From 71c54a35143c1ba9952498ea1f66607e4523e25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 16 Oct 2023 14:50:40 +0200 Subject: [PATCH] style format --- .../lib/uui-color-picker.element.ts | 72 +++++++++---------- .../lib/uui-color-swatches.element.ts | 21 +++--- 2 files changed, 46 insertions(+), 47 deletions(-) diff --git a/packages/uui-color-picker/lib/uui-color-picker.element.ts b/packages/uui-color-picker/lib/uui-color-picker.element.ts index b07587bda..5929b94f8 100644 --- a/packages/uui-color-picker/lib/uui-color-picker.element.ts +++ b/packages/uui-color-picker/lib/uui-color-picker.element.ts @@ -498,7 +498,7 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) { closeColorPicker(event: Event) { const target = event.target as UUIPopoverElement; - const trigger = target.querySelector("button[part=trigger]"); + const trigger = target.querySelector('button[part=trigger]'); if (trigger) { trigger.setAttribute('aria-expanded', 'false'); @@ -617,13 +617,13 @@ export class UUIColorPickerElement extends LabelMixin('label', LitElement) { ${!this.noFormatToggle ? html` - ${this.format} - ` + label="Toggle color format" + @click=${this.handleFormatToggle} + class="color-picker__toggle-format" + ?disabled=${this.disabled} + compact> + ${this.format} + ` : ''} ${hasEyeDropper ? html` ${this.swatches.map( swatch => - html` + html` ` )} `; } private _renderPreviewButton() { - return html` - -
${this._renderColorPicker()}
-
`; + return html` + +
${this._renderColorPicker()}
+
`; } render() { diff --git a/packages/uui-color-swatches/lib/uui-color-swatches.element.ts b/packages/uui-color-swatches/lib/uui-color-swatches.element.ts index 856994d5c..7e72f5c74 100644 --- a/packages/uui-color-swatches/lib/uui-color-swatches.element.ts +++ b/packages/uui-color-swatches/lib/uui-color-swatches.element.ts @@ -35,13 +35,13 @@ export class UUIColorSwatchesElement extends LabelMixin('label', LitElement) { @property() value = ''; - /** - * Disables the color swatches. - * @type {boolean} - * @attr - * @default false - **/ - @property({ type: Boolean, reflect: true }) disabled = false; + /** + * Disables the color swatches. + * @type {boolean} + * @attr + * @default false + **/ + @property({ type: Boolean, reflect: true }) disabled = false; @queryAssignedElements({ selector: 'uui-color-swatch' }) swatches!: Array; @@ -90,9 +90,8 @@ export class UUIColorSwatchesElement extends LabelMixin('label', LitElement) { swatch.setAttribute('role', 'radio'); if (this.disabled) { - swatch.setAttribute('disabled', '') - } - else { + swatch.setAttribute('disabled', ''); + } else { // For some reason the value it really wants the attribute to be set not the value. If value is set then it is not reflected properly. :cry: swatch.setAttribute('selectable', 'selectable'); } @@ -141,7 +140,7 @@ export class UUIColorSwatchesElement extends LabelMixin('label', LitElement) { ); } }; - + /** * Deselects all swatches. *