Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ import type { UUIColorSwatchesEvent } from '@umbraco-cms/backoffice/external/uui
*/
@customElement('umb-input-color')
export class UmbInputColorElement extends UUIFormControlMixin(UmbLitElement, '') {
/**
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
* @type {boolean}
* @attr
* @default false
*/
@property({ type: Boolean, reflect: true })
readonly = false;

protected override getFormElement() {
return undefined;
}
Expand Down
1 change: 1 addition & 0 deletions src/packages/property-editors/color-picker/manifests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const manifests: Array<UmbExtensionManifest> = [
propertyEditorSchemaAlias: 'Umbraco.ColorPicker',
icon: 'icon-colorpicker',
group: 'pickers',
supportsReadOnly: true,
},
},
schemaManifest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ export class UmbPropertyEditorUIColorPickerElement extends UmbLitElement impleme
}
#value?: UmbSwatchDetails | undefined;

/**
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
* @type {boolean}
* @attr
* @default false
*/
@property({ type: Boolean, reflect: true })
readonly = false;

@state()
private _showLabels = this.#defaultShowLabels;

Expand Down Expand Up @@ -59,7 +68,8 @@ export class UmbPropertyEditorUIColorPickerElement extends UmbLitElement impleme
value=${this.value?.value ?? ''}
.swatches=${this._swatches}
?showLabels=${this._showLabels}
@change=${this.#onChange}></umb-input-color>`;
@change=${this.#onChange}
?readonly=${this.readonly}></umb-input-color>`;
}
}

Expand Down