@nldd/design-system 0.26.0 → 0.26.2
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/custom-elements.json +4559 -1176
- package/dist/cdn/autoloader.js +141 -141
- package/dist/cdn/chunks/{accordion-DA4IlxS5.js → accordion-CCuKxlsg.js} +6 -6
- package/dist/cdn/chunks/{accordion-item-Ca1o93cq.js → accordion-item-Cn1UDWtD.js} +7 -7
- package/dist/cdn/chunks/{activity-indicator-Cj4H0Mbz.js → activity-indicator-BM_atCTY.js} +13 -13
- package/dist/cdn/chunks/{admonition-CdZSoO8O.js → admonition-CqDce27_.js} +11 -11
- package/dist/cdn/chunks/{avatar-Dhqn-Dmv.js → avatar-Dl2tOfc2.js} +18 -18
- package/dist/cdn/chunks/{avatar-group-B017eF-u.js → avatar-group-Br3qBaow.js} +42 -40
- package/dist/cdn/chunks/{badge-Bep5B0_g.js → badge-DjjAl4mn.js} +15 -15
- package/dist/cdn/chunks/{banner-DGpIXuE2.js → banner-s5xMqoEU.js} +16 -16
- package/dist/cdn/chunks/{bar-split-view-CKwJxd3e.js → bar-split-view-B6Mv_cw-.js} +8 -8
- package/dist/cdn/chunks/{blockquote-ChMgaOuI.js → blockquote-CRFPXI9u.js} +8 -8
- package/dist/cdn/chunks/{box-BRmziG-6.js → box-CSZyj31o.js} +5 -5
- package/dist/cdn/chunks/{breadcrumbs-BeVO8bkQ.js → breadcrumbs-DzjbOB7o.js} +13 -13
- package/dist/cdn/chunks/{button-cHBkq_s7.js → button-B7OGt_dX.js} +53 -54
- package/dist/cdn/chunks/{button-bar-CLxOdalJ.js → button-bar-CvDkir22.js} +8 -8
- package/dist/cdn/chunks/{button-group-BIvKtEIX.js → button-group-Bi3dr9Go.js} +6 -6
- package/dist/cdn/chunks/{card-B5gp9Zly.js → card-DceO3pMp.js} +10 -10
- package/dist/cdn/chunks/{cell-D4Nrd5Z9.js → cell-Bgp9n0yQ.js} +13 -13
- package/dist/cdn/chunks/{checkbox-CeLTJhAc.js → checkbox-C1F0Q3g8.js} +26 -43
- package/dist/cdn/chunks/{checkbox-field-C8cU8fuf.js → checkbox-field-DGKc530M.js} +35 -43
- package/dist/cdn/chunks/checkbox-group-x9Ua2a06.js +91 -0
- package/dist/cdn/chunks/choice-group-AZsqoheP.js +64 -0
- package/dist/cdn/chunks/{class-map-xzscTu4B.js → class-map-CAVKoa31.js} +1 -1
- package/dist/cdn/chunks/{code-editor-BNhlXTSl.js → code-editor-C0U5qVW2.js} +11 -11
- package/dist/cdn/chunks/{code-viewer-D_JwouYO.js → code-viewer-C_DzKPSv.js} +17 -17
- package/dist/cdn/chunks/{codemirror-input-DJ0wgYrc.js → codemirror-input-BmIE22aU.js} +5 -5
- package/dist/cdn/chunks/{collection-BXvz_OtU.js → collection-BZK9NzrQ.js} +19 -19
- package/dist/cdn/chunks/{combo-box-8kbmoStb.js → combo-box-DJrQ-2Wr.js} +69 -87
- package/dist/cdn/chunks/{container-Dq-2uHd5.js → container-BT96Wlz6.js} +48 -48
- package/dist/cdn/chunks/{custom-element-DeaCQ2NP.js → custom-element-D5bstafw.js} +2 -2
- package/dist/cdn/chunks/{date-field-CQg1_73u.js → date-field-B8GcDwkD.js} +33 -40
- package/dist/cdn/chunks/{date-picker-CTMxGOiA.js → date-picker-Byi-fA0A.js} +17 -17
- package/dist/cdn/chunks/{decorate-CCYde2ES.js → decorate-Cjb3GqlZ.js} +1 -1
- package/dist/cdn/chunks/deep-active-element-DgiHjYGG.js +7 -0
- package/dist/cdn/chunks/{described-by-mixin-BYFim7aO.js → described-by-mixin-ZWpyWEyB.js} +2 -2
- package/dist/cdn/chunks/{description-cell-GcVeCz2_.js → description-cell-DRXRiZGw.js} +12 -12
- package/dist/cdn/chunks/{dev-checks-CSlbfDuF.js → dev-checks-BYWMWeug.js} +931 -931
- package/dist/cdn/chunks/{directive-helpers-DgaADFyY.js → directive-helpers-mh9SNf0j.js} +1 -1
- package/dist/cdn/chunks/{dist-5vPsM2aV.js → dist-1yCEk2Pe.js} +1 -1
- package/dist/cdn/chunks/{dist-1OQdP4ho.js → dist-BBtyEGZQ.js} +3 -3
- package/dist/cdn/chunks/{dist-Da_liXcd.js → dist-BIhRNYZs.js} +3 -3
- package/dist/cdn/chunks/{dist-B23jHvJ5.js → dist-BfJ8w6Dz.js} +1 -1
- package/dist/cdn/chunks/{dist-CcpLhc4y.js → dist-BlHWe6Ns.js} +1 -1
- package/dist/cdn/chunks/{dist-VCymi0hs.js → dist-C4o16iKF.js} +1 -1
- package/dist/cdn/chunks/{dist-CyDpBAaD.js → dist-CKGgPGjj.js} +2 -2
- package/dist/cdn/chunks/{dist-CNy2sPTt.js → dist-CT0CdAxb.js} +2 -2
- package/dist/cdn/chunks/{dist-D4SViUJx.js → dist-DCzCfm9V.js} +1 -1
- package/dist/cdn/chunks/{dist-DLtwMUDc.js → dist-iYv1GHSb.js} +2 -2
- package/dist/cdn/chunks/{dist-DBxjWahH.js → dist-jyyZH0d2.js} +1 -1
- package/dist/cdn/chunks/{divider-8XD3xTbl.js → divider-CeAw8gBP.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-RBAmckHS.js → document-tab-bar-rIsC6EZp.js} +32 -46
- package/dist/cdn/chunks/{dropdown-DVlxPcjr.js → dropdown-MEzKo0TQ.js} +14 -14
- package/dist/cdn/chunks/{file-field-BrHnFplX.js → file-field--wivtgZv.js} +42 -40
- package/dist/cdn/chunks/{form-DGHeGEIr.js → form-ByjlUZuR.js} +1 -1
- package/dist/cdn/chunks/{form-actions-CHwWKfMM.js → form-actions-YK7n_jse.js} +4 -4
- package/dist/cdn/chunks/form-associated-mixin-BCzChLUO.js +123 -0
- package/dist/cdn/chunks/{form-field-CdTSI-8h.js → form-field-y-h-k8x5.js} +11 -11
- package/dist/cdn/chunks/{form-section-CjECOIiZ.js → form-section-jWj88aQa.js} +1 -1
- package/dist/cdn/chunks/{full-bleed-section-CQgq4iGQ.js → full-bleed-section-h6CrFe8F.js} +5 -5
- package/dist/cdn/chunks/{hero-DhdcYt2N.js → hero-Dy1tW9gU.js} +19 -19
- package/dist/cdn/chunks/{icon-button-DT_Bi4Ac.js → icon-button-B0Lb2ccT.js} +37 -38
- package/dist/cdn/chunks/{icon-cell-C-qrZAlN.js → icon-cell-byBTzcEn.js} +10 -10
- package/dist/cdn/chunks/{icon-qpmEfU9B.js → icon-m8JXbN5F.js} +8 -8
- package/dist/cdn/chunks/{identity-DFmvuPkl.js → identity-BpUMGka9.js} +12 -12
- package/dist/cdn/chunks/{if-defined-BINBE69I.js → if-defined-Duzrh8bb.js} +1 -1
- package/dist/cdn/chunks/{image-B4M3h1xJ.js → image-DfpFBPj1.js} +21 -21
- package/dist/cdn/chunks/{inline-dialog-L-NvjANF.js → inline-dialog-D6CMJnYk.js} +16 -16
- package/dist/cdn/chunks/interest-intent-Bk3i_upv.js +63 -0
- package/dist/cdn/chunks/{interest-controller-Ban-3NrX.js → interest-invoker-BY95Duqo.js} +28 -38
- package/dist/cdn/chunks/{just-in-time-education-CWplH4r9.js → just-in-time-education-_1kTZuGb.js} +13 -13
- package/dist/cdn/chunks/{kanban-B6Wa-2aM.js → kanban-DFGaEwfP.js} +25 -29
- package/dist/cdn/chunks/{kanban-column-D2-Xq79_.js → kanban-column-Cs47JSUO.js} +10 -10
- package/dist/cdn/chunks/{keyboard-shortcut-Ci95olxF.js → keyboard-shortcut-4DPqQovv.js} +13 -13
- package/dist/cdn/chunks/{languages-C9AGuuSS.js → languages-D-97TsxL.js} +12 -12
- package/dist/cdn/chunks/{link-BJB2a_fG.js → link-6T0VtDWt.js} +18 -18
- package/dist/cdn/chunks/{link-group-aNoedLZo.js → link-group-ymcl82Ua.js} +7 -7
- package/dist/cdn/chunks/{list-CZWX62tH.js → list-BXpR0UzC.js} +110 -95
- package/dist/cdn/chunks/{list-item-DHzsbK_S.js → list-item-CyZ6uPGG.js} +50 -29
- package/dist/cdn/chunks/{list-item-segment-CHLlU9Gg.js → list-item-segment-BUtAy96X.js} +23 -20
- package/dist/cdn/chunks/{menu-bar-CJazkmY7.js → menu-bar-Cn1Nb2ir.js} +59 -60
- package/dist/cdn/chunks/{menu-bar-item-CSqXWNKE.js → menu-bar-item-CZR2qAzA.js} +35 -35
- package/dist/cdn/chunks/{menu-divider-Cn1hTpcM.js → menu-divider-dF1NvFJO.js} +3 -3
- package/dist/cdn/chunks/{menu-group-C71K1Vmv.js → menu-group-DW3so0Dn.js} +4 -4
- package/dist/cdn/chunks/{menu-item-TqBlQfI2.js → menu-item-7kb18Ypf.js} +4 -4
- package/dist/cdn/chunks/{menu-NGpB1SKq.js → menu-kSZLzjet.js} +101 -93
- package/dist/cdn/chunks/{menu.template-DthELYky.js → menu.template-cgua9dKM.js} +4 -4
- package/dist/cdn/chunks/{modal-dialog-0V2HsrJC.js → modal-dialog-DfKbcw9T.js} +28 -78
- package/dist/cdn/chunks/modal-overlay-Bx0bYzF3.js +95 -0
- package/dist/cdn/chunks/{multi-line-text-field-BV4uUDoK.js → multi-line-text-field-AV-vID1z.js} +28 -45
- package/dist/cdn/chunks/{navigation-split-view-tPhkxEVD.js → navigation-split-view-UwlSFPDE.js} +10 -10
- package/dist/cdn/chunks/{notification-CZccv6qx.js → notification-e5uGGh0b.js} +12 -12
- package/dist/cdn/chunks/{number-field-4R2blHda.js → number-field-COUmvl_s.js} +26 -32
- package/dist/cdn/chunks/{one-half-one-half-section-h2fLPQfP.js → one-half-one-half-section-C-AgSdm9.js} +6 -6
- package/dist/cdn/chunks/{one-third-two-thirds-section-mqUAH5lK.js → one-third-two-thirds-section-D1kq4IEc.js} +6 -6
- package/dist/cdn/chunks/{one-time-code-field-Bf_qymKd.js → one-time-code-field-BDQctC8H.js} +25 -38
- package/dist/cdn/chunks/overflow-menu-C67lAkP8.js +83 -0
- package/dist/cdn/chunks/overlay-invoker-CQpe-JGA.js +95 -0
- package/dist/cdn/chunks/{page-Kipfvmi6.js → page-DXEaFsfo.js} +11 -11
- package/dist/cdn/chunks/{page-footer-DxE966Oe.js → page-footer-DFaIlgHs.js} +13 -13
- package/dist/cdn/chunks/{page-section-mixin-DpF9JDpd.js → page-section-mixin-3XhS4f5q.js} +21 -21
- package/dist/cdn/chunks/{pagination-DUFFhaU8.js → pagination-BE3ERBNx.js} +13 -13
- package/dist/cdn/chunks/{password-field-DdYAVmF3.js → password-field-DjRp78HI.js} +28 -45
- package/dist/cdn/chunks/{popover-CRHxyhGx.js → popover-C3j0KtFh.js} +55 -64
- package/dist/cdn/chunks/{progress-bar-BuYsjmSo.js → progress-bar-iWFq6KS1.js} +26 -26
- package/dist/cdn/chunks/{progress-circle-Cvu1bfNG.js → progress-circle-BPFzTlhn.js} +24 -24
- package/dist/cdn/chunks/{radio-button-B_4AxWDx.js → radio-button-BMVBbe3-.js} +17 -26
- package/dist/cdn/chunks/{radio-button-field-D7jIg6Oi.js → radio-button-field-BqSd0JMd.js} +29 -37
- package/dist/cdn/chunks/radio-button-group-DZTPflZ3.js +112 -0
- package/dist/cdn/chunks/{render-marked-CIuiSS_8.js → render-marked-1xftlCd8.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-DNPaZjSC.js → reorder-handle-cell-loSG6GRY.js} +7 -7
- package/dist/cdn/chunks/{reorder-handle-mixin-CgvWq4fF.js → reorder-handle-mixin-cLWXCdFC.js} +2 -2
- package/dist/cdn/chunks/{repeat-DfVuWl6o.js → repeat-CWsNVfra.js} +2 -2
- package/dist/cdn/chunks/{return-focus-D0fF2hjd.js → return-focus-CpwHVxYU.js} +10 -14
- package/dist/cdn/chunks/{rich-text-CVHlMQY6.js → rich-text-DSvI9u6v.js} +3 -3
- package/dist/cdn/chunks/{row-header-mixin-B25JK2B3.js → row-header-mixin-vwABKkTO.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-Dv57rTww.js → scroll-fade-ZNdnDF4p.js} +4 -4
- package/dist/cdn/chunks/{search-field-hmD_DXbG.js → search-field-CBTir8Wu.js} +33 -58
- package/dist/cdn/chunks/{segmented-control-e8e-jYSw.js → segmented-control-hvWn3L0J.js} +92 -103
- package/dist/cdn/chunks/{shadow-resets-CRdvf-Ei.js → shadow-resets-JiVlctXb.js} +2 -2
- package/dist/cdn/chunks/{sheet-D09y3J45.js → sheet-CnbdONF9.js} +39 -90
- package/dist/cdn/chunks/{shell-CV3gooGg.js → shell-BAH9okPd.js} +5 -5
- package/dist/cdn/chunks/{side-by-side-split-view-Ckz1C9zk.js → side-by-side-split-view-D07iBCFK.js} +8 -8
- package/dist/cdn/chunks/{sidebar-section-CdyD-x4t.js → sidebar-section-DAE2lrdn.js} +14 -14
- package/dist/cdn/chunks/{simple-section-CEf38rBZ.js → simple-section-DQZpG3nQ.js} +7 -7
- package/dist/cdn/chunks/{skip-link-DMRhATWw.js → skip-link-D0yYukhb.js} +7 -7
- package/dist/cdn/chunks/{slider-Db3FPiP6.js → slider-C-a97cAu.js} +30 -37
- package/dist/cdn/chunks/{spacer-BPFIYueo.js → spacer-C19W6HrX.js} +8 -8
- package/dist/cdn/chunks/{spacer-cell-kITa3CDV.js → spacer-cell-lRxkFSnp.js} +6 -6
- package/dist/cdn/chunks/{split-button-CJs9-Nha.js → split-button-38xSIAVk.js} +21 -21
- package/dist/cdn/chunks/{split-view-divider-lHlM1Ss8.js → split-view-divider-CViSo7s7.js} +5 -5
- package/dist/cdn/chunks/{split-view-pane-DlsbZtyo.js → split-view-pane-Bb1RFCNJ.js} +7 -7
- package/dist/cdn/chunks/{stacked-split-view-uRSVhrMd.js → stacked-split-view-Bnw5hQ5A.js} +8 -8
- package/dist/cdn/chunks/{static-html-BahSPV_4.js → static-html-7PckS8pf.js} +1 -1
- package/dist/cdn/chunks/{status-bar-DCJLVpsW.js → status-bar-D57SEB_4.js} +8 -8
- package/dist/cdn/chunks/{step-bar-CRR2jiyo.js → step-bar-Q_wc0vqp.js} +18 -18
- package/dist/cdn/chunks/{step-cell-CbtKxJNJ.js → step-cell-DU6sNjnm.js} +15 -15
- package/dist/cdn/chunks/{stepper-Con1_CnB.js → stepper-BM1dp44g.js} +16 -26
- package/dist/cdn/chunks/{style-map-uOwLerwV.js → style-map-BRs_xiW6.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-Bqn0eaC9.js → swatch-picker-BcRbPWVv.js} +63 -69
- package/dist/cdn/chunks/{switch-CMQcLEBJ.js → switch-7BZAufN0.js} +25 -42
- package/dist/cdn/chunks/{switch-field-D9kWq4Kw.js → switch-field-gjPTIapp.js} +19 -32
- package/dist/cdn/chunks/{tab-bar-DXzyZI3V.js → tab-bar-BKzbb7TE.js} +34 -29
- package/dist/cdn/chunks/{table-CWACLpHx.js → table-CmkkY3M1.js} +15 -15
- package/dist/cdn/chunks/{tag-Bo4yJbtF.js → tag-B4VfItSH.js} +11 -11
- package/dist/cdn/chunks/{term-CQ379ZbN.js → term-C0aNyYXz.js} +42 -39
- package/dist/cdn/chunks/{text-D-dFoj6N.js → text-CLuHOFQt.js} +29 -29
- package/dist/cdn/chunks/{text-cell-Be1hStxp.js → text-cell-Dvujh580.js} +23 -23
- package/dist/cdn/chunks/{text-editor-BjzQEBWm.js → text-editor-0_ZoELkA.js} +12 -12
- package/dist/cdn/chunks/{text-field-DA8nirp6.js → text-field-CrRBrXx0.js} +28 -45
- package/dist/cdn/chunks/{time-field-Dd_TxJuf.js → time-field-DUt1zvLw.js} +66 -148
- package/dist/cdn/chunks/{time-picker-B0-rv1qp.js → time-picker-CDzillxF.js} +119 -40
- package/dist/cdn/chunks/{title-DOoPdG_i.js → title-DQXyEqFW.js} +12 -12
- package/dist/cdn/chunks/{title-cell-BzCNOMGr.js → title-cell-CoUK6h-F.js} +23 -23
- package/dist/cdn/chunks/{toggle-button-9PbDHviQ.js → toggle-button-BhU5vLF8.js} +41 -54
- package/dist/cdn/chunks/{toggle-button-group-C-H-xp0M.js → toggle-button-group-B-0r4xZZ.js} +40 -54
- package/dist/cdn/chunks/{token-CMKFC3gz.js → token-CELUzY2p.js} +31 -34
- package/dist/cdn/chunks/{token-field-D4-XHfnG.js → token-field-C8ynyISX.js} +67 -57
- package/dist/cdn/chunks/{toolbar-z9OhEE5l.js → toolbar--QBCm9qO.js} +34 -78
- package/dist/cdn/chunks/{toolbar-item-ZYoyKOyy.js → toolbar-item-BoRhKFDR.js} +3 -3
- package/dist/cdn/chunks/{toolbar-title-FKtQ8ZC4.js → toolbar-title-CciXdTJR.js} +4 -4
- package/dist/cdn/chunks/{toolbar.styles-DDjpdCHV.js → toolbar.styles-B6kTrAfC.js} +3 -3
- package/dist/cdn/chunks/{tooltip-BvRNYRo3.js → tooltip-CkLC4ooQ.js} +43 -41
- package/dist/cdn/chunks/{top-navigation-bar-BHPQntER.js → top-navigation-bar-CGu2pn4Z.js} +29 -29
- package/dist/cdn/chunks/{top-title-bar-BVjegLlh.js → top-title-bar-2b-XHftB.js} +15 -15
- package/dist/cdn/chunks/{translations-cJjO6nQV.js → translations-D0cgmONm.js} +1 -1
- package/dist/cdn/chunks/{two-thirds-one-third-section-BdBHQuXc.js → two-thirds-one-third-section-CEfd273Z.js} +6 -6
- package/dist/cdn/chunks/{validation-list-5E3-3_95.js → validation-list-DIFEVSIk.js} +12 -12
- package/dist/cdn/chunks/{visibility-mixin-DvRe3O8t.js → visibility-mixin-OjALtpXa.js} +14 -14
- package/dist/cdn/chunks/{visually-hidden-F85D_HcR.js → visually-hidden-DcpY5lun.js} +2 -2
- package/dist/cdn/chunks/{window-CabW35M1.js → window-BGZCu06O.js} +44 -80
- package/dist/cdn/chunks/{with-translations-BHDG37HJ.js → with-translations-DkNkjQym.js} +3 -3
- package/dist/components/actions/button/button.d.ts +4 -4
- package/dist/components/actions/button/button.d.ts.map +1 -1
- package/dist/components/actions/button/button.js +4 -5
- package/dist/components/actions/button/button.js.map +1 -1
- package/dist/components/actions/button/button.template.js +1 -1
- package/dist/components/actions/button/button.template.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.d.ts +4 -4
- package/dist/components/actions/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/actions/icon-button/icon-button.js +4 -5
- package/dist/components/actions/icon-button/icon-button.js.map +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js +1 -1
- package/dist/components/actions/icon-button/icon-button.template.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +22 -6
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +50 -70
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/split-button/split-button.js +1 -1
- package/dist/components/actions/split-button/split-button.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +3 -3
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +4 -4
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.template.js +5 -9
- package/dist/components/actions/toolbar/toolbar.template.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +7 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +9 -9
- package/dist/components/content/avatar-group/avatar-group.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.template.js +0 -1
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- package/dist/components/content/term/term.d.ts +5 -5
- package/dist/components/content/term/term.d.ts.map +1 -1
- package/dist/components/content/term/term.js +22 -23
- package/dist/components/content/term/term.js.map +1 -1
- package/dist/components/content/term/term.template.js +1 -1
- package/dist/components/content/term/term.template.js.map +1 -1
- package/dist/components/content/token/token.d.ts +3 -5
- package/dist/components/content/token/token.d.ts.map +1 -1
- package/dist/components/content/token/token.js +23 -33
- package/dist/components/content/token/token.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +3 -5
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +34 -119
- package/dist/components/content/tooltip/tooltip.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +4 -1
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.d.ts +1 -4
- package/dist/components/inputs/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/inputs/checkbox/checkbox.js +3 -23
- package/dist/components/inputs/checkbox/checkbox.js.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts +1 -5
- package/dist/components/inputs/checkbox-field/checkbox-field.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-field/checkbox-field.js +8 -17
- package/dist/components/inputs/checkbox-field/checkbox-field.js.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts +1 -9
- package/dist/components/inputs/checkbox-group/checkbox-group.d.ts.map +1 -1
- package/dist/components/inputs/checkbox-group/checkbox-group.js +18 -59
- package/dist/components/inputs/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +6 -7
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +25 -58
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +1 -2
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +4 -14
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts +6 -3
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +15 -18
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts +1 -4
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.d.ts.map +1 -1
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js +3 -23
- package/dist/components/inputs/multi-line-text-field/multi-line-text-field.js.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts +4 -3
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.js +12 -16
- package/dist/components/inputs/number-field/number-field.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +1 -4
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js +2 -17
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
- package/dist/components/inputs/password-field/password-field.d.ts +1 -4
- package/dist/components/inputs/password-field/password-field.d.ts.map +1 -1
- package/dist/components/inputs/password-field/password-field.js +3 -23
- package/dist/components/inputs/password-field/password-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts +1 -4
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +1 -10
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts +3 -6
- package/dist/components/inputs/radio-button-field/radio-button-field.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-field/radio-button-field.js +6 -14
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts +1 -10
- package/dist/components/inputs/radio-button-group/radio-button-group.d.ts.map +1 -1
- package/dist/components/inputs/radio-button-group/radio-button-group.js +17 -74
- package/dist/components/inputs/radio-button-group/radio-button-group.js.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +1 -4
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.js +5 -35
- package/dist/components/inputs/search-field/search-field.js.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.d.ts +1 -3
- package/dist/components/inputs/segmented-control/segmented-control.d.ts.map +1 -1
- package/dist/components/inputs/segmented-control/segmented-control.js +6 -41
- package/dist/components/inputs/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/inputs/slider/slider.d.ts +1 -4
- package/dist/components/inputs/slider/slider.d.ts.map +1 -1
- package/dist/components/inputs/slider/slider.js +1 -14
- package/dist/components/inputs/slider/slider.js.map +1 -1
- package/dist/components/inputs/stepper/stepper.d.ts +1 -3
- package/dist/components/inputs/stepper/stepper.d.ts.map +1 -1
- package/dist/components/inputs/stepper/stepper.js +2 -13
- package/dist/components/inputs/stepper/stepper.js.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts +1 -3
- package/dist/components/inputs/swatch-picker/swatch-picker.d.ts.map +1 -1
- package/dist/components/inputs/swatch-picker/swatch-picker.js +5 -28
- package/dist/components/inputs/swatch-picker/swatch-picker.js.map +1 -1
- package/dist/components/inputs/switch/switch.d.ts +1 -4
- package/dist/components/inputs/switch/switch.d.ts.map +1 -1
- package/dist/components/inputs/switch/switch.js +3 -22
- package/dist/components/inputs/switch/switch.js.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.d.ts +1 -4
- package/dist/components/inputs/switch-field/switch-field.d.ts.map +1 -1
- package/dist/components/inputs/switch-field/switch-field.js +2 -16
- package/dist/components/inputs/switch-field/switch-field.js.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +1 -4
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.js +3 -23
- package/dist/components/inputs/text-field/text-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +8 -2
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +23 -14
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts +11 -7
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +19 -14
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.d.ts +3 -6
- package/dist/components/inputs/toggle-button/toggle-button.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button/toggle-button.js +6 -20
- package/dist/components/inputs/toggle-button/toggle-button.js.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts +2 -11
- package/dist/components/inputs/toggle-button-group/toggle-button-group.d.ts.map +1 -1
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js +23 -78
- package/dist/components/inputs/toggle-button-group/toggle-button-group.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts +12 -10
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +33 -35
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/layout/kanban/kanban.d.ts +0 -1
- package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban.js +2 -7
- package/dist/components/layout/kanban/kanban.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts +17 -3
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +34 -126
- package/dist/components/layout/popover/popover.js.map +1 -1
- package/dist/components/layout/sheet/sheet.d.ts +2 -33
- package/dist/components/layout/sheet/sheet.d.ts.map +1 -1
- package/dist/components/layout/sheet/sheet.js +8 -169
- package/dist/components/layout/sheet/sheet.js.map +1 -1
- package/dist/components/layout/sheet/sheet.template.js +5 -5
- package/dist/components/layout/sheet/sheet.template.js.map +1 -1
- package/dist/components/layout/window/window.d.ts +2 -30
- package/dist/components/layout/window/window.d.ts.map +1 -1
- package/dist/components/layout/window/window.js +12 -139
- package/dist/components/layout/window/window.js.map +1 -1
- package/dist/components/layout/window/window.template.d.ts.map +1 -1
- package/dist/components/layout/window/window.template.js +5 -4
- package/dist/components/layout/window/window.template.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +8 -32
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +37 -136
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.roving.d.ts +79 -0
- package/dist/components/lists-and-tables/list/list.roving.d.ts.map +1 -0
- package/dist/components/lists-and-tables/list/list.roving.js +122 -0
- package/dist/components/lists-and-tables/list/list.roving.js.map +1 -0
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +32 -17
- package/dist/components/lists-and-tables/list-item/list-item.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.js +49 -36
- package/dist/components/lists-and-tables/list-item/list-item.js.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts +3 -2
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js +5 -5
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +4 -5
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js +12 -63
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js +5 -7
- package/dist/components/navigation/document-tab-bar/document-tab-bar.template.js.map +1 -1
- package/dist/components/navigation/link/link.d.ts +2 -2
- package/dist/components/navigation/link/link.d.ts.map +1 -1
- package/dist/components/navigation/link/link.js +2 -2
- package/dist/components/navigation/link/link.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +11 -17
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +44 -71
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.template.js +2 -2
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts +2 -3
- package/dist/components/navigation/menu-bar-item/menu-bar-item.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js +14 -30
- package/dist/components/navigation/menu-bar-item/menu-bar-item.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +8 -2
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +18 -4
- package/dist/components/navigation/tab-bar/tab-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.template.js +4 -2
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts +2 -22
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js +4 -124
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.d.ts.map +1 -1
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js +5 -3
- package/dist/components/status-and-feedback/modal-dialog/modal-dialog.template.js.map +1 -1
- package/dist/nldd.min.js +855 -851
- package/dist/types/react.d.ts +96 -6
- package/dist/types/vue.d.ts +182 -9
- package/dist/utilities/choice-group.d.ts +91 -0
- package/dist/utilities/choice-group.d.ts.map +1 -0
- package/dist/utilities/choice-group.js +135 -0
- package/dist/utilities/choice-group.js.map +1 -0
- package/dist/utilities/deep-active-element.d.ts +6 -0
- package/dist/utilities/deep-active-element.d.ts.map +1 -0
- package/dist/utilities/deep-active-element.js +11 -0
- package/dist/utilities/deep-active-element.js.map +1 -0
- package/dist/utilities/dev-rules.generated.js +931 -931
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/form-associated-mixin.d.ts +21 -5
- package/dist/utilities/form-associated-mixin.d.ts.map +1 -1
- package/dist/utilities/form-associated-mixin.js +86 -5
- package/dist/utilities/form-associated-mixin.js.map +1 -1
- package/dist/utilities/interest-intent.d.ts +63 -0
- package/dist/utilities/interest-intent.d.ts.map +1 -0
- package/dist/utilities/interest-intent.js +139 -0
- package/dist/utilities/interest-intent.js.map +1 -0
- package/dist/utilities/{interest-controller.d.ts → interest-invoker.d.ts} +5 -14
- package/dist/utilities/interest-invoker.d.ts.map +1 -0
- package/dist/utilities/{interest-controller.js → interest-invoker.js} +39 -97
- package/dist/utilities/interest-invoker.js.map +1 -0
- package/dist/utilities/modal-overlay.d.ts +73 -0
- package/dist/utilities/modal-overlay.d.ts.map +1 -0
- package/dist/utilities/modal-overlay.js +219 -0
- package/dist/utilities/modal-overlay.js.map +1 -0
- package/dist/utilities/overflow-menu.d.ts +97 -0
- package/dist/utilities/overflow-menu.d.ts.map +1 -0
- package/dist/utilities/overflow-menu.js +209 -0
- package/dist/utilities/overflow-menu.js.map +1 -0
- package/dist/utilities/overlay-invoker.d.ts +185 -0
- package/dist/utilities/overlay-invoker.d.ts.map +1 -0
- package/dist/utilities/overlay-invoker.js +326 -0
- package/dist/utilities/overlay-invoker.js.map +1 -0
- package/dist/utilities/page-section-mixin.d.ts +11 -0
- package/dist/utilities/page-section-mixin.d.ts.map +1 -1
- package/dist/utilities/page-section-mixin.js +11 -0
- package/dist/utilities/page-section-mixin.js.map +1 -1
- package/dist/utilities/return-focus.d.ts +0 -2
- package/dist/utilities/return-focus.d.ts.map +1 -1
- package/dist/utilities/return-focus.js +1 -7
- package/dist/utilities/return-focus.js.map +1 -1
- package/dist/utilities/with-translations.d.ts +3 -0
- package/dist/utilities/with-translations.d.ts.map +1 -1
- package/dist/utilities/with-translations.js +3 -0
- package/dist/utilities/with-translations.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +4 -114
- package/lint/fix.js +53 -136
- package/lint/frontends.js +68 -6
- package/lint/linter.js +1 -0
- package/lint/main.js +21 -123
- package/lint/project.js +31 -0
- package/lint/rule-compiler.js +289 -0
- package/lint/session.js +127 -0
- package/lint/tree.js +46 -0
- package/package.json +5 -3
- package/dist/cdn/chunks/checkbox-group-CC72cq-P.js +0 -103
- package/dist/cdn/chunks/form-associated-mixin-BtStDDYA.js +0 -73
- package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +0 -20
- package/dist/cdn/chunks/popover-target-B25dxnmt.js +0 -10
- package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +0 -30
- package/dist/cdn/chunks/radio-button-group-D_OezDhB.js +0 -124
- package/dist/components/actions/toolbar/toolbar.overflow-menu.d.ts +0 -52
- package/dist/components/actions/toolbar/toolbar.overflow-menu.d.ts.map +0 -1
- package/dist/components/actions/toolbar/toolbar.overflow-menu.js +0 -105
- package/dist/components/actions/toolbar/toolbar.overflow-menu.js.map +0 -1
- package/dist/utilities/interest-controller.d.ts.map +0 -1
- package/dist/utilities/interest-controller.js.map +0 -1
- package/dist/utilities/open-when-rendered.d.ts +0 -21
- package/dist/utilities/open-when-rendered.d.ts.map +0 -1
- package/dist/utilities/open-when-rendered.js +0 -30
- package/dist/utilities/open-when-rendered.js.map +0 -1
- package/dist/utilities/popover-target.d.ts +0 -25
- package/dist/utilities/popover-target.d.ts.map +0 -1
- package/dist/utilities/popover-target.js +0 -48
- package/dist/utilities/popover-target.js.map +0 -1
- package/dist/utilities/popup-anchor-controller.d.ts +0 -63
- package/dist/utilities/popup-anchor-controller.d.ts.map +0 -1
- package/dist/utilities/popup-anchor-controller.js +0 -72
- package/dist/utilities/popup-anchor-controller.js.map +0 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { NLDDMenu } from '../components/actions/menu/menu.js';
|
|
3
|
+
import '../components/actions/menu/menu.js';
|
|
4
|
+
/** What the overflow menu needs from the bar it belongs to. */
|
|
5
|
+
export interface OverflowMenuHost extends ReactiveControllerHost, HTMLElement {
|
|
6
|
+
readonly renderRoot: HTMLElement | DocumentFragment;
|
|
7
|
+
}
|
|
8
|
+
export interface OverflowMenuOptions {
|
|
9
|
+
/** Prefix of the menu's id. */
|
|
10
|
+
id: string;
|
|
11
|
+
/** After the menu opened or closed; `open` is up to date by then. */
|
|
12
|
+
onToggle?: (open: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The "more" menu of a bar that hides what does not fit: nldd-toolbar,
|
|
16
|
+
* nldd-menu-bar and nldd-document-tab-bar. Each bar decides for itself what
|
|
17
|
+
* fits; this is the menu that lists the rest.
|
|
18
|
+
*
|
|
19
|
+
* It lives in the bar's shadow root, not in document.body. It is a popover,
|
|
20
|
+
* so the top layer gets it past any clipping anyway, and a menu in the body
|
|
21
|
+
* goes inert (visible but untouchable) when the bar sits in a modal dialog:
|
|
22
|
+
* everything outside the dialog is inert then. In the shadow root it also
|
|
23
|
+
* inherits the bar's color scheme, language and context, with nothing to carry.
|
|
24
|
+
*
|
|
25
|
+
* A `select` in the menu stays in the menu: what the bar wants the app to hear
|
|
26
|
+
* it sends on itself, from the original the entry stands for. Leaving it would
|
|
27
|
+
* reach the bar's own listeners as if one of its items had been chosen.
|
|
28
|
+
*
|
|
29
|
+
* Before an entry's action runs, focus goes to the bar's button (`handOff`).
|
|
30
|
+
* Whatever the action opens, a sheet or a dialog, remembers where focus was,
|
|
31
|
+
* and the entry is gone from view once the menu closes.
|
|
32
|
+
*/
|
|
33
|
+
export declare class OverflowMenu implements ReactiveController {
|
|
34
|
+
private readonly _host;
|
|
35
|
+
private readonly _options;
|
|
36
|
+
private static _counter;
|
|
37
|
+
/** Whether the menu is open. The bar renders its button from this. */
|
|
38
|
+
open: boolean;
|
|
39
|
+
private _menu;
|
|
40
|
+
private _originals;
|
|
41
|
+
constructor(_host: OverflowMenuHost, _options: OverflowMenuOptions);
|
|
42
|
+
/** The menu, while the bar is connected. */
|
|
43
|
+
get menu(): NLDDMenu | null;
|
|
44
|
+
hostConnected(): void;
|
|
45
|
+
hostDisconnected(): void;
|
|
46
|
+
hide(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Make `button` the menu's invoker. The browser opens and closes it
|
|
49
|
+
* natively through popovertarget, and the menu keeps `popoverTargetAction`
|
|
50
|
+
* in step with its state ('hide' while open, 'show' while closed). The
|
|
51
|
+
* default 'toggle' becomes 'show' here, for the very first click before the
|
|
52
|
+
* menu ever toggled.
|
|
53
|
+
*/
|
|
54
|
+
anchorTo(button: (HTMLElement & {
|
|
55
|
+
popoverTargetElement?: Element | null;
|
|
56
|
+
popoverTargetAction?: string;
|
|
57
|
+
}) | null): void;
|
|
58
|
+
/**
|
|
59
|
+
* Focus to the button that opens the menu, before what an entry stands for
|
|
60
|
+
* runs. An overlay that opens from it would otherwise remember the entry,
|
|
61
|
+
* which sits in a closed menu by the time it hands focus back, and focus
|
|
62
|
+
* ended on the body (#450).
|
|
63
|
+
*/
|
|
64
|
+
handOff(): void;
|
|
65
|
+
/** Fill the menu with entries the bar built itself. */
|
|
66
|
+
replace(entries: Element[]): void;
|
|
67
|
+
/**
|
|
68
|
+
* Fill the menu with copies of `items`, in this order. The originals stay
|
|
69
|
+
* where the app put them, so a copy's `select`, which never reaches
|
|
70
|
+
* listeners on its original, is dispatched again on the original: every
|
|
71
|
+
* original is stamped with an id that its copy carries.
|
|
72
|
+
*/
|
|
73
|
+
mirror(items: Element[]): void;
|
|
74
|
+
/** Whether the menu holds a copy of each of `items`, in this order. */
|
|
75
|
+
private _showsCopiesOf;
|
|
76
|
+
/**
|
|
77
|
+
* Carry what changed on the originals over to their copies, in place: a
|
|
78
|
+
* choice that checks an item shows its check mark while it blinks. Only the
|
|
79
|
+
* attributes the original has or had: the menu writes its own on an entry.
|
|
80
|
+
* The text of an element without children of its own, such as a label.
|
|
81
|
+
*/
|
|
82
|
+
private _updateCopies;
|
|
83
|
+
private _copiedAttributes;
|
|
84
|
+
private _pending;
|
|
85
|
+
/**
|
|
86
|
+
* Refill now, or once the menu has closed. New entries while it is open
|
|
87
|
+
* would cut the blink of a chosen one short and skip the menu's divider
|
|
88
|
+
* pass. The entries are made from the originals as they are by then.
|
|
89
|
+
*/
|
|
90
|
+
private _fill;
|
|
91
|
+
private _applyPending;
|
|
92
|
+
/** `data-overflow-oid` is outside the attributes a bar watches, so
|
|
93
|
+
* stamping starts no new sync. */
|
|
94
|
+
private _clone;
|
|
95
|
+
private _handleSelect;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=overflow-menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overflow-menu.d.ts","sourceRoot":"","sources":["../../src/utilities/overflow-menu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,KAAK,CAAC;AACtE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,oCAAoC,CAAC;AAG5C,+DAA+D;AAC/D,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB,EAAE,WAAW;IAC5E,QAAQ,CAAC,UAAU,EAAE,WAAW,GAAG,gBAAgB,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IACnC,+BAA+B;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACnC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,YAAa,YAAW,kBAAkB;IAUrD,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAV1B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAK;IAE5B,sEAAsE;IACtE,IAAI,UAAS;IAEb,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,UAAU,CAA8B;gBAG9B,KAAK,EAAE,gBAAgB,EACvB,QAAQ,EAAE,mBAAmB;IAK/C,4CAA4C;IAC5C,IAAI,IAAI,IAAI,QAAQ,GAAG,IAAI,CAE1B;IAED,aAAa,IAAI,IAAI;IAgBrB,gBAAgB,IAAI,IAAI;IAUxB,IAAI,IAAI,IAAI;IAIZ;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,WAAW,GAAG;QAC/B,oBAAoB,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;QACtC,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC,GAAG,IAAI,GAAG,IAAI;IAShB;;;;;OAKG;IACH,OAAO,IAAI,IAAI;IAKf,uDAAuD;IACvD,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI;IAQjC;;;;;OAKG;IACH,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,IAAI;IAY9B,uEAAuE;IACvE,OAAO,CAAC,cAAc;IAMtB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAoBrB,OAAO,CAAC,iBAAiB,CAAkC;IAC3D,OAAO,CAAC,QAAQ,CAA6B;IAE7C;;;;OAIG;IACH,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,aAAa;IAMrB;uCACmC;IACnC,OAAO,CAAC,MAAM;IAed,OAAO,CAAC,aAAa,CAcnB;CACF"}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import '../components/actions/menu/menu.js';
|
|
2
|
+
import { focusAsLastInput } from './return-focus.js';
|
|
3
|
+
/**
|
|
4
|
+
* The "more" menu of a bar that hides what does not fit: nldd-toolbar,
|
|
5
|
+
* nldd-menu-bar and nldd-document-tab-bar. Each bar decides for itself what
|
|
6
|
+
* fits; this is the menu that lists the rest.
|
|
7
|
+
*
|
|
8
|
+
* It lives in the bar's shadow root, not in document.body. It is a popover,
|
|
9
|
+
* so the top layer gets it past any clipping anyway, and a menu in the body
|
|
10
|
+
* goes inert (visible but untouchable) when the bar sits in a modal dialog:
|
|
11
|
+
* everything outside the dialog is inert then. In the shadow root it also
|
|
12
|
+
* inherits the bar's color scheme, language and context, with nothing to carry.
|
|
13
|
+
*
|
|
14
|
+
* A `select` in the menu stays in the menu: what the bar wants the app to hear
|
|
15
|
+
* it sends on itself, from the original the entry stands for. Leaving it would
|
|
16
|
+
* reach the bar's own listeners as if one of its items had been chosen.
|
|
17
|
+
*
|
|
18
|
+
* Before an entry's action runs, focus goes to the bar's button (`handOff`).
|
|
19
|
+
* Whatever the action opens, a sheet or a dialog, remembers where focus was,
|
|
20
|
+
* and the entry is gone from view once the menu closes.
|
|
21
|
+
*/
|
|
22
|
+
export class OverflowMenu {
|
|
23
|
+
constructor(_host, _options) {
|
|
24
|
+
this._host = _host;
|
|
25
|
+
this._options = _options;
|
|
26
|
+
/** Whether the menu is open. The bar renders its button from this. */
|
|
27
|
+
this.open = false;
|
|
28
|
+
this._menu = null;
|
|
29
|
+
this._originals = new Map();
|
|
30
|
+
this._copiedAttributes = new Map();
|
|
31
|
+
this._pending = null;
|
|
32
|
+
this._handleSelect = (event) => {
|
|
33
|
+
// The menu's own listener on itself still runs: this only keeps it from
|
|
34
|
+
// going further.
|
|
35
|
+
event.stopPropagation();
|
|
36
|
+
const stamped = event.composedPath()
|
|
37
|
+
.find((node) => node instanceof Element && node.hasAttribute('data-overflow-oid'));
|
|
38
|
+
const original = stamped && this._originals.get(stamped.getAttribute('data-overflow-oid'));
|
|
39
|
+
if (!original)
|
|
40
|
+
return;
|
|
41
|
+
this.handOff();
|
|
42
|
+
original.dispatchEvent(new CustomEvent('select', {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
composed: true,
|
|
45
|
+
detail: event.detail,
|
|
46
|
+
}));
|
|
47
|
+
};
|
|
48
|
+
_host.addController(this);
|
|
49
|
+
}
|
|
50
|
+
/** The menu, while the bar is connected. */
|
|
51
|
+
get menu() {
|
|
52
|
+
return this._menu;
|
|
53
|
+
}
|
|
54
|
+
hostConnected() {
|
|
55
|
+
if (this._menu)
|
|
56
|
+
return;
|
|
57
|
+
const menu = document.createElement('nldd-menu');
|
|
58
|
+
menu.setAttribute('placement', 'bottom-end');
|
|
59
|
+
menu.id = `${this._options.id}-${OverflowMenu._counter++}`;
|
|
60
|
+
menu.addEventListener('toggle', (event) => {
|
|
61
|
+
this.open = event.newState === 'open';
|
|
62
|
+
if (!this.open)
|
|
63
|
+
this._applyPending();
|
|
64
|
+
this._host.requestUpdate();
|
|
65
|
+
this._options.onToggle?.(this.open);
|
|
66
|
+
});
|
|
67
|
+
menu.addEventListener('select', this._handleSelect);
|
|
68
|
+
this._host.renderRoot.appendChild(menu);
|
|
69
|
+
this._menu = menu;
|
|
70
|
+
}
|
|
71
|
+
hostDisconnected() {
|
|
72
|
+
this._menu?.remove();
|
|
73
|
+
this._menu = null;
|
|
74
|
+
this.open = false;
|
|
75
|
+
// The bar fills a new menu when it connects again; these point into the old one.
|
|
76
|
+
this._pending = null;
|
|
77
|
+
this._originals.clear();
|
|
78
|
+
this._copiedAttributes.clear();
|
|
79
|
+
}
|
|
80
|
+
hide() {
|
|
81
|
+
if (this.open)
|
|
82
|
+
this._menu?.hidePopover();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Make `button` the menu's invoker. The browser opens and closes it
|
|
86
|
+
* natively through popovertarget, and the menu keeps `popoverTargetAction`
|
|
87
|
+
* in step with its state ('hide' while open, 'show' while closed). The
|
|
88
|
+
* default 'toggle' becomes 'show' here, for the very first click before the
|
|
89
|
+
* menu ever toggled.
|
|
90
|
+
*/
|
|
91
|
+
anchorTo(button) {
|
|
92
|
+
if (!this._menu || !button)
|
|
93
|
+
return;
|
|
94
|
+
this._menu.anchorElement = button;
|
|
95
|
+
if ('popoverTargetElement' in button)
|
|
96
|
+
button.popoverTargetElement = this._menu;
|
|
97
|
+
if ('popoverTargetAction' in button && button.popoverTargetAction === 'toggle') {
|
|
98
|
+
button.popoverTargetAction = 'show';
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Focus to the button that opens the menu, before what an entry stands for
|
|
103
|
+
* runs. An overlay that opens from it would otherwise remember the entry,
|
|
104
|
+
* which sits in a closed menu by the time it hands focus back, and focus
|
|
105
|
+
* ended on the body (#450).
|
|
106
|
+
*/
|
|
107
|
+
handOff() {
|
|
108
|
+
const button = this._menu?.anchorElement;
|
|
109
|
+
if (button instanceof HTMLElement && button.isConnected)
|
|
110
|
+
focusAsLastInput(button);
|
|
111
|
+
}
|
|
112
|
+
/** Fill the menu with entries the bar built itself. */
|
|
113
|
+
replace(entries) {
|
|
114
|
+
this._fill(() => {
|
|
115
|
+
this._originals.clear();
|
|
116
|
+
this._copiedAttributes.clear();
|
|
117
|
+
this._menu?.replaceChildren(...entries);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Fill the menu with copies of `items`, in this order. The originals stay
|
|
122
|
+
* where the app put them, so a copy's `select`, which never reaches
|
|
123
|
+
* listeners on its original, is dispatched again on the original: every
|
|
124
|
+
* original is stamped with an id that its copy carries.
|
|
125
|
+
*/
|
|
126
|
+
mirror(items) {
|
|
127
|
+
if (this.open && this._showsCopiesOf(items)) {
|
|
128
|
+
this._updateCopies();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this._fill(() => {
|
|
132
|
+
this._originals.clear();
|
|
133
|
+
this._copiedAttributes.clear();
|
|
134
|
+
this._menu?.replaceChildren(...items.map((item) => this._clone(item)));
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
/** Whether the menu holds a copy of each of `items`, in this order. */
|
|
138
|
+
_showsCopiesOf(items) {
|
|
139
|
+
const shown = [...(this._menu?.children ?? [])].map((copy) => copy.getAttribute('data-overflow-oid'));
|
|
140
|
+
return shown.length === items.length
|
|
141
|
+
&& items.every((item, i) => item.getAttribute('data-overflow-oid') === shown[i] && shown[i] !== null);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Carry what changed on the originals over to their copies, in place: a
|
|
145
|
+
* choice that checks an item shows its check mark while it blinks. Only the
|
|
146
|
+
* attributes the original has or had: the menu writes its own on an entry.
|
|
147
|
+
* The text of an element without children of its own, such as a label.
|
|
148
|
+
*/
|
|
149
|
+
_updateCopies() {
|
|
150
|
+
for (const copy of this._menu?.querySelectorAll('[data-overflow-oid]') ?? []) {
|
|
151
|
+
const oid = copy.getAttribute('data-overflow-oid');
|
|
152
|
+
const original = this._originals.get(oid);
|
|
153
|
+
if (!original)
|
|
154
|
+
continue;
|
|
155
|
+
const names = new Set(original.getAttributeNames().filter((name) => name !== 'slot'));
|
|
156
|
+
for (const name of this._copiedAttributes.get(oid) ?? []) {
|
|
157
|
+
if (!names.has(name))
|
|
158
|
+
copy.removeAttribute(name);
|
|
159
|
+
}
|
|
160
|
+
for (const name of names) {
|
|
161
|
+
const value = original.getAttribute(name);
|
|
162
|
+
if (copy.getAttribute(name) !== value)
|
|
163
|
+
copy.setAttribute(name, value);
|
|
164
|
+
}
|
|
165
|
+
this._copiedAttributes.set(oid, names);
|
|
166
|
+
if (original.childElementCount === 0 && copy.textContent !== original.textContent) {
|
|
167
|
+
copy.textContent = original.textContent;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Refill now, or once the menu has closed. New entries while it is open
|
|
173
|
+
* would cut the blink of a chosen one short and skip the menu's divider
|
|
174
|
+
* pass. The entries are made from the originals as they are by then.
|
|
175
|
+
*/
|
|
176
|
+
_fill(apply) {
|
|
177
|
+
if (!this._menu)
|
|
178
|
+
return;
|
|
179
|
+
if (this.open) {
|
|
180
|
+
this._pending = apply;
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
this._pending = null;
|
|
184
|
+
apply();
|
|
185
|
+
}
|
|
186
|
+
_applyPending() {
|
|
187
|
+
const apply = this._pending;
|
|
188
|
+
this._pending = null;
|
|
189
|
+
apply?.();
|
|
190
|
+
}
|
|
191
|
+
/** `data-overflow-oid` is outside the attributes a bar watches, so
|
|
192
|
+
* stamping starts no new sync. */
|
|
193
|
+
_clone(original) {
|
|
194
|
+
for (const node of [original, ...original.querySelectorAll('*')]) {
|
|
195
|
+
let oid = node.getAttribute('data-overflow-oid');
|
|
196
|
+
if (!oid) {
|
|
197
|
+
oid = `oid-${OverflowMenu._counter++}`;
|
|
198
|
+
node.setAttribute('data-overflow-oid', oid);
|
|
199
|
+
}
|
|
200
|
+
this._originals.set(oid, node);
|
|
201
|
+
this._copiedAttributes.set(oid, new Set(node.getAttributeNames().filter((name) => name !== 'slot')));
|
|
202
|
+
}
|
|
203
|
+
const clone = original.cloneNode(true);
|
|
204
|
+
clone.removeAttribute('slot');
|
|
205
|
+
return clone;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
OverflowMenu._counter = 0;
|
|
209
|
+
//# sourceMappingURL=overflow-menu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overflow-menu.js","sourceRoot":"","sources":["../../src/utilities/overflow-menu.ts"],"names":[],"mappings":"AAEA,OAAO,oCAAoC,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAcrD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,YAAY;IASxB,YACkB,KAAuB,EACvB,QAA6B;QAD7B,UAAK,GAAL,KAAK,CAAkB;QACvB,aAAQ,GAAR,QAAQ,CAAqB;QAR/C,sEAAsE;QACtE,SAAI,GAAG,KAAK,CAAC;QAEL,UAAK,GAAoB,IAAI,CAAC;QAC9B,eAAU,GAAG,IAAI,GAAG,EAAmB,CAAC;QAsIxC,sBAAiB,GAAG,IAAI,GAAG,EAAuB,CAAC;QACnD,aAAQ,GAAwB,IAAI,CAAC;QAwCrC,kBAAa,GAAG,CAAC,KAAY,EAAQ,EAAE;YAC9C,wEAAwE;YACxE,iBAAiB;YACjB,KAAK,CAAC,eAAe,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,EAAE;iBAClC,IAA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AS,CAAC,IAAI,CAAY,CAAC;QAClD,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC9B,OAAO,KAAK,CAAC;IACd,CAAC;;AAnLc,qBAAQ,GAAG,CAAC,AAAJ,CAAK"}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one place that knows how a control opens an overlay (`nldd-menu`,
|
|
3
|
+
* `nldd-popover`): which overlay it is, where it stands, and how a press turns
|
|
4
|
+
* into open or close.
|
|
5
|
+
*
|
|
6
|
+
* The delicate part is the pointerdown. The browser light-dismisses an open
|
|
7
|
+
* auto popover on pointerdown, before the click lands, so a click handler that
|
|
8
|
+
* only sees "the overlay is closed" opens again what the same gesture just
|
|
9
|
+
* closed (the "flashes closed then reopens" bug). The invoker takes a snapshot
|
|
10
|
+
* on pointerdown, and the click reads it. A manual popover (the bottom sheet of
|
|
11
|
+
* nldd-popover on a small screen) is not dismissed by the press, so there the
|
|
12
|
+
* click closes it.
|
|
13
|
+
*
|
|
14
|
+
* Every control that opens an overlay goes through here: a button with an
|
|
15
|
+
* overlay in its `popup` slot, a term, a token, a menu bar item, the picker
|
|
16
|
+
* button of a combo box. What differs between them is configuration: where the
|
|
17
|
+
* overlay comes from, what it anchors to, and, for a control that does more
|
|
18
|
+
* than open and close, its own open and close.
|
|
19
|
+
*/
|
|
20
|
+
/** What an overlay tells its invoker. `nldd-menu` and `nldd-popover` both
|
|
21
|
+
* implement it; another popover element is opened with the Popover API. */
|
|
22
|
+
export interface InvokableOverlay extends HTMLElement {
|
|
23
|
+
anchorElement: Element | null;
|
|
24
|
+
/** Whether the overlay is open for its invoker. A drill-in menu counts as
|
|
25
|
+
* open while one of its submenus shows and the root itself is hidden. */
|
|
26
|
+
invokerIsOpen?(): boolean;
|
|
27
|
+
/** Opens it as its invoker would: with its own animation and focus. */
|
|
28
|
+
invokerOpen?(): void;
|
|
29
|
+
/** Closes it as its invoker would, including any submenus. */
|
|
30
|
+
invokerClose?(): void;
|
|
31
|
+
/** Whether a press on the trigger opens it again rather than closing it,
|
|
32
|
+
* as for a menu still confirming a choice. */
|
|
33
|
+
invokerPressReopens?(): boolean;
|
|
34
|
+
/** The invoker has handled its click: forget a gesture marker kept for it. */
|
|
35
|
+
invokerGestureEnd?(): void;
|
|
36
|
+
}
|
|
37
|
+
export interface OverlayInvokerOptions {
|
|
38
|
+
/** Element the overlay positions against; defaults to the host. A callback,
|
|
39
|
+
* so a target that only resolves after the first render still works: call
|
|
40
|
+
* `anchor()` once it exists. Return null to leave positioning alone. */
|
|
41
|
+
anchorFor?: () => Element | null;
|
|
42
|
+
/** Runs after the overlay is swapped, for behavior layered on top. */
|
|
43
|
+
onChange?: (overlay: InvokableOverlay | null, previous: InvokableOverlay | null) => void;
|
|
44
|
+
/** Whether the overlay is open for this control. Defaults to whether it is
|
|
45
|
+
* open at all; a control that shares its overlay with others (a term)
|
|
46
|
+
* counts it open only while it stands at this control. */
|
|
47
|
+
isOpen?: (overlay: InvokableOverlay) => boolean;
|
|
48
|
+
/** Opens the overlay, for a control that does more on open (a combo box
|
|
49
|
+
* filters its list first). Defaults to the overlay's own open. */
|
|
50
|
+
open?: (overlay: InvokableOverlay) => void;
|
|
51
|
+
/** Closes the overlay. Defaults to the overlay's own close. */
|
|
52
|
+
close?: (overlay: InvokableOverlay) => void;
|
|
53
|
+
}
|
|
54
|
+
export declare function isOverlayOpen(overlay: InvokableOverlay): boolean;
|
|
55
|
+
export declare class OverlayInvoker {
|
|
56
|
+
private _anchorFor;
|
|
57
|
+
private _options;
|
|
58
|
+
private _overlay;
|
|
59
|
+
private _wasOpenOnPointerdown;
|
|
60
|
+
constructor(host: HTMLElement, options?: OverlayInvokerOptions);
|
|
61
|
+
/** The overlay this control opens, or null. */
|
|
62
|
+
get overlay(): InvokableOverlay | null;
|
|
63
|
+
/** Whether the overlay is open for this control. */
|
|
64
|
+
get isOpen(): boolean;
|
|
65
|
+
private _isOpenFor;
|
|
66
|
+
/** Bind to a slot's `slotchange`: adopts the first `nldd-menu` or
|
|
67
|
+
* `nldd-popover` in it. Flattened, so a component can forward its own slot
|
|
68
|
+
* into this one (nldd-split-button hands its popup to the chevron). */
|
|
69
|
+
handleSlotChange: (event: Event) => void;
|
|
70
|
+
/** Adopt an overlay (or none). Lets go of the previous one first: left
|
|
71
|
+
* anchored, a removed overlay keeps positioning against this control and
|
|
72
|
+
* writing its state onto it, and the pair can never be collected. */
|
|
73
|
+
setOverlay(overlay: InvokableOverlay | null): void;
|
|
74
|
+
/** (Re-)anchor the overlay. Call once the anchor target exists when it
|
|
75
|
+
* resolves later than the overlay. */
|
|
76
|
+
anchor(): void;
|
|
77
|
+
/** Bind to the trigger's `pointerdown`. Covers mouse, touch and pen. A press
|
|
78
|
+
* inside the overlay is not a press on the trigger, even where the overlay
|
|
79
|
+
* sits inside it (a menu in a menu bar item). */
|
|
80
|
+
handlePointerdown: (event?: Event) => void;
|
|
81
|
+
/**
|
|
82
|
+
* Call from the trigger's click handler: opens the overlay, or closes it.
|
|
83
|
+
* Returns true when there is an overlay, so the click is spent: a popup
|
|
84
|
+
* control neither submits a form nor navigates.
|
|
85
|
+
*
|
|
86
|
+
* Only a pointer-driven click (detail > 0) has a pointerdown before it. A
|
|
87
|
+
* keyboard click ignores the snapshot, which could be left over from a
|
|
88
|
+
* gesture that ended without a click (a drag off the control, a scroll).
|
|
89
|
+
*/
|
|
90
|
+
handleClick(event: MouseEvent): boolean;
|
|
91
|
+
/** Opens the overlay, unless it is open already. */
|
|
92
|
+
open(): void;
|
|
93
|
+
/** Closes the overlay, unless it is closed already. */
|
|
94
|
+
close(): void;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Whether `trigger` opens `overlay` as a native popover invoker
|
|
98
|
+
* (`popovertarget` or `popoverTargetElement`). The browser then toggles it as
|
|
99
|
+
* the click's default action, and no script should toggle it again.
|
|
100
|
+
*/
|
|
101
|
+
export declare function invokesNatively(trigger: Element, overlay: Element): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Makes an element outside any design-system control the invoker of
|
|
104
|
+
* `overlay`: a plain `<button>` that an overlay names with `anchor="id"`.
|
|
105
|
+
* Listens on the document, so the element may come and go, and calls the
|
|
106
|
+
* invoker for presses that land on it and not in the overlay. A trigger that
|
|
107
|
+
* is a native invoker of the overlay is left to the browser.
|
|
108
|
+
*
|
|
109
|
+
* Returns the function that stops listening.
|
|
110
|
+
*/
|
|
111
|
+
export declare function watchTrigger(invoker: OverlayInvoker, trigger: () => Element | null): () => void;
|
|
112
|
+
export interface TriggerState {
|
|
113
|
+
open: boolean;
|
|
114
|
+
/** The `aria-haspopup` the overlay asks for: 'menu', 'listbox', 'dialog',
|
|
115
|
+
* or '' for a disclosure that promises no popup. */
|
|
116
|
+
popupType: string;
|
|
117
|
+
/** The overlay's id, for `aria-controls`. */
|
|
118
|
+
controls?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface TriggerAriaOptions {
|
|
121
|
+
/** Write ARIA attributes on a trigger that has no properties for it (a
|
|
122
|
+
* plain element). Off for a menu: a combo box field anchors its listbox and
|
|
123
|
+
* carries its own combobox ARIA. */
|
|
124
|
+
attributes: boolean;
|
|
125
|
+
/** Point a native invoker's `popoverTargetAction` explicitly at what a
|
|
126
|
+
* click should do. `toggle` re-reads the state at click time and would
|
|
127
|
+
* reopen a menu light-dismissed a moment before. */
|
|
128
|
+
popoverTargetAction?: boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Writes an overlay's state onto the element it hangs off: expanded, the
|
|
132
|
+
* popup type and the link to the overlay. The overlay says what it is and
|
|
133
|
+
* whether it is open; this decides how a trigger shows that.
|
|
134
|
+
*
|
|
135
|
+
* `aria-haspopup` is set from the first sync, not from the first open: it is
|
|
136
|
+
* a static property of the trigger ("this button opens a menu"), and a screen
|
|
137
|
+
* reader user tabbing a row of identical buttons needs it before anything was
|
|
138
|
+
* opened. A popup type the consumer chose is left alone; one this wrote follows
|
|
139
|
+
* the overlay when it changes.
|
|
140
|
+
*/
|
|
141
|
+
export declare class TriggerAria {
|
|
142
|
+
private readonly _options;
|
|
143
|
+
private _trigger;
|
|
144
|
+
private _seededPopupType;
|
|
145
|
+
/** The `aria-haspopup` this wrote on a plain trigger, so it takes back only its own. */
|
|
146
|
+
private _seededHasPopup;
|
|
147
|
+
constructor(_options: TriggerAriaOptions);
|
|
148
|
+
sync(trigger: Element | null, state: TriggerState): void;
|
|
149
|
+
/**
|
|
150
|
+
* Takes everything off the trigger, for an overlay that leaves the page. In
|
|
151
|
+
* a single-page app the overlay can go while its trigger stays, and an
|
|
152
|
+
* `aria-controls` pointing at an element that no longer exists fails WCAG
|
|
153
|
+
* 4.1.2. A control that keeps its expanded state is reset too, or it stays
|
|
154
|
+
* stuck in its expanded look.
|
|
155
|
+
*/
|
|
156
|
+
clear(trigger: Element | null, controls: string | undefined): void;
|
|
157
|
+
/** Takes the state off a trigger the overlay leaves, so it does not linger
|
|
158
|
+
* as a toggle for a screen reader, nor in its expanded look. */
|
|
159
|
+
private _release;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The popover a component's inner button invokes, from `popovertarget` or
|
|
163
|
+
* `popoverTargetElement` on the host.
|
|
164
|
+
*
|
|
165
|
+
* An id written on the inner button is looked up in the component's own
|
|
166
|
+
* shadow root, where the popover never is, so the button opened nothing. The
|
|
167
|
+
* id is looked up here in the tree of the host instead, and the inner button
|
|
168
|
+
* gets the element. The element wins when both are set.
|
|
169
|
+
*
|
|
170
|
+
* Look it up again on click: a popover rendered after the button is not there
|
|
171
|
+
* yet on the button's first render.
|
|
172
|
+
*/
|
|
173
|
+
export declare function popoverTargetOf(host: Element, id: string | undefined, element: Element | null): Element | null;
|
|
174
|
+
/**
|
|
175
|
+
* Positions an `nldd-menu` or `nldd-popover` that `popovertarget` points at
|
|
176
|
+
* against the control that opens it, so the overlay needs no `anchor` of its
|
|
177
|
+
* own. The browser already opens and closes it; this adds where it stands and
|
|
178
|
+
* the ARIA link back to the control, as a slotted overlay gets.
|
|
179
|
+
*
|
|
180
|
+
* An overlay with an `anchor` id, or anchored to another element, is
|
|
181
|
+
* left alone: someone chose where it goes. Pass `null` to let go, as on
|
|
182
|
+
* disconnect or when `popovertarget` changes.
|
|
183
|
+
*/
|
|
184
|
+
export declare function anchorPopoverTarget(host: Element, target: Element | null): void;
|
|
185
|
+
//# sourceMappingURL=overlay-invoker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"overlay-invoker.d.ts","sourceRoot":"","sources":["../../src/utilities/overlay-invoker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;4EAC4E;AAC5E,MAAM,WAAW,gBAAiB,SAAQ,WAAW;IACpD,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B;8EAC0E;IAC1E,aAAa,CAAC,IAAI,OAAO,CAAC;IAC1B,uEAAuE;IACvE,WAAW,CAAC,IAAI,IAAI,CAAC;IACrB,8DAA8D;IAC9D,YAAY,CAAC,IAAI,IAAI,CAAC;IACtB;mDAC+C;IAC/C,mBAAmB,CAAC,IAAI,OAAO,CAAC;IAChC,8EAA8E;IAC9E,iBAAiB,CAAC,IAAI,IAAI,CAAC;CAC3B;AAID,MAAM,WAAW,qBAAqB;IACrC;;6EAEyE;IACzE,SAAS,CAAC,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IACjC,sEAAsE;IACtE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,KAAK,IAAI,CAAC;IACzF;;+DAE2D;IAC3D,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,OAAO,CAAC;IAChD;uEACmE;IACnE,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAC3C,+DAA+D;IAC/D,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,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