@luzmo/lucero 1.0.1-alpha.15 → 1.0.1-alpha.17
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/components/accordion/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +155 -131
- package/components/tooltip/tooltip.d.ts +1 -12
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-BbVqNU-g.js +0 -53
- package/components/clear-button-DYdeFsS8.cjs +0 -18
- package/components/close-button-CpfKibqg.cjs +0 -18
- package/components/close-button-DzOZZmkY.js +0 -51
- package/components/color-controller-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-BQoI8AD3.cjs +0 -113
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cb9zsiz6.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-D47EGj-3.cjs +0 -29
- package/components/luzmo-icons-NEyaMpEM.js +0 -229
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-CaH1si5b.cjs +0 -26
- package/components/picker-CAYj4hBD.js +0 -461
- package/components/picker-apS0Zrly.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-BYF2RHY8.cjs +0 -85
- package/components/text-field-PYafEYeO.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -15,4 +15,588 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
"use strict";
|
|
18
|
+
"use strict";
|
|
19
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
20
|
+
const tinycolor = require("@ctrl/tinycolor");
|
|
21
|
+
const lit = require("lit");
|
|
22
|
+
const decorators_js = require("lit/decorators.js");
|
|
23
|
+
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
24
|
+
const styleMap_js = require("lit/directives/style-map.js");
|
|
25
|
+
require("../color-handle/index.cjs");
|
|
26
|
+
const focusable = require("../focusable-BPrTcZPd.cjs");
|
|
27
|
+
const languageResolution = require("../language-resolution-iN9EImbb.cjs");
|
|
28
|
+
const streamingListener = require("../streaming-listener-D4sHaMub.cjs");
|
|
29
|
+
const extractHueAndSaturationRegExp = /^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/;
|
|
30
|
+
const replaceHueAndSaturationRegExp = /(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/;
|
|
31
|
+
const replaceHueRegExp = /(^hs[v|l]a?\()\d{1,3}/;
|
|
32
|
+
const getHexValue = (color, isString) => isString ? color.toHexString() : color.toHex();
|
|
33
|
+
class ColorController {
|
|
34
|
+
constructor(host, {
|
|
35
|
+
applyColorToState,
|
|
36
|
+
extractColorFromState,
|
|
37
|
+
maintains
|
|
38
|
+
}) {
|
|
39
|
+
this.maintains = "hue";
|
|
40
|
+
this._hue = 0;
|
|
41
|
+
this._opacity = 1;
|
|
42
|
+
this.getColorProcesses = {
|
|
43
|
+
rgb: (color, isString) => isString ? color.toRgbString() : color.toRgb(),
|
|
44
|
+
prgb: (color, isString) => isString ? color.toPercentageRgbString() : color.toPercentageRgb(),
|
|
45
|
+
hex8: (color, isString) => isString ? color.toHex8String() : color.toHex8(),
|
|
46
|
+
name: (color) => color.toName() || color.toRgbString(),
|
|
47
|
+
hsl: (color, isString) => {
|
|
48
|
+
if (this.maintains === "hue") {
|
|
49
|
+
if (isString) {
|
|
50
|
+
const hslString = color.toHslString();
|
|
51
|
+
return hslString.replace(replaceHueRegExp, `$1${this.hue}`);
|
|
52
|
+
}
|
|
53
|
+
const { s: s2, l: l2, a: a2 } = color.toHsl();
|
|
54
|
+
return { h: this.hue, s: s2, l: l2, a: a2 };
|
|
55
|
+
}
|
|
56
|
+
if (isString) {
|
|
57
|
+
const hslString = color.toHslString();
|
|
58
|
+
return hslString.replace(
|
|
59
|
+
replaceHueAndSaturationRegExp,
|
|
60
|
+
`$1${this.hue}$2${this.saturation}`
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
const { s, l, a } = color.toHsl();
|
|
64
|
+
return { h: this.hue, s, l, a };
|
|
65
|
+
},
|
|
66
|
+
hsv: (color, isString) => {
|
|
67
|
+
if (this.maintains === "hue") {
|
|
68
|
+
if (isString) {
|
|
69
|
+
const hsvString = color.toHsvString();
|
|
70
|
+
return hsvString.replace(replaceHueRegExp, `$1${this.hue}`);
|
|
71
|
+
}
|
|
72
|
+
const { s: s2, v: v2, a: a2 } = color.toHsv();
|
|
73
|
+
return { h: this.hue, s: s2, v: v2, a: a2 };
|
|
74
|
+
}
|
|
75
|
+
if (isString) {
|
|
76
|
+
const hsvString = color.toHsvString();
|
|
77
|
+
return hsvString.replace(
|
|
78
|
+
replaceHueAndSaturationRegExp,
|
|
79
|
+
`$1${this.hue}$2${this.saturation}`
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const { s, v, a } = color.toHsv();
|
|
83
|
+
return { h: this.hue, s, v, a };
|
|
84
|
+
},
|
|
85
|
+
hex: getHexValue,
|
|
86
|
+
hex3: getHexValue,
|
|
87
|
+
hex4: getHexValue,
|
|
88
|
+
hex6: getHexValue
|
|
89
|
+
};
|
|
90
|
+
this._color = new tinycolor.TinyColor({ h: 0, s: 1, v: 1 });
|
|
91
|
+
this._previousColor = new tinycolor.TinyColor({ h: 0, s: 1, v: 1 });
|
|
92
|
+
this._format = {
|
|
93
|
+
format: "",
|
|
94
|
+
isString: false
|
|
95
|
+
};
|
|
96
|
+
this.host = host;
|
|
97
|
+
this.applyColorToState = applyColorToState;
|
|
98
|
+
this.extractColorFromState = extractColorFromState;
|
|
99
|
+
this.maintains = maintains || this.maintains;
|
|
100
|
+
}
|
|
101
|
+
setColorProcess(currentColor, nextColor, format, isString) {
|
|
102
|
+
if (this.maintains === "hue") {
|
|
103
|
+
this.setColorMaintainHue(currentColor, nextColor, format, isString);
|
|
104
|
+
} else if (this.maintains === "saturation") {
|
|
105
|
+
this.setColorMaintainSaturation(
|
|
106
|
+
currentColor,
|
|
107
|
+
nextColor,
|
|
108
|
+
format,
|
|
109
|
+
isString
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
setColorMaintainHue(currentColor, nextColor, format, isString) {
|
|
114
|
+
const { h, s, v, a } = this._color.toHsv();
|
|
115
|
+
let originalHue;
|
|
116
|
+
if (isString && format.startsWith("hs")) {
|
|
117
|
+
const values = extractHueAndSaturationRegExp.exec(nextColor);
|
|
118
|
+
if (values !== null) {
|
|
119
|
+
const [, h2] = values;
|
|
120
|
+
originalHue = Number(h2);
|
|
121
|
+
}
|
|
122
|
+
} else if (!isString && format.startsWith("hs")) {
|
|
123
|
+
const colorInput = currentColor.originalInput;
|
|
124
|
+
const colorValues = Object.values(colorInput);
|
|
125
|
+
originalHue = colorValues[0];
|
|
126
|
+
}
|
|
127
|
+
this.hue = originalHue || h;
|
|
128
|
+
this.opacity = a ?? 1;
|
|
129
|
+
this.applyColorToState({ h, s, v, a });
|
|
130
|
+
}
|
|
131
|
+
setColorMaintainSaturation(currentColor, nextColor, format, isString) {
|
|
132
|
+
const { a } = this._color.toHsv();
|
|
133
|
+
if (isString && format.startsWith("hs")) {
|
|
134
|
+
const values = extractHueAndSaturationRegExp.exec(nextColor);
|
|
135
|
+
if (values !== null) {
|
|
136
|
+
const [, h, s] = values;
|
|
137
|
+
this.hue = Number(h);
|
|
138
|
+
this.saturation = Number(s);
|
|
139
|
+
}
|
|
140
|
+
} else if (!isString && format.startsWith("hs")) {
|
|
141
|
+
const colorInput = currentColor.originalInput;
|
|
142
|
+
const colorValues = Object.values(colorInput);
|
|
143
|
+
this.hue = colorValues[0];
|
|
144
|
+
this.saturation = colorValues[1];
|
|
145
|
+
} else {
|
|
146
|
+
const { h } = currentColor.toHsv();
|
|
147
|
+
this.hue = h;
|
|
148
|
+
}
|
|
149
|
+
this.opacity = a ?? 1;
|
|
150
|
+
this.applyColorToState(currentColor.toHsv());
|
|
151
|
+
}
|
|
152
|
+
applyColorFromState() {
|
|
153
|
+
this._color = new tinycolor.TinyColor(this.extractColorFromState(this));
|
|
154
|
+
}
|
|
155
|
+
get hue() {
|
|
156
|
+
return this._hue;
|
|
157
|
+
}
|
|
158
|
+
set hue(value) {
|
|
159
|
+
const hue = Math.min(360, Math.max(0, value));
|
|
160
|
+
if (hue === this.hue) {
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
const oldValue = this.hue;
|
|
164
|
+
const { s, v, a } = this._color.toHsv();
|
|
165
|
+
this._color = new tinycolor.TinyColor({ h: hue, s, v, a });
|
|
166
|
+
this._hue = hue;
|
|
167
|
+
this.host.requestUpdate("hue", oldValue);
|
|
168
|
+
}
|
|
169
|
+
get opacity() {
|
|
170
|
+
return this._opacity;
|
|
171
|
+
}
|
|
172
|
+
set opacity(value) {
|
|
173
|
+
const opacity = Math.min(1, Math.max(0, value));
|
|
174
|
+
if (opacity === this.opacity) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
const oldValue = this.opacity;
|
|
178
|
+
const { h, s, v } = this._color.toHsv();
|
|
179
|
+
this._color = new tinycolor.TinyColor({ h, s, v, a: opacity });
|
|
180
|
+
this._opacity = opacity;
|
|
181
|
+
this.host.requestUpdate("opacity", oldValue);
|
|
182
|
+
}
|
|
183
|
+
/* c8 ignore next 3 */
|
|
184
|
+
get value() {
|
|
185
|
+
return this.color;
|
|
186
|
+
}
|
|
187
|
+
get color() {
|
|
188
|
+
return this.getColorProcesses[this._format.format || "hex"](
|
|
189
|
+
this._color,
|
|
190
|
+
this._format.isString
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
set color(color) {
|
|
194
|
+
if (color === this.color) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const oldValue = this._color;
|
|
198
|
+
this._color = new tinycolor.TinyColor(color);
|
|
199
|
+
const format = this._color.format;
|
|
200
|
+
let isString = typeof color === "string" || color instanceof String;
|
|
201
|
+
if (format.startsWith("hex")) {
|
|
202
|
+
isString = color.startsWith("#");
|
|
203
|
+
}
|
|
204
|
+
this._format = {
|
|
205
|
+
format,
|
|
206
|
+
isString
|
|
207
|
+
};
|
|
208
|
+
this.setColorProcess(this._color, color, format, isString);
|
|
209
|
+
this.host.requestUpdate("color", oldValue);
|
|
210
|
+
}
|
|
211
|
+
getColor(format) {
|
|
212
|
+
const formatOptions = {
|
|
213
|
+
hsl: "toHsl"
|
|
214
|
+
};
|
|
215
|
+
return this._color[formatOptions[format]]();
|
|
216
|
+
}
|
|
217
|
+
setColor(color) {
|
|
218
|
+
this._color = color;
|
|
219
|
+
const isString = typeof this._color.originalInput === "string" || this._color.originalInput instanceof String;
|
|
220
|
+
this.setColorProcess(this._color, color, this._color.format, isString);
|
|
221
|
+
}
|
|
222
|
+
getHslString() {
|
|
223
|
+
return this._color.toHslString();
|
|
224
|
+
}
|
|
225
|
+
savePreviousColor() {
|
|
226
|
+
this._previousColor = this._color.clone();
|
|
227
|
+
}
|
|
228
|
+
restorePreviousColor() {
|
|
229
|
+
this.setColor(this._previousColor);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
const styles = '.opacity-checkerboard{position:absolute;block-size:100%;inline-size:100%;background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}:host{--luzmo-color-slider-gradient-fallback: rgb(255 0 0) 0%, rgb(255 255 0) 17%, rgb(0 255 0) 33%, rgb(0 255 255) 50%, rgb(0 0 255) 67%, rgb(255 0 255) 83%, rgb(255 0 0) 100%;touch-action:none}:host([vertical]) .handle{inset-block-start:unset;inset-block-end:0}:host([vertical]) .slider{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){width:100%;height:100%}@media (forced-colors: active){:host{--highcontrast-color-slider-border-color: CanvasText;--highcontrast-color-slider-border-color-disabled: GrayText;--highcontrast-color-slider-background-color-disabled: Canvas;forced-color-adjust:none}}:host{--luzmo-color-handle-hitarea-border-radius: var( --luzmo-color-slider-handle-hitarea-border-radius, 0px );min-inline-size:var(--luzmo-color-slider-minimum-length, 80px);inline-size:var(--luzmo-color-slider-length, 192px);block-size:var(--luzmo-color-slider-control-track-width, 24px);-webkit-user-select:none;user-select:none;cursor:default;display:block;position:relative}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([disabled]) .gradient{display:none}:host([vertical]){min-block-size:var(--luzmo-color-slider-vertical-minimum-height, var(--luzmo-color-slider-minimum-length, 80px));block-size:var(--luzmo-color-slider-vertical-height, var(--luzmo-color-slider-length, 192px));min-inline-size:0;inline-size:var(--luzmo-color-slider-vertical-control-track-width, var(--luzmo-color-slider-control-track-height, 24px));display:inline-block}:host([vertical]) .handle{inset-inline-start:50%}.handle{inset-block-start:50%;inset-inline-start:0}.checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color, var(--luzmo-color-slider-border-color, var(--luzmo-border-color)) )}.checkerboard:before{content:"";z-index:1;box-shadow:inset 0 0 0 var(--luzmo-color-slider-border-width, var(--luzmo-border-width)) var(--luzmo-color-slider-border-color-local);border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s));position:absolute;top:0;right:0;bottom:0;left:0}:host([disabled]) .checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color-disabled, var(--luzmo-color-slider-border-color-disabled, var(--luzmo-dimmed-color)) );background:var(--highcontrast-color-slider-background-color-disabled, var(--luzmo-color-slider-background-color-disabled, var(--luzmo-dimmed-color)))}.checkerboard,.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s))}.gradient:dir(rtl),:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}';
|
|
233
|
+
var __defProp = Object.defineProperty;
|
|
234
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
235
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
236
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
237
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
238
|
+
if (decorator = decorators[i])
|
|
239
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
240
|
+
if (kind && result) __defProp(target, key, result);
|
|
241
|
+
return result;
|
|
242
|
+
};
|
|
243
|
+
class LuzmoColorSlider extends focusable.Focusable {
|
|
244
|
+
constructor() {
|
|
245
|
+
super(...arguments);
|
|
246
|
+
this.disabled = false;
|
|
247
|
+
this.focused = false;
|
|
248
|
+
this.label = "hue";
|
|
249
|
+
this.vertical = false;
|
|
250
|
+
this.languageResolver = new languageResolution.LanguageResolutionController(this);
|
|
251
|
+
this.colorController = new ColorController(this, {
|
|
252
|
+
/* c8 ignore next 3 */
|
|
253
|
+
applyColorToState: () => {
|
|
254
|
+
if (this.mode === "opacity") {
|
|
255
|
+
const color = new tinycolor.TinyColor(this.colorController.color);
|
|
256
|
+
this.sliderHandlePosition = 100 * color.getAlpha();
|
|
257
|
+
} else {
|
|
258
|
+
this.sliderHandlePosition = 100 * (this.colorController.hue / 360);
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
extractColorFromState: (controller) => {
|
|
262
|
+
if (this.mode === "opacity") {
|
|
263
|
+
return {
|
|
264
|
+
...controller.getColor("hsl"),
|
|
265
|
+
a: this.value
|
|
266
|
+
};
|
|
267
|
+
}
|
|
268
|
+
return {
|
|
269
|
+
...controller.getColor("hsl"),
|
|
270
|
+
h: this.value
|
|
271
|
+
};
|
|
272
|
+
},
|
|
273
|
+
maintains: "saturation"
|
|
274
|
+
});
|
|
275
|
+
this.sliderHandlePosition = 0;
|
|
276
|
+
this.step = 1;
|
|
277
|
+
this.isLTR = true;
|
|
278
|
+
this._altered = 0;
|
|
279
|
+
this._pointerDown = false;
|
|
280
|
+
}
|
|
281
|
+
static get styles() {
|
|
282
|
+
return [lit.unsafeCSS(styles)];
|
|
283
|
+
}
|
|
284
|
+
get value() {
|
|
285
|
+
if (this.mode === "opacity") {
|
|
286
|
+
return this.colorController.opacity;
|
|
287
|
+
}
|
|
288
|
+
return this.colorController.hue;
|
|
289
|
+
}
|
|
290
|
+
set value(value) {
|
|
291
|
+
if (this.mode === "opacity") {
|
|
292
|
+
this.colorController.opacity = value;
|
|
293
|
+
} else {
|
|
294
|
+
this.colorController.hue = value;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
get color() {
|
|
298
|
+
return this.colorController.color;
|
|
299
|
+
}
|
|
300
|
+
set color(color) {
|
|
301
|
+
this.colorController.color = color;
|
|
302
|
+
}
|
|
303
|
+
get altered() {
|
|
304
|
+
return this._altered;
|
|
305
|
+
}
|
|
306
|
+
set altered(altered) {
|
|
307
|
+
this._altered = altered;
|
|
308
|
+
this.step = Math.max(1, this.altered * 10);
|
|
309
|
+
}
|
|
310
|
+
get focusElement() {
|
|
311
|
+
return this.input;
|
|
312
|
+
}
|
|
313
|
+
handleKeydown(event) {
|
|
314
|
+
const { key } = event;
|
|
315
|
+
this.focused = true;
|
|
316
|
+
this.altered = [event.shiftKey, event.ctrlKey, event.altKey].filter(
|
|
317
|
+
(_key) => !!_key
|
|
318
|
+
).length;
|
|
319
|
+
let delta = 0;
|
|
320
|
+
switch (key) {
|
|
321
|
+
case "ArrowUp": {
|
|
322
|
+
delta = this.step;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
case "ArrowDown": {
|
|
326
|
+
delta = -this.step;
|
|
327
|
+
break;
|
|
328
|
+
}
|
|
329
|
+
case "ArrowLeft": {
|
|
330
|
+
delta = this.step * (this.isLTR ? -1 : 1);
|
|
331
|
+
break;
|
|
332
|
+
}
|
|
333
|
+
case "ArrowRight": {
|
|
334
|
+
delta = this.step * (this.isLTR ? 1 : -1);
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
default: {
|
|
338
|
+
return;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
event.preventDefault();
|
|
342
|
+
const range = this.mode === "opacity" ? 100 : 360;
|
|
343
|
+
const mult = 100 / range;
|
|
344
|
+
this.sliderHandlePosition = Math.min(
|
|
345
|
+
100,
|
|
346
|
+
Math.max(0, this.sliderHandlePosition + delta * mult)
|
|
347
|
+
);
|
|
348
|
+
this.value = this.mode === "opacity" ? Math.min(1, Math.max(0, this.value + delta / 100)) : Math.min(360, Math.max(0, this.value + delta));
|
|
349
|
+
this.colorController.applyColorFromState();
|
|
350
|
+
if (delta !== 0) {
|
|
351
|
+
this.dispatchEvent(
|
|
352
|
+
new Event("input", {
|
|
353
|
+
bubbles: true,
|
|
354
|
+
composed: true
|
|
355
|
+
})
|
|
356
|
+
);
|
|
357
|
+
this.dispatchEvent(
|
|
358
|
+
new Event("change", {
|
|
359
|
+
bubbles: true,
|
|
360
|
+
composed: true
|
|
361
|
+
})
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
handleInput(event) {
|
|
366
|
+
const { valueAsNumber } = event.target;
|
|
367
|
+
this.value = valueAsNumber;
|
|
368
|
+
this.sliderHandlePosition = 100 * (this.mode === "opacity" ? this.value : this.value / 360);
|
|
369
|
+
this.colorController.applyColorFromState();
|
|
370
|
+
}
|
|
371
|
+
handleChange(event) {
|
|
372
|
+
this.handleInput(event);
|
|
373
|
+
this.dispatchEvent(
|
|
374
|
+
new Event("change", {
|
|
375
|
+
bubbles: true,
|
|
376
|
+
composed: true
|
|
377
|
+
})
|
|
378
|
+
);
|
|
379
|
+
}
|
|
380
|
+
focus(focusOptions = {}) {
|
|
381
|
+
super.focus(focusOptions);
|
|
382
|
+
this.forwardFocus();
|
|
383
|
+
}
|
|
384
|
+
forwardFocus() {
|
|
385
|
+
this.input.focus();
|
|
386
|
+
}
|
|
387
|
+
handleFocus() {
|
|
388
|
+
this.focused = true;
|
|
389
|
+
}
|
|
390
|
+
handleBlur() {
|
|
391
|
+
if (this._pointerDown) {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
this.altered = 0;
|
|
395
|
+
this.focused = false;
|
|
396
|
+
}
|
|
397
|
+
handlePointerdown(event) {
|
|
398
|
+
if (event.button !== 0) {
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
this._pointerDown = true;
|
|
403
|
+
this.colorController.savePreviousColor();
|
|
404
|
+
this.boundingClientRect = this.getBoundingClientRect();
|
|
405
|
+
event.target.setPointerCapture(event.pointerId);
|
|
406
|
+
if (event.pointerType === "mouse") {
|
|
407
|
+
this.focused = true;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
handlePointermove(event) {
|
|
411
|
+
this.sliderHandlePosition = this.calculateHandlePosition(event);
|
|
412
|
+
this.value = (this.mode === "opacity" ? 1 : 360) * (this.sliderHandlePosition / 100);
|
|
413
|
+
this.colorController.applyColorFromState();
|
|
414
|
+
this.dispatchEvent(
|
|
415
|
+
new Event("input", {
|
|
416
|
+
bubbles: true,
|
|
417
|
+
composed: true,
|
|
418
|
+
cancelable: true
|
|
419
|
+
})
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
handlePointerup(event) {
|
|
423
|
+
this._pointerDown = false;
|
|
424
|
+
event.target.releasePointerCapture(event.pointerId);
|
|
425
|
+
const applyDefault = this.dispatchEvent(
|
|
426
|
+
new Event("change", {
|
|
427
|
+
bubbles: true,
|
|
428
|
+
composed: true,
|
|
429
|
+
cancelable: true
|
|
430
|
+
})
|
|
431
|
+
);
|
|
432
|
+
if (!applyDefault) {
|
|
433
|
+
this.colorController.restorePreviousColor();
|
|
434
|
+
}
|
|
435
|
+
this.focus();
|
|
436
|
+
if (event.pointerType === "mouse") {
|
|
437
|
+
this.focused = false;
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Returns the value under the cursor
|
|
442
|
+
* @param: PointerEvent on slider
|
|
443
|
+
* @return: Slider value that correlates to the position under the pointer
|
|
444
|
+
*/
|
|
445
|
+
calculateHandlePosition(event) {
|
|
446
|
+
if (!this.boundingClientRect) {
|
|
447
|
+
return this.sliderHandlePosition;
|
|
448
|
+
}
|
|
449
|
+
const rect = this.boundingClientRect;
|
|
450
|
+
const minOffset = this.vertical ? rect.top : rect.left;
|
|
451
|
+
const offset = this.vertical ? event.clientY : event.clientX;
|
|
452
|
+
const size = this.vertical ? rect.height : rect.width;
|
|
453
|
+
const percent = Math.max(0, Math.min(1, (offset - minOffset) / size));
|
|
454
|
+
const sliderHandlePosition = this.vertical || !this.isLTR ? 100 - 100 * percent : 100 * percent;
|
|
455
|
+
return sliderHandlePosition;
|
|
456
|
+
}
|
|
457
|
+
handleGradientPointerdown(event) {
|
|
458
|
+
if (event.button !== 0) {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
event.stopPropagation();
|
|
462
|
+
event.preventDefault();
|
|
463
|
+
this.handle.dispatchEvent(new PointerEvent("pointerdown", event));
|
|
464
|
+
this.handlePointermove(event);
|
|
465
|
+
}
|
|
466
|
+
get handlePositionStyles() {
|
|
467
|
+
return `${this.vertical ? "inset-block-end" : "inset-inline-start"}: ${this.sliderHandlePosition}%`;
|
|
468
|
+
}
|
|
469
|
+
get getColorSliderStyle() {
|
|
470
|
+
const orientation = this.vertical ? "top" : "right";
|
|
471
|
+
if (this.mode === "opacity") {
|
|
472
|
+
const color = new tinycolor.TinyColor(this.colorController.color).setAlpha(1).toRgbString();
|
|
473
|
+
return {
|
|
474
|
+
background: `linear-gradient(to ${orientation}, transparent, ${color})`
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
return {
|
|
478
|
+
background: `linear-gradient(to ${orientation}, var(--luzmo-color-slider-gradient, var(--luzmo-color-slider-gradient-fallback)))`
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
render() {
|
|
482
|
+
return lit.html`
|
|
483
|
+
<div
|
|
484
|
+
class="opacity-checkerboard checkerboard"
|
|
485
|
+
role="presentation"
|
|
486
|
+
@pointerdown=${this.handleGradientPointerdown}
|
|
487
|
+
>
|
|
488
|
+
<div
|
|
489
|
+
class="gradient"
|
|
490
|
+
role="presentation"
|
|
491
|
+
style=${styleMap_js.styleMap(this.getColorSliderStyle)}
|
|
492
|
+
>
|
|
493
|
+
<slot name="gradient"></slot>
|
|
494
|
+
</div>
|
|
495
|
+
</div>
|
|
496
|
+
<luzmo-color-handle
|
|
497
|
+
tabindex=${ifDefined_js.ifDefined(this.focused ? void 0 : "0")}
|
|
498
|
+
@focus=${this.forwardFocus}
|
|
499
|
+
?focused=${this.focused}
|
|
500
|
+
class="handle"
|
|
501
|
+
color=${this.mode === "opacity" ? this.color : "hsl(" + this.value + ", 100%, 50%)"}
|
|
502
|
+
?disabled=${this.disabled}
|
|
503
|
+
style=${this.handlePositionStyles}
|
|
504
|
+
${streamingListener.streamingListener({
|
|
505
|
+
start: ["pointerdown", this.handlePointerdown],
|
|
506
|
+
streamInside: ["pointermove", this.handlePointermove],
|
|
507
|
+
end: [
|
|
508
|
+
["pointerup", "pointercancel", "pointerleave"],
|
|
509
|
+
this.handlePointerup
|
|
510
|
+
]
|
|
511
|
+
})}
|
|
512
|
+
></luzmo-color-handle>
|
|
513
|
+
<input
|
|
514
|
+
type="range"
|
|
515
|
+
class="slider"
|
|
516
|
+
min="0"
|
|
517
|
+
max=${this.mode === "opacity" ? "100" : "360"}
|
|
518
|
+
aria-orientation=${ifDefined_js.ifDefined(this.vertical ? "vertical" : void 0)}
|
|
519
|
+
orient=${ifDefined_js.ifDefined(this.vertical ? "vertical" : void 0)}
|
|
520
|
+
step=${this.step}
|
|
521
|
+
aria-label=${this.label}
|
|
522
|
+
.value=${String(
|
|
523
|
+
this.mode === "opacity" ? this.value * 100 : this.value
|
|
524
|
+
)}
|
|
525
|
+
aria-valuetext=${`${new Intl.NumberFormat(
|
|
526
|
+
this.languageResolver.language,
|
|
527
|
+
{
|
|
528
|
+
maximumFractionDigits: 0,
|
|
529
|
+
minimumIntegerDigits: 1,
|
|
530
|
+
style: "unit",
|
|
531
|
+
unit: this.mode === "opacity" ? "percent" : "degree",
|
|
532
|
+
unitDisplay: "narrow"
|
|
533
|
+
}
|
|
534
|
+
).format(this.mode === "opacity" ? this.value * 100 : this.value)}`}
|
|
535
|
+
@input=${this.handleInput}
|
|
536
|
+
@change=${this.handleChange}
|
|
537
|
+
@keydown=${this.handleKeydown}
|
|
538
|
+
/>
|
|
539
|
+
`;
|
|
540
|
+
}
|
|
541
|
+
firstUpdated(changed) {
|
|
542
|
+
super.firstUpdated(changed);
|
|
543
|
+
this.boundingClientRect = this.getBoundingClientRect();
|
|
544
|
+
this.addEventListener("focus", this.handleFocus);
|
|
545
|
+
this.addEventListener("blur", this.handleBlur);
|
|
546
|
+
}
|
|
547
|
+
updated(changedProperties) {
|
|
548
|
+
if (changedProperties.has("mode")) {
|
|
549
|
+
this.handle.style.insetInlineStart = "";
|
|
550
|
+
this.handle.style.insetBlockEnd = "";
|
|
551
|
+
if (this.mode === "opacity") {
|
|
552
|
+
this.colorController.color = new tinycolor.TinyColor(
|
|
553
|
+
this.colorController.color
|
|
554
|
+
).toRgbString();
|
|
555
|
+
this.handle.style.insetInlineStart = 100 * this.colorController.opacity + "%";
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
__decorateClass([
|
|
561
|
+
decorators_js.property({ type: String, reflect: true })
|
|
562
|
+
], LuzmoColorSlider.prototype, "dir", 2);
|
|
563
|
+
__decorateClass([
|
|
564
|
+
decorators_js.property({ type: String, reflect: true })
|
|
565
|
+
], LuzmoColorSlider.prototype, "mode", 2);
|
|
566
|
+
__decorateClass([
|
|
567
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
568
|
+
], LuzmoColorSlider.prototype, "disabled", 2);
|
|
569
|
+
__decorateClass([
|
|
570
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
571
|
+
], LuzmoColorSlider.prototype, "focused", 2);
|
|
572
|
+
__decorateClass([
|
|
573
|
+
decorators_js.query(".handle")
|
|
574
|
+
], LuzmoColorSlider.prototype, "handle", 2);
|
|
575
|
+
__decorateClass([
|
|
576
|
+
decorators_js.property({ type: String })
|
|
577
|
+
], LuzmoColorSlider.prototype, "label", 2);
|
|
578
|
+
__decorateClass([
|
|
579
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
580
|
+
], LuzmoColorSlider.prototype, "vertical", 2);
|
|
581
|
+
__decorateClass([
|
|
582
|
+
decorators_js.property({ type: Number })
|
|
583
|
+
], LuzmoColorSlider.prototype, "value", 1);
|
|
584
|
+
__decorateClass([
|
|
585
|
+
decorators_js.property({ type: Number, reflect: true })
|
|
586
|
+
], LuzmoColorSlider.prototype, "sliderHandlePosition", 2);
|
|
587
|
+
__decorateClass([
|
|
588
|
+
decorators_js.property({ type: String })
|
|
589
|
+
], LuzmoColorSlider.prototype, "color", 1);
|
|
590
|
+
__decorateClass([
|
|
591
|
+
decorators_js.property({ type: Number })
|
|
592
|
+
], LuzmoColorSlider.prototype, "step", 2);
|
|
593
|
+
__decorateClass([
|
|
594
|
+
decorators_js.property({ type: Boolean, attribute: "is-ltr" })
|
|
595
|
+
], LuzmoColorSlider.prototype, "isLTR", 2);
|
|
596
|
+
__decorateClass([
|
|
597
|
+
decorators_js.query("input")
|
|
598
|
+
], LuzmoColorSlider.prototype, "input", 2);
|
|
599
|
+
if (!customElements.get("luzmo-color-slider")) {
|
|
600
|
+
customElements.define("luzmo-color-slider", LuzmoColorSlider);
|
|
601
|
+
}
|
|
602
|
+
exports.LuzmoColorSlider = LuzmoColorSlider;
|