@luzmo/lucero 1.0.1-alpha.15 → 1.0.1-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +155 -131
- package/components/tooltip/tooltip.d.ts +1 -12
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-BbVqNU-g.js +0 -53
- package/components/clear-button-DYdeFsS8.cjs +0 -18
- package/components/close-button-CpfKibqg.cjs +0 -18
- package/components/close-button-DzOZZmkY.js +0 -51
- package/components/color-controller-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-BQoI8AD3.cjs +0 -113
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cb9zsiz6.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-D47EGj-3.cjs +0 -29
- package/components/luzmo-icons-NEyaMpEM.js +0 -229
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-CaH1si5b.cjs +0 -26
- package/components/picker-CAYj4hBD.js +0 -461
- package/components/picker-apS0Zrly.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-BYF2RHY8.cjs +0 -85
- package/components/text-field-PYafEYeO.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
|
@@ -15,73 +15,98 @@
|
|
|
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
|
-
|
|
24
|
-
const n = () => {
|
|
25
|
-
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
26
|
-
const s = document.createElement("style");
|
|
27
|
-
s.setAttribute("data-luzmo-vars", ""), s.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(s);
|
|
18
|
+
const initializeGlobalLuzmoCSSVariables = () => {
|
|
19
|
+
if (typeof document !== "undefined" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
const styleElement = document.createElement("style");
|
|
21
|
+
styleElement.setAttribute("data-luzmo-vars", "");
|
|
22
|
+
styleElement.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}`;
|
|
23
|
+
document.head.appendChild(styleElement);
|
|
28
24
|
}
|
|
29
25
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
initializeGlobalLuzmoCSSVariables();
|
|
27
|
+
import { unsafeCSS, html } from "lit";
|
|
28
|
+
import { MutationController } from "@lit-labs/observers/mutation-controller.js";
|
|
29
|
+
import { property, query } from "lit/decorators.js";
|
|
30
|
+
import { ifDefined } from "lit/directives/if-defined.js";
|
|
31
|
+
import { a as LuzmoElement } from "../base-DmeVy0cq.js";
|
|
32
|
+
import { R as RovingTabindexController } from "../roving-tabindex-DPF9NmrH.js";
|
|
33
|
+
import { S as SizedMixin } from "../sized-mixin-DmkrNdWB.js";
|
|
34
|
+
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)}";
|
|
35
|
+
var __defProp = Object.defineProperty;
|
|
36
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
37
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
38
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
39
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
40
|
+
if (decorator = decorators[i])
|
|
41
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
42
|
+
if (kind && result) __defProp(target, key, result);
|
|
43
|
+
return result;
|
|
36
44
|
};
|
|
37
|
-
class
|
|
45
|
+
class LuzmoColorPaletteGroup extends SizedMixin(LuzmoElement, {
|
|
38
46
|
validSizes: ["s", "m", "l", "xl"],
|
|
39
|
-
noDefaultSize:
|
|
47
|
+
noDefaultSize: true
|
|
40
48
|
}) {
|
|
41
49
|
constructor() {
|
|
42
|
-
super()
|
|
50
|
+
super();
|
|
51
|
+
this.disabled = false;
|
|
52
|
+
this.horizontal = false;
|
|
53
|
+
this._palettes = [];
|
|
54
|
+
this.rovingTabindexController = new RovingTabindexController(
|
|
43
55
|
this,
|
|
44
56
|
{
|
|
45
|
-
focusInIndex: (
|
|
46
|
-
(
|
|
57
|
+
focusInIndex: (elements) => elements.findIndex(
|
|
58
|
+
(el) => this.selected ? !el.disabled && el.value === this.selected : !el.disabled
|
|
47
59
|
),
|
|
48
60
|
elements: () => this.palettes,
|
|
49
|
-
isFocusableElement: (
|
|
61
|
+
isFocusableElement: (el) => !el.disabled
|
|
50
62
|
}
|
|
51
|
-
)
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
63
|
+
);
|
|
64
|
+
this.label = "";
|
|
65
|
+
this._onKeyDown = (event) => {
|
|
66
|
+
if (event.code === "Enter" || event.code === "Space") {
|
|
67
|
+
event.preventDefault();
|
|
68
|
+
const target = event.target;
|
|
69
|
+
if (target.value === void 0) {
|
|
56
70
|
return;
|
|
57
|
-
|
|
71
|
+
}
|
|
72
|
+
this.deselectSelectedPalettes();
|
|
73
|
+
target.selected = true;
|
|
74
|
+
target.tabIndex = 0;
|
|
75
|
+
target.setAttribute("aria-checked", "true");
|
|
76
|
+
this.setSelected(target.value, true);
|
|
58
77
|
}
|
|
59
|
-
}
|
|
60
|
-
|
|
78
|
+
};
|
|
79
|
+
this.manageColorPalettes = () => {
|
|
80
|
+
if (!this.slotElement) {
|
|
61
81
|
return;
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
82
|
+
}
|
|
83
|
+
const assignedElements = this.slotElement.assignedElements({
|
|
84
|
+
flatten: true
|
|
85
|
+
});
|
|
86
|
+
const palettes = assignedElements.reduce((acc, el) => {
|
|
87
|
+
if (el.matches("luzmo-color-palette")) {
|
|
88
|
+
acc.push(el);
|
|
89
|
+
} else {
|
|
90
|
+
const paletteDescendents = [
|
|
91
|
+
...el.querySelectorAll(`:scope > ${"luzmo-color-palette"}`)
|
|
70
92
|
];
|
|
71
|
-
|
|
93
|
+
acc.push(...paletteDescendents);
|
|
72
94
|
}
|
|
73
|
-
return
|
|
95
|
+
return acc;
|
|
74
96
|
}, []);
|
|
75
|
-
this.palettes =
|
|
76
|
-
|
|
97
|
+
this.palettes = palettes;
|
|
98
|
+
this.manageChildren();
|
|
99
|
+
this.manageSelects();
|
|
100
|
+
};
|
|
101
|
+
new MutationController(this, {
|
|
77
102
|
config: {
|
|
78
|
-
childList:
|
|
79
|
-
subtree:
|
|
103
|
+
childList: true,
|
|
104
|
+
subtree: true
|
|
80
105
|
},
|
|
81
106
|
callback: () => {
|
|
82
107
|
this.manageColorPalettes();
|
|
83
108
|
},
|
|
84
|
-
skipInitial:
|
|
109
|
+
skipInitial: true
|
|
85
110
|
});
|
|
86
111
|
}
|
|
87
112
|
/**
|
|
@@ -89,14 +114,18 @@ class a extends b(d, {
|
|
|
89
114
|
* @internal
|
|
90
115
|
*/
|
|
91
116
|
static get styles() {
|
|
92
|
-
return [
|
|
117
|
+
return [unsafeCSS(styles)];
|
|
93
118
|
}
|
|
94
119
|
/**
|
|
95
120
|
* The color palette elements in the group
|
|
96
121
|
* @internal
|
|
97
122
|
*/
|
|
98
|
-
set palettes(
|
|
99
|
-
|
|
123
|
+
set palettes(palettes) {
|
|
124
|
+
if (palettes === this.palettes) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
this._palettes = palettes;
|
|
128
|
+
this.rovingTabindexController.clearElementCache();
|
|
100
129
|
}
|
|
101
130
|
/**
|
|
102
131
|
* The color palette elements in the group
|
|
@@ -108,60 +137,92 @@ class a extends b(d, {
|
|
|
108
137
|
get selected() {
|
|
109
138
|
return this._selected;
|
|
110
139
|
}
|
|
111
|
-
set selected(
|
|
112
|
-
this.requestUpdate("selected", this._selected)
|
|
113
|
-
|
|
140
|
+
set selected(selected) {
|
|
141
|
+
this.requestUpdate("selected", this._selected);
|
|
142
|
+
this._selected = selected;
|
|
143
|
+
this.updateComplete.then(() => {
|
|
144
|
+
this.applySelects();
|
|
145
|
+
this.manageChildren();
|
|
114
146
|
});
|
|
115
147
|
}
|
|
116
|
-
dispatchChange(
|
|
117
|
-
this.dispatchEvent(
|
|
148
|
+
dispatchChange(old) {
|
|
149
|
+
const applyDefault = this.dispatchEvent(
|
|
118
150
|
new Event("change", {
|
|
119
|
-
bubbles:
|
|
120
|
-
composed:
|
|
121
|
-
cancelable:
|
|
151
|
+
bubbles: true,
|
|
152
|
+
composed: true,
|
|
153
|
+
cancelable: true
|
|
122
154
|
})
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
|
|
155
|
+
);
|
|
156
|
+
if (!applyDefault) {
|
|
157
|
+
this.setSelected(old);
|
|
158
|
+
this.palettes.map((palette) => {
|
|
159
|
+
palette.selected = palette.value && this.selected === palette.value ? true : false;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
126
162
|
}
|
|
127
|
-
setSelected(
|
|
128
|
-
if (
|
|
163
|
+
setSelected(selected, announce) {
|
|
164
|
+
if (selected === this.selected) {
|
|
129
165
|
return;
|
|
130
|
-
|
|
131
|
-
|
|
166
|
+
}
|
|
167
|
+
const old = this.selected;
|
|
168
|
+
this.requestUpdate("selected", old);
|
|
169
|
+
this._selected = selected;
|
|
170
|
+
if (!announce) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
this.dispatchChange(old);
|
|
132
174
|
}
|
|
133
|
-
focus(
|
|
134
|
-
this.rovingTabindexController.focus(
|
|
175
|
+
focus(options) {
|
|
176
|
+
this.rovingTabindexController.focus(options);
|
|
135
177
|
}
|
|
136
178
|
deselectSelectedPalettes() {
|
|
137
|
-
this.palettes.forEach((
|
|
138
|
-
|
|
179
|
+
this.palettes.forEach((palette) => {
|
|
180
|
+
if (!palette.selected) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
palette.selected = false;
|
|
184
|
+
palette.tabIndex = -1;
|
|
185
|
+
palette.setAttribute("aria-checked", "false");
|
|
139
186
|
});
|
|
140
187
|
}
|
|
141
|
-
_handleClick(
|
|
142
|
-
const
|
|
143
|
-
|
|
188
|
+
_handleClick(event) {
|
|
189
|
+
const target = event.target;
|
|
190
|
+
if (target.value === void 0) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this.deselectSelectedPalettes();
|
|
194
|
+
target.selected = true;
|
|
195
|
+
target.tabIndex = 0;
|
|
196
|
+
target.setAttribute("aria-checked", "true");
|
|
197
|
+
this.setSelected(target.value, true);
|
|
144
198
|
}
|
|
145
199
|
async applySelects() {
|
|
146
200
|
await this.manageSelects();
|
|
147
201
|
}
|
|
148
202
|
async manageSelects() {
|
|
149
|
-
if (this.palettes.length === 0)
|
|
203
|
+
if (this.palettes.length === 0) {
|
|
150
204
|
return;
|
|
151
|
-
|
|
205
|
+
}
|
|
206
|
+
const options = this.palettes;
|
|
152
207
|
this.setAttribute("role", "radiogroup");
|
|
153
|
-
const
|
|
154
|
-
|
|
208
|
+
const selections = [];
|
|
209
|
+
const updates = options.map(async (option) => {
|
|
210
|
+
await option.updateComplete;
|
|
211
|
+
option.setAttribute("role", "radio");
|
|
212
|
+
option.setAttribute("aria-checked", option.selected ? "true" : "false");
|
|
213
|
+
if (option.selected) {
|
|
214
|
+
selections.push(option);
|
|
215
|
+
}
|
|
155
216
|
});
|
|
156
|
-
await Promise.all(
|
|
157
|
-
const
|
|
158
|
-
this.setSelected(
|
|
217
|
+
await Promise.all(updates);
|
|
218
|
+
const selected = selections.map((palette) => palette.value).find(Boolean);
|
|
219
|
+
this.setSelected(selected);
|
|
159
220
|
}
|
|
160
221
|
render() {
|
|
161
|
-
return
|
|
222
|
+
return html`
|
|
162
223
|
<div
|
|
163
224
|
class="color-palette-group"
|
|
164
|
-
aria-label=${
|
|
225
|
+
aria-label=${ifDefined(this.label ?? void 0)}
|
|
165
226
|
role="radiogroup"
|
|
166
227
|
@keydown=${this._onKeyDown}
|
|
167
228
|
@slotchange=${this.manageColorPalettes}
|
|
@@ -170,36 +231,63 @@ class a extends b(d, {
|
|
|
170
231
|
</div>
|
|
171
232
|
`;
|
|
172
233
|
}
|
|
173
|
-
firstUpdated(
|
|
174
|
-
super.firstUpdated(
|
|
234
|
+
firstUpdated(changes) {
|
|
235
|
+
super.firstUpdated(changes);
|
|
236
|
+
this.addEventListener("click", this._handleClick);
|
|
175
237
|
}
|
|
176
|
-
updated(
|
|
177
|
-
super.updated(
|
|
178
|
-
|
|
179
|
-
|
|
238
|
+
updated(changes) {
|
|
239
|
+
super.updated(changes);
|
|
240
|
+
const hasHorizontal = changes.has("horizontal");
|
|
241
|
+
if (hasHorizontal) {
|
|
242
|
+
this.palettes.forEach((palette) => {
|
|
243
|
+
palette.horizontal = this.horizontal;
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
this.manageSelects();
|
|
247
|
+
this.manageChildren();
|
|
248
|
+
if (changes.has("size")) {
|
|
249
|
+
this.manageChildren(changes);
|
|
250
|
+
}
|
|
251
|
+
if (changes.has("label") && (this.label || changes.get("label") !== void 0)) {
|
|
252
|
+
if (this.label.length > 0) {
|
|
253
|
+
this.setAttribute("aria-label", this.label);
|
|
254
|
+
} else {
|
|
255
|
+
this.removeAttribute("aria-label");
|
|
256
|
+
}
|
|
257
|
+
}
|
|
180
258
|
}
|
|
181
|
-
manageChildren(
|
|
182
|
-
this.palettes.forEach((
|
|
183
|
-
|
|
259
|
+
manageChildren(changes) {
|
|
260
|
+
this.palettes.forEach((palette) => {
|
|
261
|
+
palette.setAttribute("aria-label", `color palette: ${palette.value}`);
|
|
262
|
+
palette.selected = palette.value && this.selected === palette.value ? true : false;
|
|
263
|
+
if (this.size && (this.size !== "m" || (changes == null ? void 0 : changes.get("size")) !== void 0)) {
|
|
264
|
+
palette.size = this.size;
|
|
265
|
+
}
|
|
266
|
+
if (this.disabled) {
|
|
267
|
+
palette.disabled = true;
|
|
268
|
+
}
|
|
269
|
+
palette.horizontal = this.horizontal;
|
|
184
270
|
});
|
|
185
271
|
}
|
|
186
272
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
],
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
],
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
],
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
],
|
|
202
|
-
customElements.get("luzmo-color-palette-group")
|
|
273
|
+
__decorateClass([
|
|
274
|
+
property({ type: Boolean, reflect: true })
|
|
275
|
+
], LuzmoColorPaletteGroup.prototype, "disabled", 2);
|
|
276
|
+
__decorateClass([
|
|
277
|
+
property({ type: Boolean, reflect: true })
|
|
278
|
+
], LuzmoColorPaletteGroup.prototype, "horizontal", 2);
|
|
279
|
+
__decorateClass([
|
|
280
|
+
property({ type: String })
|
|
281
|
+
], LuzmoColorPaletteGroup.prototype, "label", 2);
|
|
282
|
+
__decorateClass([
|
|
283
|
+
property({ type: String })
|
|
284
|
+
], LuzmoColorPaletteGroup.prototype, "selected", 1);
|
|
285
|
+
__decorateClass([
|
|
286
|
+
query("slot")
|
|
287
|
+
], LuzmoColorPaletteGroup.prototype, "slotElement", 2);
|
|
288
|
+
if (!customElements.get("luzmo-color-palette-group")) {
|
|
289
|
+
customElements.define("luzmo-color-palette-group", LuzmoColorPaletteGroup);
|
|
290
|
+
}
|
|
203
291
|
export {
|
|
204
|
-
|
|
292
|
+
LuzmoColorPaletteGroup
|
|
205
293
|
};
|
|
@@ -15,7 +15,68 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
"use strict";
|
|
18
|
+
"use strict";
|
|
19
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
20
|
+
const lit = require("lit");
|
|
21
|
+
const decorators_js = require("lit/decorators.js");
|
|
22
|
+
const base = require("../base-COw9n7UR.cjs");
|
|
23
|
+
const sizedMixin = require("../sized-mixin-UaTVa-AE.cjs");
|
|
24
|
+
require("../color-menu/index.cjs");
|
|
25
|
+
require("../overlay/index.cjs");
|
|
26
|
+
const slottableRequestEvent = require("../slottable-request-event-CANixJnR.cjs");
|
|
27
|
+
require("../popover/index.cjs");
|
|
28
|
+
require("../swatch/index.cjs");
|
|
29
|
+
const styles = "luzmo-popover{margin-left:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap));margin-right:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap))}luzmo-swatch{cursor:pointer}:host([read-only]) luzmo-swatch{cursor:default;pointer-events:none}:host{--luzmo-popover-content-area-spacing-vertical: 0;--color-picker-popover-horizontal-gap: var(--luzmo-spacing-4)}:host([size=s]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-3)}:host([size=l]),:host([size=xl]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-5)}";
|
|
30
|
+
var __defProp = Object.defineProperty;
|
|
31
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
32
|
+
var result = void 0;
|
|
33
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
34
|
+
if (decorator = decorators[i])
|
|
35
|
+
result = decorator(target, key, result) || result;
|
|
36
|
+
if (result) __defProp(target, key, result);
|
|
37
|
+
return result;
|
|
38
|
+
};
|
|
39
|
+
const _LuzmoColorPicker = class _LuzmoColorPicker extends sizedMixin.SizedMixin(base.LuzmoElement) {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.color = "rgb(255, 0, 0)";
|
|
43
|
+
this.open = false;
|
|
44
|
+
this.disabled = false;
|
|
45
|
+
this.readOnly = false;
|
|
46
|
+
this.placement = "left-start";
|
|
47
|
+
this.rounding = "full";
|
|
48
|
+
this.swatches = [];
|
|
49
|
+
this.noAlphaChannel = false;
|
|
50
|
+
this._renderMenu = false;
|
|
51
|
+
}
|
|
52
|
+
overlayCloseEvent() {
|
|
53
|
+
this.open = false;
|
|
54
|
+
}
|
|
55
|
+
overlayOpenEvent() {
|
|
56
|
+
this.open = true;
|
|
57
|
+
}
|
|
58
|
+
handleColorChange() {
|
|
59
|
+
const menuColor = this.menuElement.color;
|
|
60
|
+
this.color = typeof menuColor === "string" ? menuColor : String(menuColor);
|
|
61
|
+
this.dispatchEvent(
|
|
62
|
+
new Event("change", {
|
|
63
|
+
bubbles: true,
|
|
64
|
+
composed: true
|
|
65
|
+
})
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
firstUpdated() {
|
|
69
|
+
this.overlayElement.addEventListener("slottable-request", (event) => {
|
|
70
|
+
this._renderMenu = event.data === slottableRequestEvent.removeSlottableRequest ? false : true;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
updated(changedProperties) {
|
|
74
|
+
if (changedProperties.has("open") && this.open === true) {
|
|
75
|
+
this._renderMenu = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
renderColorMenu() {
|
|
79
|
+
return lit.html`
|
|
19
80
|
<luzmo-color-menu
|
|
20
81
|
.size=${this.size}
|
|
21
82
|
.color=${this.color}
|
|
@@ -23,26 +84,73 @@
|
|
|
23
84
|
.swatches=${this.swatches}
|
|
24
85
|
@change=${this.handleColorChange}
|
|
25
86
|
></luzmo-color-menu>
|
|
26
|
-
|
|
87
|
+
`;
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
return lit.html`
|
|
27
91
|
<luzmo-swatch
|
|
28
92
|
id="trigger"
|
|
29
93
|
.shape=${this.shape}
|
|
30
94
|
.rounding=${this.rounding}
|
|
31
95
|
.size=${this.size}
|
|
32
96
|
.color=${this.color}
|
|
33
|
-
.selected=${this.open
|
|
97
|
+
.selected=${this.open && !this.disabled}
|
|
34
98
|
?disabled=${this.disabled}
|
|
35
99
|
?read-only=${this.readOnly}
|
|
36
100
|
@luzmo-closed=${this.overlayCloseEvent}
|
|
37
101
|
@luzmo-opened=${this.overlayOpenEvent}
|
|
38
102
|
></luzmo-swatch>
|
|
39
103
|
<luzmo-overlay
|
|
40
|
-
trigger=${this.disabled||this.readOnly?"":"trigger@click"}
|
|
104
|
+
trigger=${this.disabled || this.readOnly ? "" : "trigger@click"}
|
|
41
105
|
.placement=${this.placement}
|
|
42
106
|
type="auto"
|
|
43
107
|
>
|
|
44
108
|
<luzmo-popover style="position:relative">
|
|
45
|
-
${this._renderMenu?this.renderColorMenu():
|
|
109
|
+
${this._renderMenu ? this.renderColorMenu() : lit.html``}
|
|
46
110
|
</luzmo-popover>
|
|
47
111
|
</luzmo-overlay>
|
|
48
|
-
|
|
112
|
+
`;
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
_LuzmoColorPicker.styles = lit.unsafeCSS(styles);
|
|
116
|
+
let LuzmoColorPicker = _LuzmoColorPicker;
|
|
117
|
+
__decorateClass([
|
|
118
|
+
decorators_js.property({ type: String, reflect: true })
|
|
119
|
+
], LuzmoColorPicker.prototype, "color");
|
|
120
|
+
__decorateClass([
|
|
121
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
122
|
+
], LuzmoColorPicker.prototype, "open");
|
|
123
|
+
__decorateClass([
|
|
124
|
+
decorators_js.property({ type: Boolean, reflect: true })
|
|
125
|
+
], LuzmoColorPicker.prototype, "disabled");
|
|
126
|
+
__decorateClass([
|
|
127
|
+
decorators_js.property({ type: Boolean, reflect: true, attribute: "read-only" })
|
|
128
|
+
], LuzmoColorPicker.prototype, "readOnly");
|
|
129
|
+
__decorateClass([
|
|
130
|
+
decorators_js.property({ type: String, reflect: true })
|
|
131
|
+
], LuzmoColorPicker.prototype, "placement");
|
|
132
|
+
__decorateClass([
|
|
133
|
+
decorators_js.property({ type: String, reflect: true })
|
|
134
|
+
], LuzmoColorPicker.prototype, "rounding");
|
|
135
|
+
__decorateClass([
|
|
136
|
+
decorators_js.property({ type: String, reflect: true })
|
|
137
|
+
], LuzmoColorPicker.prototype, "shape");
|
|
138
|
+
__decorateClass([
|
|
139
|
+
decorators_js.property({ type: Array, reflect: true })
|
|
140
|
+
], LuzmoColorPicker.prototype, "swatches");
|
|
141
|
+
__decorateClass([
|
|
142
|
+
decorators_js.property({ type: Boolean, reflect: true, attribute: "no-alpha-channel" })
|
|
143
|
+
], LuzmoColorPicker.prototype, "noAlphaChannel");
|
|
144
|
+
__decorateClass([
|
|
145
|
+
decorators_js.query("luzmo-color-menu")
|
|
146
|
+
], LuzmoColorPicker.prototype, "menuElement");
|
|
147
|
+
__decorateClass([
|
|
148
|
+
decorators_js.query("luzmo-overlay")
|
|
149
|
+
], LuzmoColorPicker.prototype, "overlayElement");
|
|
150
|
+
__decorateClass([
|
|
151
|
+
decorators_js.state()
|
|
152
|
+
], LuzmoColorPicker.prototype, "_renderMenu");
|
|
153
|
+
if (!customElements.get("luzmo-color-picker")) {
|
|
154
|
+
customElements.define("luzmo-color-picker", LuzmoColorPicker);
|
|
155
|
+
}
|
|
156
|
+
exports.LuzmoColorPicker = LuzmoColorPicker;
|