@luzmo/lucero 1.0.1-alpha.18 → 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 -250
- package/components/tooltip/index.js +124 -177
- 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/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,41 +15,28 @@
|
|
|
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
|
-
document.
|
|
18
|
+
import { r as m, x as p, n as e } from "../base-CFWO09N1.js";
|
|
19
|
+
import { F as b } from "../focusable-C5JjRZmT.js";
|
|
20
|
+
import { S as z } from "../sized-mixin-CJbBHWRQ.js";
|
|
21
|
+
const n = () => {
|
|
22
|
+
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
23
|
+
const t = document.createElement("style");
|
|
24
|
+
t.setAttribute("data-luzmo-vars", ""), t.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(t);
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var __defProp = Object.defineProperty;
|
|
33
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
34
|
-
var result = void 0;
|
|
35
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
36
|
-
if (decorator = decorators[i])
|
|
37
|
-
result = decorator(target, key, result) || result;
|
|
38
|
-
if (result) __defProp(target, key, result);
|
|
39
|
-
return result;
|
|
27
|
+
n();
|
|
28
|
+
const h = ":host{box-sizing:border-box}:host([focused]),:host(:focus-visible){outline:none}:host([focused]) #palette,:host(:focus-visible) #palette{border:var(--luzmo-color-palette-focus-indicator-width, var(--color-palette-focus-indicator-width)) solid var(--luzmo-color-palette-focus-indicator-color, var(--color-palette-focus-indicator-color))!important}:host([disabled]){pointer-events:none;cursor:not-allowed}:host([disabled]) #palette{opacity:var(--luzmo-color-palette-disabled-opacity, .3);border-color:transparent!important;background-color:var(--luzmo-color-palette-disabled-background-color, var(--color-palette-disabled-background-color))!important}:host([selected]) #palette{border-color:var(--luzmo-color-palette-selected-border-color, var(--color-palette-selected-border-color));background-color:var(--luzmo-color-palette-selected-background-color, var(--color-palette-selected-background-color))}:host:hover #palette{border-color:var(--luzmo-color-palette-hover-border-color, var(--color-palette-hover-border-color))}#palette{box-sizing:border-box;height:100%;width:fit-content;padding:var(--luzmo-color-palette-padding, var(--color-palette-padding));border:var(--luzmo-color-palette-border-width, var(--color-palette-border-width)) solid transparent;cursor:pointer;border-radius:var(--luzmo-color-palette-border-radius, var(--color-palette-border-radius));display:flex}#palette>div{box-sizing:border-box;border:var(--luzmo-color-palette-color-border-width, var(--color-palette-color-border-width)) solid var(--luzmo-color-palette-color-border-color, var(--color-palette-color-border-color));height:var(--luzmo-color-palette-color-height, var(--color-palette-color-height));width:var(--luzmo-color-palette-color-width, var(--color-palette-color-width))}#palette:hover{background-color:var(--luzmo-color-palette-hover-background-color, var(--color-palette-hover-background-color))}#palette:focus-visible{outline:none}:host(:not([reverse]):not([horizontal])) #palette{flex-direction:column}:host(:not([reverse]):not([horizontal])) #palette>div:not(:first-child){border-top:0}:host(:not([reverse]):not([horizontal])) #palette>div:first-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host(:not([reverse]):not([horizontal])) #palette>div:last-child{border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([reverse]:not([horizontal])) #palette{flex-direction:column-reverse}:host([reverse]:not([horizontal])) #palette>div:not(:first-child){border-bottom:0}:host([reverse]:not([horizontal])) #palette>div:first-child{border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([reverse]:not([horizontal])) #palette>div:last-child{border-bottom-left-radius:0;border-bottom-right-radius:0;border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal]:not([reverse])) #palette{flex-direction:row}:host([horizontal]:not([reverse])) #palette>div:not(:first-child){border-left:0}:host([horizontal]:not([reverse])) #palette>div:first-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal]:not([reverse])) #palette>div:last-child{border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal][reverse]) #palette{flex-direction:row-reverse}:host([horizontal][reverse]) #palette>div:not(:first-child){border-right:0}:host([horizontal][reverse]) #palette>div:first-child{border-top-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-right-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host([horizontal][reverse]) #palette>div:last-child{border-top-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius));border-bottom-left-radius:var(--luzmo-color-palette-color-border-radius, var(--color-palette-color-border-radius))}:host{--color-palette-padding: var(--luzmo-spacing-1);--color-palette-background-color: transparent;--color-palette-hover-background-color: var( --luzmo-background-color-highlight );--color-palette-selected-border-color: var(--luzmo-border-color-down);--color-palette-selected-background-color: var( --luzmo-background-color-highlight-hover );--color-palette-disabled-background-color: transparent;--color-palette-border-width: var(--luzmo-border-width);--color-palette-hover-border-color: var(--luzmo-border-color);--color-palette-focus-indicator-width: var(--luzmo-indicator-width);--color-palette-focus-indicator-color: var(--luzmo-indicator-color);--color-palette-color-width: var(--luzmo-spacing-5);--color-palette-color-height: 1.25rem;--color-palette-color-border-radius: var(--luzmo-border-radius);--color-palette-color-border-width: var(--luzmo-border-width);--color-palette-color-border-color: var(--luzmo-border-color);--color-palette-border-radius: calc( var(--color-palette-color-border-radius) + var(--color-palette-padding) )}:host([horizontal]){--color-palette-color-height: var(--luzmo-spacing-5);--color-palette-color-width: 1.25rem}:host([size=s]){--color-palette-color-width: .75rem;--color-palette-color-height: var(--luzmo-spacing-5);--color-palette-padding: var(--luzmo-spacing-1);--color-palette-color-border-radius: var(--luzmo-border-radius-s)}:host([size=s][horizontal]){--color-palette-color-height: .75rem;--color-palette-color-width: var(--luzmo-spacing-5)}:host([size=l]){--color-palette-color-width: 1.25rem;--color-palette-color-height: 1.5rem;--color-palette-padding: var(--luzmo-spacing-2);--color-palette-color-border-radius: var(--luzmo-border-radius-l)}:host([size=l][horizontal]){--color-palette-color-height: 1.25rem;--color-palette-color-width: 1.5rem}:host([size=xl]){--color-palette-color-width: 1.5rem;--color-palette-color-height: 1.75rem;--color-palette-padding: var(--luzmo-spacing-2);--color-palette-color-border-radius: var(--luzmo-border-radius-xl)}:host([size=xl][horizontal]){--color-palette-color-height: 1.5rem;--color-palette-color-width: 1.75rem}";
|
|
29
|
+
var v = Object.defineProperty, l = (t, r, c, s) => {
|
|
30
|
+
for (var a = void 0, d = t.length - 1, u; d >= 0; d--)
|
|
31
|
+
(u = t[d]) && (a = u(r, c, a) || a);
|
|
32
|
+
return a && v(r, c, a), a;
|
|
40
33
|
};
|
|
41
|
-
const
|
|
34
|
+
const i = class i extends z(b, {
|
|
42
35
|
validSizes: ["s", "m", "l", "xl"],
|
|
43
|
-
noDefaultSize:
|
|
36
|
+
noDefaultSize: !0
|
|
44
37
|
}) {
|
|
45
38
|
constructor() {
|
|
46
|
-
super(...arguments);
|
|
47
|
-
this.disabled = false;
|
|
48
|
-
this.focused = false;
|
|
49
|
-
this.selected = false;
|
|
50
|
-
this.active = false;
|
|
51
|
-
this.reverse = false;
|
|
52
|
-
this.horizontal = false;
|
|
39
|
+
super(...arguments), this.disabled = !1, this.focused = !1, this.selected = !1, this.active = !1, this.reverse = !1, this.horizontal = !1;
|
|
53
40
|
}
|
|
54
41
|
/**
|
|
55
42
|
* @internal
|
|
@@ -58,58 +45,44 @@ const _LuzmoColorPalette = class _LuzmoColorPalette extends SizedMixin(Focusable
|
|
|
58
45
|
return this;
|
|
59
46
|
}
|
|
60
47
|
render() {
|
|
61
|
-
var
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
return html` <div id="palette">${renderColors}</div> `;
|
|
48
|
+
var c;
|
|
49
|
+
const r = (c = this.colors) == null ? void 0 : c.map((s) => p`<div class="color" style="background-color: ${s}"></div>`);
|
|
50
|
+
return p` <div id="palette">${r}</div> `;
|
|
66
51
|
}
|
|
67
|
-
firstUpdated(
|
|
68
|
-
super.firstUpdated(
|
|
52
|
+
firstUpdated(r) {
|
|
53
|
+
super.firstUpdated(r);
|
|
69
54
|
}
|
|
70
|
-
updated(
|
|
71
|
-
super.updated(
|
|
72
|
-
if (changes.has("selected")) {
|
|
73
|
-
this.setAttribute("tabindex", this.selected ? "0" : "-1");
|
|
74
|
-
}
|
|
75
|
-
if (changes.has("disabled")) {
|
|
76
|
-
if (this.disabled) {
|
|
77
|
-
this.setAttribute("aria-disabled", "true");
|
|
78
|
-
} else {
|
|
79
|
-
this.removeAttribute("aria-disabled");
|
|
80
|
-
}
|
|
81
|
-
}
|
|
55
|
+
updated(r) {
|
|
56
|
+
super.updated(r), r.has("selected") && this.setAttribute("tabindex", this.selected ? "0" : "-1"), r.has("disabled") && (this.disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled"));
|
|
82
57
|
}
|
|
83
58
|
};
|
|
84
|
-
|
|
85
|
-
let
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
],
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
],
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
],
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
],
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
],
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
],
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
],
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
],
|
|
110
|
-
|
|
111
|
-
customElements.define("luzmo-color-palette", LuzmoColorPalette);
|
|
112
|
-
}
|
|
59
|
+
i.styles = m(h);
|
|
60
|
+
let o = i;
|
|
61
|
+
l([
|
|
62
|
+
e({ type: Boolean, reflect: !0 })
|
|
63
|
+
], o.prototype, "disabled");
|
|
64
|
+
l([
|
|
65
|
+
e({ type: Boolean, reflect: !0 })
|
|
66
|
+
], o.prototype, "focused");
|
|
67
|
+
l([
|
|
68
|
+
e({ type: Boolean, reflect: !0 })
|
|
69
|
+
], o.prototype, "selected");
|
|
70
|
+
l([
|
|
71
|
+
e({ type: Boolean, reflect: !0 })
|
|
72
|
+
], o.prototype, "active");
|
|
73
|
+
l([
|
|
74
|
+
e({ type: String, reflect: !0 })
|
|
75
|
+
], o.prototype, "value");
|
|
76
|
+
l([
|
|
77
|
+
e({ type: Array, reflect: !0 })
|
|
78
|
+
], o.prototype, "colors");
|
|
79
|
+
l([
|
|
80
|
+
e({ type: Boolean, reflect: !0 })
|
|
81
|
+
], o.prototype, "reverse");
|
|
82
|
+
l([
|
|
83
|
+
e({ type: Boolean, reflect: !0 })
|
|
84
|
+
], o.prototype, "horizontal");
|
|
85
|
+
customElements.get("luzmo-color-palette") || customElements.define("luzmo-color-palette", o);
|
|
113
86
|
export {
|
|
114
|
-
LuzmoColorPalette
|
|
87
|
+
o as LuzmoColorPalette
|
|
115
88
|
};
|
|
@@ -15,270 +15,14 @@
|
|
|
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";
|
|
19
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
20
|
-
const lit = require("lit");
|
|
21
|
-
const mutationController_js = require("@lit-labs/observers/mutation-controller.js");
|
|
22
|
-
const decorators_js = require("lit/decorators.js");
|
|
23
|
-
const ifDefined_js = require("lit/directives/if-defined.js");
|
|
24
|
-
const base = require("../base-COw9n7UR.cjs");
|
|
25
|
-
const rovingTabindex = require("../roving-tabindex-AsmAh2In.cjs");
|
|
26
|
-
const sizedMixin = require("../sized-mixin-UaTVa-AE.cjs");
|
|
27
|
-
const styles = ".color-palette-group{column-gap:var(--luzmo-color-palette-group-column-gap, var(--color-palette-group-column-gap));row-gap:var(--luzmo-color-palette-group-row-gap, var(--color-palette-group-row-gap));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:1}:host{--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}:host([size=s]){--color-palette-group-column-gap: var(--luzmo-spacing-2);--color-palette-group-row-gap: var(--luzmo-spacing-2)}:host,:host([size=l]),:host([size=xl]){--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}";
|
|
28
|
-
var __defProp = Object.defineProperty;
|
|
29
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
30
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
31
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
32
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
33
|
-
if (decorator = decorators[i])
|
|
34
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
35
|
-
if (kind && result) __defProp(target, key, result);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
class LuzmoColorPaletteGroup extends sizedMixin.SizedMixin(base.LuzmoElement, {
|
|
39
|
-
validSizes: ["s", "m", "l", "xl"],
|
|
40
|
-
noDefaultSize: true
|
|
41
|
-
}) {
|
|
42
|
-
constructor() {
|
|
43
|
-
super();
|
|
44
|
-
this.disabled = false;
|
|
45
|
-
this.horizontal = false;
|
|
46
|
-
this._palettes = [];
|
|
47
|
-
this.rovingTabindexController = new rovingTabindex.RovingTabindexController(
|
|
48
|
-
this,
|
|
49
|
-
{
|
|
50
|
-
focusInIndex: (elements) => elements.findIndex(
|
|
51
|
-
(el) => this.selected ? !el.disabled && el.value === this.selected : !el.disabled
|
|
52
|
-
),
|
|
53
|
-
elements: () => this.palettes,
|
|
54
|
-
isFocusableElement: (el) => !el.disabled
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
this.label = "";
|
|
58
|
-
this._onKeyDown = (event) => {
|
|
59
|
-
if (event.code === "Enter" || event.code === "Space") {
|
|
60
|
-
event.preventDefault();
|
|
61
|
-
const target = event.target;
|
|
62
|
-
if (target.value === void 0) {
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this.deselectSelectedPalettes();
|
|
66
|
-
target.selected = true;
|
|
67
|
-
target.tabIndex = 0;
|
|
68
|
-
target.setAttribute("aria-checked", "true");
|
|
69
|
-
this.setSelected(target.value, true);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
this.manageColorPalettes = () => {
|
|
73
|
-
if (!this.slotElement) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const assignedElements = this.slotElement.assignedElements({
|
|
77
|
-
flatten: true
|
|
78
|
-
});
|
|
79
|
-
const palettes = assignedElements.reduce((acc, el) => {
|
|
80
|
-
if (el.matches("luzmo-color-palette")) {
|
|
81
|
-
acc.push(el);
|
|
82
|
-
} else {
|
|
83
|
-
const paletteDescendents = [
|
|
84
|
-
...el.querySelectorAll(`:scope > ${"luzmo-color-palette"}`)
|
|
85
|
-
];
|
|
86
|
-
acc.push(...paletteDescendents);
|
|
87
|
-
}
|
|
88
|
-
return acc;
|
|
89
|
-
}, []);
|
|
90
|
-
this.palettes = palettes;
|
|
91
|
-
this.manageChildren();
|
|
92
|
-
this.manageSelects();
|
|
93
|
-
};
|
|
94
|
-
new mutationController_js.MutationController(this, {
|
|
95
|
-
config: {
|
|
96
|
-
childList: true,
|
|
97
|
-
subtree: true
|
|
98
|
-
},
|
|
99
|
-
callback: () => {
|
|
100
|
-
this.manageColorPalettes();
|
|
101
|
-
},
|
|
102
|
-
skipInitial: true
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* The styles of the color palette
|
|
107
|
-
* @internal
|
|
108
|
-
*/
|
|
109
|
-
static get styles() {
|
|
110
|
-
return [lit.unsafeCSS(styles)];
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* The color palette elements in the group
|
|
114
|
-
* @internal
|
|
115
|
-
*/
|
|
116
|
-
set palettes(palettes) {
|
|
117
|
-
if (palettes === this.palettes) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
this._palettes = palettes;
|
|
121
|
-
this.rovingTabindexController.clearElementCache();
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* The color palette elements in the group
|
|
125
|
-
* @internal
|
|
126
|
-
*/
|
|
127
|
-
get palettes() {
|
|
128
|
-
return this._palettes;
|
|
129
|
-
}
|
|
130
|
-
get selected() {
|
|
131
|
-
return this._selected;
|
|
132
|
-
}
|
|
133
|
-
set selected(selected) {
|
|
134
|
-
this.requestUpdate("selected", this._selected);
|
|
135
|
-
this._selected = selected;
|
|
136
|
-
this.updateComplete.then(() => {
|
|
137
|
-
this.applySelects();
|
|
138
|
-
this.manageChildren();
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
dispatchChange(old) {
|
|
142
|
-
const applyDefault = this.dispatchEvent(
|
|
143
|
-
new Event("change", {
|
|
144
|
-
bubbles: true,
|
|
145
|
-
composed: true,
|
|
146
|
-
cancelable: true
|
|
147
|
-
})
|
|
148
|
-
);
|
|
149
|
-
if (!applyDefault) {
|
|
150
|
-
this.setSelected(old);
|
|
151
|
-
this.palettes.map((palette) => {
|
|
152
|
-
palette.selected = palette.value && this.selected === palette.value ? true : false;
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
setSelected(selected, announce) {
|
|
157
|
-
if (selected === this.selected) {
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
const old = this.selected;
|
|
161
|
-
this.requestUpdate("selected", old);
|
|
162
|
-
this._selected = selected;
|
|
163
|
-
if (!announce) {
|
|
164
|
-
return;
|
|
165
|
-
}
|
|
166
|
-
this.dispatchChange(old);
|
|
167
|
-
}
|
|
168
|
-
focus(options) {
|
|
169
|
-
this.rovingTabindexController.focus(options);
|
|
170
|
-
}
|
|
171
|
-
deselectSelectedPalettes() {
|
|
172
|
-
this.palettes.forEach((palette) => {
|
|
173
|
-
if (!palette.selected) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
palette.selected = false;
|
|
177
|
-
palette.tabIndex = -1;
|
|
178
|
-
palette.setAttribute("aria-checked", "false");
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
_handleClick(event) {
|
|
182
|
-
const target = event.target;
|
|
183
|
-
if (target.value === void 0) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
this.deselectSelectedPalettes();
|
|
187
|
-
target.selected = true;
|
|
188
|
-
target.tabIndex = 0;
|
|
189
|
-
target.setAttribute("aria-checked", "true");
|
|
190
|
-
this.setSelected(target.value, true);
|
|
191
|
-
}
|
|
192
|
-
async applySelects() {
|
|
193
|
-
await this.manageSelects();
|
|
194
|
-
}
|
|
195
|
-
async manageSelects() {
|
|
196
|
-
if (this.palettes.length === 0) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
const options = this.palettes;
|
|
200
|
-
this.setAttribute("role", "radiogroup");
|
|
201
|
-
const selections = [];
|
|
202
|
-
const updates = options.map(async (option) => {
|
|
203
|
-
await option.updateComplete;
|
|
204
|
-
option.setAttribute("role", "radio");
|
|
205
|
-
option.setAttribute("aria-checked", option.selected ? "true" : "false");
|
|
206
|
-
if (option.selected) {
|
|
207
|
-
selections.push(option);
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
await Promise.all(updates);
|
|
211
|
-
const selected = selections.map((palette) => palette.value).find(Boolean);
|
|
212
|
-
this.setSelected(selected);
|
|
213
|
-
}
|
|
214
|
-
render() {
|
|
215
|
-
return lit.html`
|
|
18
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../base-Cy0MQrPT.cjs"),u=require("../mutation-controller-DkOMCW-c.cjs"),d=require("../query-BL-TJj7K.cjs"),p=require("../if-defined-DaXWqfzc.cjs"),h=require("../roving-tabindex-By_fCy_e.cjs"),g=require("../sized-mixin-WPHH0a_D.cjs"),m=".color-palette-group{column-gap:var(--luzmo-color-palette-group-column-gap, var(--color-palette-group-column-gap));row-gap:var(--luzmo-color-palette-group-row-gap, var(--color-palette-group-row-gap));flex-wrap:wrap;display:flex}::slotted(*){flex-shrink:0}::slotted(:focus-visible){z-index:1}:host{--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}:host([size=s]){--color-palette-group-column-gap: var(--luzmo-spacing-2);--color-palette-group-row-gap: var(--luzmo-spacing-2)}:host,:host([size=l]),:host([size=xl]){--color-palette-group-column-gap: var(--luzmo-spacing-3);--color-palette-group-row-gap: var(--luzmo-spacing-3)}";var f=Object.defineProperty,b=Object.getOwnPropertyDescriptor,o=(n,e,t,s)=>{for(var a=s>1?void 0:s?b(e,t):e,l=n.length-1,c;l>=0;l--)(c=n[l])&&(a=(s?c(e,t,a):c(a))||a);return s&&a&&f(e,t,a),a};class i extends g.SizedMixin(r.LuzmoElement,{validSizes:["s","m","l","xl"],noDefaultSize:!0}){constructor(){super(),this.disabled=!1,this.horizontal=!1,this._palettes=[],this.rovingTabindexController=new h.RovingTabindexController(this,{focusInIndex:e=>e.findIndex(t=>this.selected?!t.disabled&&t.value===this.selected:!t.disabled),elements:()=>this.palettes,isFocusableElement:e=>!e.disabled}),this.label="",this._onKeyDown=e=>{if(e.code==="Enter"||e.code==="Space"){e.preventDefault();const t=e.target;if(t.value===void 0)return;this.deselectSelectedPalettes(),t.selected=!0,t.tabIndex=0,t.setAttribute("aria-checked","true"),this.setSelected(t.value,!0)}},this.manageColorPalettes=()=>{if(!this.slotElement)return;const t=this.slotElement.assignedElements({flatten:!0}).reduce((s,a)=>{if(a.matches("luzmo-color-palette"))s.push(a);else{const l=[...a.querySelectorAll(":scope > luzmo-color-palette")];s.push(...l)}return s},[]);this.palettes=t,this.manageChildren(),this.manageSelects()},new u.s(this,{config:{childList:!0,subtree:!0},callback:()=>{this.manageColorPalettes()},skipInitial:!0})}static get styles(){return[r.r(m)]}set palettes(e){e!==this.palettes&&(this._palettes=e,this.rovingTabindexController.clearElementCache())}get palettes(){return this._palettes}get selected(){return this._selected}set selected(e){this.requestUpdate("selected",this._selected),this._selected=e,this.updateComplete.then(()=>{this.applySelects(),this.manageChildren()})}dispatchChange(e){this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||(this.setSelected(e),this.palettes.map(s=>{s.selected=!!(s.value&&this.selected===s.value)}))}setSelected(e,t){if(e===this.selected)return;const s=this.selected;this.requestUpdate("selected",s),this._selected=e,t&&this.dispatchChange(s)}focus(e){this.rovingTabindexController.focus(e)}deselectSelectedPalettes(){this.palettes.forEach(e=>{e.selected&&(e.selected=!1,e.tabIndex=-1,e.setAttribute("aria-checked","false"))})}_handleClick(e){const t=e.target;t.value!==void 0&&(this.deselectSelectedPalettes(),t.selected=!0,t.tabIndex=0,t.setAttribute("aria-checked","true"),this.setSelected(t.value,!0))}async applySelects(){await this.manageSelects()}async manageSelects(){if(this.palettes.length===0)return;const e=this.palettes;this.setAttribute("role","radiogroup");const t=[],s=e.map(async l=>{await l.updateComplete,l.setAttribute("role","radio"),l.setAttribute("aria-checked",l.selected?"true":"false"),l.selected&&t.push(l)});await Promise.all(s);const a=t.map(l=>l.value).find(Boolean);this.setSelected(a)}render(){return r.x`
|
|
216
19
|
<div
|
|
217
20
|
class="color-palette-group"
|
|
218
|
-
aria-label=${
|
|
21
|
+
aria-label=${p.o(this.label??void 0)}
|
|
219
22
|
role="radiogroup"
|
|
220
23
|
@keydown=${this._onKeyDown}
|
|
221
24
|
@slotchange=${this.manageColorPalettes}
|
|
222
25
|
>
|
|
223
26
|
<slot role="presentation"></slot>
|
|
224
27
|
</div>
|
|
225
|
-
|
|
226
|
-
}
|
|
227
|
-
firstUpdated(changes) {
|
|
228
|
-
super.firstUpdated(changes);
|
|
229
|
-
this.addEventListener("click", this._handleClick);
|
|
230
|
-
}
|
|
231
|
-
updated(changes) {
|
|
232
|
-
super.updated(changes);
|
|
233
|
-
const hasHorizontal = changes.has("horizontal");
|
|
234
|
-
if (hasHorizontal) {
|
|
235
|
-
this.palettes.forEach((palette) => {
|
|
236
|
-
palette.horizontal = this.horizontal;
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
this.manageSelects();
|
|
240
|
-
this.manageChildren();
|
|
241
|
-
if (changes.has("size")) {
|
|
242
|
-
this.manageChildren(changes);
|
|
243
|
-
}
|
|
244
|
-
if (changes.has("label") && (this.label || changes.get("label") !== void 0)) {
|
|
245
|
-
if (this.label.length > 0) {
|
|
246
|
-
this.setAttribute("aria-label", this.label);
|
|
247
|
-
} else {
|
|
248
|
-
this.removeAttribute("aria-label");
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
manageChildren(changes) {
|
|
253
|
-
this.palettes.forEach((palette) => {
|
|
254
|
-
palette.setAttribute("aria-label", `color palette: ${palette.value}`);
|
|
255
|
-
palette.selected = palette.value && this.selected === palette.value ? true : false;
|
|
256
|
-
if (this.size && (this.size !== "m" || (changes == null ? void 0 : changes.get("size")) !== void 0)) {
|
|
257
|
-
palette.size = this.size;
|
|
258
|
-
}
|
|
259
|
-
if (this.disabled) {
|
|
260
|
-
palette.disabled = true;
|
|
261
|
-
}
|
|
262
|
-
palette.horizontal = this.horizontal;
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
__decorateClass([
|
|
267
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
268
|
-
], LuzmoColorPaletteGroup.prototype, "disabled", 2);
|
|
269
|
-
__decorateClass([
|
|
270
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
271
|
-
], LuzmoColorPaletteGroup.prototype, "horizontal", 2);
|
|
272
|
-
__decorateClass([
|
|
273
|
-
decorators_js.property({ type: String })
|
|
274
|
-
], LuzmoColorPaletteGroup.prototype, "label", 2);
|
|
275
|
-
__decorateClass([
|
|
276
|
-
decorators_js.property({ type: String })
|
|
277
|
-
], LuzmoColorPaletteGroup.prototype, "selected", 1);
|
|
278
|
-
__decorateClass([
|
|
279
|
-
decorators_js.query("slot")
|
|
280
|
-
], LuzmoColorPaletteGroup.prototype, "slotElement", 2);
|
|
281
|
-
if (!customElements.get("luzmo-color-palette-group")) {
|
|
282
|
-
customElements.define("luzmo-color-palette-group", LuzmoColorPaletteGroup);
|
|
283
|
-
}
|
|
284
|
-
exports.LuzmoColorPaletteGroup = LuzmoColorPaletteGroup;
|
|
28
|
+
`}firstUpdated(e){super.firstUpdated(e),this.addEventListener("click",this._handleClick)}updated(e){super.updated(e),e.has("horizontal")&&this.palettes.forEach(s=>{s.horizontal=this.horizontal}),this.manageSelects(),this.manageChildren(),e.has("size")&&this.manageChildren(e),e.has("label")&&(this.label||e.get("label")!==void 0)&&(this.label.length>0?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"))}manageChildren(e){this.palettes.forEach(t=>{t.setAttribute("aria-label",`color palette: ${t.value}`),t.selected=!!(t.value&&this.selected===t.value),this.size&&(this.size!=="m"||(e==null?void 0:e.get("size"))!==void 0)&&(t.size=this.size),this.disabled&&(t.disabled=!0),t.horizontal=this.horizontal})}}o([r.n({type:Boolean,reflect:!0})],i.prototype,"disabled",2);o([r.n({type:Boolean,reflect:!0})],i.prototype,"horizontal",2);o([r.n({type:String})],i.prototype,"label",2);o([r.n({type:String})],i.prototype,"selected",1);o([d.e("slot")],i.prototype,"slotElement",2);customElements.get("luzmo-color-palette-group")||customElements.define("luzmo-color-palette-group",i);exports.LuzmoColorPaletteGroup=i;
|