From 8dea305e95efdda7b4464a992f27f4a1b1d33ff1 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Tue, 19 Mar 2024 09:39:39 +0000 Subject: [PATCH] =?UTF-8?q?EyeDropper:=20=E2=80=9CshowPalette=E2=80=9D=20c?= =?UTF-8?q?onfig=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The “showPalette” configuration isn’t wired up correctly. Also there’s a disconnect between “showPalette” and the default value for “swatches”. I've added temporary values for the swatch colors. (Hex values have been taken from the UUI Library example) --- .../property-editor-ui-eye-dropper.element.ts | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts index 0ee2525262..e73ae03ea6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/core/property-editor/uis/eye-dropper/property-editor-ui-eye-dropper.element.ts @@ -22,9 +22,30 @@ export class UmbPropertyEditorUIEyeDropperElement extends UmbLitElement implemen private _swatches: string[] = []; public set config(config: UmbPropertyEditorConfigCollection | undefined) { - if (config) { - this._opacity = config.getValueByAlias('showAlpha') ?? this.#defaultOpacity; - this._swatches = config.getValueByAlias('palette') ?? []; + this._opacity = config?.getValueByAlias('showAlpha') ?? this.#defaultOpacity; + + const showPalette = config?.getValueByAlias('showPalette') ?? false; + + if (showPalette) { + // TODO: This is a temporary solution until we have a proper way to get the palette from the config. [LK] + this._swatches = [ + '#d0021b', + '#f5a623', + '#f8e71c', + '#8b572a', + '#7ed321', + '#417505', + '#bd10e0', + '#9013fe', + '#4a90e2', + '#50e3c2', + '#b8e986', + '#000', + '#444', + '#888', + '#ccc', + '#fff', + ]; } }