From b3a4bb42d2fe08f81b5ff6c890caec0a32630967 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 22 Aug 2024 08:47:44 +0200 Subject: [PATCH 1/3] Update manifests.ts --- src/packages/property-editors/checkbox-list/manifests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/packages/property-editors/checkbox-list/manifests.ts b/src/packages/property-editors/checkbox-list/manifests.ts index d88679601a..768e35ff23 100644 --- a/src/packages/property-editors/checkbox-list/manifests.ts +++ b/src/packages/property-editors/checkbox-list/manifests.ts @@ -12,6 +12,7 @@ export const manifests: Array = [ propertyEditorSchemaAlias: 'Umbraco.CheckBoxList', icon: 'icon-bulleted-list', group: 'lists', + supportsReadOnly: true, settings: { properties: [ { From 92296617bde3cb137f9b2b6bd8cc22de13d7362f Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 22 Aug 2024 08:47:56 +0200 Subject: [PATCH 2/3] pass readonly to input --- .../property-editor-ui-checkbox-list.element.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.element.ts b/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.element.ts index 0eb81cc05c..45d99914cb 100644 --- a/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.element.ts +++ b/src/packages/property-editors/checkbox-list/property-editor-ui-checkbox-list.element.ts @@ -39,6 +39,15 @@ export class UmbPropertyEditorUICheckboxListElement extends UmbLitElement implem } } + /** + * 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 _list: UmbInputCheckboxListElement['list'] = []; @@ -52,6 +61,7 @@ export class UmbPropertyEditorUICheckboxListElement extends UmbLitElement implem `; } From 1c9a7b40d2bcbcb5a863f553c95ec3b8fa5fcb8e Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 22 Aug 2024 08:51:47 +0200 Subject: [PATCH 3/3] pass readonly to uui-checkbox --- .../input-checkbox-list.element.ts | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/packages/property-editors/checkbox-list/components/input-checkbox-list/input-checkbox-list.element.ts b/src/packages/property-editors/checkbox-list/components/input-checkbox-list/input-checkbox-list.element.ts index eba6f09baf..14ee1cf435 100644 --- a/src/packages/property-editors/checkbox-list/components/input-checkbox-list/input-checkbox-list.element.ts +++ b/src/packages/property-editors/checkbox-list/components/input-checkbox-list/input-checkbox-list.element.ts @@ -29,6 +29,15 @@ export class UmbInputCheckboxListElement extends UUIFormControlMixin(UmbLitEleme return this.selection.join(','); } + /** + * 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; } @@ -64,7 +73,11 @@ export class UmbInputCheckboxListElement extends UUIFormControlMixin(UmbLitEleme } #renderCheckbox(item: (typeof this.list)[0]) { - return html``; + return html``; } static override styles = [