@nldd/design-system 0.26.5 → 0.27.1
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 +460 -37
- package/dist/cdn/autoloader.js +141 -141
- package/dist/cdn/chunks/{accordion-item-BXEHwzcv.js → accordion-item-Db9LW8AG.js} +4 -4
- package/dist/cdn/chunks/{accordion-qXirmNBj.js → accordion-tLICRUFs.js} +4 -4
- package/dist/cdn/chunks/{activity-indicator-DP61AhsJ.js → activity-indicator-CMNIikEV.js} +5 -5
- package/dist/cdn/chunks/{admonition-RnRSNAri.js → admonition-DEXVkTJm.js} +4 -4
- package/dist/cdn/chunks/after-parse-BSKUm67Q.js +9 -0
- package/dist/cdn/chunks/{avatar-group-BrfrpXvd.js → avatar-group-DMU0HLBL.js} +71 -49
- package/dist/cdn/chunks/{avatar-DsexiOhH.js → avatar-nLrlfh4s.js} +75 -41
- package/dist/cdn/chunks/{badge-BiQFOq2l.js → badge-D1XadmOE.js} +5 -5
- package/dist/cdn/chunks/{banner-42zIYAEN.js → banner-B4kFQlHx.js} +7 -7
- package/dist/cdn/chunks/{bar-split-view-CjYEp276.js → bar-split-view-DtD4zmoP.js} +28 -21
- package/dist/cdn/chunks/{blockquote-qf4hJYvm.js → blockquote-DbFjwox8.js} +3 -3
- package/dist/cdn/chunks/{box-CWyg7sbR.js → box-BlwaDicI.js} +3 -3
- package/dist/cdn/chunks/{breadcrumbs-BaHjYdz8.js → breadcrumbs-DJS9-8wX.js} +5 -5
- package/dist/cdn/chunks/{button-CKV-jwGY.js → button-BK8CmshL.js} +8 -8
- package/dist/cdn/chunks/{button-bar-DeJ81759.js → button-bar-5RtXjgGl.js} +3 -3
- package/dist/cdn/chunks/{button-group-CuRkiHR5.js → button-group-BYMkQNhT.js} +2 -2
- package/dist/cdn/chunks/{card-DxeUNE3V.js → card-NNl0PxBY.js} +4 -4
- package/dist/cdn/chunks/{cell-QaG8b-Qk.js → cell-D2NzCBVZ.js} +6 -6
- package/dist/cdn/chunks/{checkbox-V0YerUKf.js → checkbox-CXFA_up4.js} +5 -5
- package/dist/cdn/chunks/{checkbox-field-DeySECgv.js → checkbox-field-sFs7GvAq.js} +7 -7
- package/dist/cdn/chunks/{checkbox-group-DFNy1y-A.js → checkbox-group-BPN4eRCX.js} +3 -3
- package/dist/cdn/chunks/{class-map-CmgI2Tu-.js → class-map-1XjgYGeg.js} +1 -1
- package/dist/cdn/chunks/{code-editor-BBMbUJ4d.js → code-editor-KZEaMAN7.js} +5 -5
- package/dist/cdn/chunks/{code-viewer-B8jse0-5.js → code-viewer-CJwpLKb1.js} +94 -87
- package/dist/cdn/chunks/{codemirror-input-BEotDTtZ.js → codemirror-input-CYBNNf0-.js} +5 -5
- package/dist/cdn/chunks/{collection-DRoS7Ona.js → collection-BdUB8qeL.js} +61 -42
- package/dist/cdn/chunks/{combo-box-DA1ZQJJS.js → combo-box-DxWW-zeE.js} +20 -14
- package/dist/cdn/chunks/{container-F1i2pmko.js → container-Dhf1Ahi8.js} +14 -10
- package/dist/cdn/chunks/{custom-element-DD4ffKRs.js → custom-element-DtLjpays.js} +1 -1
- package/dist/cdn/chunks/{date-field-DVgisQnm.js → date-field-D83r9gjY.js} +12 -12
- package/dist/cdn/chunks/{date-picker-BaDTota3.js → date-picker-D8qv2iuG.js} +21 -15
- package/dist/cdn/chunks/{decorate-CeGXihRM.js → decorate-BhnGmemK.js} +1 -1
- package/dist/cdn/chunks/{described-by-mixin-qFatR9dF.js → described-by-mixin-Jh_PTTde.js} +2 -2
- package/dist/cdn/chunks/{description-cell-D45N4P1X.js → description-cell-nQKMluy8.js} +6 -6
- package/dist/cdn/chunks/{dev-checks-CkCD0tPh.js → dev-checks-Bet7bhMS.js} +99 -49
- package/dist/cdn/chunks/{directive-helpers-B9pcQxsE.js → directive-helpers-dLE2M1R1.js} +1 -1
- package/dist/cdn/chunks/{dist-n8aCu6Kg.js → dist-BTuJ-NyU.js} +2 -2
- package/dist/cdn/chunks/{dist-BS_pQgb6.js → dist-BbwC3zHR.js} +2 -2
- package/dist/cdn/chunks/{dist-Dsyc1RGG.js → dist-BpqJqkl_.js} +1 -1
- package/dist/cdn/chunks/{dist-mxb0NzAU.js → dist-C9xmfEc_.js} +1 -1
- package/dist/cdn/chunks/{dist-v7yvd26H.js → dist-CYKK2xXE.js} +3 -3
- package/dist/cdn/chunks/{dist-rjQNj-KZ.js → dist-Cdmhq-4P.js} +2 -2
- package/dist/cdn/chunks/{dist-v62GtoI6.js → dist-DJSiRJRL.js} +1 -1
- package/dist/cdn/chunks/{dist-Cl-rXzh7.js → dist-DwevYbXo.js} +1 -1
- package/dist/cdn/chunks/{dist-DjlGttcc.js → dist-Dzlvec4O.js} +1 -1
- package/dist/cdn/chunks/{dist-jTL_Kil1.js → dist-EP5KATv0.js} +1 -1
- package/dist/cdn/chunks/{dist-DJQUgOKW.js → dist-u6MS5-M8.js} +3 -3
- package/dist/cdn/chunks/{divider-CtMx3Byp.js → divider-DjT76fuO.js} +2 -2
- package/dist/cdn/chunks/{document-tab-bar-SKSf69FX.js → document-tab-bar-CO2M1bFc.js} +95 -56
- package/dist/cdn/chunks/{dropdown-se1zjYlw.js → dropdown-CdQ1beF2.js} +5 -5
- package/dist/cdn/chunks/{file-field-DW_Xt5O3.js → file-field-D0UlnM9R.js} +14 -14
- package/dist/cdn/chunks/{form-C9-eW3zc.js → form-BV9wifov.js} +1 -1
- package/dist/cdn/chunks/{form-actions-Cy5tH1nk.js → form-actions-DDeF8urg.js} +2 -2
- package/dist/cdn/chunks/{form-associated-mixin-CA0F9CPx.js → form-associated-mixin-Cm1N24gR.js} +2 -2
- package/dist/cdn/chunks/{form-field-BMWm8VGS.js → form-field-IeKadcwe.js} +6 -6
- package/dist/cdn/chunks/{form-section-DrrXc4wZ.js → form-section-C350G5wg.js} +1 -1
- package/dist/cdn/chunks/frame-pass-C0RUoFMc.js +17 -0
- package/dist/cdn/chunks/{full-bleed-section-6QL0av4x.js → full-bleed-section-CR3zsX7K.js} +9 -10
- package/dist/cdn/chunks/{hero-BThWV3MR.js → hero-Ch5el5J5.js} +73 -68
- package/dist/cdn/chunks/{icon-CVM6X_F1.js → icon-Dj98ov4G.js} +2 -2
- package/dist/cdn/chunks/{icon-button-h_sEz0Ia.js → icon-button-HKoCqWG3.js} +9 -9
- package/dist/cdn/chunks/{icon-cell-C3Ygercd.js → icon-cell-C1I-oIWn.js} +5 -5
- package/dist/cdn/chunks/{identity-BR0KxjM5.js → identity-DNkEDJ8m.js} +6 -6
- package/dist/cdn/chunks/{if-defined-CvQli6P0.js → if-defined-CZ1Fmb74.js} +1 -1
- package/dist/cdn/chunks/{image-D8H73DIj.js → image-KXTd-hL-.js} +8 -8
- package/dist/cdn/chunks/{inline-dialog-Dlu3bneh.js → inline-dialog-BTI0xmIT.js} +6 -6
- package/dist/cdn/chunks/{just-in-time-education-DG0teV5g.js → just-in-time-education-BtjbYffu.js} +5 -5
- package/dist/cdn/chunks/{kanban-MNLyqki_.js → kanban-DNXtL34O.js} +35 -30
- package/dist/cdn/chunks/{kanban-column-CGF_4Q0N.js → kanban-column-D0ujQ2_W.js} +37 -25
- package/dist/cdn/chunks/{keyboard-shortcut-DZDtndhS.js → keyboard-shortcut-BikzmCBH.js} +3 -3
- package/dist/cdn/chunks/{languages-BCn4J5Ck.js → languages-CPd7_I8H.js} +12 -12
- package/dist/cdn/chunks/layout-pass-Cq85kSHX.js +45 -0
- package/dist/cdn/chunks/{link-CTj3dTmJ.js → link-DqMeRYFm.js} +6 -6
- package/dist/cdn/chunks/{link-group--C486tYV.js → link-group-BKn4MHA-.js} +2 -2
- package/dist/cdn/chunks/{list-DApLHKj-.js → list-C8Dnks-q.js} +48 -34
- package/dist/cdn/chunks/{list-item-BN9uuvXr.js → list-item-CSP1a_cN.js} +5 -6
- package/dist/cdn/chunks/{list-item-segment-CvdZT9Ni.js → list-item-segment-BvFqXXnA.js} +3 -3
- package/dist/cdn/chunks/{menu-2-9LtMLY.js → menu-LZ0DmVCe.js} +20 -19
- package/dist/cdn/chunks/{menu-bar-item-tOFEx-lS.js → menu-bar-item-DENdrp0m.js} +6 -6
- package/dist/cdn/chunks/{menu-bar-g-O3_TNl.js → menu-bar-rsGd3kKq.js} +62 -46
- package/dist/cdn/chunks/{menu-divider-Dmv0lMHV.js → menu-divider-BptK2nug.js} +3 -3
- package/dist/cdn/chunks/{menu-group-Ci9QUUwZ.js → menu-group-0B34NyN5.js} +4 -4
- package/dist/cdn/chunks/{menu-item-BnIbV4yo.js → menu-item-55vjckz2.js} +16 -12
- package/dist/cdn/chunks/{menu.template-sPjaMfc8.js → menu.template-B_HMnBsa.js} +105 -76
- package/dist/cdn/chunks/{modal-dialog-D-jAbabe.js → modal-dialog-DQY_0Qlk.js} +4 -4
- package/dist/cdn/chunks/{multi-line-text-field-uBZqAdr6.js → multi-line-text-field-DB4Vflno.js} +6 -6
- package/dist/cdn/chunks/{navigation-split-view-DARbBPq-.js → navigation-split-view-Dbhrxni9.js} +59 -47
- package/dist/cdn/chunks/{notification-CntIGoYh.js → notification-dtrMLORo.js} +6 -6
- package/dist/cdn/chunks/{number-field-C0MTabLP.js → number-field-Ctxk40as.js} +8 -8
- package/dist/cdn/chunks/{one-half-one-half-section-DYzf6LtU.js → one-half-one-half-section-Bx6KLSY5.js} +15 -16
- package/dist/cdn/chunks/{one-third-two-thirds-section-AAiaxCHH.js → one-third-two-thirds-section-Bql0Xrsc.js} +15 -16
- package/dist/cdn/chunks/{one-time-code-field-CCILuCy1.js → one-time-code-field-B-y5gRLi.js} +103 -64
- package/dist/cdn/chunks/{overflow-menu-DFoh3xL_.js → overflow-menu-Cs1VLcX7.js} +1 -1
- package/dist/cdn/chunks/{page-BDXLREou.js → page-Bdkit86l.js} +78 -56
- package/dist/cdn/chunks/{page-footer-BsVMZCXs.js → page-footer-D68JiIFE.js} +4 -4
- package/dist/cdn/chunks/{page-section-mixin-L0bl3wCm.js → page-section-mixin-Bmlpcmrw.js} +3 -3
- package/dist/cdn/chunks/{pagination-DLwbSZdO.js → pagination-BH6UQbby.js} +6 -6
- package/dist/cdn/chunks/{password-field-DKTJgEyb.js → password-field-Dz0znv2L.js} +8 -8
- package/dist/cdn/chunks/{popover-RB7uLASo.js → popover-C6j3sO70.js} +5 -5
- package/dist/cdn/chunks/{progress-bar-DnXWbmiw.js → progress-bar-BA_5dDXK.js} +10 -7
- package/dist/cdn/chunks/{progress-circle-S89MUtU8.js → progress-circle-DsCyTyw-.js} +10 -7
- package/dist/cdn/chunks/{radio-button-field-BF4MHiOQ.js → radio-button-field-JsQalrMs.js} +8 -7
- package/dist/cdn/chunks/{radio-button-group-BQUqV8wJ.js → radio-button-group-Bqn43LYh.js} +3 -3
- package/dist/cdn/chunks/{radio-button-B31lAjlk.js → radio-button-pcE5Vo5k.js} +92 -51
- package/dist/cdn/chunks/{render-marked-ChJNzktf.js → render-marked-DAVGoeYa.js} +1 -1
- package/dist/cdn/chunks/{reorder-handle-cell-SEERkeh7.js → reorder-handle-cell-r4OuA45S.js} +4 -4
- package/dist/cdn/chunks/{reorder-handle-mixin-tWe9XTjZ.js → reorder-handle-mixin-Co5E_Y7l.js} +2 -2
- package/dist/cdn/chunks/{repeat-CdCK17GF.js → repeat-DoLR8W_a.js} +2 -2
- package/dist/cdn/chunks/{rich-text-vVWOndD2.js → rich-text-CEmzxZRC.js} +3 -3
- package/dist/cdn/chunks/{row-header-mixin-6MoJ5Mjq.js → row-header-mixin-BCYXiXva.js} +2 -2
- package/dist/cdn/chunks/{scroll-fade-Cr7_IXpU.js → scroll-fade-OSFrYTum.js} +2 -2
- package/dist/cdn/chunks/scroll-mode-controller-Dl5hddJo.js +52 -0
- package/dist/cdn/chunks/{search-field-C9urWH_J.js → search-field-CT483s7J.js} +10 -10
- package/dist/cdn/chunks/{segmented-control-DkILAMOJ.js → segmented-control-5zMasjz7.js} +7 -7
- package/dist/cdn/chunks/{shadow-resets-9v6K-Fie.js → shadow-resets-DR73IFIL.js} +2 -2
- package/dist/cdn/chunks/{sheet-D89xI-KY.js → sheet-CDXX61d_.js} +3 -3
- package/dist/cdn/chunks/{shell-CFmfUD0_.js → shell-C4vAeA49.js} +4 -4
- package/dist/cdn/chunks/{side-by-side-split-view-ir9c0mwZ.js → side-by-side-split-view-D9_u1TIS.js} +38 -29
- package/dist/cdn/chunks/{sidebar-section-BhJXels3.js → sidebar-section-vWX-ymIa.js} +70 -48
- package/dist/cdn/chunks/{simple-section-CMoYuLYV.js → simple-section-CEw2oC7K.js} +9 -10
- package/dist/cdn/chunks/{skip-link-rUQq0D-l.js → skip-link-DcOGlfM9.js} +4 -4
- package/dist/cdn/chunks/{slider-CIQqjKUo.js → slider-B108QDlz.js} +9 -9
- package/dist/cdn/chunks/{spacer-CD85egxE.js → spacer-CpfTNtbZ.js} +2 -2
- package/dist/cdn/chunks/{spacer-cell-B33mGdru.js → spacer-cell-DBm7_AUi.js} +4 -4
- package/dist/cdn/chunks/{split-button-COL7r-wa.js → split-button-DxgDxdan.js} +7 -7
- package/dist/cdn/chunks/{split-view-divider-DVBuBzeO.js → split-view-divider-6_RDvANN.js} +2 -2
- package/dist/cdn/chunks/{split-view-pane-CSvIzeBg.js → split-view-pane-9tEGLRZC.js} +4 -4
- package/dist/cdn/chunks/{stacked-split-view-onSk2QEi.js → stacked-split-view-CRMEMwtv.js} +29 -25
- package/dist/cdn/chunks/{static-html-Cyhp44gp.js → static-html-CmXnRyP6.js} +1 -1
- package/dist/cdn/chunks/{status-bar-CjYXOQAX.js → status-bar-Blk_iYSD.js} +29 -17
- package/dist/cdn/chunks/{step-bar-D-To0TEw.js → step-bar-DM4a_0PG.js} +5 -5
- package/dist/cdn/chunks/{step-cell-B7sVGixc.js → step-cell-CUs8AKJq.js} +5 -5
- package/dist/cdn/chunks/{stepper-h6boMOhz.js → stepper-JwxPNJRc.js} +7 -7
- package/dist/cdn/chunks/{style-map-BrdTV34-.js → style-map-DUDIMhuW.js} +1 -1
- package/dist/cdn/chunks/{swatch-picker-gQ3m3y9U.js → swatch-picker-BXs7Ob4o.js} +6 -6
- package/dist/cdn/chunks/{switch-DC-BTi9E.js → switch-CWKoOyz7.js} +5 -5
- package/dist/cdn/chunks/{switch-field-D82mLobj.js → switch-field-BgX9mNOA.js} +6 -6
- package/dist/cdn/chunks/{tab-bar-sKiFzvfj.js → tab-bar-BNaJSB38.js} +85 -49
- package/dist/cdn/chunks/{table-CuxZfCZD.js → table-dgJdHR92.js} +111 -54
- package/dist/cdn/chunks/{tag-DP_ome5l.js → tag-DHHf_gxq.js} +4 -4
- package/dist/cdn/chunks/{term-BdiTV-Jk.js → term-DNLqQErM.js} +12 -12
- package/dist/cdn/chunks/{text-C-b1ygHI.js → text-CK1-qJ6d.js} +3 -3
- package/dist/cdn/chunks/{text-cell-DfRh7JqZ.js → text-cell-CrKBqL5A.js} +8 -8
- package/dist/cdn/chunks/{text-editor-DuT9Rrpv.js → text-editor-B0A2vNpD.js} +191 -191
- package/dist/cdn/chunks/{text-field-kAbXzkUj.js → text-field-CqYxSiKy.js} +6 -6
- package/dist/cdn/chunks/{time-field-DUz9ifmn.js → time-field-DHm6KQsG.js} +14 -14
- package/dist/cdn/chunks/{time-picker-DGOKwC9T.js → time-picker-C_BE5oNq.js} +170 -99
- package/dist/cdn/chunks/{title-BA-SUyAq.js → title-BpREzeX9.js} +4 -4
- package/dist/cdn/chunks/{title-cell-Cu5NFNUu.js → title-cell-C4ZL3mJo.js} +8 -8
- package/dist/cdn/chunks/{toggle-button-J6UapeqB.js → toggle-button-COQdr-hZ.js} +8 -8
- package/dist/cdn/chunks/{toggle-button-group-wrps-tL9.js → toggle-button-group-D4vTcGce.js} +2 -2
- package/dist/cdn/chunks/{token-DJkyJz-k.js → token-1DfHVSVj.js} +5 -5
- package/dist/cdn/chunks/{token-field-SiBFPD8-.js → token-field-s_mCjtcZ.js} +12 -12
- package/dist/cdn/chunks/toolbar-Bz_8d1v-.js +441 -0
- package/dist/cdn/chunks/{toolbar-item-DPizdgYi.js → toolbar-item-B-EDYaPf.js} +3 -3
- package/dist/cdn/chunks/{toolbar-title-CB4IJFGv.js → toolbar-title-Cl8VPHYK.js} +4 -4
- package/dist/cdn/chunks/{toolbar.styles-vmMPyzS_.js → toolbar.styles-BiT7JPsr.js} +3 -3
- package/dist/cdn/chunks/{tooltip-Bg2ovCCg.js → tooltip-DhPeqDvL.js} +4 -4
- package/dist/cdn/chunks/{top-navigation-bar-vA8wpJXS.js → top-navigation-bar-CHWqoNms.js} +121 -104
- package/dist/cdn/chunks/{top-title-bar-BAJGmgnj.js → top-title-bar-DUp0bSIU.js} +43 -30
- package/dist/cdn/chunks/{translations-Cjd13Xb6.js → translations-C6WKR-hE.js} +1 -1
- package/dist/cdn/chunks/{two-thirds-one-third-section-D1FvorKO.js → two-thirds-one-third-section-CftZqodu.js} +15 -16
- package/dist/cdn/chunks/{validation-list-D3rKnfTu.js → validation-list-BdTSfsD6.js} +3 -3
- package/dist/cdn/chunks/{visibility-mixin-BRMACV1l.js → visibility-mixin-DL737l0g.js} +2 -2
- package/dist/cdn/chunks/{visually-hidden-BukWRiJA.js → visually-hidden-DvU3wAD4.js} +2 -2
- package/dist/cdn/chunks/{window-C9njVzzK.js → window-7XYqha2V.js} +4 -4
- package/dist/cdn/chunks/{with-translations-BLzHPSUF.js → with-translations-nT8q6ELU.js} +3 -3
- package/dist/components/actions/menu/menu-item.d.ts +11 -0
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +28 -13
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.d.ts +6 -0
- package/dist/components/actions/menu/menu.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.js +14 -4
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.styles.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.styles.js +63 -3
- package/dist/components/actions/menu/menu.styles.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +18 -47
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.d.ts +56 -16
- package/dist/components/actions/toolbar/toolbar.d.ts.map +1 -1
- package/dist/components/actions/toolbar/toolbar.js +263 -95
- package/dist/components/actions/toolbar/toolbar.js.map +1 -1
- package/dist/components/actions/toolbar/toolbar.steps.d.ts +16 -0
- package/dist/components/actions/toolbar/toolbar.steps.d.ts.map +1 -0
- package/dist/components/actions/toolbar/toolbar.steps.js +33 -0
- package/dist/components/actions/toolbar/toolbar.steps.js.map +1 -0
- package/dist/components/content/avatar/avatar.d.ts +22 -10
- package/dist/components/content/avatar/avatar.d.ts.map +1 -1
- package/dist/components/content/avatar/avatar.js +122 -29
- package/dist/components/content/avatar/avatar.js.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.d.ts +25 -10
- package/dist/components/content/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/components/content/avatar-group/avatar-group.js +97 -26
- 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 +5 -4
- package/dist/components/content/avatar-group/avatar-group.template.js.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.d.ts +4 -2
- package/dist/components/content/code-viewer/code-viewer.d.ts.map +1 -1
- package/dist/components/content/code-viewer/code-viewer.js +35 -32
- package/dist/components/content/code-viewer/code-viewer.js.map +1 -1
- package/dist/components/content/image/image.d.ts +1 -4
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +1 -4
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/tooltip/tooltip.d.ts +1 -4
- package/dist/components/content/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/content/tooltip/tooltip.js +1 -4
- 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 -0
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.d.ts +8 -0
- package/dist/components/inputs/combo-box/combo-box.d.ts.map +1 -1
- package/dist/components/inputs/combo-box/combo-box.js +28 -9
- package/dist/components/inputs/combo-box/combo-box.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.d.ts +11 -0
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.js +23 -0
- package/dist/components/inputs/date-picker/date-picker.js.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-picker.template.js +4 -2
- package/dist/components/inputs/date-picker/date-picker.template.js.map +1 -1
- package/dist/components/inputs/file-field/file-field.d.ts.map +1 -1
- package/dist/components/inputs/file-field/file-field.js +6 -1
- package/dist/components/inputs/file-field/file-field.js.map +1 -1
- package/dist/components/inputs/one-time-code-field/one-time-code-field.d.ts +27 -5
- 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 +128 -30
- package/dist/components/inputs/one-time-code-field/one-time-code-field.js.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.d.ts.map +1 -1
- package/dist/components/inputs/radio-button/radio-button.js +5 -2
- package/dist/components/inputs/radio-button/radio-button.js.map +1 -1
- 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 +5 -2
- package/dist/components/inputs/radio-button-field/radio-button-field.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.annotations.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.js +2 -2
- package/dist/components/inputs/text-editor/text-editor.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.selection.js +1 -1
- package/dist/components/inputs/text-editor/text-editor.selection.js.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.toolbar.d.ts.map +1 -1
- package/dist/components/inputs/text-editor/text-editor.toolbar.js +18 -12
- package/dist/components/inputs/text-editor/text-editor.toolbar.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.d.ts +23 -0
- package/dist/components/inputs/time-picker/time-picker.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.js +132 -12
- package/dist/components/inputs/time-picker/time-picker.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.styles.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.styles.js +27 -6
- package/dist/components/inputs/time-picker/time-picker.styles.js.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.template.d.ts.map +1 -1
- package/dist/components/inputs/time-picker/time-picker.template.js +1 -0
- package/dist/components/inputs/time-picker/time-picker.template.js.map +1 -1
- package/dist/components/inputs/token-field/token-field.d.ts.map +1 -1
- package/dist/components/inputs/token-field/token-field.js +3 -0
- package/dist/components/inputs/token-field/token-field.js.map +1 -1
- package/dist/components/layout/collection/collection.d.ts +9 -1
- package/dist/components/layout/collection/collection.d.ts.map +1 -1
- package/dist/components/layout/collection/collection.js +96 -38
- package/dist/components/layout/collection/collection.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +1 -0
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +22 -16
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/kanban/kanban-column.d.ts +7 -2
- package/dist/components/layout/kanban/kanban-column.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban-column.js +49 -17
- package/dist/components/layout/kanban/kanban-column.js.map +1 -1
- package/dist/components/layout/kanban/kanban.d.ts +4 -1
- package/dist/components/layout/kanban/kanban.d.ts.map +1 -1
- package/dist/components/layout/kanban/kanban.js +25 -7
- package/dist/components/layout/kanban/kanban.js.map +1 -1
- package/dist/components/layout/kanban/kanban.template.js +1 -1
- package/dist/components/layout/kanban/kanban.template.js.map +1 -1
- package/dist/components/layout/page/page.d.ts +43 -12
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +116 -66
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/page/page.styles.js +2 -2
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts +3 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js +3 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.js.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js +6 -7
- package/dist/components/layout/page-sections/full-bleed-section/full-bleed-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js +24 -1
- package/dist/components/layout/page-sections/hero/hero-corner.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js +22 -22
- package/dist/components/layout/page-sections/hero/hero-corner.styles.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.d.ts +2 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +2 -0
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.styles.js +8 -11
- package/dist/components/layout/page-sections/hero/hero.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts +4 -2
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js +4 -2
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js +12 -13
- package/dist/components/layout/page-sections/one-half-one-half-section/one-half-one-half-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts +4 -2
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js +4 -2
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.js.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js +12 -13
- package/dist/components/layout/page-sections/one-third-two-thirds-section/one-third-two-thirds-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts +12 -9
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js +66 -21
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js +23 -17
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.d.ts.map +1 -1
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js +5 -0
- package/dist/components/layout/page-sections/sidebar-section/sidebar-section.template.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts +4 -3
- package/dist/components/layout/page-sections/simple-section/simple-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.js +4 -3
- package/dist/components/layout/page-sections/simple-section/simple-section.js.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js +6 -7
- package/dist/components/layout/page-sections/simple-section/simple-section.styles.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts +4 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js +4 -2
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.js.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.d.ts.map +1 -1
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js +12 -13
- package/dist/components/layout/page-sections/two-thirds-one-third-section/two-thirds-one-third-section.styles.js.map +1 -1
- package/dist/components/layout/shell/shell.d.ts +2 -0
- package/dist/components/layout/shell/shell.d.ts.map +1 -1
- package/dist/components/layout/shell/shell.js +2 -0
- package/dist/components/layout/shell/shell.js.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts +2 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js +30 -17
- package/dist/components/layout/split-views/bar-split-view/bar-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts +8 -3
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js +35 -20
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.js.map +1 -1
- package/dist/components/layout/split-views/navigation-split-view/navigation-split-view.styles.js +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts +6 -2
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js +30 -15
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.js.map +1 -1
- package/dist/components/layout/split-views/side-by-side-split-view/side-by-side-split-view.styles.js +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts +6 -3
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.d.ts.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js +28 -16
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.js.map +1 -1
- package/dist/components/layout/split-views/stacked-split-view/stacked-split-view.styles.js +1 -1
- package/dist/components/lists-and-tables/list/list.d.ts +19 -0
- package/dist/components/lists-and-tables/list/list.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.js +47 -15
- package/dist/components/lists-and-tables/list/list.js.map +1 -1
- package/dist/components/lists-and-tables/list/list.roving.d.ts +2 -1
- package/dist/components/lists-and-tables/list/list.roving.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list/list.roving.js +7 -3
- package/dist/components/lists-and-tables/list/list.roving.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js +0 -1
- package/dist/components/lists-and-tables/list-item/list-item.styles.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.d.ts +34 -6
- package/dist/components/lists-and-tables/table/table.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.js +143 -40
- package/dist/components/lists-and-tables/table/table.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.styles.js +13 -0
- package/dist/components/lists-and-tables/table/table.styles.js.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.d.ts.map +1 -1
- package/dist/components/lists-and-tables/table/table.template.js +6 -0
- package/dist/components/lists-and-tables/table/table.template.js.map +1 -1
- package/dist/components/navigation/document-tab-bar/document-tab-bar.d.ts +33 -2
- 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 +136 -38
- package/dist/components/navigation/document-tab-bar/document-tab-bar.js.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.d.ts +21 -3
- package/dist/components/navigation/menu-bar/menu-bar.d.ts.map +1 -1
- package/dist/components/navigation/menu-bar/menu-bar.js +61 -29
- package/dist/components/navigation/menu-bar/menu-bar.js.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.d.ts +26 -4
- package/dist/components/navigation/tab-bar/tab-bar.d.ts.map +1 -1
- package/dist/components/navigation/tab-bar/tab-bar.js +99 -24
- 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 +1 -0
- package/dist/components/navigation/tab-bar/tab-bar.template.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts +23 -14
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js +126 -83
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.js.map +1 -1
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js +28 -28
- package/dist/components/navigation/top-navigation-bar/top-navigation-bar.styles.js.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts +5 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.d.ts.map +1 -1
- package/dist/components/navigation/top-title-bar/top-title-bar.js +36 -13
- package/dist/components/navigation/top-title-bar/top-title-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts +1 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js +6 -0
- package/dist/components/status-and-feedback/progress-bar/progress-bar.js.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts +1 -0
- package/dist/components/status-and-feedback/progress-circle/progress-circle.d.ts.map +1 -1
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js +6 -0
- package/dist/components/status-and-feedback/progress-circle/progress-circle.js.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts +0 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.d.ts.map +1 -1
- package/dist/components/status-and-feedback/status-bar/status-bar.js +26 -6
- package/dist/components/status-and-feedback/status-bar/status-bar.js.map +1 -1
- package/dist/nldd.min.js +882 -816
- package/dist/types/react.d.ts +8 -8
- package/dist/types/vue.d.ts +8 -8
- package/dist/utilities/after-parse.d.ts +30 -0
- package/dist/utilities/after-parse.d.ts.map +1 -0
- package/dist/utilities/after-parse.js +44 -0
- package/dist/utilities/after-parse.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +6 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +42 -16
- package/dist/utilities/dev-checks.js.map +1 -1
- package/dist/utilities/dev-rules.generated.d.ts.map +1 -1
- package/dist/utilities/dev-rules.generated.js +39 -2
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/frame-pass.d.ts +28 -0
- package/dist/utilities/frame-pass.d.ts.map +1 -0
- package/dist/utilities/frame-pass.js +41 -0
- package/dist/utilities/frame-pass.js.map +1 -0
- package/dist/utilities/layout-pass.d.ts +49 -0
- package/dist/utilities/layout-pass.d.ts.map +1 -0
- package/dist/utilities/layout-pass.js +103 -0
- package/dist/utilities/layout-pass.js.map +1 -0
- package/dist/utilities/radio-grouping.d.ts +30 -4
- package/dist/utilities/radio-grouping.d.ts.map +1 -1
- package/dist/utilities/radio-grouping.js +98 -17
- package/dist/utilities/radio-grouping.js.map +1 -1
- package/dist/utilities/scroll-mode-controller.d.ts +13 -6
- package/dist/utilities/scroll-mode-controller.d.ts.map +1 -1
- package/dist/utilities/scroll-mode-controller.js +47 -21
- package/dist/utilities/scroll-mode-controller.js.map +1 -1
- package/lint/css.js +58 -26
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +29 -12
- package/lint/fix.js +103 -12
- package/lint/format.js +4 -3
- package/lint/frontends.js +153 -35
- package/lint/linter.js +174 -25
- package/lint/main.js +7 -2
- package/lint/project.js +50 -12
- package/lint/rule-compiler.js +20 -11
- package/lint/rule-data.js +8 -0
- package/lint/rule.schema.json +2 -1
- package/lint/session.js +42 -18
- package/lint/tree.js +5 -2
- package/package.json +1 -1
- package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +0 -42
- package/dist/cdn/chunks/toolbar-be8hoSAz.js +0 -364
|
@@ -44,10 +44,79 @@ import { template } from './toolbar.template.js';
|
|
|
44
44
|
import { nlddToolbarTranslations } from './toolbar.i18n.js';
|
|
45
45
|
import { translate } from '../../../utilities/translations.js';
|
|
46
46
|
import { OverflowMenu } from '../../../utilities/overflow-menu.js';
|
|
47
|
+
import { afterParse } from '../../../utilities/after-parse.js';
|
|
48
|
+
import { LayoutPass } from '../../../utilities/layout-pass.js';
|
|
49
|
+
import { runSteps } from './toolbar.steps.js';
|
|
47
50
|
import { areaWidth, fillsRowAlone, itemsOf, overflowOrder, spacerZeros, groupForOverflow, } from './toolbar.layout.js';
|
|
48
51
|
export { NLDDToolbarItem } from './toolbar-item.js';
|
|
49
52
|
export { NLDDToolbarTitle } from './toolbar-title.js';
|
|
50
53
|
export { groupForOverflow } from './toolbar.layout.js';
|
|
54
|
+
function shrinkableControlOf(item) {
|
|
55
|
+
const control = Array.from(item.children).find(el => el.getAttribute('slot') !== 'overflow');
|
|
56
|
+
return typeof control?._toolbarWidths === 'function' ? control : null;
|
|
57
|
+
}
|
|
58
|
+
/** Every toolbar that asks for a measurement in the same tick, in one pass. */
|
|
59
|
+
const measurePass = new LayoutPass(toolbars => runSteps(toolbars.filter(toolbar => toolbar.isConnected).map(toolbar => toolbar._measureSteps())));
|
|
60
|
+
/** The area widths before the first measurement, in one pass for the same reason. */
|
|
61
|
+
const areaPass = new LayoutPass(toolbars => runSteps(toolbars.filter(toolbar => toolbar.isConnected && !toolbar._hasMeasured).map(toolbar => toolbar._areaSteps())));
|
|
62
|
+
/**
|
|
63
|
+
* One ResizeObserver for every toolbar and its items. One per toolbar calls
|
|
64
|
+
* back once per toolbar, and each callback measures a layout the previous one
|
|
65
|
+
* changed; this one measures every toolbar that changed size in one pass.
|
|
66
|
+
*/
|
|
67
|
+
const toolbarOf = new WeakMap();
|
|
68
|
+
let sizeObserver = null;
|
|
69
|
+
function observeSize(target, toolbar) {
|
|
70
|
+
sizeObserver ?? (sizeObserver = new ResizeObserver(entries => {
|
|
71
|
+
const resized = new Set();
|
|
72
|
+
for (const entry of entries) {
|
|
73
|
+
const toolbar = toolbarOf.get(entry.target);
|
|
74
|
+
if (toolbar?._resized(entry))
|
|
75
|
+
resized.add(toolbar);
|
|
76
|
+
}
|
|
77
|
+
if (!resized.size)
|
|
78
|
+
return;
|
|
79
|
+
resized.forEach(toolbar => measurePass.schedule(toolbar, toolbar.ownerDocument));
|
|
80
|
+
measurePass.flush();
|
|
81
|
+
}));
|
|
82
|
+
toolbarOf.set(target, toolbar);
|
|
83
|
+
sizeObserver.observe(target);
|
|
84
|
+
}
|
|
85
|
+
/** Only while the target is still this toolbar's: an item moved to another
|
|
86
|
+
* toolbar is that one's to watch. */
|
|
87
|
+
function unobserveSize(target, toolbar) {
|
|
88
|
+
if (toolbarOf.get(target) !== toolbar)
|
|
89
|
+
return;
|
|
90
|
+
sizeObserver?.unobserve(target);
|
|
91
|
+
toolbarOf.delete(target);
|
|
92
|
+
}
|
|
93
|
+
/** The toolbars that build their children at the next task, in one timeout. */
|
|
94
|
+
const toBuild = new Set();
|
|
95
|
+
let buildTimer = null;
|
|
96
|
+
function buildSoon(toolbar) {
|
|
97
|
+
toBuild.add(toolbar);
|
|
98
|
+
buildTimer ?? (buildTimer = setTimeout(() => {
|
|
99
|
+
buildTimer = null;
|
|
100
|
+
const toolbars = [...toBuild];
|
|
101
|
+
toBuild.clear();
|
|
102
|
+
toolbars.forEach(toolbar => toolbar._buildChildren());
|
|
103
|
+
}, 0));
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* A web font that finishes loading changes how wide an item is. The child
|
|
107
|
+
* resize observer sees that for a visible item, but an item already in the
|
|
108
|
+
* overflow menu has no width to watch: measured with the fallback font it
|
|
109
|
+
* went into the menu, and would stay there although it fits now. One listener
|
|
110
|
+
* for every toolbar, so they measure in one pass.
|
|
111
|
+
*/
|
|
112
|
+
const connectedToolbars = new Set();
|
|
113
|
+
const onFontsLoaded = () => {
|
|
114
|
+
const measured = [...connectedToolbars].filter(toolbar => toolbar._hasMeasured);
|
|
115
|
+
if (!measured.length)
|
|
116
|
+
return;
|
|
117
|
+
measured.forEach(toolbar => measurePass.schedule(toolbar, toolbar.ownerDocument));
|
|
118
|
+
measurePass.flush();
|
|
119
|
+
};
|
|
51
120
|
// # Component
|
|
52
121
|
let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
53
122
|
constructor() {
|
|
@@ -81,21 +150,17 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
81
150
|
this._idCounter = 0;
|
|
82
151
|
this._itemWidths = new Map();
|
|
83
152
|
this._observer = null;
|
|
84
|
-
this._resizeObserver = null;
|
|
85
153
|
this._isMeasuring = false;
|
|
86
|
-
|
|
154
|
+
/** The items and title whose size is watched (see _watchChildSizes). */
|
|
155
|
+
this._sizedChildren = new Set();
|
|
87
156
|
this._lastChildWidths = new WeakMap();
|
|
88
157
|
this._isBuilding = false;
|
|
158
|
+
this._rebuildPending = false;
|
|
159
|
+
this._built = false;
|
|
160
|
+
this._lastWidth = null;
|
|
161
|
+
/** @internal */
|
|
89
162
|
this._hasMeasured = false;
|
|
90
163
|
this._prioritizedItemsCache = null;
|
|
91
|
-
/** A web font that finishes loading changes how wide an item is. The child
|
|
92
|
-
* resize observer sees that for a visible item, but an item already in the
|
|
93
|
-
* overflow menu has no width to watch: measured with the fallback font it
|
|
94
|
-
* went into the menu, and would stay there although it fits now. */
|
|
95
|
-
this._onFontsLoaded = () => {
|
|
96
|
-
if (this._hasMeasured)
|
|
97
|
-
this._measureAndUpdate();
|
|
98
|
-
};
|
|
99
164
|
}
|
|
100
165
|
// — i18n —————————————————————————————————————————————————————————————————
|
|
101
166
|
_t(key) {
|
|
@@ -137,32 +202,90 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
137
202
|
}
|
|
138
203
|
}
|
|
139
204
|
if (needsRebuild)
|
|
140
|
-
this.
|
|
205
|
+
this._rebuild();
|
|
141
206
|
else if (needsMenuResync)
|
|
142
207
|
this._syncMenuItems();
|
|
143
208
|
});
|
|
144
209
|
// Here and not in firstUpdated: disconnecting takes it down, and a toolbar
|
|
145
210
|
// moved in the DOM or kept by a framework connects again without a first
|
|
146
211
|
// update, so it would no longer follow its width.
|
|
147
|
-
this
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
});
|
|
153
|
-
this._resizeObserver.observe(this);
|
|
154
|
-
setTimeout(() => this._buildChildren(), 0);
|
|
155
|
-
document.fonts?.addEventListener('loadingdone', this._onFontsLoaded);
|
|
212
|
+
observeSize(this, this);
|
|
213
|
+
buildSoon(this);
|
|
214
|
+
if (!connectedToolbars.size)
|
|
215
|
+
document.fonts?.addEventListener('loadingdone', onFontsLoaded);
|
|
216
|
+
connectedToolbars.add(this);
|
|
156
217
|
}
|
|
157
218
|
disconnectedCallback() {
|
|
158
219
|
super.disconnectedCallback();
|
|
159
|
-
|
|
220
|
+
connectedToolbars.delete(this);
|
|
221
|
+
if (!connectedToolbars.size)
|
|
222
|
+
document.fonts?.removeEventListener('loadingdone', onFontsLoaded);
|
|
223
|
+
toBuild.delete(this);
|
|
224
|
+
measurePass.cancel(this);
|
|
225
|
+
areaPass.cancel(this);
|
|
160
226
|
this._observer?.disconnect();
|
|
161
227
|
this._observer = null;
|
|
162
|
-
this
|
|
163
|
-
this.
|
|
164
|
-
this.
|
|
165
|
-
this.
|
|
228
|
+
unobserveSize(this, this);
|
|
229
|
+
this._lastWidth = null;
|
|
230
|
+
this._sizedChildren.forEach(el => unobserveSize(el, this));
|
|
231
|
+
this._sizedChildren.clear();
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A rebuild for a change in the children. While the parser is still adding
|
|
235
|
+
* them, the observer calls back once per child; one rebuild after the parse
|
|
236
|
+
* does for all of them.
|
|
237
|
+
*/
|
|
238
|
+
_rebuild() {
|
|
239
|
+
if (this._rebuildPending)
|
|
240
|
+
return;
|
|
241
|
+
const run = () => {
|
|
242
|
+
this._rebuildPending = false;
|
|
243
|
+
if (this.isConnected)
|
|
244
|
+
this._buildChildren();
|
|
245
|
+
};
|
|
246
|
+
this._rebuildPending = afterParse(run, this.ownerDocument);
|
|
247
|
+
if (!this._rebuildPending)
|
|
248
|
+
this._buildChildren();
|
|
249
|
+
}
|
|
250
|
+
/** A measurement in the next pass, together with the other toolbars. */
|
|
251
|
+
_scheduleMeasure() {
|
|
252
|
+
measurePass.schedule(this, this.ownerDocument);
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Whether a size change reported by the shared observer calls for a
|
|
256
|
+
* measurement. Measuring changes these very sizes, since an item that moves
|
|
257
|
+
* into the overflow menu collapses. `_isMeasuring` covers the synchronous
|
|
258
|
+
* pass, and the render that follows lands after it, so a child is compared
|
|
259
|
+
* against the width it last had and stays quiet when nothing really moved.
|
|
260
|
+
* @internal
|
|
261
|
+
*/
|
|
262
|
+
_resized(entry) {
|
|
263
|
+
if (this._isMeasuring)
|
|
264
|
+
return false;
|
|
265
|
+
if (entry.target === this) {
|
|
266
|
+
// Only the width decides what fits. The height changes with what the
|
|
267
|
+
// items render, which their own reports already cover.
|
|
268
|
+
// The border box, as the measurement reads it with getBoundingClientRect.
|
|
269
|
+
const width = entry.borderBoxSize?.[0]?.inlineSize ?? entry.contentRect.width;
|
|
270
|
+
if (width === this._lastWidth)
|
|
271
|
+
return false;
|
|
272
|
+
this._lastWidth = width;
|
|
273
|
+
this._overflowMenu.hide();
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
if (this._isBuilding)
|
|
277
|
+
return false;
|
|
278
|
+
const el = entry.target;
|
|
279
|
+
// An item in the overflow menu has no width to speak of. It is the
|
|
280
|
+
// hiding that took it away, not the content, so it says nothing about
|
|
281
|
+
// whether the layout should change.
|
|
282
|
+
if (el.hasAttribute('hidden'))
|
|
283
|
+
return false;
|
|
284
|
+
const width = entry.contentRect.width;
|
|
285
|
+
if (Math.abs((this._lastChildWidths.get(el) ?? -1) - width) < 0.5)
|
|
286
|
+
return false;
|
|
287
|
+
this._lastChildWidths.set(el, width);
|
|
288
|
+
return true;
|
|
166
289
|
}
|
|
167
290
|
firstUpdated() {
|
|
168
291
|
this._syncHosts();
|
|
@@ -171,17 +294,19 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
171
294
|
if (changedProperties.has('size') || changedProperties.has('showItemLabels')) {
|
|
172
295
|
this._syncHosts();
|
|
173
296
|
}
|
|
174
|
-
|
|
297
|
+
// Not for the first render: the children are only known once they are
|
|
298
|
+
// built, which measures anyway.
|
|
299
|
+
if (this._built && (changedProperties.has('_startChildren') ||
|
|
175
300
|
changedProperties.has('_centerChildren') ||
|
|
176
|
-
changedProperties.has('_endChildren')) {
|
|
177
|
-
this.updateComplete.then(() => this.
|
|
301
|
+
changedProperties.has('_endChildren'))) {
|
|
302
|
+
this.updateComplete.then(() => this._scheduleMeasure());
|
|
178
303
|
}
|
|
179
304
|
if (changedProperties.has('_overflowIds') ||
|
|
180
305
|
changedProperties.has('_pinnedOverflowItems')) {
|
|
181
306
|
this._syncMenuItems();
|
|
182
307
|
this._syncMenuAnchor();
|
|
183
308
|
if (!this._hasMeasured) {
|
|
184
|
-
this.updateComplete.then(() => this.
|
|
309
|
+
this.updateComplete.then(() => areaPass.schedule(this, this.ownerDocument));
|
|
185
310
|
}
|
|
186
311
|
}
|
|
187
312
|
}
|
|
@@ -193,7 +318,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
193
318
|
* not carry listeners added with addEventListener; its `select` is sent on
|
|
194
319
|
* to the original (see utilities/overflow-menu.ts). */
|
|
195
320
|
_syncMenuItems() {
|
|
196
|
-
const overflowed =
|
|
321
|
+
const overflowed = this._getPrioritizedItems().toReversed()
|
|
197
322
|
.filter(child => this._overflowIds.has(child.id))
|
|
198
323
|
.flatMap(child => child.overflowItems);
|
|
199
324
|
this._overflowMenu.mirror([...overflowed, ...this._pinnedOverflowItems]);
|
|
@@ -256,15 +381,27 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
256
381
|
? child.element
|
|
257
382
|
: null;
|
|
258
383
|
}
|
|
384
|
+
/** Also what the size observer compares with: this measurement has seen
|
|
385
|
+
* these widths, so a report of the same width needs no new one. Items
|
|
386
|
+
* have no padding or border, so their box is their content box. */
|
|
259
387
|
_measureItemWidths() {
|
|
260
388
|
this._allHostChildren().forEach(child => {
|
|
261
389
|
if (child.type === 'item' || child.type === 'title') {
|
|
262
390
|
const host = child.element;
|
|
263
|
-
|
|
391
|
+
const width = host.getBoundingClientRect().width;
|
|
392
|
+
this._itemWidths.set(child.id, width);
|
|
393
|
+
if (!host.hidden)
|
|
394
|
+
this._lastChildWidths.set(host, width);
|
|
264
395
|
}
|
|
265
396
|
});
|
|
266
397
|
}
|
|
267
|
-
|
|
398
|
+
/**
|
|
399
|
+
* Publishes how wide each area is, for the spacers that center the center.
|
|
400
|
+
* Reads everything first and writes after, so toolbars side by side lay
|
|
401
|
+
* out once (see runSteps).
|
|
402
|
+
* @internal
|
|
403
|
+
*/
|
|
404
|
+
*_areaSteps() {
|
|
268
405
|
const itemsEl = this.shadowRoot?.querySelector('.toolbar__items');
|
|
269
406
|
if (!itemsEl)
|
|
270
407
|
return;
|
|
@@ -276,6 +413,17 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
276
413
|
const overflowButtonWidth = (overflowButtonContainerEl && !overflowButtonContainerEl.classList.contains('is-hidden') && overflowButtonEl)
|
|
277
414
|
? overflowButtonEl.getBoundingClientRect().width + hostGap
|
|
278
415
|
: 0;
|
|
416
|
+
// Route to the centered center-fill layout whenever nothing is actually
|
|
417
|
+
// rendered in start/end — measured by real rendering, not child presence,
|
|
418
|
+
// so a consumer-hidden (display:none) back button doesn't strand a centered
|
|
419
|
+
// title at the left (it would otherwise keep centerOnly false and fall into
|
|
420
|
+
// the spacer path, where startWidth===0 && endWidth===0 suppresses both
|
|
421
|
+
// balancing spacers). An item the toolbar moved into the overflow menu
|
|
422
|
+
// still counts: switching layout then changes what fits, so the next
|
|
423
|
+
// measurement brings it back, and the two layouts take turns forever.
|
|
424
|
+
const centerOnly = this._isCenterOnly();
|
|
425
|
+
const rendered = this._allHostChildren().filter(c => !this._overflowIds.has(c.id) && c.element.getClientRects().length > 0);
|
|
426
|
+
yield 'write';
|
|
279
427
|
this.style.setProperty('--_toolbar-overflow-button-width', `${overflowButtonWidth}px`);
|
|
280
428
|
const startWidth = areaWidth(this._startChildren, this._overflowIds, this._itemWidths, itemGap);
|
|
281
429
|
const centerWidth = areaWidth(this._centerChildren, this._overflowIds, this._itemWidths, itemGap);
|
|
@@ -296,18 +444,8 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
296
444
|
this._leftSpacerZero = leftZero;
|
|
297
445
|
if (rightZero !== this._rightSpacerZero)
|
|
298
446
|
this._rightSpacerZero = rightZero;
|
|
299
|
-
// Route to the centered center-fill layout whenever nothing is actually
|
|
300
|
-
// rendered in start/end — measured by real rendering, not child presence,
|
|
301
|
-
// so a consumer-hidden (display:none) back button doesn't strand a centered
|
|
302
|
-
// title at the left (it would otherwise keep centerOnly false and fall into
|
|
303
|
-
// the spacer path, where startWidth===0 && endWidth===0 suppresses both
|
|
304
|
-
// balancing spacers). An item the toolbar moved into the overflow menu
|
|
305
|
-
// still counts: switching layout then changes what fits, so the next
|
|
306
|
-
// measurement brings it back, and the two layouts take turns forever.
|
|
307
|
-
const centerOnly = this._isCenterOnly();
|
|
308
447
|
if (centerOnly !== this._centerOnly)
|
|
309
448
|
this._centerOnly = centerOnly;
|
|
310
|
-
const rendered = this._allHostChildren().filter(c => !this._overflowIds.has(c.id) && c.element.getClientRects().length > 0);
|
|
311
449
|
const soloFluid = fillsRowAlone(rendered);
|
|
312
450
|
if (soloFluid !== this._soloFluid)
|
|
313
451
|
this._soloFluid = soloFluid;
|
|
@@ -330,29 +468,67 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
330
468
|
_hasPresentChild(children) {
|
|
331
469
|
return children.some(c => this._overflowIds.has(c.id)) || this._hasRenderedChild(children);
|
|
332
470
|
}
|
|
471
|
+
/** Measures this toolbar now, by itself. */
|
|
333
472
|
_measureAndUpdate() {
|
|
473
|
+
measurePass.cancel(this);
|
|
474
|
+
runSteps([this._measureSteps()]);
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Decides what fits, as steps that read or write (see runSteps).
|
|
478
|
+
* @internal
|
|
479
|
+
*/
|
|
480
|
+
*_measureSteps() {
|
|
334
481
|
if (this._isMeasuring)
|
|
335
482
|
return;
|
|
336
483
|
const itemsEl = this.shadowRoot?.querySelector('.toolbar__items');
|
|
337
484
|
if (!itemsEl)
|
|
338
485
|
return;
|
|
339
486
|
this._isMeasuring = true;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
487
|
+
try {
|
|
488
|
+
const hostWidth = this.getBoundingClientRect().width;
|
|
489
|
+
// The width this measurement fits the items in; a report of the same
|
|
490
|
+
// width from the size observer is no resize.
|
|
491
|
+
this._lastWidth = hostWidth;
|
|
492
|
+
yield 'write';
|
|
493
|
+
this.style.setProperty('--_toolbar-width', `${hostWidth}px`);
|
|
494
|
+
yield* this._overflowSteps(itemsEl);
|
|
495
|
+
this._hasMeasured = true;
|
|
496
|
+
}
|
|
497
|
+
finally {
|
|
498
|
+
this._isMeasuring = false;
|
|
499
|
+
}
|
|
345
500
|
}
|
|
346
|
-
|
|
501
|
+
/** Starts in the write phase; ends in the read phase. */
|
|
502
|
+
*_overflowSteps(itemsEl) {
|
|
347
503
|
const overflowButtonEl = this.shadowRoot?.querySelector('.toolbar__overflow-button');
|
|
348
504
|
const allChildren = this._allHostChildren();
|
|
349
505
|
const itemChildren = itemsOf(allChildren);
|
|
350
506
|
const titleChildren = allChildren.filter((c) => c.type === 'title');
|
|
351
|
-
// Show all items,
|
|
507
|
+
// Show all items, and read what a control with its own overflow wants
|
|
508
|
+
// (see _syncShrinkable) with everything shown.
|
|
509
|
+
const controls = new Map();
|
|
352
510
|
itemChildren.forEach(child => {
|
|
353
511
|
const host = child.element;
|
|
354
512
|
host.hidden = false;
|
|
355
|
-
|
|
513
|
+
host.removeAttribute('shrunk');
|
|
514
|
+
const control = shrinkableControlOf(host);
|
|
515
|
+
if (control)
|
|
516
|
+
controls.set(host, control);
|
|
517
|
+
});
|
|
518
|
+
if (controls.size) {
|
|
519
|
+
controls.forEach(control => control._setMeasuring?.(true));
|
|
520
|
+
yield 'read';
|
|
521
|
+
const widths = new Map([...controls].map(([host, control]) => [host, control._toolbarWidths()]));
|
|
522
|
+
yield 'write';
|
|
523
|
+
controls.forEach(control => control._setMeasuring?.(false));
|
|
524
|
+
itemChildren.forEach(child => this._syncShrinkable(child.element, widths.get(child.element) ?? null));
|
|
525
|
+
}
|
|
526
|
+
else {
|
|
527
|
+
itemChildren.forEach(child => this._syncShrinkable(child.element, null));
|
|
528
|
+
}
|
|
529
|
+
// Reset solo-fluid to fluid with min-width restored.
|
|
530
|
+
itemChildren.forEach(child => {
|
|
531
|
+
const host = child.element;
|
|
356
532
|
if (host.hasAttribute('solo-fluid')) {
|
|
357
533
|
host.removeAttribute('solo-fluid');
|
|
358
534
|
host.toggleAttribute('fluid', child.isFluid);
|
|
@@ -372,20 +548,21 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
372
548
|
else {
|
|
373
549
|
overflowButtonEl?.classList.add('is-hidden');
|
|
374
550
|
}
|
|
375
|
-
|
|
551
|
+
yield 'read';
|
|
376
552
|
const centerOnly = this._isCenterOnly();
|
|
377
553
|
const isOverflowing = () => itemsEl.scrollWidth > itemsEl.clientWidth + 1;
|
|
378
554
|
if (!isOverflowing()) {
|
|
379
555
|
if (this._overflowIds.size > 0) {
|
|
380
556
|
this._overflowIds = new Set();
|
|
381
557
|
}
|
|
382
|
-
this.
|
|
558
|
+
yield* this._promoteSoloFluidSteps(itemsEl, itemChildren, titleChildren, centerOnly);
|
|
383
559
|
this._measureItemWidths();
|
|
384
|
-
this.
|
|
560
|
+
yield* this._areaSteps();
|
|
385
561
|
return;
|
|
386
562
|
}
|
|
563
|
+
yield 'write';
|
|
387
564
|
overflowButtonEl?.classList.remove('is-hidden');
|
|
388
|
-
|
|
565
|
+
yield 'read';
|
|
389
566
|
const prioritized = this._getPrioritizedItems();
|
|
390
567
|
const newOverflowIds = new Set();
|
|
391
568
|
const priorityGroups = groupForOverflow(prioritized);
|
|
@@ -410,40 +587,42 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
410
587
|
.map(c => c.element)
|
|
411
588
|
.filter(host => host.hasAttribute('shrinkable'));
|
|
412
589
|
if (shrinkable.length > 0) {
|
|
590
|
+
yield 'write';
|
|
413
591
|
shrinkable.forEach(host => host.toggleAttribute('shrunk', true));
|
|
414
|
-
|
|
592
|
+
yield 'read';
|
|
415
593
|
if (!isOverflowing())
|
|
416
594
|
break;
|
|
417
595
|
}
|
|
596
|
+
yield 'write';
|
|
418
597
|
for (const child of group) {
|
|
419
598
|
newOverflowIds.add(child.id);
|
|
420
599
|
const host = child.element;
|
|
421
600
|
host.hidden = true;
|
|
422
601
|
host.removeAttribute('shrunk');
|
|
423
602
|
}
|
|
424
|
-
|
|
603
|
+
yield 'read';
|
|
425
604
|
}
|
|
426
605
|
if (newOverflowIds.size === 0 && this._pinnedOverflowItems.length === 0) {
|
|
606
|
+
yield 'write';
|
|
427
607
|
overflowButtonEl?.classList.add('is-hidden');
|
|
608
|
+
yield 'read';
|
|
428
609
|
}
|
|
429
|
-
this.
|
|
610
|
+
yield* this._promoteSoloFluidSteps(itemsEl, itemChildren, titleChildren, centerOnly);
|
|
430
611
|
const changed = newOverflowIds.size !== this._overflowIds.size ||
|
|
431
612
|
[...newOverflowIds].some(id => !this._overflowIds.has(id));
|
|
432
613
|
if (changed) {
|
|
433
614
|
this._overflowIds = newOverflowIds;
|
|
434
615
|
}
|
|
435
616
|
this._measureItemWidths();
|
|
436
|
-
this.
|
|
617
|
+
yield* this._areaSteps();
|
|
437
618
|
}
|
|
438
619
|
/**
|
|
439
620
|
* Gives an item whose control overflows by itself (nldd-tab-bar) the width
|
|
440
621
|
* that control wants with everything shown, and remembers how narrow it can
|
|
441
622
|
* get. Read on every measurement, because the control's content can change.
|
|
623
|
+
* Writes only: the widths were read before, for every toolbar in the pass.
|
|
442
624
|
*/
|
|
443
|
-
_syncShrinkable(host) {
|
|
444
|
-
host.removeAttribute('shrunk');
|
|
445
|
-
const control = Array.from(host.children).find(el => el.getAttribute('slot') !== 'overflow');
|
|
446
|
-
const widths = typeof control?._toolbarWidths === 'function' ? control._toolbarWidths() : null;
|
|
625
|
+
_syncShrinkable(host, widths) {
|
|
447
626
|
host.toggleAttribute('shrinkable', Boolean(widths));
|
|
448
627
|
if (widths) {
|
|
449
628
|
host.style.setProperty('--_toolbar-item-preferred-width', `${widths.preferred}px`);
|
|
@@ -460,7 +639,14 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
460
639
|
* center-only mode the center-fill wrapper already grows the items, so item
|
|
461
640
|
* promotion is skipped there (matching the previous template behavior).
|
|
462
641
|
*/
|
|
463
|
-
|
|
642
|
+
/**
|
|
643
|
+
* Promotes a lone remaining fluid item (or a lone title when no items are
|
|
644
|
+
* visible) to the solo-fluid state so it grows to fill the row. In
|
|
645
|
+
* center-only mode the center-fill wrapper already grows the items, so item
|
|
646
|
+
* promotion is skipped there (matching the previous template behavior).
|
|
647
|
+
* Starts and ends in the read phase.
|
|
648
|
+
*/
|
|
649
|
+
*_promoteSoloFluidSteps(itemsEl, itemChildren, titleChildren, centerOnly) {
|
|
464
650
|
// Real rendering, not the `hidden` property: a consumer-hidden
|
|
465
651
|
// (display:none) start/end item must not count as a "remaining visible"
|
|
466
652
|
// item, or it blocks promoting a lone title to solo-fluid (which is what
|
|
@@ -468,24 +654,27 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
468
654
|
// display:none too, so this stays equivalent for the overflow flow.
|
|
469
655
|
const remainingVisible = itemChildren.filter(c => c.element.getClientRects().length > 0);
|
|
470
656
|
if (!centerOnly && remainingVisible.length === 1 && remainingVisible[0].element.hasAttribute('fluid')) {
|
|
657
|
+
yield 'write';
|
|
471
658
|
const host = remainingVisible[0].element;
|
|
472
659
|
host.removeAttribute('fluid');
|
|
473
660
|
host.setAttribute('solo-fluid', '');
|
|
474
661
|
host.style.removeProperty('--_toolbar-item-min-width');
|
|
475
|
-
|
|
662
|
+
yield 'read';
|
|
476
663
|
}
|
|
477
664
|
const remainingTitles = titleChildren.filter(c => !c.element.hidden);
|
|
478
665
|
if (remainingVisible.length === 0 && remainingTitles.length === 1) {
|
|
666
|
+
yield 'write';
|
|
479
667
|
const host = remainingTitles[0].element;
|
|
480
668
|
host.setAttribute('solo-fluid', '');
|
|
481
669
|
host.style.setProperty('min-width', '0px');
|
|
482
|
-
|
|
670
|
+
yield 'read';
|
|
483
671
|
}
|
|
484
672
|
// A title holds its own width while items can still move into the menu.
|
|
485
673
|
// When nothing else can go and the row still does not fit, it gives way.
|
|
486
674
|
if (itemsEl.scrollWidth > itemsEl.clientWidth + 1) {
|
|
675
|
+
yield 'write';
|
|
487
676
|
remainingTitles.forEach(c => c.element.style.setProperty('min-width', '0px'));
|
|
488
|
-
|
|
677
|
+
yield 'read';
|
|
489
678
|
}
|
|
490
679
|
}
|
|
491
680
|
_buildChildrenForSlot(slotName) {
|
|
@@ -535,6 +724,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
535
724
|
(tag === 'nldd-menu-item' || tag === 'nldd-menu-divider' || tag === 'nldd-menu-group');
|
|
536
725
|
});
|
|
537
726
|
}
|
|
727
|
+
/** @internal */
|
|
538
728
|
_buildChildren() {
|
|
539
729
|
if (this._isBuilding)
|
|
540
730
|
return;
|
|
@@ -544,6 +734,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
544
734
|
this._centerChildren = this._buildChildrenForSlot('center');
|
|
545
735
|
this._endChildren = this._buildChildrenForSlot('end');
|
|
546
736
|
this._buildPinnedOverflowItems();
|
|
737
|
+
this._built = true;
|
|
547
738
|
this._prioritizedItemsCache = null;
|
|
548
739
|
this._syncHosts();
|
|
549
740
|
const itemAttributeFilter = ['label', 'priority', 'min-width', 'max-width', 'width', 'text', 'disabled', 'selected', 'type'];
|
|
@@ -561,37 +752,14 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
561
752
|
* some of those and has no way to tell which of them moved a pixel, so it
|
|
562
753
|
* asked the wrong question. This one reads the answer.
|
|
563
754
|
*
|
|
564
|
-
*
|
|
565
|
-
*
|
|
566
|
-
* the render that follows lands after it, so the callback compares against
|
|
567
|
-
* the widths it last acted on and stays quiet when nothing really moved.
|
|
755
|
+
* The observer is shared by every toolbar; what a report means for this one
|
|
756
|
+
* is decided in _resized.
|
|
568
757
|
*/
|
|
569
758
|
_watchChildSizes() {
|
|
570
|
-
this.
|
|
571
|
-
this.
|
|
572
|
-
if (this._isMeasuring || this._isBuilding)
|
|
573
|
-
return;
|
|
574
|
-
let moved = false;
|
|
575
|
-
for (const entry of entries) {
|
|
576
|
-
const el = entry.target;
|
|
577
|
-
// An item in the overflow menu has no width to speak of. It is the
|
|
578
|
-
// hiding that took it away, not the content, so it says nothing about
|
|
579
|
-
// whether the layout should change.
|
|
580
|
-
if (el.hasAttribute('hidden'))
|
|
581
|
-
continue;
|
|
582
|
-
const width = entry.contentRect.width;
|
|
583
|
-
if (Math.abs((this._lastChildWidths.get(el) ?? -1) - width) < 0.5)
|
|
584
|
-
continue;
|
|
585
|
-
this._lastChildWidths.set(el, width);
|
|
586
|
-
moved = true;
|
|
587
|
-
}
|
|
588
|
-
if (moved)
|
|
589
|
-
this._measureAndUpdate();
|
|
590
|
-
}));
|
|
759
|
+
this._sizedChildren.forEach(el => unobserveSize(el, this));
|
|
760
|
+
this._sizedChildren = new Set(this._hostChildElements());
|
|
591
761
|
this._lastChildWidths = new WeakMap();
|
|
592
|
-
|
|
593
|
-
this._childResizeObserver.observe(el);
|
|
594
|
-
}
|
|
762
|
+
this._sizedChildren.forEach(el => observeSize(el, this));
|
|
595
763
|
}
|
|
596
764
|
/** The elements this toolbar lays out: its items and its title. */
|
|
597
765
|
_hostChildElements() {
|
|
@@ -601,7 +769,7 @@ let NLDDToolbar = class NLDDToolbar extends LitElement {
|
|
|
601
769
|
});
|
|
602
770
|
}
|
|
603
771
|
render() {
|
|
604
|
-
// Pre-measurement fallback: before the first
|
|
772
|
+
// Pre-measurement fallback: before the first _areaSteps there is no
|
|
605
773
|
// rendering to read, so fall back to mere DOM presence. _soloFluid takes
|
|
606
774
|
// over from the first measurement on.
|
|
607
775
|
const isSoloFluid = this._soloFluid
|