@luzmo/lucero 1.0.1-alpha.17 → 1.0.1-alpha.19
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/NumberFormatter-DewVDY5w.cjs +18 -0
- package/components/NumberFormatter-DgOUVrge.js +136 -0
- package/components/NumberParser-Dik4a0h-.cjs +18 -0
- package/components/NumberParser-ci9J5EKv.js +173 -0
- package/components/accordion/index.cjs +6 -183
- package/components/accordion/index.js +88 -136
- package/components/action-bar/index.cjs +4 -85
- package/components/action-bar/index.js +50 -72
- package/components/action-button/index.cjs +3 -205
- package/components/action-button/index.js +93 -167
- package/components/action-group/index.cjs +1 -7
- package/components/action-group/index.js +8 -12
- package/components/action-group-C54IxNZk.cjs +20 -0
- package/components/action-group-C9dsPJg-.js +258 -0
- package/components/action-menu/index.cjs +11 -91
- package/components/action-menu/index.js +47 -66
- package/components/async-directive-BwIAw5tB.js +82 -0
- package/components/async-directive-DLz6JB0v.cjs +22 -0
- package/components/avatar/index.cjs +3 -63
- package/components/avatar/index.js +42 -54
- package/components/{focusable-selectors-D0t_5P7C.cjs → base-BjTwmyRF.cjs} +5 -16
- package/components/base-CFWO09N1.js +684 -0
- package/components/base-Cy0MQrPT.cjs +40 -0
- package/components/base-D76d76ww.js +26 -0
- package/components/button/index.cjs +2 -134
- package/components/button/index.js +72 -106
- package/components/button-base-B8bWcklV.js +144 -0
- package/components/button-base-tf95Lyl4.cjs +25 -0
- package/components/button-group/index.cjs +1 -45
- package/components/button-group/index.js +25 -37
- package/components/calendar/index.cjs +1 -632
- package/components/calendar/index.js +7 -637
- package/components/checkbox/index.cjs +4 -111
- package/components/checkbox/index.js +53 -98
- package/components/checkbox-mixin-BOTvuPEu.js +70 -0
- package/components/checkbox-mixin-BVPpXtsq.cjs +27 -0
- package/components/class-map-CGfNk3Ee.js +51 -0
- package/components/class-map-D-Y-hsN5.cjs +22 -0
- package/components/clear-button-CuPbWwZY.cjs +18 -0
- package/components/clear-button-DzZ5ulBW.js +53 -0
- package/components/close-button-BTo4yrFR.cjs +18 -0
- package/components/close-button-CuQdsez5.js +51 -0
- package/components/color-area/index.cjs +13 -440
- package/components/color-area/index.js +187 -322
- package/components/color-controller-B0uX6Zso.js +3230 -0
- package/components/color-controller-CoUL5f9K.cjs +18 -0
- package/components/color-field/index.cjs +2 -95
- package/components/color-field/index.js +41 -77
- package/components/color-handle/index.cjs +3 -64
- package/components/color-handle/index.js +37 -58
- package/components/color-loupe/index.cjs +1 -7
- package/components/color-loupe/index.js +8 -12
- package/components/color-loupe-CrM2DVY3.cjs +56 -0
- package/components/color-loupe-DmQe3SpP.js +81 -0
- package/components/color-menu/index.cjs +12 -217
- package/components/color-menu/index.js +93 -187
- package/components/color-palette/index.cjs +1 -89
- package/components/color-palette/index.js +51 -78
- package/components/color-palette-group/index.cjs +3 -259
- package/components/color-palette-group/index.js +105 -193
- package/components/color-picker/index.cjs +6 -114
- package/components/color-picker/index.js +72 -92
- package/components/color-slider/index.cjs +1 -585
- package/components/color-slider/index.js +7 -590
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +18 -0
- package/components/condition-attribute-with-id-Dv4lSRbe.js +31 -0
- package/components/date-time-picker/index.cjs +31 -1357
- package/components/date-time-picker/index.js +637 -951
- package/components/{dependency-manger-XHpQjFgK.js → dependency-manger-CO-VPlqq.js} +14 -24
- package/components/dependency-manger-uthev62E.cjs +18 -0
- package/components/directive-C7oCP5Bh.cjs +22 -0
- package/components/directive-helpers-D4KMv2dC.js +62 -0
- package/components/directive-helpers-t-TVum7J.cjs +22 -0
- package/components/{slottable-request-event-CANixJnR.cjs → directive-oAbCiebi.js} +25 -14
- package/components/divider/index.cjs +1 -54
- package/components/divider/index.js +30 -49
- package/components/divider.module-DDvBo9zo.cjs +18 -0
- package/components/divider.module-DoQWQEIJ.js +21 -0
- package/components/element-resolution-BvRLGqIU.cjs +18 -0
- package/components/element-resolution-FCUT-wql.js +91 -0
- package/components/field-group/index.cjs +1 -7
- package/components/field-group/index.js +8 -12
- package/components/field-group-5WQMBOk4.cjs +23 -0
- package/components/field-group-D4B0IOdA.js +66 -0
- package/components/field-label/index.cjs +1 -7
- package/components/field-label/index.js +8 -12
- package/components/field-label-DxmPiC5p.js +106 -0
- package/components/field-label-Dz9kisdW.cjs +25 -0
- package/components/flow-D-0MTYCm.js +527 -0
- package/components/flow-DM3dNAKs.cjs +30 -0
- package/components/focus-group-DHeTq18L.js +218 -0
- package/components/focus-group-DnxZUBhQ.cjs +18 -0
- package/components/focus-visible-BvScGDCE.js +74 -0
- package/components/focus-visible-D4BXb5RB.cjs +18 -0
- package/components/focusable-B_KwfEec.cjs +18 -0
- package/components/focusable-C5JjRZmT.js +153 -0
- package/components/{focusable-selectors-IltOAOd9.js → focusable-selectors-B4YgbghQ.js} +4 -7
- package/components/focusable-selectors-BgFlyFcY.cjs +18 -0
- package/components/icon/index.cjs +1 -90
- package/components/icon/index.js +46 -74
- package/components/if-defined-DULpqYwi.js +27 -0
- package/components/if-defined-DaXWqfzc.cjs +22 -0
- package/components/index-CNK8wHXu.cjs +57 -0
- package/components/index-Cf6G4q52.js +1490 -0
- package/components/index-D3ICqC7S.js +1174 -0
- package/components/index-hqVbNKYy.cjs +113 -0
- package/components/index.cjs +1 -174
- package/components/index.js +172 -174
- package/components/infield-button/index.cjs +2 -46
- package/components/infield-button/index.js +30 -41
- package/components/label/index.cjs +1 -37
- package/components/label/index.js +24 -36
- package/components/{language-resolution-BSGJAWiQ.js → language-resolution-B-wjV5bb.js} +17 -21
- package/components/language-resolution-EUER43cg.cjs +18 -0
- package/components/like-anchor-Bu3pXbjT.cjs +32 -0
- package/components/like-anchor-DCFJN0LV.js +69 -0
- package/components/luzmo-icons-CiSek5iM.js +229 -0
- package/components/luzmo-icons-CtA-TJPd.cjs +29 -0
- package/components/manage-help-text-CHfMLzSa.js +92 -0
- package/components/manage-help-text-DNqdEkTA.cjs +30 -0
- package/components/menu/index.cjs +29 -1297
- package/components/menu/index.js +499 -954
- package/components/multi-language-field/index.cjs +2 -132
- package/components/multi-language-field/index.js +88 -118
- package/components/mutation-controller-DH7YOCyj.js +52 -0
- package/components/mutation-controller-DkOMCW-c.cjs +22 -0
- package/components/number-field/index.cjs +10 -613
- package/components/number-field/index.js +243 -442
- package/components/observe-slot-presence-CmVi0zTc.js +68 -0
- package/components/observe-slot-presence-bc9chhsi.cjs +18 -0
- package/components/observe-slot-text-C3moTjwy.js +87 -0
- package/components/observe-slot-text-D2VAEFSd.cjs +18 -0
- package/components/options/index.cjs +60 -693
- package/components/options/index.js +953 -519
- package/components/overlay/index.cjs +21 -367
- package/components/overlay/index.js +189 -273
- package/components/overlay-B3ajDLLq.cjs +47 -0
- package/components/overlay-CUKs69yr.js +2745 -0
- package/components/{pending-state-CXbe-Xul.js → pending-state-B2wWssTo.js} +13 -28
- package/components/pending-state-bJr-nEJl.cjs +26 -0
- package/components/picker/index.cjs +1 -9
- package/components/picker/index.js +11 -15
- package/components/picker-C0LvseZe.cjs +123 -0
- package/components/picker-W1qNmtsh.js +461 -0
- package/components/picker-button/index.cjs +4 -56
- package/components/picker-button/index.js +34 -45
- package/components/{condition-attribute-with-id-Cn815e9W.js → platform-BM-uMWpX.js} +49 -24
- package/components/platform-BiXhwqk3.cjs +18 -0
- package/components/popover/index.cjs +1 -7
- package/components/popover/index.js +8 -12
- package/components/popover-fwJeZHMQ.cjs +30 -0
- package/components/popover-iD8f5Jkp.js +67 -0
- package/components/progress-circle/index.cjs +1 -7
- package/components/progress-circle/index.js +8 -12
- package/components/progress-circle-DZxaMe8L.cjs +33 -0
- package/components/progress-circle-USIIU1up.js +97 -0
- package/components/query-BL-TJj7K.cjs +22 -0
- package/components/query-D_KR_GUc.js +51 -0
- package/components/query-assigned-elements-DjfhL1cl.js +36 -0
- package/components/query-assigned-elements-DsKsfk7G.cjs +22 -0
- package/components/query-assigned-nodes-BcKWmGzy.cjs +22 -0
- package/components/query-assigned-nodes-C76XVPWY.js +36 -0
- package/components/radio/index.cjs +2 -244
- package/components/radio/index.js +110 -192
- package/components/{random-id-BEc6QIUL.js → random-id-ByCz1xaq.js} +3 -3
- package/components/random-id-CqvckpWe.cjs +18 -0
- package/components/roving-tabindex-By_fCy_e.cjs +18 -0
- package/components/roving-tabindex-DOg4z6ZU.js +66 -0
- package/components/search/index.cjs +8 -115
- package/components/search/index.js +66 -96
- package/components/select/index.cjs +51 -720
- package/components/select/index.js +347 -563
- package/components/sized-mixin-CJbBHWRQ.js +63 -0
- package/components/sized-mixin-WPHH0a_D.cjs +18 -0
- package/components/slider/index.cjs +1 -119
- package/components/slider/index.js +1113 -100
- package/components/slottable-request-event-BfUUt1Mh.cjs +18 -0
- package/components/{slottable-request-event-D9WzrdWv.js → slottable-request-event-DggLA4Rx.js} +9 -12
- package/components/state-DwIwYPvt.js +29 -0
- package/components/state-vf0PJN3_.cjs +22 -0
- package/components/strategies-C6HsQpU2.cjs +18 -0
- package/components/strategies-CUMLHtQI.js +195 -0
- package/components/streaming-listener-BQ68fKMa.js +91 -0
- package/components/streaming-listener-DeGQYM-9.cjs +18 -0
- package/components/style-map-Bnhf_mVZ.js +53 -0
- package/components/style-map-DuMd5xlY.cjs +22 -0
- package/components/swatch/index.cjs +7 -436
- package/components/swatch/index.js +205 -350
- package/components/switch/index.cjs +2 -61
- package/components/switch/index.js +34 -51
- package/components/tabs/index.cjs +26 -693
- package/components/tabs/index.js +388 -521
- package/components/tags/index.cjs +4 -201
- package/components/tags/index.js +87 -152
- package/components/text-field/index.cjs +3 -49
- package/components/text-field/index.js +30 -44
- package/components/text-field-BkFPYo7S.cjs +85 -0
- package/components/text-field-C2n3rzCK.js +314 -0
- package/components/text-field.module-C2KVUJcX.js +21 -0
- package/components/text-field.module-DXhFA9G-.cjs +18 -0
- package/components/toast/index.cjs +12 -177
- package/components/toast/index.js +73 -145
- package/components/tooltip/index.cjs +6 -221
- package/components/tooltip/index.js +131 -155
- package/components/tooltip/tooltip.d.ts +12 -1
- package/components/unit-input/index.cjs +8 -232
- package/components/unit-input/index.js +108 -201
- package/components/utils.cjs +1 -25
- package/components/utils.js +22 -22
- package/components/{random-id-BE6HA503.cjs → when-CDK1Tt5Y.js} +10 -7
- package/components/when-CDZyJPvd.cjs +22 -0
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/components/action-group-DHp8RHDf.js +0 -392
- package/components/action-group-MPf19RPV.cjs +0 -391
- package/components/base-COw9n7UR.cjs +0 -119
- package/components/base-DmeVy0cq.js +0 -120
- package/components/button-base-7Ak55xFd.cjs +0 -206
- package/components/button-base-C3kf6BTK.js +0 -207
- package/components/checkbox-mixin-8cL-vfDy.js +0 -84
- package/components/checkbox-mixin-CE7dJj3J.cjs +0 -83
- package/components/clear-button-Co6oKSgl.js +0 -59
- package/components/clear-button-X_HDY2eH.cjs +0 -58
- package/components/close-button-DPBK6Kpu.cjs +0 -59
- package/components/close-button-Miw9ZjoJ.js +0 -60
- package/components/color-controller-BjDZaxhX.js +0 -491
- package/components/color-controller-C3c_vb2P.cjs +0 -490
- package/components/color-loupe-BQqNR8YD.cjs +0 -88
- package/components/color-loupe-B_DDFv8l.js +0 -89
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +0 -43
- package/components/dependency-manger-CcIE1uvQ.cjs +0 -63
- package/components/divider.module-Cm5LcDRV.cjs +0 -20
- package/components/divider.module-DauH6k2_.js +0 -21
- package/components/element-resolution-DCsrhGZO.cjs +0 -112
- package/components/element-resolution-nMlmW4Jy.js +0 -113
- package/components/field-group-DNmY8W9v.cjs +0 -86
- package/components/field-group-DVdAWCQF.js +0 -87
- package/components/field-label-CKH9EXpR.cjs +0 -156
- package/components/field-label-Dpsecoc6.js +0 -157
- package/components/focus-group-BqDAk9Is.js +0 -337
- package/components/focus-group-DFzOlalL.cjs +0 -336
- package/components/focus-visible-B-B8-P9R.cjs +0 -104
- package/components/focus-visible-BUPRWlsh.js +0 -105
- package/components/focusable-BPrTcZPd.cjs +0 -262
- package/components/focusable-ChCLg1k4.js +0 -263
- package/components/language-resolution-iN9EImbb.cjs +0 -57
- package/components/like-anchor-D62faRNG.cjs +0 -79
- package/components/like-anchor-v3cJ9RWM.js +0 -80
- package/components/manage-help-text-BYx84zZR.cjs +0 -125
- package/components/manage-help-text-DOuMTGht.js +0 -126
- package/components/observe-slot-presence-9AwLGUQ_.cjs +0 -78
- package/components/observe-slot-presence-DcMdoumP.js +0 -79
- package/components/observe-slot-text-CSofZeeF.cjs +0 -104
- package/components/observe-slot-text-CjnkkBPn.js +0 -105
- package/components/overlay-CN8ISP1F.js +0 -2485
- package/components/overlay-LViy9VWM.cjs +0 -2484
- package/components/pending-state-e4RbXe9u.cjs +0 -75
- package/components/picker-DNde3awt.cjs +0 -672
- package/components/picker-PfUAF05y.js +0 -673
- package/components/platform-CxDar3Dn.cjs +0 -68
- package/components/platform-Cxn0WbyT.js +0 -69
- package/components/popover-BkbYhl3i.js +0 -74
- package/components/popover-BkgUf0kL.cjs +0 -74
- package/components/progress-circle-Hu_ivPHf.js +0 -133
- package/components/progress-circle-_Etqsj9f.cjs +0 -132
- package/components/roving-tabindex-AsmAh2In.cjs +0 -95
- package/components/roving-tabindex-DPF9NmrH.js +0 -96
- package/components/sized-mixin-DmkrNdWB.js +0 -80
- package/components/sized-mixin-UaTVa-AE.cjs +0 -79
- package/components/strategies-DlMlaSJR.cjs +0 -317
- package/components/strategies-DlPQoTFE.js +0 -318
- package/components/streaming-listener-D4sHaMub.cjs +0 -145
- package/components/streaming-listener-cAz5zJyk.js +0 -146
- package/components/text-field-11tcnftU.cjs +0 -338
- package/components/text-field-Chi9J2Cz.js +0 -339
- package/components/text-field.module-CMBS0jSL.js +0 -21
- package/components/text-field.module-DIJdV_sA.cjs +0 -20
|
@@ -15,60 +15,39 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
import { a as z, r as v, x as y, n as s } from "../base-CFWO09N1.js";
|
|
19
|
+
import { e as b } from "../query-D_KR_GUc.js";
|
|
20
|
+
import { o as m } from "../if-defined-DULpqYwi.js";
|
|
21
|
+
import "../color-handle/index.js";
|
|
22
|
+
import { j as x, c as w } from "../platform-BM-uMWpX.js";
|
|
23
|
+
import { C } from "../color-controller-B0uX6Zso.js";
|
|
24
|
+
import { L as $ } from "../language-resolution-B-wjV5bb.js";
|
|
25
|
+
import { s as k } from "../streaming-listener-BQ68fKMa.js";
|
|
26
|
+
const g = () => {
|
|
27
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
28
|
+
const u = document.createElement("style");
|
|
29
|
+
u.setAttribute("data-luzmo-vars", ""), u.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(u);
|
|
24
30
|
}
|
|
25
31
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
import { j as isAndroid, c as isIOS } from "../platform-Cxn0WbyT.js";
|
|
33
|
-
import { C as ColorController } from "../color-controller-BjDZaxhX.js";
|
|
34
|
-
import { L as LanguageResolutionController } from "../language-resolution-BSGJAWiQ.js";
|
|
35
|
-
import { s as streamingListener } from "../streaming-listener-cAz5zJyk.js";
|
|
36
|
-
const styles = "@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.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}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";
|
|
37
|
-
var __defProp = Object.defineProperty;
|
|
38
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
39
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
40
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
41
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
42
|
-
if (decorator = decorators[i])
|
|
43
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
44
|
-
if (kind && result) __defProp(target, key, result);
|
|
45
|
-
return result;
|
|
32
|
+
g();
|
|
33
|
+
const R = "@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.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}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";
|
|
34
|
+
var A = Object.defineProperty, P = Object.getOwnPropertyDescriptor, i = (u, e, o, t) => {
|
|
35
|
+
for (var r = t > 1 ? void 0 : t ? P(e, o) : e, a = u.length - 1, n; a >= 0; a--)
|
|
36
|
+
(n = u[a]) && (r = (t ? n(e, o, r) : n(r)) || r);
|
|
37
|
+
return t && r && A(e, o, r), r;
|
|
46
38
|
};
|
|
47
|
-
class
|
|
39
|
+
class l extends z {
|
|
48
40
|
constructor() {
|
|
49
|
-
super(...arguments);
|
|
50
|
-
this.disabled = false;
|
|
51
|
-
this.focused = false;
|
|
52
|
-
this.labelX = "saturation";
|
|
53
|
-
this.labelY = "luminosity";
|
|
54
|
-
this.isLTR = true;
|
|
55
|
-
this.languageResolver = new LanguageResolutionController(this);
|
|
56
|
-
this.colorController = new ColorController(this, { manageAs: "hsv" });
|
|
57
|
-
this.activeAxis = "x";
|
|
58
|
-
this.step = 0.01;
|
|
59
|
-
this.altered = 0;
|
|
60
|
-
this.activeKeys = /* @__PURE__ */ new Set();
|
|
61
|
-
this._valueChanged = false;
|
|
62
|
-
this._pointerDown = false;
|
|
41
|
+
super(...arguments), this.disabled = !1, this.focused = !1, this.labelX = "saturation", this.labelY = "luminosity", this.isLTR = !0, this.languageResolver = new $(this), this.colorController = new C(this, { manageAs: "hsv" }), this.activeAxis = "x", this.step = 0.01, this.altered = 0, this.activeKeys = /* @__PURE__ */ new Set(), this._valueChanged = !1, this._pointerDown = !1;
|
|
63
42
|
}
|
|
64
43
|
static get styles() {
|
|
65
|
-
return [
|
|
44
|
+
return [v(R)];
|
|
66
45
|
}
|
|
67
46
|
get hue() {
|
|
68
47
|
return this.colorController.hue;
|
|
69
48
|
}
|
|
70
|
-
set hue(
|
|
71
|
-
this.colorController.hue =
|
|
49
|
+
set hue(e) {
|
|
50
|
+
this.colorController.hue = e;
|
|
72
51
|
}
|
|
73
52
|
get value() {
|
|
74
53
|
return this.colorController.colorValue;
|
|
@@ -76,275 +55,184 @@ class LuzmoColorArea extends LuzmoElement {
|
|
|
76
55
|
get color() {
|
|
77
56
|
return this.colorController.colorValue;
|
|
78
57
|
}
|
|
79
|
-
set color(
|
|
80
|
-
this.colorController.color =
|
|
58
|
+
set color(e) {
|
|
59
|
+
this.colorController.color = e;
|
|
81
60
|
}
|
|
82
61
|
get x() {
|
|
83
62
|
return this.colorController.color.hsv.s / 100;
|
|
84
63
|
}
|
|
85
|
-
set x(
|
|
86
|
-
if (
|
|
64
|
+
set x(e) {
|
|
65
|
+
if (e === this.x)
|
|
87
66
|
return;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
if (this.inputX) {
|
|
91
|
-
this.inputX.value = x.toString();
|
|
92
|
-
this.colorController.color.set("s", this.inputX.valueAsNumber * 100);
|
|
93
|
-
} else {
|
|
94
|
-
this.colorController.color.set("s", x * 100);
|
|
95
|
-
}
|
|
96
|
-
this.requestUpdate("x", oldValue);
|
|
67
|
+
const o = this.x;
|
|
68
|
+
this.inputX ? (this.inputX.value = e.toString(), this.colorController.color.set("s", this.inputX.valueAsNumber * 100)) : this.colorController.color.set("s", e * 100), this.requestUpdate("x", o);
|
|
97
69
|
}
|
|
98
70
|
get y() {
|
|
99
71
|
return this.colorController.color.hsv.v / 100;
|
|
100
72
|
}
|
|
101
|
-
set y(
|
|
102
|
-
if (
|
|
73
|
+
set y(e) {
|
|
74
|
+
if (e === this.y)
|
|
103
75
|
return;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (this.inputY) {
|
|
107
|
-
this.inputY.value = y.toString();
|
|
108
|
-
this.colorController.color.set("v", this.inputY.valueAsNumber * 100);
|
|
109
|
-
}
|
|
110
|
-
this.requestUpdate("y", oldValue);
|
|
76
|
+
const o = this.y;
|
|
77
|
+
this.inputY && (this.inputY.value = e.toString(), this.colorController.color.set("v", this.inputY.valueAsNumber * 100)), this.requestUpdate("y", o);
|
|
111
78
|
}
|
|
112
|
-
focus(
|
|
113
|
-
super.focus(
|
|
114
|
-
this.forwardFocus();
|
|
79
|
+
focus(e = {}) {
|
|
80
|
+
super.focus(e), this.forwardFocus();
|
|
115
81
|
}
|
|
116
82
|
forwardFocus() {
|
|
117
|
-
|
|
118
|
-
this.inputX.focus();
|
|
119
|
-
} else {
|
|
120
|
-
this.inputY.focus();
|
|
121
|
-
}
|
|
83
|
+
this.activeAxis === "x" ? this.inputX.focus() : this.inputY.focus();
|
|
122
84
|
}
|
|
123
85
|
handleFocus() {
|
|
124
|
-
this.focused =
|
|
125
|
-
this._valueChanged = false;
|
|
86
|
+
this.focused = !0, this._valueChanged = !1;
|
|
126
87
|
}
|
|
127
88
|
handleBlur() {
|
|
128
|
-
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
this.altered = 0;
|
|
132
|
-
this.focused = false;
|
|
133
|
-
this._valueChanged = false;
|
|
89
|
+
this._pointerDown || (this.altered = 0, this.focused = !1, this._valueChanged = !1);
|
|
134
90
|
}
|
|
135
|
-
handleKeydown(
|
|
136
|
-
const { code } =
|
|
137
|
-
this.focused =
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
).length;
|
|
141
|
-
const isArrowKey = code.search("Arrow") === 0 || code.search("Page") === 0 || code.search("Home") === 0 || code.search("End") === 0;
|
|
142
|
-
if (isArrowKey) {
|
|
143
|
-
event.preventDefault();
|
|
144
|
-
this.activeKeys.add(code);
|
|
145
|
-
this.handleKeypress();
|
|
146
|
-
}
|
|
91
|
+
handleKeydown(e) {
|
|
92
|
+
const { code: o } = e;
|
|
93
|
+
this.focused = !0, this.altered = [e.shiftKey, e.ctrlKey, e.altKey].filter(
|
|
94
|
+
(r) => !!r
|
|
95
|
+
).length, (o.search("Arrow") === 0 || o.search("Page") === 0 || o.search("Home") === 0 || o.search("End") === 0) && (e.preventDefault(), this.activeKeys.add(o), this.handleKeypress());
|
|
147
96
|
}
|
|
148
97
|
handleKeypress() {
|
|
149
|
-
let
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
switch (code) {
|
|
98
|
+
let e = 0, o = 0;
|
|
99
|
+
const t = Math.max(this.step, this.altered * 5 * this.step);
|
|
100
|
+
this.activeKeys.forEach((r) => {
|
|
101
|
+
switch (r) {
|
|
154
102
|
case "ArrowUp": {
|
|
155
|
-
|
|
103
|
+
o = t;
|
|
156
104
|
break;
|
|
157
105
|
}
|
|
158
106
|
case "ArrowDown": {
|
|
159
|
-
|
|
107
|
+
o = t * -1;
|
|
160
108
|
break;
|
|
161
109
|
}
|
|
162
110
|
case "ArrowLeft": {
|
|
163
|
-
|
|
111
|
+
e = this.step * (this.isLTR ? -1 : 1);
|
|
164
112
|
break;
|
|
165
113
|
}
|
|
166
114
|
case "ArrowRight": {
|
|
167
|
-
|
|
115
|
+
e = this.step * (this.isLTR ? 1 : -1);
|
|
168
116
|
break;
|
|
169
117
|
}
|
|
170
118
|
case "PageUp": {
|
|
171
|
-
|
|
119
|
+
o = t * 10;
|
|
172
120
|
break;
|
|
173
121
|
}
|
|
174
122
|
case "PageDown": {
|
|
175
|
-
|
|
123
|
+
o = t * -10;
|
|
176
124
|
break;
|
|
177
125
|
}
|
|
178
126
|
case "Home": {
|
|
179
|
-
|
|
127
|
+
e = t * (this.isLTR ? -10 : 10);
|
|
180
128
|
break;
|
|
181
129
|
}
|
|
182
130
|
case "End": {
|
|
183
|
-
|
|
131
|
+
e = t * (this.isLTR ? 10 : -10);
|
|
184
132
|
break;
|
|
185
133
|
}
|
|
186
134
|
}
|
|
187
|
-
})
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this._valueChanged = true;
|
|
200
|
-
this.dispatchEvent(
|
|
201
|
-
new Event("input", {
|
|
202
|
-
bubbles: true,
|
|
203
|
-
composed: true
|
|
204
|
-
})
|
|
205
|
-
);
|
|
206
|
-
const applyDefault = this.dispatchEvent(
|
|
207
|
-
new Event("change", {
|
|
208
|
-
bubbles: true,
|
|
209
|
-
composed: true,
|
|
210
|
-
cancelable: true
|
|
211
|
-
})
|
|
212
|
-
);
|
|
213
|
-
if (!applyDefault) {
|
|
214
|
-
this.colorController.restorePreviousColor();
|
|
215
|
-
}
|
|
216
|
-
}
|
|
135
|
+
}), e !== 0 ? (this.activeAxis = "x", this.inputX.focus()) : o !== 0 && (this.activeAxis = "y", this.inputY.focus()), this.x = Math.min(1, Math.max(this.x + e, 0)), this.y = Math.min(1, Math.max(this.y + o, 0)), this.colorController.savePreviousColor(), (e !== 0 || o !== 0) && (this._valueChanged = !0, this.dispatchEvent(
|
|
136
|
+
new Event("input", {
|
|
137
|
+
bubbles: !0,
|
|
138
|
+
composed: !0
|
|
139
|
+
})
|
|
140
|
+
), this.dispatchEvent(
|
|
141
|
+
new Event("change", {
|
|
142
|
+
bubbles: !0,
|
|
143
|
+
composed: !0,
|
|
144
|
+
cancelable: !0
|
|
145
|
+
})
|
|
146
|
+
) || this.colorController.restorePreviousColor());
|
|
217
147
|
}
|
|
218
|
-
handleKeyup(
|
|
219
|
-
|
|
220
|
-
const { code } =
|
|
221
|
-
this.activeKeys.delete(
|
|
148
|
+
handleKeyup(e) {
|
|
149
|
+
e.preventDefault();
|
|
150
|
+
const { code: o } = e;
|
|
151
|
+
this.activeKeys.delete(o);
|
|
222
152
|
}
|
|
223
|
-
handleInput(
|
|
224
|
-
const { valueAsNumber, name } =
|
|
225
|
-
this[
|
|
153
|
+
handleInput(e) {
|
|
154
|
+
const { valueAsNumber: o, name: t } = e.target;
|
|
155
|
+
this[t] = o;
|
|
226
156
|
}
|
|
227
|
-
handleChange(
|
|
228
|
-
this.handleInput(
|
|
229
|
-
this.dispatchEvent(
|
|
157
|
+
handleChange(e) {
|
|
158
|
+
this.handleInput(e), this.dispatchEvent(
|
|
230
159
|
new Event("change", {
|
|
231
|
-
bubbles:
|
|
232
|
-
composed:
|
|
233
|
-
cancelable:
|
|
160
|
+
bubbles: !0,
|
|
161
|
+
composed: !0,
|
|
162
|
+
cancelable: !0
|
|
234
163
|
})
|
|
235
164
|
);
|
|
236
165
|
}
|
|
237
|
-
handlePointerdown(
|
|
238
|
-
if (
|
|
239
|
-
|
|
166
|
+
handlePointerdown(e) {
|
|
167
|
+
if (e.button !== 0) {
|
|
168
|
+
e.preventDefault();
|
|
240
169
|
return;
|
|
241
170
|
}
|
|
242
|
-
this._pointerDown =
|
|
243
|
-
this.colorController.savePreviousColor();
|
|
244
|
-
this.boundingClientRect = this.getBoundingClientRect();
|
|
245
|
-
event.target.setPointerCapture(event.pointerId);
|
|
246
|
-
if (event.pointerType === "mouse") {
|
|
247
|
-
this.focused = true;
|
|
248
|
-
}
|
|
171
|
+
this._pointerDown = !0, this.colorController.savePreviousColor(), this.boundingClientRect = this.getBoundingClientRect(), e.target.setPointerCapture(e.pointerId), e.pointerType === "mouse" && (this.focused = !0);
|
|
249
172
|
}
|
|
250
|
-
handlePointermove(
|
|
251
|
-
const [
|
|
252
|
-
this._valueChanged =
|
|
253
|
-
this.x = x;
|
|
254
|
-
this.y = y;
|
|
255
|
-
this.dispatchEvent(
|
|
173
|
+
handlePointermove(e) {
|
|
174
|
+
const [o, t] = this.calculateHandlePosition(e);
|
|
175
|
+
this._valueChanged = !1, this.x = o, this.y = t, this.dispatchEvent(
|
|
256
176
|
new Event("input", {
|
|
257
|
-
bubbles:
|
|
258
|
-
composed:
|
|
259
|
-
cancelable:
|
|
177
|
+
bubbles: !0,
|
|
178
|
+
composed: !0,
|
|
179
|
+
cancelable: !0
|
|
260
180
|
})
|
|
261
181
|
);
|
|
262
182
|
}
|
|
263
|
-
handlePointerup(
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
event.target.releasePointerCapture(event.pointerId);
|
|
267
|
-
const applyDefault = this.dispatchEvent(
|
|
183
|
+
handlePointerup(e) {
|
|
184
|
+
e.preventDefault(), this._pointerDown = !1, e.target.releasePointerCapture(e.pointerId);
|
|
185
|
+
const o = this.dispatchEvent(
|
|
268
186
|
new Event("change", {
|
|
269
|
-
bubbles:
|
|
270
|
-
composed:
|
|
271
|
-
cancelable:
|
|
187
|
+
bubbles: !0,
|
|
188
|
+
composed: !0,
|
|
189
|
+
cancelable: !0
|
|
272
190
|
})
|
|
273
191
|
);
|
|
274
|
-
this.inputX.focus();
|
|
275
|
-
if (event.pointerType === "mouse") {
|
|
276
|
-
this.focused = false;
|
|
277
|
-
}
|
|
278
|
-
if (!applyDefault) {
|
|
279
|
-
this.colorController.restorePreviousColor();
|
|
280
|
-
}
|
|
192
|
+
this.inputX.focus(), e.pointerType === "mouse" && (this.focused = !1), o || this.colorController.restorePreviousColor();
|
|
281
193
|
}
|
|
282
194
|
/**
|
|
283
195
|
* Returns the value under the cursor
|
|
284
196
|
* @param: PointerEvent on slider
|
|
285
197
|
* @return: Slider value that correlates to the position under the pointer
|
|
286
198
|
*/
|
|
287
|
-
calculateHandlePosition(
|
|
288
|
-
if (!this.boundingClientRect)
|
|
199
|
+
calculateHandlePosition(e) {
|
|
200
|
+
if (!this.boundingClientRect)
|
|
289
201
|
return [this.x, this.y];
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const minOffsetX = rect.left;
|
|
293
|
-
const minOffsetY = rect.top;
|
|
294
|
-
const offsetX = event.clientX;
|
|
295
|
-
const offsetY = event.clientY;
|
|
296
|
-
const width = rect.width;
|
|
297
|
-
const height = rect.height;
|
|
298
|
-
const percentX = Math.max(0, Math.min(1, (offsetX - minOffsetX) / width));
|
|
299
|
-
const percentY = Math.max(0, Math.min(1, (offsetY - minOffsetY) / height));
|
|
300
|
-
return [this.isLTR ? percentX : 1 - percentX, 1 - percentY];
|
|
202
|
+
const o = this.boundingClientRect, t = o.left, r = o.top, a = e.clientX, n = e.clientY, c = o.width, d = o.height, h = Math.max(0, Math.min(1, (a - t) / c)), p = Math.max(0, Math.min(1, (n - r) / d));
|
|
203
|
+
return [this.isLTR ? h : 1 - h, 1 - p];
|
|
301
204
|
}
|
|
302
|
-
handleAreaPointerdown(
|
|
303
|
-
|
|
304
|
-
return;
|
|
305
|
-
}
|
|
306
|
-
event.stopPropagation();
|
|
307
|
-
event.preventDefault();
|
|
308
|
-
this.handle.dispatchEvent(new PointerEvent("pointerdown", event));
|
|
309
|
-
this.handlePointermove(event);
|
|
205
|
+
handleAreaPointerdown(e) {
|
|
206
|
+
e.button === 0 && (e.stopPropagation(), e.preventDefault(), this.handle.dispatchEvent(new PointerEvent("pointerdown", e)), this.handlePointermove(e));
|
|
310
207
|
}
|
|
311
208
|
render() {
|
|
312
|
-
const { width = 0, height = 0 } = this.boundingClientRect || {}
|
|
313
|
-
const isMobile = isAndroid() || isIOS();
|
|
314
|
-
const defaultAriaLabel = "Color Picker";
|
|
315
|
-
const ariaLabel = defaultAriaLabel;
|
|
316
|
-
const ariaRoleDescription = ifDefined(isMobile ? void 0 : "2d slider");
|
|
317
|
-
const ariaLabelX = this.labelX;
|
|
318
|
-
const ariaLabelY = this.labelY;
|
|
319
|
-
const ariaValueX = new Intl.NumberFormat(this.languageResolver.language, {
|
|
209
|
+
const { width: e = 0, height: o = 0 } = this.boundingClientRect || {}, t = x() || w(), a = "Color Picker", n = m(t ? void 0 : "2d slider"), c = this.labelX, d = this.labelY, h = new Intl.NumberFormat(this.languageResolver.language, {
|
|
320
210
|
style: "percent",
|
|
321
211
|
unitDisplay: "narrow"
|
|
322
|
-
}).format(this.x)
|
|
323
|
-
const ariaValueY = new Intl.NumberFormat(this.languageResolver.language, {
|
|
212
|
+
}).format(this.x), p = new Intl.NumberFormat(this.languageResolver.language, {
|
|
324
213
|
style: "percent",
|
|
325
214
|
unitDisplay: "narrow"
|
|
326
|
-
}).format(this.y)
|
|
327
|
-
const style = {
|
|
215
|
+
}).format(this.y), f = {
|
|
328
216
|
background: `linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`
|
|
329
217
|
};
|
|
330
|
-
return
|
|
218
|
+
return y`
|
|
331
219
|
<div
|
|
332
220
|
@pointerdown=${this.handleAreaPointerdown}
|
|
333
221
|
class="gradient"
|
|
334
|
-
style="background: ${
|
|
222
|
+
style="background: ${f.background}"
|
|
335
223
|
>
|
|
336
224
|
<slot name="gradient"></slot>
|
|
337
225
|
</div>
|
|
338
226
|
|
|
339
227
|
<luzmo-color-handle
|
|
340
|
-
tabindex=${
|
|
228
|
+
tabindex=${m(this.focused ? void 0 : "0")}
|
|
341
229
|
@focus=${this.forwardFocus}
|
|
342
230
|
?focused=${this.focused}
|
|
343
231
|
class="handle"
|
|
344
232
|
color=${this.colorController.getHslString()}
|
|
345
233
|
?disabled=${this.disabled}
|
|
346
|
-
style=${`transform: translate(${(this.isLTR ? this.x : 1 - this.x) *
|
|
347
|
-
${
|
|
234
|
+
style=${`transform: translate(${(this.isLTR ? this.x : 1 - this.x) * e}px, ${o - this.y * o}px);`}
|
|
235
|
+
${k({
|
|
348
236
|
start: ["pointerdown", this.handlePointerdown],
|
|
349
237
|
streamInside: ["pointermove", this.handlePointermove],
|
|
350
238
|
end: [
|
|
@@ -356,17 +244,17 @@ class LuzmoColorArea extends LuzmoElement {
|
|
|
356
244
|
|
|
357
245
|
<fieldset
|
|
358
246
|
class="fieldset"
|
|
359
|
-
aria-label=${
|
|
247
|
+
aria-label=${m(t ? a : void 0)}
|
|
360
248
|
>
|
|
361
249
|
<div role="presentation">
|
|
362
250
|
<input
|
|
363
251
|
type="range"
|
|
364
252
|
class="slider"
|
|
365
253
|
name="x"
|
|
366
|
-
aria-label=${
|
|
367
|
-
aria-roledescription=${
|
|
254
|
+
aria-label=${t ? c : `${c} ${a}`}
|
|
255
|
+
aria-roledescription=${n}
|
|
368
256
|
aria-orientation="horizontal"
|
|
369
|
-
aria-valuetext=${
|
|
257
|
+
aria-valuetext=${t ? h : `${h}, ${c}${this._valueChanged ? "" : `, ${p}, ${d}`}`}
|
|
370
258
|
min="0"
|
|
371
259
|
max="1"
|
|
372
260
|
step=${this.step}
|
|
@@ -381,10 +269,10 @@ class LuzmoColorArea extends LuzmoElement {
|
|
|
381
269
|
type="range"
|
|
382
270
|
class="slider"
|
|
383
271
|
name="y"
|
|
384
|
-
aria-label=${
|
|
385
|
-
aria-roledescription=${
|
|
272
|
+
aria-label=${t ? d : `${d} ${a}`}
|
|
273
|
+
aria-roledescription=${n}
|
|
386
274
|
aria-orientation="vertical"
|
|
387
|
-
aria-valuetext=${
|
|
275
|
+
aria-valuetext=${t ? p : `${p}, ${d}${this._valueChanged ? "" : `, ${h}, ${c}`}`}
|
|
388
276
|
orient="vertical"
|
|
389
277
|
min="0"
|
|
390
278
|
max="1"
|
|
@@ -398,13 +286,8 @@ class LuzmoColorArea extends LuzmoElement {
|
|
|
398
286
|
</fieldset>
|
|
399
287
|
`;
|
|
400
288
|
}
|
|
401
|
-
firstUpdated(
|
|
402
|
-
super.firstUpdated(
|
|
403
|
-
this.boundingClientRect = this.getBoundingClientRect();
|
|
404
|
-
this.addEventListener("focus", this.handleFocus);
|
|
405
|
-
this.addEventListener("blur", this.handleBlur);
|
|
406
|
-
this.addEventListener("keyup", this.handleKeyup);
|
|
407
|
-
this.addEventListener("keydown", this.handleKeydown);
|
|
289
|
+
firstUpdated(e) {
|
|
290
|
+
super.firstUpdated(e), this.boundingClientRect = this.getBoundingClientRect(), this.addEventListener("focus", this.handleFocus), this.addEventListener("blur", this.handleBlur), this.addEventListener("keyup", this.handleKeyup), this.addEventListener("keydown", this.handleKeydown);
|
|
408
291
|
}
|
|
409
292
|
/**
|
|
410
293
|
* Overrides the `updated` method to handle changes in property values.
|
|
@@ -418,99 +301,81 @@ class LuzmoColorArea extends LuzmoElement {
|
|
|
418
301
|
* the `input[type="range"]` elements in shadow roots to prevent multiple
|
|
419
302
|
* tab stops within the Color Area for certain browser settings (e.g., Webkit).
|
|
420
303
|
*/
|
|
421
|
-
updated(
|
|
422
|
-
super.updated(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
"
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
}
|
|
432
|
-
if (changed.has("focused") && this.focused) {
|
|
433
|
-
const parentX = this.inputX.parentElement;
|
|
434
|
-
const parentY = this.inputY.parentElement;
|
|
435
|
-
if (!parentX.shadowRoot && !parentY.shadowRoot) {
|
|
436
|
-
parentX.attachShadow({ mode: "open" });
|
|
437
|
-
parentY.attachShadow({ mode: "open" });
|
|
438
|
-
const slot = '<div tabindex="-1"><slot></slot></div>';
|
|
439
|
-
parentX.shadowRoot.innerHTML = slot;
|
|
440
|
-
parentY.shadowRoot.innerHTML = slot;
|
|
304
|
+
updated(e) {
|
|
305
|
+
if (super.updated(e), this.x !== this.inputX.valueAsNumber && this.colorController.color.set("s", this.inputX.valueAsNumber * 100), this.y !== this.inputY.valueAsNumber && this.colorController.color.set(
|
|
306
|
+
"v",
|
|
307
|
+
(1 - this.inputY.valueAsNumber) * 100
|
|
308
|
+
), e.has("focused") && this.focused) {
|
|
309
|
+
const o = this.inputX.parentElement, t = this.inputY.parentElement;
|
|
310
|
+
if (!o.shadowRoot && !t.shadowRoot) {
|
|
311
|
+
o.attachShadow({ mode: "open" }), t.attachShadow({ mode: "open" });
|
|
312
|
+
const r = '<div tabindex="-1"><slot></slot></div>';
|
|
313
|
+
o.shadowRoot.innerHTML = r, t.shadowRoot.innerHTML = r;
|
|
441
314
|
}
|
|
442
315
|
}
|
|
443
316
|
}
|
|
444
317
|
connectedCallback() {
|
|
445
|
-
var
|
|
446
|
-
super.connectedCallback()
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
}
|
|
452
|
-
this.requestUpdate();
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
(_a = this.observer) == null ? void 0 : _a.observe(this);
|
|
318
|
+
var e;
|
|
319
|
+
super.connectedCallback(), !this.observer && window.ResizeObserver && (this.observer = new window.ResizeObserver((o) => {
|
|
320
|
+
for (const t of o)
|
|
321
|
+
this.boundingClientRect = t.contentRect;
|
|
322
|
+
this.requestUpdate();
|
|
323
|
+
})), (e = this.observer) == null || e.observe(this);
|
|
456
324
|
}
|
|
457
325
|
disconnectedCallback() {
|
|
458
|
-
var
|
|
459
|
-
(
|
|
460
|
-
super.disconnectedCallback();
|
|
326
|
+
var e;
|
|
327
|
+
(e = this.observer) == null || e.unobserve(this), super.disconnectedCallback();
|
|
461
328
|
}
|
|
462
329
|
}
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
],
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
],
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
],
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
],
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
],
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
],
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
],
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
],
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
],
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
],
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
],
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
],
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
],
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
],
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
],
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
],
|
|
511
|
-
|
|
512
|
-
customElements.define("luzmo-color-area", LuzmoColorArea);
|
|
513
|
-
}
|
|
330
|
+
i([
|
|
331
|
+
s({ type: String, reflect: !0 })
|
|
332
|
+
], l.prototype, "dir", 2);
|
|
333
|
+
i([
|
|
334
|
+
s({ type: Boolean, reflect: !0 })
|
|
335
|
+
], l.prototype, "disabled", 2);
|
|
336
|
+
i([
|
|
337
|
+
s({ type: Boolean, reflect: !0 })
|
|
338
|
+
], l.prototype, "focused", 2);
|
|
339
|
+
i([
|
|
340
|
+
s({ type: String, attribute: "label-x" })
|
|
341
|
+
], l.prototype, "labelX", 2);
|
|
342
|
+
i([
|
|
343
|
+
s({ type: String, attribute: "label-y" })
|
|
344
|
+
], l.prototype, "labelY", 2);
|
|
345
|
+
i([
|
|
346
|
+
s({ type: Boolean, attribute: "is-ltr" })
|
|
347
|
+
], l.prototype, "isLTR", 2);
|
|
348
|
+
i([
|
|
349
|
+
b(".handle")
|
|
350
|
+
], l.prototype, "handle", 2);
|
|
351
|
+
i([
|
|
352
|
+
s({ type: Number })
|
|
353
|
+
], l.prototype, "hue", 1);
|
|
354
|
+
i([
|
|
355
|
+
s({ type: String })
|
|
356
|
+
], l.prototype, "value", 1);
|
|
357
|
+
i([
|
|
358
|
+
s({ type: String })
|
|
359
|
+
], l.prototype, "color", 1);
|
|
360
|
+
i([
|
|
361
|
+
s({ attribute: !1 })
|
|
362
|
+
], l.prototype, "activeAxis", 2);
|
|
363
|
+
i([
|
|
364
|
+
s({ type: Number })
|
|
365
|
+
], l.prototype, "x", 1);
|
|
366
|
+
i([
|
|
367
|
+
s({ type: Number })
|
|
368
|
+
], l.prototype, "y", 1);
|
|
369
|
+
i([
|
|
370
|
+
s({ type: Number })
|
|
371
|
+
], l.prototype, "step", 2);
|
|
372
|
+
i([
|
|
373
|
+
b('[name="x"]')
|
|
374
|
+
], l.prototype, "inputX", 2);
|
|
375
|
+
i([
|
|
376
|
+
b('[name="y"]')
|
|
377
|
+
], l.prototype, "inputY", 2);
|
|
378
|
+
customElements.get("luzmo-color-area") || customElements.define("luzmo-color-area", l);
|
|
514
379
|
export {
|
|
515
|
-
LuzmoColorArea
|
|
380
|
+
l as LuzmoColorArea
|
|
516
381
|
};
|