@nldd/design-system 0.20.0 → 0.21.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 +361 -10
- 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-GinEMPm9.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-OywRKaWj.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-vmZLo80s.js +662 -0
- package/dist/cdn/chunks/date-field.i18n-BTzc0E9a.js +15 -0
- package/dist/cdn/chunks/date-picker-CXDzSBoL.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-A2DFWrP9.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-DQ52qq5L.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-BLXecYsZ.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-BtxzRedh.js +719 -0
- package/dist/cdn/chunks/menu-bar-BU3Hjk1b.js +253 -0
- package/dist/cdn/chunks/menu-bar-item-C7LQ0NI_.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-CGbeEv_-.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-BzZWhXhc.js +57 -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-CqN7ViYV.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-CFPBdETU.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-DH19p8So.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-CA8K1XjU.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--5K0YTcr.js +607 -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-BpyxOGmU.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-C24LqAzK.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-C_kLPVKD.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-CxV6ELE9.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/content/blockquote/blockquote.d.ts +1 -0
- package/dist/components/content/blockquote/blockquote.d.ts.map +1 -1
- package/dist/components/content/blockquote/blockquote.js +1 -0
- package/dist/components/content/blockquote/blockquote.js.map +1 -1
- package/dist/components/content/identity/identity.d.ts +1 -0
- package/dist/components/content/identity/identity.d.ts.map +1 -1
- package/dist/components/content/identity/identity.js +1 -0
- package/dist/components/content/identity/identity.js.map +1 -1
- package/dist/components/content/image/image.d.ts +1 -0
- package/dist/components/content/image/image.d.ts.map +1 -1
- package/dist/components/content/image/image.js +1 -0
- package/dist/components/content/image/image.js.map +1 -1
- package/dist/components/content/rich-text/rich-text.d.ts +1 -0
- package/dist/components/content/rich-text/rich-text.d.ts.map +1 -1
- package/dist/components/content/rich-text/rich-text.js +1 -0
- package/dist/components/content/rich-text/rich-text.js.map +1 -1
- package/dist/components/content/text/text.d.ts +1 -0
- package/dist/components/content/text/text.d.ts.map +1 -1
- package/dist/components/content/text/text.js +1 -0
- package/dist/components/content/text/text.js.map +1 -1
- package/dist/components/content/title/title.d.ts +1 -0
- package/dist/components/content/title/title.d.ts.map +1 -1
- package/dist/components/content/title/title.js +1 -0
- package/dist/components/content/title/title.js.map +1 -1
- package/dist/components/forms/form/form.d.ts.map +1 -1
- package/dist/components/forms/form/form.js +1 -0
- package/dist/components/forms/form/form.js.map +1 -1
- package/dist/components/forms/form-field/form-field.d.ts +1 -0
- package/dist/components/forms/form-field/form-field.d.ts.map +1 -1
- package/dist/components/forms/form-field/form-field.js +1 -0
- package/dist/components/forms/form-field/form-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.d.ts +9 -4
- package/dist/components/inputs/date-field/date-field.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.js +20 -7
- package/dist/components/inputs/date-field/date-field.js.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.d.ts.map +1 -1
- package/dist/components/inputs/date-field/date-field.template.js +1 -0
- package/dist/components/inputs/date-field/date-field.template.js.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.d.ts +23 -2
- package/dist/components/inputs/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/inputs/dropdown/dropdown.js +68 -11
- package/dist/components/inputs/dropdown/dropdown.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +4 -0
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.js +17 -2
- package/dist/components/inputs/time-field/time-field.js.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.template.js +1 -0
- package/dist/components/inputs/time-field/time-field.template.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/layout/page-sections/hero/hero.d.ts +1 -0
- package/dist/components/layout/page-sections/hero/hero.d.ts.map +1 -1
- package/dist/components/layout/page-sections/hero/hero.js +1 -0
- package/dist/components/layout/page-sections/hero/hero.js.map +1 -1
- package/dist/components/layout/popover/popover.d.ts.map +1 -1
- package/dist/components/layout/popover/popover.js +4 -2
- package/dist/components/layout/popover/popover.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 +729 -727
- 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/dist/utilities/return-focus.d.ts +14 -0
- package/dist/utilities/return-focus.d.ts.map +1 -1
- package/dist/utilities/return-focus.js +26 -8
- package/dist/utilities/return-focus.js.map +1 -1
- package/lint/data.generated.json +1 -1
- package/lint/engine.js +53 -1
- package/lint/format.js +6 -5
- package/lint/frontends.js +224 -16
- package/lint/linter.js +5 -3
- package/lint/main.js +36 -9
- package/lint/project.js +73 -4
- package/lint/rule-data.js +17 -2
- package/lint/tree.js +3 -0
- 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,993 @@
|
|
|
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 "./reflect-non-default-Bu3rpCvg.js";
|
|
6
|
+
import "./button-bar-Bxgdbyh3.js";
|
|
7
|
+
import { t as u } from "./shadow-resets-6SToDsPu.js";
|
|
8
|
+
import "./button-DO90Lo6q.js";
|
|
9
|
+
import { t as d } from "./with-translations-XX14GKFh.js";
|
|
10
|
+
import { t as f } from "./class-map-CXSdNjt8.js";
|
|
11
|
+
import { t as p } from "./described-by-mixin-daRE7orX.js";
|
|
12
|
+
import { t as m } from "./defer-focus-F73ud2D9.js";
|
|
13
|
+
import "./icon-button-rKiIHs7A.js";
|
|
14
|
+
import { n as h } from "./input-modality-XE0B7yCn.js";
|
|
15
|
+
import { n as g } from "./breakpoints-Cwor8TRP.js";
|
|
16
|
+
import "./menu-BtxzRedh.js";
|
|
17
|
+
import { n as _, r as v, t as y } from "./date-picker.i18n-Dsc_M5QK.js";
|
|
18
|
+
// src/utilities/resolve-date-bound.ts
|
|
19
|
+
function b(e, t, n) {
|
|
20
|
+
if (t < 1 || t > 12 || n < 1) return !1;
|
|
21
|
+
let r = new Date(Date.UTC(e, t - 1, n));
|
|
22
|
+
return r.getUTCFullYear() === e && r.getUTCMonth() === t - 1 && r.getUTCDate() === n;
|
|
23
|
+
}
|
|
24
|
+
function x(e, t, n) {
|
|
25
|
+
return b(e, t, n) ? `${String(e).padStart(4, "0")}-${String(t).padStart(2, "0")}-${String(n).padStart(2, "0")}` : null;
|
|
26
|
+
}
|
|
27
|
+
function S(e, t) {
|
|
28
|
+
return new Date(Date.UTC(e, t, 0)).getUTCDate();
|
|
29
|
+
}
|
|
30
|
+
var C = /^(\d{4})-(\d{2})-(\d{2})$/, w = /^today(?:([+-])(\d+)([dwmy]))?$/;
|
|
31
|
+
function T(e, t = /* @__PURE__ */ new Date()) {
|
|
32
|
+
let n = e.trim();
|
|
33
|
+
if (n === "") return "";
|
|
34
|
+
let r = C.exec(n);
|
|
35
|
+
if (r) return b(Number(r[1]), Number(r[2]), Number(r[3])) ? n : "";
|
|
36
|
+
let i = w.exec(n);
|
|
37
|
+
if (!i) return "";
|
|
38
|
+
let a = t.getFullYear(), o = t.getMonth() + 1, s = t.getDate();
|
|
39
|
+
if (i[1]) {
|
|
40
|
+
let e = Number(i[2]) * (i[1] === "-" ? -1 : 1), t = i[3];
|
|
41
|
+
if (t === "d" || t === "w") {
|
|
42
|
+
let n = new Date(Date.UTC(a, o - 1, s + e * (t === "w" ? 7 : 1)));
|
|
43
|
+
a = n.getUTCFullYear(), o = n.getUTCMonth() + 1, s = n.getUTCDate();
|
|
44
|
+
} else {
|
|
45
|
+
let n = e * (t === "y" ? 12 : 1), r = a * 12 + (o - 1) + n;
|
|
46
|
+
a = Math.floor(r / 12), o = (r % 12 + 12) % 12 + 1, s = Math.min(s, S(a, o));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return x(a, o, s) ?? "";
|
|
50
|
+
}
|
|
51
|
+
// src/components/inputs/date-picker/date-picker.styles.ts
|
|
52
|
+
var E = t`
|
|
53
|
+
:host {
|
|
54
|
+
box-sizing: border-box;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/* # Host */
|
|
59
|
+
|
|
60
|
+
:host {
|
|
61
|
+
--_date-picker-header-margin-bottom: var(--primitives-space-16);
|
|
62
|
+
--_date-picker-footer-margin-top: var(--primitives-space-8);
|
|
63
|
+
--_date-picker-title-font: var(--primitives-font-display-5-sm);
|
|
64
|
+
--_date-picker-title-button-corner-radius: var(--semantics-controls-sm-corner-radius);
|
|
65
|
+
--_date-picker-title-button-min-size: var(--semantics-controls-sm-min-size);
|
|
66
|
+
--_date-picker-title-picker-icon-size: var(--primitives-space-20);
|
|
67
|
+
--_date-picker-weekday-header-font: var(--primitives-font-body-xs-regular-flat);
|
|
68
|
+
--_date-picker-weekday-header-content-color: var(--semantics-content-secondary-color);
|
|
69
|
+
--_date-picker-divider-color: light-dark(var(--primitives-color-neutral-50), var(--primitives-color-neutral-150));
|
|
70
|
+
--_date-picker-divider-thickness: var(--semantics-dividers-thickness);
|
|
71
|
+
--_date-picker-week-number-column-width: var(--primitives-space-32);
|
|
72
|
+
--_date-picker-week-number-font: var(--primitives-font-body-xs-regular-flat);
|
|
73
|
+
--_date-picker-week-number-content-color: var(--semantics-content-secondary-color);
|
|
74
|
+
/* Set from JS by the width attribute; initial keeps it guaranteed-invalid
|
|
75
|
+
so every var(--_date-picker-width, ...) below falls back to its own default. */
|
|
76
|
+
--_date-picker-width: initial;
|
|
77
|
+
--_date-picker-day-size: var(--semantics-controls-md-min-size);
|
|
78
|
+
--_date-picker-day-corner-radius: var(--semantics-controls-md-corner-radius);
|
|
79
|
+
--_date-picker-day-font: var(--primitives-font-body-sm-medium-flat);
|
|
80
|
+
--_date-picker-day-indicator-inset: var(--primitives-space-2);
|
|
81
|
+
--_date-picker-day-indicator-size: calc(var(--_date-picker-day-size) - var(--_date-picker-day-indicator-inset) * 2);
|
|
82
|
+
--_date-picker-day-indicator-corner-radius: var(--_date-picker-day-corner-radius);
|
|
83
|
+
--_date-picker-day-is-in-range-background-color: var(--components-date-picker-day-is-in-range-background-color);
|
|
84
|
+
--_date-picker-day-is-in-range-is-hovered-background-color: var(--components-date-picker-day-is-in-range-is-hovered-background-color);
|
|
85
|
+
--_date-picker-day-is-in-range-content-color: var(--semantics-content-color);
|
|
86
|
+
--_date-picker-day-is-today-border-color: light-dark(var(--primitives-color-neutral-250), var(--primitives-color-neutral-400));
|
|
87
|
+
--_date-picker-day-is-today-is-in-range-border-color: var(--components-date-picker-day-is-today-is-in-range-border-color);
|
|
88
|
+
--_date-picker-day-is-today-is-selected-border-color: var(--components-date-picker-day-is-today-is-selected-border-color);
|
|
89
|
+
--_date-picker-day-is-hovered-background-color: light-dark(var(--primitives-color-neutral-100), var(--primitives-color-neutral-150));
|
|
90
|
+
--_date-picker-day-is-selected-background-color: var(--semantics-controls-is-selected-indicator-color);
|
|
91
|
+
--_date-picker-day-is-selected-content-color: var(--semantics-controls-is-selected-contrast-color);
|
|
92
|
+
--_date-picker-day-is-selected-is-hovered-background-color: var(--semantics-controls-is-selected-is-hovered-indicator-color);
|
|
93
|
+
--_date-picker-day-is-selected-is-hovered-content-color: var(--semantics-controls-is-selected-is-hovered-contrast-color);
|
|
94
|
+
--_date-picker-day-is-outside-month-content-color: var(--semantics-content-secondary-color);
|
|
95
|
+
--_date-picker-day-is-unavailable-content-color: var(--semantics-content-secondary-color);
|
|
96
|
+
|
|
97
|
+
${u}
|
|
98
|
+
display: block;
|
|
99
|
+
/* Stated, not fit-content: the calendar inside is sized in percentages, so
|
|
100
|
+
measuring it from here is circular and resolves to the container. The
|
|
101
|
+
width attribute (--_date-picker-width) overrides the intrinsic seven-cell width;
|
|
102
|
+
the percentage-based inside stretches along. */
|
|
103
|
+
width: var(--_date-picker-width, calc(var(--_date-picker-day-size) * 7));
|
|
104
|
+
color: var(--semantics-content-color);
|
|
105
|
+
-webkit-tap-highlight-color: transparent;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:host([week-numbers]) {
|
|
109
|
+
width: var(--_date-picker-width, calc(var(--_date-picker-day-size) * 7 + var(--_date-picker-week-number-column-width)));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* An explicit width attribute outranks the derived stacked width: stacked
|
|
113
|
+
only describes how narrow the picker happens to be, not what the consumer
|
|
114
|
+
asked for. */
|
|
115
|
+
:host([stacked]) {
|
|
116
|
+
--_date-picker-title-font: var(--primitives-font-display-4-sm);
|
|
117
|
+
--_date-picker-title-button-min-size: var(--semantics-controls-md-min-size);
|
|
118
|
+
|
|
119
|
+
width: var(--_date-picker-width, 100%);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:host([hidden]) {
|
|
123
|
+
display: none;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
/* # Block */
|
|
128
|
+
|
|
129
|
+
.date-picker {
|
|
130
|
+
display: flex;
|
|
131
|
+
width: 100%;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
/* # Elements */
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
/* ## Header */
|
|
140
|
+
|
|
141
|
+
.date-picker__header {
|
|
142
|
+
display: flex;
|
|
143
|
+
margin-bottom: var(--_date-picker-header-margin-bottom);
|
|
144
|
+
align-items: center;
|
|
145
|
+
justify-content: space-between;
|
|
146
|
+
gap: var(--primitives-space-8);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.date-picker__title {
|
|
150
|
+
display: flex;
|
|
151
|
+
margin: 0;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: var(--primitives-space-4);
|
|
154
|
+
font: var(--_date-picker-title-font);
|
|
155
|
+
/* A heading that breaks between month and year stops answering the one
|
|
156
|
+
question it is there for. */
|
|
157
|
+
white-space: nowrap;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.date-picker__title-month-button,
|
|
161
|
+
.date-picker__title-year-button {
|
|
162
|
+
box-sizing: border-box;
|
|
163
|
+
display: flex;
|
|
164
|
+
margin: 0;
|
|
165
|
+
outline: none;
|
|
166
|
+
border: none;
|
|
167
|
+
border-radius: var(--_date-picker-title-button-corner-radius);
|
|
168
|
+
background: none;
|
|
169
|
+
min-height: var(--_date-picker-title-button-min-size);
|
|
170
|
+
padding: 0;
|
|
171
|
+
align-items: center;
|
|
172
|
+
color: inherit;
|
|
173
|
+
font: inherit;
|
|
174
|
+
appearance: none;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.date-picker__title-picker-icon {
|
|
178
|
+
display: flex;
|
|
179
|
+
width: var(--_date-picker-title-picker-icon-size);
|
|
180
|
+
height: var(--_date-picker-title-picker-icon-size);
|
|
181
|
+
flex-shrink: 0;
|
|
182
|
+
align-items: center;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.date-picker__title-month-button:focus-visible,
|
|
186
|
+
.date-picker__title-year-button:focus-visible {
|
|
187
|
+
outline: var(--semantics-focus-ring-outline);
|
|
188
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
189
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.date-picker__pagination {
|
|
193
|
+
display: flex;
|
|
194
|
+
flex-shrink: 0;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: var(--primitives-space-2);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
/* ## Calendar */
|
|
201
|
+
|
|
202
|
+
.date-picker__calendar {
|
|
203
|
+
border-collapse: collapse;
|
|
204
|
+
width: 100%;
|
|
205
|
+
table-layout: fixed;
|
|
206
|
+
/* Dragging a range would otherwise select the day numbers as text. */
|
|
207
|
+
-webkit-user-select: none;
|
|
208
|
+
user-select: none;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.date-picker__weekday-header-cell,
|
|
212
|
+
.date-picker__week-header-cell {
|
|
213
|
+
border-block-end: var(--_date-picker-divider-thickness) solid var(--_date-picker-divider-color);
|
|
214
|
+
padding: 0 0 var(--primitives-space-4);
|
|
215
|
+
width: var(--_date-picker-day-size);
|
|
216
|
+
color: var(--_date-picker-weekday-header-content-color);
|
|
217
|
+
font: var(--_date-picker-weekday-header-font);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.date-picker__day-cell,
|
|
221
|
+
.date-picker__week-cell {
|
|
222
|
+
border-block-end: var(--_date-picker-divider-thickness) solid var(--_date-picker-divider-color);
|
|
223
|
+
padding: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
tbody tr:last-child .date-picker__day-cell,
|
|
227
|
+
tbody tr:last-child .date-picker__week-cell {
|
|
228
|
+
border-block-end: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.date-picker__week-cell,
|
|
232
|
+
.date-picker__week-header-cell {
|
|
233
|
+
/* Table cells do not inherit the host's border-box, so the padding and rule
|
|
234
|
+
below would otherwise be added on top of the stated width. */
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
border-inline-end: var(--_date-picker-divider-thickness) solid var(--_date-picker-divider-color);
|
|
237
|
+
/* Stated rather than auto: an auto column under table-layout: fixed takes
|
|
238
|
+
all the surplus width and pushes the dates aside. */
|
|
239
|
+
width: var(--_date-picker-week-number-column-width);
|
|
240
|
+
padding-right: var(--primitives-space-8);
|
|
241
|
+
text-align: right;
|
|
242
|
+
color: var(--_date-picker-week-number-content-color);
|
|
243
|
+
font: var(--_date-picker-week-number-font);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
/* ## Day */
|
|
248
|
+
|
|
249
|
+
.date-picker__day {
|
|
250
|
+
box-sizing: border-box;
|
|
251
|
+
display: flex;
|
|
252
|
+
position: relative;
|
|
253
|
+
margin: 0;
|
|
254
|
+
outline: none;
|
|
255
|
+
border: none;
|
|
256
|
+
background: none;
|
|
257
|
+
width: 100%;
|
|
258
|
+
height: var(--_date-picker-day-size);
|
|
259
|
+
padding: 0;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: center;
|
|
262
|
+
color: inherit;
|
|
263
|
+
font: var(--_date-picker-day-font);
|
|
264
|
+
appearance: none;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.date-picker__day-range-indicator {
|
|
268
|
+
position: absolute;
|
|
269
|
+
inset-inline: 0;
|
|
270
|
+
inset-block: var(--_date-picker-day-indicator-inset);
|
|
271
|
+
background-color: var(--_date-picker-day-is-in-range-background-color);
|
|
272
|
+
pointer-events: none;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.date-picker__day-range-indicator.is-start {
|
|
276
|
+
inset-inline: 50% 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.date-picker__day-range-indicator.is-end {
|
|
280
|
+
inset-inline: 0 50%;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.date-picker__day-indicator {
|
|
284
|
+
box-sizing: border-box;
|
|
285
|
+
position: absolute;
|
|
286
|
+
top: 50%;
|
|
287
|
+
left: 50%;
|
|
288
|
+
border-radius: var(--_date-picker-day-indicator-corner-radius);
|
|
289
|
+
background-color: transparent;
|
|
290
|
+
pointer-events: none;
|
|
291
|
+
width: var(--_date-picker-day-indicator-size);
|
|
292
|
+
height: var(--_date-picker-day-indicator-size);
|
|
293
|
+
transform: translate(-50%, -50%);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
.date-picker__day.is-range-start:not(.is-range-end) .date-picker__day-indicator {
|
|
297
|
+
border-start-end-radius: 0;
|
|
298
|
+
border-end-end-radius: 0;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.date-picker__day.is-range-end:not(.is-range-start) .date-picker__day-indicator {
|
|
302
|
+
border-start-start-radius: 0;
|
|
303
|
+
border-end-start-radius: 0;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.date-picker__day-number {
|
|
307
|
+
position: relative;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.date-picker__day.is-today .date-picker__day-indicator {
|
|
311
|
+
border: var(--primitives-border-width-regular) solid var(--_date-picker-day-is-today-border-color);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.date-picker__day.is-today.is-in-range .date-picker__day-indicator {
|
|
315
|
+
border-color: var(--_date-picker-day-is-today-is-in-range-border-color);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.date-picker__day.is-today.is-selected .date-picker__day-indicator {
|
|
319
|
+
border-color: var(--_date-picker-day-is-today-is-selected-border-color);
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
/* Touch reports a hover after a tap and keeps it until you touch something
|
|
323
|
+
else, so a day stays lit long after you picked it. Only pointers that can
|
|
324
|
+
really hover. */
|
|
325
|
+
@media (hover: hover) {
|
|
326
|
+
.date-picker__day:hover .date-picker__day-indicator {
|
|
327
|
+
background-color: var(--_date-picker-day-is-hovered-background-color);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
.date-picker__day.is-in-range:hover .date-picker__day-indicator {
|
|
331
|
+
background-color: var(--_date-picker-day-is-in-range-is-hovered-background-color);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/* :focus, not :focus-visible. Arrow keys move focus programmatically, and the
|
|
336
|
+
browser keeps judging the session by the click that opened the calendar, so
|
|
337
|
+
focus-visible never matches while navigating. The modality class carries that
|
|
338
|
+
decision instead - and while it is absent the ring shows, so a failure leaves
|
|
339
|
+
focus visible rather than hidden.
|
|
340
|
+
|
|
341
|
+
Raised above its neighbors: the ring sits outside the indicator, so an
|
|
342
|
+
adjacent selected day would paint over part of it. */
|
|
343
|
+
.date-picker__day:focus:not(.is-pointer-focus) {
|
|
344
|
+
z-index: 1;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.date-picker__day:focus:not(.is-pointer-focus) .date-picker__day-indicator {
|
|
348
|
+
outline: var(--semantics-focus-ring-outline);
|
|
349
|
+
outline-offset: var(--semantics-focus-ring-outline-offset);
|
|
350
|
+
box-shadow: var(--semantics-focus-ring-box-shadow);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/* These four all set the color at equal specificity, so the order is what
|
|
354
|
+
decides: outside the month is the weakest, chosen the strongest. */
|
|
355
|
+
.date-picker__day.is-outside-month {
|
|
356
|
+
color: var(--_date-picker-day-is-outside-month-content-color);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
.date-picker__day.is-in-range {
|
|
360
|
+
color: var(--_date-picker-day-is-in-range-content-color);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.date-picker__day.is-selected {
|
|
364
|
+
color: var(--_date-picker-day-is-selected-content-color);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.date-picker__day.is-selected .date-picker__day-indicator {
|
|
368
|
+
background-color: var(--_date-picker-day-is-selected-background-color);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
@media (hover: hover) {
|
|
372
|
+
.date-picker__day.is-selected:hover {
|
|
373
|
+
color: var(--_date-picker-day-is-selected-is-hovered-content-color);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.date-picker__day.is-selected:hover .date-picker__day-indicator {
|
|
377
|
+
background-color: var(--_date-picker-day-is-selected-is-hovered-background-color);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.date-picker__day.is-unavailable {
|
|
382
|
+
color: var(--_date-picker-day-is-unavailable-content-color);
|
|
383
|
+
text-decoration: line-through;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
.date-picker__day.is-unavailable:hover .date-picker__day-indicator {
|
|
387
|
+
background-color: transparent;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
/* ## Footer */
|
|
392
|
+
|
|
393
|
+
.date-picker__footer {
|
|
394
|
+
display: flex;
|
|
395
|
+
margin-top: var(--_date-picker-footer-margin-top);
|
|
396
|
+
align-items: center;
|
|
397
|
+
justify-content: space-between;
|
|
398
|
+
gap: var(--primitives-space-8);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/* Both corners hold their place when a side is empty (today out of reach, or
|
|
402
|
+
a boundary that hides an arrow), so the other side does not slide over. */
|
|
403
|
+
.date-picker__footer-start,
|
|
404
|
+
.date-picker__footer-end {
|
|
405
|
+
display: flex;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
/* ## Announcer */
|
|
410
|
+
|
|
411
|
+
.date-picker__announcer {
|
|
412
|
+
position: absolute;
|
|
413
|
+
clip-path: inset(50%);
|
|
414
|
+
margin: -1px;
|
|
415
|
+
width: 1px;
|
|
416
|
+
height: 1px;
|
|
417
|
+
overflow: hidden;
|
|
418
|
+
white-space: nowrap;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
/* # High Contrast */
|
|
423
|
+
|
|
424
|
+
@media (forced-colors: active) {
|
|
425
|
+
.date-picker__day.is-selected .date-picker__day-indicator {
|
|
426
|
+
outline: 2px solid CanvasText;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.date-picker__day:focus:not(.is-pointer-focus) .date-picker__day-indicator {
|
|
430
|
+
outline: 2px solid CanvasText;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
`, D = "date-picker-title";
|
|
434
|
+
function O(e, t, n, r, i) {
|
|
435
|
+
return r < 2 ? a`<span class="date-picker__title-label">${n}</span>` : a`
|
|
436
|
+
<button class="date-picker__title-${t}-button"
|
|
437
|
+
type="button"
|
|
438
|
+
aria-haspopup="menu"
|
|
439
|
+
aria-expanded=${i ? "true" : "false"}
|
|
440
|
+
>
|
|
441
|
+
${n}
|
|
442
|
+
<span class="date-picker__title-picker-icon">
|
|
443
|
+
<nldd-icon
|
|
444
|
+
icon="chevron-down-small"
|
|
445
|
+
aria-hidden="true"
|
|
446
|
+
></nldd-icon>
|
|
447
|
+
</span>
|
|
448
|
+
</button>
|
|
449
|
+
`;
|
|
450
|
+
}
|
|
451
|
+
function k(e) {
|
|
452
|
+
let t = e._months, n = e._years;
|
|
453
|
+
return a`
|
|
454
|
+
<div class="date-picker__header">
|
|
455
|
+
<h2 class="date-picker__title"
|
|
456
|
+
id=${D}
|
|
457
|
+
aria-live="polite"
|
|
458
|
+
>
|
|
459
|
+
${O(e, "month", e._monthLabel, t.length, e._monthMenuOpen)}
|
|
460
|
+
${O(e, "year", String(e._viewYear), n.length, e._yearMenuOpen)}
|
|
461
|
+
</h2>
|
|
462
|
+
${t.length < 2 ? o : a`
|
|
463
|
+
<nldd-menu class="date-picker__month-menu"
|
|
464
|
+
accessible-label=${e._t("components.date-picker.to-choose-month-action")}
|
|
465
|
+
width="176px"
|
|
466
|
+
@toggle=${e._handleMonthMenuToggle}
|
|
467
|
+
>
|
|
468
|
+
${t.map((t) => a`
|
|
469
|
+
<nldd-menu-item
|
|
470
|
+
type="radio"
|
|
471
|
+
text=${e._t(`components.date-picker.${y[t - 1]}-capitalize`)}
|
|
472
|
+
?selected=${t === e._viewMonth}
|
|
473
|
+
@click=${() => e._handleMonthSelect(t)}
|
|
474
|
+
></nldd-menu-item>
|
|
475
|
+
`)}
|
|
476
|
+
</nldd-menu>
|
|
477
|
+
`}
|
|
478
|
+
${n.length < 2 ? o : a`
|
|
479
|
+
<nldd-menu class="date-picker__year-menu"
|
|
480
|
+
accessible-label=${e._t("components.date-picker.to-choose-year-action")}
|
|
481
|
+
max-items="8"
|
|
482
|
+
width="136px"
|
|
483
|
+
@toggle=${e._handleYearMenuToggle}
|
|
484
|
+
>
|
|
485
|
+
${n.map((t) => a`
|
|
486
|
+
<nldd-menu-item
|
|
487
|
+
type="radio"
|
|
488
|
+
text=${String(t)}
|
|
489
|
+
?selected=${t === e._viewYear}
|
|
490
|
+
@click=${() => e._handleYearSelect(t)}
|
|
491
|
+
></nldd-menu-item>
|
|
492
|
+
`)}
|
|
493
|
+
</nldd-menu>
|
|
494
|
+
`}
|
|
495
|
+
${e._stacked ? o : a`
|
|
496
|
+
<div class="date-picker__pagination">
|
|
497
|
+
${A(e, "sm", "neutral-base")}
|
|
498
|
+
</div>
|
|
499
|
+
`}
|
|
500
|
+
</div>
|
|
501
|
+
`;
|
|
502
|
+
}
|
|
503
|
+
function A(e, t, n) {
|
|
504
|
+
return a`
|
|
505
|
+
<nldd-button-bar
|
|
506
|
+
size=${t}
|
|
507
|
+
appearance=${n}
|
|
508
|
+
>
|
|
509
|
+
<nldd-icon-button
|
|
510
|
+
icon="chevron-left"
|
|
511
|
+
text=${e._t("components.date-picker.view-previous-month-action")}
|
|
512
|
+
tooltip-timing="never"
|
|
513
|
+
@click=${() => e._shiftView(-1)}
|
|
514
|
+
></nldd-icon-button>
|
|
515
|
+
<nldd-button-bar-divider></nldd-button-bar-divider>
|
|
516
|
+
<nldd-icon-button
|
|
517
|
+
icon="chevron-right"
|
|
518
|
+
text=${e._t("components.date-picker.view-next-month-action")}
|
|
519
|
+
tooltip-timing="never"
|
|
520
|
+
@click=${() => e._shiftView(1)}
|
|
521
|
+
></nldd-icon-button>
|
|
522
|
+
</nldd-button-bar>
|
|
523
|
+
`;
|
|
524
|
+
}
|
|
525
|
+
function j(e, t) {
|
|
526
|
+
return a`
|
|
527
|
+
<div class="date-picker__footer">
|
|
528
|
+
<div class="date-picker__footer-start">
|
|
529
|
+
${e._todayReachable ? a`
|
|
530
|
+
<nldd-button
|
|
531
|
+
size=${t ? "md" : "sm"}
|
|
532
|
+
appearance="neutral-tinted"
|
|
533
|
+
text=${e._t("components.date-picker.view-today-action")}
|
|
534
|
+
@click=${e._handleToday}
|
|
535
|
+
></nldd-button>
|
|
536
|
+
` : o}
|
|
537
|
+
</div>
|
|
538
|
+
<div class="date-picker__footer-end">
|
|
539
|
+
${t ? A(e, "md", "neutral-tinted") : o}
|
|
540
|
+
</div>
|
|
541
|
+
</div>
|
|
542
|
+
`;
|
|
543
|
+
}
|
|
544
|
+
function M(e) {
|
|
545
|
+
return a`
|
|
546
|
+
<tr>
|
|
547
|
+
${e.weekNumbers ? a`
|
|
548
|
+
<th class="date-picker__week-header-cell"
|
|
549
|
+
scope="col"
|
|
550
|
+
abbr=${e._t("components.date-picker.week-number-column-label")}
|
|
551
|
+
>
|
|
552
|
+
${e._t("components.date-picker.week-number-column-short-lowercase-label")}
|
|
553
|
+
</th>
|
|
554
|
+
` : o}
|
|
555
|
+
${e._weekdays.map((t) => a`
|
|
556
|
+
<th class="date-picker__weekday-header-cell"
|
|
557
|
+
scope="col"
|
|
558
|
+
abbr=${e._t(`components.date-picker.${_[t]}-lowercase`)}
|
|
559
|
+
>
|
|
560
|
+
${e._t(`components.date-picker.${_[t]}-short-lowercase`)}
|
|
561
|
+
</th>
|
|
562
|
+
`)}
|
|
563
|
+
</tr>
|
|
564
|
+
`;
|
|
565
|
+
}
|
|
566
|
+
function N(e, t) {
|
|
567
|
+
let n = e._isUnavailable(t), r = e._isSelected(t), i = e._bandFor(t);
|
|
568
|
+
return a`
|
|
569
|
+
<td class="date-picker__day-cell"
|
|
570
|
+
aria-selected=${r ? "true" : o}
|
|
571
|
+
>
|
|
572
|
+
<button class=${f({
|
|
573
|
+
"date-picker__day": !0,
|
|
574
|
+
"is-selected": r,
|
|
575
|
+
"is-in-range": e._isInRange(t),
|
|
576
|
+
"is-range-start": i === "start",
|
|
577
|
+
"is-range-end": i === "end",
|
|
578
|
+
"is-today": e._isToday(t),
|
|
579
|
+
"is-outside-month": e._isOutsideMonth(t),
|
|
580
|
+
"is-unavailable": n
|
|
581
|
+
})}
|
|
582
|
+
type="button"
|
|
583
|
+
data-date=${t}
|
|
584
|
+
tabindex=${t === e._focused ? "0" : "-1"}
|
|
585
|
+
aria-label=${e._dayLabel(t)}
|
|
586
|
+
aria-disabled=${n ? "true" : o}
|
|
587
|
+
aria-current=${e._isToday(t) ? "date" : o}
|
|
588
|
+
@click=${() => e._handleDayClick(t)}
|
|
589
|
+
@pointerdown=${(n) => e._handleDayPointerDown(t, n)}
|
|
590
|
+
@mouseenter=${() => e._handleDayHover(t)}
|
|
591
|
+
>
|
|
592
|
+
${i === "none" ? o : a`<span class=${f({
|
|
593
|
+
"date-picker__day-range-indicator": !0,
|
|
594
|
+
"is-start": i === "start",
|
|
595
|
+
"is-end": i === "end"
|
|
596
|
+
})}></span>`}
|
|
597
|
+
<span class="date-picker__day-indicator"></span>
|
|
598
|
+
<span class="date-picker__day-number">
|
|
599
|
+
${Number(t.slice(8, 10))}
|
|
600
|
+
</span>
|
|
601
|
+
</button>
|
|
602
|
+
</td>
|
|
603
|
+
`;
|
|
604
|
+
}
|
|
605
|
+
function P(e) {
|
|
606
|
+
return a`
|
|
607
|
+
<div class="date-picker">
|
|
608
|
+
${k(e)}
|
|
609
|
+
<table class="date-picker__calendar"
|
|
610
|
+
role="grid"
|
|
611
|
+
aria-label=${e.accessibleLabel || o}
|
|
612
|
+
aria-labelledby=${e.accessibleLabel ? o : D}
|
|
613
|
+
@keydown=${e._handleKeydown}
|
|
614
|
+
@focusin=${e._handleDayFocusIn}
|
|
615
|
+
@focusout=${e._handleDayFocusOut}
|
|
616
|
+
@pointermove=${e._handleGridPointerMove}
|
|
617
|
+
@mouseleave=${e._handleGridLeave}
|
|
618
|
+
>
|
|
619
|
+
<thead>
|
|
620
|
+
${M(e)}
|
|
621
|
+
</thead>
|
|
622
|
+
<tbody>
|
|
623
|
+
${e._weeks.map((t) => a`
|
|
624
|
+
<tr>
|
|
625
|
+
${e.weekNumbers ? a`
|
|
626
|
+
<th class="date-picker__week-cell"
|
|
627
|
+
scope="row"
|
|
628
|
+
aria-label=${e._t("components.date-picker.week-number-label", { week: e._weekNumber(t) })}
|
|
629
|
+
>
|
|
630
|
+
${e._weekNumber(t)}
|
|
631
|
+
</th>
|
|
632
|
+
` : o}
|
|
633
|
+
${t.map((t) => N(e, t))}
|
|
634
|
+
</tr>
|
|
635
|
+
`)}
|
|
636
|
+
</tbody>
|
|
637
|
+
</table>
|
|
638
|
+
${e._stacked || e._todayReachable ? j(e, e._stacked) : o}
|
|
639
|
+
<div class="date-picker__announcer"
|
|
640
|
+
role="status"
|
|
641
|
+
aria-live="polite"
|
|
642
|
+
>
|
|
643
|
+
${e._announcement}
|
|
644
|
+
</div>
|
|
645
|
+
</div>
|
|
646
|
+
`;
|
|
647
|
+
}
|
|
648
|
+
// src/components/inputs/date-picker/date-picker.ts
|
|
649
|
+
var F = /* @__PURE__ */ e({ NLDDDatePicker: () => Y }), I;
|
|
650
|
+
function L(e) {
|
|
651
|
+
let t = /^(\d{4})-(\d{2})-(\d{2})$/.exec(e);
|
|
652
|
+
if (!t) return null;
|
|
653
|
+
let n = new Date(Date.UTC(Number(t[1]), Number(t[2]) - 1, Number(t[3])));
|
|
654
|
+
return Number.isNaN(n.getTime()) ? null : n;
|
|
655
|
+
}
|
|
656
|
+
function R(e) {
|
|
657
|
+
return x(e.getUTCFullYear(), e.getUTCMonth() + 1, e.getUTCDate()) ?? "";
|
|
658
|
+
}
|
|
659
|
+
function z(e, t) {
|
|
660
|
+
let n = L(e);
|
|
661
|
+
return n ? (n.setUTCDate(n.getUTCDate() + t), R(n)) : e;
|
|
662
|
+
}
|
|
663
|
+
function B(e, t) {
|
|
664
|
+
let n = L(e);
|
|
665
|
+
if (!n) return e;
|
|
666
|
+
let r = n.getUTCDate(), i = n.getUTCFullYear() * 12 + n.getUTCMonth() + t, a = Math.floor(i / 12), o = (i % 12 + 12) % 12 + 1, s = new Date(Date.UTC(a, o, 0)).getUTCDate();
|
|
667
|
+
return x(a, o, Math.min(r, s)) ?? e;
|
|
668
|
+
}
|
|
669
|
+
function V() {
|
|
670
|
+
let e = /* @__PURE__ */ new Date();
|
|
671
|
+
return x(e.getFullYear(), e.getMonth() + 1, e.getDate()) ?? "";
|
|
672
|
+
}
|
|
673
|
+
function H(e) {
|
|
674
|
+
return `${e.slice(0, 7)}-01`;
|
|
675
|
+
}
|
|
676
|
+
function U(e) {
|
|
677
|
+
let t = L(e);
|
|
678
|
+
return t ? x(t.getUTCFullYear(), t.getUTCMonth() + 1, new Date(Date.UTC(t.getUTCFullYear(), t.getUTCMonth() + 1, 0)).getUTCDate()) ?? e : e;
|
|
679
|
+
}
|
|
680
|
+
function W(e) {
|
|
681
|
+
return L(e)?.getUTCDay() ?? 0;
|
|
682
|
+
}
|
|
683
|
+
function G(e, t) {
|
|
684
|
+
return z(e, -((W(e) - t + 7) % 7));
|
|
685
|
+
}
|
|
686
|
+
function K(e, t) {
|
|
687
|
+
let n = Number(e.slice(5, 7)), r = Number(e.slice(8, 10)), i = new Date(Date.UTC(t, n, 0)).getUTCDate();
|
|
688
|
+
return x(t, n, Math.min(r, i)) ?? e;
|
|
689
|
+
}
|
|
690
|
+
function q(e, t) {
|
|
691
|
+
let n = Number(e.slice(0, 4)), r = Number(e.slice(8, 10)), i = new Date(Date.UTC(n, t, 0)).getUTCDate();
|
|
692
|
+
return x(n, t, Math.min(r, i)) ?? e;
|
|
693
|
+
}
|
|
694
|
+
function J(e, t, n) {
|
|
695
|
+
return t && e < t ? t : n && e > n ? n : e;
|
|
696
|
+
}
|
|
697
|
+
var Y = (I = class extends p(d(i, v)) {
|
|
698
|
+
constructor(...e) {
|
|
699
|
+
super(...e), this.value = "", this.start = "", this.end = "", this.width = "", this.range = !1, this.min = "", this.max = "", this.firstDayOfWeek = 1, this.weekNumbers = !1, this.accessibleLabel = "", this._focused = "", this._view = "", this._anchor = "", this._hover = "", this._announcement = "", this._monthMenuOpen = !1, this._yearMenuOpen = !1, this._stacked = !1, this._handleStackedChange = () => {
|
|
700
|
+
this._stacked = !!this._stackedQuery?.matches;
|
|
701
|
+
}, this._restoreFocus = !1, this.invalid = !1, this._focusFromKeyboard = !1, this._dragOrigin = "", this._dragged = !1, this._suppressClick = !1, this._onDocumentPointerUp = (e) => {
|
|
702
|
+
document.removeEventListener("pointerup", this._onDocumentPointerUp);
|
|
703
|
+
let t = this._dragOrigin;
|
|
704
|
+
if (this._dragOrigin = "", !this._dragged) return;
|
|
705
|
+
this._dragged = !1, this._suppressClick = !0;
|
|
706
|
+
let n = this._dayUnderPointer(e);
|
|
707
|
+
n && !this._isUnavailable(n) && this._commitRange(t, n);
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
async _handleMonthMenuToggle(e) {
|
|
711
|
+
this._monthMenuOpen = e.newState === "open", this._monthMenuOpen && await this._openMenuOnSelection(".date-picker__month-menu");
|
|
712
|
+
}
|
|
713
|
+
async _handleYearMenuToggle(e) {
|
|
714
|
+
this._yearMenuOpen = e.newState === "open", this._yearMenuOpen && await this._openMenuOnSelection(".date-picker__year-menu");
|
|
715
|
+
}
|
|
716
|
+
async _openMenuOnSelection(e) {
|
|
717
|
+
let t = this.shadowRoot?.querySelector(e);
|
|
718
|
+
await t?.updateComplete;
|
|
719
|
+
let n = () => {
|
|
720
|
+
let e = t?.querySelector("nldd-menu-item[selected]");
|
|
721
|
+
e && this.shadowRoot?.activeElement !== e && (e.scrollIntoView({ block: "nearest" }), e.focus({ preventScroll: !0 }));
|
|
722
|
+
};
|
|
723
|
+
requestAnimationFrame(n), t?.addEventListener("focusin", (e) => {
|
|
724
|
+
e.target === t && n();
|
|
725
|
+
}, { once: !0 });
|
|
726
|
+
}
|
|
727
|
+
connectedCallback() {
|
|
728
|
+
super.connectedCallback(), this._focused || (this._focused = this._initialFocus()), this._view || (this._view = H(this._focused)), this._stackedQuery = window.matchMedia(`(max-width: ${g.smMax}), (pointer: coarse)`), this._stacked = this._stackedQuery.matches, this._stackedQuery.addEventListener("change", this._handleStackedChange);
|
|
729
|
+
}
|
|
730
|
+
disconnectedCallback() {
|
|
731
|
+
super.disconnectedCallback(), document.removeEventListener("pointerup", this._onDocumentPointerUp), this._stackedQuery?.removeEventListener("change", this._handleStackedChange);
|
|
732
|
+
}
|
|
733
|
+
willUpdate(e) {
|
|
734
|
+
if (super.willUpdate(e), e.has("value") || e.has("start") || e.has("end")) {
|
|
735
|
+
let e = this.range ? this.start || this.end : this.value;
|
|
736
|
+
e && H(e) !== this._view && (this._view = H(e), this._focused = e);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
updated(e) {
|
|
740
|
+
if (this.toggleAttribute("stacked", this._stacked), e.has("width")) {
|
|
741
|
+
let e = this.width;
|
|
742
|
+
e === "full" ? this.style.setProperty("--_date-picker-width", "100%") : e && CSS.supports("width", e) ? this.style.setProperty("--_date-picker-width", e) : this.style.removeProperty("--_date-picker-width");
|
|
743
|
+
}
|
|
744
|
+
for (let e of ["month", "year"]) {
|
|
745
|
+
let t = this.shadowRoot?.querySelector(`.date-picker__${e}-menu`), n = this.shadowRoot?.querySelector(`.date-picker__title-${e}-button`);
|
|
746
|
+
t && n && (t.anchorElement !== n && (t.anchorElement = n), n.popoverTargetElement !== t && (n.popoverTargetElement = t));
|
|
747
|
+
}
|
|
748
|
+
this._restoreFocus && (this._restoreFocus = !1, this._focusedCell()?.focus());
|
|
749
|
+
}
|
|
750
|
+
_focusedCell() {
|
|
751
|
+
return this.shadowRoot?.querySelector(".date-picker__day[tabindex=\"0\"]") ?? null;
|
|
752
|
+
}
|
|
753
|
+
focus(e) {
|
|
754
|
+
if (m(this, e)) return;
|
|
755
|
+
let t = this._focusedCell();
|
|
756
|
+
t ? t.focus(e) : super.focus(e);
|
|
757
|
+
}
|
|
758
|
+
_initialFocus() {
|
|
759
|
+
return J((this.range ? this.start : this.value) || V(), this._min, this._max);
|
|
760
|
+
}
|
|
761
|
+
get _min() {
|
|
762
|
+
return T(this.min);
|
|
763
|
+
}
|
|
764
|
+
get _max() {
|
|
765
|
+
return T(this.max);
|
|
766
|
+
}
|
|
767
|
+
_isOutOfBounds(e) {
|
|
768
|
+
let t = this._min, n = this._max;
|
|
769
|
+
return !!(t && e < t || n && e > n);
|
|
770
|
+
}
|
|
771
|
+
_isUnavailable(e) {
|
|
772
|
+
return this._isOutOfBounds(e) ? !0 : this.isDateUnavailable?.(e) ?? !1;
|
|
773
|
+
}
|
|
774
|
+
get _weekdays() {
|
|
775
|
+
return Array.from({ length: 7 }, (e, t) => (this.firstDayOfWeek + t) % 7);
|
|
776
|
+
}
|
|
777
|
+
get _weeks() {
|
|
778
|
+
let e = (W(this._view) - this.firstDayOfWeek + 7) % 7, t = z(this._view, -e);
|
|
779
|
+
return Array.from({ length: 6 }, (e, n) => Array.from({ length: 7 }, (e, r) => z(t, n * 7 + r)));
|
|
780
|
+
}
|
|
781
|
+
_isOutsideMonth(e) {
|
|
782
|
+
return e.slice(0, 7) !== this._view.slice(0, 7);
|
|
783
|
+
}
|
|
784
|
+
_weekNumber(e) {
|
|
785
|
+
let t = L(e.find((e) => W(e) === 4) ?? e[0]);
|
|
786
|
+
if (!t) return 0;
|
|
787
|
+
let n = new Date(Date.UTC(t.getUTCFullYear(), 0, 4));
|
|
788
|
+
return n.setUTCDate(n.getUTCDate() - (n.getUTCDay() + 6) % 7 + 3), 1 + Math.round((t.getTime() - n.getTime()) / 6048e5);
|
|
789
|
+
}
|
|
790
|
+
get _viewYear() {
|
|
791
|
+
return Number(this._view.slice(0, 4));
|
|
792
|
+
}
|
|
793
|
+
get _viewMonth() {
|
|
794
|
+
return Number(this._view.slice(5, 7));
|
|
795
|
+
}
|
|
796
|
+
get _months() {
|
|
797
|
+
let e = this._min ? Number(this._min.slice(0, 4)) : null, t = this._max ? Number(this._max.slice(0, 4)) : null;
|
|
798
|
+
if (e !== null && this._viewYear < e || t !== null && this._viewYear > t) return [];
|
|
799
|
+
let n = e === this._viewYear ? Number(this._min.slice(5, 7)) : 1, r = t === this._viewYear ? Number(this._max.slice(5, 7)) : 12;
|
|
800
|
+
return r < n ? [] : Array.from({ length: r - n + 1 }, (e, t) => n + t);
|
|
801
|
+
}
|
|
802
|
+
get _years() {
|
|
803
|
+
let e = Number(V().slice(0, 4)), t = this._min ? Number(this._min.slice(0, 4)) : Math.min(e - 120, this._viewYear), n = this._max ? Number(this._max.slice(0, 4)) : Math.max(e + 20, this._viewYear);
|
|
804
|
+
return n < t ? [] : Array.from({ length: n - t + 1 }, (e, n) => t + n);
|
|
805
|
+
}
|
|
806
|
+
_handleMonthSelect(e) {
|
|
807
|
+
this._view = H(J(q(this._view, e), this._min, this._max)), this._focused = J(q(this._focused, e), this._min, this._max), this._restoreFocus = !!this._focusedCell(), this._closeMenu(".date-picker__month-menu");
|
|
808
|
+
}
|
|
809
|
+
_handleYearSelect(e) {
|
|
810
|
+
this._view = H(J(K(this._view, e), this._min, this._max)), this._focused = J(K(this._focused, e), this._min, this._max), this._restoreFocus = !!this._focusedCell(), this._closeMenu(".date-picker__year-menu");
|
|
811
|
+
}
|
|
812
|
+
_closeMenu(e) {
|
|
813
|
+
let t = this.shadowRoot?.querySelector(e);
|
|
814
|
+
t?.matches(":popover-open") && t.hidePopover?.();
|
|
815
|
+
}
|
|
816
|
+
get _monthLabel() {
|
|
817
|
+
return this._t(`components.date-picker.${y[this._viewMonth - 1]}-capitalize`);
|
|
818
|
+
}
|
|
819
|
+
_isSelected(e) {
|
|
820
|
+
if (!this.range) return e === this.value;
|
|
821
|
+
let [t, n] = this._previewSpan();
|
|
822
|
+
return t && n ? e === t || e === n : e === this.start || e === this.end;
|
|
823
|
+
}
|
|
824
|
+
_bandFor(e) {
|
|
825
|
+
if (!this.range) return "none";
|
|
826
|
+
let [t, n] = this._previewSpan();
|
|
827
|
+
return !t || !n || t === n ? "none" : e > t && e < n ? "full" : e === t ? "start" : e === n ? "end" : "none";
|
|
828
|
+
}
|
|
829
|
+
_isInRange(e) {
|
|
830
|
+
return this._bandFor(e) === "full";
|
|
831
|
+
}
|
|
832
|
+
_previewSpan() {
|
|
833
|
+
return this.start && this.end ? [this.start, this.end] : this._anchor && this._hover ? this._anchor < this._hover ? [this._anchor, this._hover] : [this._hover, this._anchor] : ["", ""];
|
|
834
|
+
}
|
|
835
|
+
_isToday(e) {
|
|
836
|
+
return e === V();
|
|
837
|
+
}
|
|
838
|
+
_dateText(e) {
|
|
839
|
+
let t = L(e);
|
|
840
|
+
if (!t) return "";
|
|
841
|
+
let n = this._t(`components.date-picker.${_[t.getUTCDay()]}-lowercase`), r = this._t(`components.date-picker.${y[t.getUTCMonth()]}-lowercase`);
|
|
842
|
+
return this._t("components.date-picker.date-label", {
|
|
843
|
+
weekday: n,
|
|
844
|
+
day: t.getUTCDate(),
|
|
845
|
+
month: r,
|
|
846
|
+
year: t.getUTCFullYear()
|
|
847
|
+
});
|
|
848
|
+
}
|
|
849
|
+
_dayLabel(e) {
|
|
850
|
+
if (!L(e)) return "";
|
|
851
|
+
let t = [this._dateText(e)];
|
|
852
|
+
return this._isToday(e) && t.push(this._t("components.date-picker.today-lowercase")), this.range && this._anchor !== "" && this.end === "" && e === this._anchor ? t.push(this._t("components.date-picker.range-anchor-lowercase-label")) : (this.range && e === this.start && t.push(this._t("components.date-picker.range-start-lowercase-label")), this.range && e === this.end && t.push(this._t("components.date-picker.range-end-lowercase-label"))), this._isInRange(e) && t.push(this._t("components.date-picker.in-range-lowercase-label")), this._isUnavailable(e) && t.push(this._t("components.date-picker.unavailable-lowercase-label")), t.join(", ");
|
|
853
|
+
}
|
|
854
|
+
_shiftView(e) {
|
|
855
|
+
let t = B(this._view, e);
|
|
856
|
+
this._view = t;
|
|
857
|
+
let n = Math.min(Number(this._focused.slice(8, 10)), Number(U(t).slice(8, 10)));
|
|
858
|
+
this._focused = J(`${t.slice(0, 7)}-${String(n).padStart(2, "0")}`, this._min, this._max);
|
|
859
|
+
}
|
|
860
|
+
_moveFocus(e) {
|
|
861
|
+
let t = J(e, this._min, this._max);
|
|
862
|
+
this._focused = t, H(t) !== this._view && (this._view = H(t)), this._focusFromKeyboard = !0, this._restoreFocus = !0;
|
|
863
|
+
}
|
|
864
|
+
_handleKeydown(e) {
|
|
865
|
+
let t = this._focused, n;
|
|
866
|
+
switch (e.key) {
|
|
867
|
+
case "ArrowLeft":
|
|
868
|
+
n = z(t, -1);
|
|
869
|
+
break;
|
|
870
|
+
case "ArrowRight":
|
|
871
|
+
n = z(t, 1);
|
|
872
|
+
break;
|
|
873
|
+
case "ArrowUp":
|
|
874
|
+
n = z(t, -7);
|
|
875
|
+
break;
|
|
876
|
+
case "ArrowDown":
|
|
877
|
+
n = z(t, 7);
|
|
878
|
+
break;
|
|
879
|
+
case "Home":
|
|
880
|
+
n = G(t, this.firstDayOfWeek);
|
|
881
|
+
break;
|
|
882
|
+
case "End":
|
|
883
|
+
n = z(G(t, this.firstDayOfWeek), 6);
|
|
884
|
+
break;
|
|
885
|
+
case "PageUp":
|
|
886
|
+
n = B(t, e.shiftKey ? -12 : -1);
|
|
887
|
+
break;
|
|
888
|
+
case "PageDown":
|
|
889
|
+
n = B(t, e.shiftKey ? 12 : 1);
|
|
890
|
+
break;
|
|
891
|
+
case "Enter":
|
|
892
|
+
case " ":
|
|
893
|
+
e.preventDefault(), this._select(t);
|
|
894
|
+
return;
|
|
895
|
+
default: return;
|
|
896
|
+
}
|
|
897
|
+
e.preventDefault(), this._moveFocus(n);
|
|
898
|
+
}
|
|
899
|
+
_handleDayClick(e) {
|
|
900
|
+
this._suppressClick ? this._suppressClick = !1 : this._select(e);
|
|
901
|
+
}
|
|
902
|
+
_handleDayHover(e) {
|
|
903
|
+
this.range && this._anchor && (this._hover = e);
|
|
904
|
+
}
|
|
905
|
+
_handleDayFocusIn(e) {
|
|
906
|
+
let t = !this._focusFromKeyboard && h();
|
|
907
|
+
this._focusFromKeyboard = !1, e.target?.classList?.toggle("is-pointer-focus", t);
|
|
908
|
+
}
|
|
909
|
+
_handleDayFocusOut(e) {
|
|
910
|
+
e.target?.classList?.remove("is-pointer-focus");
|
|
911
|
+
}
|
|
912
|
+
_handleGridLeave() {
|
|
913
|
+
this._dragOrigin || (this._hover = "");
|
|
914
|
+
}
|
|
915
|
+
_handleDayPointerDown(e, t) {
|
|
916
|
+
this._suppressClick = !1, this.range && t.pointerType !== "touch" && (this._isUnavailable(e) || (this._dragOrigin = e, this._dragged = !1, document.addEventListener("pointerup", this._onDocumentPointerUp)));
|
|
917
|
+
}
|
|
918
|
+
_handleGridPointerMove(e) {
|
|
919
|
+
if (!this._dragOrigin) return;
|
|
920
|
+
let t = this._dayUnderPointer(e);
|
|
921
|
+
t && t !== this._dragOrigin && (this._dragged || (this._dragged = !0, this._beginRange(this._dragOrigin)), this._hover = t);
|
|
922
|
+
}
|
|
923
|
+
_dayUnderPointer(e) {
|
|
924
|
+
return (this.shadowRoot?.elementFromPoint(e.clientX, e.clientY))?.closest(".date-picker__day")?.getAttribute("data-date") ?? "";
|
|
925
|
+
}
|
|
926
|
+
_select(e) {
|
|
927
|
+
this._isUnavailable(e) || (this._focused = e, this._isOutsideMonth(e) && (this._view = H(e)), this.range ? !this._anchor || this.start && this.end ? this._beginRange(e) : this._commitRange(this._anchor, e) : (this.value = e, this._announce(this._t("components.date-picker.date-selected-text", { date: this._dateText(e) })), this._emit("change", { value: e })));
|
|
928
|
+
}
|
|
929
|
+
_rangeHasUnavailable(e, t) {
|
|
930
|
+
let [n, r] = e < t ? [e, t] : [t, e];
|
|
931
|
+
for (let e = n; e <= r; e = z(e, 1)) if (this._isUnavailable(e)) return !0;
|
|
932
|
+
return !1;
|
|
933
|
+
}
|
|
934
|
+
_commitRange(e, t) {
|
|
935
|
+
this._rangeHasUnavailable(e, t) ? this._announce(this._t("components.date-picker.range-blocked-text")) : (this.start = e < t ? e : t, this.end = e < t ? t : e, this._anchor = "", this._hover = "", this._announce(this._t("components.date-picker.range-selected-text", {
|
|
936
|
+
start: this._dateText(this.start),
|
|
937
|
+
end: this._dateText(this.end)
|
|
938
|
+
})), this._emit("change", {
|
|
939
|
+
start: this.start,
|
|
940
|
+
end: this.end
|
|
941
|
+
}));
|
|
942
|
+
}
|
|
943
|
+
_beginRange(e) {
|
|
944
|
+
this._anchor = e, this.start = e, this.end = "", this._hover = "", this._announce(this._t("components.date-picker.range-anchor-text", { date: this._dateText(e) })), this._emit("input", {
|
|
945
|
+
start: e,
|
|
946
|
+
end: ""
|
|
947
|
+
});
|
|
948
|
+
}
|
|
949
|
+
_announce(e) {
|
|
950
|
+
this._announcement = e;
|
|
951
|
+
}
|
|
952
|
+
_emit(e, t) {
|
|
953
|
+
this.dispatchEvent(new CustomEvent(e, {
|
|
954
|
+
detail: t,
|
|
955
|
+
bubbles: !0,
|
|
956
|
+
composed: !0
|
|
957
|
+
}));
|
|
958
|
+
}
|
|
959
|
+
get _todayReachable() {
|
|
960
|
+
return !this._isOutOfBounds(V());
|
|
961
|
+
}
|
|
962
|
+
_handleToday() {
|
|
963
|
+
let e = V();
|
|
964
|
+
this._view = H(e), this._focused = e;
|
|
965
|
+
}
|
|
966
|
+
describedTarget() {
|
|
967
|
+
return this.shadowRoot?.querySelector("[role=\"grid\"]") ?? null;
|
|
968
|
+
}
|
|
969
|
+
render() {
|
|
970
|
+
return P(this);
|
|
971
|
+
}
|
|
972
|
+
}, I.styles = E, I.isFormInput = !0, I);
|
|
973
|
+
s([n({ type: String })], Y.prototype, "value", void 0), s([n({ type: String })], Y.prototype, "start", void 0), s([n({ type: String })], Y.prototype, "end", void 0), s([n({
|
|
974
|
+
reflect: !0,
|
|
975
|
+
converter: l("")
|
|
976
|
+
})], Y.prototype, "width", void 0), s([n({
|
|
977
|
+
type: Boolean,
|
|
978
|
+
reflect: !0
|
|
979
|
+
})], Y.prototype, "range", void 0), s([n({ type: String })], Y.prototype, "min", void 0), s([n({ type: String })], Y.prototype, "max", void 0), s([n({
|
|
980
|
+
type: Number,
|
|
981
|
+
attribute: "first-day-of-week"
|
|
982
|
+
})], Y.prototype, "firstDayOfWeek", void 0), s([n({
|
|
983
|
+
type: Boolean,
|
|
984
|
+
reflect: !0,
|
|
985
|
+
attribute: "week-numbers"
|
|
986
|
+
})], Y.prototype, "weekNumbers", void 0), s([n({
|
|
987
|
+
type: String,
|
|
988
|
+
attribute: "accessible-label"
|
|
989
|
+
})], Y.prototype, "accessibleLabel", void 0), s([n({ attribute: !1 })], Y.prototype, "isDateUnavailable", void 0), s([r()], Y.prototype, "_focused", void 0), s([r()], Y.prototype, "_view", void 0), s([r()], Y.prototype, "_anchor", void 0), s([r()], Y.prototype, "_hover", void 0), s([r()], Y.prototype, "_announcement", void 0), s([r()], Y.prototype, "_monthMenuOpen", void 0), s([r()], Y.prototype, "_yearMenuOpen", void 0), s([r()], Y.prototype, "_stacked", void 0), s([n({
|
|
990
|
+
type: Boolean,
|
|
991
|
+
reflect: !0
|
|
992
|
+
})], Y.prototype, "invalid", void 0), Y = s([c("nldd-date-picker")], Y);
|
|
993
|
+
export { T as n, x as r, F as t };
|