@luzmo/lucero 1.0.1-alpha.15 → 1.0.1-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/accordion/index.cjs +183 -6
- package/components/accordion/index.js +136 -88
- package/components/action-bar/index.cjs +85 -4
- package/components/action-bar/index.js +72 -50
- package/components/action-button/index.cjs +205 -3
- package/components/action-button/index.js +167 -93
- package/components/action-group/index.cjs +7 -1
- package/components/action-group/index.js +12 -8
- package/components/action-group-DHp8RHDf.js +392 -0
- package/components/action-group-MPf19RPV.cjs +391 -0
- package/components/action-menu/index.cjs +91 -11
- package/components/action-menu/index.js +66 -47
- package/components/avatar/index.cjs +63 -3
- package/components/avatar/index.js +54 -42
- package/components/base-COw9n7UR.cjs +119 -0
- package/components/base-DmeVy0cq.js +120 -0
- package/components/button/index.cjs +134 -2
- package/components/button/index.js +106 -72
- package/components/button-base-7Ak55xFd.cjs +206 -0
- package/components/button-base-C3kf6BTK.js +207 -0
- package/components/button-group/index.cjs +45 -1
- package/components/button-group/index.js +37 -25
- package/components/calendar/index.cjs +632 -1
- package/components/calendar/index.js +637 -7
- package/components/checkbox/index.cjs +111 -4
- package/components/checkbox/index.js +98 -53
- package/components/checkbox-mixin-8cL-vfDy.js +84 -0
- package/components/checkbox-mixin-CE7dJj3J.cjs +83 -0
- package/components/clear-button-Co6oKSgl.js +59 -0
- package/components/clear-button-X_HDY2eH.cjs +58 -0
- package/components/close-button-DPBK6Kpu.cjs +59 -0
- package/components/close-button-Miw9ZjoJ.js +60 -0
- package/components/color-area/index.cjs +440 -13
- package/components/color-area/index.js +322 -187
- package/components/color-controller-BjDZaxhX.js +491 -0
- package/components/color-controller-C3c_vb2P.cjs +490 -0
- package/components/color-field/index.cjs +95 -2
- package/components/color-field/index.js +77 -41
- package/components/color-handle/index.cjs +64 -3
- package/components/color-handle/index.js +58 -37
- package/components/color-loupe/index.cjs +7 -1
- package/components/color-loupe/index.js +12 -8
- package/components/color-loupe-BQqNR8YD.cjs +88 -0
- package/components/color-loupe-B_DDFv8l.js +89 -0
- package/components/color-menu/index.cjs +217 -12
- package/components/color-menu/index.js +187 -93
- package/components/color-palette/index.cjs +89 -1
- package/components/color-palette/index.js +78 -51
- package/components/color-palette-group/index.cjs +259 -3
- package/components/color-palette-group/index.js +193 -105
- package/components/color-picker/index.cjs +114 -6
- package/components/color-picker/index.js +92 -72
- package/components/color-slider/index.cjs +585 -1
- package/components/color-slider/index.js +590 -7
- package/components/{directive-oAbCiebi.js → condition-attribute-with-id-Cn815e9W.js} +22 -22
- package/components/condition-attribute-with-id-DEc2Yjne.cjs +43 -0
- package/components/date-time-picker/index.cjs +1357 -31
- package/components/date-time-picker/index.js +951 -637
- package/components/dependency-manger-CcIE1uvQ.cjs +63 -0
- package/components/{dependency-manger-CEXvGQUV.js → dependency-manger-XHpQjFgK.js} +24 -14
- package/components/divider/index.cjs +54 -1
- package/components/divider/index.js +49 -30
- package/components/divider.module-Cm5LcDRV.cjs +20 -0
- package/components/divider.module-DauH6k2_.js +21 -0
- package/components/element-resolution-DCsrhGZO.cjs +112 -0
- package/components/element-resolution-nMlmW4Jy.js +113 -0
- package/components/field-group/index.cjs +7 -1
- package/components/field-group/index.js +12 -8
- package/components/field-group-DNmY8W9v.cjs +86 -0
- package/components/field-group-DVdAWCQF.js +87 -0
- package/components/field-label/index.cjs +7 -1
- package/components/field-label/index.js +12 -8
- package/components/field-label-CKH9EXpR.cjs +156 -0
- package/components/field-label-Dpsecoc6.js +157 -0
- package/components/focus-group-BqDAk9Is.js +337 -0
- package/components/focus-group-DFzOlalL.cjs +336 -0
- package/components/focus-visible-B-B8-P9R.cjs +104 -0
- package/components/focus-visible-BUPRWlsh.js +105 -0
- package/components/focusable-BPrTcZPd.cjs +262 -0
- package/components/focusable-ChCLg1k4.js +263 -0
- package/components/{directive-C7oCP5Bh.cjs → focusable-selectors-D0t_5P7C.cjs} +16 -5
- package/components/{focusable-selectors-B4YgbghQ.js → focusable-selectors-IltOAOd9.js} +7 -4
- package/components/icon/index.cjs +90 -1
- package/components/icon/index.js +74 -46
- package/components/index.cjs +174 -1
- package/components/index.js +174 -172
- package/components/infield-button/index.cjs +46 -2
- package/components/infield-button/index.js +41 -30
- package/components/label/index.cjs +37 -1
- package/components/label/index.js +36 -24
- package/components/{language-resolution-8yZa5r_P.js → language-resolution-BSGJAWiQ.js} +21 -16
- package/components/language-resolution-iN9EImbb.cjs +57 -0
- package/components/like-anchor-D62faRNG.cjs +79 -0
- package/components/like-anchor-v3cJ9RWM.js +80 -0
- package/components/manage-help-text-BYx84zZR.cjs +125 -0
- package/components/manage-help-text-DOuMTGht.js +126 -0
- package/components/menu/index.cjs +1297 -29
- package/components/menu/index.js +954 -499
- package/components/multi-language-field/index.cjs +132 -2
- package/components/multi-language-field/index.js +118 -88
- package/components/number-field/index.cjs +613 -10
- package/components/number-field/index.js +442 -243
- package/components/observe-slot-presence-9AwLGUQ_.cjs +78 -0
- package/components/observe-slot-presence-DcMdoumP.js +79 -0
- package/components/observe-slot-text-CSofZeeF.cjs +104 -0
- package/components/observe-slot-text-CjnkkBPn.js +105 -0
- package/components/options/index.cjs +693 -60
- package/components/options/index.js +519 -953
- package/components/overlay/index.cjs +367 -21
- package/components/overlay/index.js +273 -189
- package/components/overlay-CN8ISP1F.js +2485 -0
- package/components/overlay-LViy9VWM.cjs +2484 -0
- package/components/{pending-state-DTX7ggyF.js → pending-state-CXbe-Xul.js} +28 -13
- package/components/pending-state-e4RbXe9u.cjs +75 -0
- package/components/picker/index.cjs +9 -1
- package/components/picker/index.js +15 -11
- package/components/picker-DNde3awt.cjs +672 -0
- package/components/picker-PfUAF05y.js +673 -0
- package/components/picker-button/index.cjs +56 -4
- package/components/picker-button/index.js +45 -34
- package/components/platform-CxDar3Dn.cjs +68 -0
- package/components/platform-Cxn0WbyT.js +69 -0
- package/components/popover/index.cjs +7 -1
- package/components/popover/index.js +12 -8
- package/components/popover-BkbYhl3i.js +74 -0
- package/components/popover-BkgUf0kL.cjs +74 -0
- package/components/progress-circle/index.cjs +7 -1
- package/components/progress-circle/index.js +12 -8
- package/components/progress-circle-Hu_ivPHf.js +133 -0
- package/components/progress-circle-_Etqsj9f.cjs +132 -0
- package/components/radio/index.cjs +244 -2
- package/components/radio/index.js +192 -110
- package/components/{when-CDK1Tt5Y.js → random-id-BE6HA503.cjs} +7 -10
- package/components/{random-id-ByCz1xaq.js → random-id-BEc6QIUL.js} +3 -3
- package/components/roving-tabindex-AsmAh2In.cjs +95 -0
- package/components/roving-tabindex-DPF9NmrH.js +96 -0
- package/components/search/index.cjs +115 -8
- package/components/search/index.js +96 -66
- package/components/select/index.cjs +720 -51
- package/components/select/index.js +563 -347
- package/components/sized-mixin-DmkrNdWB.js +80 -0
- package/components/sized-mixin-UaTVa-AE.cjs +79 -0
- package/components/slider/index.cjs +119 -1
- package/components/slider/index.js +100 -1113
- package/components/{condition-attribute-with-id-Dv4lSRbe.js → slottable-request-event-CANixJnR.cjs} +15 -13
- package/components/{slottable-request-event-DggLA4Rx.js → slottable-request-event-D9WzrdWv.js} +12 -9
- package/components/strategies-DlMlaSJR.cjs +317 -0
- package/components/strategies-DlPQoTFE.js +318 -0
- package/components/streaming-listener-D4sHaMub.cjs +145 -0
- package/components/streaming-listener-cAz5zJyk.js +146 -0
- package/components/swatch/index.cjs +436 -7
- package/components/swatch/index.js +350 -205
- package/components/switch/index.cjs +61 -2
- package/components/switch/index.js +51 -34
- package/components/tabs/index.cjs +693 -26
- package/components/tabs/index.js +521 -388
- package/components/tags/index.cjs +201 -4
- package/components/tags/index.js +152 -87
- package/components/text-field/index.cjs +49 -3
- package/components/text-field/index.js +44 -30
- package/components/text-field-11tcnftU.cjs +338 -0
- package/components/text-field-Chi9J2Cz.js +339 -0
- package/components/text-field.module-CMBS0jSL.js +21 -0
- package/components/text-field.module-DIJdV_sA.cjs +20 -0
- package/components/toast/index.cjs +177 -12
- package/components/toast/index.js +145 -73
- package/components/tooltip/index.cjs +221 -6
- package/components/tooltip/index.js +155 -131
- package/components/tooltip/tooltip.d.ts +1 -12
- package/components/unit-input/index.cjs +232 -8
- package/components/unit-input/index.js +201 -108
- package/components/utils.cjs +25 -1
- package/components/utils.js +22 -22
- package/custom-elements.json +1 -1
- package/package.json +1 -1
- package/components/NumberFormatter-DewVDY5w.cjs +0 -18
- package/components/NumberFormatter-DgOUVrge.js +0 -136
- package/components/NumberParser-Dik4a0h-.cjs +0 -18
- package/components/NumberParser-ci9J5EKv.js +0 -173
- package/components/action-group-DBImibFn.js +0 -258
- package/components/action-group-DJGMcRHb.cjs +0 -20
- package/components/async-directive-BX1T1e1_.cjs +0 -22
- package/components/async-directive-BfcqVjDp.js +0 -82
- package/components/base-BjTwmyRF.cjs +0 -22
- package/components/base-CBCg3yyw.cjs +0 -40
- package/components/base-D76d76ww.js +0 -26
- package/components/base-WsynuqaS.js +0 -677
- package/components/button-base-DbkDzb71.js +0 -144
- package/components/button-base-XgPLmwP-.cjs +0 -25
- package/components/checkbox-mixin-BDN0dBtS.cjs +0 -27
- package/components/checkbox-mixin-Do7EgtpQ.js +0 -70
- package/components/class-map-Di1D_rCm.cjs +0 -22
- package/components/class-map-NbVXqBU0.js +0 -51
- package/components/clear-button-BbVqNU-g.js +0 -53
- package/components/clear-button-DYdeFsS8.cjs +0 -18
- package/components/close-button-CpfKibqg.cjs +0 -18
- package/components/close-button-DzOZZmkY.js +0 -51
- package/components/color-controller-B0uX6Zso.js +0 -3230
- package/components/color-controller-CoUL5f9K.cjs +0 -18
- package/components/color-loupe-CaA_Lfkk.cjs +0 -56
- package/components/color-loupe-CmMsXbjT.js +0 -81
- package/components/condition-attribute-with-id-DrQYZzFS.cjs +0 -18
- package/components/dependency-manger-C5HCkMMB.cjs +0 -18
- package/components/directive-helpers-Cm6gitnu.js +0 -62
- package/components/directive-helpers-DyIRTWwA.cjs +0 -22
- package/components/divider.module-DDvBo9zo.cjs +0 -18
- package/components/divider.module-DoQWQEIJ.js +0 -21
- package/components/element-resolution-BvRLGqIU.cjs +0 -18
- package/components/element-resolution-FCUT-wql.js +0 -91
- package/components/field-group-DXfBWrkO.js +0 -66
- package/components/field-group-DkGst3r5.cjs +0 -23
- package/components/field-label-CZ2zzChK.js +0 -106
- package/components/field-label-mO1AkUgR.cjs +0 -25
- package/components/flow-D-0MTYCm.js +0 -527
- package/components/flow-DM3dNAKs.cjs +0 -30
- package/components/focus-group-DHeTq18L.js +0 -218
- package/components/focus-group-DnxZUBhQ.cjs +0 -18
- package/components/focus-visible-B0P9aY_G.cjs +0 -18
- package/components/focus-visible-DBlJGoEW.js +0 -74
- package/components/focusable-BxtpnzWp.js +0 -153
- package/components/focusable-EbipgXRh.cjs +0 -18
- package/components/focusable-selectors-BgFlyFcY.cjs +0 -18
- package/components/if-defined-C9YGdo33.cjs +0 -22
- package/components/if-defined-DOaE2coe.js +0 -27
- package/components/index-BQoI8AD3.cjs +0 -113
- package/components/index-BwxgAdzi.cjs +0 -57
- package/components/index-Cb9zsiz6.js +0 -1490
- package/components/index-HjQa8tew.js +0 -1174
- package/components/language-resolution-DJzmyzZq.cjs +0 -18
- package/components/like-anchor-Bvn_vLQ8.js +0 -69
- package/components/like-anchor-sod1C1fR.cjs +0 -32
- package/components/luzmo-icons-D47EGj-3.cjs +0 -29
- package/components/luzmo-icons-NEyaMpEM.js +0 -229
- package/components/manage-help-text-DhgARkZX.cjs +0 -30
- package/components/manage-help-text-syYnjKGL.js +0 -92
- package/components/mutation-controller-DH7YOCyj.js +0 -52
- package/components/mutation-controller-DkOMCW-c.cjs +0 -22
- package/components/observe-slot-presence-CmVi0zTc.js +0 -68
- package/components/observe-slot-presence-bc9chhsi.cjs +0 -18
- package/components/observe-slot-text-BPfIQQtz.js +0 -87
- package/components/observe-slot-text-Ceb7SvYT.cjs +0 -18
- package/components/overlay-Cig9r6uU.js +0 -2747
- package/components/overlay-KSKMzzkh.cjs +0 -47
- package/components/pending-state-CaH1si5b.cjs +0 -26
- package/components/picker-CAYj4hBD.js +0 -461
- package/components/picker-apS0Zrly.cjs +0 -123
- package/components/platform-BM-uMWpX.js +0 -69
- package/components/platform-BiXhwqk3.cjs +0 -18
- package/components/popover-DjX0aAnY.js +0 -67
- package/components/popover-KFfO0IYL.cjs +0 -30
- package/components/progress-circle-BvRJNuNo.cjs +0 -33
- package/components/progress-circle-DXH9z8-6.js +0 -97
- package/components/query-BL-TJj7K.cjs +0 -22
- package/components/query-D_KR_GUc.js +0 -51
- package/components/query-assigned-elements-DjfhL1cl.js +0 -36
- package/components/query-assigned-elements-DsKsfk7G.cjs +0 -22
- package/components/query-assigned-nodes-BcKWmGzy.cjs +0 -22
- package/components/query-assigned-nodes-C76XVPWY.js +0 -36
- package/components/random-id-CqvckpWe.cjs +0 -18
- package/components/roving-tabindex-By_fCy_e.cjs +0 -18
- package/components/roving-tabindex-DOg4z6ZU.js +0 -66
- package/components/sized-mixin-CPxE5C96.cjs +0 -18
- package/components/sized-mixin-D4ACoVUr.js +0 -63
- package/components/slottable-request-event-BfUUt1Mh.cjs +0 -18
- package/components/state-D8JEtYqe.cjs +0 -22
- package/components/state-Deh-vKYE.js +0 -29
- package/components/strategies-9indNIEb.js +0 -195
- package/components/strategies-BACP6MhR.cjs +0 -18
- package/components/streaming-listener-B00MvALi.cjs +0 -18
- package/components/streaming-listener-CP-JE6Fa.js +0 -91
- package/components/style-map-CeilmSgs.cjs +0 -22
- package/components/style-map-IgqIKvlE.js +0 -53
- package/components/text-field-BYF2RHY8.cjs +0 -85
- package/components/text-field-PYafEYeO.js +0 -314
- package/components/text-field.module-C2KVUJcX.js +0 -21
- package/components/text-field.module-DXhFA9G-.cjs +0 -18
- package/components/when-CDZyJPvd.cjs +0 -22
package/components/menu/index.js
CHANGED
|
@@ -15,78 +15,118 @@
|
|
|
15
15
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16
16
|
* SOFTWARE.
|
|
17
17
|
* */
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
import { r as y } from "../random-id-ByCz1xaq.js";
|
|
25
|
-
import { s as D } from "../mutation-controller-DH7YOCyj.js";
|
|
26
|
-
import { F as O } from "../focusable-BxtpnzWp.js";
|
|
27
|
-
import { L as R } from "../like-anchor-Bvn_vLQ8.js";
|
|
28
|
-
import { O as P } from "../observe-slot-presence-CmVi0zTc.js";
|
|
29
|
-
import { O as L } from "../observe-slot-text-BPfIQQtz.js";
|
|
30
|
-
import { D as U } from "../dependency-manger-CEXvGQUV.js";
|
|
31
|
-
import { p as z, S as $, F as T, c as _ } from "../luzmo-icons-NEyaMpEM.js";
|
|
32
|
-
import { S as B } from "../slottable-request-event-DggLA4Rx.js";
|
|
33
|
-
const E = () => {
|
|
34
|
-
if (typeof document < "u" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
35
|
-
const r = document.createElement("style");
|
|
36
|
-
r.setAttribute("data-luzmo-vars", ""), r.textContent = 'html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}', document.head.appendChild(r);
|
|
18
|
+
const initializeGlobalLuzmoCSSVariables = () => {
|
|
19
|
+
if (typeof document !== "undefined" && !document.querySelector("style[data-luzmo-vars]")) {
|
|
20
|
+
const styleElement = document.createElement("style");
|
|
21
|
+
styleElement.setAttribute("data-luzmo-vars", "");
|
|
22
|
+
styleElement.textContent = `html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}`;
|
|
23
|
+
document.head.appendChild(styleElement);
|
|
37
24
|
}
|
|
38
25
|
};
|
|
39
|
-
|
|
40
|
-
const F = ":host{--menu-item-top-to-action: var(--luzmo-spacing-1);--menu-item-top-to-checkbox: var(--luzmo-spacing-1);--menu-item-label-line-height: var(--luzmo-line-height);--menu-item-label-line-height-cjk: 1.5;--menu-item-label-to-description-spacing: 1px;--menu-item-focus-indicator-width: var(--luzmo-indicator-width);--menu-item-focus-indicator-color: var(--luzmo-indicator-color);--menu-item-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--menu-item-label-content-color-default: var(--luzmo-font-color);--menu-item-label-content-color-hover: var(--luzmo-font-color-hover);--menu-item-label-content-color-down: var(--luzmo-font-color-down);--menu-item-label-content-color-focus: var(--luzmo-font-color-focus);--menu-item-highlight-label-background-color: var(--luzmo-primary);--menu-item-highlight-label-content-color: var(--luzmo-font-color);--menu-item-highlight-label-content-color-hover: var( --luzmo-font-color-hover );--menu-item-highlight-label-content-color-down: var(--luzmo-font-color-down);--menu-item-highlight-label-content-color-focus: var( --luzmo-font-color-focus );--menu-item-label-icon-color-default: var(--luzmo-font-color);--menu-item-label-icon-color-hover: var(--luzmo-font-color-hover);--menu-item-label-icon-color-down: var(--luzmo-font-color-down);--menu-item-label-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-label-content-color-disabled: var(--luzmo-font-color-disabled);--menu-item-label-icon-color-disabled: var(--luzmo-font-color-disabled);--menu-item-description-line-height: var(--luzmo-line-height);--menu-item-description-line-height-cjk: 1.5;--menu-item-description-color-default: var(--luzmo-font-color);--menu-item-description-color-hover: var(--luzmo-font-color-hover);--menu-item-description-color-down: var(--luzmo-font-color-down);--menu-item-description-color-focus: var(--luzmo-font-color-focus);--menu-item-description-color-disabled: var(--luzmo-disabled-color);--menu-section-header-line-height: var(--luzmo-line-height);--menu-section-header-line-height-cjk: 1.5;--menu-section-header-font-weight: bold;--menu-section-header-color: var(--luzmo-font-color-hard);--menu-collapsible-icon-color: var(--luzmo-font-color-hard);--menu-checkmark-icon-color-default: var(--luzmo-primary);--menu-checkmark-icon-color-hover: var(--luzmo-primary-hover);--menu-checkmark-icon-color-down: var(--luzmo-primary-down);--menu-checkmark-icon-color-focus: var(--luzmo-primary-focus);--menu-drillin-icon-color-default: var(--luzmo-font-color);--menu-drillin-icon-color-hover: var(--luzmo-font-color-hover);--menu-drillin-icon-color-down: var(--luzmo-font-color-down);--menu-drillin-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-value-color-default: var(--luzmo-font-color);--menu-item-value-color-hover: var(--luzmo-font-color-hover);--menu-item-value-color-down: var(--luzmo-font-color-down);--menu-item-value-color-focus: var(--luzmo-font-color-focus);--menu-checkmark-display-hidden: none;--menu-checkmark-display-shown: block;--menu-checkmark-display: block;--menu-item-collapsible-no-icon-submenu-item-padding-x-start: 28px;--menu-item-background-color-selected: var(--luzmo-background-color);--menu-item-background-color-default: var(--luzmo-background-color);--menu-item-background-color-hover: var(--luzmo-background-color-hover);--menu-item-background-color-down: var(--luzmo-background-color-down);--menu-item-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--menu-item-min-height: var(--luzmo-component-height);--menu-item-icon-height: var(--luzmo-font-size);--menu-item-icon-width: var(--luzmo-font-size);--menu-item-label-font-size: var(--luzmo-font-size);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size);--menu-section-header-min-width: var(--luzmo-component-height);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--menu-item-min-height: var(--luzmo-component-height-s);--menu-item-icon-height: var(--luzmo-font-size-s);--menu-item-icon-width: var(--luzmo-font-size-s);--menu-item-label-font-size: var(--luzmo-font-size-s);--menu-item-label-text-to-visual: var(--luzmo-spacing-3);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-3);--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: var(--luzmo-spacing-2);--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size-s);--menu-section-header-min-width: var(--luzmo-component-height-s);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size-s);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: var(--luzmo-spacing-3);--menu-back-icon-margin: var(--luzmo-spacing-3)}:host([size=l]){--menu-item-min-height: var(--luzmo-component-height-l);--menu-item-icon-height: var(--luzmo-font-size-l);--menu-item-icon-width: var(--luzmo-font-size-l);--menu-item-label-font-size: var(--luzmo-font-size-l);--menu-item-label-text-to-visual: var(--luzmo-spacing-4);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-4);--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-3);--menu-item-description-font-size: var(--luzmo-font-size-s);--menu-section-header-font-size: var(--luzmo-font-size-l);--menu-section-header-min-width: var(--luzmo-component-height-l);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--menu-item-checkmark-size: var(--luzmo-font-size-s);--menu-item-angle-size: var(--luzmo-font-size-l);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: var(--luzmo-spacing-4);--menu-back-icon-margin: var(--luzmo-spacing-4)}:host([size=xl]){--menu-item-min-height: var(--luzmo-component-height-xl);--menu-item-icon-height: var(--luzmo-font-size-xl);--menu-item-icon-width: var(--luzmo-font-size-xl);--menu-item-label-font-size: var(--luzmo-font-size-xl);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-4);--menu-item-description-font-size: var(--luzmo-font-size);--menu-section-header-font-size: var(--luzmo-font-size-xl);--menu-section-header-min-width: var(--luzmo-component-height-xl);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--luzmo-font-size);--menu-item-angle-size: var(--luzmo-font-size-xl);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}:host([variant=highlight]){--menu-item-highlight-label-content-color: var(--luzmo-primary-inverse-color);--menu-checkmark-display: var(--menu-checkmark-display-hidden);--menu-item-highlight-label-content-color-hover: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-down: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-focus: var( --luzmo-primary-inverse-color )}:host([variant=highlight]) ::slotted(luzmo-menu-item[selected]){padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));background-color:var(--luzmo-menu-item-highlight-label-background-color, var(--menu-item-highlight-label-background-color, var(--luzmo-border-color)))}@media (forced-colors: active){:host{--highcontrast-menu-item-background-color-default: ButtonFace;--highcontrast-menu-item-color-default: ButtonText;--highcontrast-menu-item-background-color-focus: Highlight;--highcontrast-menu-item-color-focus: HighlightText;--highcontrast-menu-checkmark-icon-color-default: Highlight;--highcontrast-menu-item-color-disabled: GrayText;--highcontrast-menu-item-focus-indicator-color: Highlight;--highcontrast-menu-item-selected-background-color: Highlight;--highcontrast-menu-item-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-menu-item-selected-background-color: SelectedItem;--highcontrast-menu-item-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-menu-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){--menu-item-label-line-height: var( --luzmo-menu-item-label-line-height-cjk, var(--menu-item-label-line-height-cjk) );--menu-item-description-line-height: var( --luzmo-menu-item-description-line-height-cjk, var(--menu-item-description-line-height-cjk) );--menu-section-header-line-height: var( --luzmo-menu-section-header-line-height-cjk, var(--menu-section-header-line-height-cjk) )}:host([selects]) ::slotted(luzmo-menu-item){--menu-checkmark-display: var(--menu-checkmark-display-hidden);padding-inline-start:var(--luzmo-menu-item-selectable-edge-to-text-not-selected, var(--menu-item-selectable-edge-to-text-not-selected))}:host([selects]) ::slotted(luzmo-menu-item[selected]){--menu-checkmark-display: var(--menu-checkmark-display-shown);padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content))}.luzmo-Menu-backIcon{margin-block:var(--luzmo-menu-back-icon-margin-block, var(--menu-back-icon-margin));margin-inline:var(--luzmo-menu-back-icon-margin-inline, var(--menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-sectionHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-section-header-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));min-inline-size:var(--luzmo-menu-section-header-min-width, var(--menu-section-header-min-width));padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-back .luzmo-Menu-sectionHeading{padding:0}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--luzmo-indicator-width) solid var(--luzmo-indicator-color);outline-offset:calc((var(--luzmo-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
26
|
+
initializeGlobalLuzmoCSSVariables();
|
|
27
|
+
import { unsafeCSS, html, nothing } from "lit";
|
|
28
|
+
import { property, query, queryAssignedNodes, state } from "lit/decorators.js";
|
|
29
|
+
import { a as LuzmoElement } from "../base-DmeVy0cq.js";
|
|
30
|
+
import { S as SizedMixin } from "../sized-mixin-DmkrNdWB.js";
|
|
31
|
+
import { d as dividerStyles } from "../divider.module-DauH6k2_.js";
|
|
32
|
+
import { r as randomID } from "../random-id-BEc6QIUL.js";
|
|
33
|
+
import { MutationController } from "@lit-labs/observers/mutation-controller.js";
|
|
34
|
+
import { F as Focusable } from "../focusable-ChCLg1k4.js";
|
|
35
|
+
import { L as LikeAnchor } from "../like-anchor-v3cJ9RWM.js";
|
|
36
|
+
import { O as ObserveSlotPresence } from "../observe-slot-presence-DcMdoumP.js";
|
|
37
|
+
import { O as ObserveSlotText } from "../observe-slot-text-CjnkkBPn.js";
|
|
38
|
+
import { D as DependencyManagerController } from "../dependency-manger-XHpQjFgK.js";
|
|
39
|
+
import { luzmoIcon, luzmoAngleRight, luzmoCheck, luzmoInfoCircleOutline } from "@luzmo/icons";
|
|
40
|
+
import { S as SlottableRequestEvent } from "../slottable-request-event-D9WzrdWv.js";
|
|
41
|
+
const menuStyles = ":host{--menu-item-top-to-action: var(--luzmo-spacing-1);--menu-item-top-to-checkbox: var(--luzmo-spacing-1);--menu-item-label-line-height: var(--luzmo-line-height);--menu-item-label-line-height-cjk: 1.5;--menu-item-label-to-description-spacing: 1px;--menu-item-focus-indicator-width: var(--luzmo-indicator-width);--menu-item-focus-indicator-color: var(--luzmo-indicator-color);--menu-item-label-to-value-area-min-spacing: var(--luzmo-spacing-3);--menu-item-label-content-color-default: var(--luzmo-font-color);--menu-item-label-content-color-hover: var(--luzmo-font-color-hover);--menu-item-label-content-color-down: var(--luzmo-font-color-down);--menu-item-label-content-color-focus: var(--luzmo-font-color-focus);--menu-item-highlight-label-background-color: var(--luzmo-primary);--menu-item-highlight-label-content-color: var(--luzmo-font-color);--menu-item-highlight-label-content-color-hover: var( --luzmo-font-color-hover );--menu-item-highlight-label-content-color-down: var(--luzmo-font-color-down);--menu-item-highlight-label-content-color-focus: var( --luzmo-font-color-focus );--menu-item-label-icon-color-default: var(--luzmo-font-color);--menu-item-label-icon-color-hover: var(--luzmo-font-color-hover);--menu-item-label-icon-color-down: var(--luzmo-font-color-down);--menu-item-label-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-label-content-color-disabled: var(--luzmo-font-color-disabled);--menu-item-label-icon-color-disabled: var(--luzmo-font-color-disabled);--menu-item-description-line-height: var(--luzmo-line-height);--menu-item-description-line-height-cjk: 1.5;--menu-item-description-color-default: var(--luzmo-font-color);--menu-item-description-color-hover: var(--luzmo-font-color-hover);--menu-item-description-color-down: var(--luzmo-font-color-down);--menu-item-description-color-focus: var(--luzmo-font-color-focus);--menu-item-description-color-disabled: var(--luzmo-disabled-color);--menu-section-header-line-height: var(--luzmo-line-height);--menu-section-header-line-height-cjk: 1.5;--menu-section-header-font-weight: bold;--menu-section-header-color: var(--luzmo-font-color-hard);--menu-collapsible-icon-color: var(--luzmo-font-color-hard);--menu-checkmark-icon-color-default: var(--luzmo-primary);--menu-checkmark-icon-color-hover: var(--luzmo-primary-hover);--menu-checkmark-icon-color-down: var(--luzmo-primary-down);--menu-checkmark-icon-color-focus: var(--luzmo-primary-focus);--menu-drillin-icon-color-default: var(--luzmo-font-color);--menu-drillin-icon-color-hover: var(--luzmo-font-color-hover);--menu-drillin-icon-color-down: var(--luzmo-font-color-down);--menu-drillin-icon-color-focus: var(--luzmo-font-color-focus);--menu-item-value-color-default: var(--luzmo-font-color);--menu-item-value-color-hover: var(--luzmo-font-color-hover);--menu-item-value-color-down: var(--luzmo-font-color-down);--menu-item-value-color-focus: var(--luzmo-font-color-focus);--menu-checkmark-display-hidden: none;--menu-checkmark-display-shown: block;--menu-checkmark-display: block;--menu-item-collapsible-no-icon-submenu-item-padding-x-start: 28px;--menu-item-background-color-selected: var(--luzmo-background-color);--menu-item-background-color-default: var(--luzmo-background-color);--menu-item-background-color-hover: var(--luzmo-background-color-hover);--menu-item-background-color-down: var(--luzmo-background-color-down);--menu-item-background-color-key-focus: var(--luzmo-background-color-focus)}:host{--menu-item-min-height: var(--luzmo-component-height);--menu-item-icon-height: var(--luzmo-font-size);--menu-item-icon-width: var(--luzmo-font-size);--menu-item-label-font-size: var(--luzmo-font-size);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size);--menu-section-header-min-width: var(--luzmo-component-height);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-3) + var(--luzmo-spacing-1) )}:host([size=s]){--menu-item-min-height: var(--luzmo-component-height-s);--menu-item-icon-height: var(--luzmo-font-size-s);--menu-item-icon-width: var(--luzmo-font-size-s);--menu-item-label-font-size: var(--luzmo-font-size-s);--menu-item-label-text-to-visual: var(--luzmo-spacing-3);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-3);--menu-item-top-edge-to-text: var(--luzmo-spacing-1);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-1);--menu-item-text-to-control: var(--luzmo-spacing-2);--menu-item-description-font-size: var(--luzmo-font-size-xs);--menu-section-header-font-size: var(--luzmo-font-size-s);--menu-section-header-min-width: var(--luzmo-component-height-s);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-3);--menu-item-checkmark-size: var(--luzmo-font-size-xs);--menu-item-angle-size: var(--luzmo-font-size-s);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: var(--luzmo-spacing-3);--menu-back-icon-margin: var(--luzmo-spacing-3)}:host([size=l]){--menu-item-min-height: var(--luzmo-component-height-l);--menu-item-icon-height: var(--luzmo-font-size-l);--menu-item-icon-width: var(--luzmo-font-size-l);--menu-item-label-font-size: var(--luzmo-font-size-l);--menu-item-label-text-to-visual: var(--luzmo-spacing-4);--menu-item-label-inline-edge-to-content: var(--luzmo-spacing-4);--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-3);--menu-item-description-font-size: var(--luzmo-font-size-s);--menu-section-header-font-size: var(--luzmo-font-size-l);--menu-section-header-min-width: var(--luzmo-component-height-l);--menu-item-selectable-edge-to-text-not-selected: var(--luzmo-spacing-4);--menu-item-checkmark-size: var(--luzmo-font-size-s);--menu-item-angle-size: var(--luzmo-font-size-l);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: var(--luzmo-spacing-4);--menu-back-icon-margin: var(--luzmo-spacing-4)}:host([size=xl]){--menu-item-min-height: var(--luzmo-component-height-xl);--menu-item-icon-height: var(--luzmo-font-size-xl);--menu-item-icon-width: var(--luzmo-font-size-xl);--menu-item-label-font-size: var(--luzmo-font-size-xl);--menu-item-label-text-to-visual: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-label-inline-edge-to-content: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-top-edge-to-text: var(--luzmo-spacing-2);--menu-item-bottom-edge-to-text: var(--luzmo-spacing-2);--menu-item-text-to-control: var(--luzmo-spacing-4);--menu-item-description-font-size: var(--luzmo-font-size);--menu-section-header-font-size: var(--luzmo-font-size-xl);--menu-section-header-min-width: var(--luzmo-component-height-xl);--menu-item-selectable-edge-to-text-not-selected: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-item-checkmark-size: var(--luzmo-font-size);--menu-item-angle-size: var(--luzmo-font-size-xl);--menu-item-top-to-icon: calc( ( var(--menu-item-min-height) - var(--menu-item-top-edge-to-text) - var( --menu-item-bottom-edge-to-text ) - var(--menu-item-icon-height) ) / 2 );--menu-item-top-to-checkmark: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) );--menu-back-icon-margin: calc( var(--luzmo-spacing-4) + var(--luzmo-spacing-1) )}:host([variant=highlight]){--menu-item-highlight-label-content-color: var(--luzmo-primary-inverse-color);--menu-checkmark-display: var(--menu-checkmark-display-hidden);--menu-item-highlight-label-content-color-hover: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-down: var( --luzmo-primary-inverse-color );--menu-item-highlight-label-content-color-focus: var( --luzmo-primary-inverse-color )}:host([variant=highlight]) ::slotted(luzmo-menu-item[selected]){padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));background-color:var(--luzmo-menu-item-highlight-label-background-color, var(--menu-item-highlight-label-background-color, var(--luzmo-border-color)))}@media (forced-colors: active){:host{--highcontrast-menu-item-background-color-default: ButtonFace;--highcontrast-menu-item-color-default: ButtonText;--highcontrast-menu-item-background-color-focus: Highlight;--highcontrast-menu-item-color-focus: HighlightText;--highcontrast-menu-checkmark-icon-color-default: Highlight;--highcontrast-menu-item-color-disabled: GrayText;--highcontrast-menu-item-focus-indicator-color: Highlight;--highcontrast-menu-item-selected-background-color: Highlight;--highcontrast-menu-item-selected-color: HighlightText}@supports (color: SelectedItem){:host{--highcontrast-menu-item-selected-background-color: SelectedItem;--highcontrast-menu-item-selected-color: SelectedItemText}}}:host{inline-size:auto;inline-size:var(--luzmo-menu-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){--menu-item-label-line-height: var( --luzmo-menu-item-label-line-height-cjk, var(--menu-item-label-line-height-cjk) );--menu-item-description-line-height: var( --luzmo-menu-item-description-line-height-cjk, var(--menu-item-description-line-height-cjk) );--menu-section-header-line-height: var( --luzmo-menu-section-header-line-height-cjk, var(--menu-section-header-line-height-cjk) )}:host([selects]) ::slotted(luzmo-menu-item){--menu-checkmark-display: var(--menu-checkmark-display-hidden);padding-inline-start:var(--luzmo-menu-item-selectable-edge-to-text-not-selected, var(--menu-item-selectable-edge-to-text-not-selected))}:host([selects]) ::slotted(luzmo-menu-item[selected]){--menu-checkmark-display: var(--menu-checkmark-display-shown);padding-inline-start:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content))}.luzmo-Menu-backIcon{margin-block:var(--luzmo-menu-back-icon-margin-block, var(--menu-back-icon-margin));margin-inline:var(--luzmo-menu-back-icon-margin-inline, var(--menu-back-icon-margin));fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-icon-color-default, var(--menu-section-header-color)))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-sectionHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-section-header-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));min-inline-size:var(--luzmo-menu-section-header-min-width, var(--menu-section-header-min-width));padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-back .luzmo-Menu-sectionHeading{padding:0}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--luzmo-indicator-width) solid var(--luzmo-indicator-color);outline-offset:calc((var(--luzmo-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{display:inline-flex;flex-direction:column;width:100%}:host(:focus){outline:none}::slotted(*){flex-shrink:0}";
|
|
42
|
+
var __defProp$2 = Object.defineProperty;
|
|
43
|
+
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
44
|
+
var __decorateClass$2 = (decorators, target, key, kind) => {
|
|
45
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target;
|
|
46
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
47
|
+
if (decorator = decorators[i])
|
|
48
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
49
|
+
if (kind && result) __defProp$2(target, key, result);
|
|
50
|
+
return result;
|
|
45
51
|
};
|
|
46
|
-
function
|
|
47
|
-
return !!
|
|
52
|
+
function elementIsOrContains(el, isOrContains) {
|
|
53
|
+
return !!isOrContains && (el === isOrContains || el.contains(isOrContains));
|
|
48
54
|
}
|
|
49
|
-
class
|
|
50
|
-
noDefaultSize:
|
|
55
|
+
class LuzmoMenu extends SizedMixin(LuzmoElement, {
|
|
56
|
+
noDefaultSize: true
|
|
51
57
|
}) {
|
|
52
58
|
constructor() {
|
|
53
|
-
super()
|
|
54
|
-
|
|
59
|
+
super();
|
|
60
|
+
this.label = "";
|
|
61
|
+
this.ignore = false;
|
|
62
|
+
this.value = "";
|
|
63
|
+
this.valueSeparator = ",";
|
|
64
|
+
this.selectedItems = [];
|
|
65
|
+
this.focusedItemIndex = 0;
|
|
66
|
+
this.focusInItemIndex = 0;
|
|
67
|
+
this._selected = [];
|
|
68
|
+
this.cacheUpdated = Promise.resolve();
|
|
69
|
+
this.childItemSet = /* @__PURE__ */ new Set();
|
|
70
|
+
this.selectedItemsMap = /* @__PURE__ */ new Map();
|
|
71
|
+
this._hasUpdatedSelectedItemIndex = false;
|
|
72
|
+
this._willUpdateItems = false;
|
|
73
|
+
this.pointerUpTarget = null;
|
|
74
|
+
this.descendentOverlays = /* @__PURE__ */ new Map();
|
|
75
|
+
this.handleSubmenuClosed = (event) => {
|
|
76
|
+
event.stopPropagation();
|
|
77
|
+
const target = event.composedPath()[0];
|
|
78
|
+
target.dispatchEvent(
|
|
55
79
|
new Event("luzmo-menu-submenu-closed", {
|
|
56
|
-
bubbles:
|
|
57
|
-
composed:
|
|
80
|
+
bubbles: true,
|
|
81
|
+
composed: true
|
|
58
82
|
})
|
|
59
83
|
);
|
|
60
|
-
}
|
|
61
|
-
|
|
84
|
+
};
|
|
85
|
+
this.handleSubmenuOpened = (event) => {
|
|
86
|
+
event.stopPropagation();
|
|
87
|
+
const target = event.composedPath()[0];
|
|
88
|
+
target.dispatchEvent(
|
|
62
89
|
new Event("luzmo-menu-submenu-opened", {
|
|
63
|
-
bubbles:
|
|
64
|
-
composed:
|
|
90
|
+
bubbles: true,
|
|
91
|
+
composed: true
|
|
65
92
|
})
|
|
66
93
|
);
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
94
|
+
const focusedItem = this.childItems[this.focusedItemIndex];
|
|
95
|
+
if (focusedItem) {
|
|
96
|
+
focusedItem.focused = false;
|
|
97
|
+
}
|
|
98
|
+
const openedItem = event.composedPath().find((el) => this.childItemSet.has(el));
|
|
99
|
+
if (!openedItem) {
|
|
71
100
|
return;
|
|
72
|
-
|
|
73
|
-
|
|
101
|
+
}
|
|
102
|
+
const openedItemIndex = this.childItems.indexOf(
|
|
103
|
+
openedItem
|
|
74
104
|
);
|
|
75
|
-
this.focusedItemIndex =
|
|
76
|
-
|
|
77
|
-
}
|
|
105
|
+
this.focusedItemIndex = openedItemIndex;
|
|
106
|
+
this.focusInItemIndex = openedItemIndex;
|
|
107
|
+
};
|
|
108
|
+
this.resolveCacheUpdated = () => {
|
|
109
|
+
};
|
|
110
|
+
this.addEventListener(
|
|
78
111
|
"luzmo-menu-item-added-or-updated",
|
|
79
112
|
this.onSelectableItemAddedOrUpdated
|
|
80
|
-
)
|
|
113
|
+
);
|
|
114
|
+
this.addEventListener(
|
|
81
115
|
"luzmo-menu-item-added-or-updated",
|
|
82
116
|
this.onFocusableItemAddedOrUpdated,
|
|
83
117
|
{
|
|
84
|
-
capture:
|
|
118
|
+
capture: true
|
|
85
119
|
}
|
|
86
|
-
)
|
|
120
|
+
);
|
|
121
|
+
this.addEventListener("click", this.handleClick);
|
|
122
|
+
this.addEventListener("pointerup", this.handlePointerup);
|
|
123
|
+
this.addEventListener("focusin", this.handleFocusin);
|
|
124
|
+
this.addEventListener("blur", this.handleBlur);
|
|
125
|
+
this.addEventListener("luzmo-opened", this.handleSubmenuOpened);
|
|
126
|
+
this.addEventListener("luzmo-closed", this.handleSubmenuClosed);
|
|
87
127
|
}
|
|
88
128
|
static get styles() {
|
|
89
|
-
return [
|
|
129
|
+
return [unsafeCSS(menuStyles)];
|
|
90
130
|
}
|
|
91
131
|
get isSubmenu() {
|
|
92
132
|
return this.slot === "submenu";
|
|
@@ -94,16 +134,31 @@ class m extends I(w, {
|
|
|
94
134
|
get selected() {
|
|
95
135
|
return this._selected;
|
|
96
136
|
}
|
|
97
|
-
set selected(
|
|
98
|
-
if (
|
|
137
|
+
set selected(selected) {
|
|
138
|
+
if (selected === this.selected) {
|
|
99
139
|
return;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
140
|
+
}
|
|
141
|
+
const old = this.selected;
|
|
142
|
+
this._selected = selected;
|
|
143
|
+
this.selectedItems = [];
|
|
144
|
+
this.selectedItemsMap.clear();
|
|
145
|
+
this.childItems.forEach((item) => {
|
|
146
|
+
if (this !== item.menuData.selectionRoot) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
item.selected = this.selected.includes(item.value);
|
|
150
|
+
if (item.selected) {
|
|
151
|
+
this.selectedItems.push(item);
|
|
152
|
+
this.selectedItemsMap.set(item, true);
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
this.requestUpdate("selected", old);
|
|
104
156
|
}
|
|
105
157
|
get childItems() {
|
|
106
|
-
|
|
158
|
+
if (!this.cachedChildItems) {
|
|
159
|
+
this.cachedChildItems = this.updateCachedMenuItems();
|
|
160
|
+
}
|
|
161
|
+
return this.cachedChildItems;
|
|
107
162
|
}
|
|
108
163
|
/**
|
|
109
164
|
* Hide this getter from web-component-analyzer until
|
|
@@ -113,168 +168,300 @@ class m extends I(w, {
|
|
|
113
168
|
* @private
|
|
114
169
|
*/
|
|
115
170
|
get childRole() {
|
|
116
|
-
if (this.resolvedRole === "listbox")
|
|
171
|
+
if (this.resolvedRole === "listbox") {
|
|
117
172
|
return "option";
|
|
173
|
+
}
|
|
118
174
|
switch (this.resolvedSelects) {
|
|
119
|
-
case "single":
|
|
175
|
+
case "single": {
|
|
120
176
|
return "menuitemradio";
|
|
121
|
-
|
|
177
|
+
}
|
|
178
|
+
case "multiple": {
|
|
122
179
|
return "menuitemcheckbox";
|
|
123
|
-
|
|
180
|
+
}
|
|
181
|
+
default: {
|
|
124
182
|
return "menuitem";
|
|
183
|
+
}
|
|
125
184
|
}
|
|
126
185
|
}
|
|
127
186
|
get ownRole() {
|
|
128
187
|
return "menu";
|
|
129
188
|
}
|
|
130
|
-
focus({ preventScroll
|
|
131
|
-
if (this.childItems.every((
|
|
189
|
+
focus({ preventScroll } = {}) {
|
|
190
|
+
if (this.childItems.every((childItem) => childItem.disabled)) {
|
|
132
191
|
return;
|
|
133
|
-
|
|
134
|
-
|
|
192
|
+
}
|
|
193
|
+
if (this.childItems.some((childItem) => childItem.menuData.focusRoot !== this)) {
|
|
194
|
+
super.focus({ preventScroll });
|
|
135
195
|
return;
|
|
136
196
|
}
|
|
137
|
-
this.focusMenuItemByOffset(0)
|
|
138
|
-
|
|
139
|
-
|
|
197
|
+
this.focusMenuItemByOffset(0);
|
|
198
|
+
super.focus({ preventScroll });
|
|
199
|
+
const selectedItem = this.selectedItems[0];
|
|
200
|
+
if (selectedItem && !preventScroll) {
|
|
201
|
+
selectedItem.scrollIntoView({ block: "nearest" });
|
|
202
|
+
}
|
|
140
203
|
}
|
|
141
|
-
handleFocusin(
|
|
142
|
-
var
|
|
143
|
-
if (this.childItems.some((
|
|
204
|
+
handleFocusin(event) {
|
|
205
|
+
var _a;
|
|
206
|
+
if (this.childItems.some((childItem) => childItem.menuData.focusRoot !== this)) {
|
|
144
207
|
return;
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
208
|
+
}
|
|
209
|
+
const activeElement = this.getRootNode().activeElement;
|
|
210
|
+
const selectionRoot = ((_a = this.childItems[this.focusedItemIndex]) == null ? void 0 : _a.menuData.selectionRoot) || this;
|
|
211
|
+
if (activeElement !== selectionRoot || event.target !== this) {
|
|
212
|
+
selectionRoot.focus({ preventScroll: true });
|
|
213
|
+
if (activeElement && this.focusedItemIndex === 0) {
|
|
214
|
+
const offset = this.childItems.indexOf(activeElement);
|
|
215
|
+
this.focusMenuItemByOffset(Math.max(offset, 0));
|
|
216
|
+
}
|
|
149
217
|
}
|
|
150
218
|
this.startListeningToKeyboard();
|
|
151
219
|
}
|
|
152
220
|
startListeningToKeyboard() {
|
|
153
221
|
this.addEventListener("keydown", this.handleKeydown);
|
|
154
222
|
}
|
|
155
|
-
handleBlur(
|
|
156
|
-
|
|
223
|
+
handleBlur(event) {
|
|
224
|
+
if (elementIsOrContains(this, event.relatedTarget)) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
this.stopListeningToKeyboard();
|
|
228
|
+
this.childItems.forEach((child) => child.focused = false);
|
|
229
|
+
this.removeAttribute("aria-activedescendant");
|
|
157
230
|
}
|
|
158
231
|
stopListeningToKeyboard() {
|
|
159
232
|
this.removeEventListener("keydown", this.handleKeydown);
|
|
160
233
|
}
|
|
161
|
-
selectOrToggleItem(
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
234
|
+
selectOrToggleItem(targetItem) {
|
|
235
|
+
const resolvedSelects = this.resolvedSelects;
|
|
236
|
+
const oldSelectedItemsMap = new Map(this.selectedItemsMap);
|
|
237
|
+
const oldSelected = [...this.selected];
|
|
238
|
+
const oldSelectedItems = [...this.selectedItems];
|
|
239
|
+
const oldValue = this.value;
|
|
240
|
+
const focusedChild = this.childItems[this.focusedItemIndex];
|
|
241
|
+
if (focusedChild) {
|
|
242
|
+
focusedChild.focused = false;
|
|
243
|
+
focusedChild.active = false;
|
|
244
|
+
}
|
|
245
|
+
this.focusedItemIndex = this.childItems.indexOf(targetItem);
|
|
246
|
+
this.forwardFocusVisibleToItem(targetItem);
|
|
247
|
+
if (resolvedSelects === "multiple") {
|
|
248
|
+
if (this.selectedItemsMap.has(targetItem)) {
|
|
249
|
+
this.selectedItemsMap.delete(targetItem);
|
|
250
|
+
} else {
|
|
251
|
+
this.selectedItemsMap.set(targetItem, true);
|
|
252
|
+
}
|
|
253
|
+
const selected = [];
|
|
254
|
+
const selectedItems = [];
|
|
255
|
+
this.childItemSet.forEach((childItem) => {
|
|
256
|
+
if (childItem.menuData.selectionRoot !== this) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
if (this.selectedItemsMap.has(childItem)) {
|
|
260
|
+
selected.push(childItem.value);
|
|
261
|
+
selectedItems.push(childItem);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
this._selected = selected;
|
|
265
|
+
this.selectedItems = selectedItems;
|
|
266
|
+
this.value = this.selected.join(this.valueSeparator);
|
|
267
|
+
} else {
|
|
268
|
+
this.selectedItemsMap.clear();
|
|
269
|
+
this.selectedItemsMap.set(targetItem, true);
|
|
270
|
+
this.value = targetItem.value;
|
|
271
|
+
this._selected = [targetItem.value];
|
|
272
|
+
this.selectedItems = [targetItem];
|
|
273
|
+
}
|
|
274
|
+
const applyDefault = this.dispatchEvent(
|
|
172
275
|
new Event("change", {
|
|
173
|
-
cancelable:
|
|
174
|
-
bubbles:
|
|
175
|
-
composed:
|
|
276
|
+
cancelable: true,
|
|
277
|
+
bubbles: true,
|
|
278
|
+
composed: true
|
|
176
279
|
})
|
|
177
|
-
)
|
|
178
|
-
|
|
280
|
+
);
|
|
281
|
+
if (!applyDefault) {
|
|
282
|
+
this._selected = oldSelected;
|
|
283
|
+
this.selectedItems = oldSelectedItems;
|
|
284
|
+
this.selectedItemsMap = oldSelectedItemsMap;
|
|
285
|
+
this.value = oldValue;
|
|
179
286
|
return;
|
|
180
287
|
}
|
|
181
|
-
if (
|
|
182
|
-
for (const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
288
|
+
if (resolvedSelects === "single") {
|
|
289
|
+
for (const oldItem of oldSelectedItemsMap.keys()) {
|
|
290
|
+
if (oldItem !== targetItem) {
|
|
291
|
+
oldItem.selected = false;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
targetItem.selected = true;
|
|
295
|
+
} else if (resolvedSelects === "multiple") {
|
|
296
|
+
targetItem.selected = !targetItem.selected;
|
|
297
|
+
}
|
|
186
298
|
}
|
|
187
|
-
handleKeydown(
|
|
188
|
-
if (
|
|
299
|
+
handleKeydown(event) {
|
|
300
|
+
if (event.defaultPrevented) {
|
|
189
301
|
return;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
302
|
+
}
|
|
303
|
+
const lastFocusedItem = this.childItems[this.focusedItemIndex];
|
|
304
|
+
if (lastFocusedItem) {
|
|
305
|
+
lastFocusedItem.focused = true;
|
|
306
|
+
}
|
|
307
|
+
const { key } = event;
|
|
308
|
+
if (event.shiftKey && event.target !== this && this.hasAttribute("tabindex")) {
|
|
194
309
|
this.removeAttribute("tabindex");
|
|
195
|
-
const
|
|
196
|
-
!
|
|
310
|
+
const replaceTabindex = (eventForTab) => {
|
|
311
|
+
if (!eventForTab.shiftKey && !this.hasAttribute("tabindex")) {
|
|
312
|
+
this.tabIndex = 0;
|
|
313
|
+
document.removeEventListener("keyup", replaceTabindex);
|
|
314
|
+
this.removeEventListener("focusout", replaceTabindex);
|
|
315
|
+
}
|
|
197
316
|
};
|
|
198
|
-
document.addEventListener("keyup",
|
|
317
|
+
document.addEventListener("keyup", replaceTabindex);
|
|
318
|
+
this.addEventListener("focusout", replaceTabindex);
|
|
199
319
|
}
|
|
200
|
-
if (
|
|
320
|
+
if (key === "Tab") {
|
|
201
321
|
this.prepareToCleanUp();
|
|
202
322
|
return;
|
|
203
323
|
}
|
|
204
|
-
if (
|
|
205
|
-
|
|
324
|
+
if (key === " " && (lastFocusedItem == null ? void 0 : lastFocusedItem.hasSubmenu)) {
|
|
325
|
+
lastFocusedItem.openOverlay();
|
|
206
326
|
return;
|
|
207
327
|
}
|
|
208
|
-
if (
|
|
209
|
-
const
|
|
210
|
-
|
|
328
|
+
if (key === " " || key === "Enter") {
|
|
329
|
+
const childItem = this.childItems[this.focusedItemIndex];
|
|
330
|
+
if (childItem && childItem.menuData.selectionRoot === event.target) {
|
|
331
|
+
event.preventDefault();
|
|
332
|
+
childItem.click();
|
|
333
|
+
}
|
|
211
334
|
return;
|
|
212
335
|
}
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
215
|
-
|
|
336
|
+
if (key === "ArrowDown" || key === "ArrowUp") {
|
|
337
|
+
const childItem = this.childItems[this.focusedItemIndex];
|
|
338
|
+
if (childItem && childItem.menuData.selectionRoot === event.target) {
|
|
339
|
+
this.navigateWithinMenu(event);
|
|
340
|
+
}
|
|
216
341
|
return;
|
|
217
342
|
}
|
|
218
|
-
this.navigateBetweenRelatedMenus(
|
|
219
|
-
}
|
|
220
|
-
focusMenuItemByOffset(
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
343
|
+
this.navigateBetweenRelatedMenus(event);
|
|
344
|
+
}
|
|
345
|
+
focusMenuItemByOffset(offset) {
|
|
346
|
+
const step = offset || 1;
|
|
347
|
+
const focusedItem = this.childItems[this.focusedItemIndex];
|
|
348
|
+
if (focusedItem) {
|
|
349
|
+
focusedItem.focused = false;
|
|
350
|
+
focusedItem.active = focusedItem.open;
|
|
351
|
+
}
|
|
352
|
+
this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + offset) % this.childItems.length;
|
|
353
|
+
let itemToFocus = this.childItems[this.focusedItemIndex];
|
|
354
|
+
let availableItems = this.childItems.length;
|
|
355
|
+
while ((itemToFocus == null ? void 0 : itemToFocus.disabled) && availableItems) {
|
|
356
|
+
availableItems -= 1;
|
|
357
|
+
this.focusedItemIndex = (this.childItems.length + this.focusedItemIndex + step) % this.childItems.length;
|
|
358
|
+
itemToFocus = this.childItems[this.focusedItemIndex];
|
|
359
|
+
}
|
|
360
|
+
if (!(itemToFocus == null ? void 0 : itemToFocus.disabled)) {
|
|
361
|
+
this.forwardFocusVisibleToItem(itemToFocus);
|
|
362
|
+
}
|
|
363
|
+
return itemToFocus;
|
|
227
364
|
}
|
|
228
365
|
updateSelectedItemIndex() {
|
|
229
|
-
let
|
|
230
|
-
const
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
366
|
+
let firstOrFirstSelectedIndex = 0;
|
|
367
|
+
const selectedItemsMap = /* @__PURE__ */ new Map();
|
|
368
|
+
const selected = [];
|
|
369
|
+
const selectedItems = [];
|
|
370
|
+
let itemIndex = this.childItems.length;
|
|
371
|
+
while (itemIndex) {
|
|
372
|
+
itemIndex -= 1;
|
|
373
|
+
const childItem = this.childItems[itemIndex];
|
|
374
|
+
if (childItem.menuData.selectionRoot === this) {
|
|
375
|
+
if (childItem.selected || !this._hasUpdatedSelectedItemIndex && this.selected.includes(childItem.value)) {
|
|
376
|
+
firstOrFirstSelectedIndex = itemIndex;
|
|
377
|
+
selectedItemsMap.set(childItem, true);
|
|
378
|
+
selected.unshift(childItem.value);
|
|
379
|
+
selectedItems.unshift(childItem);
|
|
380
|
+
}
|
|
381
|
+
if (itemIndex !== firstOrFirstSelectedIndex) {
|
|
382
|
+
childItem.focused = false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
selectedItems.map((item, i) => {
|
|
387
|
+
if (i > 0) {
|
|
388
|
+
item.focused = false;
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
this.selectedItemsMap = selectedItemsMap;
|
|
392
|
+
this._selected = selected;
|
|
393
|
+
this.selectedItems = selectedItems;
|
|
394
|
+
this.value = this.selected.join(this.valueSeparator);
|
|
395
|
+
this.focusedItemIndex = firstOrFirstSelectedIndex;
|
|
396
|
+
this.focusInItemIndex = firstOrFirstSelectedIndex;
|
|
240
397
|
}
|
|
241
398
|
closeDescendentOverlays() {
|
|
242
|
-
this.descendentOverlays.forEach((
|
|
243
|
-
|
|
244
|
-
})
|
|
399
|
+
this.descendentOverlays.forEach((overlay) => {
|
|
400
|
+
overlay.open = false;
|
|
401
|
+
});
|
|
402
|
+
this.descendentOverlays = /* @__PURE__ */ new Map();
|
|
245
403
|
}
|
|
246
404
|
render() {
|
|
247
405
|
return this.renderMenuItemSlot();
|
|
248
406
|
}
|
|
249
407
|
connectedCallback() {
|
|
250
|
-
super.connectedCallback()
|
|
408
|
+
super.connectedCallback();
|
|
409
|
+
if (!this.hasAttribute("role") && !this.ignore) {
|
|
410
|
+
this.setAttribute("role", this.ownRole);
|
|
411
|
+
}
|
|
412
|
+
this.updateComplete.then(() => this.updateItemFocus());
|
|
251
413
|
}
|
|
252
414
|
disconnectedCallback() {
|
|
253
|
-
this.cachedChildItems = void 0
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
415
|
+
this.cachedChildItems = void 0;
|
|
416
|
+
this.selectedItems = [];
|
|
417
|
+
this.selectedItemsMap.clear();
|
|
418
|
+
this.childItemSet.clear();
|
|
419
|
+
this.descendentOverlays = /* @__PURE__ */ new Map();
|
|
420
|
+
super.disconnectedCallback();
|
|
421
|
+
}
|
|
422
|
+
handleDescendentOverlayOpened(event) {
|
|
423
|
+
const target = event.composedPath()[0];
|
|
424
|
+
if (!target.overlayElement) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
this.descendentOverlays.set(target.overlayElement, target.overlayElement);
|
|
266
428
|
}
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
429
|
+
handleDescendentOverlayClosed(event) {
|
|
430
|
+
const target = event.composedPath()[0];
|
|
431
|
+
if (!target.overlayElement) {
|
|
432
|
+
return;
|
|
433
|
+
}
|
|
434
|
+
this.descendentOverlays.delete(target.overlayElement);
|
|
435
|
+
}
|
|
436
|
+
navigateWithinMenu(event) {
|
|
437
|
+
const { key } = event;
|
|
438
|
+
const lastFocusedItem = this.childItems[this.focusedItemIndex];
|
|
439
|
+
const direction = key === "ArrowDown" ? 1 : -1;
|
|
440
|
+
const itemToFocus = this.focusMenuItemByOffset(direction);
|
|
441
|
+
if (itemToFocus === lastFocusedItem) {
|
|
442
|
+
return;
|
|
443
|
+
}
|
|
444
|
+
event.preventDefault();
|
|
445
|
+
event.stopPropagation();
|
|
446
|
+
itemToFocus.scrollIntoView({ block: "nearest" });
|
|
447
|
+
}
|
|
448
|
+
navigateBetweenRelatedMenus(event) {
|
|
449
|
+
const { key } = event;
|
|
450
|
+
event.stopPropagation();
|
|
451
|
+
const shouldOpenSubmenu = this.isLTR && key === "ArrowRight" || !this.isLTR && key === "ArrowLeft";
|
|
452
|
+
const shouldCloseSelfAsSubmenu = this.isLTR && key === "ArrowLeft" || !this.isLTR && key === "ArrowRight";
|
|
453
|
+
if (shouldOpenSubmenu) {
|
|
454
|
+
const lastFocusedItem = this.childItems[this.focusedItemIndex];
|
|
455
|
+
if (lastFocusedItem == null ? void 0 : lastFocusedItem.hasSubmenu) {
|
|
456
|
+
lastFocusedItem.openOverlay();
|
|
457
|
+
}
|
|
458
|
+
} else if (shouldCloseSelfAsSubmenu && this.isSubmenu) {
|
|
459
|
+
this.dispatchEvent(new Event("close", { bubbles: true }));
|
|
460
|
+
this.updateSelectedItemIndex();
|
|
461
|
+
}
|
|
275
462
|
}
|
|
276
463
|
renderMenuItemSlot() {
|
|
277
|
-
return
|
|
464
|
+
return html`
|
|
278
465
|
<slot
|
|
279
466
|
@luzmo-menu-submenu-opened=${this.handleDescendentOverlayOpened}
|
|
280
467
|
@luzmo-menu-submenu-closed=${this.handleDescendentOverlayClosed}
|
|
@@ -282,52 +469,72 @@ class m extends I(w, {
|
|
|
282
469
|
></slot>
|
|
283
470
|
`;
|
|
284
471
|
}
|
|
285
|
-
firstUpdated(
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
472
|
+
firstUpdated(changed) {
|
|
473
|
+
super.firstUpdated(changed);
|
|
474
|
+
if (!this.hasAttribute("tabindex") && !this.ignore) {
|
|
475
|
+
const role = this.getAttribute("role");
|
|
476
|
+
this.tabIndex = role === "group" ? -1 : 0;
|
|
289
477
|
}
|
|
290
|
-
const
|
|
291
|
-
new Promise((
|
|
478
|
+
const updates = [
|
|
479
|
+
new Promise((res) => requestAnimationFrame(() => res(true)))
|
|
292
480
|
];
|
|
293
|
-
[...this.children].forEach((
|
|
294
|
-
|
|
295
|
-
|
|
481
|
+
[...this.children].forEach((item) => {
|
|
482
|
+
if (item.localName === "luzmo-menu-item") {
|
|
483
|
+
updates.push(item.updateComplete);
|
|
484
|
+
}
|
|
485
|
+
});
|
|
486
|
+
this.childItemsUpdated = Promise.all(updates);
|
|
296
487
|
}
|
|
297
|
-
updated(
|
|
298
|
-
super.updated(
|
|
488
|
+
updated(changes) {
|
|
489
|
+
super.updated(changes);
|
|
490
|
+
if (changes.has("selects") && this.hasUpdated) {
|
|
491
|
+
this.selectsChanged();
|
|
492
|
+
}
|
|
493
|
+
if (changes.has("label") && (this.label || changes.get("label") !== void 0)) {
|
|
494
|
+
if (this.label) {
|
|
495
|
+
this.setAttribute("aria-label", this.label);
|
|
496
|
+
} else {
|
|
497
|
+
this.removeAttribute("aria-label");
|
|
498
|
+
}
|
|
499
|
+
}
|
|
299
500
|
}
|
|
300
501
|
selectsChanged() {
|
|
301
|
-
const
|
|
302
|
-
new Promise((
|
|
502
|
+
const updates = [
|
|
503
|
+
new Promise((res) => requestAnimationFrame(() => res(true)))
|
|
303
504
|
];
|
|
304
|
-
this.childItemSet.forEach((
|
|
305
|
-
|
|
306
|
-
})
|
|
505
|
+
this.childItemSet.forEach((childItem) => {
|
|
506
|
+
updates.push(childItem.triggerUpdate());
|
|
507
|
+
});
|
|
508
|
+
this.childItemsUpdated = Promise.all(updates);
|
|
307
509
|
}
|
|
308
510
|
async getUpdateComplete() {
|
|
309
|
-
const
|
|
310
|
-
|
|
511
|
+
const complete = await super.getUpdateComplete();
|
|
512
|
+
await this.childItemsUpdated;
|
|
513
|
+
await this.cacheUpdated;
|
|
514
|
+
return complete;
|
|
311
515
|
}
|
|
312
516
|
updateCachedMenuItems() {
|
|
313
|
-
|
|
517
|
+
this.cachedChildItems = [];
|
|
518
|
+
if (!this.menuSlot) {
|
|
314
519
|
return [];
|
|
315
|
-
|
|
316
|
-
|
|
520
|
+
}
|
|
521
|
+
const slottedElements = this.menuSlot.assignedElements({
|
|
522
|
+
flatten: true
|
|
317
523
|
});
|
|
318
|
-
for (const [
|
|
319
|
-
if (this.childItemSet.has(
|
|
320
|
-
this.cachedChildItems.push(
|
|
524
|
+
for (const [i, slottedElement] of slottedElements.entries()) {
|
|
525
|
+
if (this.childItemSet.has(slottedElement)) {
|
|
526
|
+
this.cachedChildItems.push(slottedElement);
|
|
321
527
|
continue;
|
|
322
528
|
}
|
|
323
|
-
const
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
529
|
+
const isHTMLSlotElement = slottedElement.localName === "slot";
|
|
530
|
+
const flattenedChildren = isHTMLSlotElement ? slottedElement.assignedElements({
|
|
531
|
+
flatten: true
|
|
532
|
+
}) : [...slottedElement.querySelectorAll(":scope > *")];
|
|
533
|
+
slottedElements.splice(
|
|
534
|
+
i,
|
|
328
535
|
1,
|
|
329
|
-
|
|
330
|
-
...
|
|
536
|
+
slottedElement,
|
|
537
|
+
...flattenedChildren
|
|
331
538
|
);
|
|
332
539
|
}
|
|
333
540
|
return this.cachedChildItems;
|
|
@@ -339,11 +546,15 @@ class m extends I(w, {
|
|
|
339
546
|
* dispatching `<luzmo-menu-item>` element.
|
|
340
547
|
* @param event
|
|
341
548
|
*/
|
|
342
|
-
onFocusableItemAddedOrUpdated(
|
|
343
|
-
|
|
344
|
-
hadFocusRoot: !!
|
|
345
|
-
ancestorWithSelects:
|
|
346
|
-
})
|
|
549
|
+
onFocusableItemAddedOrUpdated(event) {
|
|
550
|
+
event.menuCascade.set(this, {
|
|
551
|
+
hadFocusRoot: !!event.item.menuData.focusRoot,
|
|
552
|
+
ancestorWithSelects: event.currentAncestorWithSelects
|
|
553
|
+
});
|
|
554
|
+
if (this.selects) {
|
|
555
|
+
event.currentAncestorWithSelects = this;
|
|
556
|
+
}
|
|
557
|
+
event.item.menuData.focusRoot = event.item.menuData.focusRoot || this;
|
|
347
558
|
}
|
|
348
559
|
/**
|
|
349
560
|
* When a descendant `<luzmo-menu-item>` element is added or updated it will dispatch
|
|
@@ -352,61 +563,103 @@ class m extends I(w, {
|
|
|
352
563
|
* manage the selection state of the dispatching `<luzmo-menu-item>` element.
|
|
353
564
|
* @param event
|
|
354
565
|
*/
|
|
355
|
-
onSelectableItemAddedOrUpdated(
|
|
356
|
-
var
|
|
357
|
-
const
|
|
358
|
-
if (!
|
|
566
|
+
onSelectableItemAddedOrUpdated(event) {
|
|
567
|
+
var _a, _b;
|
|
568
|
+
const cascadeData = event.menuCascade.get(this);
|
|
569
|
+
if (!cascadeData) {
|
|
359
570
|
return;
|
|
360
|
-
|
|
571
|
+
}
|
|
572
|
+
event.item.menuData.parentMenu = event.item.menuData.parentMenu || this;
|
|
573
|
+
if (cascadeData.hadFocusRoot && !this.ignore) {
|
|
574
|
+
this.tabIndex = -1;
|
|
575
|
+
}
|
|
576
|
+
this.addChildItem(event.item);
|
|
577
|
+
if (this.selects === "inherit") {
|
|
361
578
|
this.resolvedSelects = "inherit";
|
|
362
|
-
const
|
|
363
|
-
this.resolvedRole =
|
|
364
|
-
} else
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
this.
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
579
|
+
const ignoreMenu = (_a = event.currentAncestorWithSelects) == null ? void 0 : _a.ignore;
|
|
580
|
+
this.resolvedRole = ignoreMenu ? "none" : ((_b = event.currentAncestorWithSelects) == null ? void 0 : _b.getAttribute("role")) || this.getAttribute("role") || void 0;
|
|
581
|
+
} else if (this.selects) {
|
|
582
|
+
this.resolvedRole = this.ignore ? "none" : this.getAttribute("role") || void 0;
|
|
583
|
+
this.resolvedSelects = this.selects;
|
|
584
|
+
} else {
|
|
585
|
+
this.resolvedRole = this.ignore ? "none" : this.getAttribute("role") || void 0;
|
|
586
|
+
this.resolvedSelects = this.resolvedRole === "none" ? "ignore" : "none";
|
|
587
|
+
}
|
|
588
|
+
const selects = this.resolvedSelects === "single" || this.resolvedSelects === "multiple";
|
|
589
|
+
event.item.menuData.cleanupSteps.push(
|
|
590
|
+
(item) => this.removeChildItem(item)
|
|
591
|
+
);
|
|
592
|
+
if ((selects || !this.selects && this.resolvedSelects !== "ignore") && !event.item.menuData.selectionRoot) {
|
|
593
|
+
event.item.setRole(this.childRole);
|
|
594
|
+
event.item.menuData.selectionRoot = event.item.menuData.selectionRoot || this;
|
|
595
|
+
if (event.item.selected) {
|
|
596
|
+
this.selectedItemsMap.set(event.item, true);
|
|
597
|
+
this.selectedItems = [...this.selectedItems, event.item];
|
|
598
|
+
this._selected = [...this.selected, event.item.value];
|
|
599
|
+
this.value = this.selected.join(this.valueSeparator);
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
addChildItem(item) {
|
|
604
|
+
this.childItemSet.add(item);
|
|
605
|
+
this.handleItemsChanged();
|
|
606
|
+
}
|
|
607
|
+
async removeChildItem(item) {
|
|
608
|
+
this.childItemSet.delete(item);
|
|
609
|
+
this.cachedChildItems = void 0;
|
|
610
|
+
if (item.focused) {
|
|
611
|
+
this.handleItemsChanged();
|
|
612
|
+
await this.updateComplete;
|
|
613
|
+
this.focus();
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
handleClick(event) {
|
|
617
|
+
if (this.pointerUpTarget === event.target) {
|
|
378
618
|
this.pointerUpTarget = null;
|
|
379
619
|
return;
|
|
380
620
|
}
|
|
381
|
-
this.handlePointerBasedSelection(
|
|
621
|
+
this.handlePointerBasedSelection(event);
|
|
382
622
|
}
|
|
383
|
-
handlePointerup(
|
|
384
|
-
this.pointerUpTarget =
|
|
623
|
+
handlePointerup(event) {
|
|
624
|
+
this.pointerUpTarget = event.target;
|
|
625
|
+
this.handlePointerBasedSelection(event);
|
|
385
626
|
}
|
|
386
|
-
handlePointerBasedSelection(
|
|
387
|
-
var
|
|
388
|
-
if (
|
|
627
|
+
handlePointerBasedSelection(event) {
|
|
628
|
+
var _a, _b;
|
|
629
|
+
if (event instanceof MouseEvent && event.button !== 0) {
|
|
389
630
|
return;
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
((
|
|
631
|
+
}
|
|
632
|
+
const path = event.composedPath();
|
|
633
|
+
const target = path.find((el) => {
|
|
634
|
+
if (!(el instanceof Element)) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
return el.getAttribute("role") === this.childRole;
|
|
638
|
+
});
|
|
639
|
+
if (event.defaultPrevented) {
|
|
640
|
+
const index = this.childItems.indexOf(target);
|
|
641
|
+
if (((_a = target == null ? void 0 : target.menuData) == null ? void 0 : _a.focusRoot) === this && index !== -1) {
|
|
642
|
+
this.focusedItemIndex = index;
|
|
643
|
+
}
|
|
394
644
|
return;
|
|
395
645
|
}
|
|
396
|
-
if (
|
|
646
|
+
if ((target == null ? void 0 : target.href) && target.href.length > 0) {
|
|
397
647
|
this.dispatchEvent(
|
|
398
648
|
new Event("change", {
|
|
399
|
-
bubbles:
|
|
400
|
-
composed:
|
|
649
|
+
bubbles: true,
|
|
650
|
+
composed: true
|
|
401
651
|
})
|
|
402
652
|
);
|
|
403
653
|
return;
|
|
404
|
-
} else if (((
|
|
405
|
-
|
|
654
|
+
} else if (((_b = target == null ? void 0 : target.menuData) == null ? void 0 : _b.selectionRoot) === this && this.childItems.length > 0) {
|
|
655
|
+
event.preventDefault();
|
|
656
|
+
if (target.hasSubmenu || target.open) {
|
|
406
657
|
return;
|
|
407
|
-
|
|
408
|
-
|
|
658
|
+
}
|
|
659
|
+
this.selectOrToggleItem(target);
|
|
660
|
+
} else {
|
|
409
661
|
return;
|
|
662
|
+
}
|
|
410
663
|
this.prepareToCleanUp();
|
|
411
664
|
}
|
|
412
665
|
prepareToCleanUp() {
|
|
@@ -414,101 +667,133 @@ class m extends I(w, {
|
|
|
414
667
|
"focusout",
|
|
415
668
|
() => {
|
|
416
669
|
requestAnimationFrame(() => {
|
|
417
|
-
const
|
|
418
|
-
|
|
670
|
+
const focusedItem = this.childItems[this.focusedItemIndex];
|
|
671
|
+
if (focusedItem) {
|
|
672
|
+
focusedItem.focused = false;
|
|
673
|
+
this.updateSelectedItemIndex();
|
|
674
|
+
}
|
|
419
675
|
});
|
|
420
676
|
},
|
|
421
|
-
{ once:
|
|
677
|
+
{ once: true }
|
|
422
678
|
);
|
|
423
679
|
}
|
|
424
680
|
handleItemsChanged() {
|
|
425
|
-
this.cachedChildItems = void 0
|
|
681
|
+
this.cachedChildItems = void 0;
|
|
682
|
+
if (!this._willUpdateItems) {
|
|
683
|
+
this._willUpdateItems = true;
|
|
684
|
+
this.cacheUpdated = this.updateCache();
|
|
685
|
+
}
|
|
426
686
|
}
|
|
427
687
|
async updateCache() {
|
|
428
|
-
await (this.hasUpdated ? new Promise((
|
|
429
|
-
new Promise((
|
|
688
|
+
await (this.hasUpdated ? new Promise((res) => requestAnimationFrame(() => res(true))) : Promise.all([
|
|
689
|
+
new Promise((res) => requestAnimationFrame(() => res(true))),
|
|
430
690
|
this.updateComplete
|
|
431
|
-
]))
|
|
691
|
+
]));
|
|
692
|
+
if (this.cachedChildItems === void 0) {
|
|
693
|
+
this.updateSelectedItemIndex();
|
|
694
|
+
this.updateItemFocus();
|
|
695
|
+
}
|
|
696
|
+
this._willUpdateItems = false;
|
|
432
697
|
}
|
|
433
698
|
updateItemFocus() {
|
|
434
|
-
if (this.childItems.length === 0)
|
|
699
|
+
if (this.childItems.length === 0) {
|
|
435
700
|
return;
|
|
436
|
-
|
|
437
|
-
|
|
701
|
+
}
|
|
702
|
+
const focusInItem = this.childItems[this.focusInItemIndex];
|
|
703
|
+
if (this.getRootNode().activeElement === focusInItem.menuData.focusRoot) {
|
|
704
|
+
this.forwardFocusVisibleToItem(focusInItem);
|
|
705
|
+
}
|
|
438
706
|
}
|
|
439
|
-
forwardFocusVisibleToItem(
|
|
440
|
-
if (!
|
|
707
|
+
forwardFocusVisibleToItem(item) {
|
|
708
|
+
if (!item || item.menuData.focusRoot !== this) {
|
|
441
709
|
return;
|
|
710
|
+
}
|
|
442
711
|
this.closeDescendentOverlays();
|
|
443
|
-
const
|
|
444
|
-
|
|
712
|
+
const focused = this.hasVisibleFocusInTree() || !!this.childItems.some((child) => child.hasVisibleFocusInTree());
|
|
713
|
+
item.focused = focused;
|
|
714
|
+
this.setAttribute("aria-activedescendant", item.id);
|
|
715
|
+
if (item.menuData.selectionRoot && item.menuData.selectionRoot !== this) {
|
|
716
|
+
item.menuData.selectionRoot.focus();
|
|
717
|
+
}
|
|
445
718
|
}
|
|
446
719
|
handleSlotchange({
|
|
447
|
-
target
|
|
720
|
+
target
|
|
448
721
|
}) {
|
|
449
|
-
const
|
|
450
|
-
flatten:
|
|
722
|
+
const assignedElements = target.assignedElements({
|
|
723
|
+
flatten: true
|
|
451
724
|
});
|
|
452
|
-
this.childItems.length !==
|
|
453
|
-
|
|
454
|
-
|
|
725
|
+
if (this.childItems.length !== assignedElements.length) {
|
|
726
|
+
assignedElements.forEach((item) => {
|
|
727
|
+
if (item.triggerUpdate !== void 0) {
|
|
728
|
+
item.triggerUpdate();
|
|
729
|
+
} else if (item.childItems !== void 0) {
|
|
730
|
+
item.childItems.forEach((child) => {
|
|
731
|
+
child.triggerUpdate();
|
|
732
|
+
});
|
|
733
|
+
}
|
|
455
734
|
});
|
|
456
|
-
}
|
|
735
|
+
}
|
|
457
736
|
}
|
|
458
737
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
],
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
],
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
],
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
],
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
],
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
],
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
],
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
],
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
],
|
|
486
|
-
const
|
|
487
|
-
class
|
|
738
|
+
__decorateClass$2([
|
|
739
|
+
property({ type: String, reflect: true })
|
|
740
|
+
], LuzmoMenu.prototype, "label", 2);
|
|
741
|
+
__decorateClass$2([
|
|
742
|
+
property({ type: Boolean, reflect: true })
|
|
743
|
+
], LuzmoMenu.prototype, "ignore", 2);
|
|
744
|
+
__decorateClass$2([
|
|
745
|
+
property({ type: String, reflect: true })
|
|
746
|
+
], LuzmoMenu.prototype, "variant", 2);
|
|
747
|
+
__decorateClass$2([
|
|
748
|
+
property({ type: String, reflect: true })
|
|
749
|
+
], LuzmoMenu.prototype, "selects", 2);
|
|
750
|
+
__decorateClass$2([
|
|
751
|
+
property({ type: String })
|
|
752
|
+
], LuzmoMenu.prototype, "value", 2);
|
|
753
|
+
__decorateClass$2([
|
|
754
|
+
property({ type: String, attribute: "value-separator" })
|
|
755
|
+
], LuzmoMenu.prototype, "valueSeparator", 2);
|
|
756
|
+
__decorateClass$2([
|
|
757
|
+
property({ attribute: false })
|
|
758
|
+
], LuzmoMenu.prototype, "selected", 1);
|
|
759
|
+
__decorateClass$2([
|
|
760
|
+
property({ attribute: false })
|
|
761
|
+
], LuzmoMenu.prototype, "selectedItems", 2);
|
|
762
|
+
__decorateClass$2([
|
|
763
|
+
query("slot:not([name])")
|
|
764
|
+
], LuzmoMenu.prototype, "menuSlot", 2);
|
|
765
|
+
const menuDividerStyles = ":host{--menu-divider-thickness: var( --divider-thickness-medium, var(--luzmo-border-width) );inline-size:auto;margin-block:var(--luzmo-menu-section-divider-margin-block, max(0px, (var(--menu-item-section-divider-height) - var(--menu-divider-thickness)) / 2));margin-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));overflow:visible}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{display:block;flex-shrink:0}";
|
|
766
|
+
class LuzmoMenuDivider extends SizedMixin(LuzmoElement, {
|
|
488
767
|
validSizes: ["s", "m", "l"]
|
|
489
768
|
}) {
|
|
490
769
|
static get styles() {
|
|
491
|
-
return [
|
|
770
|
+
return [unsafeCSS(dividerStyles), unsafeCSS(menuDividerStyles)];
|
|
492
771
|
}
|
|
493
|
-
firstUpdated(
|
|
494
|
-
super.firstUpdated(
|
|
772
|
+
firstUpdated(changed) {
|
|
773
|
+
super.firstUpdated(changed);
|
|
774
|
+
this.setAttribute("role", "separator");
|
|
495
775
|
}
|
|
496
776
|
}
|
|
497
|
-
const
|
|
498
|
-
var
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
777
|
+
const menuGroupStyles = ".luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.header{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-section-header-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));min-inline-size:var(--luzmo-menu-section-header-min-width, var(--menu-section-header-min-width));padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-area:sectionHeadingArea/1/sectionHeadingArea/-1;display:block}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-back .header{padding:0}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{margin:0;display:inline-flex;overflow:visible;flex-direction:column}[hidden]{display:none!important}";
|
|
778
|
+
var __defProp$1 = Object.defineProperty;
|
|
779
|
+
var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
780
|
+
var result = void 0;
|
|
781
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
782
|
+
if (decorator = decorators[i])
|
|
783
|
+
result = decorator(target, key, result) || result;
|
|
784
|
+
if (result) __defProp$1(target, key, result);
|
|
785
|
+
return result;
|
|
502
786
|
};
|
|
503
|
-
class
|
|
787
|
+
class LuzmoMenuGroup extends LuzmoMenu {
|
|
504
788
|
constructor() {
|
|
505
|
-
super(...arguments)
|
|
789
|
+
super(...arguments);
|
|
790
|
+
this.headerId = "";
|
|
506
791
|
}
|
|
507
792
|
static get styles() {
|
|
508
|
-
return [...super.styles,
|
|
793
|
+
return [...super.styles, unsafeCSS(menuGroupStyles)];
|
|
509
794
|
}
|
|
510
795
|
render() {
|
|
511
|
-
return
|
|
796
|
+
return html`
|
|
512
797
|
<span class="header" ?hidden=${!this.headerElement}>
|
|
513
798
|
<slot name="header" @slotchange=${this.updateLabel}></slot>
|
|
514
799
|
</span>
|
|
@@ -525,127 +810,193 @@ class k extends m {
|
|
|
525
810
|
switch (this.selects) {
|
|
526
811
|
case "multiple":
|
|
527
812
|
case "single":
|
|
528
|
-
case "inherit":
|
|
813
|
+
case "inherit": {
|
|
529
814
|
return "group";
|
|
530
|
-
|
|
815
|
+
}
|
|
816
|
+
default: {
|
|
531
817
|
return "menu";
|
|
818
|
+
}
|
|
532
819
|
}
|
|
533
820
|
}
|
|
534
821
|
updateLabel() {
|
|
535
|
-
const
|
|
536
|
-
if (
|
|
537
|
-
if (this.headerElement && this.headerElement.id === this.headerId
|
|
538
|
-
this.
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
822
|
+
const headerElement = this.headerElements.length > 0 ? this.headerElements[0] : void 0;
|
|
823
|
+
if (headerElement !== this.headerElement) {
|
|
824
|
+
if (this.headerElement && this.headerElement.id === this.headerId) {
|
|
825
|
+
this.headerElement.removeAttribute("id");
|
|
826
|
+
}
|
|
827
|
+
if (headerElement) {
|
|
828
|
+
this.headerId = this.headerId || `luzmo-menu-group-label-${randomID()}`;
|
|
829
|
+
const headerId = headerElement.id || this.headerId;
|
|
830
|
+
if (!headerElement.id) {
|
|
831
|
+
headerElement.id = headerId;
|
|
832
|
+
}
|
|
833
|
+
this.setAttribute("aria-labelledby", headerId);
|
|
834
|
+
} else {
|
|
542
835
|
this.removeAttribute("aria-labelledby");
|
|
543
|
-
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
this.headerElement = headerElement;
|
|
544
839
|
}
|
|
545
840
|
}
|
|
546
|
-
|
|
547
|
-
|
|
841
|
+
__decorateClass$1([
|
|
842
|
+
queryAssignedNodes({
|
|
548
843
|
slot: "header",
|
|
549
|
-
flatten:
|
|
844
|
+
flatten: true
|
|
550
845
|
})
|
|
551
|
-
],
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
],
|
|
555
|
-
const G = '.checkmark{display:var(--luzmo-menu-checkmark-display, var(--menu-checkmark-display));font-size:var(--luzmo-menu-item-checkmark-size, var(--menu-item-checkmark-size));fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));opacity:1;grid-area:checkmarkArea;align-self:start;margin-block-start:calc(var(--luzmo-menu-item-top-to-checkmark, var(--menu-item-top-to-checkmark)) - var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.angle{font-size:var(--menu-item-angle-size);grid-area:angleArea;align-self:center;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));grid-area:iconArea;align-self:start}::slotted([slot=icon]){margin-inline-end:var(--luzmo-menu-item-label-text-to-visual, var(--menu-item-label-text-to-visual));margin-block-start:var(--luzmo-menu-item-top-to-icon, var(--menu-item-top-to-icon));block-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));inline-size:var(--luzmo-menu-item-icon-width, var(--menu-item-icon-height));font-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)));line-height:var(--luzmo-menu-item-label-line-height, var(--menu-item-label-line-height));min-block-size:var(--luzmo-menu-item-min-height, var(--menu-item-min-height));padding-block-start:var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text));padding-block-end:var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-template:". angleAreaCollapsible . headingIconArea sectionHeadingArea . . ." "selectedArea angleAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea angleAreaDrillIn" 1fr ". . . . descriptionArea . . ." ". . . . submenuArea . . ." ". . . . . . . ."/auto auto auto auto 1fr auto auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;align-items:center;position:relative}.luzmo-Menu-itemCheckbox{--luzmo-checkbox-top-to-text: 0;--luzmo-checkbox-text-to-control: 0;min-block-size:0}.luzmo-Menu-itemCheckbox .luzmo-Checkbox-box{margin-block-start:var(--luzmo-menu-item-top-to-checkbox, var(--menu-item-top-to-checkbox));margin-block-end:0;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-itemSwitch{min-block-size:0}.luzmo-Menu-itemSwitch .luzmo-Switch-switch{margin-block-start:var(--luzmo-menu-item-top-to-action, var(--menu-item-top-to-action));margin-block-end:0}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]),:host(:focus){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-key-focus, var(--menu-item-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label,:host([focused])>.menu-item-tooltip-icon,:host(:focus)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-focus, var(--menu-item-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-focus, var(--menu-item-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-focus, var(--menu-item-value-color-focus)))}:host([focused])>.icon:not(.angle,.checkmark),:host(:focus)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)))}:host([focused])>.angle,:host(:focus)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--menu-item-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-down, var(--menu-item-background-color-down)))}:host(:is(:active,[active]))>#label,:host(:is(:active,[active]))>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-down, var(--menu-item-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-down, var(--menu-item-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-down, var(--menu-item-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)))}:host(:is(:active,[active]))>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) .menu-item-tooltip-icon,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}:host([focused]) .luzmo-Menu-back,:host([focused]){box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .luzmo-Menu-itemCheckbox{grid-area:checkmarkArea}.luzmo-Menu-itemSelection{grid-area:selectedArea}#label{--luzmo-switch-control-label-spacing: 0;--luzmo-switch-spacing-top-to-label: 0;font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-content-color-default, var(--menu-item-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)))}:host([selected]) #label{color:var(--menu-item-highlight-label-content-color)}:host([selected]) .menu-item-tooltip-icon{color:var(--menu-item-highlight-label-content-color)}::slotted([slot=value]){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-value-color-default, var(--menu-item-value-color-default)));font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));grid-area:valueArea;justify-self:end}.luzmo-Menu-itemActions,::slotted([slot=value]){align-self:start;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing))}.luzmo-Menu-itemActions{grid-area:actionsArea}[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-description-color-default, var(--menu-item-description-color-default)));font-size:var(--luzmo-menu-item-description-font-size, var(--menu-item-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-menu-item-description-line-height, var(--menu-item-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-menu-item-label-to-description-spacing, var(--menu-item-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.luzmo-Menu-item--collapsible.is-open{padding-block-end:0}.luzmo-Menu-item--collapsible.is-open .angle{transform:rotate(90deg)}:host([focused]) .luzmo-Menu-item--collapsible.is-open,:host(:is(:active,[active])) .luzmo-Menu-item--collapsible.is-open,.luzmo-Menu-item--collapsible.is-open:focus{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}.luzmo-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}.luzmo-Menu-item--collapsible>::slotted([slot=icon]){padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)))}.luzmo-Menu-item--collapsible .angle{grid-area:angleAreaCollapsible}:host([has-submenu]) .angle{fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));grid-area:angleAreaDrillIn;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing));margin-inline-end:0}:host([has-submenu]) .is-open{--menu-item-background-color-default: var( --highcontrast-menu-item-selected-background-color, var( --luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover) ) )}:host([has-submenu]) .is-open .icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host([has-submenu]) .is-open .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}:host([has-submenu]) .is-open .checkmark{fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)))}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover)))}:host(:hover)>#label,:host(:hover)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-hover, var(--menu-item-label-content-color-hover)))}:host([selected]:hover)>#label,:host([selected]:hover)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-highlight-label-content-color, var(--menu-item-highlight-label-content-color)))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-hover, var(--menu-item-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-hover, var(--menu-item-value-color-hover)))}:host(:hover)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host(:hover)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:hover)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) .menu-item-tooltip-icon,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}.luzmo-Menu-item--collapsible.is-open:hover{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}:host([has-submenu]:hover) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}}:host([has-submenu][focused]) .angle,:host([has-submenu]:focus) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)))}:host([has-submenu]:is(:active,[active])) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)))}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}:host([focused]) .luzmo-Menu-backButton{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{text-align:initial;font-family:var(--luzmo-menu-item-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-menu-item-label-icon-color-disabled, var(--luzmo-disabled-color))}:host([has-submenu][disabled]) .angle{color:var(--luzmo-menu-item-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}}::slotted([slot=submenu]){width:max-content;max-width:100%}:host([no-wrap]) #label{display:block}.menu-item-tooltip-container{grid-area:actionsArea;align-self:center;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing));display:flex;align-items:center;justify-content:center}.menu-item-tooltip-container luzmo-tooltip{--tooltip-font-size: var( --luzmo-menu-item-tooltip-font-size, var(--tooltip-font-size) )}.menu-item-tooltip-icon-trigger{cursor:default;display:flex;align-items:center;justify-content:center}.menu-item-tooltip-icon{font-size:.875rem;width:.875rem;height:.875rem}';
|
|
556
|
-
var
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
846
|
+
], LuzmoMenuGroup.prototype, "headerElements");
|
|
847
|
+
__decorateClass$1([
|
|
848
|
+
state()
|
|
849
|
+
], LuzmoMenuGroup.prototype, "headerElement");
|
|
850
|
+
const menuItemStyles = '.checkmark{display:var(--luzmo-menu-checkmark-display, var(--menu-checkmark-display));font-size:var(--luzmo-menu-item-checkmark-size, var(--menu-item-checkmark-size));fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-default, var(--menu-checkmark-icon-color-default)));opacity:1;grid-area:checkmarkArea;align-self:start;margin-block-start:calc(var(--luzmo-menu-item-top-to-checkmark, var(--menu-item-top-to-checkmark)) - var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.angle{font-size:var(--menu-item-angle-size);grid-area:angleArea;align-self:center;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-back:focus-visible{box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}.luzmo-Menu-backButton:focus-visible{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}::slotted([slot=icon]){fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)));grid-area:iconArea;align-self:start}::slotted([slot=icon]){margin-inline-end:var(--luzmo-menu-item-label-text-to-visual, var(--menu-item-label-text-to-visual));margin-block-start:var(--luzmo-menu-item-top-to-icon, var(--menu-item-top-to-icon));block-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));inline-size:var(--luzmo-menu-item-icon-width, var(--menu-item-icon-height));font-size:var(--luzmo-menu-item-icon-size, var(--menu-item-icon-height));text-align:center;--luzmo-icon-vertical-align: 0}:host{cursor:pointer;box-sizing:border-box;background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)));line-height:var(--luzmo-menu-item-label-line-height, var(--menu-item-label-line-height));min-block-size:var(--luzmo-menu-item-min-height, var(--menu-item-min-height));padding-block-start:var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text));padding-block-end:var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text));padding-inline:var(--luzmo-menu-item-label-inline-edge-to-content, var(--menu-item-label-inline-edge-to-content));grid-template:". angleAreaCollapsible . headingIconArea sectionHeadingArea . . ." "selectedArea angleAreaCollapsible checkmarkArea iconArea labelArea valueArea actionsArea angleAreaDrillIn" 1fr ". . . . descriptionArea . . ." ". . . . submenuArea . . ." ". . . . . . . ."/auto auto auto auto 1fr auto auto auto;justify-content:start;margin:0;-webkit-text-decoration:none;text-decoration:none;display:grid;align-items:center;position:relative}.luzmo-Menu-itemCheckbox{--luzmo-checkbox-top-to-text: 0;--luzmo-checkbox-text-to-control: 0;min-block-size:0}.luzmo-Menu-itemCheckbox .luzmo-Checkbox-box{margin-block-start:var(--luzmo-menu-item-top-to-checkbox, var(--menu-item-top-to-checkbox));margin-block-end:0;margin-inline-end:var(--luzmo-menu-item-text-to-control, var(--menu-item-text-to-control))}.luzmo-Menu-itemSwitch{min-block-size:0}.luzmo-Menu-itemSwitch .luzmo-Switch-switch{margin-block-start:var(--luzmo-menu-item-top-to-action, var(--menu-item-top-to-action));margin-block-end:0}#label{grid-area:submenuItemLabelArea}::slotted([slot=value]){grid-area:submenuItemValueArea}:host([focused]),:host(:focus){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-key-focus, var(--menu-item-background-color-key-focus)));outline:none}:host([focused])>#label,:host(:focus)>#label,:host([focused])>.menu-item-tooltip-icon,:host(:focus)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-focus, var(--menu-item-label-content-color-focus)))}:host([focused])>[name=description]::slotted(*),:host(:focus)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-focus, var(--menu-item-description-color-focus)))}:host([focused])>::slotted([slot=value]),:host(:focus)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-focus, var(--menu-item-value-color-focus)))}:host([focused])>.icon:not(.angle,.checkmark),:host(:focus)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-focus, var(--menu-item-label-icon-color-focus)))}:host([focused])>.angle,:host(:focus)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host([focused])>.checkmark,:host(:focus)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-focus, var(--menu-checkmark-icon-color-focus)))}:host:dir(rtl),:host([dir=rtl]){--menu-item-focus-indicator-direction-scalar: -1}:host(:is(:active,[active])){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-down, var(--menu-item-background-color-down)))}:host(:is(:active,[active]))>#label,:host(:is(:active,[active]))>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-down, var(--menu-item-label-content-color-down)))}:host(:is(:active,[active]))>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-down, var(--menu-item-description-color-down)))}:host(:is(:active,[active]))>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-down, var(--menu-item-value-color-down)))}:host(:is(:active,[active]))>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-down, var(--menu-item-label-icon-color-down)))}:host(:is(:active,[active]))>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:is(:active,[active]))>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-down, var(--menu-checkmark-icon-color-down)))}:host([disabled]),:host([aria-disabled=true]){background-color:initial}:host([disabled]) #label,:host([disabled]) .menu-item-tooltip-icon,:host([disabled]) ::slotted([slot=value]),:host([aria-disabled=true]) #label,:host([aria-disabled=true]) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]) [name=description]::slotted(*),:host([aria-disabled=true]) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]) ::slotted([slot=icon]),:host([aria-disabled=true]) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}:host([focused]) .luzmo-Menu-back,:host([focused]){box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * 1) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)));box-shadow:inset calc(var(--luzmo-menu-item-focus-indicator-width, var(--menu-item-focus-indicator-width)) * var(--menu-item-focus-indicator-direction-scalar, 1)) 0 0 0 var(--highcontrast-menu-item-focus-indicator-color, var(--luzmo-menu-item-focus-indicator-color, var(--menu-item-focus-indicator-color)))}:host .is-selectableMultiple{align-items:start}.is-selectableMultiple .luzmo-Menu-itemCheckbox{grid-area:checkmarkArea}.luzmo-Menu-itemSelection{grid-area:selectedArea}#label{--luzmo-switch-control-label-spacing: 0;--luzmo-switch-spacing-top-to-label: 0;font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-content-color-default, var(--menu-item-label-content-color-default)));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;grid-area:labelArea}.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-label-icon-color-default, var(--menu-item-label-icon-color-default)))}:host([selected]) #label{color:var(--menu-item-highlight-label-content-color)}:host([selected]) .menu-item-tooltip-icon{color:var(--menu-item-highlight-label-content-color)}::slotted([slot=value]){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-value-color-default, var(--menu-item-value-color-default)));font-size:var(--luzmo-menu-item-label-font-size, var(--menu-item-label-font-size));grid-area:valueArea;justify-self:end}.luzmo-Menu-itemActions,::slotted([slot=value]){align-self:start;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing))}.luzmo-Menu-itemActions{grid-area:actionsArea}[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-item-description-color-default, var(--menu-item-description-color-default)));font-size:var(--luzmo-menu-item-description-font-size, var(--menu-item-description-font-size));-webkit-hyphens:auto;hyphens:auto;overflow-wrap:break-word;line-height:var(--luzmo-menu-item-description-line-height, var(--menu-item-description-line-height));grid-area:descriptionArea;margin-block-start:var(--luzmo-menu-item-label-to-description-spacing, var(--menu-item-label-to-description-spacing))}:host([no-wrap]) #label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.luzmo-Menu-item--collapsible.is-open{padding-block-end:0}.luzmo-Menu-item--collapsible.is-open .angle{transform:rotate(90deg)}:host([focused]) .luzmo-Menu-item--collapsible.is-open,:host(:is(:active,[active])) .luzmo-Menu-item--collapsible.is-open,.luzmo-Menu-item--collapsible.is-open:focus{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}.luzmo-Menu-item--collapsible ::slotted([slot=icon]){grid-area:headingIconArea}.luzmo-Menu-item--collapsible>::slotted([slot=icon]){padding-block-start:var(--luzmo-menu-section-header-top-edge-to-text, var(--luzmo-menu-item-top-edge-to-text, var(--menu-item-top-edge-to-text)));padding-block-end:var(--luzmo-menu-section-header-bottom-edge-to-text, var(--luzmo-menu-item-bottom-edge-to-text, var(--menu-item-bottom-edge-to-text)))}.luzmo-Menu-item--collapsible .angle{grid-area:angleAreaCollapsible}:host([has-submenu]) .angle{fill:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-drillin-icon-color-default, var(--menu-drillin-icon-color-default)));grid-area:angleAreaDrillIn;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing));margin-inline-end:0}:host([has-submenu]) .is-open{--menu-item-background-color-default: var( --highcontrast-menu-item-selected-background-color, var( --luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover) ) )}:host([has-submenu]) .is-open .icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host([has-submenu]) .is-open .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}:host([has-submenu]) .is-open .checkmark{fill:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-checkmark-icon-color-default, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)))}@media (hover: hover){:host(:hover){background-color:var(--highcontrast-menu-item-background-color-focus, var(--luzmo-menu-item-background-color-hover, var(--menu-item-background-color-hover)))}:host(:hover)>#label,:host(:hover)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-content-color-hover, var(--menu-item-label-content-color-hover)))}:host([selected]:hover)>#label,:host([selected]:hover)>.menu-item-tooltip-icon{color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-highlight-label-content-color, var(--menu-item-highlight-label-content-color)))}:host(:hover)>[name=description]::slotted(*){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-description-color-hover, var(--menu-item-description-color-hover)))}:host(:hover)>::slotted([slot=value]){color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-value-color-hover, var(--menu-item-value-color-hover)))}:host(:hover)>.icon:not(.angle,.checkmark){fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-item-label-icon-color-hover, var(--menu-item-label-icon-color-hover)))}:host(:hover)>.angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-collapsible-icon-color, var(--menu-collapsible-icon-color)))}:host(:hover)>.checkmark{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-checkmark-icon-color-hover, var(--menu-checkmark-icon-color-hover)))}:host([disabled]:hover),:host([aria-disabled=true]:hover){cursor:default;background-color:initial}:host([disabled]:hover) #label,:host([disabled]:hover) .menu-item-tooltip-icon,:host([disabled]:hover) ::slotted([slot=value]),:host([aria-disabled=true]:hover) #label,:host([aria-disabled=true]:hover) ::slotted([slot=value]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-content-color-disabled, var(--menu-item-label-content-color-disabled)))}:host([disabled]:hover) [name=description]::slotted(*),:host([aria-disabled=true]:hover) [name=description]::slotted(*){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-description-color-disabled, var(--menu-item-description-color-disabled)))}:host([disabled]:hover) ::slotted([slot=icon]),:host([aria-disabled=true]:hover) ::slotted([slot=icon]){color:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)));fill:var(--highcontrast-menu-item-color-disabled, var(--luzmo-menu-item-label-icon-color-disabled, var(--menu-item-label-icon-color-disabled)))}.luzmo-Menu-item--collapsible.is-open:hover{background-color:var(--highcontrast-menu-item-background-color-default, var(--luzmo-menu-item-background-color-default, var(--menu-item-background-color-default)))}:host([has-submenu]:hover) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-hover, var(--menu-drillin-icon-color-hover)))}}:host([has-submenu][focused]) .angle,:host([has-submenu]:focus) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-focus, var(--menu-drillin-icon-color-focus)))}:host([has-submenu]:is(:active,[active])) .angle{fill:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)));color:var(--highcontrast-menu-item-color-focus, var(--luzmo-menu-drillin-icon-color-down, var(--menu-drillin-icon-color-down)))}.luzmo-Menu-back{padding-inline:0 var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-inline:var(--luzmo-menu-back-padding-inline-start, 0) var(--luzmo-menu-back-padding-inline-end, var(--menu-item-label-inline-edge-to-content));padding-block:0;padding-block:var(--luzmo-menu-back-padding-block-start, 0) var(--luzmo-menu-back-padding-block-end, 0);flex-flow:wrap;align-items:center;display:flex}.luzmo-Menu-backButton{cursor:pointer;background:none;border:0;margin:0;padding:0;display:inline-flex}:host([focused]) .luzmo-Menu-backButton{outline:var(--focus-indicator-width) solid var(--focus-indicator-color);outline-offset:calc((var(--focus-indicator-width) + 1px) * -1)}.luzmo-Menu-backHeading{color:var(--highcontrast-menu-item-color-default, var(--luzmo-menu-back-heading-color, var(--menu-section-header-color)));font-size:var(--luzmo-menu-section-header-font-size, var(--menu-section-header-font-size));font-weight:var(--luzmo-menu-section-header-font-weight, var(--menu-section-header-font-weight));line-height:var(--luzmo-menu-section-header-line-height, var(--menu-section-header-line-height));display:block}:host{text-align:initial;font-family:var(--luzmo-menu-item-font-family, var(--luzmo-font-family))}:host([hidden]){display:none}:host([disabled]){pointer-events:none}:host([disabled]) [name=value]::slotted(*){color:var(--luzmo-menu-item-label-icon-color-disabled, var(--luzmo-disabled-color))}:host([has-submenu][disabled]) .angle{color:var(--luzmo-menu-item-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}}::slotted([slot=submenu]){width:max-content;max-width:100%}:host([no-wrap]) #label{display:block}.menu-item-tooltip-container{grid-area:actionsArea;align-self:center;margin-inline-start:var(--luzmo-menu-item-label-to-value-area-min-spacing, var(--menu-item-label-to-value-area-min-spacing));display:flex;align-items:center;justify-content:center}.menu-item-tooltip-container luzmo-tooltip{--tooltip-font-size: var( --luzmo-menu-item-tooltip-font-size, var(--tooltip-font-size) )}.menu-item-tooltip-icon-trigger{cursor:default;display:flex;align-items:center;justify-content:center}.menu-item-tooltip-icon{font-size:.875rem;width:.875rem;height:.875rem}';
|
|
851
|
+
var __defProp = Object.defineProperty;
|
|
852
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
853
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
854
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
855
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
856
|
+
if (decorator = decorators[i])
|
|
857
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
858
|
+
if (kind && result) __defProp(target, key, result);
|
|
859
|
+
return result;
|
|
560
860
|
};
|
|
561
|
-
const
|
|
562
|
-
|
|
563
|
-
|
|
861
|
+
const POINTERLEAVE_TIMEOUT = 100;
|
|
862
|
+
const checkIcon = (classes) => html`
|
|
863
|
+
<span class="icon-container icon checkmark ${classes.join(" ")}">
|
|
864
|
+
${luzmoIcon(luzmoCheck)}
|
|
564
865
|
</span>
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
866
|
+
`;
|
|
867
|
+
const angleIcon = (classes) => html`
|
|
868
|
+
<span class="icon-container icon angle ${classes.join(" ")}">
|
|
869
|
+
${luzmoIcon(luzmoAngleRight, { className: "indicator" })}
|
|
568
870
|
</span>
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
871
|
+
`;
|
|
872
|
+
const infoIcon = (classes) => html`
|
|
873
|
+
<span class="icon-container icon info ${classes.join(" ")}">
|
|
874
|
+
${luzmoIcon(luzmoInfoCircleOutline)}
|
|
572
875
|
</span>
|
|
573
876
|
`;
|
|
574
|
-
class
|
|
575
|
-
constructor(
|
|
877
|
+
class MenuItemAddedOrUpdatedEvent extends Event {
|
|
878
|
+
constructor(item) {
|
|
576
879
|
super("luzmo-menu-item-added-or-updated", {
|
|
577
|
-
bubbles:
|
|
578
|
-
composed:
|
|
579
|
-
})
|
|
880
|
+
bubbles: true,
|
|
881
|
+
composed: true
|
|
882
|
+
});
|
|
883
|
+
this.menuCascade = /* @__PURE__ */ new WeakMap();
|
|
884
|
+
this.clear(item);
|
|
580
885
|
}
|
|
581
886
|
get item() {
|
|
582
887
|
return this._item;
|
|
583
888
|
}
|
|
584
|
-
clear(
|
|
585
|
-
this._item =
|
|
889
|
+
clear(item) {
|
|
890
|
+
this._item = item;
|
|
891
|
+
this.currentAncestorWithSelects = void 0;
|
|
892
|
+
item.menuData = {
|
|
586
893
|
cleanupSteps: [],
|
|
587
894
|
focusRoot: void 0,
|
|
588
895
|
selectionRoot: void 0,
|
|
589
896
|
parentMenu: void 0
|
|
590
|
-
}
|
|
897
|
+
};
|
|
898
|
+
this.menuCascade = /* @__PURE__ */ new WeakMap();
|
|
591
899
|
}
|
|
592
900
|
}
|
|
593
|
-
class
|
|
594
|
-
|
|
901
|
+
class LuzmoMenuItem extends LikeAnchor(
|
|
902
|
+
ObserveSlotText(ObserveSlotPresence(Focusable, '[slot="icon"]'))
|
|
595
903
|
) {
|
|
596
904
|
constructor() {
|
|
597
|
-
super()
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
905
|
+
super();
|
|
906
|
+
this.active = false;
|
|
907
|
+
this.dependencyManager = new DependencyManagerController(this);
|
|
908
|
+
this.focused = false;
|
|
909
|
+
this.selected = false;
|
|
910
|
+
this._value = "";
|
|
911
|
+
this.hasSubmenu = false;
|
|
912
|
+
this.tooltipPlacement = "top";
|
|
913
|
+
this.noWrap = false;
|
|
914
|
+
this.renderAngleIcon = (classes = []) => angleIcon(classes);
|
|
915
|
+
this.renderCheckIcon = (classes = []) => checkIcon(classes);
|
|
916
|
+
this.renderInfoIcon = (classes = []) => infoIcon(classes);
|
|
917
|
+
this.open = false;
|
|
918
|
+
this.handleSlottableRequest = (event) => {
|
|
919
|
+
var _a;
|
|
920
|
+
(_a = this.submenuElement) == null ? void 0 : _a.dispatchEvent(
|
|
921
|
+
new SlottableRequestEvent(event.name, event.data)
|
|
601
922
|
);
|
|
602
|
-
}
|
|
923
|
+
};
|
|
924
|
+
this.proxyFocus = () => {
|
|
603
925
|
this.focus();
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
this.
|
|
608
|
-
|
|
609
|
-
|
|
926
|
+
};
|
|
927
|
+
this.handleBeforetoggle = (event) => {
|
|
928
|
+
if (event.newState === "closed") {
|
|
929
|
+
this.open = true;
|
|
930
|
+
this.overlayElement.manuallyKeepOpen();
|
|
931
|
+
this.overlayElement.removeEventListener(
|
|
932
|
+
"beforetoggle",
|
|
933
|
+
this.handleBeforetoggle
|
|
934
|
+
);
|
|
935
|
+
}
|
|
936
|
+
};
|
|
937
|
+
this.recentlyLeftChild = false;
|
|
938
|
+
this.willDispatchUpdate = false;
|
|
939
|
+
this.menuData = {
|
|
610
940
|
focusRoot: void 0,
|
|
611
941
|
parentMenu: void 0,
|
|
612
942
|
selectionRoot: void 0,
|
|
613
943
|
cleanupSteps: []
|
|
614
|
-
}
|
|
615
|
-
|
|
616
|
-
|
|
944
|
+
};
|
|
945
|
+
this.addEventListener("click", this.handleClickCapture, {
|
|
946
|
+
capture: true
|
|
947
|
+
});
|
|
948
|
+
new MutationController(this, {
|
|
617
949
|
config: {
|
|
618
|
-
characterData:
|
|
619
|
-
childList:
|
|
620
|
-
subtree:
|
|
950
|
+
characterData: true,
|
|
951
|
+
childList: true,
|
|
952
|
+
subtree: true
|
|
621
953
|
},
|
|
622
|
-
callback: (
|
|
623
|
-
|
|
624
|
-
(
|
|
625
|
-
)
|
|
954
|
+
callback: (mutations) => {
|
|
955
|
+
const isSubmenu = mutations.every(
|
|
956
|
+
(mutation) => mutation.target.slot === "submenu"
|
|
957
|
+
);
|
|
958
|
+
if (isSubmenu) {
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
this.breakItemChildrenCache();
|
|
626
962
|
}
|
|
627
963
|
});
|
|
628
964
|
}
|
|
629
965
|
static get styles() {
|
|
630
|
-
return [
|
|
966
|
+
return [unsafeCSS(menuItemStyles)];
|
|
631
967
|
}
|
|
632
968
|
get value() {
|
|
633
969
|
return this._value || this.itemText;
|
|
634
970
|
}
|
|
635
|
-
set value(
|
|
636
|
-
|
|
971
|
+
set value(value) {
|
|
972
|
+
if (value === this._value) {
|
|
973
|
+
return;
|
|
974
|
+
}
|
|
975
|
+
this._value = value || "";
|
|
976
|
+
if (this._value) {
|
|
977
|
+
this.setAttribute("value", this._value);
|
|
978
|
+
} else {
|
|
979
|
+
this.removeAttribute("value");
|
|
980
|
+
}
|
|
637
981
|
}
|
|
638
982
|
/**
|
|
639
983
|
* @private
|
|
640
984
|
*/
|
|
641
985
|
get itemText() {
|
|
642
986
|
return this.itemChildren.content.reduce(
|
|
643
|
-
(
|
|
987
|
+
(acc, node) => acc + (node.textContent || "").trim(),
|
|
644
988
|
""
|
|
645
989
|
);
|
|
646
990
|
}
|
|
647
991
|
renderTooltip() {
|
|
648
|
-
|
|
992
|
+
if (!this.tooltip) {
|
|
993
|
+
return nothing;
|
|
994
|
+
}
|
|
995
|
+
this.dependencyManager.add("luzmo-tooltip");
|
|
996
|
+
this.dependencyManager.add("luzmo-overlay");
|
|
997
|
+
import("../tooltip/index.js");
|
|
998
|
+
import("../overlay/index.js");
|
|
999
|
+
return html`
|
|
649
1000
|
<div class="menu-item-tooltip-container">
|
|
650
1001
|
<!-- The visible icon that acts as trigger -->
|
|
651
1002
|
<div
|
|
@@ -665,7 +1016,7 @@ class s extends R(
|
|
|
665
1016
|
<luzmo-tooltip> ${this.tooltip} </luzmo-tooltip>
|
|
666
1017
|
</luzmo-overlay>
|
|
667
1018
|
</div>
|
|
668
|
-
|
|
1019
|
+
`;
|
|
669
1020
|
}
|
|
670
1021
|
get focusElement() {
|
|
671
1022
|
return this;
|
|
@@ -674,48 +1025,76 @@ class s extends R(
|
|
|
674
1025
|
return this.slotContentIsPresent;
|
|
675
1026
|
}
|
|
676
1027
|
get itemChildren() {
|
|
677
|
-
if (!this.iconSlot || !this.contentSlot)
|
|
1028
|
+
if (!this.iconSlot || !this.contentSlot) {
|
|
678
1029
|
return {
|
|
679
1030
|
icon: [],
|
|
680
1031
|
content: []
|
|
681
1032
|
};
|
|
682
|
-
|
|
1033
|
+
}
|
|
1034
|
+
if (this._itemChildren) {
|
|
683
1035
|
return this._itemChildren;
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
1036
|
+
}
|
|
1037
|
+
const icon = this.iconSlot.assignedElements().map((element) => {
|
|
1038
|
+
const newElement = element.cloneNode(true);
|
|
1039
|
+
newElement.removeAttribute("slot");
|
|
1040
|
+
newElement.classList.toggle("icon");
|
|
1041
|
+
return newElement;
|
|
1042
|
+
});
|
|
1043
|
+
const content = this.contentSlot.assignedNodes().map((node) => node.cloneNode(true));
|
|
1044
|
+
this._itemChildren = { icon, content };
|
|
1045
|
+
return this._itemChildren;
|
|
689
1046
|
}
|
|
690
1047
|
click() {
|
|
691
|
-
this.disabled
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
if (this.
|
|
695
|
-
return
|
|
1048
|
+
if (this.disabled) {
|
|
1049
|
+
return;
|
|
1050
|
+
}
|
|
1051
|
+
if (this.shouldProxyClick()) {
|
|
1052
|
+
return;
|
|
1053
|
+
}
|
|
1054
|
+
super.click();
|
|
1055
|
+
}
|
|
1056
|
+
handleClickCapture(event) {
|
|
1057
|
+
if (this.disabled) {
|
|
1058
|
+
event.preventDefault();
|
|
1059
|
+
event.stopImmediatePropagation();
|
|
1060
|
+
event.stopPropagation();
|
|
1061
|
+
return false;
|
|
1062
|
+
}
|
|
696
1063
|
}
|
|
697
1064
|
shouldProxyClick() {
|
|
698
|
-
let
|
|
699
|
-
|
|
1065
|
+
let handled = false;
|
|
1066
|
+
if (this.anchorElement) {
|
|
1067
|
+
this.anchorElement.click();
|
|
1068
|
+
handled = true;
|
|
1069
|
+
}
|
|
1070
|
+
return handled;
|
|
700
1071
|
}
|
|
701
1072
|
breakItemChildrenCache() {
|
|
702
|
-
this._itemChildren = void 0
|
|
1073
|
+
this._itemChildren = void 0;
|
|
1074
|
+
this.triggerUpdate();
|
|
703
1075
|
}
|
|
704
1076
|
renderSubmenu() {
|
|
705
|
-
const
|
|
1077
|
+
const slot = html`
|
|
706
1078
|
<slot
|
|
707
1079
|
name="submenu"
|
|
708
1080
|
@slotchange=${this.manageSubmenu}
|
|
709
1081
|
@luzmo-menu-item-added-or-updated=${{
|
|
710
|
-
handleEvent: (
|
|
711
|
-
|
|
1082
|
+
handleEvent: (event) => {
|
|
1083
|
+
event.clear(event.item);
|
|
712
1084
|
},
|
|
713
|
-
capture:
|
|
1085
|
+
capture: true
|
|
714
1086
|
}}
|
|
715
|
-
@focusin=${(
|
|
1087
|
+
@focusin=${(event) => event.stopPropagation()}
|
|
716
1088
|
></slot>
|
|
717
1089
|
`;
|
|
718
|
-
|
|
1090
|
+
if (!this.hasSubmenu) {
|
|
1091
|
+
return slot;
|
|
1092
|
+
}
|
|
1093
|
+
this.dependencyManager.add("luzmo-overlay");
|
|
1094
|
+
this.dependencyManager.add("luzmo-popover");
|
|
1095
|
+
import("../overlay-CN8ISP1F.js").then((n) => n.f);
|
|
1096
|
+
import("../popover-BkbYhl3i.js");
|
|
1097
|
+
return html`
|
|
719
1098
|
<luzmo-overlay
|
|
720
1099
|
.triggerElement=${this}
|
|
721
1100
|
?disabled=${!this.hasSubmenu}
|
|
@@ -723,30 +1102,31 @@ class s extends R(
|
|
|
723
1102
|
.placement=${this.isLTR ? "right-start" : "left-start"}
|
|
724
1103
|
.offset=${[-10, -5]}
|
|
725
1104
|
.type=${"auto"}
|
|
726
|
-
@close=${(
|
|
1105
|
+
@close=${(event) => event.stopPropagation()}
|
|
727
1106
|
@slottable-request=${this.handleSlottableRequest}
|
|
728
1107
|
>
|
|
729
1108
|
<luzmo-popover
|
|
730
|
-
@change=${(
|
|
731
|
-
this.handleSubmenuChange(
|
|
1109
|
+
@change=${(event) => {
|
|
1110
|
+
this.handleSubmenuChange(event);
|
|
1111
|
+
this.open = false;
|
|
732
1112
|
}}
|
|
733
1113
|
@pointerenter=${this.handleSubmenuPointerenter}
|
|
734
1114
|
@pointerleave=${this.handleSubmenuPointerleave}
|
|
735
|
-
@luzmo-menu-item-added-or-updated=${(
|
|
1115
|
+
@luzmo-menu-item-added-or-updated=${(event) => event.stopPropagation()}
|
|
736
1116
|
>
|
|
737
|
-
${
|
|
1117
|
+
${slot}
|
|
738
1118
|
</luzmo-popover>
|
|
739
1119
|
</luzmo-overlay>
|
|
740
1120
|
${this.renderAngleIcon()}
|
|
741
|
-
|
|
1121
|
+
`;
|
|
742
1122
|
}
|
|
743
1123
|
render() {
|
|
744
|
-
return
|
|
745
|
-
${this.selected ?
|
|
1124
|
+
return html`
|
|
1125
|
+
${this.selected ? html`
|
|
746
1126
|
${this.renderCheckIcon(
|
|
747
1127
|
this.hasIcon ? ["checkmark--withAdjacentIcon"] : []
|
|
748
1128
|
)}
|
|
749
|
-
` :
|
|
1129
|
+
` : nothing}
|
|
750
1130
|
<slot name="icon"></slot>
|
|
751
1131
|
<div id="label">
|
|
752
1132
|
<slot id="slot"></slot>
|
|
@@ -756,34 +1136,53 @@ class s extends R(
|
|
|
756
1136
|
${this.renderTooltip()}
|
|
757
1137
|
${this.href && this.href.length > 0 ? super.renderAnchor({
|
|
758
1138
|
id: "button",
|
|
759
|
-
ariaHidden:
|
|
1139
|
+
ariaHidden: true,
|
|
760
1140
|
className: "button anchor hidden"
|
|
761
|
-
}) :
|
|
1141
|
+
}) : nothing}
|
|
762
1142
|
${this.renderSubmenu()}
|
|
763
1143
|
`;
|
|
764
1144
|
}
|
|
765
|
-
manageSubmenu(
|
|
766
|
-
this.submenuElement =
|
|
767
|
-
flatten:
|
|
768
|
-
})[0]
|
|
1145
|
+
manageSubmenu(event) {
|
|
1146
|
+
this.submenuElement = event.target.assignedElements({
|
|
1147
|
+
flatten: true
|
|
1148
|
+
})[0];
|
|
1149
|
+
this.hasSubmenu = !!this.submenuElement;
|
|
1150
|
+
if (this.hasSubmenu) {
|
|
1151
|
+
this.setAttribute("aria-haspopup", "true");
|
|
1152
|
+
}
|
|
769
1153
|
}
|
|
770
|
-
handlePointerdown(
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
this.
|
|
776
|
-
|
|
1154
|
+
handlePointerdown(event) {
|
|
1155
|
+
if (event.target === this && this.hasSubmenu && this.open) {
|
|
1156
|
+
this.addEventListener("focus", this.handleSubmenuFocus, {
|
|
1157
|
+
once: true
|
|
1158
|
+
});
|
|
1159
|
+
this.overlayElement.addEventListener(
|
|
1160
|
+
"beforetoggle",
|
|
1161
|
+
this.handleBeforetoggle
|
|
1162
|
+
);
|
|
1163
|
+
}
|
|
777
1164
|
}
|
|
778
|
-
firstUpdated(
|
|
779
|
-
super.firstUpdated(
|
|
1165
|
+
firstUpdated(changes) {
|
|
1166
|
+
super.firstUpdated(changes);
|
|
1167
|
+
this.setAttribute("tabindex", "-1");
|
|
1168
|
+
this.addEventListener("pointerdown", this.handlePointerdown);
|
|
1169
|
+
this.addEventListener("pointerenter", this.closeOverlaysForRoot);
|
|
1170
|
+
if (!this.hasAttribute("id")) {
|
|
1171
|
+
this.id = `luzmo-menu-item-${randomID()}`;
|
|
1172
|
+
}
|
|
780
1173
|
}
|
|
781
1174
|
closeOverlaysForRoot() {
|
|
782
|
-
var
|
|
783
|
-
|
|
1175
|
+
var _a;
|
|
1176
|
+
if (this.open) {
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1179
|
+
(_a = this.menuData.parentMenu) == null ? void 0 : _a.closeDescendentOverlays();
|
|
784
1180
|
}
|
|
785
|
-
handleSubmenuClick(
|
|
786
|
-
|
|
1181
|
+
handleSubmenuClick(event) {
|
|
1182
|
+
if (event.composedPath().includes(this.overlayElement)) {
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
this.openOverlay();
|
|
787
1186
|
}
|
|
788
1187
|
handleSubmenuFocus() {
|
|
789
1188
|
requestAnimationFrame(() => {
|
|
@@ -792,15 +1191,19 @@ class s extends R(
|
|
|
792
1191
|
}
|
|
793
1192
|
handlePointerenter() {
|
|
794
1193
|
if (this.leaveTimeout) {
|
|
795
|
-
clearTimeout(this.leaveTimeout)
|
|
1194
|
+
clearTimeout(this.leaveTimeout);
|
|
1195
|
+
delete this.leaveTimeout;
|
|
796
1196
|
return;
|
|
797
1197
|
}
|
|
798
1198
|
this.openOverlay();
|
|
799
1199
|
}
|
|
800
1200
|
handlePointerleave() {
|
|
801
|
-
this.open && !this.recentlyLeftChild
|
|
802
|
-
|
|
803
|
-
|
|
1201
|
+
if (this.open && !this.recentlyLeftChild) {
|
|
1202
|
+
this.leaveTimeout = setTimeout(() => {
|
|
1203
|
+
delete this.leaveTimeout;
|
|
1204
|
+
this.open = false;
|
|
1205
|
+
}, POINTERLEAVE_TIMEOUT);
|
|
1206
|
+
}
|
|
804
1207
|
}
|
|
805
1208
|
/**
|
|
806
1209
|
* When there is a `change` event in the submenu for this item
|
|
@@ -809,122 +1212,174 @@ class s extends R(
|
|
|
809
1212
|
* and the root of the tree to have their selection changes and
|
|
810
1213
|
* be closed.
|
|
811
1214
|
*/
|
|
812
|
-
handleSubmenuChange(
|
|
813
|
-
var
|
|
814
|
-
|
|
1215
|
+
handleSubmenuChange(event) {
|
|
1216
|
+
var _a;
|
|
1217
|
+
event.stopPropagation();
|
|
1218
|
+
(_a = this.menuData.selectionRoot) == null ? void 0 : _a.selectOrToggleItem(this);
|
|
815
1219
|
}
|
|
816
1220
|
handleSubmenuPointerenter() {
|
|
817
|
-
this.recentlyLeftChild =
|
|
1221
|
+
this.recentlyLeftChild = true;
|
|
818
1222
|
}
|
|
819
1223
|
handleSubmenuPointerleave() {
|
|
820
1224
|
requestAnimationFrame(() => {
|
|
821
|
-
this.recentlyLeftChild =
|
|
1225
|
+
this.recentlyLeftChild = false;
|
|
822
1226
|
});
|
|
823
1227
|
}
|
|
824
|
-
handleSubmenuOpen(
|
|
825
|
-
this.focused =
|
|
826
|
-
const
|
|
827
|
-
(
|
|
1228
|
+
handleSubmenuOpen(event) {
|
|
1229
|
+
this.focused = false;
|
|
1230
|
+
const parentOverlay = event.composedPath().find(
|
|
1231
|
+
(el) => el !== this.overlayElement && el.localName === "luzmo-overlay"
|
|
828
1232
|
);
|
|
829
|
-
this.overlayElement.parentOverlayToForceClose =
|
|
1233
|
+
this.overlayElement.parentOverlayToForceClose = parentOverlay;
|
|
830
1234
|
}
|
|
831
1235
|
cleanup() {
|
|
832
|
-
this.open =
|
|
1236
|
+
this.open = false;
|
|
1237
|
+
this.active = false;
|
|
833
1238
|
}
|
|
834
1239
|
openOverlay() {
|
|
835
|
-
!this.hasSubmenu || this.open || this.disabled
|
|
836
|
-
|
|
837
|
-
}
|
|
1240
|
+
if (!this.hasSubmenu || this.open || this.disabled) {
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
this.open = true;
|
|
1244
|
+
this.active = true;
|
|
1245
|
+
this.setAttribute("aria-expanded", "true");
|
|
1246
|
+
this.addEventListener("luzmo-closed", this.cleanup, {
|
|
1247
|
+
once: true
|
|
1248
|
+
});
|
|
838
1249
|
}
|
|
839
1250
|
updateAriaSelected() {
|
|
840
|
-
const
|
|
841
|
-
|
|
1251
|
+
const role = this.getAttribute("role");
|
|
1252
|
+
if (role === "option") {
|
|
1253
|
+
this.setAttribute("aria-selected", this.selected ? "true" : "false");
|
|
1254
|
+
} else if (role === "menuitemcheckbox" || role === "menuitemradio") {
|
|
1255
|
+
this.setAttribute("aria-checked", this.selected ? "true" : "false");
|
|
1256
|
+
}
|
|
842
1257
|
}
|
|
843
|
-
setRole(
|
|
844
|
-
this.setAttribute("role",
|
|
1258
|
+
setRole(role) {
|
|
1259
|
+
this.setAttribute("role", role);
|
|
1260
|
+
this.updateAriaSelected();
|
|
845
1261
|
}
|
|
846
|
-
updated(
|
|
847
|
-
var
|
|
848
|
-
|
|
1262
|
+
updated(changes) {
|
|
1263
|
+
var _a, _b;
|
|
1264
|
+
super.updated(changes);
|
|
1265
|
+
if (changes.has("label") && (this.label || changes.get("label") !== void 0)) {
|
|
1266
|
+
this.setAttribute("aria-label", this.label || "");
|
|
1267
|
+
}
|
|
1268
|
+
if (changes.has("active") && (this.active || changes.get("active") !== void 0) && this.active) {
|
|
1269
|
+
(_a = this.menuData.selectionRoot) == null ? void 0 : _a.closeDescendentOverlays();
|
|
1270
|
+
}
|
|
1271
|
+
if (this.anchorElement) {
|
|
1272
|
+
this.anchorElement.addEventListener("focus", this.proxyFocus);
|
|
1273
|
+
this.anchorElement.tabIndex = -1;
|
|
1274
|
+
}
|
|
1275
|
+
if (changes.has("selected")) {
|
|
1276
|
+
this.updateAriaSelected();
|
|
1277
|
+
}
|
|
1278
|
+
if (changes.has("hasSubmenu") && (this.hasSubmenu || changes.get("hasSubmenu") !== void 0)) {
|
|
849
1279
|
if (this.hasSubmenu) {
|
|
850
1280
|
this.abortControllerSubmenu = new AbortController();
|
|
851
|
-
const
|
|
852
|
-
this.addEventListener("click", this.handleSubmenuClick,
|
|
853
|
-
|
|
854
|
-
(
|
|
1281
|
+
const options = { signal: this.abortControllerSubmenu.signal };
|
|
1282
|
+
this.addEventListener("click", this.handleSubmenuClick, options);
|
|
1283
|
+
this.addEventListener("pointerenter", this.handlePointerenter, options);
|
|
1284
|
+
this.addEventListener("pointerleave", this.handlePointerleave, options);
|
|
1285
|
+
this.addEventListener("luzmo-opened", this.handleSubmenuOpen, options);
|
|
1286
|
+
} else {
|
|
1287
|
+
(_b = this.abortControllerSubmenu) == null ? void 0 : _b.abort();
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
855
1290
|
}
|
|
856
1291
|
connectedCallback() {
|
|
857
|
-
super.connectedCallback()
|
|
1292
|
+
super.connectedCallback();
|
|
1293
|
+
this.triggerUpdate();
|
|
858
1294
|
}
|
|
859
1295
|
disconnectedCallback() {
|
|
860
|
-
this.menuData.cleanupSteps.forEach((
|
|
1296
|
+
this.menuData.cleanupSteps.forEach((removal) => removal(this));
|
|
1297
|
+
this.menuData = {
|
|
861
1298
|
focusRoot: void 0,
|
|
862
1299
|
parentMenu: void 0,
|
|
863
1300
|
selectionRoot: void 0,
|
|
864
1301
|
cleanupSteps: []
|
|
865
|
-
}
|
|
1302
|
+
};
|
|
1303
|
+
super.disconnectedCallback();
|
|
866
1304
|
}
|
|
867
1305
|
async triggerUpdate() {
|
|
868
|
-
|
|
1306
|
+
if (this.willDispatchUpdate) {
|
|
1307
|
+
return;
|
|
1308
|
+
}
|
|
1309
|
+
this.willDispatchUpdate = true;
|
|
1310
|
+
await new Promise((ready) => requestAnimationFrame(ready));
|
|
1311
|
+
this.dispatchUpdate();
|
|
869
1312
|
}
|
|
870
1313
|
dispatchUpdate() {
|
|
871
|
-
|
|
1314
|
+
if (!this.isConnected) {
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
this.dispatchEvent(new MenuItemAddedOrUpdatedEvent(this));
|
|
1318
|
+
this.willDispatchUpdate = false;
|
|
872
1319
|
}
|
|
873
1320
|
}
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
],
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
],
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
],
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
],
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
],
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
],
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
],
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
],
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
],
|
|
901
|
-
|
|
902
|
-
|
|
1321
|
+
__decorateClass([
|
|
1322
|
+
property({ type: Boolean, reflect: true })
|
|
1323
|
+
], LuzmoMenuItem.prototype, "active", 2);
|
|
1324
|
+
__decorateClass([
|
|
1325
|
+
property({ type: Boolean, reflect: true })
|
|
1326
|
+
], LuzmoMenuItem.prototype, "focused", 2);
|
|
1327
|
+
__decorateClass([
|
|
1328
|
+
property({ type: Boolean, reflect: true })
|
|
1329
|
+
], LuzmoMenuItem.prototype, "selected", 2);
|
|
1330
|
+
__decorateClass([
|
|
1331
|
+
property({ type: String })
|
|
1332
|
+
], LuzmoMenuItem.prototype, "value", 1);
|
|
1333
|
+
__decorateClass([
|
|
1334
|
+
property({ type: Boolean, reflect: true, attribute: "has-submenu" })
|
|
1335
|
+
], LuzmoMenuItem.prototype, "hasSubmenu", 2);
|
|
1336
|
+
__decorateClass([
|
|
1337
|
+
property({ type: String })
|
|
1338
|
+
], LuzmoMenuItem.prototype, "tooltip", 2);
|
|
1339
|
+
__decorateClass([
|
|
1340
|
+
property({ type: String, attribute: "tooltip-placement" })
|
|
1341
|
+
], LuzmoMenuItem.prototype, "tooltipPlacement", 2);
|
|
1342
|
+
__decorateClass([
|
|
1343
|
+
query("slot:not([name])")
|
|
1344
|
+
], LuzmoMenuItem.prototype, "contentSlot", 2);
|
|
1345
|
+
__decorateClass([
|
|
1346
|
+
query('slot[name="icon"]')
|
|
1347
|
+
], LuzmoMenuItem.prototype, "iconSlot", 2);
|
|
1348
|
+
__decorateClass([
|
|
1349
|
+
property({
|
|
903
1350
|
type: Boolean,
|
|
904
|
-
reflect:
|
|
1351
|
+
reflect: true,
|
|
905
1352
|
attribute: "no-wrap",
|
|
906
1353
|
hasChanged() {
|
|
907
|
-
return
|
|
1354
|
+
return false;
|
|
908
1355
|
}
|
|
909
1356
|
})
|
|
910
|
-
],
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
],
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
],
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
],
|
|
920
|
-
customElements.get("luzmo-menu")
|
|
921
|
-
customElements.
|
|
922
|
-
|
|
923
|
-
customElements.get("luzmo-menu-
|
|
1357
|
+
], LuzmoMenuItem.prototype, "noWrap", 2);
|
|
1358
|
+
__decorateClass([
|
|
1359
|
+
query(".anchor")
|
|
1360
|
+
], LuzmoMenuItem.prototype, "anchorElement", 2);
|
|
1361
|
+
__decorateClass([
|
|
1362
|
+
query("luzmo-overlay")
|
|
1363
|
+
], LuzmoMenuItem.prototype, "overlayElement", 2);
|
|
1364
|
+
__decorateClass([
|
|
1365
|
+
property({ type: Boolean, reflect: true })
|
|
1366
|
+
], LuzmoMenuItem.prototype, "open", 2);
|
|
1367
|
+
if (!customElements.get("luzmo-menu")) {
|
|
1368
|
+
customElements.define("luzmo-menu", LuzmoMenu);
|
|
1369
|
+
}
|
|
1370
|
+
if (!customElements.get("luzmo-menu-divider")) {
|
|
1371
|
+
customElements.define("luzmo-menu-divider", LuzmoMenuDivider);
|
|
1372
|
+
}
|
|
1373
|
+
if (!customElements.get("luzmo-menu-group")) {
|
|
1374
|
+
customElements.define("luzmo-menu-group", LuzmoMenuGroup);
|
|
1375
|
+
}
|
|
1376
|
+
if (!customElements.get("luzmo-menu-item")) {
|
|
1377
|
+
customElements.define("luzmo-menu-item", LuzmoMenuItem);
|
|
1378
|
+
}
|
|
924
1379
|
export {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
1380
|
+
LuzmoMenu,
|
|
1381
|
+
LuzmoMenuDivider,
|
|
1382
|
+
LuzmoMenuGroup,
|
|
1383
|
+
LuzmoMenuItem,
|
|
1384
|
+
MenuItemAddedOrUpdatedEvent
|
|
930
1385
|
};
|