@nldd/design-system 0.20.0 → 0.21.0
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 +204 -8
- package/dist/cdn/autoloader.js +181 -0
- package/dist/cdn/chunks/activity-indicator-JglZJ8dh.js +356 -0
- package/dist/cdn/chunks/activity-indicator.i18n-D7mCy6d2.js +3 -0
- package/dist/cdn/chunks/avatar-ASqePVhU.js +308 -0
- package/dist/cdn/chunks/avatar-group-rknt4FBO.js +338 -0
- package/dist/cdn/chunks/avatar-group.i18n-BYw_9wt_.js +7 -0
- package/dist/cdn/chunks/avatar.i18n-CMwQjBkS.js +7 -0
- package/dist/cdn/chunks/badge-Cc2Nufoc.js +323 -0
- package/dist/cdn/chunks/badge.i18n-DqW7hLQj.js +3 -0
- package/dist/cdn/chunks/banner-BLVKM07M.js +325 -0
- package/dist/cdn/chunks/banner.i18n-BOCM9rGN.js +3 -0
- package/dist/cdn/chunks/bar-split-view-Clbg-p9H.js +259 -0
- package/dist/cdn/chunks/base-CfuoYRhN.js +3 -0
- package/dist/cdn/chunks/blockquote-BoOqbGdm.js +189 -0
- package/dist/cdn/chunks/box-WkhyjQVy.js +88 -0
- package/dist/cdn/chunks/breadcrumbs-D9YxZzRj.js +162 -0
- package/dist/cdn/chunks/breadcrumbs.i18n-zmO8jaTO.js +3 -0
- package/dist/cdn/chunks/breakpoints-Cwor8TRP.js +15 -0
- package/dist/cdn/chunks/button-DO90Lo6q.js +863 -0
- package/dist/cdn/chunks/button-bar-Bxgdbyh3.js +225 -0
- package/dist/cdn/chunks/button-group-BYGPPLmZ.js +205 -0
- package/dist/{components/button.i18n-DiDGynnq.js → cdn/chunks/button.i18n-BGFt7Z9u.js} +2 -2
- package/dist/cdn/chunks/card-BP0jfOkS.js +262 -0
- package/dist/cdn/chunks/card.i18n-CpafLm3i.js +8 -0
- package/dist/cdn/chunks/carried-context-DlMSujiJ.js +37 -0
- package/dist/cdn/chunks/cell-BRD2ilQh.js +144 -0
- package/dist/cdn/chunks/checkbox-Cazx8CQn.js +296 -0
- package/dist/cdn/chunks/checkbox-field-DDZ-B6vH.js +157 -0
- package/dist/cdn/chunks/class-map-CXSdNjt8.js +26 -0
- package/dist/cdn/chunks/code-editor-D6Q55oaY.js +286 -0
- package/dist/cdn/chunks/code-viewer-DspLH2T1.js +766 -0
- package/dist/cdn/chunks/code-viewer.i18n-BHfSDRbK.js +13 -0
- package/dist/cdn/chunks/codemirror-input-Db65x22n.js +1232 -0
- package/dist/cdn/chunks/collection-NVtkvDls.js +396 -0
- package/dist/cdn/chunks/collection.i18n-DqWPGnZO.js +8 -0
- package/dist/cdn/chunks/combo-box-DyBQSaQl.js +512 -0
- package/dist/cdn/chunks/combo-box.i18n-BorzYnJ2.js +6 -0
- package/dist/cdn/chunks/container-rrbwk0z4.js +602 -0
- package/dist/cdn/chunks/custom-element-BW8Ua4c7.js +7 -0
- package/dist/cdn/chunks/custom-element-q6NzoL5b.js +301 -0
- package/dist/cdn/chunks/custom-font-size-D7KNr84p.js +57 -0
- package/dist/cdn/chunks/date-field-Clti_wKN.js +654 -0
- package/dist/cdn/chunks/date-field.i18n-BTzc0E9a.js +15 -0
- package/dist/cdn/chunks/date-picker-2TCQLd5D.js +993 -0
- package/dist/cdn/chunks/date-picker.i18n-Dsc_M5QK.js +82 -0
- package/dist/cdn/chunks/decorate-TduJMFD_.js +280 -0
- package/dist/cdn/chunks/defer-focus-F73ud2D9.js +9 -0
- package/dist/cdn/chunks/described-by-mixin-daRE7orX.js +32 -0
- package/dist/cdn/chunks/description-cell-CQwOj_rN.js +166 -0
- package/dist/cdn/chunks/dev-checks-zW_W-hnh.js +2695 -0
- package/dist/cdn/chunks/directive-CwRgozUW.js +27 -0
- package/dist/cdn/chunks/dismiss-from-title-bar-C6mP7sWP.js +5 -0
- package/dist/cdn/chunks/dist-3C80SZN9.js +849 -0
- package/dist/cdn/chunks/dist-A7_1pHX0.js +379 -0
- package/dist/cdn/chunks/dist-BEfLdOvy.js +1346 -0
- package/dist/cdn/chunks/dist-BTUxFM2V.js +268 -0
- package/dist/cdn/chunks/dist-CP3G1pSK.js +1037 -0
- package/dist/cdn/chunks/dist-C_dGY6zR.js +468 -0
- package/dist/{components/dist-B9YBOGFW.js → cdn/chunks/dist-ChmCRv39.js} +109 -153
- package/dist/{components/dist-CJm4tkNC.js → cdn/chunks/dist-D2qap2OY.js} +23 -31
- package/dist/cdn/chunks/dist-DPUBF0MZ.js +1593 -0
- package/dist/{components/dist-4g23YHP0.js → cdn/chunks/dist-DrTzvgE7.js} +291 -404
- package/dist/cdn/chunks/dist-EM4MWLQq.js +385 -0
- package/dist/cdn/chunks/dist-EgIBI-FG.js +293 -0
- package/dist/{components/dist-Bf823YyL.js → cdn/chunks/dist-Rm6FvrSR.js} +272 -551
- package/dist/cdn/chunks/divider-CCNbnplA.js +53 -0
- package/dist/cdn/chunks/document-tab-bar-CUc4WWY3.js +973 -0
- package/dist/cdn/chunks/document-tab-bar.i18n-DKrA9TnB.js +9 -0
- package/dist/cdn/chunks/drag-handle-cell-CbzDYebG.js +206 -0
- package/dist/cdn/chunks/drag-handle-cell.i18n-CKUrbm2q.js +3 -0
- package/dist/cdn/chunks/dropdown-DZTZtkm5.js +350 -0
- package/dist/cdn/chunks/element-state-B-44fVqq.js +20 -0
- package/dist/cdn/chunks/file-field-Bff6_1pp.js +1484 -0
- package/dist/cdn/chunks/file-field.i18n-pDM7Utud.js +40 -0
- package/dist/cdn/chunks/floating-ui.dom-B8J1rV2c.js +753 -0
- package/dist/cdn/chunks/focus-target-DSLGcCWq.js +24 -0
- package/dist/cdn/chunks/form-actions-C_7hINq-.js +90 -0
- package/dist/cdn/chunks/form-associated-mixin--GIbl98p.js +62 -0
- package/dist/cdn/chunks/form-field--4nWJ_DK.js +364 -0
- package/dist/cdn/chunks/form-hXLgy_tY.js +84 -0
- package/dist/cdn/chunks/form-section-By-D4un0.js +64 -0
- package/dist/cdn/chunks/full-bleed-section-Dg4sIJG1.js +161 -0
- package/dist/cdn/chunks/gherkin-eseYvsxh.js +29 -0
- package/dist/cdn/chunks/hero-CQQMNCT_.js +761 -0
- package/dist/{components/icon-_Eox7ZfO.js → cdn/chunks/icon-BORlalt0.js} +298 -308
- package/dist/cdn/chunks/icon-button-rKiIHs7A.js +632 -0
- package/dist/{components/icon-button.i18n-1_N-wN6x.js → cdn/chunks/icon-button.i18n-DpZOfIS4.js} +2 -4
- package/dist/cdn/chunks/icon-cell-rk4NQid2.js +156 -0
- package/dist/cdn/chunks/identity-Cg1l0HhB.js +187 -0
- package/dist/cdn/chunks/if-defined-CaKKERku.js +4 -0
- package/dist/cdn/chunks/image-DZMW6JgL.js +659 -0
- package/dist/cdn/chunks/image.i18n-ONcm1h7o.js +3 -0
- package/dist/cdn/chunks/implicit-submission-Csbcor_E.js +27 -0
- package/dist/cdn/chunks/inline-dialog-WlqtPBPJ.js +259 -0
- package/dist/cdn/chunks/input-modality-XE0B7yCn.js +42 -0
- package/dist/cdn/chunks/just-in-time-education-DRcb5g7x.js +611 -0
- package/dist/cdn/chunks/just-in-time-education.i18n-CW_dsaxf.js +6 -0
- package/dist/cdn/chunks/kanban-Ca_mfqsA.js +400 -0
- package/dist/cdn/chunks/kanban-column-fgIMc7pw.js +375 -0
- package/dist/cdn/chunks/kanban.i18n-CWqc3e0B.js +11 -0
- package/dist/cdn/chunks/keyboard-shortcut-EknnW7Ub.js +267 -0
- package/dist/cdn/chunks/languages-yKikVFv_.js +8893 -0
- package/dist/cdn/chunks/link-FBSAJ3UC.js +229 -0
- package/dist/cdn/chunks/link-group-90qVfKa0.js +111 -0
- package/dist/cdn/chunks/link-hint-KFhgr5Ng.js +24 -0
- package/dist/cdn/chunks/link-rel-DvrTEfVT.js +8 -0
- package/dist/cdn/chunks/link.i18n-DJPobGmu.js +8 -0
- package/dist/cdn/chunks/list-CaWl3q0Z.js +880 -0
- package/dist/cdn/chunks/list-item-Cagnf6eG.js +802 -0
- package/dist/cdn/chunks/list-item-segment-BRzBF1y_.js +315 -0
- package/dist/cdn/chunks/list-item-segment.i18n-DHnrQL4V.js +8 -0
- package/dist/{components/list-item.i18n-89uqlBMK.js → cdn/chunks/list-item.i18n-Br6J5Ev9.js} +2 -2
- package/dist/cdn/chunks/list-items-Du0RCWsY.js +6 -0
- package/dist/{components/list.i18n-CKqbhFQ_.js → cdn/chunks/list.i18n-C40ltgdI.js} +2 -2
- package/dist/cdn/chunks/loading-tags-DtUr-DR7.js +3 -0
- package/dist/cdn/chunks/menu-BOu_pD1Q.js +719 -0
- package/dist/cdn/chunks/menu-bar-0NFXvq-v.js +253 -0
- package/dist/cdn/chunks/menu-bar-item-DGSC_ETi.js +365 -0
- package/dist/cdn/chunks/menu-bar.i18n-BoMu4Eoz.js +3 -0
- package/dist/cdn/chunks/menu-divider-CLLRgMll.js +15 -0
- package/dist/cdn/chunks/menu-group-BL24ChpR.js +23 -0
- package/dist/cdn/chunks/menu-item-CooKfrFa.js +140 -0
- package/dist/cdn/chunks/menu.i18n-C6uYJsG3.js +10 -0
- package/dist/cdn/chunks/menu.template-C6rbfI-u.js +642 -0
- package/dist/cdn/chunks/modal-dialog-BrUMP4Jm.js +240 -0
- package/dist/cdn/chunks/multi-line-text-field-D7hXhyOn.js +318 -0
- package/dist/cdn/chunks/navigation-split-view-B2ZQhxEb.js +621 -0
- package/dist/cdn/chunks/nl.generated-D6T41jG3.js +112 -0
- package/dist/cdn/chunks/notification-DSGP14d1.js +492 -0
- package/dist/cdn/chunks/notification.i18n-BKUSLN5c.js +6 -0
- package/dist/cdn/chunks/number-field-B8op14Y_.js +301 -0
- package/dist/cdn/chunks/number-field.i18n-BS0bINWY.js +7 -0
- package/dist/cdn/chunks/one-half-one-half-section-ZYmHYf4Q.js +213 -0
- package/dist/cdn/chunks/one-third-two-thirds-section-Ds10K6AS.js +213 -0
- package/dist/cdn/chunks/one-time-code-field-Cgy_tTS4.js +693 -0
- package/dist/cdn/chunks/open-when-rendered-CW_2_WUZ.js +20 -0
- package/dist/cdn/chunks/owned-attribute-x9OCTy_4.js +6 -0
- package/dist/cdn/chunks/owner-form-Cq8tT7ac.js +7 -0
- package/dist/cdn/chunks/page-CBf_Decp.js +431 -0
- package/dist/cdn/chunks/page-footer-CSv1dU7M.js +396 -0
- package/dist/cdn/chunks/page-footer.i18n-pbdr4lN3.js +3 -0
- package/dist/cdn/chunks/page-section-mixin-Dp6X8GKd.js +132 -0
- package/dist/cdn/chunks/pagination-CMUcFB53.js +485 -0
- package/dist/cdn/chunks/pagination.i18n-QQMx14CQ.js +9 -0
- package/dist/cdn/chunks/password-field-C76Vm3rm.js +368 -0
- package/dist/cdn/chunks/password-field.i18n-CzdBn-1b.js +8 -0
- package/dist/cdn/chunks/popover-C-CVVtfl.js +334 -0
- package/dist/cdn/chunks/popover-target-B25dxnmt.js +10 -0
- package/dist/cdn/chunks/popover.i18n-DmFBHUvB.js +3 -0
- package/dist/cdn/chunks/popup-anchor-controller-VZw0bXf2.js +30 -0
- package/dist/cdn/chunks/progress-bar-BLiHaRUS.js +674 -0
- package/dist/cdn/chunks/progress-bar.i18n-Cr5miGTx.js +8 -0
- package/dist/cdn/chunks/progress-circle-CjkovRbL.js +667 -0
- package/dist/cdn/chunks/progress-circle.i18n-CRrXuY4V.js +8 -0
- package/dist/cdn/chunks/query-ChDzi9FQ.js +28 -0
- package/dist/cdn/chunks/radio-button-GHyO-GQB.js +338 -0
- package/dist/cdn/chunks/radio-button-field-C-Z6Lnd4.js +192 -0
- package/dist/cdn/chunks/radio-button-group-ChTqBCnQ.js +118 -0
- package/dist/cdn/chunks/radio-position-CXWYAjaz.js +10 -0
- package/dist/cdn/chunks/reflect-non-default-Bu3rpCvg.js +9 -0
- package/dist/cdn/chunks/render-marked-DX_5ISZE.js +37 -0
- package/dist/cdn/chunks/repeat-Ch_5OsXE.js +76 -0
- package/dist/cdn/chunks/return-focus-Xmagtk6r.js +52 -0
- package/dist/cdn/chunks/rich-text-CQ2uwMSp.js +47 -0
- package/dist/cdn/chunks/rich-text.i18n-BlJ68YuU.js +3 -0
- package/dist/cdn/chunks/row-header-mixin-CgqvREoV.js +16 -0
- package/dist/cdn/chunks/sanitize-url-CBuGmY0W.js +7 -0
- package/dist/cdn/chunks/scroll-mode-controller-COUD1-3P.js +42 -0
- package/dist/cdn/chunks/search-field-BGNfERhn.js +396 -0
- package/dist/cdn/chunks/search-field.i18n-B_Oc7hc-.js +6 -0
- package/dist/cdn/chunks/segmented-control-BYAG4VRp.js +671 -0
- package/dist/cdn/chunks/shadow-resets-6SToDsPu.js +12 -0
- package/dist/cdn/chunks/sheet-BdVCqm2H.js +340 -0
- package/dist/cdn/chunks/shell-C9rds_D9.js +146 -0
- package/dist/cdn/chunks/shell-DmJOYhyF.js +108 -0
- package/dist/cdn/chunks/side-by-side-split-view-C5oX4c6Z.js +166 -0
- package/dist/cdn/chunks/sidebar-section-DP4jnS7g.js +353 -0
- package/dist/cdn/chunks/sidebar-section.i18n-BuGfRMpD.js +6 -0
- package/dist/cdn/chunks/simple-section-qrCqXeBa.js +192 -0
- package/dist/cdn/chunks/skip-link-DWh4W6-J.js +161 -0
- package/dist/cdn/chunks/skip-link.i18n--PbEdAmJ.js +3 -0
- package/dist/cdn/chunks/slider--hODfOwh.js +772 -0
- package/dist/cdn/chunks/slider.i18n-DVw0c8AG.js +6 -0
- package/dist/cdn/chunks/slot-content-BLuPqVXw.js +13 -0
- package/dist/cdn/chunks/spacer-CFzq_JCh.js +237 -0
- package/dist/cdn/chunks/spacer-cell-DuVOgIj8.js +68 -0
- package/dist/cdn/chunks/spacing-scale-SufIjHeN.js +28 -0
- package/dist/cdn/chunks/split-button-BeXnOUTt.js +268 -0
- package/dist/cdn/chunks/split-button.i18n-DtClSMga.js +3 -0
- package/dist/cdn/chunks/split-view-divider-jzcPmnMh.js +100 -0
- package/dist/cdn/chunks/split-view-pane-BLsZz263.js +128 -0
- package/dist/cdn/chunks/stacked-split-view-CcOR8LrJ.js +157 -0
- package/dist/cdn/chunks/static-html-Cf4ccUIg.js +26 -0
- package/dist/cdn/chunks/status-bar-CINbOihq.js +284 -0
- package/dist/cdn/chunks/status-bar-change-CR9l0Gyk.js +3 -0
- package/dist/cdn/chunks/step-bar-6FvZL1Ti.js +474 -0
- package/dist/cdn/chunks/step-bar.i18n-DocExlD7.js +9 -0
- package/dist/cdn/chunks/step-cell-CejRisgS.js +287 -0
- package/dist/cdn/chunks/stepper-CY2rJWOJ.js +223 -0
- package/dist/cdn/chunks/stepper.i18n-COOAkaBl.js +7 -0
- package/dist/cdn/chunks/style-map-DsIw6lkq.js +29 -0
- package/dist/cdn/chunks/style-mod-DGMhzWuk.js +1583 -0
- package/dist/cdn/chunks/swatch-picker-BY3DBIl6.js +430 -0
- package/dist/cdn/chunks/swatch-picker.i18n-_G0nmnGe.js +22 -0
- package/dist/cdn/chunks/switch-DDSsZFwK.js +275 -0
- package/dist/cdn/chunks/switch-field-CMoM9I38.js +137 -0
- package/dist/cdn/chunks/tab-bar-DmslEoPD.js +697 -0
- package/dist/cdn/chunks/tab-bar.i18n-Crsc7ShA.js +3 -0
- package/dist/cdn/chunks/table-DwXjCSD5.js +308 -0
- package/dist/cdn/chunks/table.i18n-Bmb_uw_w.js +3 -0
- package/dist/cdn/chunks/tag-DM3APy3B.js +306 -0
- package/dist/cdn/chunks/text-B1CatNR1.js +421 -0
- package/dist/cdn/chunks/text-cell-BkEsGI3g.js +299 -0
- package/dist/cdn/chunks/text-editor-BvTiMeNV.js +3743 -0
- package/dist/cdn/chunks/text-editor.i18n-sJKiRQ4i.js +17 -0
- package/dist/cdn/chunks/text-field-CUyh1-V8.js +398 -0
- package/dist/cdn/chunks/time-field-Cj5WojfO.js +597 -0
- package/dist/cdn/chunks/time-field.i18n-CLH5vmS7.js +11 -0
- package/dist/cdn/chunks/time-picker-W0xYXLy8.js +508 -0
- package/dist/cdn/chunks/time-picker.i18n-BilOCXlS.js +7 -0
- package/dist/cdn/chunks/title-BuT7tWqN.js +437 -0
- package/dist/cdn/chunks/title-bar-label-controller-DSxdKZOg.js +24 -0
- package/dist/cdn/chunks/title-cell-8d8psUBX.js +327 -0
- package/dist/cdn/chunks/toggle-button-DNXWXZpE.js +528 -0
- package/dist/cdn/chunks/toggle-button-group-ByowJYgs.js +156 -0
- package/dist/cdn/chunks/token-CnkEB3hB.js +266 -0
- package/dist/cdn/chunks/token-field-hvDB3l6O.js +664 -0
- package/dist/cdn/chunks/token-field.i18n-BclzoR8F.js +9 -0
- package/dist/cdn/chunks/token.i18n-RGD5zAtl.js +7 -0
- package/dist/cdn/chunks/toml-w97zZfFO.js +27 -0
- package/dist/cdn/chunks/toolbar-iNd1VmuG.js +408 -0
- package/dist/cdn/chunks/toolbar-item-DpPfPxCi.js +50 -0
- package/dist/cdn/chunks/toolbar-title-KBMpfL9d.js +84 -0
- package/dist/cdn/chunks/toolbar.i18n-QwS37CBC.js +8 -0
- package/dist/cdn/chunks/toolbar.styles-BQkG4gVc.js +383 -0
- package/dist/cdn/chunks/tooltip-BsAHJjci.js +325 -0
- package/dist/cdn/chunks/top-navigation-bar-D1hjWIF3.js +925 -0
- package/dist/cdn/chunks/top-navigation-bar.i18n-C-lcH1nB.js +10 -0
- package/dist/cdn/chunks/top-title-bar-iNFB2zQL.js +344 -0
- package/dist/cdn/chunks/translations-wxBSz213.js +8 -0
- package/dist/cdn/chunks/two-thirds-one-third-section-D-UANbHC.js +213 -0
- package/dist/cdn/chunks/validation-list-C5BhHZIG.js +202 -0
- package/dist/cdn/chunks/validation-list.i18n-CM6In8zD.js +12 -0
- package/dist/cdn/chunks/visibility-mixin-COAZ9pON.js +74 -0
- package/dist/cdn/chunks/visually-hidden-BPgATaH0.js +43 -0
- package/dist/cdn/chunks/window-t5iFkMLY.js +227 -0
- package/dist/cdn/chunks/window.i18n-CsEnUPAk.js +3 -0
- package/dist/cdn/chunks/with-translations-XX14GKFh.js +16 -0
- package/dist/components/actions/menu/menu-item.d.ts +6 -2
- package/dist/components/actions/menu/menu-item.d.ts.map +1 -1
- package/dist/components/actions/menu/menu-item.js +12 -1
- package/dist/components/actions/menu/menu-item.js.map +1 -1
- package/dist/components/actions/menu/menu.js +1 -1
- package/dist/components/actions/menu/menu.js.map +1 -1
- package/dist/components/actions/menu/menu.template.d.ts.map +1 -1
- package/dist/components/actions/menu/menu.template.js +2 -1
- package/dist/components/actions/menu/menu.template.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +22 -2
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +67 -11
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/layout/container/container.d.ts +15 -2
- package/dist/components/layout/container/container.d.ts.map +1 -1
- package/dist/components/layout/container/container.js +38 -3
- package/dist/components/layout/container/container.js.map +1 -1
- package/dist/components/layout/container/container.styles.js +1 -1
- package/dist/components/layout/container/container.template.js +1 -1
- package/dist/components/layout/container/container.template.js.map +1 -1
- package/dist/components/lists-and-tables/list-item/list-item.d.ts +7 -0
- 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 +13 -3
- 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 +11 -1
- 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 +19 -3
- package/dist/components/lists-and-tables/list-item-segment/list-item-segment.js.map +1 -1
- package/dist/nldd.min.js +298 -298
- package/dist/types/react.d.ts +3323 -0
- package/dist/types/vue.d.ts +11 -3
- package/dist/utilities/autoloader.d.ts +33 -0
- package/dist/utilities/autoloader.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.d.ts +3 -0
- package/dist/utilities/autoloader.generated.d.ts.map +1 -0
- package/dist/utilities/autoloader.generated.js +141 -0
- package/dist/utilities/autoloader.generated.js.map +1 -0
- package/dist/utilities/autoloader.js +94 -0
- package/dist/utilities/autoloader.js.map +1 -0
- package/dist/utilities/dev-checks.d.ts +9 -0
- package/dist/utilities/dev-checks.d.ts.map +1 -1
- package/dist/utilities/dev-checks.js +45 -3
- 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 +12 -2
- package/dist/utilities/dev-rules.generated.js.map +1 -1
- package/dist/utilities/loading-tags.d.ts +7 -0
- package/dist/utilities/loading-tags.d.ts.map +1 -0
- package/dist/utilities/loading-tags.js +7 -0
- package/dist/utilities/loading-tags.js.map +1 -0
- package/dist/utilities/owner-form.d.ts +3 -3
- package/dist/utilities/owner-form.d.ts.map +1 -1
- package/dist/utilities/owner-form.js +6 -3
- package/dist/utilities/owner-form.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/package.json +50 -11
- package/dist/components/breakpoints-DtL62nLI.js +0 -45
- package/dist/components/components.js +0 -68243
- package/dist/components/decorate-DD7uUxHb.js +0 -51
- package/dist/components/defer-focus-dzorHsCQ.js +0 -176
- package/dist/components/dev-checks-CLB9G43h.js +0 -2711
- package/dist/components/dist-245LaK9m.js +0 -1479
- package/dist/components/dist-BFZM0YsR.js +0 -15772
- package/dist/components/dist-BNkeFjc3.js +0 -1180
- package/dist/components/dist-CSC1dG3L.js +0 -365
- package/dist/components/dist-CeMOOqgP.js +0 -1509
- package/dist/components/dist-DFjwTlJV.js +0 -624
- package/dist/components/dist-DHhnz3Gv.js +0 -381
- package/dist/components/dist-PeUX4vPq.js +0 -2857
- package/dist/components/dist-m70B83qb.js +0 -463
- package/dist/components/element-state-BnarBv0M.js +0 -42
- package/dist/components/gherkin-DzYbEwDO.js +0 -107
- package/dist/components/icon-button-8gvQCwCW.js +0 -2305
- package/dist/components/input-modality-D_CY185R.js +0 -48
- package/dist/components/just-in-time-education.i18n-BqU1ImP4.js +0 -423
- package/dist/components/nl.generated-DzZkOgnP.js +0 -64
- package/dist/components/rolldown-runtime-D8jQpDG7.js +0 -12
- package/dist/components/shadow-resets-BwOyyZFH.js +0 -60
- package/dist/components/shell-Dh5IwHd-.js +0 -222
- package/dist/components/toml-D0Pix_8Q.js +0 -58
- package/dist/components/visibility-mixin-Dzn48SL8.js +0 -153
|
@@ -0,0 +1,880 @@
|
|
|
1
|
+
import { r as e } from "./icon-BORlalt0.js";
|
|
2
|
+
import { i as t, n, t as r } from "./custom-element-q6NzoL5b.js";
|
|
3
|
+
import { n as i, o as a, r as o, t as s } from "./decorate-TduJMFD_.js";
|
|
4
|
+
import { t as c } from "./custom-element-BW8Ua4c7.js";
|
|
5
|
+
import { t as l } from "./query-ChDzi9FQ.js";
|
|
6
|
+
import { t as u } from "./reflect-non-default-Bu3rpCvg.js";
|
|
7
|
+
import { r as d } from "./element-state-B-44fVqq.js";
|
|
8
|
+
import { t as f } from "./translations-wxBSz213.js";
|
|
9
|
+
import "./icon-button-rKiIHs7A.js";
|
|
10
|
+
import "./inline-dialog-WlqtPBPJ.js";
|
|
11
|
+
import { t as p } from "./if-defined-CaKKERku.js";
|
|
12
|
+
import { t as m } from "./list.i18n-C40ltgdI.js";
|
|
13
|
+
// src/components/lists-and-tables/list/list.styles.ts
|
|
14
|
+
var h = t`
|
|
15
|
+
:host {
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/* Nothing in it, nothing said about it and no controls of its own: not a
|
|
20
|
+
thing on the page, so a parent that spaces its children keeps no room for
|
|
21
|
+
it either. The surface is already gone with .list__main; this takes the
|
|
22
|
+
box out of the flow. */
|
|
23
|
+
:host(.is-blank) {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/* # Host */
|
|
29
|
+
|
|
30
|
+
:host {
|
|
31
|
+
--_list-drag-clone-top: 0px;
|
|
32
|
+
--_list-drag-clone-left: 0px;
|
|
33
|
+
--_list-drag-clone-opacity: 0.95;
|
|
34
|
+
--_list-drag-clone-z-index: 100;
|
|
35
|
+
--_list-drag-clone-width: 0px;
|
|
36
|
+
--_list-drag-clone-height: 0px;
|
|
37
|
+
--_list-max-height: none;
|
|
38
|
+
--_list-background-color: transparent;
|
|
39
|
+
--_list-highlight-border-color: transparent;
|
|
40
|
+
--_list-box-padding: var(--primitives-space-4);
|
|
41
|
+
--_list-gap: var(--primitives-space-8);
|
|
42
|
+
--_list-search-field-min-size: var(--semantics-controls-md-min-size);
|
|
43
|
+
--_list-search-field-icon-size: var(--primitives-space-24);
|
|
44
|
+
--_list-search-field-end-padding-right: calc((var(--_list-search-field-min-size) - var(--semantics-controls-sm-min-size)) / 2 - var(--semantics-input-fields-border-width));
|
|
45
|
+
--_list-search-field-button-focus-z-index: 1;
|
|
46
|
+
--_list-search-bar-gap: var(--primitives-space-8);
|
|
47
|
+
--_list-toolbar-gap: var(--primitives-space-8);
|
|
48
|
+
--_list-empty-padding: var(--primitives-space-16);
|
|
49
|
+
--_list-drag-placeholder-background-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-150));
|
|
50
|
+
|
|
51
|
+
display: block;
|
|
52
|
+
position: relative;
|
|
53
|
+
width: 100%;
|
|
54
|
+
isolation: isolate;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
:host([hidden]) {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:host([dividers="never"]),
|
|
62
|
+
:host([dividers="on-touch"]) {
|
|
63
|
+
--context-list-divider-display: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@media (pointer: coarse) {
|
|
67
|
+
:host([dividers="on-touch"]) {
|
|
68
|
+
--context-list-divider-display: block;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
:host([appearance^="box"]) {
|
|
73
|
+
--_list-background-color: var(--semantics-surfaces-tinted-background-color);
|
|
74
|
+
--_list-highlight-border-color: var(--semantics-surfaces-tinted-highlight-border-color);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
:host([appearance="box-base"]) {
|
|
78
|
+
--_list-background-color: var(--semantics-surfaces-base-background-color);
|
|
79
|
+
--_list-highlight-border-color: var(--semantics-surfaces-base-highlight-border-color);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
/* # Block */
|
|
84
|
+
|
|
85
|
+
.list {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: var(--_list-gap);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
/* # Elements */
|
|
93
|
+
|
|
94
|
+
.list__header {
|
|
95
|
+
display: contents;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.list__toolbar {
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: var(--_list-toolbar-gap);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.list__toolbar[hidden] {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.list__search-bar[hidden] {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.list__main {
|
|
115
|
+
display: flex;
|
|
116
|
+
flex-direction: column;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/* No overflow clip: the rows sit 4px inside the frame, so their fills never
|
|
120
|
+
reach its corners and have nothing to be clipped against. Without it a
|
|
121
|
+
focus ring inside the box paints outward, like every other control in the
|
|
122
|
+
system, instead of being cut off by the frame. */
|
|
123
|
+
:host([appearance^="box"]) .list__main {
|
|
124
|
+
position: relative;
|
|
125
|
+
border-radius: var(--semantics-surfaces-corner-radius);
|
|
126
|
+
background-color: var(--_list-background-color);
|
|
127
|
+
box-shadow: inset 0 0 0 1px var(--_list-highlight-border-color);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/* Listbox: give the options a bit more breathing room from the pinned
|
|
131
|
+
search bar (and toolbar) above them than the default inter-row gap, so
|
|
132
|
+
the search field reads as a zone distinct from the scrolling options. */
|
|
133
|
+
|
|
134
|
+
:host([type="listbox"]) .list__main {
|
|
135
|
+
margin-block-start: var(--primitives-space-8);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.list__main[hidden] {
|
|
139
|
+
display: none;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.list__items {
|
|
143
|
+
display: flex;
|
|
144
|
+
flex-direction: column;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.list__items[hidden] {
|
|
148
|
+
display: none;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
:host([appearance^="box"]) .list__items {
|
|
152
|
+
padding-inline: calc(var(--semantics-list-items-indicator-inline-inset) + var(--_list-box-padding));
|
|
153
|
+
padding-block: var(--_list-box-padding);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
:host([type="listbox"]) .list__items {
|
|
157
|
+
max-height: var(--_list-max-height);
|
|
158
|
+
overflow-x: hidden;
|
|
159
|
+
overflow-y: auto;
|
|
160
|
+
padding-inline: var(--semantics-list-items-indicator-inline-inset);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.list__empty {
|
|
164
|
+
padding: var(--_list-empty-padding);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.list__empty[hidden] {
|
|
168
|
+
display: none;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.list__search-bar {
|
|
172
|
+
display: flex;
|
|
173
|
+
flex-direction: row;
|
|
174
|
+
align-items: center;
|
|
175
|
+
gap: var(--_list-search-bar-gap);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.list__search-bar-end {
|
|
179
|
+
display: flex;
|
|
180
|
+
flex-shrink: 0;
|
|
181
|
+
flex-direction: row;
|
|
182
|
+
align-items: center;
|
|
183
|
+
gap: var(--_list-search-bar-gap);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.list__search-bar-end[hidden] {
|
|
187
|
+
display: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.list__search-field {
|
|
191
|
+
box-sizing: border-box;
|
|
192
|
+
display: flex;
|
|
193
|
+
position: relative;
|
|
194
|
+
border: var(--semantics-input-fields-border);
|
|
195
|
+
border-radius: var(--semantics-controls-md-corner-radius);
|
|
196
|
+
background-color: var(--semantics-input-fields-background-color);
|
|
197
|
+
width: 100%;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
min-height: var(--_list-search-field-min-size);
|
|
200
|
+
flex-direction: row;
|
|
201
|
+
align-items: center;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.list__search-field:has(.list__search-field-input:focus-visible) {
|
|
205
|
+
outline: var(--semantics-focus-ring-outline);
|
|
206
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
207
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.list__search-field-label {
|
|
211
|
+
display: flex;
|
|
212
|
+
min-width: 0;
|
|
213
|
+
flex-grow: 1;
|
|
214
|
+
align-self: stretch;
|
|
215
|
+
flex-direction: row;
|
|
216
|
+
align-items: center;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.list__search-field-icon {
|
|
220
|
+
display: flex;
|
|
221
|
+
margin-inline: calc((var(--_list-search-field-min-size) - var(--_list-search-field-icon-size)) / 2 - var(--semantics-input-fields-border-width));
|
|
222
|
+
width: var(--_list-search-field-icon-size);
|
|
223
|
+
height: var(--_list-search-field-icon-size);
|
|
224
|
+
flex-shrink: 0;
|
|
225
|
+
align-items: center;
|
|
226
|
+
justify-content: center;
|
|
227
|
+
color: var(--semantics-content-secondary-color);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.list__search-field-input {
|
|
231
|
+
box-sizing: border-box;
|
|
232
|
+
margin: 0;
|
|
233
|
+
outline: none;
|
|
234
|
+
border: none;
|
|
235
|
+
background: transparent;
|
|
236
|
+
min-width: 0;
|
|
237
|
+
padding: 0;
|
|
238
|
+
flex-grow: 1;
|
|
239
|
+
flex-shrink: 1;
|
|
240
|
+
flex-basis: 0;
|
|
241
|
+
align-self: stretch;
|
|
242
|
+
color: var(--semantics-content-color);
|
|
243
|
+
font: var(--semantics-input-fields-md-text-font);
|
|
244
|
+
appearance: none;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.list__search-field-input::placeholder {
|
|
248
|
+
color: var(--semantics-input-fields-placeholder-color);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.list__search-field-end {
|
|
252
|
+
display: flex;
|
|
253
|
+
position: relative;
|
|
254
|
+
padding-right: var(--_list-search-field-end-padding-right);
|
|
255
|
+
flex-shrink: 0;
|
|
256
|
+
align-items: center;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.list__search-field-clear:focus-within {
|
|
260
|
+
position: relative;
|
|
261
|
+
z-index: var(--_list-search-field-button-focus-z-index);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
::slotted(.nldd-list-drag-placeholder) {
|
|
265
|
+
box-sizing: border-box;
|
|
266
|
+
border-radius: var(--semantics-list-items-indicator-corner-radius);
|
|
267
|
+
background-color: var(--_list-drag-placeholder-background-color);
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.list__drag-clone {
|
|
272
|
+
display: flex;
|
|
273
|
+
position: absolute;
|
|
274
|
+
top: var(--_list-drag-clone-top);
|
|
275
|
+
left: var(--_list-drag-clone-left);
|
|
276
|
+
opacity: var(--_list-drag-clone-opacity);
|
|
277
|
+
z-index: var(--_list-drag-clone-z-index);
|
|
278
|
+
border-radius: var(--semantics-list-items-indicator-corner-radius);
|
|
279
|
+
background: var(--semantics-surfaces-base-background-color);
|
|
280
|
+
pointer-events: none;
|
|
281
|
+
width: var(--_list-drag-clone-width);
|
|
282
|
+
height: var(--_list-drag-clone-height);
|
|
283
|
+
overflow: hidden;
|
|
284
|
+
flex-direction: row;
|
|
285
|
+
align-items: stretch;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
.list__polite-announcer,
|
|
289
|
+
.list__assertive-announcer {
|
|
290
|
+
position: absolute;
|
|
291
|
+
margin: -1px;
|
|
292
|
+
border: 0;
|
|
293
|
+
width: 1px;
|
|
294
|
+
height: 1px;
|
|
295
|
+
overflow: hidden;
|
|
296
|
+
padding: 0;
|
|
297
|
+
white-space: nowrap;
|
|
298
|
+
clip-path: inset(50%);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
/* # High Contrast */
|
|
303
|
+
|
|
304
|
+
@media (forced-colors: active) {
|
|
305
|
+
:host([appearance^="box"]) .list__main {
|
|
306
|
+
border: 1px solid CanvasText;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
`, g = ({ itemsLabel: e, hasToolbar: t, type: n, isEmpty: r, hasItems: i, hasEmptyState: s, hasNoResultsState: c, listbox: l }) => {
|
|
310
|
+
let u = n === "navigation", d = n === "listbox", f = u || d, m = d ? "listbox" : n === "tree" ? "tree" : n === "radiogroup" ? "radiogroup" : "list", h = r && i, g = d && l.searchValue === "", _ = h && !c && s, v = h && c && !g, y = (!h && r && s || _) && !g, b = !r || y || v, x = i || d;
|
|
311
|
+
return a`
|
|
312
|
+
<div class="list">
|
|
313
|
+
<div class="list__header">
|
|
314
|
+
${d ? a`
|
|
315
|
+
<div class="list__search-bar"
|
|
316
|
+
?hidden=${!x}
|
|
317
|
+
>
|
|
318
|
+
<div class="list__search-field">
|
|
319
|
+
<label class="list__search-field-label">
|
|
320
|
+
<div class="list__search-field-icon"
|
|
321
|
+
aria-hidden="true"
|
|
322
|
+
>
|
|
323
|
+
<nldd-icon icon="search"></nldd-icon>
|
|
324
|
+
</div>
|
|
325
|
+
<input class="list__search-field-input"
|
|
326
|
+
type="text"
|
|
327
|
+
role="combobox"
|
|
328
|
+
aria-controls=${l.listboxId}
|
|
329
|
+
aria-expanded=${!r}
|
|
330
|
+
aria-autocomplete="list"
|
|
331
|
+
aria-activedescendant=${l.activeId || o}
|
|
332
|
+
aria-label=${l.searchAccessibleLabel}
|
|
333
|
+
placeholder=${l.searchPlaceholder}
|
|
334
|
+
.value=${l.searchValue}
|
|
335
|
+
@input=${l.onSearchInput}
|
|
336
|
+
@keydown=${l.onSearchKeyDown}
|
|
337
|
+
@focus=${l.onSearchFocus}
|
|
338
|
+
@blur=${l.onSearchBlur}
|
|
339
|
+
>
|
|
340
|
+
</label>
|
|
341
|
+
${l.searchValue ? a`
|
|
342
|
+
<div class="list__search-field-end">
|
|
343
|
+
<div class="list__search-field-clear">
|
|
344
|
+
<nldd-icon-button
|
|
345
|
+
appearance="neutral-transparent"
|
|
346
|
+
size="sm"
|
|
347
|
+
icon="dismiss"
|
|
348
|
+
text=${l.searchClearLabel}
|
|
349
|
+
tooltip-timing="never"
|
|
350
|
+
@click=${l.onClearClick}
|
|
351
|
+
></nldd-icon-button>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
` : o}
|
|
355
|
+
</div>
|
|
356
|
+
<div class="list__search-bar-end"
|
|
357
|
+
?hidden=${!l.hasSearchBarEnd}
|
|
358
|
+
>
|
|
359
|
+
<slot
|
|
360
|
+
name="search-bar-end"
|
|
361
|
+
@slotchange=${l.onSearchBarEndSlotChange}
|
|
362
|
+
></slot>
|
|
363
|
+
</div>
|
|
364
|
+
</div>
|
|
365
|
+
` : o}
|
|
366
|
+
<div class="list__toolbar"
|
|
367
|
+
?hidden=${!t || !x}
|
|
368
|
+
>
|
|
369
|
+
<slot name="toolbar"></slot>
|
|
370
|
+
</div>
|
|
371
|
+
</div>
|
|
372
|
+
<div class="list__main"
|
|
373
|
+
?hidden=${!b}
|
|
374
|
+
>
|
|
375
|
+
<div class="list__items"
|
|
376
|
+
id=${p(d ? l.listboxId : void 0)}
|
|
377
|
+
role=${m}
|
|
378
|
+
aria-label=${p(f ? void 0 : e)}
|
|
379
|
+
?hidden=${r}
|
|
380
|
+
>
|
|
381
|
+
<slot></slot>
|
|
382
|
+
</div>
|
|
383
|
+
<div class="list__empty"
|
|
384
|
+
?hidden=${!y && !v}
|
|
385
|
+
>
|
|
386
|
+
<slot
|
|
387
|
+
name="empty"
|
|
388
|
+
?hidden=${!y}
|
|
389
|
+
></slot>
|
|
390
|
+
<slot
|
|
391
|
+
name="no-results"
|
|
392
|
+
?hidden=${!v}
|
|
393
|
+
></slot>
|
|
394
|
+
</div>
|
|
395
|
+
</div>
|
|
396
|
+
</div>
|
|
397
|
+
<div class="list__polite-announcer"
|
|
398
|
+
role="status"
|
|
399
|
+
aria-live="polite"
|
|
400
|
+
aria-atomic="true"
|
|
401
|
+
></div>
|
|
402
|
+
<div class="list__assertive-announcer"
|
|
403
|
+
role="alert"
|
|
404
|
+
aria-live="assertive"
|
|
405
|
+
aria-atomic="true"
|
|
406
|
+
></div>
|
|
407
|
+
`;
|
|
408
|
+
}, _ = /* @__PURE__ */ e({ NLDDList: () => x }), v, y, b = ":is(a[href], button, input, select, textarea, [tabindex]):not([tabindex^=\"-\"]):not(:disabled)", x = (v = class extends i {
|
|
409
|
+
constructor(...e) {
|
|
410
|
+
super(...e), this.appearance = "simple", this.type = "list", this.dividers = "always", this.height = "", this.accessibleLabel = "", this.translations = {}, this.reorderable = !1, this._hasToolbar = !1, this._hasSearchBarEnd = !1, this._hasEmptyState = !1, this._hasNoResultsState = !1, this._hasItems = !1, this._isEmpty = !1, this._searchValue = "", this._activeId = "", this._searchFocused = !1, this._listboxId = `nldd-list-listbox-${y._idCounter++}`, this._draggingEl = null, this._draggingFromIndex = -1, this._placeholder = null, this._currentDropIndex = -1, this._pointerId = null, this._clone = null, this._cloneOffsetY = 0, this._listRect = null, this._itemsObserver = null, this._autoLabel = null, this._contextScheduled = !1, this._listboxScheduled = !1, this._onSearchInput = (e) => {
|
|
411
|
+
e.stopPropagation();
|
|
412
|
+
let t = e.target;
|
|
413
|
+
this._searchValue = t.value, this._emitListboxInput(this._searchValue);
|
|
414
|
+
}, this._onClearClick = () => {
|
|
415
|
+
this._clearSearch();
|
|
416
|
+
}, this._onSearchBarEndSlotChange = (e) => {
|
|
417
|
+
let t = e.target;
|
|
418
|
+
queueMicrotask(() => {
|
|
419
|
+
this._hasSearchBarEnd = t.assignedElements().length > 0;
|
|
420
|
+
});
|
|
421
|
+
}, this._onSearchFocus = () => {
|
|
422
|
+
this._searchFocused = !0, this._applyListboxOptions();
|
|
423
|
+
}, this._onSearchBlur = () => {
|
|
424
|
+
this._searchFocused = !1, this._syncHighlight();
|
|
425
|
+
}, this._onListClick = (e) => {
|
|
426
|
+
if (this.type !== "listbox") return;
|
|
427
|
+
let t = e.target?.closest?.("nldd-list-item");
|
|
428
|
+
t && t.parentElement === this && !t.hasAttribute("hidden") && (this._activeId = this._ensureOptionId(t));
|
|
429
|
+
}, this._onSearchKeyDown = (e) => {
|
|
430
|
+
let { key: t } = e;
|
|
431
|
+
if (t === "Escape") {
|
|
432
|
+
this._searchValue !== "" && (e.preventDefault(), this._clearSearch());
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
if (t === "Enter") {
|
|
436
|
+
let t = this._activeItem;
|
|
437
|
+
t && (e.preventDefault(), t.shadowRoot?.querySelector(".list-item__action")?.click(), this._searchInput?.focus());
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
if (t !== "ArrowDown" && t !== "ArrowUp" && t !== "Home" && t !== "End") return;
|
|
441
|
+
let n = this._getVisibleItems();
|
|
442
|
+
if (n.length === 0) return;
|
|
443
|
+
e.preventDefault();
|
|
444
|
+
let r = n.findIndex((e) => e.id === this._activeId), i;
|
|
445
|
+
if (t === "Home") i = 0;
|
|
446
|
+
else if (t === "End") i = n.length - 1;
|
|
447
|
+
else {
|
|
448
|
+
let e = t === "ArrowDown" ? 1 : -1;
|
|
449
|
+
i = ((r === -1 ? e === 1 ? -1 : 0 : r) + e + n.length) % n.length;
|
|
450
|
+
}
|
|
451
|
+
this._setActiveOption(n[i]);
|
|
452
|
+
}, this._rovingScheduled = !1, this._popoverWasOpen = !1, this._onKeyDownCapture = (e) => {
|
|
453
|
+
if (e.key !== "Escape" || !this._arrowNavActive) return;
|
|
454
|
+
let t = this._origin(e);
|
|
455
|
+
this._popoverWasOpen = !!t?.control && !!t.row.querySelector(":popover-open");
|
|
456
|
+
}, this._onFocusIn = (e) => {
|
|
457
|
+
if (!this._arrowNavActive) return;
|
|
458
|
+
let t = e.composedPath().find((e) => e instanceof Element && e.tagName.toLowerCase() === "nldd-list-item");
|
|
459
|
+
t && !t._rovingActive && this._getInteractiveItems().includes(t) ? this._setRovingActive(t) : t?._rovingActive && t._syncRovingTabStops();
|
|
460
|
+
}, this._onFocusOut = () => {
|
|
461
|
+
this._arrowNavActive && queueMicrotask(() => {
|
|
462
|
+
this.isConnected && !this._containsFocus() && this._getAllRows().forEach((e) => {
|
|
463
|
+
e._parkControls();
|
|
464
|
+
});
|
|
465
|
+
});
|
|
466
|
+
}, this._unmanagedCheckScheduled = !1, this._onPointerDown = (e) => {
|
|
467
|
+
if (!this.reorderable || this.type !== "list") return;
|
|
468
|
+
let t = e.composedPath();
|
|
469
|
+
if (!t.some((e) => e instanceof Element && e.hasAttribute("reorderable-only"))) return;
|
|
470
|
+
let n = t.find((e) => e instanceof Element && e.tagName.toLowerCase() === "nldd-list-item");
|
|
471
|
+
n && (e.preventDefault(), this._lastPointerY = e.clientY, this._startDrag(n, e.clientY), t.find((e) => e instanceof HTMLButtonElement)?.focus(), this._pointerId = e.pointerId, this.setPointerCapture(e.pointerId), this.addEventListener("pointermove", this._onPointerMove), this.addEventListener("pointerup", this._onPointerUp), this.addEventListener("pointercancel", this._onPointerCancel));
|
|
472
|
+
}, this._lastPointerY = 0, this._onPointerMove = (e) => {
|
|
473
|
+
if (!this._draggingEl || !this._placeholder) return;
|
|
474
|
+
this._clone && (this._listRect = this.getBoundingClientRect(), this._clone.style.setProperty("--_list-drag-clone-top", `${e.clientY - this._listRect.top - this._cloneOffsetY}px`));
|
|
475
|
+
let t = e.clientY >= this._lastPointerY;
|
|
476
|
+
this._lastPointerY = e.clientY;
|
|
477
|
+
let n = this._getItems().filter((e) => e !== this._draggingEl), r = e.clientY, i = n.length;
|
|
478
|
+
for (let e = 0; e < n.length; e++) {
|
|
479
|
+
let a = (n[e].shadowRoot?.querySelector(".list-item") ?? n[e]).getBoundingClientRect();
|
|
480
|
+
if (r < (t ? a.top : a.bottom)) {
|
|
481
|
+
i = e;
|
|
482
|
+
break;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
this._setDropIndex(i);
|
|
486
|
+
}, this._onPointerUp = (e) => {
|
|
487
|
+
this._endDrag();
|
|
488
|
+
}, this._onPointerCancel = () => {
|
|
489
|
+
this._cancelDrag();
|
|
490
|
+
}, this._onKeyDown = (e) => {
|
|
491
|
+
if (this._arrowNavActive) {
|
|
492
|
+
if (e.key === "Escape") {
|
|
493
|
+
this._onEscape(e);
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
this._onArrowNav(e);
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (!this.reorderable || this.type !== "list" || e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
500
|
+
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement && e.hasAttribute("reorderable-only"));
|
|
501
|
+
if (!n) return;
|
|
502
|
+
let r = t.find((e) => e instanceof Element && e.tagName.toLowerCase() === "nldd-list-item");
|
|
503
|
+
if (!r) return;
|
|
504
|
+
let i = this._getItems(), a = i.indexOf(r);
|
|
505
|
+
if (a === -1) return;
|
|
506
|
+
let o = e.key === "ArrowUp" ? a - 1 : a + 1;
|
|
507
|
+
if (o < 0 || o >= i.length) return;
|
|
508
|
+
e.preventDefault();
|
|
509
|
+
let s = this._getDeepActiveElement() ?? n;
|
|
510
|
+
this.dispatchEvent(new CustomEvent("nldd-reorder", {
|
|
511
|
+
detail: {
|
|
512
|
+
fromIndex: a,
|
|
513
|
+
toIndex: o
|
|
514
|
+
},
|
|
515
|
+
bubbles: !0,
|
|
516
|
+
composed: !0
|
|
517
|
+
})), this._announce(this._t("components.list.reorder-moved-text", { position: o + 1 })), requestAnimationFrame(() => s.focus());
|
|
518
|
+
};
|
|
519
|
+
}
|
|
520
|
+
willUpdate(e) {
|
|
521
|
+
this.hasUpdated || (this._updateEmpty(), this._hasToolbar = this.querySelector(":scope > [slot=\"toolbar\"]") !== null, this._hasSearchBarEnd = this.querySelector(":scope > [slot=\"search-bar-end\"]") !== null);
|
|
522
|
+
}
|
|
523
|
+
firstUpdated() {
|
|
524
|
+
(this.shadowRoot?.querySelector("slot:not([name])"))?.addEventListener("slotchange", () => queueMicrotask(() => {
|
|
525
|
+
this._updateItems(), this._updateEmpty();
|
|
526
|
+
})), this._updateItems(), this._syncUnmanagedControls();
|
|
527
|
+
let e = this.shadowRoot?.querySelector("slot[name=\"toolbar\"]");
|
|
528
|
+
e?.addEventListener("slotchange", () => queueMicrotask(() => {
|
|
529
|
+
this._hasToolbar = e.assignedElements().length > 0;
|
|
530
|
+
})), (this.shadowRoot?.querySelector("slot[name=\"empty\"]"))?.addEventListener("slotchange", () => queueMicrotask(() => this._updateEmpty())), (this.shadowRoot?.querySelector("slot[name=\"no-results\"]"))?.addEventListener("slotchange", () => queueMicrotask(() => this._updateEmpty())), this._itemsObserver = new MutationObserver((e) => {
|
|
531
|
+
let t = (e) => e instanceof Element && e.tagName.toLowerCase() === "nldd-list-item";
|
|
532
|
+
e.some((e) => e.type === "childList" ? e.target === this || t(e.target) : e.type !== "attributes" || !t(e.target) ? !1 : e.attributeName === "expanded" || e.attributeName === "disabled" || e.attributeName === "hidden" && (e.target.parentElement === this || t(e.target.parentElement))) && (this._updateItems(), this._updateEmpty(), this._syncUnmanagedControls());
|
|
533
|
+
}), this._itemsObserver.observe(this, {
|
|
534
|
+
childList: !0,
|
|
535
|
+
subtree: !0,
|
|
536
|
+
attributes: !0,
|
|
537
|
+
attributeFilter: [
|
|
538
|
+
"hidden",
|
|
539
|
+
"expanded",
|
|
540
|
+
"disabled"
|
|
541
|
+
]
|
|
542
|
+
}), this._applyHostType();
|
|
543
|
+
}
|
|
544
|
+
connectedCallback() {
|
|
545
|
+
super.connectedCallback(), this.style.containerType = "inline-size", this.style.containerName = "cells-container", this.addEventListener("pointerdown", this._onPointerDown), this.addEventListener("keydown", this._onKeyDownCapture, !0), this.addEventListener("keydown", this._onKeyDown), this.addEventListener("focusin", this._onFocusIn), this.addEventListener("focusout", this._onFocusOut), this.addEventListener("click", this._onListClick);
|
|
546
|
+
}
|
|
547
|
+
disconnectedCallback() {
|
|
548
|
+
super.disconnectedCallback(), this.removeEventListener("pointerdown", this._onPointerDown), this.removeEventListener("keydown", this._onKeyDownCapture, !0), this.removeEventListener("keydown", this._onKeyDown), this.removeEventListener("focusin", this._onFocusIn), this.removeEventListener("focusout", this._onFocusOut), this.removeEventListener("click", this._onListClick), this._itemsObserver?.disconnect(), this._itemsObserver = null, this._cancelDrag();
|
|
549
|
+
}
|
|
550
|
+
updated(e) {
|
|
551
|
+
if (this._syncTranslatedTexts(), (e.has("reorderable") || e.has("type")) && (this._updateItems(), this._syncUnmanagedControls()), e.has("appearance") && this._updateItemContext(), e.has("dividers") && e.get("dividers") !== void 0 && this._getItems().forEach((e) => e._measureDividerMarkers()), e.has("type") && (this._applyHostType(), e.get("type") === "listbox" && this.type !== "listbox" && (this._activeId = "", this._getItems().forEach((e) => {
|
|
552
|
+
e._highlighted = !1;
|
|
553
|
+
}))), e.has("height")) {
|
|
554
|
+
let e = this.height;
|
|
555
|
+
e && CSS.supports("max-height", e) ? this.style.setProperty("--_list-max-height", e) : this.style.removeProperty("--_list-max-height");
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
_navigationLabel() {
|
|
559
|
+
return this.accessibleLabel || this._t("components.list.navigation-accessible-label");
|
|
560
|
+
}
|
|
561
|
+
_syncTranslatedTexts() {
|
|
562
|
+
this.hasAttribute("data-nldd-auto-label") && this.getAttribute("aria-label") === this._autoLabel && (this._autoLabel = this._navigationLabel(), this.setAttribute("aria-label", this._autoLabel)), this.hasAttribute("aria-keyshortcuts") && this.setAttribute("aria-description", this._t("components.list.arrow-navigation-description-text"));
|
|
563
|
+
}
|
|
564
|
+
_applyHostType() {
|
|
565
|
+
this.type === "navigation" ? (this.setAttribute("role", "navigation"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && (this._autoLabel = this._navigationLabel(), this.setAttribute("aria-label", this._autoLabel), this.setAttribute("data-nldd-auto-label", ""))) : (this.getAttribute("role") === "navigation" && this.removeAttribute("role"), this.hasAttribute("data-nldd-auto-label") && (this.getAttribute("aria-label") === this._autoLabel && this.removeAttribute("aria-label"), this.removeAttribute("data-nldd-auto-label"), this._autoLabel = null));
|
|
566
|
+
}
|
|
567
|
+
_getItems() {
|
|
568
|
+
return ((this.shadowRoot?.querySelector("slot:not([name])"))?.assignedElements() ?? []).filter((e) => e.tagName.toLowerCase() === "nldd-list-item" && !e.hasAttribute("data-nldd-placeholder"));
|
|
569
|
+
}
|
|
570
|
+
_getVisibleItems() {
|
|
571
|
+
return this._getItems().filter((e) => !e.hasAttribute("hidden"));
|
|
572
|
+
}
|
|
573
|
+
_getAllRows(e = this._getItems()) {
|
|
574
|
+
return e.flatMap((e) => [e, ...this._getAllRows(e.childRows)]);
|
|
575
|
+
}
|
|
576
|
+
_getPaintedRows(e = this._getItems()) {
|
|
577
|
+
return e.filter((e) => !e.hasAttribute("hidden")).flatMap((e) => e._childrenOpen ? [e, ...this._getPaintedRows(e.childRows)] : [e]);
|
|
578
|
+
}
|
|
579
|
+
_updateItems() {
|
|
580
|
+
let e = this._getItems(), t = this._getPaintedRows(e), n = t[0], r = t[t.length - 1], i = this.reorderable && this.type === "list";
|
|
581
|
+
this._getAllRows(e).forEach((e) => {
|
|
582
|
+
e.classList.toggle("is-first", e === n), e.classList.toggle("is-last", e === r);
|
|
583
|
+
}), e.forEach((e) => {
|
|
584
|
+
i ? e.setAttribute("reorderable", "") : e.removeAttribute("reorderable");
|
|
585
|
+
}), this._updateItemContext(), this._updateRoving(), this.type === "listbox" && this._updateListboxOptions();
|
|
586
|
+
}
|
|
587
|
+
_updateItemContext() {
|
|
588
|
+
this._contextScheduled || (this._contextScheduled = !0, queueMicrotask(() => {
|
|
589
|
+
this._contextScheduled = !1, this._applyItemContext();
|
|
590
|
+
}));
|
|
591
|
+
}
|
|
592
|
+
_applyItemContext() {
|
|
593
|
+
this._getItems().forEach((e) => {
|
|
594
|
+
e._applyAppearance(this.appearance), e._applyParentType(this.type);
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
_updateEmpty() {
|
|
598
|
+
let e = this.hasUpdated ? this._getItems() : Array.from(this.querySelectorAll(":scope > nldd-list-item"));
|
|
599
|
+
this._isEmpty = e.length === 0 || e.every((e) => e.hasAttribute("hidden")), this._hasItems = e.length > 0, this._hasEmptyState = !!this.querySelector(":scope > [slot=\"empty\"]"), this._hasNoResultsState = !!this.querySelector(":scope > [slot=\"no-results\"]"), this.classList.toggle("is-blank", this._isEmpty && !this._hasItems && !this._hasEmptyState && this.type !== "listbox");
|
|
600
|
+
let t = this._isEmpty && !(this.type === "listbox" && !this._searchValue);
|
|
601
|
+
d(this, "empty", t && !this._hasItems), d(this, "filtered", t && this._hasItems);
|
|
602
|
+
}
|
|
603
|
+
_ensureOptionId(e) {
|
|
604
|
+
return e.id || (e.id = `nldd-list-option-${y._optionIdCounter++}`), e.id;
|
|
605
|
+
}
|
|
606
|
+
_updateListboxOptions() {
|
|
607
|
+
this._listboxScheduled || (this._listboxScheduled = !0, queueMicrotask(() => {
|
|
608
|
+
this._listboxScheduled = !1, this._applyListboxOptions();
|
|
609
|
+
}));
|
|
610
|
+
}
|
|
611
|
+
_applyListboxOptions() {
|
|
612
|
+
if (this.type !== "listbox") return;
|
|
613
|
+
let e = this._getVisibleItems();
|
|
614
|
+
e.forEach((e) => this._ensureOptionId(e));
|
|
615
|
+
let t = e.find((e) => e.id === this._activeId) ?? e[0];
|
|
616
|
+
this._activeId = t?.id ?? "", this._syncHighlight();
|
|
617
|
+
}
|
|
618
|
+
_setActiveOption(e) {
|
|
619
|
+
this._activeId = this._ensureOptionId(e), this._syncHighlight(), e.scrollIntoView({ block: "nearest" });
|
|
620
|
+
}
|
|
621
|
+
_syncHighlight() {
|
|
622
|
+
let e = this._searchFocused ? this._activeItem : null;
|
|
623
|
+
this._getItems().forEach((t) => {
|
|
624
|
+
t._highlighted = t === e;
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
get _activeItem() {
|
|
628
|
+
return this._activeId ? this._getVisibleItems().find((e) => e.id === this._activeId) ?? null : null;
|
|
629
|
+
}
|
|
630
|
+
_emitListboxInput(e) {
|
|
631
|
+
this.dispatchEvent(new CustomEvent("input", {
|
|
632
|
+
detail: { value: e },
|
|
633
|
+
bubbles: !0,
|
|
634
|
+
composed: !0
|
|
635
|
+
}));
|
|
636
|
+
}
|
|
637
|
+
_clearSearch() {
|
|
638
|
+
this._searchValue = "", this._searchInput && (this._searchInput.value = ""), this._emitListboxInput(""), this._searchInput?.focus();
|
|
639
|
+
}
|
|
640
|
+
get _arrowNavActive() {
|
|
641
|
+
return this.type === "listbox" || this.type === "form" ? !1 : !(this.reorderable && this.type === "list");
|
|
642
|
+
}
|
|
643
|
+
_getInteractiveItems() {
|
|
644
|
+
let e = this._getPaintedRows();
|
|
645
|
+
return this.type === "tree" ? e : e.filter((e) => e._isRovingStop);
|
|
646
|
+
}
|
|
647
|
+
_updateRoving() {
|
|
648
|
+
this._rovingScheduled || (this._rovingScheduled = !0, queueMicrotask(() => {
|
|
649
|
+
this._rovingScheduled = !1, this._applyRoving();
|
|
650
|
+
}));
|
|
651
|
+
}
|
|
652
|
+
_applyRoving() {
|
|
653
|
+
let e = this._arrowNavActive, t = this._getAllRows();
|
|
654
|
+
t.forEach((t) => {
|
|
655
|
+
t._arrowNavigation = e;
|
|
656
|
+
});
|
|
657
|
+
let n = e ? this._getInteractiveItems() : [];
|
|
658
|
+
if (n.length > 0 ? (this.setAttribute("aria-keyshortcuts", "ArrowUp ArrowDown Home End"), this.setAttribute("aria-description", this._t("components.list.arrow-navigation-description-text"))) : (this.removeAttribute("aria-keyshortcuts"), this.removeAttribute("aria-description")), !e) {
|
|
659
|
+
t.forEach((e) => {
|
|
660
|
+
e._rovingActive = !1;
|
|
661
|
+
});
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
if (n.length === 0) return;
|
|
665
|
+
let r = n.find((e) => e._rovingActive) ?? n.find((e) => e.selected) ?? n[0];
|
|
666
|
+
t.forEach((e) => {
|
|
667
|
+
e._rovingActive = e === r, e._syncRovingTabStops();
|
|
668
|
+
});
|
|
669
|
+
}
|
|
670
|
+
_setRovingActive(e, t = this._getAllRows()) {
|
|
671
|
+
t.forEach((t) => {
|
|
672
|
+
t._rovingActive = t === e, t._syncRovingTabStops();
|
|
673
|
+
});
|
|
674
|
+
}
|
|
675
|
+
_containsFocus() {
|
|
676
|
+
let e = document.activeElement;
|
|
677
|
+
for (; e;) {
|
|
678
|
+
if (e === this || this.contains(e)) return !0;
|
|
679
|
+
e = e.shadowRoot?.activeElement ?? null;
|
|
680
|
+
}
|
|
681
|
+
return !1;
|
|
682
|
+
}
|
|
683
|
+
_origin(e) {
|
|
684
|
+
let t = e.composedPath(), n = t.find((e) => e instanceof Element && e.tagName.toLowerCase() === "nldd-list-item");
|
|
685
|
+
return n ? {
|
|
686
|
+
row: n,
|
|
687
|
+
control: n._slottedControlFor(t)
|
|
688
|
+
} : null;
|
|
689
|
+
}
|
|
690
|
+
_onArrowNav(e) {
|
|
691
|
+
let { key: t } = e;
|
|
692
|
+
if (this._origin(e)?.control) return;
|
|
693
|
+
if (this.type === "tree" && (t === "ArrowRight" || t === "ArrowLeft")) {
|
|
694
|
+
this._onTreeHorizontal(e, t);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
if (this.type === "tree" && (t === "Enter" || t === " ")) {
|
|
698
|
+
this._onTreeActivate(e);
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
if (t !== "ArrowUp" && t !== "ArrowDown" && t !== "Home" && t !== "End") return;
|
|
702
|
+
let n = this._getInteractiveItems();
|
|
703
|
+
if (n.length === 0) return;
|
|
704
|
+
let r = n.findIndex((e) => e._rovingActive), i;
|
|
705
|
+
if (t === "Home") i = 0;
|
|
706
|
+
else if (t === "End") i = n.length - 1;
|
|
707
|
+
else {
|
|
708
|
+
let e = t === "ArrowDown" ? 1 : -1;
|
|
709
|
+
i = ((r === -1 ? e === 1 ? -1 : 0 : r) + e + n.length) % n.length;
|
|
710
|
+
}
|
|
711
|
+
e.preventDefault();
|
|
712
|
+
let a = n[i];
|
|
713
|
+
this._setRovingActive(a), a.focus();
|
|
714
|
+
}
|
|
715
|
+
_onEscape(e) {
|
|
716
|
+
let t = this._popoverWasOpen;
|
|
717
|
+
this._popoverWasOpen = !1;
|
|
718
|
+
let n = this._origin(e);
|
|
719
|
+
n?.control && (t || (e.preventDefault(), e.stopPropagation(), this._setRovingActive(n.row), n.row.focus()));
|
|
720
|
+
}
|
|
721
|
+
_onTreeHorizontal(e, t) {
|
|
722
|
+
let n = this._getInteractiveItems().find((e) => e._rovingActive);
|
|
723
|
+
if (!n) return;
|
|
724
|
+
let r = n.childRows.filter((e) => !e.hasAttribute("hidden")), i = r.length > 0 && n.expanded === !0;
|
|
725
|
+
if (t === "ArrowRight") {
|
|
726
|
+
if (r.length === 0) return;
|
|
727
|
+
if (e.preventDefault(), !i) {
|
|
728
|
+
n._activateDisclosure();
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
this._moveRovingTo(r[0]);
|
|
732
|
+
return;
|
|
733
|
+
}
|
|
734
|
+
if (i) {
|
|
735
|
+
e.preventDefault(), n._activateDisclosure();
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
let a = n.parentRow;
|
|
739
|
+
a && (e.preventDefault(), this._moveRovingTo(a));
|
|
740
|
+
}
|
|
741
|
+
_onTreeActivate(e) {
|
|
742
|
+
let t = e.target;
|
|
743
|
+
if (!(t instanceof Element) || t.tagName.toLowerCase() !== "nldd-list-item") return;
|
|
744
|
+
let n = t;
|
|
745
|
+
n.shadowRoot?.activeElement || (e.key === "Enter" && n._activatePrimary() || n._activateDisclosure()) && e.preventDefault();
|
|
746
|
+
}
|
|
747
|
+
_moveRovingTo(e) {
|
|
748
|
+
this._setRovingActive(e), e.focus();
|
|
749
|
+
}
|
|
750
|
+
_syncUnmanagedControls() {
|
|
751
|
+
import.meta.env?.DEV && (this._arrowNavActive ? this._unmanagedCheckScheduled || (this._unmanagedCheckScheduled = !0, (async () => {
|
|
752
|
+
this._unmanagedCheckScheduled = !1;
|
|
753
|
+
let e = this._getPaintedRows();
|
|
754
|
+
await Promise.all(e.map((e) => e.updateComplete));
|
|
755
|
+
let t = !1;
|
|
756
|
+
for (let n of e) {
|
|
757
|
+
if (t) break;
|
|
758
|
+
t = await this._holdsUnmanagedControl(n);
|
|
759
|
+
}
|
|
760
|
+
d(this, "control-keeps-tab-stop", t);
|
|
761
|
+
})()) : d(this, "control-keeps-tab-stop", !1));
|
|
762
|
+
}
|
|
763
|
+
async _holdsUnmanagedControl(e) {
|
|
764
|
+
for (let t of Array.from(e.querySelectorAll("*"))) {
|
|
765
|
+
if (t.closest("nldd-list-item") !== e || t.tagName.toLowerCase() === "nldd-list-item-segment" || !t.tagName.includes("-") || "noTab" in t) continue;
|
|
766
|
+
let n = t;
|
|
767
|
+
if (n.updateComplete && await n.updateComplete, t.shadowRoot?.querySelector(b) && !this._hiddenWithin(e, t)) return !0;
|
|
768
|
+
}
|
|
769
|
+
return !1;
|
|
770
|
+
}
|
|
771
|
+
_hiddenWithin(e, t) {
|
|
772
|
+
for (let n = t; n && n !== e; n = n.parentElement) if (getComputedStyle(n).display === "none") return !0;
|
|
773
|
+
return !1;
|
|
774
|
+
}
|
|
775
|
+
_getDeepActiveElement() {
|
|
776
|
+
let e = document.activeElement;
|
|
777
|
+
for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
|
|
778
|
+
return e instanceof HTMLElement ? e : null;
|
|
779
|
+
}
|
|
780
|
+
_startDrag(e, t = 0) {
|
|
781
|
+
let n = this._getItems().indexOf(e);
|
|
782
|
+
if (n === -1) return;
|
|
783
|
+
this._draggingEl = e, this._draggingFromIndex = n, this._currentDropIndex = n;
|
|
784
|
+
let r = e.shadowRoot?.querySelector(".list-item") ?? e, i = r.getBoundingClientRect(), a = parseFloat(getComputedStyle(r).marginBlockEnd) || 0;
|
|
785
|
+
this._placeholder = document.createElement("div"), this._placeholder.className = "nldd-list-drag-placeholder", this._placeholder.setAttribute("aria-hidden", "true"), this._placeholder.setAttribute("data-nldd-placeholder", ""), this._placeholder.style.height = `${i.height + a}px`, e.after(this._placeholder), e.classList.add("is-dragging"), e.classList.add("is-dragging-pointer"), this._listRect = this.getBoundingClientRect(), this._cloneOffsetY = t - i.top;
|
|
786
|
+
let o = e.cloneNode(!0);
|
|
787
|
+
o.classList.remove("is-dragging"), o.classList.remove("is-dragging-pointer"), o.setAttribute("data-nldd-clone", ""), this._clone = document.createElement("div"), this._clone.className = "list__drag-clone", this._clone.style.setProperty("--_list-drag-clone-top", `${t - this._listRect.top - this._cloneOffsetY}px`), this._clone.style.setProperty("--_list-drag-clone-left", `${i.left - this._listRect.left}px`), this._clone.style.setProperty("--_list-drag-clone-width", `${i.width}px`), this._clone.style.setProperty("--_list-drag-clone-height", `${i.height}px`), this._clone.appendChild(o), this.renderRoot.appendChild(this._clone);
|
|
788
|
+
}
|
|
789
|
+
_setDropIndex(e) {
|
|
790
|
+
if (!this._placeholder || !this._draggingEl) return;
|
|
791
|
+
let t = this._getItems().filter((e) => e !== this._draggingEl), n = Math.max(0, Math.min(t.length, e));
|
|
792
|
+
this._currentDropIndex = n, this._placeholder.remove(), t.length === 0 ? this._draggingEl.after(this._placeholder) : n === 0 ? t[0].before(this._placeholder) : t[n - 1].after(this._placeholder);
|
|
793
|
+
}
|
|
794
|
+
_getDropIndex() {
|
|
795
|
+
return this._currentDropIndex;
|
|
796
|
+
}
|
|
797
|
+
_endDrag() {
|
|
798
|
+
if (!this._draggingEl) return;
|
|
799
|
+
let e = this._draggingFromIndex, t = this._getDropIndex(), n = this._draggingEl;
|
|
800
|
+
this._cleanupDrag(), e === t ? this._announce(this._t("components.list.reorder-no-change-text")) : (this.dispatchEvent(new CustomEvent("nldd-reorder", {
|
|
801
|
+
detail: {
|
|
802
|
+
fromIndex: e,
|
|
803
|
+
toIndex: t
|
|
804
|
+
},
|
|
805
|
+
bubbles: !0,
|
|
806
|
+
composed: !0
|
|
807
|
+
})), this._announce(this._t("components.list.reorder-dropped-text", { position: t + 1 })), requestAnimationFrame(() => {
|
|
808
|
+
(n.querySelector("[reorderable-only]")?.shadowRoot?.querySelector("button"))?.focus();
|
|
809
|
+
}));
|
|
810
|
+
}
|
|
811
|
+
_cancelDrag() {
|
|
812
|
+
this._draggingEl && (this._cleanupDrag(), this._announce(this._t("components.list.reorder-canceled-text")));
|
|
813
|
+
}
|
|
814
|
+
_cleanupDrag() {
|
|
815
|
+
if (this._draggingEl?.classList.remove("is-dragging"), this._draggingEl?.classList.remove("is-dragging-pointer"), this._placeholder?.remove(), this._clone?.remove(), this._pointerId !== null) {
|
|
816
|
+
try {
|
|
817
|
+
this.releasePointerCapture(this._pointerId);
|
|
818
|
+
} catch (e) {
|
|
819
|
+
if (!(e instanceof DOMException)) throw e;
|
|
820
|
+
}
|
|
821
|
+
this._pointerId = null;
|
|
822
|
+
}
|
|
823
|
+
this.removeEventListener("pointermove", this._onPointerMove), this.removeEventListener("pointerup", this._onPointerUp), this.removeEventListener("pointercancel", this._onPointerCancel), this._draggingEl = null, this._draggingFromIndex = -1, this._placeholder = null, this._clone = null, this._cloneOffsetY = 0, this._listRect = null, this._currentDropIndex = -1;
|
|
824
|
+
}
|
|
825
|
+
_t(e, t) {
|
|
826
|
+
return f(this.translations, m, e, t);
|
|
827
|
+
}
|
|
828
|
+
_announce(e, t = !1) {
|
|
829
|
+
let n = t ? ".list__assertive-announcer" : ".list__polite-announcer", r = this.shadowRoot?.querySelector(n);
|
|
830
|
+
r && (r.textContent = "", requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
831
|
+
r.textContent = e;
|
|
832
|
+
})));
|
|
833
|
+
}
|
|
834
|
+
render() {
|
|
835
|
+
return g({
|
|
836
|
+
itemsLabel: this.accessibleLabel || this._t("components.list.items-accessible-label"),
|
|
837
|
+
hasToolbar: this._hasToolbar,
|
|
838
|
+
type: this.type,
|
|
839
|
+
isEmpty: this._isEmpty,
|
|
840
|
+
hasItems: this._hasItems,
|
|
841
|
+
hasEmptyState: this._hasEmptyState,
|
|
842
|
+
hasNoResultsState: this._hasNoResultsState,
|
|
843
|
+
listbox: {
|
|
844
|
+
listboxId: this._listboxId,
|
|
845
|
+
searchValue: this._searchValue,
|
|
846
|
+
activeId: this._searchFocused ? this._activeId : "",
|
|
847
|
+
searchPlaceholder: this._t("components.list.search-placeholder-label"),
|
|
848
|
+
searchAccessibleLabel: this.accessibleLabel || this._t("components.list.search-placeholder-label"),
|
|
849
|
+
searchClearLabel: this._t("components.list.clear-search-action"),
|
|
850
|
+
hasSearchBarEnd: this._hasSearchBarEnd,
|
|
851
|
+
onSearchInput: this._onSearchInput,
|
|
852
|
+
onSearchKeyDown: this._onSearchKeyDown,
|
|
853
|
+
onSearchFocus: this._onSearchFocus,
|
|
854
|
+
onSearchBlur: this._onSearchBlur,
|
|
855
|
+
onClearClick: this._onClearClick,
|
|
856
|
+
onSearchBarEndSlotChange: this._onSearchBarEndSlotChange
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
}, y = v, v.styles = [h], v._idCounter = 0, v._optionIdCounter = 0, v);
|
|
861
|
+
s([n({
|
|
862
|
+
reflect: !0,
|
|
863
|
+
converter: u("simple")
|
|
864
|
+
})], x.prototype, "appearance", void 0), s([n({
|
|
865
|
+
reflect: !0,
|
|
866
|
+
converter: u("list")
|
|
867
|
+
})], x.prototype, "type", void 0), s([n({
|
|
868
|
+
reflect: !0,
|
|
869
|
+
converter: u("always")
|
|
870
|
+
})], x.prototype, "dividers", void 0), s([n({
|
|
871
|
+
reflect: !0,
|
|
872
|
+
converter: u("")
|
|
873
|
+
})], x.prototype, "height", void 0), s([n({
|
|
874
|
+
type: String,
|
|
875
|
+
attribute: "accessible-label"
|
|
876
|
+
})], x.prototype, "accessibleLabel", void 0), s([n({ type: Object })], x.prototype, "translations", void 0), s([n({
|
|
877
|
+
type: Boolean,
|
|
878
|
+
reflect: !0
|
|
879
|
+
})], x.prototype, "reorderable", void 0), s([r(), r()], x.prototype, "_hasToolbar", void 0), s([r()], x.prototype, "_hasSearchBarEnd", void 0), s([r()], x.prototype, "_hasEmptyState", void 0), s([r()], x.prototype, "_hasNoResultsState", void 0), s([r()], x.prototype, "_hasItems", void 0), s([r()], x.prototype, "_isEmpty", void 0), s([r()], x.prototype, "_searchValue", void 0), s([r()], x.prototype, "_activeId", void 0), s([r()], x.prototype, "_searchFocused", void 0), s([l(".list__search-field-input")], x.prototype, "_searchInput", void 0), x = y = s([c("nldd-list")], x);
|
|
880
|
+
export { _ as t };
|