@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,170 +15,24 @@
|
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const decorators_js = require("lit/decorators.js");
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const observeSlotPresence = require("../observe-slot-presence-9AwLGUQ_.cjs");
|
|
26
|
-
const observeSlotText = require("../observe-slot-text-CSofZeeF.cjs");
|
|
27
|
-
const randomId = require("../random-id-BE6HA503.cjs");
|
|
28
|
-
const icons = require("@luzmo/icons");
|
|
29
|
-
require("@lit-labs/virtualizer");
|
|
30
|
-
const repeat_js = require("lit/directives/repeat.js");
|
|
31
|
-
const base = require("../base-COw9n7UR.cjs");
|
|
32
|
-
const sizedMixin = require("../sized-mixin-UaTVa-AE.cjs");
|
|
33
|
-
require("../progress-circle/index.cjs");
|
|
34
|
-
const divider_module = require("../divider.module-Cm5LcDRV.cjs");
|
|
35
|
-
const menuItemStyles = '#icon{grid-area:iconArea;align-self:start;height:var(--luzmo-option-icon-container-height, var(--option-icon-container-height));display:flex;align-items:center;justify-content:center;color:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)))}::slotted([slot=icon]){fill:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)));margin-inline-end:var(--luzmo-option-label-text-to-visual, var(--option-label-text-to-visual));block-size:var(--luzmo-option-icon-size, var(--option-icon-height));inline-size:var(--luzmo-option-icon-width, var(--option-icon-height));font-size:var(--luzmo-option-icon-size, var(--option-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-option-background-color-default, var(--luzmo-option-background-color-default, var(--option-background-color-default)));line-height:var(--luzmo-option-label-line-height, var(--option-label-line-height));min-block-size:var(--luzmo-option-min-height, var(--option-min-height));padding-block-start:var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text));padding-block-end:var(--luzmo-option-bottom-edge-to-text, var(--option-bottom-edge-to-text));padding-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));grid-template:". . headingIconArea sectionHeadingArea . ." "selectedArea checkArea iconArea labelArea valueArea actionsArea" 1fr ". . . descriptionArea . ." ". . . . . ."/auto auto auto 1fr auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;outline:none;align-items:center;position:relative;flex-shrink:0}:host:focus-visible{outline:none}#label{grid-area:submenuItemLabelArea}.checkmark,.checkbox{opacity:1;grid-area:checkArea;align-self:start;display:block}.checkmark{font-size:var(--luzmo-option-checkmark-size, var(--option-checkmark-size));fill:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));color:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkmark, var(--option-top-to-checkmark)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}.checkbox{font-size:var(--luzmo-option-checkbox-size, var(--option-checkbox-size));fill:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));color:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkbox, var(--option-top-to-checkbox)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-key-focus, var(--option-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-focus, var(--option-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-focus, var(--option-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-focus, var(--option-value-color-focus)))}:host([focused])>.icon:not(.checkmark,.checkbox),:host(:focus)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)))}:host([focused])>.checkbox,:host(:focus)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--option-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-down, var(--option-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-down, var(--option-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-down, var(--option-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-down, var(--option-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)))}:host(:is(:active,[active]))>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}:host([focused]){box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * var(--option-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)))}#label{font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));color:var(--highcontrast-option-color-default, var(--luzmo-option-label-content-color-default, var(--option-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([variant=highlight][selected]){background-color:var(--luzmo-option-highlight-selected-label-background-color, var(--option-highlight-selected-label-background-color))}:host([variant=highlight][selected]) #label{color:var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]):hover #label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):active #label{color:var(--luzmo-option-highlight-selected-label-content-color-down, var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):focus #label{color:var(--luzmo-option-highlight-selected-label-content-color-focus, var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)))}::slotted([slot=value]){color:var(--highcontrast-option-color-default, var(--luzmo-option-value-color-default, var(--option-value-color-default)));font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));grid-area:valueArea;justify-self:end}[name=description]::slotted(*){color:var(--highcontrast-option-color-default, var(--luzmo-option-description-color-default, var(--option-description-color-default)));font-size:var(--luzmo-option-description-font-size, var(--option-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-option-description-line-height, var(--option-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-option-label-to-description-spacing, var(--option-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-hover, var(--option-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-hover, var(--option-label-content-color-hover)))}:host([variant=highlight][selected]:hover)>#label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-hover, var(--option-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-hover, var(--option-value-color-hover)))}:host(:hover)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)))}:host([variant=highlight][selected]:hover)>.icon:not(.checkmark,.checkbox){fill:var(--luzmo-option-highlight-selected-label-icon-color-hover, var(--option-highlight-selected-label-icon-color-hover))}:host(:hover)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)))}:host(:hover)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}}:host([emphasized]){--options-checkmark-icon-color-default: var(--luzmo-primary);--options-checkmark-icon-color-hover: var(--luzmo-primary-hover);--options-checkmark-icon-color-down: var(--luzmo-primary-down);--options-checkmark-icon-color-focus: var(--luzmo-primary-focus);--options-checkbox-icon-color-default: var(--luzmo-primary);--options-checkbox-icon-color-hover: var(--luzmo-primary-hover);--options-checkbox-icon-color-down: var(--luzmo-primary-down);--options-checkbox-icon-color-focus: var(--luzmo-primary-focus)}:host{text-align:initial;font-family:var(--luzmo-option-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-option-label-icon-color-disabled, var(--luzmo-disabled-color))}#button{position:absolute;top:0;right:0;bottom:0;left:0}.icon-container>svg{vertical-align:top}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors: active){:host{forced-color-adjust:none}}:host([no-wrap]) #label{display:block}';
|
|
36
|
-
var __defProp$1 = Object.defineProperty;
|
|
37
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
38
|
-
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
39
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
40
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
41
|
-
if (decorator = decorators[i])
|
|
42
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
43
|
-
if (kind && result) __defProp$1(target, key, result);
|
|
44
|
-
return result;
|
|
45
|
-
};
|
|
46
|
-
const checkIcon = (classes) => lit.html`
|
|
47
|
-
<span class="icon-container icon checkmark ${classes.join(" ")}">
|
|
48
|
-
${icons.luzmoIcon(icons.luzmoCheck)}
|
|
18
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("../mutation-controller-DkOMCW-c.cjs"),a=require("../base-Cy0MQrPT.cjs"),L=require("../query-BL-TJj7K.cjs"),K=require("../focusable-B_KwfEec.cjs"),Z=require("../like-anchor-Bu3pXbjT.cjs"),G=require("../observe-slot-presence-bc9chhsi.cjs"),J=require("../observe-slot-text-D2VAEFSd.cjs"),X=require("../random-id-CqvckpWe.cjs"),E=require("../luzmo-icons-CtA-TJPd.cjs"),S=require("../directive-C7oCP5Bh.cjs"),Y=require("../async-directive-DLz6JB0v.cjs"),g=require("../directive-helpers-t-TVum7J.cjs"),Q=require("../base-BjTwmyRF.cjs"),D=require("../sized-mixin-WPHH0a_D.cjs");require("../progress-circle/index.cjs");const tt=require("../divider.module-DDvBo9zo.cjs");/**
|
|
19
|
+
* @license
|
|
20
|
+
* Copyright 2017 Google LLC
|
|
21
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
+
*/let ot;function et(r){return(t,o)=>Q.e(t,o,{get(){return(this.renderRoot??ot??(ot=document.createDocumentFragment())).querySelectorAll(r)}})}const it='#icon{grid-area:iconArea;align-self:start;height:var(--luzmo-option-icon-container-height, var(--option-icon-container-height));display:flex;align-items:center;justify-content:center;color:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)))}::slotted([slot=icon]){fill:var(--highcontrast-option-color-default, var(--luzmo-option-label-icon-color-default, var(--option-label-icon-color-default)));margin-inline-end:var(--luzmo-option-label-text-to-visual, var(--option-label-text-to-visual));block-size:var(--luzmo-option-icon-size, var(--option-icon-height));inline-size:var(--luzmo-option-icon-width, var(--option-icon-height));font-size:var(--luzmo-option-icon-size, var(--option-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-option-background-color-default, var(--luzmo-option-background-color-default, var(--option-background-color-default)));line-height:var(--luzmo-option-label-line-height, var(--option-label-line-height));min-block-size:var(--luzmo-option-min-height, var(--option-min-height));padding-block-start:var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text));padding-block-end:var(--luzmo-option-bottom-edge-to-text, var(--option-bottom-edge-to-text));padding-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));grid-template:". . headingIconArea sectionHeadingArea . ." "selectedArea checkArea iconArea labelArea valueArea actionsArea" 1fr ". . . descriptionArea . ." ". . . . . ."/auto auto auto 1fr auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;outline:none;align-items:center;position:relative;flex-shrink:0}:host:focus-visible{outline:none}#label{grid-area:submenuItemLabelArea}.checkmark,.checkbox{opacity:1;grid-area:checkArea;align-self:start;display:block}.checkmark{font-size:var(--luzmo-option-checkmark-size, var(--option-checkmark-size));fill:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));color:var(--highcontrast-options-checkmark-icon-color-default, var(--luzmo-options-checkmark-icon-color-default, var(--options-checkmark-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkmark, var(--option-top-to-checkmark)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}.checkbox{font-size:var(--luzmo-option-checkbox-size, var(--option-checkbox-size));fill:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));color:var(--highcontrast-options-checkbox-icon-color-default, var(--luzmo-options-checkbox-icon-color-default, var(--options-checkbox-icon-color-default)));margin-block-start:calc(var(--luzmo-option-top-to-checkbox, var(--option-top-to-checkbox)) - var(--luzmo-option-top-edge-to-text, var(--option-top-edge-to-text)));margin-inline-end:var(--luzmo-option-text-to-control, var(--option-label-text-to-control))}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-key-focus, var(--option-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-focus, var(--option-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-focus, var(--option-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-focus, var(--option-value-color-focus)))}:host([focused])>.icon:not(.checkmark,.checkbox),:host(:focus)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-focus, var(--option-label-icon-color-focus)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-focus, var(--options-checkmark-icon-color-focus)))}:host([focused])>.checkbox,:host(:focus)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-focus, var(--options-checkbox-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--option-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-down, var(--option-background-color-down)))}:host(:is(:active,[active]))>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-down, var(--option-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-down, var(--option-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-down, var(--option-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-down, var(--option-label-icon-color-down)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-down, var(--options-checkmark-icon-color-down)))}:host(:is(:active,[active]))>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-down, var(--options-checkbox-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}:host([focused]){box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-option-focus-indicator-width, var(--option-focus-indicator-width)) * var(--option-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-option-focus-indicator-color, var(--luzmo-option-focus-indicator-color, var(--option-focus-indicator-color)))}#label{font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));color:var(--highcontrast-option-color-default, var(--luzmo-option-label-content-color-default, var(--option-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}:host([variant=highlight][selected]){background-color:var(--luzmo-option-highlight-selected-label-background-color, var(--option-highlight-selected-label-background-color))}:host([variant=highlight][selected]) #label{color:var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color))}:host([variant=highlight][selected]):hover #label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host([variant=highlight][selected]):active #label{color:var(--luzmo-option-highlight-selected-label-content-color-down, var(--option-highlight-selected-label-content-color-down))}:host([variant=highlight][selected]):focus #label{color:var(--luzmo-option-highlight-selected-label-content-color-focus, var(--option-highlight-selected-label-content-color-focus))}:host([variant=highlight][selected]) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-highlight-selected-label-content-color, var(--option-highlight-selected-label-content-color)))}::slotted([slot=value]){color:var(--highcontrast-option-color-default, var(--luzmo-option-value-color-default, var(--option-value-color-default)));font-size:var(--luzmo-option-label-font-size, var(--option-label-font-size));grid-area:valueArea;justify-self:end}[name=description]::slotted(*){color:var(--highcontrast-option-color-default, var(--luzmo-option-description-color-default, var(--option-description-color-default)));font-size:var(--luzmo-option-description-font-size, var(--option-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-option-description-line-height, var(--option-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-option-label-to-description-spacing, var(--option-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-option-background-color-focus, var(--luzmo-option-background-color-hover, var(--option-background-color-hover)))}:host(:hover)>#label{color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-content-color-hover, var(--option-label-content-color-hover)))}:host([variant=highlight][selected]:hover)>#label{color:var(--luzmo-option-highlight-selected-label-content-color-hover, var(--option-highlight-selected-label-content-color-hover))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-option-color-focus, var(--luzmo-option-description-color-hover, var(--option-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-option-color-focus, var(--luzmo-option-value-color-hover, var(--option-value-color-hover)))}:host(:hover)>.icon:not(.checkmark,.checkbox){fill:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-option-label-icon-color-hover, var(--option-label-icon-color-hover)))}:host([variant=highlight][selected]:hover)>.icon:not(.checkmark,.checkbox){fill:var(--luzmo-option-highlight-selected-label-icon-color-hover, var(--option-highlight-selected-label-icon-color-hover))}:host(:hover)>.checkmark{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkmark-icon-color-hover, var(--options-checkmark-icon-color-hover)))}:host(:hover)>.checkbox{fill:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)));color:var(--highcontrast-option-color-focus, var(--luzmo-options-checkbox-icon-color-hover, var(--options-checkbox-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-content-color-disabled, var(--option-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-description-color-disabled, var(--option-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)));fill:var(--highcontrast-option-color-disabled, var(--luzmo-option-label-icon-color-disabled, var(--option-label-icon-color-disabled)))}}:host([emphasized]){--options-checkmark-icon-color-default: var(--luzmo-primary);--options-checkmark-icon-color-hover: var(--luzmo-primary-hover);--options-checkmark-icon-color-down: var(--luzmo-primary-down);--options-checkmark-icon-color-focus: var(--luzmo-primary-focus);--options-checkbox-icon-color-default: var(--luzmo-primary);--options-checkbox-icon-color-hover: var(--luzmo-primary-hover);--options-checkbox-icon-color-down: var(--luzmo-primary-down);--options-checkbox-icon-color-focus: var(--luzmo-primary-focus)}:host{text-align:initial;font-family:var(--luzmo-option-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-option-label-icon-color-disabled, var(--luzmo-disabled-color))}#button{position:absolute;top:0;right:0;bottom:0;left:0}.icon-container>svg{vertical-align:top}:host([dir=ltr]) [icon-only]::slotted(:last-of-type){margin-right:auto}:host([dir=rtl]) [icon-only]::slotted(:last-of-type){margin-left:auto}@media (forced-colors: active){:host{forced-color-adjust:none}}:host([no-wrap]) #label{display:block}';var nt=Object.defineProperty,lt=Object.getOwnPropertyDescriptor,z=(r,t,o,e)=>{for(var i=e>1?void 0:e?lt(t,o):t,n=r.length-1,s;n>=0;n--)(s=r[n])&&(i=(e?s(t,o,i):s(i))||i);return e&&i&&nt(t,o,i),i};const rt=r=>a.x`
|
|
23
|
+
<span class="icon-container icon checkmark ${r.join(" ")}">
|
|
24
|
+
${E.T3(E.F)}
|
|
49
25
|
</span>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
${icons.luzmoIcon(icons.luzmoCheckbox)}
|
|
26
|
+
`,st=r=>a.x`
|
|
27
|
+
<span class="icon-container icon checkbox ${r.join(" ")}">
|
|
28
|
+
${E.T3(E.z0)}
|
|
54
29
|
</span>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
${icons.luzmoIcon(icons.luzmoCheckboxChecked)}
|
|
30
|
+
`,at=r=>a.x`
|
|
31
|
+
<span class="icon-container icon checkbox ${r.join(" ")}">
|
|
32
|
+
${E.T3(E.v0)}
|
|
59
33
|
</span>
|
|
60
|
-
`;
|
|
61
|
-
|
|
62
|
-
observeSlotText.ObserveSlotText(observeSlotPresence.ObserveSlotPresence(focusable.Focusable, '[slot="icon"]'))
|
|
63
|
-
) {
|
|
64
|
-
constructor() {
|
|
65
|
-
super();
|
|
66
|
-
this.active = false;
|
|
67
|
-
this.focused = false;
|
|
68
|
-
this.selected = false;
|
|
69
|
-
this.emphasized = false;
|
|
70
|
-
this.variant = "checkmarks";
|
|
71
|
-
this._value = "";
|
|
72
|
-
this.noWrap = false;
|
|
73
|
-
this.renderCheckIcon = (selected, hasIcon) => {
|
|
74
|
-
const classes = hasIcon ? ["check-icon--with-adjacent-icon"] : [];
|
|
75
|
-
if (this.variant === "checkboxes") {
|
|
76
|
-
return selected ? checkboxCheckedIcon(classes) : checkboxIcon(classes);
|
|
77
|
-
}
|
|
78
|
-
return selected && this.variant !== "highlight" ? checkIcon(classes) : lit.html``;
|
|
79
|
-
};
|
|
80
|
-
this.proxyFocus = () => {
|
|
81
|
-
this.focus();
|
|
82
|
-
};
|
|
83
|
-
this.willDispatchUpdate = false;
|
|
84
|
-
this.addEventListener("click", this.handleClickCapture, {
|
|
85
|
-
capture: true
|
|
86
|
-
});
|
|
87
|
-
new mutationController_js.MutationController(this, {
|
|
88
|
-
config: {
|
|
89
|
-
characterData: true,
|
|
90
|
-
childList: true,
|
|
91
|
-
subtree: true
|
|
92
|
-
},
|
|
93
|
-
callback: () => {
|
|
94
|
-
this.breakItemChildrenCache();
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
static get styles() {
|
|
99
|
-
return [lit.unsafeCSS(menuItemStyles)];
|
|
100
|
-
}
|
|
101
|
-
get value() {
|
|
102
|
-
return this._value || this.itemText;
|
|
103
|
-
}
|
|
104
|
-
set value(value) {
|
|
105
|
-
if (value === this._value) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
this._value = value || "";
|
|
109
|
-
if (this._value) {
|
|
110
|
-
this.setAttribute("value", this._value);
|
|
111
|
-
} else {
|
|
112
|
-
this.removeAttribute("value");
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* @private
|
|
117
|
-
*/
|
|
118
|
-
get itemText() {
|
|
119
|
-
return this.itemChildren.content.reduce(
|
|
120
|
-
(acc, node) => acc + (node.textContent || "").trim(),
|
|
121
|
-
""
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
|
-
get focusElement() {
|
|
125
|
-
return this;
|
|
126
|
-
}
|
|
127
|
-
get hasIcon() {
|
|
128
|
-
return this.slotContentIsPresent;
|
|
129
|
-
}
|
|
130
|
-
get itemChildren() {
|
|
131
|
-
if (!this.iconSlot || !this.contentSlot) {
|
|
132
|
-
return {
|
|
133
|
-
icon: [],
|
|
134
|
-
content: []
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
if (this._itemChildren) {
|
|
138
|
-
return this._itemChildren;
|
|
139
|
-
}
|
|
140
|
-
const icon = this.iconSlot.assignedElements().map((element) => {
|
|
141
|
-
const newElement = element.cloneNode(true);
|
|
142
|
-
newElement.removeAttribute("slot");
|
|
143
|
-
newElement.classList.toggle("icon");
|
|
144
|
-
return newElement;
|
|
145
|
-
});
|
|
146
|
-
const content = this.contentSlot.assignedNodes().map((node) => node.cloneNode(true));
|
|
147
|
-
this._itemChildren = { icon, content };
|
|
148
|
-
return this._itemChildren;
|
|
149
|
-
}
|
|
150
|
-
click() {
|
|
151
|
-
if (this.disabled) {
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
if (this.shouldProxyClick()) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
super.click();
|
|
158
|
-
}
|
|
159
|
-
handleClickCapture(event) {
|
|
160
|
-
if (this.disabled) {
|
|
161
|
-
event.preventDefault();
|
|
162
|
-
event.stopImmediatePropagation();
|
|
163
|
-
event.stopPropagation();
|
|
164
|
-
return false;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
shouldProxyClick() {
|
|
168
|
-
let handled = false;
|
|
169
|
-
if (this.anchorElement) {
|
|
170
|
-
this.anchorElement.click();
|
|
171
|
-
handled = true;
|
|
172
|
-
}
|
|
173
|
-
return handled;
|
|
174
|
-
}
|
|
175
|
-
breakItemChildrenCache() {
|
|
176
|
-
this._itemChildren = void 0;
|
|
177
|
-
this.triggerUpdate();
|
|
178
|
-
}
|
|
179
|
-
render() {
|
|
180
|
-
return lit.html`
|
|
181
|
-
${this.renderCheckIcon(this.selected, this.hasIcon)}
|
|
34
|
+
`;class b extends Z.LikeAnchor(J.ObserveSlotText(G.ObserveSlotPresence(K.Focusable,'[slot="icon"]'))){constructor(){super(),this.active=!1,this.focused=!1,this.selected=!1,this.emphasized=!1,this.variant="checkmarks",this._value="",this.noWrap=!1,this.renderCheckIcon=(t,o)=>{const e=o?["check-icon--with-adjacent-icon"]:[];return this.variant==="checkboxes"?t?at(e):st(e):t&&this.variant!=="highlight"?rt(e):a.x``},this.proxyFocus=()=>{this.focus()},this.willDispatchUpdate=!1,this.addEventListener("click",this.handleClickCapture,{capture:!0}),new W.s(this,{config:{characterData:!0,childList:!0,subtree:!0},callback:()=>{this.breakItemChildrenCache()}})}static get styles(){return[a.r(it)]}get value(){return this._value||this.itemText}set value(t){t!==this._value&&(this._value=t||"",this._value?this.setAttribute("value",this._value):this.removeAttribute("value"))}get itemText(){return this.itemChildren.content.reduce((t,o)=>t+(o.textContent||"").trim(),"")}get focusElement(){return this}get hasIcon(){return this.slotContentIsPresent}get itemChildren(){if(!this.iconSlot||!this.contentSlot)return{icon:[],content:[]};if(this._itemChildren)return this._itemChildren;const t=this.iconSlot.assignedElements().map(e=>{const i=e.cloneNode(!0);return i.removeAttribute("slot"),i.classList.toggle("icon"),i}),o=this.contentSlot.assignedNodes().map(e=>e.cloneNode(!0));return this._itemChildren={icon:t,content:o},this._itemChildren}click(){this.disabled||this.shouldProxyClick()||super.click()}handleClickCapture(t){if(this.disabled)return t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation(),!1}shouldProxyClick(){let t=!1;return this.anchorElement&&(this.anchorElement.click(),t=!0),t}breakItemChildrenCache(){this._itemChildren=void 0,this.triggerUpdate()}render(){return a.x`
|
|
35
|
+
${this.renderCheckIcon(this.selected,this.hasIcon)}
|
|
182
36
|
<div id="icon">
|
|
183
37
|
<slot name="icon"></slot>
|
|
184
38
|
</div>
|
|
@@ -187,548 +41,61 @@ class LuzmoOption extends likeAnchor.LikeAnchor(
|
|
|
187
41
|
</div>
|
|
188
42
|
<slot name="description"></slot>
|
|
189
43
|
<slot name="value"></slot>
|
|
190
|
-
${this.href
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
updateAriaSelected() {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
updated(changes) {
|
|
220
|
-
super.updated(changes);
|
|
221
|
-
if (changes.has("label") && (this.label || changes.get("label") !== void 0)) {
|
|
222
|
-
this.setAttribute("aria-label", this.label || "");
|
|
223
|
-
}
|
|
224
|
-
if (this.anchorElement) {
|
|
225
|
-
this.anchorElement.addEventListener("focus", this.proxyFocus);
|
|
226
|
-
this.anchorElement.tabIndex = -1;
|
|
227
|
-
}
|
|
228
|
-
if (changes.has("selected")) {
|
|
229
|
-
this.updateAriaSelected();
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
connectedCallback() {
|
|
233
|
-
super.connectedCallback();
|
|
234
|
-
this.triggerUpdate();
|
|
235
|
-
}
|
|
236
|
-
async triggerUpdate() {
|
|
237
|
-
if (this.willDispatchUpdate) {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
this.willDispatchUpdate = true;
|
|
241
|
-
await new Promise((ready) => requestAnimationFrame(ready));
|
|
242
|
-
this.dispatchUpdate();
|
|
243
|
-
}
|
|
244
|
-
dispatchUpdate() {
|
|
245
|
-
if (!this.isConnected) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
this.willDispatchUpdate = false;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
__decorateClass$1([
|
|
252
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
253
|
-
], LuzmoOption.prototype, "active", 2);
|
|
254
|
-
__decorateClass$1([
|
|
255
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
256
|
-
], LuzmoOption.prototype, "focused", 2);
|
|
257
|
-
__decorateClass$1([
|
|
258
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
259
|
-
], LuzmoOption.prototype, "selected", 2);
|
|
260
|
-
__decorateClass$1([
|
|
261
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
262
|
-
], LuzmoOption.prototype, "emphasized", 2);
|
|
263
|
-
__decorateClass$1([
|
|
264
|
-
decorators_js.property({ type: String, reflect: true })
|
|
265
|
-
], LuzmoOption.prototype, "variant", 2);
|
|
266
|
-
__decorateClass$1([
|
|
267
|
-
decorators_js.property({ type: String })
|
|
268
|
-
], LuzmoOption.prototype, "value", 1);
|
|
269
|
-
__decorateClass$1([
|
|
270
|
-
decorators_js.query("slot:not([name])")
|
|
271
|
-
], LuzmoOption.prototype, "contentSlot", 2);
|
|
272
|
-
__decorateClass$1([
|
|
273
|
-
decorators_js.query('slot[name="icon"]')
|
|
274
|
-
], LuzmoOption.prototype, "iconSlot", 2);
|
|
275
|
-
__decorateClass$1([
|
|
276
|
-
decorators_js.property({
|
|
277
|
-
type: Boolean,
|
|
278
|
-
reflect: true,
|
|
279
|
-
attribute: "no-wrap",
|
|
280
|
-
hasChanged() {
|
|
281
|
-
return false;
|
|
282
|
-
}
|
|
283
|
-
})
|
|
284
|
-
], LuzmoOption.prototype, "noWrap", 2);
|
|
285
|
-
__decorateClass$1([
|
|
286
|
-
decorators_js.query(".anchor")
|
|
287
|
-
], LuzmoOption.prototype, "anchorElement", 2);
|
|
288
|
-
const optionsDividerStyles = ":host{--options-divider-thickness: var( --divider-thickness-medium, var(--luzmo-border-width) );inline-size:auto;margin-block:var(--luzmo-options-section-divider-margin-block, max(0px, (var(--option-section-divider-height) - var(--options-divider-thickness)) / 2));margin-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));overflow:visible}:host{display:block;flex-shrink:0}";
|
|
289
|
-
class LuzmoOptionsDivider extends sizedMixin.SizedMixin(base.LuzmoElement, {
|
|
290
|
-
validSizes: ["s", "m", "l"]
|
|
291
|
-
}) {
|
|
292
|
-
static get styles() {
|
|
293
|
-
return [lit.unsafeCSS(divider_module.dividerStyles), lit.unsafeCSS(optionsDividerStyles)];
|
|
294
|
-
}
|
|
295
|
-
firstUpdated(changed) {
|
|
296
|
-
super.firstUpdated(changed);
|
|
297
|
-
this.setAttribute("role", "separator");
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
const optionsStyles = ":host{--option-top-to-action: var(--luzmo-spacing-1);--option-top-to-checkbox: var(--luzmo-spacing-1);--option-label-line-height: var(--luzmo-line-height);--option-label-line-height-cjk: 1.5;--option-label-to-description-spacing: 1px;--option-focus-indicator-width: var(--luzmo-indicator-width);--option-focus-indicator-color: var(--luzmo-indicator-color);--option-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--option-label-content-color-default: var(--luzmo-font-color);--option-label-content-color-hover: var(--luzmo-font-color-hover);--option-label-content-color-down: var(--luzmo-font-color-down);--option-label-content-color-focus: var(--luzmo-font-color-focus);--option-label-icon-color-default: var(--luzmo-font-color);--option-label-icon-color-hover: var(--luzmo-font-color-hover);--option-label-icon-color-down: var(--luzmo-font-color-down);--option-label-icon-color-focus: var(--luzmo-font-color-focus);--option-highlight-selected-label-background-color: var(--luzmo-primary);--option-highlight-selected-label-content-color: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-hover: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-down: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-focus: var( --luzmo-primary-inverse-color );--option-label-content-color-disabled: var(--luzmo-font-color-disabled);--option-label-icon-color-disabled: var(--luzmo-font-color-disabled);--option-description-line-height: var(--luzmo-line-height);--option-description-line-height-cjk: 1.5;--option-description-color-default: var(--luzmo-font-color);--option-description-color-hover: var(--luzmo-font-color-hover);--option-description-color-down: var(--luzmo-font-color-down);--option-description-color-focus: var(--luzmo-font-color-focus);--option-description-color-disabled: var(--luzmo-disabled-color);--options-section-header-line-height: var(--luzmo-line-height);--options-section-header-line-height-cjk: 1.5;--options-section-header-font-weight: bold;--options-section-header-color: var(--luzmo-font-color-hard);--options-collapsible-icon-color: var(--luzmo-font-color-hard);--options-checkmark-icon-color-default: var(--luzmo-font-color);--options-checkmark-icon-color-hover: var(--luzmo-font-color-hover);--options-checkmark-icon-color-down: var(--luzmo-font-color-down);--options-checkmark-icon-color-focus: var(--luzmo-font-color-focus);--options-checkbox-icon-color-default: var(--luzmo-font-color);--options-checkbox-icon-color-hover: var(--luzmo-font-color-hover);--options-checkbox-icon-color-down: var(--luzmo-font-color-down);--options-checkbox-icon-color-focus: var(--luzmo-font-color-focus);--options-drillin-icon-color-default: var(--luzmo-font-color);--options-drillin-icon-color-hover: var(--luzmo-font-color-hover);--options-drillin-icon-color-down: var(--luzmo-font-color-down);--options-drillin-icon-color-focus: var(--luzmo-font-color-focus);--option-value-color-default: var(--luzmo-font-color);--option-value-color-hover: var(--luzmo-font-color-hover);--option-value-color-down: var(--luzmo-font-color-down);--option-value-color-focus: var(--luzmo-font-color-focus);--option-collapsible-no-icon-suboption-padding-x-start: 28px;--option-background-color-selected: var(--luzmo-background-color);--option-background-color-default: var(--luzmo-background-color);--option-background-color-hover: var(--luzmo-background-color-hover);--option-background-color-down: var(--luzmo-background-color-down);--option-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--option-min-height: var(--luzmo-component-height);--option-icon-container-height: 18px;--options-pending-height: var(--option-min-height);--progress-circle-size: calc( var(--options-pending-height) - var(--option-top-edge-to-text) - var( --option-bottom-edge-to-text ) );--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size);--option-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--pending-inline-edge-to-content: var(--option-label-inline-edge-to-content);--option-top-edge-to-text: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--option-bottom-edge-to-text: var(--luzmo-spacing-3);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size);--options-section-header-min-width: var(--luzmo-component-height);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--option-min-height: var(--luzmo-component-height-s);--option-icon-container-height: 17px;--option-icon-height: var(--luzmo-font-size);--option-icon-width: var(--luzmo-font-size);--option-label-font-size: var(--luzmo-font-size-s);--option-label-text-to-visual: var(--luzmo-spacing-3);--option-label-text-to-control: var(--luzmo-spacing-3);--option-label-inline-edge-to-content: var(--luzmo-spacing-3);--option-top-edge-to-text: calc( var(--luzmo-spacing-1) + var(--luzmo-spacing-2) );--option-bottom-edge-to-text: var(--luzmo-spacing-2);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size-s);--options-section-header-min-width: var(--luzmo-component-height-s);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: var(--luzmo-spacing-3);--option-top-to-checkbox: var(--luzmo-spacing-3)}:host([size=l]){--option-min-height: var(--luzmo-component-height-l);--option-icon-container-height: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size-l);--option-label-text-to-visual: var(--luzmo-spacing-4);--option-label-text-to-control: var(--luzmo-spacing-4);--option-label-inline-edge-to-content: var(--luzmo-spacing-4);--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size-s);--options-section-header-font-size: var(--luzmo-font-size-l);--options-section-header-min-width: var(--luzmo-component-height-l);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--option-checkmark-size: var(--luzmo-font-size-s);--option-checkbox-size: var(--luzmo-font-size-s);--option-top-to-checkmark: var(--luzmo-spacing-4);--option-top-to-checkbox: var(--luzmo-spacing-4)}:host([size=xl]){--option-min-height: var(--luzmo-component-height-xl);--option-icon-container-height: 26px;--option-icon-height: var(--luzmo-font-size-xl);--option-icon-width: var(--luzmo-font-size-xl);--option-label-font-size: var(--luzmo-font-size-xl);--option-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size);--options-section-header-font-size: var(--luzmo-font-size-xl);--options-section-header-min-width: var(--luzmo-component-height-xl);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size);--option-checkbox-size: var(--luzmo-font-size);--option-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}@media (forced-colors: active){:host{--highcontrast-option-background-color-default: ButtonFace;--highcontrast-option-color-default: ButtonText;--highcontrast-option-background-color-focus: Highlight;--highcontrast-option-color-focus: HighlightText;--highcontrast-options-checkmark-icon-color-default: Highlight;--highcontrast-options-checkbox-icon-color-default: Highlight;--highcontrast-option-color-disabled: GrayText;--highcontrast-option-focus-indicator-color: Highlight;--highcontrast-option-selected-background-color: Highlight;--highcontrast-option-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-option-selected-background-color: SelectedItem;--highcontrast-option-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-options-inline-size, auto);box-sizing:border-box;margin:0;padding:0;list-style-type:none;display:inline-block;overflow:auto}:host:lang(ja),:host:lang(ko),:host:lang(zh){--option-label-line-height: var( --luzmo-option-label-line-height-cjk, var(--option-label-line-height-cjk) );--option-description-line-height: var( --luzmo-option-description-line-height-cjk, var(--option-description-line-height-cjk) );--options-section-header-line-height: var( --luzmo-options-section-header-line-height-cjk, var(--options-section-header-line-height-cjk) )}luzmo-option{width:100%}#pending{display:flex;flex-shrink:0;align-items:center;height:var(--options-pending-height);padding-inline:var(--pending-inline-edge-to-content)}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";
|
|
301
|
-
var __defProp = Object.defineProperty;
|
|
302
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
303
|
-
var result = void 0;
|
|
304
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
305
|
-
if (decorator = decorators[i])
|
|
306
|
-
result = decorator(target, key, result) || result;
|
|
307
|
-
if (result) __defProp(target, key, result);
|
|
308
|
-
return result;
|
|
309
|
-
};
|
|
310
|
-
const VIRTUALIZE_AS_OF_NUM_ITEMS = 25;
|
|
311
|
-
function elementIsOrContains(el, isOrContains) {
|
|
312
|
-
return !!isOrContains && (el === isOrContains || el.contains(isOrContains));
|
|
313
|
-
}
|
|
314
|
-
class LuzmoOptions extends sizedMixin.SizedMixin(base.LuzmoElement, {
|
|
315
|
-
noDefaultSize: true
|
|
316
|
-
}) {
|
|
317
|
-
constructor() {
|
|
318
|
-
super();
|
|
319
|
-
this.label = "";
|
|
320
|
-
this.variant = "highlight";
|
|
321
|
-
this.selects = "single";
|
|
322
|
-
this.emphasized = false;
|
|
323
|
-
this.pending = false;
|
|
324
|
-
this.options = [];
|
|
325
|
-
this.value = [];
|
|
326
|
-
this.focusedOptionIndex = 0;
|
|
327
|
-
this._selectedOptions = [];
|
|
328
|
-
this._firstVisibleIndex = 0;
|
|
329
|
-
this.addEventListener("focusin", this.handleFocusin);
|
|
330
|
-
this.addEventListener("blur", this.handleBlur);
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* @internal
|
|
334
|
-
*/
|
|
335
|
-
static get styles() {
|
|
336
|
-
return [lit.unsafeCSS(optionsStyles)];
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* @internal
|
|
340
|
-
*/
|
|
341
|
-
get _virtualizeActive() {
|
|
342
|
-
return this.options.length > VIRTUALIZE_AS_OF_NUM_ITEMS;
|
|
343
|
-
}
|
|
344
|
-
firstUpdated(changed) {
|
|
345
|
-
super.firstUpdated(changed);
|
|
346
|
-
if (!this.hasAttribute("tabindex")) {
|
|
347
|
-
this.tabIndex = 0;
|
|
348
|
-
}
|
|
349
|
-
const updates = [
|
|
350
|
-
new Promise((res) => requestAnimationFrame(() => res(true)))
|
|
351
|
-
];
|
|
352
|
-
[...this.children].forEach((item) => {
|
|
353
|
-
if (item.localName === "luzmo-option") {
|
|
354
|
-
updates.push(item.updateComplete);
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
this.optionElementsUpdated = Promise.all(updates);
|
|
358
|
-
}
|
|
359
|
-
willUpdate(changes) {
|
|
360
|
-
var _a;
|
|
361
|
-
const hasChangedSelects = changes.has("selects");
|
|
362
|
-
if (hasChangedSelects && this.selects === "single" && ((_a = this.value) == null ? void 0 : _a.length) > 1) {
|
|
363
|
-
this.value = this.value.slice(0, 1);
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
updated(changes) {
|
|
367
|
-
super.updated(changes);
|
|
368
|
-
const changedLabel = changes.has("label");
|
|
369
|
-
if (changedLabel && (this.label || changes.get("label") !== void 0)) {
|
|
370
|
-
if (this.label) {
|
|
371
|
-
this.setAttribute("aria-label", this.label);
|
|
372
|
-
} else {
|
|
373
|
-
this.removeAttribute("aria-label");
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
async getUpdateComplete() {
|
|
378
|
-
const complete = await super.getUpdateComplete();
|
|
379
|
-
await this.optionElementsUpdated;
|
|
380
|
-
return complete;
|
|
381
|
-
}
|
|
382
|
-
focus({ preventScroll } = {}) {
|
|
383
|
-
super.focus({ preventScroll });
|
|
384
|
-
this.focusOptionByOffset(0);
|
|
385
|
-
}
|
|
386
|
-
_removeFocusedPropertyOnOptions() {
|
|
387
|
-
requestAnimationFrame(() => {
|
|
388
|
-
this.visibleOptionElements.forEach((item) => {
|
|
389
|
-
item.focused = false;
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
}
|
|
393
|
-
scrollToTop() {
|
|
394
|
-
this.scrollTop = 0;
|
|
395
|
-
}
|
|
396
|
-
handleFocusin() {
|
|
397
|
-
this.startListeningToKeyboard();
|
|
398
|
-
}
|
|
399
|
-
// when the focus is lost in the options menu, we need to remove the focus from the item, stop listening to keyboard events and clean up the aria-activedescendant
|
|
400
|
-
handleBlur(event) {
|
|
401
|
-
if (elementIsOrContains(this, event.relatedTarget)) {
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
this.stopListeningToKeyboard();
|
|
405
|
-
this._removeFocusedPropertyOnOptions();
|
|
406
|
-
this.removeAttribute("aria-activedescendant");
|
|
407
|
-
}
|
|
408
|
-
startListeningToKeyboard() {
|
|
409
|
-
this.addEventListener("keydown", this.handleKeydown);
|
|
410
|
-
}
|
|
411
|
-
stopListeningToKeyboard() {
|
|
412
|
-
this.removeEventListener("keydown", this.handleKeydown);
|
|
413
|
-
}
|
|
414
|
-
handleKeydown(event) {
|
|
415
|
-
var _a;
|
|
416
|
-
if (event.defaultPrevented) {
|
|
417
|
-
return;
|
|
418
|
-
}
|
|
419
|
-
const lastFocusedIndex = this.focusedOptionIndex;
|
|
420
|
-
const lastFocusedItem = [...this.visibleOptionElements].find(
|
|
421
|
-
(item) => {
|
|
422
|
-
var _a2, _b, _c, _d;
|
|
423
|
-
return ((_a2 = item.value) == null ? void 0 : _a2.toString()) === ((_d = (_c = (_b = this.options) == null ? void 0 : _b[lastFocusedIndex]) == null ? void 0 : _c.value) == null ? void 0 : _d.toString());
|
|
424
|
-
}
|
|
425
|
-
);
|
|
426
|
-
const { key } = event;
|
|
427
|
-
if (key === "Tab") {
|
|
428
|
-
this.prepareToCleanUp();
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
if (key === " " || key === "Enter") {
|
|
432
|
-
event.preventDefault();
|
|
433
|
-
if (lastFocusedItem) {
|
|
434
|
-
this.toggleOption(event, (_a = this.options) == null ? void 0 : _a[lastFocusedIndex]);
|
|
435
|
-
}
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
439
|
-
event.preventDefault();
|
|
440
|
-
this.navigateWithinOptions(event, lastFocusedItem);
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
navigateWithinOptions(event, optionElement) {
|
|
445
|
-
const { key } = event;
|
|
446
|
-
const direction = key === "ArrowDown" ? 1 : -1;
|
|
447
|
-
event.preventDefault();
|
|
448
|
-
event.stopPropagation();
|
|
449
|
-
const itemToFocus = this.focusOptionByOffset(
|
|
450
|
-
direction,
|
|
451
|
-
optionElement,
|
|
452
|
-
true
|
|
453
|
-
);
|
|
454
|
-
if (itemToFocus === optionElement) {
|
|
455
|
-
return;
|
|
456
|
-
}
|
|
457
|
-
if (!this._virtualizeActive) {
|
|
458
|
-
itemToFocus == null ? void 0 : itemToFocus.scrollIntoView({ block: "nearest" });
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
focusOptionByOffset(offset, optionElement, scrollIntoView) {
|
|
462
|
-
var _a;
|
|
463
|
-
const step = offset || 1;
|
|
464
|
-
if (optionElement) {
|
|
465
|
-
optionElement.focused = false;
|
|
466
|
-
}
|
|
467
|
-
const previousFocusedOptionIndex = this.focusedOptionIndex;
|
|
468
|
-
this.focusedOptionIndex = this.options.length > 0 ? (this.options.length + this.focusedOptionIndex + offset) % this.options.length : 0;
|
|
469
|
-
let optionToFocus = this.options[this.focusedOptionIndex];
|
|
470
|
-
let availableItems = this.options.length;
|
|
471
|
-
while (((optionToFocus == null ? void 0 : optionToFocus.disabled) || (optionToFocus == null ? void 0 : optionToFocus.divider)) && availableItems) {
|
|
472
|
-
availableItems -= 1;
|
|
473
|
-
this.focusedOptionIndex = (this.options.length + this.focusedOptionIndex + step) % this.options.length;
|
|
474
|
-
optionToFocus = this.options[this.focusedOptionIndex];
|
|
475
|
-
}
|
|
476
|
-
const reachedStart = previousFocusedOptionIndex < this.focusedOptionIndex && offset === -1;
|
|
477
|
-
const reachedEnd = previousFocusedOptionIndex > this.focusedOptionIndex && offset === 1;
|
|
478
|
-
if (reachedStart || reachedEnd) {
|
|
479
|
-
this.focusedOptionIndex = previousFocusedOptionIndex;
|
|
480
|
-
this.dispatchEvent(
|
|
481
|
-
new Event(`luzmo-exceeded-${reachedStart ? "top" : "bottom"}`, {
|
|
482
|
-
bubbles: true,
|
|
483
|
-
composed: true,
|
|
484
|
-
cancelable: true
|
|
485
|
-
})
|
|
486
|
-
);
|
|
487
|
-
}
|
|
488
|
-
let itemToFocus;
|
|
489
|
-
if (scrollIntoView && this._virtualizeActive) {
|
|
490
|
-
itemToFocus = [...this.visibleOptionElements].find(
|
|
491
|
-
(item) => {
|
|
492
|
-
var _a2, _b, _c;
|
|
493
|
-
return ((_a2 = item.value) == null ? void 0 : _a2.toString()) === ((_c = (_b = this.options[this.focusedOptionIndex]) == null ? void 0 : _b.value) == null ? void 0 : _c.toString());
|
|
494
|
-
}
|
|
495
|
-
);
|
|
496
|
-
if (!itemToFocus) {
|
|
497
|
-
this.focusedOptionIndex = this._firstVisibleIndex;
|
|
498
|
-
}
|
|
499
|
-
}
|
|
500
|
-
if (this._virtualizeActive && scrollIntoView) {
|
|
501
|
-
(_a = this.virtualizer.element(this.focusedOptionIndex)) == null ? void 0 : _a.scrollIntoView({
|
|
502
|
-
behavior: "smooth",
|
|
503
|
-
block: "nearest"
|
|
504
|
-
});
|
|
505
|
-
}
|
|
506
|
-
itemToFocus = itemToFocus ?? [...this.visibleOptionElements].find(
|
|
507
|
-
(item) => {
|
|
508
|
-
var _a2, _b, _c, _d, _e;
|
|
509
|
-
return (item.value === null ? null : (_a2 = item.value) == null ? void 0 : _a2.toString()) === (((_b = this.options[this.focusedOptionIndex]) == null ? void 0 : _b.value) === null ? (_c = this.options[this.focusedOptionIndex]) == null ? void 0 : _c.value : (_e = (_d = this.options[this.focusedOptionIndex]) == null ? void 0 : _d.value) == null ? void 0 : _e.toString());
|
|
510
|
-
}
|
|
511
|
-
);
|
|
512
|
-
if (!(optionToFocus == null ? void 0 : optionToFocus.disabled)) {
|
|
513
|
-
this.setFocusedAndActiveDescendant(itemToFocus);
|
|
514
|
-
}
|
|
515
|
-
return itemToFocus;
|
|
516
|
-
}
|
|
517
|
-
updateSelectedItemIndex() {
|
|
518
|
-
this.focusedOptionIndex = this._virtualizeActive ? this._firstVisibleIndex : 0;
|
|
519
|
-
}
|
|
520
|
-
setSelectedOptionsFromValue() {
|
|
521
|
-
this._selectedOptions = this.options.filter(
|
|
522
|
-
(option) => {
|
|
523
|
-
var _a;
|
|
524
|
-
return Array.isArray(this.value) && ((_a = this.value) == null ? void 0 : _a.includes((option == null ? void 0 : option.value) ?? null));
|
|
525
|
-
}
|
|
526
|
-
);
|
|
527
|
-
}
|
|
528
|
-
visibilityChanged(event) {
|
|
529
|
-
this._firstVisibleIndex = (event == null ? void 0 : event.first) ?? 0;
|
|
530
|
-
}
|
|
531
|
-
rangeChange(event) {
|
|
532
|
-
event.stopPropagation();
|
|
533
|
-
event.preventDefault();
|
|
534
|
-
if ((event == null ? void 0 : event.first) !== -1 && (event == null ? void 0 : event.last) !== -1) {
|
|
535
|
-
this.dispatchEvent(
|
|
536
|
-
new CustomEvent("luzmo-scrolled", {
|
|
537
|
-
bubbles: true,
|
|
538
|
-
composed: true,
|
|
539
|
-
cancelable: true,
|
|
540
|
-
detail: {
|
|
541
|
-
first: event.first,
|
|
542
|
-
last: event.last
|
|
543
|
-
}
|
|
544
|
-
})
|
|
545
|
-
);
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
async toggleOption(event, choice) {
|
|
549
|
-
var _a;
|
|
550
|
-
const keyboardEvent = event instanceof KeyboardEvent;
|
|
551
|
-
const index = this.options.findIndex(
|
|
552
|
-
(option) => (option == null ? void 0 : option.value) === (choice == null ? void 0 : choice.value)
|
|
553
|
-
);
|
|
554
|
-
this.focusedOptionIndex = index;
|
|
555
|
-
this.visibleOptionElements.forEach((item) => {
|
|
556
|
-
var _a2, _b;
|
|
557
|
-
if (keyboardEvent) {
|
|
558
|
-
const focused = ((item == null ? void 0 : item.value) === null ? null : (_a2 = item.value) == null ? void 0 : _a2.toString()) === ((choice == null ? void 0 : choice.value) === null ? null : (_b = choice == null ? void 0 : choice.value) == null ? void 0 : _b.toString());
|
|
559
|
-
item.focused = focused;
|
|
560
|
-
if (focused) {
|
|
561
|
-
this.setFocusedAndActiveDescendant(item);
|
|
562
|
-
}
|
|
563
|
-
} else {
|
|
564
|
-
item.focused = false;
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
const hasOption = Array.isArray(this.value) && ((_a = this.value) == null ? void 0 : _a.includes((choice == null ? void 0 : choice.value) ?? null));
|
|
568
|
-
if (this.selects === "single") {
|
|
569
|
-
this.value = [choice == null ? void 0 : choice.value];
|
|
570
|
-
this._selectedOptions = [choice];
|
|
571
|
-
} else {
|
|
572
|
-
this.value = hasOption ? this.value.filter((value) => value !== (choice == null ? void 0 : choice.value)) : [...this.value ?? [], choice == null ? void 0 : choice.value];
|
|
573
|
-
this._selectedOptions = hasOption ? this._selectedOptions.filter(
|
|
574
|
-
(option) => option.value !== choice.value
|
|
575
|
-
) : [...this._selectedOptions, choice];
|
|
576
|
-
}
|
|
577
|
-
await this.updateComplete;
|
|
578
|
-
this.dispatchEvent(
|
|
579
|
-
new CustomEvent("change", {
|
|
580
|
-
bubbles: true,
|
|
581
|
-
cancelable: true,
|
|
582
|
-
composed: true,
|
|
583
|
-
detail: {
|
|
584
|
-
value: this.value ?? []
|
|
585
|
-
}
|
|
586
|
-
})
|
|
587
|
-
);
|
|
588
|
-
this.prepareToCleanUp();
|
|
589
|
-
}
|
|
590
|
-
handleOptionClick(option, event) {
|
|
591
|
-
this.toggleOption(event, option);
|
|
592
|
-
}
|
|
593
|
-
render() {
|
|
594
|
-
const renderIcon = (icon) => {
|
|
595
|
-
return lit.html`<luzmo-icon
|
|
44
|
+
${this.href&&this.href.length>0?super.renderAnchor({id:"button",ariaHidden:!0,className:"button anchor hidden"}):a.E}
|
|
45
|
+
`}handlePointerdown(){}firstUpdated(t){super.firstUpdated(t),this.setAttribute("tabindex","-1"),this.addEventListener("pointerdown",this.handlePointerdown),this.hasAttribute("id")||(this.id=`luzmo-option-${X.randomID()}`)}updateAriaSelected(){const t=this.getAttribute("role");t==="option"?this.setAttribute("aria-selected",this.selected?"true":"false"):t==="optioncheckbox"&&this.setAttribute("aria-checked",this.selected?"true":"false")}setRole(t){this.setAttribute("role",t),this.updateAriaSelected()}updated(t){super.updated(t),t.has("label")&&(this.label||t.get("label")!==void 0)&&this.setAttribute("aria-label",this.label||""),this.anchorElement&&(this.anchorElement.addEventListener("focus",this.proxyFocus),this.anchorElement.tabIndex=-1),t.has("selected")&&this.updateAriaSelected()}connectedCallback(){super.connectedCallback(),this.triggerUpdate()}async triggerUpdate(){this.willDispatchUpdate||(this.willDispatchUpdate=!0,await new Promise(t=>requestAnimationFrame(t)),this.dispatchUpdate())}dispatchUpdate(){this.isConnected&&(this.willDispatchUpdate=!1)}}z([a.n({type:Boolean,reflect:!0})],b.prototype,"active",2);z([a.n({type:Boolean,reflect:!0})],b.prototype,"focused",2);z([a.n({type:Boolean,reflect:!0})],b.prototype,"selected",2);z([a.n({type:Boolean,reflect:!0})],b.prototype,"emphasized",2);z([a.n({type:String,reflect:!0})],b.prototype,"variant",2);z([a.n({type:String})],b.prototype,"value",1);z([L.e("slot:not([name])")],b.prototype,"contentSlot",2);z([L.e('slot[name="icon"]')],b.prototype,"iconSlot",2);z([a.n({type:Boolean,reflect:!0,attribute:"no-wrap",hasChanged(){return!1}})],b.prototype,"noWrap",2);z([L.e(".anchor")],b.prototype,"anchorElement",2);function O(r,t,o,e){var i=arguments.length,n=i<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,o):e,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(r,t,o,e);else for(var l=r.length-1;l>=0;l--)(s=r[l])&&(n=(i<3?s(n):i>3?s(t,o,n):s(t,o))||n);return i>3&&n&&Object.defineProperty(t,o,n),n}/**
|
|
46
|
+
* @license
|
|
47
|
+
* Copyright 2017 Google LLC
|
|
48
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
|
+
*/const F=(r,t,o)=>{const e=new Map;for(let i=t;i<=o;i++)e.set(r[i],i);return e},j=S.e(class extends S.i{constructor(r){if(super(r),r.type!==S.t.CHILD)throw Error("repeat() can only be used in text expressions")}dt(r,t,o){let e;o===void 0?o=t:t!==void 0&&(e=t);const i=[],n=[];let s=0;for(const l of r)i[s]=e?e(l,s):s,n[s]=o(l,s),s++;return{values:n,keys:i}}render(r,t,o){return this.dt(r,t,o).values}update(r,[t,o,e]){const i=g.p(r),{values:n,keys:s}=this.dt(t,o,e);if(!Array.isArray(i))return this.ut=s,n;const l=this.ut??(this.ut=[]),c=[];let h,m,d=0,p=i.length-1,u=0,v=n.length-1;for(;d<=p&&u<=v;)if(i[d]===null)d++;else if(i[p]===null)p--;else if(l[d]===s[u])c[u]=g.v(i[d],n[u]),d++,u++;else if(l[p]===s[v])c[v]=g.v(i[p],n[v]),p--,v--;else if(l[d]===s[v])c[v]=g.v(i[d],n[v]),g.r(r,c[v+1],i[d]),d++,v--;else if(l[p]===s[u])c[u]=g.v(i[p],n[u]),g.r(r,i[d],i[p]),p--,u++;else if(h===void 0&&(h=F(s,u,v),m=F(l,d,p)),h.has(l[d]))if(h.has(l[p])){const f=m.get(s[u]),y=f!==void 0?i[f]:null;if(y===null){const x=g.r(r,i[d]);g.v(x,n[u]),c[u]=x}else c[u]=g.v(y,n[u]),g.r(r,i[d],y),i[f]=null;u++}else g.M(i[p]),p--;else g.M(i[d]),d++;for(;u<=v;){const f=g.r(r,c[v+1]);g.v(f,n[u]),c[u++]=f}for(;d<=p;){const f=i[d++];f!==null&&g.M(f)}return this.ut=s,g.m(r,c),a.T}});/**
|
|
50
|
+
* @license
|
|
51
|
+
* Copyright 2021 Google LLC
|
|
52
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
53
|
+
*/class T extends Event{constructor(t){super(T.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}T.eventName="rangeChanged";class V extends Event{constructor(t){super(V.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}V.eventName="visibilityChanged";class M extends Event{constructor(){super(M.eventName,{bubbles:!1})}}M.eventName="unpinned";/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2021 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/class ct{constructor(t){this._element=null;const o=t??window;this._node=o,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class ht extends ct{constructor(t,o){super(o),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const e=this._node;this._originalScrollTo=e.scrollTo,this._originalScrollBy=e.scrollBy,this._originalScroll=e.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,o){const e=typeof t=="number"&&typeof o=="number"?{left:t,top:o}:t;this._scrollTo(e)}scrollBy(t,o){const e=typeof t=="number"&&typeof o=="number"?{left:t,top:o}:t;e.top!==void 0&&(e.top+=this.scrollTop),e.left!==void 0&&(e.left+=this.scrollLeft),this._scrollTo(e)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,o=null,e=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=o,this._end=e):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:o,left:e}=t;return o=o===void 0?void 0:Math.max(0,Math.min(o,this.maxScrollTop)),e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollLeft)),this._destination!==null&&e===this._destination.left&&o===this._destination.top?!1:(this.__destination={top:o,left:e,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,o,e){return this._scrollTo(t,o,e),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){const{scrollTop:t,scrollLeft:o}=this;let{top:e,left:i}=this._destination;e=Math.min(e||0,this.maxScrollTop),i=Math.min(i||0,this.maxScrollLeft);const n=Math.abs(e-t),s=Math.abs(i-o);n<1&&s<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}/**
|
|
58
|
+
* @license
|
|
59
|
+
* Copyright 2021 Google LLC
|
|
60
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
61
|
+
*/let $=typeof window<"u"?window.ResizeObserver:void 0;const R=Symbol("virtualizerRef"),I="virtualizer-sizer";let P;class ut{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(t.hostElement)this._init(t);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const o=t.layout||{};this._layoutInitialized=this._initLayout(o)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new $(()=>this._hostElementSizeChanged()),this._childrenRO=new $(this._childrenSizeChanged.bind(this))}_initHostElement(t){const o=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),o[R]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=vt(this._hostElement,t),this._scrollerController=new ht(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){var t,o,e,i;this._scrollEventListeners.forEach(n=>n.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],(t=this._scrollerController)==null||t.detach(this),this._scrollerController=null,(o=this._mutationObserver)==null||o.disconnect(),this._mutationObserver=null,(e=this._hostElementRO)==null||e.disconnect(),this._hostElementRO=null,(i=this._childrenRO)==null||i.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const o=this._hostElement.style;o.display=o.display||"block",o.position=o.position||"relative",o.contain=o.contain||"size layout",this._isScroller&&(o.overflow=o.overflow||"auto",o.minHeight=o.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let o=t.querySelector(`[${I}]`);o||(o=document.createElement("div"),o.setAttribute(I,""),t.appendChild(o)),Object.assign(o.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),o.textContent=" ",o.setAttribute(I,""),this._sizer=o}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const o=t.type||P;if(typeof o=="function"&&this._layout instanceof o){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let o,e;if(typeof t.type=="function"){e=t.type;const i={...t};delete i.type,o=i}else o=t;e===void 0&&(P=e=(await Promise.resolve().then(()=>require("../flow-DM3dNAKs.cjs"))).FlowLayout),this._layout=new e(i=>this._handleLayoutMessage(i),o),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){const t=window.performance.now(),o=t-this._benchmarkStart,i=performance.getEntriesByName("uv-virtualizing","measure").filter(n=>n.startTime>=this._benchmarkStart&&n.startTime<t).reduce((n,s)=>n+s.duration,0);return this._benchmarkStart=null,{timeElapsed:o,virtualizationTime:i}}return null}_measureChildren(){const t={},o=this._children,e=this._measureChildOverride||this._measureChild;for(let i=0;i<o.length;i++){const n=o[i],s=this._first+i;(this._itemsChanged||this._toBeMeasured.has(n))&&(t[s]=e.call(this,n,this._items[s]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:o,height:e}=t.getBoundingClientRect();return Object.assign({width:o,height:e},dt(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:o,_itemsChanged:e}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(o||e)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){var t;if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(o){console.warn("Error measuring performance data: ",o)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&((t=this._layout)==null||t.unpin()),this._schedule(this._updateLayout)}handleEvent(t){switch(t.type){case"scroll":(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();break;default:console.warn("event not handled",t)}}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new M)}get _children(){const t=[];let o=this._hostElement.firstElementChild;for(;o;)o.hasAttribute(I)||t.push(o),o=o.nextElementSibling;return t}_updateView(){var i;const t=this._hostElement,o=(i=this._scrollerController)==null?void 0:i.element,e=this._layout;if(t&&o&&e){let n,s,l,c;const h=t.getBoundingClientRect();n=0,s=0,l=window.innerHeight,c=window.innerWidth;const m=this._clippingAncestors.map(w=>w.getBoundingClientRect());m.unshift(h);for(const w of m)n=Math.max(n,w.top),s=Math.max(s,w.left),l=Math.min(l,w.bottom),c=Math.min(c,w.right);const d=o.getBoundingClientRect(),p={left:h.left-d.left,top:h.top-d.top},u={width:o.scrollWidth,height:o.scrollHeight},v=n-h.top+t.scrollTop,f=s-h.left+t.scrollLeft,y=Math.max(0,l-n),x=Math.max(0,c-s);e.viewportSize={width:x,height:y},e.viewportScroll={top:v,left:f},e.totalScrollSize=u,e.offsetWithinScroller=p}}_sizeHostElement(t){const e=t&&t.width!==null?Math.min(82e5,t.width):0,i=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${e}px, ${i}px)`;else{const n=this._hostElement.style;n.minWidth=e?`${e}px`:"100%",n.minHeight=i?`${i}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:o,left:e,width:i,height:n,xOffset:s,yOffset:l},c)=>{const h=this._children[c-this._first];h&&(h.style.position="absolute",h.style.boxSizing="border-box",h.style.transform=`translate(${e}px, ${o}px)`,i!==void 0&&(h.style.width=i+"px"),n!==void 0&&(h.style.height=n+"px"),h.style.left=s===void 0?null:s+"px",h.style.top=l===void 0?null:l+"px")})}async _adjustRange(t){const{_first:o,_last:e,_firstVisible:i,_lastVisible:n}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==o||this._last!==e,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==i||this._lastVisible!==n}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:o}=this._scrollerController,{top:e,left:i}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-e,left:o-i})}}element(t){var o;return t===1/0&&(t=this._items.length-1),((o=this._items)==null?void 0:o[t])===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){const o=this._layout.getScrollIntoViewCoordinates(t),{behavior:e}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(o,{behavior:e}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:o}=this._scrollIntoViewTarget||{};o&&(t!=null&&t.has(o))&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new T({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new V({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,o)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=o})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){var o;if((o=this._layout)!=null&&o.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function dt(r){const t=window.getComputedStyle(r);return{marginTop:A(t.marginTop),marginRight:A(t.marginRight),marginBottom:A(t.marginBottom),marginLeft:A(t.marginLeft)}}function A(r){const t=r?parseFloat(r):NaN;return Number.isNaN(t)?0:t}function B(r){if(r.assignedSlot!==null)return r.assignedSlot;if(r.parentElement!==null)return r.parentElement;const t=r.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function pt(r,t=!1){const o=[];let e=t?r:B(r);for(;e!==null;)o.push(e),e=B(e);return o}function vt(r,t=!1){let o=!1;return pt(r,t).filter(e=>{if(o)return!1;const i=getComputedStyle(e);return o=i.position==="fixed",i.overflow!=="visible"})}/**
|
|
62
|
+
* @license
|
|
63
|
+
* Copyright 2021 Google LLC
|
|
64
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
+
*/const U=r=>r,q=(r,t)=>a.x`${t}: ${JSON.stringify(r,null,2)}`;class mt extends Y.f{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(o,e)=>q(o,e+this._first),this._keyFunction=(o,e)=>U(o,e+this._first),this._items=[],t.type!==S.t.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const o=[];if(this._first>=0&&this._last>=this._first)for(let e=this._first;e<=this._last;e++)o.push(this._items[e]);return j(o,this._keyFunction,this._renderItem)}update(t,[o]){this._setFunctions(o);const e=this._items!==o.items;return this._items=o.items||[],this._virtualizer?this._updateVirtualizerConfig(t,o):this._initialize(t,o),e?a.T:this.render()}async _updateVirtualizerConfig(t,o){if(!await this._virtualizer.updateLayoutConfig(o.layout||{})){const i=t.parentNode;this._makeVirtualizer(i,o)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:o,keyFunction:e}=t;o&&(this._renderItem=(i,n)=>o(i,n+this._first)),e&&(this._keyFunction=(i,n)=>e(i,n+this._first))}_makeVirtualizer(t,o){this._virtualizer&&this._virtualizer.disconnected();const{layout:e,scroller:i,items:n}=o;this._virtualizer=new ut({hostElement:t,layout:e,scroller:i}),this._virtualizer.items=n,this._virtualizer.connected()}_initialize(t,o){const e=t.parentNode;e&&e.nodeType===1&&(e.addEventListener("rangeChanged",i=>{this._first=i.first,this._last=i.last,this.setValue(this.render())}),this._makeVirtualizer(e,o))}disconnected(){var t;(t=this._virtualizer)==null||t.disconnected()}reconnected(){var t;(t=this._virtualizer)==null||t.connected()}}const ft=S.e(mt);/**
|
|
66
|
+
* @license
|
|
67
|
+
* Copyright 2021 Google LLC
|
|
68
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
69
|
+
*/class C extends a.r$1{constructor(){super(...arguments),this.items=[],this.renderItem=q,this.keyFunction=U,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){const{items:t,renderItem:o,keyFunction:e,layout:i,scroller:n}=this;return a.x`${ft({items:t,renderItem:o,keyFunction:e,layout:i,scroller:n})}`}element(t){var o;return(o=this[R])==null?void 0:o.element(t)}get layoutComplete(){var t;return(t=this[R])==null?void 0:t.layoutComplete}scrollToIndex(t,o="start"){var e;(e=this.element(t))==null||e.scrollIntoView({block:o})}}O([a.n({attribute:!1})],C.prototype,"items",void 0);O([a.n()],C.prototype,"renderItem",void 0);O([a.n()],C.prototype,"keyFunction",void 0);O([a.n({attribute:!1})],C.prototype,"layout",void 0);O([a.n({reflect:!0,type:Boolean})],C.prototype,"scroller",void 0);/**
|
|
70
|
+
* @license
|
|
71
|
+
* Copyright 2021 Google LLC
|
|
72
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
73
|
+
*/customElements.define("lit-virtualizer",C);const gt=":host{--options-divider-thickness: var( --divider-thickness-medium, var(--luzmo-border-width) );inline-size:auto;margin-block:var(--luzmo-options-section-divider-margin-block, max(0px, (var(--option-section-divider-height) - var(--options-divider-thickness)) / 2));margin-inline:var(--luzmo-option-label-inline-edge-to-content, var(--option-label-inline-edge-to-content));overflow:visible}:host{display:block;flex-shrink:0}";class N extends D.SizedMixin(a.LuzmoElement,{validSizes:["s","m","l"]}){static get styles(){return[a.r(tt.dividerStyles),a.r(gt)]}firstUpdated(t){super.firstUpdated(t),this.setAttribute("role","separator")}}const bt=":host{--option-top-to-action: var(--luzmo-spacing-1);--option-top-to-checkbox: var(--luzmo-spacing-1);--option-label-line-height: var(--luzmo-line-height);--option-label-line-height-cjk: 1.5;--option-label-to-description-spacing: 1px;--option-focus-indicator-width: var(--luzmo-indicator-width);--option-focus-indicator-color: var(--luzmo-indicator-color);--option-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--option-label-content-color-default: var(--luzmo-font-color);--option-label-content-color-hover: var(--luzmo-font-color-hover);--option-label-content-color-down: var(--luzmo-font-color-down);--option-label-content-color-focus: var(--luzmo-font-color-focus);--option-label-icon-color-default: var(--luzmo-font-color);--option-label-icon-color-hover: var(--luzmo-font-color-hover);--option-label-icon-color-down: var(--luzmo-font-color-down);--option-label-icon-color-focus: var(--luzmo-font-color-focus);--option-highlight-selected-label-background-color: var(--luzmo-primary);--option-highlight-selected-label-content-color: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-hover: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-down: var( --luzmo-primary-inverse-color );--option-highlight-selected-label-content-color-focus: var( --luzmo-primary-inverse-color );--option-label-content-color-disabled: var(--luzmo-font-color-disabled);--option-label-icon-color-disabled: var(--luzmo-font-color-disabled);--option-description-line-height: var(--luzmo-line-height);--option-description-line-height-cjk: 1.5;--option-description-color-default: var(--luzmo-font-color);--option-description-color-hover: var(--luzmo-font-color-hover);--option-description-color-down: var(--luzmo-font-color-down);--option-description-color-focus: var(--luzmo-font-color-focus);--option-description-color-disabled: var(--luzmo-disabled-color);--options-section-header-line-height: var(--luzmo-line-height);--options-section-header-line-height-cjk: 1.5;--options-section-header-font-weight: bold;--options-section-header-color: var(--luzmo-font-color-hard);--options-collapsible-icon-color: var(--luzmo-font-color-hard);--options-checkmark-icon-color-default: var(--luzmo-font-color);--options-checkmark-icon-color-hover: var(--luzmo-font-color-hover);--options-checkmark-icon-color-down: var(--luzmo-font-color-down);--options-checkmark-icon-color-focus: var(--luzmo-font-color-focus);--options-checkbox-icon-color-default: var(--luzmo-font-color);--options-checkbox-icon-color-hover: var(--luzmo-font-color-hover);--options-checkbox-icon-color-down: var(--luzmo-font-color-down);--options-checkbox-icon-color-focus: var(--luzmo-font-color-focus);--options-drillin-icon-color-default: var(--luzmo-font-color);--options-drillin-icon-color-hover: var(--luzmo-font-color-hover);--options-drillin-icon-color-down: var(--luzmo-font-color-down);--options-drillin-icon-color-focus: var(--luzmo-font-color-focus);--option-value-color-default: var(--luzmo-font-color);--option-value-color-hover: var(--luzmo-font-color-hover);--option-value-color-down: var(--luzmo-font-color-down);--option-value-color-focus: var(--luzmo-font-color-focus);--option-collapsible-no-icon-suboption-padding-x-start: 28px;--option-background-color-selected: var(--luzmo-background-color);--option-background-color-default: var(--luzmo-background-color);--option-background-color-hover: var(--luzmo-background-color-hover);--option-background-color-down: var(--luzmo-background-color-down);--option-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--option-min-height: var(--luzmo-component-height);--option-icon-container-height: 18px;--options-pending-height: var(--option-min-height);--progress-circle-size: calc( var(--options-pending-height) - var(--option-top-edge-to-text) - var( --option-bottom-edge-to-text ) );--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size);--option-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--pending-inline-edge-to-content: var(--option-label-inline-edge-to-content);--option-top-edge-to-text: calc( var(--luzmo-spacing-2) + var(--luzmo-spacing-1) );--option-bottom-edge-to-text: var(--luzmo-spacing-3);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size);--options-section-header-min-width: var(--luzmo-component-height);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--option-min-height: var(--luzmo-component-height-s);--option-icon-container-height: 17px;--option-icon-height: var(--luzmo-font-size);--option-icon-width: var(--luzmo-font-size);--option-label-font-size: var(--luzmo-font-size-s);--option-label-text-to-visual: var(--luzmo-spacing-3);--option-label-text-to-control: var(--luzmo-spacing-3);--option-label-inline-edge-to-content: var(--luzmo-spacing-3);--option-top-edge-to-text: calc( var(--luzmo-spacing-1) + var(--luzmo-spacing-2) );--option-bottom-edge-to-text: var(--luzmo-spacing-2);--option-description-font-size: var(--luzmo-font-size-xs);--options-section-header-font-size: var(--luzmo-font-size-s);--options-section-header-min-width: var(--luzmo-component-height-s);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--option-checkmark-size: var(--luzmo-font-size-xs);--option-checkbox-size: var(--luzmo-font-size-xs);--option-top-to-checkmark: var(--luzmo-spacing-3);--option-top-to-checkbox: var(--luzmo-spacing-3)}:host([size=l]){--option-min-height: var(--luzmo-component-height-l);--option-icon-container-height: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--option-icon-height: var(--luzmo-font-size-l);--option-icon-width: var(--luzmo-font-size-l);--option-label-font-size: var(--luzmo-font-size-l);--option-label-text-to-visual: var(--luzmo-spacing-4);--option-label-text-to-control: var(--luzmo-spacing-4);--option-label-inline-edge-to-content: var(--luzmo-spacing-4);--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size-s);--options-section-header-font-size: var(--luzmo-font-size-l);--options-section-header-min-width: var(--luzmo-component-height-l);--option-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--option-checkmark-size: var(--luzmo-font-size-s);--option-checkbox-size: var(--luzmo-font-size-s);--option-top-to-checkmark: var(--luzmo-spacing-4);--option-top-to-checkbox: var(--luzmo-spacing-4)}:host([size=xl]){--option-min-height: var(--luzmo-component-height-xl);--option-icon-container-height: 26px;--option-icon-height: var(--luzmo-font-size-xl);--option-icon-width: var(--luzmo-font-size-xl);--option-label-font-size: var(--luzmo-font-size-xl);--option-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-text-to-control: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-edge-to-text: var(--luzmo-spacing-4);--option-bottom-edge-to-text: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--option-description-font-size: var(--luzmo-font-size);--options-section-header-font-size: var(--luzmo-font-size-xl);--options-section-header-min-width: var(--luzmo-component-height-xl);--option-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-checkmark-size: var(--luzmo-font-size);--option-checkbox-size: var(--luzmo-font-size);--option-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--option-top-to-checkbox: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}@media (forced-colors: active){:host{--highcontrast-option-background-color-default: ButtonFace;--highcontrast-option-color-default: ButtonText;--highcontrast-option-background-color-focus: Highlight;--highcontrast-option-color-focus: HighlightText;--highcontrast-options-checkmark-icon-color-default: Highlight;--highcontrast-options-checkbox-icon-color-default: Highlight;--highcontrast-option-color-disabled: GrayText;--highcontrast-option-focus-indicator-color: Highlight;--highcontrast-option-selected-background-color: Highlight;--highcontrast-option-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-option-selected-background-color: SelectedItem;--highcontrast-option-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-options-inline-size, auto);box-sizing:border-box;margin:0;padding:0;list-style-type:none;display:inline-block;overflow:auto}:host:lang(ja),:host:lang(ko),:host:lang(zh){--option-label-line-height: var( --luzmo-option-label-line-height-cjk, var(--option-label-line-height-cjk) );--option-description-line-height: var( --luzmo-option-description-line-height-cjk, var(--option-description-line-height-cjk) );--options-section-header-line-height: var( --luzmo-options-section-header-line-height-cjk, var(--options-section-header-line-height-cjk) )}luzmo-option{width:100%}#pending{display:flex;flex-shrink:0;align-items:center;height:var(--options-pending-height);padding-inline:var(--pending-inline-edge-to-content)}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";var _t=Object.defineProperty,k=(r,t,o,e)=>{for(var i=void 0,n=r.length-1,s;n>=0;n--)(s=r[n])&&(i=s(t,o,i)||i);return i&&_t(t,o,i),i};const H=25;function zt(r,t){return!!t&&(r===t||r.contains(t))}class _ extends D.SizedMixin(a.LuzmoElement,{noDefaultSize:!0}){constructor(){super(),this.label="",this.variant="highlight",this.selects="single",this.emphasized=!1,this.pending=!1,this.options=[],this.value=[],this.focusedOptionIndex=0,this._selectedOptions=[],this._firstVisibleIndex=0,this.addEventListener("focusin",this.handleFocusin),this.addEventListener("blur",this.handleBlur)}static get styles(){return[a.r(bt)]}get _virtualizeActive(){return this.options.length>H}firstUpdated(t){super.firstUpdated(t),this.hasAttribute("tabindex")||(this.tabIndex=0);const o=[new Promise(e=>requestAnimationFrame(()=>e(!0)))];[...this.children].forEach(e=>{e.localName==="luzmo-option"&&o.push(e.updateComplete)}),this.optionElementsUpdated=Promise.all(o)}willUpdate(t){var e;t.has("selects")&&this.selects==="single"&&((e=this.value)==null?void 0:e.length)>1&&(this.value=this.value.slice(0,1))}updated(t){super.updated(t),t.has("label")&&(this.label||t.get("label")!==void 0)&&(this.label?this.setAttribute("aria-label",this.label):this.removeAttribute("aria-label"))}async getUpdateComplete(){const t=await super.getUpdateComplete();return await this.optionElementsUpdated,t}focus({preventScroll:t}={}){super.focus({preventScroll:t}),this.focusOptionByOffset(0)}_removeFocusedPropertyOnOptions(){requestAnimationFrame(()=>{this.visibleOptionElements.forEach(t=>{t.focused=!1})})}scrollToTop(){this.scrollTop=0}handleFocusin(){this.startListeningToKeyboard()}handleBlur(t){zt(this,t.relatedTarget)||(this.stopListeningToKeyboard(),this._removeFocusedPropertyOnOptions(),this.removeAttribute("aria-activedescendant"))}startListeningToKeyboard(){this.addEventListener("keydown",this.handleKeydown)}stopListeningToKeyboard(){this.removeEventListener("keydown",this.handleKeydown)}handleKeydown(t){var n;if(t.defaultPrevented)return;const o=this.focusedOptionIndex,e=[...this.visibleOptionElements].find(s=>{var l,c,h,m;return((l=s.value)==null?void 0:l.toString())===((m=(h=(c=this.options)==null?void 0:c[o])==null?void 0:h.value)==null?void 0:m.toString())}),{key:i}=t;if(i==="Tab"){this.prepareToCleanUp();return}if(i===" "||i==="Enter"){t.preventDefault(),e&&this.toggleOption(t,(n=this.options)==null?void 0:n[o]);return}if(i==="ArrowDown"||i==="ArrowUp"){t.preventDefault(),this.navigateWithinOptions(t,e);return}}navigateWithinOptions(t,o){const{key:e}=t,i=e==="ArrowDown"?1:-1;t.preventDefault(),t.stopPropagation();const n=this.focusOptionByOffset(i,o,!0);n!==o&&(this._virtualizeActive||n==null||n.scrollIntoView({block:"nearest"}))}focusOptionByOffset(t,o,e){var d;const i=t||1;o&&(o.focused=!1);const n=this.focusedOptionIndex;this.focusedOptionIndex=this.options.length>0?(this.options.length+this.focusedOptionIndex+t)%this.options.length:0;let s=this.options[this.focusedOptionIndex],l=this.options.length;for(;(s!=null&&s.disabled||s!=null&&s.divider)&&l;)l-=1,this.focusedOptionIndex=(this.options.length+this.focusedOptionIndex+i)%this.options.length,s=this.options[this.focusedOptionIndex];const c=n<this.focusedOptionIndex&&t===-1,h=n>this.focusedOptionIndex&&t===1;(c||h)&&(this.focusedOptionIndex=n,this.dispatchEvent(new Event(`luzmo-exceeded-${c?"top":"bottom"}`,{bubbles:!0,composed:!0,cancelable:!0})));let m;return e&&this._virtualizeActive&&(m=[...this.visibleOptionElements].find(p=>{var u,v,f;return((u=p.value)==null?void 0:u.toString())===((f=(v=this.options[this.focusedOptionIndex])==null?void 0:v.value)==null?void 0:f.toString())}),m||(this.focusedOptionIndex=this._firstVisibleIndex)),this._virtualizeActive&&e&&((d=this.virtualizer.element(this.focusedOptionIndex))==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})),m=m??[...this.visibleOptionElements].find(p=>{var u,v,f,y,x;return(p.value===null?null:(u=p.value)==null?void 0:u.toString())===(((v=this.options[this.focusedOptionIndex])==null?void 0:v.value)===null?(f=this.options[this.focusedOptionIndex])==null?void 0:f.value:(x=(y=this.options[this.focusedOptionIndex])==null?void 0:y.value)==null?void 0:x.toString())}),s!=null&&s.disabled||this.setFocusedAndActiveDescendant(m),m}updateSelectedItemIndex(){this.focusedOptionIndex=this._virtualizeActive?this._firstVisibleIndex:0}setSelectedOptionsFromValue(){this._selectedOptions=this.options.filter(t=>{var o;return Array.isArray(this.value)&&((o=this.value)==null?void 0:o.includes((t==null?void 0:t.value)??null))})}visibilityChanged(t){this._firstVisibleIndex=(t==null?void 0:t.first)??0}rangeChange(t){t.stopPropagation(),t.preventDefault(),(t==null?void 0:t.first)!==-1&&(t==null?void 0:t.last)!==-1&&this.dispatchEvent(new CustomEvent("luzmo-scrolled",{bubbles:!0,composed:!0,cancelable:!0,detail:{first:t.first,last:t.last}}))}async toggleOption(t,o){var s;const e=t instanceof KeyboardEvent,i=this.options.findIndex(l=>(l==null?void 0:l.value)===(o==null?void 0:o.value));this.focusedOptionIndex=i,this.visibleOptionElements.forEach(l=>{var c,h;if(e){const m=((l==null?void 0:l.value)===null?null:(c=l.value)==null?void 0:c.toString())===((o==null?void 0:o.value)===null?null:(h=o==null?void 0:o.value)==null?void 0:h.toString());l.focused=m,m&&this.setFocusedAndActiveDescendant(l)}else l.focused=!1});const n=Array.isArray(this.value)&&((s=this.value)==null?void 0:s.includes((o==null?void 0:o.value)??null));this.selects==="single"?(this.value=[o==null?void 0:o.value],this._selectedOptions=[o]):(this.value=n?this.value.filter(l=>l!==(o==null?void 0:o.value)):[...this.value??[],o==null?void 0:o.value],this._selectedOptions=n?this._selectedOptions.filter(l=>l.value!==o.value):[...this._selectedOptions,o]),await this.updateComplete,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!0,composed:!0,detail:{value:this.value??[]}})),this.prepareToCleanUp()}handleOptionClick(t,o){this.toggleOption(o,t)}render(){const t=l=>a.x`<luzmo-icon
|
|
596
74
|
slot="icon"
|
|
597
|
-
.icon=${
|
|
75
|
+
.icon=${l}
|
|
598
76
|
.size=${this.size}
|
|
599
|
-
></luzmo-icon
|
|
600
|
-
};
|
|
601
|
-
const renderDescription = (description) => {
|
|
602
|
-
return lit.html`<span slot="description">${description}</span>`;
|
|
603
|
-
};
|
|
604
|
-
const renderImg = (imgSrc) => {
|
|
605
|
-
return lit.html`<luzmo-icon
|
|
77
|
+
></luzmo-icon>`,o=l=>a.x`<span slot="description">${l}</span>`,e=l=>a.x`<luzmo-icon
|
|
606
78
|
slot="icon"
|
|
607
|
-
.src=${
|
|
79
|
+
.src=${l}
|
|
608
80
|
.size=${this.size}
|
|
609
|
-
></luzmo-icon
|
|
610
|
-
|
|
611
|
-
const renderOption = (option) => {
|
|
612
|
-
var _a;
|
|
613
|
-
const value = option == null ? void 0 : option.value;
|
|
614
|
-
const label = option == null ? void 0 : option.label;
|
|
615
|
-
const description = option == null ? void 0 : option.description;
|
|
616
|
-
const icon = option == null ? void 0 : option.icon;
|
|
617
|
-
const imgSrc = option == null ? void 0 : option.imgSrc;
|
|
618
|
-
const divider = option == null ? void 0 : option.divider;
|
|
619
|
-
const disabled = typeof option === "string" ? void 0 : option == null ? void 0 : option.disabled;
|
|
620
|
-
return divider ? lit.html`<luzmo-options-divider></luzmo-options-divider>` : lit.html`<luzmo-option
|
|
621
|
-
.value=${value}
|
|
81
|
+
></luzmo-icon>`,i=l=>{var f;const c=l==null?void 0:l.value,h=l==null?void 0:l.label,m=l==null?void 0:l.description,d=l==null?void 0:l.icon,p=l==null?void 0:l.imgSrc,u=l==null?void 0:l.divider,v=typeof l=="string"||l==null?void 0:l.disabled;return u?a.x`<luzmo-options-divider></luzmo-options-divider>`:a.x`<luzmo-option
|
|
82
|
+
.value=${c}
|
|
622
83
|
.size=${this.size}
|
|
623
84
|
.variant=${this.variant}
|
|
624
85
|
?emphasized=${this.emphasized}
|
|
625
86
|
?no-wrap=${this.noWrap}
|
|
626
|
-
?disabled=${
|
|
627
|
-
.selected=${Array.isArray(this.value)
|
|
628
|
-
.role=${this.selects
|
|
629
|
-
@click=${this.handleOptionClick.bind(this,
|
|
87
|
+
?disabled=${v}
|
|
88
|
+
.selected=${Array.isArray(this.value)?(f=this.value)==null?void 0:f.includes(c):!1}
|
|
89
|
+
.role=${this.selects==="single"?"option":"optioncheckbox"}
|
|
90
|
+
@click=${this.handleOptionClick.bind(this,l)}
|
|
630
91
|
>
|
|
631
|
-
${
|
|
632
|
-
${
|
|
633
|
-
</luzmo-option
|
|
634
|
-
};
|
|
635
|
-
const renderedOptions = this._virtualizeActive ? lit.html`<lit-virtualizer
|
|
92
|
+
${d?t(d):p?e(p):a.E}
|
|
93
|
+
${h} ${m?o(m):a.E}
|
|
94
|
+
</luzmo-option>`},n=this._virtualizeActive?a.x`<lit-virtualizer
|
|
636
95
|
.items=${this.options}
|
|
637
|
-
.renderItem=${
|
|
96
|
+
.renderItem=${i}
|
|
638
97
|
@rangeChanged=${this.rangeChange}
|
|
639
98
|
@visibilityChanged=${this.visibilityChanged}
|
|
640
|
-
></lit-virtualizer
|
|
641
|
-
const pendingOption = this.pending ? lit.html`<div id="pending">
|
|
99
|
+
></lit-virtualizer>`:j(this.options,i),s=this.pending?a.x`<div id="pending">
|
|
642
100
|
<luzmo-progress-circle indeterminate></luzmo-progress-circle>
|
|
643
|
-
</div
|
|
644
|
-
return lit.html`${renderedOptions} ${pendingOption}`;
|
|
645
|
-
}
|
|
646
|
-
connectedCallback() {
|
|
647
|
-
super.connectedCallback();
|
|
648
|
-
this.setAttribute("role", "listbox");
|
|
649
|
-
this.updateComplete.then(() => this.updateItemFocus());
|
|
650
|
-
}
|
|
651
|
-
disconnectedCallback() {
|
|
652
|
-
super.disconnectedCallback();
|
|
653
|
-
}
|
|
654
|
-
prepareToCleanUp() {
|
|
655
|
-
document.addEventListener(
|
|
656
|
-
"focusout",
|
|
657
|
-
() => {
|
|
658
|
-
requestAnimationFrame(() => {
|
|
659
|
-
this.updateSelectedItemIndex();
|
|
660
|
-
});
|
|
661
|
-
},
|
|
662
|
-
{ once: true }
|
|
663
|
-
);
|
|
664
|
-
}
|
|
665
|
-
updateItemFocus() {
|
|
666
|
-
if (this.visibleOptionElements.length === 0) {
|
|
667
|
-
return;
|
|
668
|
-
}
|
|
669
|
-
const lastFocusedIndex = this.focusedOptionIndex;
|
|
670
|
-
const lastFocusedItem = [...this.visibleOptionElements].find(
|
|
671
|
-
(item) => {
|
|
672
|
-
var _a, _b, _c, _d, _e, _f;
|
|
673
|
-
return (item.value === null ? null : (_a = item.value) == null ? void 0 : _a.toString()) === (((_c = (_b = this.options) == null ? void 0 : _b[lastFocusedIndex]) == null ? void 0 : _c.value) === null ? null : (_f = (_e = (_d = this.options) == null ? void 0 : _d[lastFocusedIndex]) == null ? void 0 : _e.value) == null ? void 0 : _f.toString());
|
|
674
|
-
}
|
|
675
|
-
);
|
|
676
|
-
this.setFocusedAndActiveDescendant(lastFocusedItem);
|
|
677
|
-
}
|
|
678
|
-
setFocusedAndActiveDescendant(item) {
|
|
679
|
-
var _a, _b;
|
|
680
|
-
if (!item) {
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
const focused = this.hasVisibleFocusInTree() || !!(((_a = this.visibleOptionElements) == null ? void 0 : _a.some) && ((_b = this.visibleOptionElements) == null ? void 0 : _b.some(
|
|
684
|
-
(child) => child.hasVisibleFocusInTree()
|
|
685
|
-
)));
|
|
686
|
-
item.focused = focused;
|
|
687
|
-
if (focused) {
|
|
688
|
-
this.setAttribute("aria-activedescendant", item.id);
|
|
689
|
-
}
|
|
690
|
-
}
|
|
691
|
-
}
|
|
692
|
-
__decorateClass([
|
|
693
|
-
decorators_js.property({ type: String, reflect: true })
|
|
694
|
-
], LuzmoOptions.prototype, "label");
|
|
695
|
-
__decorateClass([
|
|
696
|
-
decorators_js.property({ type: String, reflect: true })
|
|
697
|
-
], LuzmoOptions.prototype, "variant");
|
|
698
|
-
__decorateClass([
|
|
699
|
-
decorators_js.property({ type: String, reflect: true })
|
|
700
|
-
], LuzmoOptions.prototype, "selects");
|
|
701
|
-
__decorateClass([
|
|
702
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
703
|
-
], LuzmoOptions.prototype, "emphasized");
|
|
704
|
-
__decorateClass([
|
|
705
|
-
decorators_js.property({ type: Boolean, reflect: true })
|
|
706
|
-
], LuzmoOptions.prototype, "pending");
|
|
707
|
-
__decorateClass([
|
|
708
|
-
decorators_js.property({ type: Array })
|
|
709
|
-
], LuzmoOptions.prototype, "options");
|
|
710
|
-
__decorateClass([
|
|
711
|
-
decorators_js.property({ type: Boolean, reflect: true, attribute: "no-wrap" })
|
|
712
|
-
], LuzmoOptions.prototype, "noWrap");
|
|
713
|
-
__decorateClass([
|
|
714
|
-
decorators_js.property({ type: Array })
|
|
715
|
-
], LuzmoOptions.prototype, "value");
|
|
716
|
-
__decorateClass([
|
|
717
|
-
decorators_js.query("lit-virtualizer")
|
|
718
|
-
], LuzmoOptions.prototype, "virtualizer");
|
|
719
|
-
__decorateClass([
|
|
720
|
-
decorators_js.queryAll("luzmo-option")
|
|
721
|
-
], LuzmoOptions.prototype, "visibleOptionElements");
|
|
722
|
-
if (!customElements.get("luzmo-options")) {
|
|
723
|
-
customElements.define("luzmo-options", LuzmoOptions);
|
|
724
|
-
}
|
|
725
|
-
if (!customElements.get("luzmo-options-divider")) {
|
|
726
|
-
customElements.define("luzmo-options-divider", LuzmoOptionsDivider);
|
|
727
|
-
}
|
|
728
|
-
if (!customElements.get("luzmo-option")) {
|
|
729
|
-
customElements.define("luzmo-option", LuzmoOption);
|
|
730
|
-
}
|
|
731
|
-
exports.LuzmoOption = LuzmoOption;
|
|
732
|
-
exports.LuzmoOptions = LuzmoOptions;
|
|
733
|
-
exports.LuzmoOptionsDivider = LuzmoOptionsDivider;
|
|
734
|
-
exports.VIRTUALIZE_AS_OF_NUM_ITEMS = VIRTUALIZE_AS_OF_NUM_ITEMS;
|
|
101
|
+
</div>`:a.E;return a.x`${n} ${s}`}connectedCallback(){super.connectedCallback(),this.setAttribute("role","listbox"),this.updateComplete.then(()=>this.updateItemFocus())}disconnectedCallback(){super.disconnectedCallback()}prepareToCleanUp(){document.addEventListener("focusout",()=>{requestAnimationFrame(()=>{this.updateSelectedItemIndex()})},{once:!0})}updateItemFocus(){if(this.visibleOptionElements.length===0)return;const t=this.focusedOptionIndex,o=[...this.visibleOptionElements].find(e=>{var i,n,s,l,c,h;return(e.value===null?null:(i=e.value)==null?void 0:i.toString())===(((s=(n=this.options)==null?void 0:n[t])==null?void 0:s.value)===null?null:(h=(c=(l=this.options)==null?void 0:l[t])==null?void 0:c.value)==null?void 0:h.toString())});this.setFocusedAndActiveDescendant(o)}setFocusedAndActiveDescendant(t){var e,i;if(!t)return;const o=this.hasVisibleFocusInTree()||!!((e=this.visibleOptionElements)!=null&&e.some&&((i=this.visibleOptionElements)!=null&&i.some(n=>n.hasVisibleFocusInTree())));t.focused=o,o&&this.setAttribute("aria-activedescendant",t.id)}}k([a.n({type:String,reflect:!0})],_.prototype,"label");k([a.n({type:String,reflect:!0})],_.prototype,"variant");k([a.n({type:String,reflect:!0})],_.prototype,"selects");k([a.n({type:Boolean,reflect:!0})],_.prototype,"emphasized");k([a.n({type:Boolean,reflect:!0})],_.prototype,"pending");k([a.n({type:Array})],_.prototype,"options");k([a.n({type:Boolean,reflect:!0,attribute:"no-wrap"})],_.prototype,"noWrap");k([a.n({type:Array})],_.prototype,"value");k([L.e("lit-virtualizer")],_.prototype,"virtualizer");k([et("luzmo-option")],_.prototype,"visibleOptionElements");customElements.get("luzmo-options")||customElements.define("luzmo-options",_);customElements.get("luzmo-options-divider")||customElements.define("luzmo-options-divider",N);customElements.get("luzmo-option")||customElements.define("luzmo-option",b);exports.LuzmoOption=b;exports.LuzmoOptions=_;exports.LuzmoOptionsDivider=N;exports.VIRTUALIZE_AS_OF_NUM_ITEMS=H;
|