@umbraco-ui/uui-color-picker 1.2.0-rc.0 → 1.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +17 -11
- package/lib/uui-color-picker.element.d.ts +1 -0
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement, html, css } from 'lit';
|
|
1
|
+
import { LitElement, html, nothing, css } from 'lit';
|
|
2
2
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
3
3
|
import { query, state, property } from 'lit/decorators.js';
|
|
4
4
|
import { classMap } from 'lit/directives/class-map.js';
|
|
@@ -328,19 +328,24 @@ let UUIColorPickerElement = class extends LabelMixin("label", LitElement) {
|
|
|
328
328
|
</uui-button>` : ""}
|
|
329
329
|
</uui-button-group>
|
|
330
330
|
</div>
|
|
331
|
-
|
|
332
|
-
id="swatches"
|
|
333
|
-
class="color-picker__swatches"
|
|
334
|
-
@change=${this.handleColorSwatchChange}>
|
|
335
|
-
${this.swatches.map(
|
|
336
|
-
(swatch) => html`<uui-color-swatch
|
|
337
|
-
label="${swatch}"
|
|
338
|
-
.value=${swatch}></uui-color-swatch>`
|
|
339
|
-
)}
|
|
340
|
-
</uui-color-swatches>
|
|
331
|
+
${this._renderSwatches()}
|
|
341
332
|
</div>
|
|
342
333
|
`;
|
|
343
334
|
}
|
|
335
|
+
_renderSwatches() {
|
|
336
|
+
if (!this.swatches)
|
|
337
|
+
return nothing;
|
|
338
|
+
return html`<uui-color-swatches
|
|
339
|
+
id="swatches"
|
|
340
|
+
class="color-picker__swatches"
|
|
341
|
+
@change=${this.handleColorSwatchChange}>
|
|
342
|
+
${this.swatches.map(
|
|
343
|
+
(swatch) => html`<uui-color-swatch
|
|
344
|
+
label="${swatch}"
|
|
345
|
+
.value=${swatch}></uui-color-swatch>`
|
|
346
|
+
)}
|
|
347
|
+
</uui-color-swatches>`;
|
|
348
|
+
}
|
|
344
349
|
_renderPreviewButton() {
|
|
345
350
|
return html`<button
|
|
346
351
|
type="button"
|
|
@@ -483,6 +488,7 @@ UUIColorPickerElement.styles = [
|
|
|
483
488
|
|
|
484
489
|
uui-color-swatches {
|
|
485
490
|
border-top: solid 1px #d4d4d8;
|
|
491
|
+
padding: 0.75rem;
|
|
486
492
|
}
|
|
487
493
|
|
|
488
494
|
button[slot='trigger'] {
|
|
@@ -115,6 +115,7 @@ export declare class UUIColorPickerElement extends UUIColorPickerElement_base {
|
|
|
115
115
|
setLetterCase(string: string): string;
|
|
116
116
|
private _syncValues;
|
|
117
117
|
private _renderColorPicker;
|
|
118
|
+
private _renderSwatches;
|
|
118
119
|
private _renderPreviewButton;
|
|
119
120
|
render(): import("lit-html").TemplateResult<1>;
|
|
120
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-color-picker",
|
|
3
|
-
"version": "1.2.0-rc.
|
|
3
|
+
"version": "1.2.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.2.0-rc.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.2.0-rc.1",
|
|
34
34
|
"colord": "^2.9.3"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"access": "public"
|
|
43
43
|
},
|
|
44
44
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-color-picker",
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c85fbce0370213590f8b60119ac39f0473ffa0fb"
|
|
46
46
|
}
|