) {
+ const includeLabels = config.find((x) => x.alias === 'includeLabels');
+ if (includeLabels) this._includeLabels = includeLabels.value;
+
+ const colorSwatches = config.find((x) => x.alias === 'colors');
+ if (colorSwatches) this._colorSwatches = colorSwatches.value;
+ }
+
+ private _onChange(event: UUIColorSwatchesEvent) {
+ this.value = event.target.value;
+ this.dispatchEvent(new CustomEvent('property-value-change'));
+ }
render() {
- return html`umb-property-editor-ui-color-picker
`;
+ return html``;
}
}
diff --git a/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts b/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts
index 42a01d4448..8ad1e00d87 100644
--- a/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts
+++ b/src/Umbraco.Web.UI.Client/src/backoffice/shared/property-editors/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts
@@ -1,7 +1,10 @@
import { html } from 'lit';
-import { customElement, property } from 'lit/decorators.js';
+import { customElement, property, state } from 'lit/decorators.js';
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
+import { UUIColorPickerChangeEvent } from '@umbraco-ui/uui';
import { UmbLitElement } from '@umbraco-cms/element';
+import '../../../components/eye-dropper/eye-dropper.element';
+import type { DataTypePropertyData } from '@umbraco-cms/models';
/**
* @element umb-property-editor-ui-eye-dropper
@@ -13,11 +16,31 @@ export class UmbPropertyEditorUIEyeDropperElement extends UmbLitElement {
@property()
value = '';
+ @state()
+ private _opacity = false;
+
+ @state()
+ private _swatches: string[] = [];
+
@property({ type: Array, attribute: false })
- public config = [];
+ public set config(config: Array) {
+ const showAlpha = config.find((x) => x.alias === 'showAlpha');
+ if (showAlpha) this._opacity = showAlpha.value;
+
+ const colorSwatches = config.find((x) => x.alias === 'palette');
+ if (colorSwatches) this._swatches = colorSwatches.value;
+ }
+
+ private _onChange(event: UUIColorPickerChangeEvent) {
+ this.value = event.target.value;
+ this.dispatchEvent(new CustomEvent('property-value-change'));
+ }
render() {
- return html`umb-property-editor-ui-eye-dropper
`;
+ return html``;
}
}
diff --git a/src/Umbraco.Web.UI.Client/src/core/mocks/data/data-type.data.ts b/src/Umbraco.Web.UI.Client/src/core/mocks/data/data-type.data.ts
index 27cf44c484..18620770db 100644
--- a/src/Umbraco.Web.UI.Client/src/core/mocks/data/data-type.data.ts
+++ b/src/Umbraco.Web.UI.Client/src/core/mocks/data/data-type.data.ts
@@ -59,7 +59,16 @@ export const data: Array = [
isFolder: false,
propertyEditorModelAlias: 'Umbraco.ColorPicker',
propertyEditorUIAlias: 'Umb.PropertyEditorUI.ColorPicker',
- data: [],
+ data: [
+ {
+ alias: 'includeLabels',
+ value: false,
+ },
+ {
+ alias: 'colors',
+ value: ['#000000', '#373737', '#9e9e9e', '#607d8b', '#2196f3', '#03a9f4', '#3f51b5', '#9c27b0', '#673ab7'],
+ },
+ ],
},
{
name: 'Content Picker',
@@ -90,7 +99,33 @@ export const data: Array = [
isFolder: false,
propertyEditorModelAlias: 'Umbraco.ColorPicker.EyeDropper',
propertyEditorUIAlias: 'Umb.PropertyEditorUI.EyeDropper',
- data: [],
+ data: [
+ {
+ alias: 'palette',
+ value: [
+ '#d0021b',
+ '#f5a623',
+ '#f8e71c',
+ '#8b572a',
+ '#7ed321',
+ '#417505',
+ '#bd10e0',
+ '#9013fe',
+ '#4a90e2',
+ '#50e3c2',
+ '#b8e986',
+ '#000',
+ '#444',
+ '#888',
+ '#ccc',
+ '#fff',
+ ],
+ },
+ {
+ alias: 'showAlpha',
+ value: false,
+ },
+ ],
},
{
name: 'Multi URL Picker',