@umbraco-ui/uui-color-swatch 1.12.1 → 1.13.0-rc.0
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 -0
- package/lib/uui-color-swatch.element.d.ts +2 -0
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
2
2
|
import { property } from 'lit/decorators.js';
|
|
3
3
|
import { LitElement, html, nothing, css } from 'lit';
|
|
4
|
+
import { ref } from 'lit/directives/ref.js';
|
|
4
5
|
import { iconCheck } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
|
|
5
6
|
import { LabelMixin, SelectableMixin, ActiveMixin } from '@umbraco-ui/uui-base/lib/mixins';
|
|
6
7
|
|
|
7
8
|
var __defProp = Object.defineProperty;
|
|
8
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __typeError = (msg) => {
|
|
11
|
+
throw TypeError(msg);
|
|
12
|
+
};
|
|
9
13
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
10
14
|
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
11
15
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
@@ -14,12 +18,17 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
14
18
|
if (kind && result) __defProp(target, key, result);
|
|
15
19
|
return result;
|
|
16
20
|
};
|
|
21
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
22
|
+
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
23
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
24
|
+
var _UUIColorSwatchElement_instances, selectButtonChanged_fn;
|
|
17
25
|
let UUIColorSwatchElement = class extends LabelMixin(
|
|
18
26
|
"label",
|
|
19
27
|
SelectableMixin(ActiveMixin(LitElement))
|
|
20
28
|
) {
|
|
21
29
|
constructor() {
|
|
22
30
|
super();
|
|
31
|
+
__privateAdd(this, _UUIColorSwatchElement_instances);
|
|
23
32
|
this.disabled = false;
|
|
24
33
|
this.readonly = false;
|
|
25
34
|
this.showLabel = false;
|
|
@@ -59,10 +68,14 @@ let UUIColorSwatchElement = class extends LabelMixin(
|
|
|
59
68
|
this._setAriaAttributes();
|
|
60
69
|
}
|
|
61
70
|
}
|
|
71
|
+
focus(options) {
|
|
72
|
+
this.selectableTarget?.focus(options);
|
|
73
|
+
}
|
|
62
74
|
render() {
|
|
63
75
|
return html`
|
|
64
76
|
<button
|
|
65
77
|
id="swatch"
|
|
78
|
+
${ref(__privateMethod(this, _UUIColorSwatchElement_instances, selectButtonChanged_fn))}
|
|
66
79
|
aria-label=${this.label}
|
|
67
80
|
?disabled="${this.disabled}"
|
|
68
81
|
title="${this.label}">
|
|
@@ -88,6 +101,10 @@ let UUIColorSwatchElement = class extends LabelMixin(
|
|
|
88
101
|
</div>`;
|
|
89
102
|
}
|
|
90
103
|
};
|
|
104
|
+
_UUIColorSwatchElement_instances = new WeakSet();
|
|
105
|
+
selectButtonChanged_fn = function(button) {
|
|
106
|
+
this.selectableTarget = button || this;
|
|
107
|
+
};
|
|
91
108
|
UUIColorSwatchElement.styles = [
|
|
92
109
|
css`
|
|
93
110
|
:host {
|
|
@@ -10,6 +10,7 @@ declare const UUIColorSwatchElement_base: (new (...args: any[]) => import("@umbr
|
|
|
10
10
|
* @slot label - Default slot for the label.
|
|
11
11
|
*/
|
|
12
12
|
export declare class UUIColorSwatchElement extends UUIColorSwatchElement_base {
|
|
13
|
+
#private;
|
|
13
14
|
/**
|
|
14
15
|
* Value of the swatch. This will become the color value if color is left undefined, see the property `color` for more details.
|
|
15
16
|
*/
|
|
@@ -47,6 +48,7 @@ export declare class UUIColorSwatchElement extends UUIColorSwatchElement_base {
|
|
|
47
48
|
private _setAriaAttributes;
|
|
48
49
|
firstUpdated(): void;
|
|
49
50
|
willUpdate(changedProperties: Map<string, any>): void;
|
|
51
|
+
focus(options?: FocusOptions | undefined): void;
|
|
50
52
|
render(): import("lit-html").TemplateResult<1>;
|
|
51
53
|
private _renderWithLabel;
|
|
52
54
|
static styles: import("lit").CSSResult[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-color-swatch",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.0-rc.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "1.
|
|
34
|
-
"@umbraco-ui/uui-icon-registry-essential": "1.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.13.0-rc.0",
|
|
34
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.13.0-rc.0",
|
|
35
35
|
"colord": "^2.9.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-color-swatch",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "864afa6c182c2a73c479237732dadc1abc69a4a0"
|
|
47
47
|
}
|