@beeq/core 1.12.14-beta.0 → 1.13.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/dist/beeq/beeq.esm.js +1 -1
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +1 -1
- package/dist/beeq/{p-9d1503bd.entry.js → p-0d078519.entry.js} +2 -2
- package/dist/beeq/{p-9d1503bd.entry.js.map → p-0d078519.entry.js.map} +1 -1
- package/dist/beeq/{p-7f9d895b.entry.js → p-1a2c4878.entry.js} +2 -2
- package/dist/beeq/{p-7f9d895b.entry.js.map → p-1a2c4878.entry.js.map} +1 -1
- package/dist/beeq/p-21db4f39.entry.js +6 -0
- package/dist/beeq/p-21db4f39.entry.js.map +1 -0
- package/dist/beeq/{p-f47905ae.entry.js → p-24bb2588.entry.js} +2 -2
- package/dist/beeq/{p-f47905ae.entry.js.map → p-24bb2588.entry.js.map} +1 -1
- package/dist/beeq/{p-41910dc5.entry.js → p-2a081a54.entry.js} +2 -2
- package/dist/beeq/{p-41910dc5.entry.js.map → p-2a081a54.entry.js.map} +1 -1
- package/dist/beeq/{p-515a1162.entry.js → p-2e1fffcd.entry.js} +2 -2
- package/dist/beeq/{p-515a1162.entry.js.map → p-2e1fffcd.entry.js.map} +1 -1
- package/dist/beeq/p-2fd6ea70.entry.js +6 -0
- package/dist/beeq/{p-2283258e.entry.js.map → p-2fd6ea70.entry.js.map} +1 -1
- package/dist/beeq/{p-7d356cce.entry.js → p-30d1bd84.entry.js} +2 -2
- package/dist/beeq/p-30d1bd84.entry.js.map +1 -0
- package/dist/beeq/{p-882966dd.entry.js → p-38006c8e.entry.js} +2 -2
- package/dist/beeq/p-3d754d97.entry.js +6 -0
- package/dist/beeq/p-3d754d97.entry.js.map +1 -0
- package/dist/beeq/{p-e9535627.entry.js → p-45ae19aa.entry.js} +2 -2
- package/dist/beeq/p-45ae19aa.entry.js.map +1 -0
- package/dist/beeq/{p-54bfb042.entry.js → p-56b49d4e.entry.js} +2 -2
- package/dist/beeq/{p-54bfb042.entry.js.map → p-56b49d4e.entry.js.map} +1 -1
- package/dist/beeq/{p-0d8618d2.entry.js → p-58813f83.entry.js} +2 -2
- package/dist/beeq/{p-0d8618d2.entry.js.map → p-58813f83.entry.js.map} +1 -1
- package/dist/beeq/{p-050c757b.entry.js → p-5eba392c.entry.js} +2 -2
- package/dist/beeq/{p-050c757b.entry.js.map → p-5eba392c.entry.js.map} +1 -1
- package/dist/beeq/{p-debcabde.entry.js → p-6a38fcaf.entry.js} +2 -2
- package/dist/beeq/{p-debcabde.entry.js.map → p-6a38fcaf.entry.js.map} +1 -1
- package/dist/beeq/{p-8dfd0329.entry.js → p-6b0f896f.entry.js} +2 -2
- package/dist/beeq/{p-a0ef4135.entry.js → p-6be3f23a.entry.js} +2 -2
- package/dist/beeq/{p-a0ef4135.entry.js.map → p-6be3f23a.entry.js.map} +1 -1
- package/dist/beeq/{p-ea473f56.entry.js → p-72ff2fe2.entry.js} +2 -2
- package/dist/beeq/{p-7527b08d.entry.js → p-79fd999a.entry.js} +2 -2
- package/dist/beeq/{p-7527b08d.entry.js.map → p-79fd999a.entry.js.map} +1 -1
- package/dist/beeq/{p-0323869d.entry.js → p-7ebe6b9d.entry.js} +2 -2
- package/dist/beeq/p-7ebe6b9d.entry.js.map +1 -0
- package/dist/beeq/{p-250ee94e.entry.js → p-817f7a5e.entry.js} +2 -2
- package/dist/beeq/{p-250ee94e.entry.js.map → p-817f7a5e.entry.js.map} +1 -1
- package/dist/beeq/{p-ad419446.entry.js → p-8bd7f4c2.entry.js} +2 -2
- package/dist/beeq/{p-e63d6c4f.entry.js → p-8be7ceb5.entry.js} +2 -2
- package/dist/beeq/{p-e63d6c4f.entry.js.map → p-8be7ceb5.entry.js.map} +1 -1
- package/dist/beeq/{p-42e388d0.entry.js → p-9413a4d3.entry.js} +2 -2
- package/dist/beeq/{p-42e388d0.entry.js.map → p-9413a4d3.entry.js.map} +1 -1
- package/dist/beeq/{p-c25c20bf.entry.js → p-96f72671.entry.js} +2 -2
- package/dist/beeq/p-96f72671.entry.js.map +1 -0
- package/dist/beeq/{p-CO2T68hs.js → p-BSSRzVAz.js} +2 -2
- package/dist/beeq/p-BSSRzVAz.js.map +1 -0
- package/dist/beeq/p-DbxZ8FhA.js +6 -0
- package/dist/beeq/p-DbxZ8FhA.js.map +1 -0
- package/dist/beeq/p-DdvbF5yL.js.map +1 -1
- package/dist/beeq/p-Dx-CEPSQ.js.map +1 -1
- package/dist/beeq/p-a0a8ea5b.entry.js +6 -0
- package/dist/beeq/p-a0a8ea5b.entry.js.map +1 -0
- package/dist/beeq/{p-2e9bc398.entry.js → p-a55354ee.entry.js} +2 -2
- package/dist/beeq/{p-2e9bc398.entry.js.map → p-a55354ee.entry.js.map} +1 -1
- package/dist/beeq/{p-7adb6e2e.entry.js → p-a72671f9.entry.js} +2 -2
- package/dist/beeq/p-a72671f9.entry.js.map +1 -0
- package/dist/beeq/{p-40bb4e2c.entry.js → p-bb99b400.entry.js} +2 -2
- package/dist/beeq/{p-40bb4e2c.entry.js.map → p-bb99b400.entry.js.map} +1 -1
- package/dist/beeq/p-bdb983f9.entry.js +6 -0
- package/dist/beeq/{p-bb46524f.entry.js.map → p-bdb983f9.entry.js.map} +1 -1
- package/dist/beeq/{p-cfe07fad.entry.js → p-cf2e4d57.entry.js} +2 -2
- package/dist/beeq/{p-cfe07fad.entry.js.map → p-cf2e4d57.entry.js.map} +1 -1
- package/dist/beeq/{p-6cd90918.entry.js → p-d6c35472.entry.js} +2 -2
- package/dist/beeq/{p-6cd90918.entry.js.map → p-d6c35472.entry.js.map} +1 -1
- package/dist/beeq/p-d792e3d3.entry.js +6 -0
- package/dist/beeq/{p-edc81a31.entry.js.map → p-d792e3d3.entry.js.map} +1 -1
- package/dist/beeq/{p-bae91da4.entry.js → p-e91ee0da.entry.js} +2 -2
- package/dist/beeq/{p-bae91da4.entry.js.map → p-e91ee0da.entry.js.map} +1 -1
- package/dist/beeq/{p-1fb43de2.entry.js → p-e9a1b183.entry.js} +2 -2
- package/dist/beeq/{p-580f0a77.entry.js → p-f3184477.entry.js} +2 -2
- package/dist/beeq/{p-580f0a77.entry.js.map → p-f3184477.entry.js.map} +1 -1
- package/dist/beeq/p-f688d230.entry.js +6 -0
- package/dist/beeq/{p-1e675bdc.entry.js.map → p-f688d230.entry.js.map} +1 -1
- package/dist/beeq/{p-3c77308c.entry.js → p-f891fb4b.entry.js} +2 -2
- package/dist/beeq/{p-40163197.entry.js → p-fa123a10.entry.js} +2 -2
- package/dist/beeq/{p-40163197.entry.js.map → p-fa123a10.entry.js.map} +1 -1
- package/dist/beeq/p-kY6d9Evy.js +6 -0
- package/dist/beeq/p-kY6d9Evy.js.map +1 -0
- package/dist/beeq/p-uqkxeAeG.js.map +1 -1
- package/dist/beeq/svg/.icons-meta.json +13 -0
- package/dist/beeq.html-custom-data.json +2214 -106
- package/dist/cjs/beeq.cjs.js +3 -3
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +2 -2
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +3 -3
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +3 -3
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +3 -3
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +3 -3
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +3 -3
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +2 -2
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +6 -6
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +3 -3
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +35 -22
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +1743 -366
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +7 -7
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +7 -7
- package/dist/cjs/bq-drawer.cjs.entry.js +7 -7
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +6 -6
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +8 -8
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +17 -10
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +8 -8
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +3 -3
- package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +10 -10
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +5 -5
- package/dist/cjs/bq-page-title.cjs.entry.js +6 -6
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +7 -7
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +8 -12
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +5 -5
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +39 -10
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +2 -2
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +3 -3
- package/dist/cjs/bq-slider.cjs.entry.js +4 -4
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +8 -8
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +4 -4
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +7 -7
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +4 -4
- package/dist/cjs/bq-switch.cjs.entry.js +9 -20
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +5 -5
- package/dist/cjs/bq-tab.cjs.entry.js +6 -6
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +17 -15
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +5 -7
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +6 -6
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{cssVariables-exM7Oz37.js → cssVariables-DuVz7KcV.js} +3 -3
- package/dist/cjs/cssVariables-DuVz7KcV.js.map +1 -0
- package/dist/cjs/event-BhuEFC-I.js.map +1 -1
- package/dist/cjs/{index-BSrsKFVG.js → index-J9jJ-fFQ.js} +47 -12
- package/dist/cjs/index-J9jJ-fFQ.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{props-DzFXZXSF.js → props-BXpv3G-e.js} +6 -5
- package/dist/cjs/props-BXpv3G-e.js.map +1 -0
- package/dist/cjs/slot-DKWrtk4b.js.map +1 -1
- package/dist/cjs/transition-C0S-pYqN.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
- package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
- package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
- package/dist/collection/components/button/scss/bq-button.css +1 -1
- package/dist/collection/components/card/scss/bq-card.css +1 -1
- package/dist/collection/components/checkbox/bq-checkbox.js +35 -21
- package/dist/collection/components/checkbox/bq-checkbox.js.map +1 -1
- package/dist/collection/components/checkbox/scss/bq-checkbox.css +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.js +1141 -457
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/date-picker/bq-date-picker.types.js +29 -0
- package/dist/collection/components/date-picker/bq-date-picker.types.js.map +1 -1
- package/dist/collection/components/date-picker/components/CalendarDayView.js +96 -0
- package/dist/collection/components/date-picker/components/CalendarDayView.js.map +1 -0
- package/dist/collection/components/date-picker/components/CalendarHeader.js +18 -0
- package/dist/collection/components/date-picker/components/CalendarHeader.js.map +1 -0
- package/dist/collection/components/date-picker/components/CalendarMonthView.js +70 -0
- package/dist/collection/components/date-picker/components/CalendarMonthView.js.map +1 -0
- package/dist/collection/components/date-picker/components/CalendarYearView.js +68 -0
- package/dist/collection/components/date-picker/components/CalendarYearView.js.map +1 -0
- package/dist/collection/components/date-picker/helper/bounds.js +114 -0
- package/dist/collection/components/date-picker/helper/bounds.js.map +1 -0
- package/dist/collection/components/date-picker/helper/calendar.js +156 -0
- package/dist/collection/components/date-picker/helper/calendar.js.map +1 -0
- package/dist/collection/components/date-picker/helper/constants.js +62 -16
- package/dist/collection/components/date-picker/helper/constants.js.map +1 -1
- package/dist/collection/components/date-picker/helper/input.js +37 -0
- package/dist/collection/components/date-picker/helper/input.js.map +1 -0
- package/dist/collection/components/date-picker/helper/intl.js +78 -0
- package/dist/collection/components/date-picker/helper/intl.js.map +1 -0
- package/dist/collection/components/date-picker/helper/labels.js +61 -0
- package/dist/collection/components/date-picker/helper/labels.js.map +1 -0
- package/dist/collection/components/date-picker/helper/navigation.js +45 -0
- package/dist/collection/components/date-picker/helper/navigation.js.map +1 -0
- package/dist/collection/components/date-picker/helper/selection.js +167 -0
- package/dist/collection/components/date-picker/helper/selection.js.map +1 -0
- package/dist/collection/components/date-picker/helper/value.js +49 -0
- package/dist/collection/components/date-picker/helper/value.js.map +1 -0
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/bq-dialog.js +4 -4
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/divider/bq-divider.js +4 -4
- package/dist/collection/components/drawer/bq-drawer.js +4 -4
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/dropdown/bq-dropdown.js +1 -1
- package/dist/collection/components/dropdown/scss/bq-dropdown.css +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +5 -5
- package/dist/collection/components/empty-state/scss/bq-empty-state.css +1 -1
- package/dist/collection/components/icon/bq-icon.js +1 -1
- package/dist/collection/components/icon/helper/request.js +1 -1
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/icon/svg/.icons-meta.json +13 -0
- package/dist/collection/components/input/bq-input.js +15 -8
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/input/scss/bq-input.css +1 -1
- package/dist/collection/components/notification/bq-notification.js +5 -5
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/notification/scss/bq-notification.css +1 -1
- package/dist/collection/components/option/bq-option.js +4 -4
- package/dist/collection/components/option-group/bq-option-group.js +1 -1
- package/dist/collection/components/option-group/scss/bq-option-group.css +1 -1
- package/dist/collection/components/option-list/bq-option-list.js +1 -1
- package/dist/collection/components/option-list/scss/bq-option-list.css +1 -1
- package/dist/collection/components/page-title/bq-page-title.js +4 -4
- package/dist/collection/components/page-title/scss/bq-page-title.css +1 -1
- package/dist/collection/components/panel/bq-panel.js +2 -2
- package/dist/collection/components/panel/scss/bq-panel.css +1 -1
- package/dist/collection/components/progress/bq-progress.js +4 -4
- package/dist/collection/components/progress/scss/bq-progress.css +1 -1
- package/dist/collection/components/radio/bq-radio.js +5 -4
- package/dist/collection/components/radio/bq-radio.js.map +1 -1
- package/dist/collection/components/radio/scss/bq-radio.css +1 -1
- package/dist/collection/components/radio-group/bq-radio-group.js +6 -10
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/select/bq-select.js +59 -10
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +2 -2
- package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
- package/dist/collection/components/slider/bq-slider.js +2 -2
- package/dist/collection/components/spinner/bq-spinner.js +4 -4
- package/dist/collection/components/spinner/scss/bq-spinner.css +1 -1
- package/dist/collection/components/status/bq-status.js +1 -1
- package/dist/collection/components/status/scss/bq-status.css +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +4 -4
- package/dist/collection/components/step-item/scss/bq-step-item.css +1 -1
- package/dist/collection/components/steps/bq-steps.js +2 -2
- package/dist/collection/components/switch/bq-switch.js +9 -18
- package/dist/collection/components/switch/bq-switch.js.map +1 -1
- package/dist/collection/components/switch/scss/bq-switch.css +1 -1
- package/dist/collection/components/tab/bq-tab.js +3 -3
- package/dist/collection/components/tab/scss/bq-tab.css +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +3 -3
- package/dist/collection/components/tag/bq-tag.js +4 -4
- package/dist/collection/components/tag/scss/bq-tag.css +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +15 -13
- package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
- package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
- package/dist/collection/components/toast/bq-toast.js +2 -4
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/toast/scss/bq-toast.css +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +4 -4
- package/dist/collection/components/tooltip/scss/bq-tooltip.css +1 -1
- package/dist/collection/shared/test-utils/computedStyle.js +24 -24
- package/dist/collection/shared/test-utils/computedStyle.js.map +1 -1
- package/dist/collection/shared/test-utils/sleep.js +5 -1
- package/dist/collection/shared/test-utils/sleep.js.map +1 -1
- package/dist/collection/shared/utils/cssVariables.js +1 -1
- package/dist/collection/shared/utils/cssVariables.js.map +1 -1
- package/dist/collection/shared/utils/event.js.map +1 -1
- package/dist/collection/shared/utils/props.js +4 -3
- package/dist/collection/shared/utils/props.js.map +1 -1
- package/dist/collection/shared/utils/slot.js.map +1 -1
- package/dist/collection/shared/utils/transition.js.map +1 -1
- package/dist/components/bq-accordion-group.js +1 -1
- package/dist/components/bq-accordion.js +1 -1
- package/dist/components/bq-alert.js +1 -1
- package/dist/components/bq-avatar.js +1 -1
- package/dist/components/bq-badge.js +1 -1
- package/dist/components/bq-breadcrumb-item.js +1 -1
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +1 -1
- package/dist/components/bq-button.js +1 -1
- package/dist/components/bq-card.js +1 -1
- package/dist/components/bq-checkbox.js +1 -1
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +1 -1
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +1 -1
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider.js +1 -1
- package/dist/components/bq-drawer.js +1 -1
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown.js +1 -1
- package/dist/components/bq-empty-state.js +1 -1
- package/dist/components/bq-icon.js +1 -1
- package/dist/components/bq-input.js +1 -1
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +1 -1
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +1 -1
- package/dist/components/bq-option-group.js.map +1 -1
- package/dist/components/bq-option-list.js +1 -1
- package/dist/components/bq-option.js +1 -1
- package/dist/components/bq-page-title.js +1 -1
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel.js +1 -1
- package/dist/components/bq-progress.js +1 -1
- package/dist/components/bq-radio-group.js +1 -1
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +1 -1
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +1 -1
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +1 -1
- package/dist/components/bq-side-menu.js +1 -1
- package/dist/components/bq-slider.js +1 -1
- package/dist/components/bq-spinner.js +1 -1
- package/dist/components/bq-status.js +1 -1
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +1 -1
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +1 -1
- package/dist/components/bq-switch.js +1 -1
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +1 -1
- package/dist/components/bq-tab.js +1 -1
- package/dist/components/bq-tag.js +1 -1
- package/dist/components/bq-textarea.js +1 -1
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +1 -1
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-YjPwN7vu.js → p-2eUC8A3N.js} +2 -2
- package/dist/components/p-2eUC8A3N.js.map +1 -0
- package/dist/components/{p-D3RCJ1ti.js → p-BBCVL6R0.js} +2 -2
- package/dist/components/{p-BY4GkNoQ.js → p-BMHXMsVR.js} +2 -2
- package/dist/components/{p-4ksDMBf6.js → p-BS8hIETL.js} +2 -2
- package/dist/components/{p-DTsYGX5p.js → p-CWawcXxA.js} +2 -2
- package/dist/components/{p-DTsYGX5p.js.map → p-CWawcXxA.js.map} +1 -1
- package/dist/components/{p-fdkSHq2G.js → p-D6ngGq0Y.js} +2 -2
- package/dist/components/p-D6ngGq0Y.js.map +1 -0
- package/dist/components/{p-B99eLANt.js → p-DMKBBBUE.js} +2 -2
- package/dist/components/p-DbxZ8FhA.js +6 -0
- package/dist/components/p-DbxZ8FhA.js.map +1 -0
- package/dist/components/{p-CvvcRGDG.js → p-Dd3v3b2E.js} +2 -2
- package/dist/components/p-DdvbF5yL.js.map +1 -1
- package/dist/components/p-Dx-CEPSQ.js.map +1 -1
- package/dist/components/{p-Dj-mQvqv.js → p-iyX-PhkX.js} +2 -2
- package/dist/components/p-kY6d9Evy.js +6 -0
- package/dist/components/p-kY6d9Evy.js.map +1 -0
- package/dist/components/p-uqkxeAeG.js.map +1 -1
- package/dist/{beeq/p-edc81a31.entry.js → components/p-v3c5-Hhf.js} +2 -2
- package/dist/components/p-v3c5-Hhf.js.map +1 -0
- package/dist/custom-elements.json +25954 -1583
- package/dist/esm/beeq.js +4 -4
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +2 -2
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +3 -3
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +3 -3
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +3 -3
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +3 -3
- package/dist/esm/bq-breadcrumb-item.entry.js +3 -3
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +2 -2
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +6 -6
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +3 -3
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +35 -22
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +1744 -367
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +7 -7
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +7 -7
- package/dist/esm/bq-drawer.entry.js +7 -7
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +6 -6
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +8 -8
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +17 -10
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +8 -8
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +3 -3
- package/dist/esm/bq-option-group.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +10 -10
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +5 -5
- package/dist/esm/bq-page-title.entry.js +6 -6
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +7 -7
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +8 -12
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +5 -5
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +39 -10
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +2 -2
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +3 -3
- package/dist/esm/bq-slider.entry.js +4 -4
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +8 -8
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +4 -4
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +7 -7
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +4 -4
- package/dist/esm/bq-switch.entry.js +9 -20
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +5 -5
- package/dist/esm/bq-tab.entry.js +6 -6
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +17 -15
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +5 -7
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +6 -6
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{cssVariables-CyiWA5Ok.js → cssVariables-DhGXeOL_.js} +3 -3
- package/dist/esm/cssVariables-DhGXeOL_.js.map +1 -0
- package/dist/esm/event-Dx-CEPSQ.js.map +1 -1
- package/dist/esm/{index-CO2T68hs.js → index-BSSRzVAz.js} +47 -12
- package/dist/esm/index-BSSRzVAz.js.map +1 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{props-zh4P02Kn.js → props-DbxZ8FhA.js} +6 -5
- package/dist/esm/props-DbxZ8FhA.js.map +1 -0
- package/dist/esm/slot-uqkxeAeG.js.map +1 -1
- package/dist/esm/transition-DdvbF5yL.js.map +1 -1
- package/dist/hydrate/index.js +2142 -675
- package/dist/hydrate/index.mjs +2142 -675
- package/dist/stencil.config.js +7 -0
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/checkbox/bq-checkbox.d.ts +4 -3
- package/dist/types/components/date-picker/bq-date-picker.d.ts +330 -238
- package/dist/types/components/date-picker/bq-date-picker.types.d.ts +30 -39
- package/dist/types/components/date-picker/components/CalendarDayView.d.ts +42 -0
- package/dist/types/components/date-picker/components/CalendarHeader.d.ts +34 -0
- package/dist/types/components/date-picker/components/CalendarMonthView.d.ts +34 -0
- package/dist/types/components/date-picker/components/CalendarYearView.d.ts +32 -0
- package/dist/types/components/date-picker/helper/bounds.d.ts +49 -0
- package/dist/types/components/date-picker/helper/calendar.d.ts +78 -0
- package/dist/types/components/date-picker/helper/constants.d.ts +62 -16
- package/dist/types/components/date-picker/helper/input.d.ts +23 -0
- package/dist/types/components/date-picker/helper/intl.d.ts +38 -0
- package/dist/types/components/date-picker/helper/labels.d.ts +29 -0
- package/dist/types/components/date-picker/helper/navigation.d.ts +23 -0
- package/dist/types/components/date-picker/helper/selection.d.ts +44 -0
- package/dist/types/components/date-picker/helper/value.d.ts +31 -0
- package/dist/types/components/input/bq-input.d.ts +1 -0
- package/dist/types/components/radio/bq-radio.d.ts +2 -1
- package/dist/types/components/select/bq-select.d.ts +5 -0
- package/dist/types/components/switch/bq-switch.d.ts +2 -3
- package/dist/types/components.d.ts +450 -350
- package/dist/types/home/runner/work/BEEQ/BEEQ/.stencil/packages/beeq/vitest.config.d.ts +2 -0
- package/dist/types/shared/test-utils/computedStyle.d.ts +7 -6
- package/dist/types/shared/test-utils/setProperties.d.ts +1 -1
- package/dist/types/shared/test-utils/sleep.d.ts +5 -1
- package/dist/types/shared/utils/event.d.ts +1 -1
- package/dist/types/shared/utils/slot.d.ts +1 -1
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/vitest.config.js +81 -0
- package/dist/vitest.config.js.map +1 -0
- package/package.json +1 -1
- package/dist/beeq/p-0323869d.entry.js.map +0 -1
- package/dist/beeq/p-1e675bdc.entry.js +0 -6
- package/dist/beeq/p-2283258e.entry.js +0 -6
- package/dist/beeq/p-654c7701.entry.js +0 -6
- package/dist/beeq/p-654c7701.entry.js.map +0 -1
- package/dist/beeq/p-7a6a89f1.entry.js +0 -6
- package/dist/beeq/p-7a6a89f1.entry.js.map +0 -1
- package/dist/beeq/p-7adb6e2e.entry.js.map +0 -1
- package/dist/beeq/p-7d356cce.entry.js.map +0 -1
- package/dist/beeq/p-CO2T68hs.js.map +0 -1
- package/dist/beeq/p-_RvVpeh2.js +0 -6
- package/dist/beeq/p-_RvVpeh2.js.map +0 -1
- package/dist/beeq/p-a83ce5aa.entry.js +0 -6
- package/dist/beeq/p-a83ce5aa.entry.js.map +0 -1
- package/dist/beeq/p-bb46524f.entry.js +0 -6
- package/dist/beeq/p-c25c20bf.entry.js.map +0 -1
- package/dist/beeq/p-e9535627.entry.js.map +0 -1
- package/dist/beeq/p-zh4P02Kn.js +0 -6
- package/dist/beeq/p-zh4P02Kn.js.map +0 -1
- package/dist/cjs/cssVariables-exM7Oz37.js.map +0 -1
- package/dist/cjs/index-BSrsKFVG.js.map +0 -1
- package/dist/cjs/props-DzFXZXSF.js.map +0 -1
- package/dist/collection/components/date-picker/libs/callyLibrary.js +0 -92
- package/dist/collection/components/date-picker/libs/callyLibrary.js.map +0 -1
- package/dist/components/p-DnqmdkvK.js +0 -6
- package/dist/components/p-DnqmdkvK.js.map +0 -1
- package/dist/components/p-YjPwN7vu.js.map +0 -1
- package/dist/components/p-_RvVpeh2.js +0 -6
- package/dist/components/p-_RvVpeh2.js.map +0 -1
- package/dist/components/p-fdkSHq2G.js.map +0 -1
- package/dist/components/p-zh4P02Kn.js +0 -6
- package/dist/components/p-zh4P02Kn.js.map +0 -1
- package/dist/esm/cssVariables-CyiWA5Ok.js.map +0 -1
- package/dist/esm/index-CO2T68hs.js.map +0 -1
- package/dist/esm/props-zh4P02Kn.js.map +0 -1
- package/dist/jest.config.js +0 -23
- package/dist/jest.config.js.map +0 -1
- package/dist/types/Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System/.stencil/packages/beeq/jest.config.d.ts +0 -19
- package/dist/types/components/date-picker/libs/callyLibrary.d.ts +0 -15
- /package/dist/beeq/{p-882966dd.entry.js.map → p-38006c8e.entry.js.map} +0 -0
- /package/dist/beeq/{p-8dfd0329.entry.js.map → p-6b0f896f.entry.js.map} +0 -0
- /package/dist/beeq/{p-ea473f56.entry.js.map → p-72ff2fe2.entry.js.map} +0 -0
- /package/dist/beeq/{p-ad419446.entry.js.map → p-8bd7f4c2.entry.js.map} +0 -0
- /package/dist/beeq/{p-1fb43de2.entry.js.map → p-e9a1b183.entry.js.map} +0 -0
- /package/dist/beeq/{p-3c77308c.entry.js.map → p-f891fb4b.entry.js.map} +0 -0
- /package/dist/components/{p-D3RCJ1ti.js.map → p-BBCVL6R0.js.map} +0 -0
- /package/dist/components/{p-BY4GkNoQ.js.map → p-BMHXMsVR.js.map} +0 -0
- /package/dist/components/{p-4ksDMBf6.js.map → p-BS8hIETL.js.map} +0 -0
- /package/dist/components/{p-B99eLANt.js.map → p-DMKBBBUE.js.map} +0 -0
- /package/dist/components/{p-CvvcRGDG.js.map → p-Dd3v3b2E.js.map} +0 -0
- /package/dist/components/{p-Dj-mQvqv.js.map → p-iyX-PhkX.js.map} +0 -0
- /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/packages/beeq/stencil.config.d.ts +0 -0
- /package/dist/types/{Users/dramos/PROJECTs/ENDAVA/BEEQ-Design-System → home/runner/work/BEEQ/BEEQ}/.stencil/tailwind.config.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["formatterCache","Map","getDateFormatter","locale","options","cacheKey","JSON","stringify","formatter","get","Intl","DateTimeFormat","set","size","firstKey","keys","next","value","delete","formatDisplayValue","type","formatOptions","undefined","dateFormatter","start","end","split","map","dateStr","Date","Number","isNaN","getTime","formatRange","dates","some","d","date","format","join","singleDate","extractFocusedDate","dateRegex","match","exec","clampDateToRange","min","max","ISO_DATE_LOCALE","DATE_PATTERNS","regex","parse","m","months","day","month","toLowerCase","year","_","parseNumericDate","monthNamesCache","getMonthNamesForLocale","cachedMonthNames","monthMap","shortFormatter","longFormatter","first","second","localeStr","usesMMDD","l","startsWith","isDateValid","getDate","getMonth","getFullYear","createValidDate","parseDateInput","inputValue","trim","isoDate","isValidISODate","test","yearStr","monthStr","dayStr","toISODateString","toLocaleDateString","getTodayISO","updateFormValidity","internals","required","inputElem","validationMessage","defaultMessage","states","clear","isDefined","add","setValidity","valueMissing","DATE_PICKER_TYPE","DEFAULT_INPUT_ID","CALENDAR_COMMON_EXPORT_PARTS","CALENDAR_BUTTON_EXPORT_PARTS","CALENDAR_MONTH_EXPORT_PARTS","CALENDAR_CONTAINER_EXPORT_PARTS","CALENDAR_TYPE_MAP","single","multi","range","CALLY_SCRIPT_ATTRIBUTE","CALLY_LIB_VERSION","CALLY_LIB_HASH","isLibraryLoaded","loadingPromise","loadScript","src","attributes","Promise","resolve","reject","script","document","createElement","onload","onerror","error","Error","message","Object","entries","forEach","key","setAttribute","head","appendChild","isCallyLibraryLoaded","querySelector","loadCallyLibrary","crossOrigin","integrity","then","catch","bqDatePickerCss","BqDatePicker","__stencil_proxyCustomElement","HTMLElement","callyElem","isInternalUpdate","labelElem","prefixElem","suffixElem","isCallyLoaded","focusedDate","displayDate","hasLabel","hasPrefix","hasRangeEnd","hasSuffix","hasValue","autofocus","clearButtonLabel","disableClear","disabled","distance","firstDayOfWeek","form","formValidationMessage","isDateDisallowed","monthsPerView","name","open","panelHeight","placeholder","placement","skidding","showOutsideDays","strategy","tentative","validationStatus","handleValueChange","newValue","oldValue","this","setFormValue","isNil","setFocusedDate","checkPropValues","validatePropValue","el","bqBlur","bqChange","bqClear","bqFocus","componentWillLoad","isClient","console","componentDidLoad","handleSlotChange","componentDidRender","formAssociatedCallback","formResetCallback","handleOpenChange","ev","isEventTargetChildOfElement","detail","handleClickOutside","button","emit","handleBlur","handleFocus","nextFocused","handleChange","isHTMLElement","target","clearValue","dateValue","handleCalendarChange","shouldStayOpen","focus","handleCalendarRangeStart","handleCalendarRangeEnd","handleClearClick","stopPropagation","hasSlotContent","generateCalendarMonth","offset","className","h","class","exportparts","generateCalendarMonths","Array","from","length","i","calendarType","render","CallyCalendar","labelId","part","htmlFor","ref","id","onSlotchange","slot","spanElem","autoCapitalize","autoComplete","onBlur","onChange","onFocus","readonly","spellcheck","appearance","border","label","onBqClick","onlyIcon","onRangeend","onRangestart","pageBy","elem","role","color"],"sources":["../../packages/beeq/src/shared/utils/date/dateFormatting.ts","../../packages/beeq/src/shared/utils/date/dateParsing.ts","../../packages/beeq/src/shared/utils/form.ts","../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts","../../packages/beeq/src/components/date-picker/helper/constants.ts","../../packages/beeq/src/components/date-picker/libs/callyLibrary.ts","../../packages/beeq/src/components/date-picker/scss/bq-date-picker.scss?tag=bq-date-picker&encapsulation=shadow","../../packages/beeq/src/components/date-picker/bq-date-picker.tsx"],"sourcesContent":["/** Cache for DateTimeFormat instances */\nconst formatterCache = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Gets or creates a cached DateTimeFormat instance\n * @param locale - The locale for formatting\n * @param options - DateTimeFormat options\n * @returns Cached or new DateTimeFormat instance\n */\nconst getDateFormatter = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat => {\n const cacheKey = `${typeof locale === 'string' ? locale : JSON.stringify(locale)}-${JSON.stringify(options)}`;\n\n let formatter = formatterCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(cacheKey, formatter);\n\n // Limit cache size to prevent memory leaks in long-running apps\n if (formatterCache.size > 50) {\n const firstKey = formatterCache.keys().next().value;\n formatterCache.delete(firstKey);\n }\n }\n\n return formatter;\n};\n\n/**\n * Formats a date value for display based on the picker type and locale.\n *\n * @param value - The ISO date string(s) to format\n * @param type - The picker type (single, multi, range)\n * @param locale - The locale for formatting\n * @param formatOptions - Intl.DateTimeFormat options\n * @returns Formatted display string or undefined\n */\nconst formatDisplayValue = (\n value: string,\n type: 'single' | 'multi' | 'range',\n locale: Intl.LocalesArgument,\n formatOptions: Intl.DateTimeFormatOptions,\n): string | undefined => {\n if (!value) return undefined;\n\n const dateFormatter = getDateFormatter(locale, formatOptions);\n\n if (type === 'range') {\n const [start, end] = value.split('/').map((dateStr) => new Date(`${dateStr}T00:00:00`));\n if (!start || !end || Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) return undefined;\n\n return dateFormatter.formatRange(start, end);\n }\n\n if (type === 'multi') {\n const dates = value.split(' ').map((dateStr) => new Date(`${dateStr}T00:00:00`));\n if (dates.some((d) => Number.isNaN(d.getTime()))) return undefined;\n\n return dates.map((date) => dateFormatter.format(date)).join(', ');\n }\n\n const singleDate = new Date(`${value}T00:00:00`);\n return Number.isNaN(singleDate.getTime()) ? undefined : dateFormatter.format(singleDate);\n};\n\n/**\n * Extracts and returns the first date part from a given string. Handles single, multi, and range picker types.\n * When the type of the date picker is 'range' or 'multi', the first or initial date part of the value\n * should be the focused date in the calendar.\n *\n * @param value - The date value string\n * @returns The first ISO date string or undefined\n */\nconst extractFocusedDate = (value: string): string | undefined => {\n if (!value) return undefined;\n\n const dateRegex = /\\b\\d{4}-\\d{2}-\\d{2}\\b/;\n const match = dateRegex.exec(value);\n return match ? match[0] : undefined;\n};\n\n/**\n * Clamps a date string to a min/max range.\n *\n * @param dateStr - The ISO date string to clamp\n * @param min - Optional minimum date\n * @param max - Optional maximum date\n * @returns The clamped date string\n */\nconst clampDateToRange = (dateStr: string, min?: string, max?: string): string => {\n if (min && dateStr < min) return min;\n if (max && dateStr > max) return max;\n return dateStr;\n};\n\nexport { clampDateToRange, extractFocusedDate, formatDisplayValue };\n","/** Date parsing pattern definition */\ntype TDatePattern = {\n regex: RegExp;\n parse: (\n match: RegExpExecArray,\n monthMap: Record<string, number>,\n locale?: Intl.LocalesArgument,\n ) => { day: number; month: number; year: number };\n};\n\n/** French Canadian locale used for ISO date formatting (YYYY-MM-DD) */\nconst ISO_DATE_LOCALE = 'fr-CA';\n\n/**\n * Static date parsing patterns\n */\nconst DATE_PATTERNS: TDatePattern[] = [\n {\n // Matches \"30 May 2024\" or \"30 January 2024\"\n regex: /^(\\d{1,2})\\s+([a-z]+)\\s+(\\d{4})$/i,\n parse: (m, months) => ({\n day: +m[1],\n month: months[m[2].toLowerCase()],\n year: +m[3],\n }),\n },\n {\n // Matches \"05/30/2024\", \"30-05-2024\", \"30.05.2024\", \"05.30.2024\" (with heuristic for day/month)\n regex: /^(\\d{1,2})[\\s\\-/.](\\d{1,2})[\\s\\-/.](\\d{4})$/,\n parse: (m, _, locale) => {\n const { day, month } = parseNumericDate(+m[1], +m[2], locale);\n return { day, month, year: +m[3] };\n },\n },\n {\n // Matches \"May 30, 2024\" or \"January 1, 1970\" (with optional comma)\n regex: /^([a-z]+)\\s+(\\d{1,2}),?\\s+(\\d{4})$/i,\n parse: (m, months) => ({\n month: months[m[1].toLowerCase()],\n day: +m[2],\n year: +m[3],\n }),\n },\n {\n // Matches \"2024-05-30\" (ISO format without parsing as Date first)\n regex: /^(\\d{4})-(\\d{2})-(\\d{2})$/,\n parse: (m) => ({\n year: +m[1],\n month: +m[2] - 1,\n day: +m[3],\n }),\n },\n];\n\nconst monthNamesCache = new Map<string, Record<string, number>>();\n\n/**\n * Gets localized month names for the given locale (both short and long forms)\n * Caches results for performance\n * @param {Intl.LocalesArgument} locale - The locale identifier, e.g., 'en-GB', 'fr-FR', etc.\n * @returns {Record<string, number>} Mapping of month names to month indices\n */\nconst getMonthNamesForLocale = (locale: Intl.LocalesArgument): Record<string, number> => {\n const cacheKey = typeof locale === 'string' ? locale : JSON.stringify(locale);\n\n const cachedMonthNames = monthNamesCache.get(cacheKey);\n if (cachedMonthNames) return cachedMonthNames;\n\n const monthMap: Record<string, number> = {};\n const shortFormatter = new Intl.DateTimeFormat(locale, { month: 'short' });\n const longFormatter = new Intl.DateTimeFormat(locale, { month: 'long' });\n\n for (let month = 0; month < 12; month++) {\n const date = new Date(2024, month, 1);\n monthMap[shortFormatter.format(date).toLowerCase()] = month;\n monthMap[longFormatter.format(date).toLowerCase()] = month;\n }\n\n monthNamesCache.set(cacheKey, monthMap);\n return monthMap;\n};\n\n/**\n * Parses day-month-year or month-day-year numeric date format\n * Uses heuristic: if any number > 12, treat it as day, otherwise defaults to locale preference\n * @param {number} first - The first numeric part (day or month)\n * @param {number} second - The second numeric part (month or day)\n * @param {Intl.LocalesArgument} locale - The locale for determining format preference\n * @returns {{day: number, month: number}} Object with day and month (0-based)\n */\nconst parseNumericDate = (\n first: number,\n second: number,\n locale: Intl.LocalesArgument = 'en-GB',\n): { day: number; month: number } => {\n // If first number > 12, it must be the day (DD/MM format)\n if (first > 12) return { day: first, month: second - 1 };\n\n // If second number > 12, it must be the day (MM/DD format)\n if (second > 12) return { day: second, month: first - 1 };\n\n // Both numbers <= 12: ambiguous case\n // Use locale to determine format preference\n const localeStr = typeof locale === 'string' ? locale : locale?.[0] || 'en-GB';\n const usesMMDD = ['en-US', 'en-CA'].some((l) => localeStr.startsWith(l));\n\n if (usesMMDD) {\n // US/Canada format: MM/DD\n return { day: second, month: first - 1 };\n }\n\n // Default to DD/MM (European/most of world format)\n return { day: first, month: second - 1 };\n};\n\n/**\n * Validates that a date is actually valid (not auto-corrected by Date constructor)\n * @param {number} day - Day of the month\n * @param {number} month - Month (0-based)\n * @param {number} year - Full year\n * @returns {boolean} True if the date is valid\n */\nconst isDateValid = (day: number, month: number, year: number): boolean => {\n const date = new Date(year, month, day);\n return date.getDate() === day && date.getMonth() === month && date.getFullYear() === year;\n};\n\n/**\n * Validates and creates a Date object from day, month, and year\n * @param {number} day - Day of the month\n * @param {number} month - Month (0-based)\n * @param {number} year - Full year\n * @returns {Date | null} Valid Date object or null if invalid\n */\nconst createValidDate = (day: number, month: number, year: number): Date | null => {\n if (month === undefined || !day || !year) return null;\n if (!isDateValid(day, month, year)) return null;\n\n return new Date(year, month, day);\n};\n\n/**\n * Parses various date input formats and returns a Date object\n * Supports:\n * - ISO format: \"2024-05-30\"\n * - Text format: \"30 May 2024\", \"May 30, 2024\", \"30 January 2024\", \"January 1, 1970\" (locale-aware)\n * - Numeric formats: \"30/05/2024\", \"05-30-2024\", \"30.05.2024\", \"05.30.2024\" (with heuristic for day/month)\n *\n * @param {string} inputValue - The date string to parse\n * @param {Intl.LocalesArgument} locale - The locale for month name recognition (defaults to 'en-GB')\n * @returns {Date | null} Parsed Date object or null if parsing fails\n */\nconst parseDateInput = (inputValue: string, locale: Intl.LocalesArgument = 'en-GB'): Date | null => {\n if (!inputValue?.trim()) return null;\n\n // Try ISO format first\n const isoDate = new Date(`${inputValue}T00:00:00`);\n if (!Number.isNaN(isoDate.getTime()) && isValidISODate(inputValue)) return isoDate;\n\n const monthMap = getMonthNamesForLocale(locale);\n\n for (const { regex, parse } of DATE_PATTERNS) {\n const match = regex.exec(inputValue);\n if (!match) continue;\n\n const { day, month, year } = parse(match, monthMap, locale);\n const date = createValidDate(day, month, year);\n if (date) return date;\n }\n\n return null;\n};\n\n/**\n * Validates if a string is in ISO date format (YYYY-MM-DD) with actual valid date values\n * @param {string} dateStr - The date string to validate\n * @returns {boolean} True if the date string is valid in ISO format and represents an actual valid date\n */\nconst isValidISODate = (dateStr: string): boolean => {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(dateStr)) return false;\n\n const [yearStr, monthStr, dayStr] = dateStr.split('-');\n const year = +yearStr;\n const month = +monthStr - 1;\n const day = +dayStr;\n\n return isDateValid(day, month, year);\n};\n\n/**\n * Converts a Date object to ISO format string (YYYY-MM-DD).\n * @param date - The date to convert\n * @returns ISO formatted date string\n */\nconst toISODateString = (date: Date): string => {\n return date.toLocaleDateString(ISO_DATE_LOCALE);\n};\n\n/**\n * Gets today's date in ISO format.\n * @returns Today's date as YYYY-MM-DD string\n */\nconst getTodayISO = (): string => {\n return new Date().toLocaleDateString(ISO_DATE_LOCALE);\n};\n\nexport { getTodayISO, ISO_DATE_LOCALE, isValidISODate, parseDateInput, toISODateString };\n","import { isDefined } from './isDefined';\n\ntype FormValidityOptions = {\n /** The ElementInternals instance */\n internals?: ElementInternals;\n /** Whether the field is required */\n required?: boolean;\n /** Current field value */\n value?: string | string[] | number;\n /** Reference to the input element */\n inputElem?: HTMLInputElement | HTMLTextAreaElement;\n /** Custom validation message */\n validationMessage?: string;\n /** Default validation message */\n defaultMessage?: string;\n};\n\n/**\n * Updates form validity state for form-associated custom elements.\n * Handles the required field validation and sets appropriate validity states.\n *\n * @param {FormValidityOptions} options - Validation options\n * @param options.internals - The ElementInternals instance\n * @param {boolean} options.required - Whether the field is required\n * @param {string | string[] | number} options.value - The current field value\n * @param {HTMLInputElement | HTMLTextAreaElement} options.inputElem - The input element\n * @param {string} options.validationMessage - The custom validation message\n * @param {string} options.defaultMessage - The default validation message\n */\nconst updateFormValidity = ({\n internals,\n required,\n value,\n inputElem,\n validationMessage,\n defaultMessage = 'Please fill out this field',\n}: FormValidityOptions): void => {\n if (!internals) return;\n\n // Clear the validity state\n internals.states.clear();\n\n // Check if value is required but missing\n if (required && !isDefined(value)) {\n // Set validity state to invalid\n internals.states.add('invalid');\n internals.setValidity({ valueMissing: true }, validationMessage ?? defaultMessage, inputElem);\n return;\n }\n\n // Set validity state to valid if the input has value or is not required\n internals.states.add('valid');\n internals.setValidity({});\n};\n\nexport { type FormValidityOptions, updateFormValidity };\n","/** The first day of the week, where Sunday is 0, Monday is 1, etc. */\nexport type DaysOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The type of the date picker */\nexport const DATE_PICKER_TYPE = ['single', 'multi', 'range'] as const;\n/** The type of the date picker */\nexport type TDatePickerType = (typeof DATE_PICKER_TYPE)[number];\n\nexport type TCalendarDate = {\n /** The first day of the week */\n firstDayOfWeek?: number;\n /** The focused date */\n focusedDate: string;\n /** The locale */\n locale?: string;\n /** The maximum date */\n max?: string;\n /** The minimum date */\n min?: string;\n /** The number of months to show */\n months?: number;\n /** How to navigate through the calendar, by single month or by the number of months */\n pageBy?: 'single' | 'months';\n /** Whether to show days outside the current month */\n showOutsideDays?: boolean;\n /** The tentative selected date, e.g. the start of a date range */\n tentative?: string;\n /** The selected date, in ISO-8601 format (YYYY-MM-DD) */\n value: string;\n /**\n * Focuses the <calendar-month> containing the currently focused date.\n * `option.target` controls which part of the component gets focused.\n */\n focus: ({ target }: { target: 'previous' | 'next' | 'day' }) => void;\n /** Checks if the date is not allowed to be selected */\n isDateDisallowed?: (date: Date) => boolean;\n /** Handles the change event, when the user selects a date or a date range */\n onChange?: (ev: Event) => void;\n /** Handles the focus date event. E.g. when the user navigates back/forward in the calendar */\n onFocusDate?: (ev: CustomEvent) => void;\n /** Handles the date range start event. E.g. when the user starts selecting a date range */\n onRangestart?: (ev: CustomEvent) => void;\n /** Handles the date range end event. E.g. when the user finishes selecting a date range */\n onRangeend?: (ev: CustomEvent) => void;\n};\n","import { ISO_DATE_LOCALE } from '../../../shared/utils/date';\n\n/** Default fallback input ID */\nconst DEFAULT_INPUT_ID = 'date-picker';\n\n/** Calendar month shadow DOM parts for common elements */\nconst CALENDAR_COMMON_EXPORT_PARTS =\n 'calendar__heading,calendar__table,calendar__tr,calendar__head,calendar__week,calendar__th,calendar__td';\n\n/** Calendar month shadow DOM parts for button elements */\nconst CALENDAR_BUTTON_EXPORT_PARTS =\n 'calendar__button,calendar__day,calendar__selected,calendar__today,calendar__disallowed,calendar__outside,calendar__range-start,calendar__range-end,calendar__range-inner';\n\n/** Combined export parts for calendar-month component */\nconst CALENDAR_MONTH_EXPORT_PARTS = `${CALENDAR_COMMON_EXPORT_PARTS},${CALENDAR_BUTTON_EXPORT_PARTS}`;\n\n/** Export parts for the calendar container component (calendar-date, calendar-range, calendar-multi) */\nconst CALENDAR_CONTAINER_EXPORT_PARTS =\n 'container:calendar__container,header:calendar__header,button:calendar__button,previous:calendar__previous,next:calendar__next,disabled:calendar__disabled,heading:calendar__heading';\n\n/** Maps picker type to Cally component tag name */\nconst CALENDAR_TYPE_MAP = {\n single: 'calendar-date',\n multi: 'calendar-multi',\n range: 'calendar-range',\n} as const;\n\nexport {\n CALENDAR_BUTTON_EXPORT_PARTS,\n CALENDAR_COMMON_EXPORT_PARTS,\n CALENDAR_CONTAINER_EXPORT_PARTS,\n CALENDAR_MONTH_EXPORT_PARTS,\n CALENDAR_TYPE_MAP,\n DEFAULT_INPUT_ID,\n ISO_DATE_LOCALE,\n};\n","/* -------------------------------------------------------------------------- */\n/* Cally Library loader helper */\n/* -------------------------------------------------------------------------- */\n\nconst CALLY_SCRIPT_ATTRIBUTE = 'data-cally-library';\n//❗ Make sure to update the version here when the library releases a new version\nconst CALLY_LIB_VERSION = '0.9.0';\n/**\n * ❗ Make sure to update the hash here if the `CALLY_LIB_VERSION` is updated\n * This hash is used to ensure the integrity of the library when loading it\n * from a CDN.\n * @see https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Subresource_Integrity#tools_for_generating_sri_hashes\n */\nconst CALLY_LIB_HASH = 'sha384-pM/XA9cWLgX65JRL+wCO7uw2DIwVqcK1WlITykq2OZYbP5vuMspYj0K29Ka6UyFU';\n\nlet isLibraryLoaded = false;\nlet loadingPromise: Promise<void> | null = null;\n\ntype ScriptConfig = {\n type: string;\n src: string;\n attributes?: Record<string, string>;\n};\n\n/**\n * Helper function to load a script with given configuration\n * @param {Object} config - Script configuration\n * @param {string} config.type - The type of the script\n * @param {string} config.src - The source URL of the script\n * @param {Record<string, string>} [config.attributes] - Additional attributes to set on the script element\n * @returns Promise that resolves when the script is loaded\n * @throws {Error} If the script fails to load\n */\nconst loadScript = ({ type, src, attributes = {} }: ScriptConfig): Promise<void> => {\n return new Promise<void>((resolve, reject) => {\n const script = document.createElement('script');\n script.type = type;\n script.src = src;\n\n script.onload = () => resolve();\n script.onerror = (error: Event) =>\n reject(new Error(`Failed to load script: ${src}, ${error instanceof Error ? error.message : 'Unknown error'}`));\n\n Object.entries(attributes).forEach(([key, value]) => {\n script.setAttribute(key, value);\n });\n\n document.head.appendChild(script);\n });\n};\n\n/**\n * Checks if the Cally library is already loaded in the document\n * @returns {boolean} True if the library is loaded\n */\nconst isCallyLibraryLoaded = (): boolean => {\n // This might be a bit redundant, but it's a sanity check to ensure the library is actually loaded\n return isLibraryLoaded || document.querySelector(`script[${CALLY_SCRIPT_ATTRIBUTE}]`) !== null;\n};\n\n/**\n * Loads the Cally library for the date picker component.\n * Uses a singleton promise pattern to prevent race conditions when multiple\n * date picker components attempt to load the library simultaneously.\n *\n * @throws {Error} If the library fails to load\n * @return {Promise<void>}\n */\nconst loadCallyLibrary = (): Promise<void> => {\n // Already loaded, return immediately\n if (isLibraryLoaded) return Promise.resolve();\n\n // If a load is already in progress, wait for it to complete\n if (loadingPromise !== null) return loadingPromise;\n\n // Check if script already exists in DOM (e.g., from a previous session or external source)\n if (document.querySelector(`script[${CALLY_SCRIPT_ATTRIBUTE}]`) !== null) {\n isLibraryLoaded = true;\n return Promise.resolve();\n }\n\n // Start loading and store the promise so concurrent calls can await it\n loadingPromise = loadScript({\n type: 'module',\n src: `https://unpkg.com/cally@${CALLY_LIB_VERSION}/dist/cally.js`,\n attributes: {\n [CALLY_SCRIPT_ATTRIBUTE]: '',\n crossOrigin: 'anonymous',\n integrity: CALLY_LIB_HASH,\n },\n })\n .then(() => {\n isLibraryLoaded = true;\n })\n .catch((error) => {\n // Reset the promise so future attempts can retry\n loadingPromise = null;\n isLibraryLoaded = false;\n throw new Error(`Failed to load the cally library: ${error instanceof Error ? error.message : 'Unknown error'}`);\n });\n\n return loadingPromise;\n};\n\nexport { isCallyLibraryLoaded, loadCallyLibrary };\n","/* -------------------------------------------------------------------------- */\n/* Date picker styles */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-date-picker.variables';\n\n:host {\n @apply block is-full;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__label {\n @apply flex flex-grow items-center gap-[--bq-date-picker--gap] m-be-[--bq-date-picker--label-margin-bottom];\n @apply text-[length:--bq-date-picker--label-text-size] text-[color:--bq-date-picker--label-text-color];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Date picker input group control */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__control {\n @apply flex items-center transition-[border-color,box-shadow] is-full;\n // Border\n @apply rounded-[--bq-date-picker--border-radius] border-[length:--bq-date-picker--border-width] border-[color:--bq-date-picker--border-color];\n // Padding\n @apply pe-[--bq-date-picker--padding-end] ps-[--bq-date-picker--padding-start] p-b-[--bq-date-picker--paddingY];\n // Text\n @apply select-none text-[length:--bq-date-picker--text-size] text-[color:--bq-date-picker--text-color] placeholder:text-[color:--bq-date-picker--text-placeholder-color];\n // Hover\n @apply [&:not(.disabled):not(:focus-within)]:hover:border-hover-brand;\n\n border-style: var(--bq-date-picker--border-style);\n\n // Focus\n &:not(.disabled):focus-within {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n\n @apply focus border-[color:--bq-focus];\n }\n\n // Enable clear button whenever the input group control is hovered or has focus\n &:not(.disabled):hover,\n &:not(.disabled):focus-within {\n .bq-date-picker__control--clear {\n @apply inline-block;\n }\n }\n}\n\n.bq-date-picker__control.disabled {\n @apply cursor-not-allowed opacity-60;\n}\n\n/* ------------------------------- Validation ------------------------------- */\n\n.bq-date-picker__control.validation-error {\n @apply border-danger [&:not(.disabled):not(:focus-within)]:hover:border-hover-danger;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.danger);\n\n @apply border-active-danger;\n }\n}\n\n.bq-date-picker__control.validation-success {\n @apply border-success [&:not(.disabled):not(:focus-within)]:hover:border-hover-success;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.success);\n\n @apply border-active-success;\n }\n}\n\n.bq-date-picker__control.validation-warning {\n @apply border-warning [&:not(.disabled):not(:focus-within)]:hover:border-hover-warning;\n\n &:not(.disabled):focus-within {\n --bq-ring-color-focus: theme(stroke.warning);\n\n @apply border-active-warning;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Native HTML Input */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__control--input {\n @apply flex-auto cursor-inherit select-none appearance-none bg-inherit font-inherit text-[length:inherit] text-inherit;\n @apply border-none min-is-0 p-b-0 p-i-0 m-b-0 m-i-0 focus:outline-none focus-visible:outline-none;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Clear button */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__control--clear::part(button) {\n // Since the clear button is inside the input group control,\n // we need to reset the focus ring styles\n --bq-ring-width: initial;\n --bq-ring-offset-width: initial;\n --bq-ring-color-focus: initial;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Prefix and suffix */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__control--prefix,\n.bq-date-picker__control--suffix {\n @apply pointer-events-none flex items-center text-[color:--bq-date-picker--text-color];\n}\n\n.bq-date-picker__control--prefix {\n @apply me-[--bq-date-picker--gap];\n}\n\n.bq-date-picker__control--suffix {\n @apply ms-[--bq-date-picker--gap];\n}\n\n/* -------------------------------------------------------------------------- */\n/* Customize Cally date picker */\n/* -------------------------------------------------------------------------- */\n\ncalendar-date,\ncalendar-range,\ncalendar-multi {\n &::part(header) {\n @apply justify-center gap-s;\n }\n\n &::part(heading) {\n @apply p-b-xs2 p-i-xs;\n }\n\n &::part(button) {\n @apply rounded-s border-0 bg-transparent transition-colors duration-200 p-b-xs2 p-i-xs2;\n @apply focus-visible:focus hover:bg-hover-ui-primary;\n }\n\n &::part(container) {\n @apply bg-[--bq-date-picker--background-color] p-b-0 p-i-0;\n }\n}\n\ncalendar-month {\n /* stylelint-disable-next-line custom-property-pattern */\n --color-accent: var(--bq-ui--brand);\n\n &::part(button) {\n @apply flex items-center justify-center rounded-s bg-transparent font-default text-primary transition-colors duration-200 ease-in-out p-b-0 p-i-0;\n @apply size-[--bq-date-picker--day-size] focus-visible:focus enabled:hover:bg-hover-secondary disabled:cursor-not-allowed;\n }\n\n &::part(button day disallowed) {\n @apply cursor-not-allowed bg-transparent #{!important};\n }\n\n &::part(button day selected) {\n @apply rounded-s bg-[--bq-date-picker--range-background-color] text-alt enabled:hover:bg-hover-ui-brand;\n }\n\n &::part(button day selected range-inner) {\n @apply rounded-none bg-[--bq-date-picker--range-inner-background-color] text-primary hover:text-alt;\n }\n\n &::part(button day outside) {\n @apply cursor-pointer text-secondary opacity-100;\n }\n\n &::part(today) {\n @apply rounded-s border-[length:--bq-date-picker--currentDate-border-width] border-[color:--bq-date-picker--currentDate-border-color];\n\n border-style: var(--bq-date-picker--border-style);\n }\n\n &::part(today selected) {\n @apply text-alt;\n }\n\n &::part(today selected range-inner) {\n /* Ensure 'today selected range-inner' keeps the intended color */\n @apply text-primary;\n }\n\n &::part(today range-inner) {\n @apply rounded-none;\n }\n\n &::part(today range-start) {\n @apply rounded-s rounded-es-none;\n }\n\n &::part(today range-end) {\n @apply rounded-s rounded-ee-none;\n }\n\n &::part(range-start) {\n @apply rounded-ee-none rounded-se-none;\n }\n\n &::part(range-end) {\n @apply rounded-es-none rounded-ss-none;\n }\n\n &::part(range-start range-end) {\n @apply rounded-s;\n }\n\n &::part(table) {\n @apply border-spacing-0 text-[length:_inherit];\n }\n}\n","import type { EventEmitter } from '@stencil/core';\nimport { AttachInternals, Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { JSX } from '@stencil/core/internal';\n\nimport type { Placement } from '../../services/interfaces';\nimport {\n clampDateToRange,\n extractFocusedDate,\n formatDisplayValue,\n getTodayISO,\n hasSlotContent,\n isClient,\n isDefined,\n isEventTargetChildOfElement,\n isHTMLElement,\n isNil,\n parseDateInput,\n toISODateString,\n updateFormValidity,\n validatePropValue,\n} from '../../shared/utils';\nimport type { TInputValidation } from '../input/bq-input.types';\nimport type { DaysOfWeek, TCalendarDate, TDatePickerType } from './bq-date-picker.types';\nimport { DATE_PICKER_TYPE } from './bq-date-picker.types';\nimport {\n CALENDAR_CONTAINER_EXPORT_PARTS,\n CALENDAR_MONTH_EXPORT_PARTS,\n CALENDAR_TYPE_MAP,\n DEFAULT_INPUT_ID,\n} from './helper/constants';\nimport { isCallyLibraryLoaded, loadCallyLibrary } from './libs/callyLibrary';\n\n/**\n * The Date Picker is a intuitive UI element component allows users to select dates from a visual calendar interface, providing an intuitive way to input date information.\n *\n * @example How to use it\n * ```html\n * <bq-date-picker\n * first-day-of-week=\"1\"\n * locale=\"en-GB\"\n * months-per-view=\"single\"\n * months=\"2\"\n * name=\"bq-date-picker\"\n * placeholder=\"Enter your date\"\n * placement=\"bottom-end\"\n * show-outside-days=\"false\"\n * type=\"range\"\n * validation-status=\"none\"\n * value=\"2024-05-25\"\n * >\n * <label class=\"flex flex-grow items-center\" slot=\"label\">\n * Date picker label\n * </label>\n * </bq-date-picker>\n * ```\n *\n * @documentation https://www.beeq.design/3d466e231/p/5793a9-date-picker\n * @status stable\n *\n * @dependency bq-button\n * @dependency bq-dropdown\n * @dependency bq-icon\n *\n * @attr {boolean} autofocus - If `true`, the Date picker input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {boolean} disable-clear - If `true`, the clear button won't be displayed.\n * @attr {boolean} disabled - Indicates whether the Date picker input is disabled or not.\n * @attr {number} distance - Represents the distance (gutter or margin) between the Date picker panel and the input element.\n * @attr {0 | 1 | 2 | 3 | 4 | 5 | 6} first-day-of-week - The first day of the week, where Sunday is 0, Monday is 1, etc.\n * @attr {Intl.DateTimeFormatOptions} format-options - The options to use when formatting the displayed value. Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options\n * @attr {string} form - The ID of the form that the Date picker input belongs to.\n * @attr {string} form-validation-message - The native form validation message (mandatory if `required` is set).\n * @attr {function} is-date-disallowed - A function that takes a date and returns true if the date should not be selectable.\n * @attr {Intl.LocalesArgument} locale - The locale for formatting dates. If not set, will use the browser's locale. Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\n * @attr {string} max - The latest date that can be selected.\n * @attr {string} min - The earliest date that can be selected.\n * @attr {number} months - Number of months to show when range is `true`.\n * @attr {string} name - The Date picker input name.\n * @attr {boolean} open - If `true`, the Date picker panel will be visible.\n * @attr {string} panel-height - When set, it will override the height of the Date picker panel.\n * @attr {\"top\" | \"right\" | \"bottom\" | \"left\" | \"top-start\" | \"top-end\" | \"right-start\" | \"right-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\"} placement - Position of the Date picker panel.\n * @attr {boolean} required - Indicates whether or not the Date picker input is required to be filled out before submitting the form.\n * @attr {number} skidding - Represents the skidding between the Date picker panel and the input element.\n * @attr {boolean} show-outside-days - Whether to show days outside the month.\n * @attr {string} strategy - Defines the strategy to position the Date picker panel.\n * @attr {string} tentative - The date that is tentatively selected, e.g. the start of a range selection.\n * @attr {\"single\" | \"multi\" | \"range\"} type - It defines how the calendar will behave, allowing single date selection, range selection, or multiple date selection.\n * @attr {\"error\" | \"none\" | \"success\" | \"warning\"} validation-status - The validation status of the Select input.\n * @attr {string} value - The select input value represents the currently selected date or range and can be used to reset the field to a previous value.\n *\n * @method clear - Clears the selected value.\n *\n * @event bqBlur - Callback handler emitted when the input loses focus.\n * @event bqChange - Callback handler emitted when the input value has changed and the input loses focus.\n * @event bqClear - Callback handler emitted when the input value has been cleared.\n * @event bqFocus - Callback handler emitted when the input has received focus.\n *\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part calendar__button - Any button used in the calendar-month component.\n * @part calendar__button - Any button within the calendar-range component.\n * @part calendar__container - The calendar-range container for the entire component.\n * @part calendar__day - The buttons corresponding to each day in the calendar-month grid.\n * @part calendar__disabled - A button that is disabled due to min/max on the calendar-range component.\n * @part calendar__disallowed - Any day that has been disallowed via isDateDisallowed.\n * @part calendar__head - The calendar-month table's header row.\n * @part calendar__header - The calendar-range container for the heading and buttons.\n * @part calendar__heading - The calendar-month heading container that labels the month.\n * @part calendar__heading - The calendar-range heading containing the month and year.\n * @part calendar__next - The next page button on the calendar-range component.\n * @part calendar__outside - Any days which are outside the current month.\n * @part calendar__previous - The previous page button on the calendar-range component.\n * @part calendar__range-end - The day at the end of a date range.\n * @part calendar__range-inner - Any days between the start and end of a date range.\n * @part calendar__range-start - The day at the start of a date range.\n * @part calendar__selected - Any days which are selected.\n * @part calendar__table - The calendar-month <table> element.\n * @part calendar__td - The calendar-month table's body cells.\n * @part calendar__th - The calendar-month table's header cells.\n * @part calendar__today - The Today's day.\n * @part calendar__tr - Any row within the table on the calendar-month component.\n * @part calendar__week - The calendar-month table's body rows.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part input - The native HTML input element used under the hood.\n * @part label - The label slot container.\n * @part panel - The date picker panel container\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n *\n * @cssprop --bq-date-picker--background-color - Date picker background color.\n * @cssprop --bq-date-picker--border-color - Date picker border color.\n * @cssprop --bq-date-picker--border-color-disabled - Date picker border color when disabled.\n * @cssprop --bq-date-picker--border-color-focus - Date picker border color on focus.\n * @cssprop --bq-date-picker--border-radius - Date picker border radius.\n * @cssprop --bq-date-picker--border-style - Date picker border style.\n * @cssprop --bq-date-picker--border-width - Date picker border width.\n * @cssprop --bq-date-picker--currentDate-border-color - Date picker border color for current date.\n * @cssprop --bq-date-picker--currentDate-border-width - Date picker border width for current date.\n * @cssprop --bq-date-picker--day-size - Date picker button day size.\n * @cssprop --bq-date-picker--gap - Gap between Date picker content and prefix/suffix.\n * @cssprop --bq-date-picker--icon-size - Icon size to use in prefix/suffix and clear button.\n * @cssprop --bq-date-picker--label-margin-bottom - Date picker label margin bottom.\n * @cssprop --bq-date-picker--label-text-color - Date picker label text color.\n * @cssprop --bq-date-picker--label-text-size - Date picker label text size.\n * @cssprop --bq-date-picker--padding-end - Date picker padding end.\n * @cssprop --bq-date-picker--padding-start - Date picker padding start.\n * @cssprop --bq-date-picker--paddingY - Date picker padding top and bottom.\n * @cssprop --bq-date-picker--range-background-color - Background color for the selected date range in the date picker.\n * @cssprop --bq-date-picker--range-inner-background-color - Background color for the selected dates inside the date range in the date picker.\n * @cssprop --bq-date-picker--text-color - Date picker text color.\n * @cssprop --bq-date-picker--text-placeholder-color - Date picker placeholder text color.\n * @cssprop --bq-date-picker--text-size - Date picker text size.\n */\n@Component({\n tag: 'bq-date-picker',\n styleUrl: './scss/bq-date-picker.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqDatePicker {\n // Own Properties\n // ====================\n\n private callyElem?: TCalendarDate;\n private inputElem?: HTMLInputElement;\n private isInternalUpdate = false;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n // Reference to host HTML element\n // ===================================\n\n @AttachInternals() internals: ElementInternals;\n @Element() el!: HTMLBqDatePickerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() isCallyLoaded = false;\n @State() focusedDate: string;\n @State() displayDate: string;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasRangeEnd = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /** If `true`, the Date picker input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /** If `true`, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /**\n * Indicates whether the Date picker input is disabled or not.\n * If `true`, the Date picker is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the Date picker panel and the input element. */\n @Prop({ reflect: true }) distance?: number = 8;\n\n /** The first day of the week, where Sunday is 0, Monday is 1, etc */\n @Prop({ reflect: true }) firstDayOfWeek?: DaysOfWeek = 1;\n\n /** The options to use when formatting the displayed value.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options\n */\n @Prop() formatOptions: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n };\n\n /** The ID of the form that the Date picker input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** The native form validation message (mandatory if `required` is set) */\n @Prop({ mutable: true }) formValidationMessage?: string;\n\n /** A function that takes a date and returns true if the date should not be selectable */\n @Prop({ reflect: true }) isDateDisallowed?: (date: Date) => boolean;\n\n /** The locale for formatting dates. If not set, will use the browser's locale.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\n */\n @Prop({ reflect: true }) locale: Intl.LocalesArgument = 'en-GB';\n\n /** The latest date that can be selected */\n @Prop({ reflect: true }) max?: string;\n\n /** The earliest date that can be selected */\n @Prop({ reflect: true }) min?: string;\n\n /** Number of months to show when range is `true` */\n @Prop({ reflect: true }) months: number;\n\n /**\n * Specifies how the next/previous buttons should navigate the calendar.\n * - single: The buttons will navigate by a single month at a time.\n * - months: The buttons will navigate by the number of months displayed per view.\n */\n @Prop({ reflect: true }) monthsPerView: 'single' | 'months' = 'single';\n\n /** The Date picker input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, the Date picker panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the Date picker panel. */\n @Prop({ reflect: true, mutable: true }) panelHeight?: string = 'auto';\n\n /** The Date picker input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Date picker panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-end';\n\n /** Indicates whether or not the Date picker input is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /** Represents the skidding between the Date picker panel and the input element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Whether to show days outside the month */\n @Prop({ reflect: true }) showOutsideDays: boolean = false;\n\n /** Defines the strategy to position the Date picker panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n /** The date that is tentatively selected e.g. the start of a range selection */\n @Prop({ reflect: true, mutable: true }) tentative?: string;\n\n /** It defines how the calendar will behave, allowing single date selection, range selection, or multiple date selection */\n @Prop({ reflect: true }) type: TDatePickerType = 'single';\n\n /**\n * The validation status of the Select input.\n *\n * @remarks\n * This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The select input value represents the currently selected date or range and can be used to reset the field to a previous value.\n * All dates are expected in ISO-8601 format (YYYY-MM-DD). */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange(newValue: string, oldValue: string) {\n if (newValue === oldValue) return;\n\n const { formatOptions, internals, isCallyLoaded, locale, type } = this;\n if (!isCallyLoaded) return;\n\n internals.setFormValue(!isNil(newValue) ? `${newValue}` : undefined);\n this.updateFormValidity();\n\n this.hasValue = isDefined(newValue);\n this.displayDate = formatDisplayValue(newValue, type, locale, formatOptions);\n\n this.setFocusedDate();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqDatePickerElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqDatePickerElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqDatePickerElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqDatePickerElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n async componentWillLoad() {\n if (!isClient() || this.isCallyLoaded) return;\n\n try {\n await loadCallyLibrary();\n this.isCallyLoaded = isCallyLibraryLoaded();\n } catch (error) {\n console.error(error);\n }\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n this.handleValueChange(this.value, undefined);\n }\n\n componentDidRender() {\n if (this.isInternalUpdate) {\n this.isInternalUpdate = false;\n }\n }\n\n formAssociatedCallback() {\n this.updateFormValidity();\n }\n\n formResetCallback() {\n if (isNil(this.value)) return;\n\n this.clear();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!isEventTargetChildOfElement(ev, this.el)) return;\n\n const { open } = ev.detail;\n if (this.open === open) return;\n\n this.open = open;\n }\n\n @Listen('click', { target: 'body', capture: true })\n handleClickOutside(ev: MouseEvent) {\n const { open, type, hasRangeEnd } = this;\n if (!open || type !== 'range' || ev.button !== 0) return;\n if (isEventTargetChildOfElement(ev, this.el) || hasRangeEnd) return;\n\n this.tentative = undefined;\n this.hasRangeEnd = false;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value.\n * @returns {Promise<void>}\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n\n this.value = undefined;\n this.internals.setFormValue(undefined);\n this.bqClear.emit(this.el);\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n /**\n * Handles the blur event for the date picker input.\n * @returns {void}\n */\n private handleBlur = (): void => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n /**\n * Handles the focus event for the date picker input.\n * @returns {void}\n */\n private handleFocus = (): void => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n /**\n * Updates the focused date in the calendar component.\n * Falls back to today's date if no value is set.\n * @returns {void}\n */\n private setFocusedDate = (): void => {\n const { callyElem, isCallyLoaded, value } = this;\n if (!callyElem || !isCallyLoaded) return;\n\n const nextFocused = value ? extractFocusedDate(value) : getTodayISO();\n if (this.focusedDate === nextFocused) return;\n\n this.focusedDate = nextFocused;\n if (callyElem.focusedDate !== this.focusedDate) {\n // We need to set the focused date in the calendar component via a ref\n // because it doesn't work when passed as a prop (the Cally element does not re-render)\n callyElem.focusedDate = this.focusedDate;\n }\n };\n\n /**\n * Handles user input changes with locale-aware date parsing.\n * Validates against disallowed dates and min/max constraints.\n * @param {Event} ev - The change event.\n * @returns {void}\n */\n private handleChange = (ev: Event): void => {\n if (this.disabled || !isHTMLElement(ev.target, 'input')) return;\n\n const inputValue = ev.target.value.trim();\n if (!inputValue) {\n this.clearValue();\n this.bqChange.emit({ value: this.value, el: this.el });\n return;\n }\n\n // Try to parse as date with locale awareness\n const dateValue = parseDateInput(inputValue, this.locale);\n if (!dateValue) {\n // Invalid date: don't update component value to avoid side effects\n this.internals.setFormValue(undefined);\n this.updateFormValidity();\n this.bqChange.emit({ value: inputValue, el: this.el });\n return;\n }\n\n // Check if date is disallowed\n if (this.isDateDisallowed?.(dateValue)) {\n this.internals.setFormValue(undefined);\n this.updateFormValidity();\n this.bqChange.emit({ value: inputValue, el: this.el });\n return;\n }\n\n // Valid date: normalize to ISO format and clamp to range if needed\n // Note: clamping is done based on string comparison of ISO dates and only when min/max are set\n let isoDate = toISODateString(dateValue);\n isoDate = clampDateToRange(isoDate, this.min, this.max);\n\n this.value = isoDate;\n this.displayDate = formatDisplayValue(isoDate, this.type, this.locale, this.formatOptions);\n this.internals.setFormValue(isoDate);\n this.updateFormValidity();\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n /**\n * Handles the change event when the user selects a date in the calendar component.\n * @param {Event} ev - The change event.\n * @returns {void}\n */\n private handleCalendarChange = (ev: Event): void => {\n if (this.isInternalUpdate) return;\n\n const shouldStayOpen = this.type === 'multi';\n const value = (ev.target as unknown as { value: string }).value;\n\n if (this.value === value) {\n this.open = shouldStayOpen;\n return;\n }\n\n this.isInternalUpdate = true;\n\n this.value = value;\n this.displayDate = formatDisplayValue(value, this.type, this.locale, this.formatOptions);\n this.inputElem.value = this.displayDate;\n this.inputElem.focus();\n\n this.internals.setFormValue(value);\n this.bqChange.emit({ value: this.value, el: this.el });\n\n this.open = shouldStayOpen;\n };\n\n /**\n * Handles the range start event when the user starts selecting a date range\n * @param {CustomEvent} ev - The range start event.\n * @returns {void}\n */\n private handleCalendarRangeStart = (ev: CustomEvent): void => {\n this.hasRangeEnd = false;\n this.tentative = ev.detail;\n };\n\n /**\n * Handles the range end event when the user finishes selecting a date range\n * @returns {void}\n */\n private handleCalendarRangeEnd = (): void => {\n this.hasRangeEnd = true;\n };\n\n /**\n * Handles the clear click event when the user clicks the clear button\n * @param {CustomEvent} ev - The clear click event.\n * @returns {void}\n */\n private handleClearClick = (ev: CustomEvent): void => {\n if (this.disabled) return;\n\n this.inputElem.value = '';\n this.clearValue();\n this.hasRangeEnd = false;\n\n this.bqClear.emit(this.el);\n this.bqChange.emit({ value: this.value, el: this.el });\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n /**\n * Clears the value of the date picker input.\n * @returns {void}\n */\n private clearValue = (): void => {\n this.value = undefined;\n this.displayDate = undefined;\n this.internals.setFormValue(undefined);\n };\n\n /**\n * Handles the slot change event when the slots content changes\n * @returns {void}\n */\n private handleSlotChange = (): void => {\n this.hasLabel = hasSlotContent(this.labelElem);\n this.hasPrefix = hasSlotContent(this.prefixElem);\n this.hasSuffix = hasSlotContent(this.suffixElem);\n };\n\n /**\n * Generates a calendar month element\n * @param {number} offset - The offset of the calendar month.\n * @param {string} className - The class name of the calendar month.\n * @returns {JSX.Element | null} The calendar month element.\n */\n private generateCalendarMonth = (offset?: number, className: string = ''): JSX.Element | null => {\n if (!this.isCallyLoaded) return null;\n\n return <calendar-month class={className} exportparts={CALENDAR_MONTH_EXPORT_PARTS} offset={offset} />;\n };\n\n /**\n * Generates an array of Elements representing the calendar months.\n *\n * If the type of the date picker is 'range' or 'multi' and the number of months is specified,\n * it generates an array of calendar months with the specified length. Each month will have an offset\n * and a class name based on its position in the array. The offset is used to determine the month to display,\n * and the class name is used for responsive design.\n *\n * If the type of the date picker is not 'range' or 'multi', or if the number of months is not specified,\n * it generates an array with a single calendar month.\n *\n * @returns {JSX.Element[]} An array of elements representing the calendar months.\n */\n private generateCalendarMonths = (): JSX.Element[] => {\n if (!this.isCallyLoaded) return [];\n\n if (this.type === 'range' || (this.type === 'multi' && this.months)) {\n return Array.from({ length: this.months }, (_, i) => {\n const offset = i > 0 ? i : undefined;\n const className = offset ? 'hidden sm:block' : '';\n return this.generateCalendarMonth(offset, className);\n });\n }\n\n return [this.generateCalendarMonth()];\n };\n\n /**\n * Updates the form validity of the date picker input.\n * @returns {void}\n */\n private updateFormValidity = (): void => {\n const { formValidationMessage, internals, required, value, inputElem } = this;\n\n updateFormValidity({\n internals,\n required,\n value,\n inputElem,\n validationMessage: formValidationMessage,\n defaultMessage: 'Please, input or select a valid date',\n });\n };\n\n /**\n * Returns the Cally calendar component tag name based on the picker type.\n * Maps 'single' → 'calendar-date', 'multi' → 'calendar-multi', 'range' → 'calendar-range'\n *\n * @returns The Cally calendar component tag name.\n */\n private get calendarType(): (typeof CALENDAR_TYPE_MAP)[TDatePickerType] {\n return CALENDAR_TYPE_MAP[this.type] ?? CALENDAR_TYPE_MAP.single;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const CallyCalendar = this.calendarType;\n const labelId = `bq-date-picker__label-${this.name || DEFAULT_INPUT_ID}`;\n\n return (\n <div class=\"bq-date-picker\" part=\"base\">\n {/* Label */}\n <label\n aria-labelledby={labelId}\n class={{ 'bq-date-picker__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name || DEFAULT_INPUT_ID}\n part=\"label\"\n ref={(labelElem: HTMLSpanElement) => {\n this.labelElem = labelElem;\n }}\n >\n <slot id={labelId} name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n {/* Select date picker dropdown */}\n <bq-dropdown\n class=\"bq-date-picker__dropdown is-full [&::part(panel)]:is-auto [&::part(panel)]:p-m\"\n disabled={this.disabled}\n distance={this.distance}\n exportparts=\"panel\"\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n skidding={this.skidding}\n strategy={this.strategy}\n >\n {/* Input control group */}\n <div\n class={{\n 'bq-date-picker__control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n slot=\"trigger\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-date-picker__control--prefix': true, '!hidden': !this.hasPrefix }}\n part=\"prefix\"\n ref={(spanElem: HTMLSpanElement) => {\n this.prefixElem = spanElem;\n }}\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n aria-controls={`${this.name}`}\n aria-describedby={this.hasLabel ? labelId : null}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-invalid={this.validationStatus === 'error' ? 'true' : 'false'}\n aria-haspopup=\"dialog\"\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n class=\"bq-date-picker__control--input\"\n disabled={this.disabled}\n form={this.form}\n id={this.name || DEFAULT_INPUT_ID}\n name={this.name}\n onBlur={this.handleBlur}\n onChange={this.handleChange}\n onFocus={this.handleFocus}\n part=\"input\"\n placeholder={this.placeholder}\n readonly={this.type !== 'single'}\n ref={(inputElem: HTMLInputElement) => {\n this.inputElem = inputElem;\n }}\n required={this.required}\n spellcheck={false}\n type=\"text\"\n value={this.displayDate}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n appearance=\"text\"\n border=\"s\"\n class=\"bq-date-picker__control--clear ms-[--bq-date-picker--gap] hidden [&::part(button)]:border-none [&::part(button)]:p-0\"\n exportparts=\"button\"\n label={this.clearButtonLabel}\n onBqClick={this.handleClearClick}\n onlyIcon\n part=\"clear-btn\"\n size=\"small\"\n >\n <slot name=\"clear-icon\">\n <bq-icon aria-hidden=\"true\" class=\"flex\" name=\"x-circle\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class=\"bq-date-picker__control--suffix\"\n part=\"suffix\"\n ref={(spanElem: HTMLSpanElement) => {\n this.suffixElem = spanElem;\n }}\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange}>\n <bq-icon class=\"flex\" name=\"calendar-blank\" />\n </slot>\n </span>\n </div>\n {this.isCallyLoaded && (\n <CallyCalendar\n aria-labelledby={labelId}\n aria-modal=\"true\"\n exportparts={CALENDAR_CONTAINER_EXPORT_PARTS}\n firstDayOfWeek={this.firstDayOfWeek}\n isDateDisallowed={this.isDateDisallowed}\n locale={this.locale as string}\n max={this.max}\n min={this.min}\n months={this.months}\n onChange={this.handleCalendarChange}\n onRangeend={this.handleCalendarRangeEnd}\n onRangestart={this.handleCalendarRangeStart}\n pageBy={this.monthsPerView}\n ref={(elem: TCalendarDate) => {\n this.callyElem = elem;\n }}\n role=\"dialog\"\n showOutsideDays={this.showOutsideDays}\n tentative={this.tentative}\n value={this.value}\n >\n <bq-icon color=\"text--primary\" label=\"Previous\" name=\"caret-left\" slot=\"previous\" />\n <bq-icon color=\"text--primary\" label=\"Next\" name=\"caret-right\" slot=\"next\" />\n\n <div class=\"flex flex-wrap justify-center gap-[--bq-spacing-m]\">{this.generateCalendarMonths()}</div>\n </CallyCalendar>\n )}\n </bq-dropdown>\n </div>\n );\n }\n}\n"],"mappings":";;;;ucACA,MAAMA,EAAiB,IAAIC,IAQ3B,MAAMC,EAAmB,CAACC,EAA8BC,KACt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AK0I,KAAK1I,IACVO,OAAQmI,KAAKnI,OACbsM,SAAUnE,KAAKkC,qBACf0C,WAAY5E,KAAKsC,uBACjBuC,aAAc7E,KAAKqC,yBACnByC,OAAQ9E,KAAKd,cACbyE,IAAMoB,IACJ/E,KAAKpC,UAAYmH,CAAI,EAEvBC,KAAK,SACLvF,gBAAiBO,KAAKP,gBACtBE,UAAWK,KAAKL,UAChBlK,MAAOuK,KAAKvK,OAEZoN,EAAA,WAAAhG,IAAA,2CAASoI,MAAM,gBAAgBR,MAAM,WAAWtF,KAAK,aAAa2E,KAAK,aACvEjB,EAAA,WAAAhG,IAAA,2CAASoI,MAAM,gBAAgBR,MAAM,OAAOtF,KAAK,cAAc2E,KAAK,SAEpEjB,EAAA,OAAAhG,IAAA,2CAAKiG,MAAM,sDAAsD9C,KAAKgD,4B","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["formatterCache","Map","getDateFormatter","locale","options","cacheKey","JSON","stringify","formatter","get","Intl","DateTimeFormat","set","size","firstKey","keys","next","value","delete","formatDisplayValue","type","formatOptions","undefined","dateFormatter","start","end","split","map","dateStr","Date","Number","isNaN","getTime","formatRange","dates","some","d","date","format","join","singleDate","extractFocusedDate","dateRegex","match","exec","clampDateToRange","min","max","ISO_DATE_LOCALE","DATE_PATTERNS","regex","parse","m","months","day","month","toLowerCase","year","_","parseNumericDate","monthNamesCache","getMonthNamesForLocale","cachedMonthNames","monthMap","shortFormatter","longFormatter","first","second","localeStr","usesMMDD","l","startsWith","isDateValid","getDate","getMonth","getFullYear","createValidDate","parseDateInput","inputValue","trim","isoDate","isValidISODate","test","yearStr","monthStr","dayStr","toISODateString","toLocaleDateString","getTodayISO","updateFormValidity","internals","required","inputElem","validationMessage","defaultMessage","states","clear","isDefined","add","setValidity","valueMissing","INPUT_VALIDATION","DAYS_OF_WEEK","DATE_PICKER_TYPE","CALENDAR_VIEW","FLOATING_STRATEGY","FLOATING_PLACEMENT","MONTHS_PER_VIEW","DATE_PRECISION","DEFAULT_INPUT_ID","DEFAULT_ARIA_LABELS","previousMonth","nextMonth","previousYear","nextYear","previousDecade","nextDecade","chooseMonth","chooseYear","chooseDate","CALENDAR_PARTS","base","label","control","prefix","suffix","input","clearBtn","button","container","header","heading","previous","table","head","tr","th","week","td","today","selected","outside","disallowed","disabled","rangeStart","rangeEnd","rangeInner","monthSelected","years","yearSelected","calendarTrigger","DECADE_GRID_SIZE","MAX_MONTHS_PER_VIEW","boundYear","iso","boundYearMonth","isYearWithinBounds","minYear","maxYear","monthAtOrAfter","bound","ym","y","monthAtOrBefore","isMonthWithinBounds","padBound","kind","yearMatch","String","padStart","parseISO","toISO","isValidISO","startOfMonth","endOfMonth","addDays","amount","setDate","addMonths","Math","addYears","setFullYear","isSameDay","a","b","compareISO","buildMonthMatrix","anchor","firstDayOfWeek","offset","getDay","gridStart","cells","i","push","rows","r","slice","getDecadeStart","floor","clampDate","minISO","maxISO","isWithinBounds","minPadded","maxPadded","sortRange","cache","CACHE_MAX_SIZE","localeKey","getFormatter","key","formatMonth","monthStyle","includeYear","formatYear","getWeekdayNames","style","weekday","Array","from","length","dayIndex","short","long","getMonthNames","PRECISION_ISO_REGEX","expandToken","token","precision","truncateISO","isValidToken","parseValue","trimmed","parts","filter","valid","Set","sort","serializeValue","selection","isSelected","includes","isRangeStart","isRangeEnd","isRangeInner","applySelection","v","buildTentativeRange","tentative","hovered","buildCellPartList","state","isToday","outOfBounds","computeCellState","cell","ctx","isDateDisallowed","effectiveSelection","isFocused","focusedISO","buttonHidden","showOutsideDays","renderCell","cb","h","class","part","role","tabIndex","onClick","ev","onDaySelect","onFocus","onDayFocus","onMouseEnter","onDayHover","onMouseLeave","CalendarDayView","props","viewDate","tentativeRange","onGridKeyDown","weekdays","gridLabel","onKeyDown","wd","abbr","scope","row","CalendarHeader","view","previousLabel","nextLabel","titleLabel","previousDisabled","nextDisabled","titleInteractive","onPrevious","onNext","onTitleClick","appearance","border","onlyIcon","onBqClick","name","block","monthCellISO","buildMonthParts","buildMonthCellState","focusedMonth","chunkMonths","columns","renderMonthCell","onMonthSelect","onMonthFocus","onMonthHover","CalendarMonthView","gridColumns","yearCellISO","buildYearParts","buildYearCellState","focusedYear","chunkYears","index","renderYearCell","onYearSelect","onYearFocus","onYearHover","CalendarYearView","parseTypedInput","text","parsed","invalid","clampISO","paddedMin","paddedMax","getHeaderLabel","decadeStart","monthCount","last","startYear","endYear","getHeaderTitleLabel","getPreviousLabel","getNextLabel","advanceFocusedMonth","delta","advanceFocusedYear","nextDecadeStart","getGridColumns","normalizeValue","raw","serialized","computeHasValue","computeDisplayDate","expanded","DEFAULT_FORMAT_OPTIONS_BY_PRECISION","bqDatePickerCss","defaultValidityMessage","flags","badInput","rangeUnderflow","rangeOverflow","BqDatePicker","__stencil_proxyCustomElement","HTMLElement","cachedSelection","hasBadInput","initialValue","isCommittingSelection","labelElem","pendingFocusRAF","prefixElem","triggerBtnElem","displayDate","hasConstraintError","hasLabel","hasPrefix","hasValue","tentativeHover","autofocus","clearButtonLabel","calendarButtonLabel","disableClear","distance","form","formValidationMessage","initialView","monthsPerView","open","panelHeight","placeholder","placement","skidding","strategy","validationStatus","handleValueChange","newValue","oldValue","normalized","this","syncDerivedFromValue","syncViewToValue","handleFormattingChange","effectiveFormatOptions","handleTypeChange","handlePrecisionChange","validatePropValue","el","precisionToView","handleBoundsChange","syncValidity","handleRequiredChange","checkPropValues","handleMonthsChange","clamped","clampMonths","handleOpen","requestAnimationFrame","shadowRoot","querySelector","focus","focusActiveCell","handleViewChange","prev","bqViewChange","emit","bqBlur","bqChange","bqClear","bqFocus","componentWillLoad","componentDidLoad","handleSlotChange","disconnectedCallback","cancelAnimationFrame","formAssociatedCallback","formResetCallback","handleOpenChange","isEventTargetChildOfElement","detail","clearValue","handleBlur","handleFocus","handleInputChange","isHTMLElement","target","setFormValue","handleClearClick","stopPropagation","handleTriggerClick","handleInputKeyDown","preventDefault","hasSlotContent","current","isNil","boundsFlags","computeBoundsValidityFlags","hasCustomConstraintError","Object","validity","message","rounded","isFinite","focusISO","bounded","getViewFocusReference","handleHeaderTitleClick","ref","handleHeaderPrev","step","handleHeaderNext","handleMonthSelect","commitSelection","nextFocus","handleYearSelect","handleDaySelect","shouldStayOpen","parsedIso","handleDayHover","handleDayFocus","getRTLDirection","dir","closest","getComputedStyle","direction","moveFocusedDay","deltaDays","focusButton","moveFocusedDayHome","dayOfWeek","moveFocusedDayEnd","rowIndex","pageFocusedMonth","byYear","selectFocusedDay","handleDayGridKeyDown","rtl","handlers","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","shiftKey","PageDown","Escape","Enter","handler","getMonthCount","handleMonthGridKeyDown","stride","move","handleYearGridKeyDown","selector","renderDayPanels","panels","anchorKey","renderMonthsView","renderYearsView","effectiveFocused","renderView","render","labelId","popupId","htmlFor","id","onSlotchange","exportparts","slot","autoCapitalize","autoComplete","onBlur","onChange","readonly","spellcheck"],"sources":["../../packages/beeq/src/shared/utils/date/dateFormatting.ts","../../packages/beeq/src/shared/utils/date/dateParsing.ts","../../packages/beeq/src/shared/utils/form.ts","../../packages/beeq/src/components/input/bq-input.types.ts","../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts","../../packages/beeq/src/components/date-picker/helper/constants.ts","../../packages/beeq/src/components/date-picker/helper/bounds.ts","../../packages/beeq/src/components/date-picker/helper/calendar.ts","../../packages/beeq/src/components/date-picker/helper/intl.ts","../../packages/beeq/src/components/date-picker/helper/selection.ts","../../packages/beeq/src/components/date-picker/components/CalendarDayView.tsx","../../packages/beeq/src/components/date-picker/components/CalendarHeader.tsx","../../packages/beeq/src/components/date-picker/components/CalendarMonthView.tsx","../../packages/beeq/src/components/date-picker/components/CalendarYearView.tsx","../../packages/beeq/src/components/date-picker/helper/input.ts","../../packages/beeq/src/components/date-picker/helper/labels.ts","../../packages/beeq/src/components/date-picker/helper/navigation.ts","../../packages/beeq/src/components/date-picker/helper/value.ts","../../packages/beeq/src/components/date-picker/scss/bq-date-picker.scss?tag=bq-date-picker&encapsulation=shadow","../../packages/beeq/src/components/date-picker/bq-date-picker.tsx"],"sourcesContent":["/** Cache for DateTimeFormat instances */\nconst formatterCache = new Map<string, Intl.DateTimeFormat>();\n\n/**\n * Gets or creates a cached DateTimeFormat instance\n * @param locale - The locale for formatting\n * @param options - DateTimeFormat options\n * @returns Cached or new DateTimeFormat instance\n */\nconst getDateFormatter = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat => {\n const cacheKey = `${typeof locale === 'string' ? locale : JSON.stringify(locale)}-${JSON.stringify(options)}`;\n\n let formatter = formatterCache.get(cacheKey);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options);\n formatterCache.set(cacheKey, formatter);\n\n // Limit cache size to prevent memory leaks in long-running apps\n if (formatterCache.size > 50) {\n const firstKey = formatterCache.keys().next().value;\n formatterCache.delete(firstKey);\n }\n }\n\n return formatter;\n};\n\n/**\n * Formats a date value for display based on the picker type and locale.\n *\n * @param value - The ISO date string(s) to format\n * @param type - The picker type (single, multi, range)\n * @param locale - The locale for formatting\n * @param formatOptions - Intl.DateTimeFormat options\n * @returns Formatted display string or undefined\n */\nconst formatDisplayValue = (\n value: string,\n type: 'single' | 'multi' | 'range',\n locale: Intl.LocalesArgument,\n formatOptions: Intl.DateTimeFormatOptions,\n): string | undefined => {\n if (!value) return undefined;\n\n const dateFormatter = getDateFormatter(locale, formatOptions);\n\n if (type === 'range') {\n const [start, end] = value.split('/').map((dateStr) => new Date(`${dateStr}T00:00:00`));\n if (!start || !end || Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) return undefined;\n\n return dateFormatter.formatRange(start, end);\n }\n\n if (type === 'multi') {\n const dates = value.split(' ').map((dateStr) => new Date(`${dateStr}T00:00:00`));\n if (dates.some((d) => Number.isNaN(d.getTime()))) return undefined;\n\n return dates.map((date) => dateFormatter.format(date)).join(', ');\n }\n\n const singleDate = new Date(`${value}T00:00:00`);\n return Number.isNaN(singleDate.getTime()) ? undefined : dateFormatter.format(singleDate);\n};\n\n/**\n * Extracts and returns the first date part from a given string. Handles single, multi, and range picker types.\n * When the type of the date picker is 'range' or 'multi', the first or initial date part of the value\n * should be the focused date in the calendar.\n *\n * @param value - The date value string\n * @returns The first ISO date string or undefined\n */\nconst extractFocusedDate = (value: string): string | undefined => {\n if (!value) return undefined;\n\n const dateRegex = /\\b\\d{4}-\\d{2}-\\d{2}\\b/;\n const match = dateRegex.exec(value);\n return match ? match[0] : undefined;\n};\n\n/**\n * Clamps a date string to a min/max range.\n *\n * @param dateStr - The ISO date string to clamp\n * @param min - Optional minimum date\n * @param max - Optional maximum date\n * @returns The clamped date string\n */\nconst clampDateToRange = (dateStr: string, min?: string, max?: string): string => {\n if (min && dateStr < min) return min;\n if (max && dateStr > max) return max;\n return dateStr;\n};\n\nexport { clampDateToRange, extractFocusedDate, formatDisplayValue };\n","/** Date parsing pattern definition */\ntype TDatePattern = {\n regex: RegExp;\n parse: (\n match: RegExpExecArray,\n monthMap: Record<string, number>,\n locale?: Intl.LocalesArgument,\n ) => { day: number; month: number; year: number };\n};\n\n/** French Canadian locale used for ISO date formatting (YYYY-MM-DD) */\nconst ISO_DATE_LOCALE = 'fr-CA';\n\n/**\n * Static date parsing patterns\n */\nconst DATE_PATTERNS: TDatePattern[] = [\n {\n // Matches \"30 May 2024\" or \"30 January 2024\"\n regex: /^(\\d{1,2})\\s+([a-z]+)\\s+(\\d{4})$/i,\n parse: (m, months) => ({\n day: +m[1],\n month: months[m[2].toLowerCase()],\n year: +m[3],\n }),\n },\n {\n // Matches \"05/30/2024\", \"30-05-2024\", \"30.05.2024\", \"05.30.2024\" (with heuristic for day/month)\n regex: /^(\\d{1,2})[\\s\\-/.](\\d{1,2})[\\s\\-/.](\\d{4})$/,\n parse: (m, _, locale) => {\n const { day, month } = parseNumericDate(+m[1], +m[2], locale);\n return { day, month, year: +m[3] };\n },\n },\n {\n // Matches \"May 30, 2024\" or \"January 1, 1970\" (with optional comma)\n regex: /^([a-z]+)\\s+(\\d{1,2}),?\\s+(\\d{4})$/i,\n parse: (m, months) => ({\n month: months[m[1].toLowerCase()],\n day: +m[2],\n year: +m[3],\n }),\n },\n {\n // Matches \"2024-05-30\" (ISO format without parsing as Date first)\n regex: /^(\\d{4})-(\\d{2})-(\\d{2})$/,\n parse: (m) => ({\n year: +m[1],\n month: +m[2] - 1,\n day: +m[3],\n }),\n },\n];\n\nconst monthNamesCache = new Map<string, Record<string, number>>();\n\n/**\n * Gets localized month names for the given locale (both short and long forms)\n * Caches results for performance\n * @param {Intl.LocalesArgument} locale - The locale identifier, e.g., 'en-GB', 'fr-FR', etc.\n * @returns {Record<string, number>} Mapping of month names to month indices\n */\nconst getMonthNamesForLocale = (locale: Intl.LocalesArgument): Record<string, number> => {\n const cacheKey = typeof locale === 'string' ? locale : JSON.stringify(locale);\n\n const cachedMonthNames = monthNamesCache.get(cacheKey);\n if (cachedMonthNames) return cachedMonthNames;\n\n const monthMap: Record<string, number> = {};\n const shortFormatter = new Intl.DateTimeFormat(locale, { month: 'short' });\n const longFormatter = new Intl.DateTimeFormat(locale, { month: 'long' });\n\n for (let month = 0; month < 12; month++) {\n const date = new Date(2024, month, 1);\n monthMap[shortFormatter.format(date).toLowerCase()] = month;\n monthMap[longFormatter.format(date).toLowerCase()] = month;\n }\n\n monthNamesCache.set(cacheKey, monthMap);\n return monthMap;\n};\n\n/**\n * Parses day-month-year or month-day-year numeric date format\n * Uses heuristic: if any number > 12, treat it as day, otherwise defaults to locale preference\n * @param {number} first - The first numeric part (day or month)\n * @param {number} second - The second numeric part (month or day)\n * @param {Intl.LocalesArgument} locale - The locale for determining format preference\n * @returns {{day: number, month: number}} Object with day and month (0-based)\n */\nconst parseNumericDate = (\n first: number,\n second: number,\n locale: Intl.LocalesArgument = 'en-GB',\n): { day: number; month: number } => {\n // If first number > 12, it must be the day (DD/MM format)\n if (first > 12) return { day: first, month: second - 1 };\n\n // If second number > 12, it must be the day (MM/DD format)\n if (second > 12) return { day: second, month: first - 1 };\n\n // Both numbers <= 12: ambiguous case\n // Use locale to determine format preference\n const localeStr = typeof locale === 'string' ? locale : locale?.[0] || 'en-GB';\n const usesMMDD = ['en-US', 'en-CA'].some((l) => localeStr.startsWith(l));\n\n if (usesMMDD) {\n // US/Canada format: MM/DD\n return { day: second, month: first - 1 };\n }\n\n // Default to DD/MM (European/most of world format)\n return { day: first, month: second - 1 };\n};\n\n/**\n * Validates that a date is actually valid (not auto-corrected by Date constructor)\n * @param {number} day - Day of the month\n * @param {number} month - Month (0-based)\n * @param {number} year - Full year\n * @returns {boolean} True if the date is valid\n */\nconst isDateValid = (day: number, month: number, year: number): boolean => {\n const date = new Date(year, month, day);\n return date.getDate() === day && date.getMonth() === month && date.getFullYear() === year;\n};\n\n/**\n * Validates and creates a Date object from day, month, and year\n * @param {number} day - Day of the month\n * @param {number} month - Month (0-based)\n * @param {number} year - Full year\n * @returns {Date | null} Valid Date object or null if invalid\n */\nconst createValidDate = (day: number, month: number, year: number): Date | null => {\n if (month === undefined || !day || !year) return null;\n if (!isDateValid(day, month, year)) return null;\n\n return new Date(year, month, day);\n};\n\n/**\n * Parses various date input formats and returns a Date object\n * Supports:\n * - ISO format: \"2024-05-30\"\n * - Text format: \"30 May 2024\", \"May 30, 2024\", \"30 January 2024\", \"January 1, 1970\" (locale-aware)\n * - Numeric formats: \"30/05/2024\", \"05-30-2024\", \"30.05.2024\", \"05.30.2024\" (with heuristic for day/month)\n *\n * @param {string} inputValue - The date string to parse\n * @param {Intl.LocalesArgument} locale - The locale for month name recognition (defaults to 'en-GB')\n * @returns {Date | null} Parsed Date object or null if parsing fails\n */\nconst parseDateInput = (inputValue: string, locale: Intl.LocalesArgument = 'en-GB'): Date | null => {\n if (!inputValue?.trim()) return null;\n\n // Try ISO format first\n const isoDate = new Date(`${inputValue}T00:00:00`);\n if (!Number.isNaN(isoDate.getTime()) && isValidISODate(inputValue)) return isoDate;\n\n const monthMap = getMonthNamesForLocale(locale);\n\n for (const { regex, parse } of DATE_PATTERNS) {\n const match = regex.exec(inputValue);\n if (!match) continue;\n\n const { day, month, year } = parse(match, monthMap, locale);\n const date = createValidDate(day, month, year);\n if (date) return date;\n }\n\n return null;\n};\n\n/**\n * Validates if a string is in ISO date format (YYYY-MM-DD) with actual valid date values\n * @param {string} dateStr - The date string to validate\n * @returns {boolean} True if the date string is valid in ISO format and represents an actual valid date\n */\nconst isValidISODate = (dateStr: string): boolean => {\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(dateStr)) return false;\n\n const [yearStr, monthStr, dayStr] = dateStr.split('-');\n const year = +yearStr;\n const month = +monthStr - 1;\n const day = +dayStr;\n\n return isDateValid(day, month, year);\n};\n\n/**\n * Converts a Date object to ISO format string (YYYY-MM-DD).\n * @param date - The date to convert\n * @returns ISO formatted date string\n */\nconst toISODateString = (date: Date): string => {\n return date.toLocaleDateString(ISO_DATE_LOCALE);\n};\n\n/**\n * Gets today's date in ISO format.\n * @returns Today's date as YYYY-MM-DD string\n */\nconst getTodayISO = (): string => {\n return new Date().toLocaleDateString(ISO_DATE_LOCALE);\n};\n\nexport { getTodayISO, ISO_DATE_LOCALE, isValidISODate, parseDateInput, toISODateString };\n","import { isDefined } from './isDefined';\n\ntype FormValidityOptions = {\n /** The ElementInternals instance */\n internals?: ElementInternals;\n /** Whether the field is required */\n required?: boolean;\n /** Current field value */\n value?: string | string[] | number;\n /** Reference to the input element */\n inputElem?: HTMLInputElement | HTMLTextAreaElement;\n /** Custom validation message */\n validationMessage?: string;\n /** Default validation message */\n defaultMessage?: string;\n};\n\n/**\n * Updates form validity state for form-associated custom elements.\n * Handles the required field validation and sets appropriate validity states.\n *\n * @param {FormValidityOptions} options - Validation options\n * @param options.internals - The ElementInternals instance\n * @param {boolean} options.required - Whether the field is required\n * @param {string | string[] | number} options.value - The current field value\n * @param {HTMLInputElement | HTMLTextAreaElement} options.inputElem - The input element\n * @param {string} options.validationMessage - The custom validation message\n * @param {string} options.defaultMessage - The default validation message\n */\nconst updateFormValidity = ({\n internals,\n required,\n value,\n inputElem,\n validationMessage,\n defaultMessage = 'Please fill out this field',\n}: FormValidityOptions): void => {\n if (!internals) return;\n\n // Clear the validity state\n internals.states.clear();\n\n // Check if value is required but missing\n if (required && !isDefined(value)) {\n // Set validity state to invalid\n internals.states.add('invalid');\n internals.setValidity({ valueMissing: true }, validationMessage ?? defaultMessage, inputElem);\n return;\n }\n\n // Set validity state to valid if the input has value or is not required\n internals.states.add('valid');\n internals.setValidity({});\n};\n\nexport { type FormValidityOptions, updateFormValidity };\n","export const INPUT_TYPE = [\n 'date',\n 'datetime-local',\n 'email',\n 'number',\n 'password',\n 'search',\n 'tel',\n 'text',\n 'time',\n 'url',\n] as const;\nexport type TInputType = (typeof INPUT_TYPE)[number];\n\nexport const INPUT_VALIDATION = ['error', 'none', 'success', 'warning'] as const;\nexport type TInputValidation = (typeof INPUT_VALIDATION)[number];\n\nexport type TInputValue = string | number | string[];\n","/** The first day of the week, where Sunday is 0, Monday is 1, etc. */\nexport type DaysOfWeek = 0 | 1 | 2 | 3 | 4 | 5 | 6;\nexport const DAYS_OF_WEEK: readonly DaysOfWeek[] = [0, 1, 2, 3, 4, 5, 6] as const;\n\n/** The type of the date picker */\nexport const DATE_PICKER_TYPE = ['single', 'multi', 'range'] as const;\n/** The type of the date picker */\nexport type TDatePickerType = (typeof DATE_PICKER_TYPE)[number];\n\n/** The calendar view */\nexport const CALENDAR_VIEW = ['days', 'months', 'years'] as const;\n/** The calendar view */\nexport type TCalendarView = (typeof CALENDAR_VIEW)[number];\n\n/** Positioning strategy for the panel. */\nexport const FLOATING_STRATEGY = ['fixed', 'absolute'] as const;\nexport type TFloatingStrategy = (typeof FLOATING_STRATEGY)[number];\n\n/** Placement of the panel — mirrors `@floating-ui/dom` placements. */\nexport const FLOATING_PLACEMENT = [\n 'top',\n 'top-start',\n 'top-end',\n 'right',\n 'right-start',\n 'right-end',\n 'bottom',\n 'bottom-start',\n 'bottom-end',\n 'left',\n 'left-start',\n 'left-end',\n] as const;\nexport type TFloatingPlacement = (typeof FLOATING_PLACEMENT)[number];\n\n/** How the next/previous buttons should step through months. */\nexport const MONTHS_PER_VIEW = ['single', 'months'] as const;\nexport type TMonthsPerView = (typeof MONTHS_PER_VIEW)[number];\n\n/**\n * The precision of the value produced by the date picker.\n * - `day` → `YYYY-MM-DD` (default; drill-down to days)\n * - `month` → `YYYY-MM` (selection commits on the months view)\n * - `year` → `YYYY` (selection commits on the years view)\n */\nexport const DATE_PRECISION = ['day', 'month', 'year'] as const;\nexport type TDatePrecision = (typeof DATE_PRECISION)[number];\n\n/**\n * Internal representation of a selection.\n * Always an array of ISO 8601 date strings (YYYY-MM-DD).\n * - single → 0 or 1 entry\n * - multi → N entries\n * - range → 0 or 2 entries [startISO, endISO]\n */\nexport type TSelection = string[];\n","/** Default fallback input ID */\nexport const DEFAULT_INPUT_ID = 'date-picker';\n\n/** Default aria labels used by the calendar navigation */\nexport const DEFAULT_ARIA_LABELS = {\n previousMonth: 'Previous month',\n nextMonth: 'Next month',\n previousYear: 'Previous year',\n nextYear: 'Next year',\n previousDecade: 'Previous decade',\n nextDecade: 'Next decade',\n chooseMonth: 'Choose month',\n chooseYear: 'Choose year',\n chooseDate: 'Choose date',\n} as const;\n\n/**\n * Shadow DOM parts exposed by the component.\n * Kept as a single list so it is easy to audit against the JSDoc @part list.\n */\nexport const CALENDAR_PARTS = {\n base: 'base',\n label: 'label',\n control: 'control',\n prefix: 'prefix',\n suffix: 'suffix',\n input: 'input',\n clearBtn: 'clear-btn',\n button: 'button',\n panel: 'panel',\n container: 'calendar__container',\n header: 'calendar__header',\n heading: 'calendar__heading',\n previous: 'calendar__previous',\n next: 'calendar__next',\n table: 'calendar__table',\n head: 'calendar__head',\n tr: 'calendar__tr',\n th: 'calendar__th',\n week: 'calendar__week',\n td: 'calendar__td',\n day: 'calendar__day',\n today: 'calendar__today',\n selected: 'calendar__selected',\n outside: 'calendar__outside',\n disallowed: 'calendar__disallowed',\n disabled: 'calendar__disabled',\n rangeStart: 'calendar__range-start',\n rangeEnd: 'calendar__range-end',\n rangeInner: 'calendar__range-inner',\n months: 'calendar__months',\n month: 'calendar__month',\n monthSelected: 'calendar__month-selected',\n years: 'calendar__years',\n year: 'calendar__year',\n yearSelected: 'calendar__year-selected',\n calendarTrigger: 'calendar-trigger',\n} as const;\n\n/** Number of years shown in the decade view grid. Uses 12 to fill a 3x4 grid. */\nexport const DECADE_GRID_SIZE = 12;\n\n/**\n * Maximum number of month panels rendered side-by-side. Range pickers only\n * benefit from up to 2 panels — beyond that the popover overflows most\n * viewports and roving keyboard navigation becomes confusing.\n */\nexport const MAX_MONTHS_PER_VIEW = 2;\n","/**\n * Bounds predicates for the calendar.\n *\n * `min` and `max` may be at any wire precision (`YYYY`, `YYYY-MM`, or\n * `YYYY-MM-DD`); internal cell values are always full `YYYY-MM-DD` strings.\n * All predicates are pure and rely on lexicographic comparison, which is\n * safe for ISO 8601 dates.\n */\n\n/**\n * Extract the `YYYY` prefix (as a number) from a bound string.\n * Returns `null` if the string does not begin with a 4-digit year.\n */\nexport const boundYear = (iso: string | undefined | null): number | null => {\n if (!iso) return null;\n const match = /^(\\d{4})/.exec(iso);\n return match ? Number(match[1]) : null;\n};\n\n/**\n * Extract `{ year, month }` (month is 0-based) from a bound string. Falls\n * back to `null` when the string doesn't contain a `YYYY-MM` prefix.\n */\nexport const boundYearMonth = (iso: string | undefined | null): { year: number; month: number } | null => {\n if (!iso) return null;\n const match = /^(\\d{4})-(\\d{2})/.exec(iso);\n if (!match) return null;\n const month = Number(match[2]) - 1;\n if (month < 0 || month > 11) return null;\n return { year: Number(match[1]), month };\n};\n\n/**\n * Whether a given year is within the (inclusive) `min`/`max` range.\n * A year cell is considered in-range when any day inside that year is\n * still selectable — i.e. we compare on the year prefix only, ignoring\n * the month/day components of `min` / `max`.\n */\nexport const isYearWithinBounds = (year: number, min?: string | null, max?: string | null): boolean => {\n const minYear = boundYear(min);\n const maxYear = boundYear(max);\n if (minYear !== null && year < minYear) return false;\n if (maxYear !== null && year > maxYear) return false;\n return true;\n};\n\n/**\n * Whether a `(year, month)` pair sits at-or-after the given lower bound.\n * A `null`/`undefined` bound is treated as \"no lower bound\".\n */\nconst monthAtOrAfter = (year: number, month: number, bound: string | undefined | null): boolean => {\n const ym = boundYearMonth(bound);\n if (ym) return year > ym.year || (year === ym.year && month >= ym.month);\n const y = boundYear(bound);\n return y === null || year >= y;\n};\n\n/** Whether a `(year, month)` pair sits at-or-before the given upper bound. */\nconst monthAtOrBefore = (year: number, month: number, bound: string | undefined | null): boolean => {\n const ym = boundYearMonth(bound);\n if (ym) return year < ym.year || (year === ym.year && month <= ym.month);\n const y = boundYear(bound);\n return y === null || year <= y;\n};\n\n/**\n * Whether a given `(year, month)` pair is within the (inclusive) `min`/`max`\n * range. A month cell is considered in-range when any day inside that month\n * would still satisfy the bounds — we compare on the year-month prefix and\n * ignore the day component of `min` / `max`.\n */\nexport const isMonthWithinBounds = (year: number, month: number, min?: string | null, max?: string | null): boolean =>\n monthAtOrAfter(year, month, min) && monthAtOrBefore(year, month, max);\n\n/**\n * Whether a full `YYYY-MM-DD` iso date is within the (inclusive) `min`/`max`\n * range. Bounds may be at any precision — we pad `min` to the earliest day\n * (`YYYY-01-01`) and `max` to the latest day (`YYYY-12-31`) before doing a\n * lexical compare (safe because ISO 8601 sorts by calendar order).\n */\nexport const isDateWithinBounds = (iso: string, min?: string | null, max?: string | null): boolean => {\n if (!iso) return false;\n const paddedMin = padBound(min, 'min');\n const paddedMax = padBound(max, 'max');\n if (paddedMin !== null && iso < paddedMin) return false;\n if (paddedMax !== null && iso > paddedMax) return false;\n return true;\n};\n\n/**\n * Pad a bound string up to full `YYYY-MM-DD` length so it can be lexically\n * compared with a full ISO date. `min` widens down (missing pieces become\n * `-01`), `max` widens up (missing month → `-12`, missing day → last day of\n * that month, honoring leap years).\n */\nexport const padBound = (iso: string | undefined | null, kind: 'min' | 'max'): string | null => {\n if (!iso) return null;\n const yearMatch = /^(\\d{4})(?:-(\\d{2}))?(?:-(\\d{2}))?$/.exec(iso);\n if (!yearMatch) return null;\n const year = yearMatch[1];\n const month = yearMatch[2] ?? (kind === 'min' ? '01' : '12');\n const day =\n yearMatch[3] ??\n (kind === 'min' ? '01' : String(new Date(Number(year), Number(month), 0).getDate()).padStart(2, '0'));\n return `${year}-${month}-${day}`;\n};\n","import { ISO_DATE_LOCALE } from '../../../shared/utils/date';\nimport { DECADE_GRID_SIZE } from './constants';\n\n/* -------------------------------------------------------------------------- */\n/* Date parsing */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Parse an ISO 8601 date string (`YYYY-MM-DD`) into a local-time `Date`.\n * Returns `null` when the string is missing or invalid.\n */\nexport const parseISO = (iso: string | undefined | null): Date | null => {\n if (!iso || !/^\\d{4}-\\d{2}-\\d{2}$/.test(iso)) return null;\n const [y, m, d] = iso.split('-').map(Number);\n const date = new Date(y, m - 1, d);\n if (date.getFullYear() !== y || date.getMonth() !== m - 1 || date.getDate() !== d) return null;\n return date;\n};\n\n/**\n * Convert a `Date` to `YYYY-MM-DD` in local time.\n */\nexport const toISO = (date: Date): string => date.toLocaleDateString(ISO_DATE_LOCALE);\n\n/**\n * Extract the calendar year and 0-based month from an ISO date string.\n * Returns `null` for missing or malformed input — safer than `Number(iso.slice(...))`\n * which silently produces `NaN` for invalid bounds.\n */\nexport const getISOYearMonth = (iso: string | undefined | null): { year: number; month: number } | null => {\n const parsed = parseISO(iso);\n if (!parsed) return null;\n return { year: parsed.getFullYear(), month: parsed.getMonth() };\n};\n\n/**\n * Whether the ISO string is a valid `YYYY-MM-DD` date (round-trips through\n * `parseISO`). Convenience predicate for input filtering.\n */\nexport const isValidISO = (iso: string | undefined | null): boolean => parseISO(iso) !== null;\n\n/* -------------------------------------------------------------------------- */\n/* Date builders */\n/* -------------------------------------------------------------------------- */\n\nexport const startOfDay = (date: Date): Date => new Date(date.getFullYear(), date.getMonth(), date.getDate());\n\nexport const startOfMonth = (date: Date): Date => new Date(date.getFullYear(), date.getMonth(), 1);\n\nexport const endOfMonth = (date: Date): Date => new Date(date.getFullYear(), date.getMonth() + 1, 0);\n\nexport const addDays = (date: Date, amount: number): Date => {\n const next = new Date(date);\n next.setDate(next.getDate() + amount);\n return next;\n};\n\nexport const addMonths = (date: Date, amount: number): Date => {\n const next = new Date(date.getFullYear(), date.getMonth() + amount, 1);\n // Preserve the day when possible.\n const day = Math.min(date.getDate(), endOfMonth(next).getDate());\n next.setDate(day);\n return next;\n};\n\nexport const addYears = (date: Date, amount: number): Date => {\n const next = new Date(date);\n next.setFullYear(next.getFullYear() + amount);\n return next;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Comparators */\n/* -------------------------------------------------------------------------- */\n\nexport const isSameDay = (a: Date | null, b: Date | null): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const isSameMonth = (a: Date | null, b: Date | null): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();\n\nexport const isSameYear = (a: Date | null, b: Date | null): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear();\n\n/** ISO-string based comparison; safe for `YYYY-MM-DD`. */\nexport const compareISO = (a: string, b: string): number => {\n if (a === b) return 0;\n return a < b ? -1 : 1;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Month matrix */\n/* -------------------------------------------------------------------------- */\n\nexport type TCalendarCell = {\n /** The day's `Date`. */\n date: Date;\n /** `YYYY-MM-DD` representation. */\n iso: string;\n /** `true` when the cell belongs to a month other than the current view. */\n outside: boolean;\n};\n\n/**\n * Build a 6x7 matrix for the given month starting on `firstDayOfWeek`.\n * The matrix always has 42 cells so the calendar keeps a stable height.\n *\n * @param anchor Any date within the target month.\n * @param firstDayOfWeek 0 = Sunday, 1 = Monday, ...\n */\nexport const buildMonthMatrix = (anchor: Date, firstDayOfWeek: number): TCalendarCell[][] => {\n const start = startOfMonth(anchor);\n const offset = (start.getDay() - firstDayOfWeek + 7) % 7;\n const gridStart = addDays(start, -offset);\n\n const cells: TCalendarCell[] = [];\n for (let i = 0; i < 42; i++) {\n const date = addDays(gridStart, i);\n cells.push({\n date,\n iso: toISO(date),\n outside: date.getMonth() !== anchor.getMonth(),\n });\n }\n\n const rows: TCalendarCell[][] = [];\n for (let r = 0; r < 6; r++) rows.push(cells.slice(r * 7, r * 7 + 7));\n return rows;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Decade grid */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Given any year, return the anchor year of the decade grid.\n *\n * The reference image shows a grid like `2016 – 2027` containing the current\n * year (`2026`). We anchor the grid so the \"round\" decade start (e.g. 2020,\n * 2010, ...) appears at index 1 - i.e. one extra year before the decade and\n * one extra year after, filling the 3x4 grid cleanly.\n */\nexport const getDecadeStart = (year: number): number => Math.floor(year / 10) * 10 - 1;\n\n/**\n * Build the 12-year decade grid for the year that contains `anchor`.\n * Returns `{ start, end, years }` where `years.length === DECADE_GRID_SIZE`.\n */\nexport const buildDecade = (anchor: Date): { start: number; end: number; years: number[] } => {\n const start = getDecadeStart(anchor.getFullYear());\n const end = start + DECADE_GRID_SIZE - 1;\n const years = Array.from({ length: DECADE_GRID_SIZE }, (_, i) => start + i);\n return { start, end, years };\n};\n\n/* -------------------------------------------------------------------------- */\n/* Range helpers */\n/* -------------------------------------------------------------------------- */\n\nimport { padBound } from './bounds';\n\n/**\n * Clamp a `Date` between an optional min and max. Bounds may be at any\n * ISO precision (`YYYY`, `YYYY-MM`, `YYYY-MM-DD`) and are padded to the\n * widest matching day before comparing (`min` → first day, `max` → last day).\n */\nexport const clampDate = (date: Date, minISO?: string, maxISO?: string): Date => {\n const min = parseISO(padBound(minISO, 'min'));\n const max = parseISO(padBound(maxISO, 'max'));\n if (min && date < min) return min;\n if (max && date > max) return max;\n return date;\n};\n\n/** Whether the given `Date` is within `[min, max]` ISO bounds (inclusive). */\nexport const isWithinBounds = (date: Date, minISO?: string, maxISO?: string): boolean => {\n const iso = toISO(date);\n const minPadded = padBound(minISO, 'min');\n const maxPadded = padBound(maxISO, 'max');\n if (minPadded && iso < minPadded) return false;\n if (maxPadded && iso > maxPadded) return false;\n return true;\n};\n\n/** Sort two ISO strings and return `[start, end]`. */\nexport const sortRange = (a: string, b: string): [string, string] => (a <= b ? [a, b] : [b, a]);\n","/**\n * Cached `Intl.DateTimeFormat` factories.\n *\n * The Intl API is powerful but relatively expensive to instantiate. Since the\n * calendar re-renders on every user interaction we keep a small LRU-ish cache\n * keyed by locale + option shape.\n */\n\nconst cache = new Map<string, Intl.DateTimeFormat>();\n\n/** Prevents unbounded growth in long-running apps. */\nconst CACHE_MAX_SIZE = 64;\n\nconst cacheKey = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): string => {\n const localeKey = typeof locale === 'string' ? locale : JSON.stringify(locale ?? '');\n return `${localeKey}|${JSON.stringify(options)}`;\n};\n\nconst getFormatter = (locale: Intl.LocalesArgument, options: Intl.DateTimeFormatOptions): Intl.DateTimeFormat => {\n const key = cacheKey(locale, options);\n let formatter = cache.get(key);\n if (!formatter) {\n formatter = new Intl.DateTimeFormat(locale, options);\n cache.set(key, formatter);\n if (cache.size > CACHE_MAX_SIZE) {\n const firstKey = cache.keys().next().value;\n if (firstKey !== undefined) cache.delete(firstKey);\n }\n }\n return formatter;\n};\n\n/**\n * Format a full date, e.g. \"1 January 2026\".\n */\nexport const formatDate = (\n date: Date,\n locale: Intl.LocalesArgument,\n options: Intl.DateTimeFormatOptions = { day: 'numeric', month: 'long', year: 'numeric' },\n): string => getFormatter(locale, options).format(date);\n\n/**\n * Format a month, e.g. \"January 2026\" or \"Jan\".\n */\nexport const formatMonth = (\n date: Date,\n locale: Intl.LocalesArgument,\n monthStyle: 'long' | 'short' | 'narrow' = 'long',\n includeYear = true,\n): string =>\n getFormatter(locale, {\n month: monthStyle,\n ...(includeYear ? { year: 'numeric' } : {}),\n }).format(date);\n\n/**\n * Format a year, e.g. \"2026\".\n */\nexport const formatYear = (date: Date, locale: Intl.LocalesArgument): string =>\n getFormatter(locale, { year: 'numeric' }).format(date);\n\n/**\n * Returns the weekday names for the given locale ordered from `firstDayOfWeek`.\n *\n * @param locale The locale used for formatting.\n * @param firstDayOfWeek The first day of the week (0 = Sunday, 1 = Monday, ...).\n * @param style Weekday style (long, short, narrow).\n * @returns An array of `{short, long}` names in display order.\n */\nexport const getWeekdayNames = (\n locale: Intl.LocalesArgument,\n firstDayOfWeek: number,\n style: 'long' | 'short' | 'narrow' = 'short',\n): Array<{ short: string; long: string }> => {\n const shortFormatter = getFormatter(locale, { weekday: style });\n const longFormatter = getFormatter(locale, { weekday: 'long' });\n // Any known Sunday works as the anchor date. 2024-01-07 is a Sunday.\n const anchor = new Date(2024, 0, 7);\n\n return Array.from({ length: 7 }, (_, i) => {\n const dayIndex = (firstDayOfWeek + i) % 7;\n const day = new Date(anchor);\n day.setDate(anchor.getDate() + dayIndex);\n return { short: shortFormatter.format(day), long: longFormatter.format(day) };\n });\n};\n\n/**\n * Returns the localized month names.\n *\n * @param locale The locale used for formatting.\n * @param style Month style (long, short, narrow).\n */\nexport const getMonthNames = (locale: Intl.LocalesArgument, style: 'long' | 'short' | 'narrow' = 'short'): string[] => {\n const formatter = getFormatter(locale, { month: style });\n return Array.from({ length: 12 }, (_, month) => formatter.format(new Date(2024, month, 1)));\n};\n","import type { TDatePickerType, TDatePrecision, TSelection } from '../bq-date-picker.types';\nimport { compareISO, isValidISO, sortRange } from './calendar';\n\n/* -------------------------------------------------------------------------- */\n/* Wire format parse/serialize */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Regex matching the wire-format ISO shape for each precision.\n * The internal selection is always `YYYY-MM-DD`; these only apply at the\n * public value boundary.\n */\nconst PRECISION_ISO_REGEX: Record<TDatePrecision, RegExp> = {\n day: /^\\d{4}-\\d{2}-\\d{2}$/,\n month: /^\\d{4}-\\d{2}$/,\n year: /^\\d{4}$/,\n};\n\n/** Expand a wire-format token to a full `YYYY-MM-DD` ISO date. */\nconst expandToken = (token: string, precision: TDatePrecision): string => {\n if (precision === 'month') return `${token}-01`;\n if (precision === 'year') return `${token}-01-01`;\n return token;\n};\n\n/** Truncate a full `YYYY-MM-DD` ISO date to the wire-format for the precision. */\nconst truncateISO = (iso: string, precision: TDatePrecision): string => {\n if (precision === 'month') return iso.slice(0, 7);\n if (precision === 'year') return iso.slice(0, 4);\n return iso;\n};\n\n/**\n * Whether the token matches the precision-specific shape *and* is a real date.\n * For month/year we still expand to a full ISO date so `2026-13` / `2026-02-30`\n * style errors are caught by `isValidISO`.\n */\nconst isValidToken = (token: string, precision: TDatePrecision): boolean => {\n if (!PRECISION_ISO_REGEX[precision].test(token)) return false;\n return isValidISO(expandToken(token, precision));\n};\n\n/**\n * Parse a raw `value` string into an internal `TSelection` array.\n *\n * Wire format:\n * - single: `YYYY-MM-DD` (or `YYYY-MM` / `YYYY` at coarser precision)\n * - multi: space-separated tokens\n * - range: `<start>/<end>`\n *\n * Internally the selection is always stored as full `YYYY-MM-DD` — month\n * precision expands to the first day of the month; year precision to Jan 1st.\n *\n * Invalid tokens (malformed strings, impossible dates like `2026-99-99`,\n * non-ISO input) are silently discarded — the returned selection is\n * guaranteed to contain only valid ISO-8601 dates.\n */\nexport const parseValue = (\n value: string | undefined | null,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): TSelection => {\n if (!value) return [];\n const trimmed = value.trim();\n if (!trimmed) return [];\n\n if (type === 'range') {\n const parts = trimmed\n .split('/')\n .filter((token) => isValidToken(token, precision))\n .map((token) => expandToken(token, precision));\n if (parts.length === 0) return [];\n if (parts.length === 1) return [parts[0]];\n const [start, end] = sortRange(parts[0], parts[1]);\n return [start, end];\n }\n\n if (type === 'multi') {\n const valid = trimmed\n .split(/\\s+/)\n .filter((token) => isValidToken(token, precision))\n .map((token) => expandToken(token, precision));\n return Array.from(new Set(valid)).sort(compareISO);\n }\n\n return isValidToken(trimmed, precision) ? [expandToken(trimmed, precision)] : [];\n};\n\n/**\n * Serialize an internal `TSelection` array back to the wire format.\n * Truncates each entry to the precision's ISO shape.\n */\nexport const serializeValue = (\n selection: TSelection,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): string => {\n if (!selection.length) return '';\n const format = (iso: string) => truncateISO(iso, precision);\n\n if (type === 'range') {\n if (selection.length < 2) return format(selection[0] ?? '');\n const [start, end] = sortRange(selection[0], selection[1]);\n return `${format(start)}/${format(end)}`;\n }\n\n if (type === 'multi') {\n return Array.from(new Set(selection.map(format)))\n .sort(compareISO)\n .join(' ');\n }\n\n return format(selection[0]);\n};\n\n/* -------------------------------------------------------------------------- */\n/* Predicates */\n/* -------------------------------------------------------------------------- */\n\n/** Whether the given ISO day is included in the selection. */\nexport const isSelected = (iso: string, selection: TSelection, type: TDatePickerType): boolean => {\n if (!selection.length) return false;\n if (type === 'range') {\n if (selection.length < 2) return iso === selection[0];\n const [start, end] = selection;\n return iso >= start && iso <= end;\n }\n return selection.includes(iso);\n};\n\n/** Whether the ISO day is the start of a range selection. */\nexport const isRangeStart = (iso: string, selection: TSelection, type: TDatePickerType): boolean =>\n type === 'range' && selection.length === 2 && iso === selection[0];\n\n/** Whether the ISO day is the end of a range selection. */\nexport const isRangeEnd = (iso: string, selection: TSelection, type: TDatePickerType): boolean =>\n type === 'range' && selection.length === 2 && iso === selection[1];\n\n/** Whether the ISO day sits strictly inside the range (not start/end). */\nexport const isRangeInner = (iso: string, selection: TSelection, type: TDatePickerType): boolean => {\n if (type !== 'range' || selection.length < 2) return false;\n const [start, end] = selection;\n return iso > start && iso < end;\n};\n\n/* -------------------------------------------------------------------------- */\n/* Selection ops */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Apply a click on `iso` and return the next selection.\n *\n * - single: always replace.\n * - multi: toggle (add if missing, remove if present).\n * - range: if there is no start OR a full range exists, start a new range;\n * otherwise complete the range (auto-sorted).\n */\nexport const applySelection = (iso: string, selection: TSelection, type: TDatePickerType): TSelection => {\n if (type === 'single') return [iso];\n\n if (type === 'multi') {\n return selection.includes(iso) ? selection.filter((v) => v !== iso) : [...selection, iso].sort(compareISO);\n }\n\n // range\n if (selection.length === 0 || selection.length === 2) return [iso];\n const [start, end] = sortRange(selection[0], iso);\n return [start, end];\n};\n\n/**\n * Build the highlighted range while the user is hovering with an in-progress\n * range selection (`tentative` = the pending start).\n */\nexport const buildTentativeRange = (tentative: string | undefined, hovered: string | undefined): TSelection => {\n if (!tentative || !hovered) return [];\n const [start, end] = sortRange(tentative, hovered);\n return [start, end];\n};\n","import { type FunctionalComponent, h } from '@stencil/core';\n\nimport type { TDatePickerType, TSelection } from '../bq-date-picker.types';\nimport { buildMonthMatrix, isSameDay, isWithinBounds, type TCalendarCell } from '../helper/calendar';\nimport { CALENDAR_PARTS } from '../helper/constants';\nimport { formatMonth, getWeekdayNames } from '../helper/intl';\nimport { isRangeEnd, isRangeInner, isRangeStart, isSelected } from '../helper/selection';\n\ntype TCellState = {\n outside: boolean;\n disallowed: boolean;\n outOfBounds: boolean;\n disabled: boolean;\n selected: boolean;\n rangeStart: boolean;\n rangeEnd: boolean;\n rangeInner: boolean;\n isToday: boolean;\n isFocused: boolean;\n buttonHidden: boolean;\n};\n\nconst buildCellPartList = (state: TCellState): string => {\n const parts: string[] = [CALENDAR_PARTS.day];\n if (state.selected) parts.push(CALENDAR_PARTS.selected);\n if (state.isToday) parts.push(CALENDAR_PARTS.today);\n if (state.outside) parts.push(CALENDAR_PARTS.outside);\n if (state.disallowed) parts.push(CALENDAR_PARTS.disallowed);\n if (state.outOfBounds) parts.push(CALENDAR_PARTS.disabled);\n if (state.rangeStart) parts.push(CALENDAR_PARTS.rangeStart);\n if (state.rangeEnd) parts.push(CALENDAR_PARTS.rangeEnd);\n if (state.rangeInner) parts.push(CALENDAR_PARTS.rangeInner);\n return parts.join(' ');\n};\n\ntype TCellContext = {\n effectiveSelection: TSelection;\n type: TDatePickerType;\n today: Date;\n focusedISO: string;\n minISO?: string;\n maxISO?: string;\n isDateDisallowed?: (date: Date) => boolean;\n showOutsideDays: boolean;\n};\n\nconst computeCellState = (cell: TCalendarCell, ctx: TCellContext): TCellState => {\n const disallowed = ctx.isDateDisallowed?.(cell.date) ?? false;\n const outOfBounds = !isWithinBounds(cell.date, ctx.minISO, ctx.maxISO);\n return {\n outside: cell.outside,\n disallowed,\n outOfBounds,\n disabled: disallowed || outOfBounds,\n selected: isSelected(cell.iso, ctx.effectiveSelection, ctx.type),\n rangeStart: isRangeStart(cell.iso, ctx.effectiveSelection, ctx.type),\n rangeEnd: isRangeEnd(cell.iso, ctx.effectiveSelection, ctx.type),\n rangeInner: isRangeInner(cell.iso, ctx.effectiveSelection, ctx.type),\n isToday: isSameDay(cell.date, ctx.today),\n isFocused: cell.iso === ctx.focusedISO,\n buttonHidden: cell.outside && !ctx.showOutsideDays,\n };\n};\n\ntype TCellCallbacks = {\n onDaySelect: (iso: string, ev: MouseEvent) => void;\n onDayHover: (iso: string | undefined) => void;\n onDayFocus: (iso: string) => void;\n};\n\nconst renderCell = (cell: TCalendarCell, state: TCellState, cb: TCellCallbacks) => (\n <td\n key={cell.iso}\n aria-selected={state.selected ? 'true' : undefined}\n class=\"bq-date-picker__td\"\n part={CALENDAR_PARTS.td}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: WAI-ARIA date-picker grid pattern.\n role=\"gridcell\"\n tabIndex={-1}\n >\n <button\n aria-current={state.isToday ? 'date' : undefined}\n aria-disabled={state.disabled ? 'true' : undefined}\n class={{\n 'bq-date-picker__day': true,\n 'is-selected': state.selected,\n 'is-today': state.isToday,\n 'is-outside': state.outside,\n 'is-disallowed': state.disallowed,\n 'is-out-of-bounds': state.outOfBounds,\n 'is-range-start': state.rangeStart,\n 'is-range-end': state.rangeEnd,\n 'is-range-inner': state.rangeInner,\n 'is-hidden': state.buttonHidden,\n }}\n data-iso={cell.iso}\n onClick={(ev) => !state.disabled && cb.onDaySelect(cell.iso, ev)}\n onFocus={() => cb.onDayFocus(cell.iso)}\n onMouseEnter={() => cb.onDayHover(cell.iso)}\n onMouseLeave={() => cb.onDayHover(undefined)}\n part={`${CALENDAR_PARTS.button} ${buildCellPartList(state)}`}\n tabIndex={state.isFocused ? 0 : -1}\n type=\"button\"\n >\n {cell.date.getDate()}\n </button>\n </td>\n);\n\nexport type TCalendarDayViewProps = {\n /** Anchor date for the month grid (any date within the month). */\n viewDate: Date;\n /** Current selection (parsed). */\n selection: TSelection;\n /** In-progress range selection (start pending or hovered end). */\n tentativeRange: TSelection;\n /** Focused date ISO (roving tabindex target). */\n focusedISO: string;\n /** Selection type. */\n type: TDatePickerType;\n /** Locale. */\n locale: Intl.LocalesArgument;\n /** First day of the week. */\n firstDayOfWeek: number;\n /** Whether to render outside-month days. */\n showOutsideDays: boolean;\n /** Optional min ISO. */\n minISO?: string;\n /** Optional max ISO. */\n maxISO?: string;\n /** Optional guard for disallowed days. */\n isDateDisallowed?: (date: Date) => boolean;\n /** Callback fired when a day is picked. */\n onDaySelect: (iso: string, ev: MouseEvent | KeyboardEvent) => void;\n /** Callback fired when the pointer hovers a day (used for range preview). */\n onDayHover: (iso: string | undefined) => void;\n /** Callback fired when a day receives focus. */\n onDayFocus: (iso: string) => void;\n /** Optional handler for keyboard nav bubbling up (Arrow, Home, End...). */\n onGridKeyDown: (ev: KeyboardEvent) => void;\n};\n\n/**\n * Day-level calendar view — weekday row + 6x7 grid.\n *\n * The grid is a `<table role=\"grid\">` so it is announced correctly by screen\n * readers, and it uses a roving tabindex so only the \"focused\" day is in the\n * tab order. Keyboard nav is delegated to the host via `onGridKeyDown`.\n */\nexport const CalendarDayView: FunctionalComponent<TCalendarDayViewProps> = (props) => {\n const {\n viewDate,\n selection,\n tentativeRange,\n focusedISO,\n type,\n locale,\n firstDayOfWeek,\n showOutsideDays,\n minISO,\n maxISO,\n isDateDisallowed,\n onDaySelect,\n onDayHover,\n onDayFocus,\n onGridKeyDown,\n } = props;\n\n const weekdays = getWeekdayNames(locale, firstDayOfWeek, 'short');\n const rows = buildMonthMatrix(viewDate, firstDayOfWeek);\n const today = new Date();\n\n // Localized \"Month Year\" label used to name the grid for screen readers,\n // e.g. \"July 2026\". Always computed so the grid is named even when the\n // visible heading is rendered outside this component.\n const gridLabel = formatMonth(viewDate, locale, 'long', true);\n\n // The effective selection includes the tentative range so hover states\n // preview correctly during range selection.\n const effectiveSelection: TSelection = type === 'range' && tentativeRange.length === 2 ? tentativeRange : selection;\n\n return (\n <div class=\"bq-date-picker__day-view\">\n <table\n aria-label={gridLabel}\n class=\"bq-date-picker__table\"\n onKeyDown={onGridKeyDown}\n part={CALENDAR_PARTS.table}\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: WAI-ARIA date-picker grid pattern.\n role=\"grid\"\n >\n <thead part={CALENDAR_PARTS.head}>\n <tr part={CALENDAR_PARTS.tr}>\n {weekdays.map((wd) => (\n <th key={wd.long} abbr={wd.long} class=\"bq-date-picker__th\" part={CALENDAR_PARTS.th} scope=\"col\">\n {wd.short}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {rows.map((row) => (\n <tr key={row[0].iso} class=\"bq-date-picker__week\" part={`${CALENDAR_PARTS.tr} ${CALENDAR_PARTS.week}`}>\n {row.map((cell) => {\n const state = computeCellState(cell, {\n effectiveSelection,\n type,\n today,\n focusedISO,\n minISO,\n maxISO,\n isDateDisallowed,\n showOutsideDays,\n });\n return renderCell(cell, state, { onDaySelect, onDayHover, onDayFocus });\n })}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n};\n","import { type FunctionalComponent, h } from '@stencil/core';\n\nimport type { TCalendarView } from '../bq-date-picker.types';\nimport { CALENDAR_PARTS } from '../helper/constants';\n\nexport type TCalendarHeaderProps = {\n /** Current view. Used to pick the correct aria label and title. */\n view: TCalendarView;\n /** Label rendered inside the title button (e.g. \"January 2026\", \"2026\", \"2016 – 2027\"). */\n label: string;\n /** Aria label for the previous button. */\n previousLabel: string;\n /** Aria label for the next button. */\n nextLabel: string;\n /** Aria label for the title button. */\n titleLabel: string;\n /** Whether the previous button is disabled. */\n previousDisabled?: boolean;\n /** Whether the next button is disabled. */\n nextDisabled?: boolean;\n /** Whether the title button is interactive. `false` when already on the years view. */\n titleInteractive?: boolean;\n /** Callback fired when the previous button is activated. */\n onPrevious: (ev: Event) => void;\n /** Callback fired when the next button is activated. */\n onNext: (ev: Event) => void;\n /** Callback fired when the title button is activated. */\n onTitleClick: (ev: Event) => void;\n};\n\n/**\n * Calendar header — previous / title / next.\n *\n * The header is rendered once per calendar panel. It exposes the standard\n * `calendar__header`, `calendar__previous`, `calendar__heading`, and\n * `calendar__next` shadow parts so consumers can theme any button.\n */\nexport const CalendarHeader: FunctionalComponent<TCalendarHeaderProps> = ({\n view,\n label,\n previousLabel,\n nextLabel,\n titleLabel,\n previousDisabled = false,\n nextDisabled = false,\n titleInteractive = true,\n onPrevious,\n onNext,\n onTitleClick,\n}) => (\n <div class=\"bq-date-picker__header\" part={CALENDAR_PARTS.header}>\n <bq-button\n appearance=\"text\"\n border=\"s\"\n class=\"bq-date-picker__nav-button\"\n disabled={previousDisabled}\n label={previousLabel}\n onlyIcon\n onBqClick={onPrevious}\n part={`${CALENDAR_PARTS.button} ${CALENDAR_PARTS.previous}`}\n size=\"small\"\n type=\"button\"\n >\n <bq-icon aria-hidden=\"true\" class=\"bq-date-picker__nav-icon\" name=\"caret-left\" />\n </bq-button>\n\n <bq-button\n appearance=\"text\"\n aria-live=\"polite\"\n border=\"s\"\n class={{\n 'bq-date-picker__heading': true,\n 'bq-date-picker__heading--static': !titleInteractive,\n }}\n data-view={view}\n disabled={!titleInteractive}\n label={titleLabel}\n onBqClick={onTitleClick}\n part={CALENDAR_PARTS.heading}\n size=\"small\"\n type=\"button\"\n block\n >\n {label}\n </bq-button>\n\n <bq-button\n appearance=\"text\"\n border=\"s\"\n class=\"bq-date-picker__nav-button\"\n disabled={nextDisabled}\n label={nextLabel}\n onlyIcon\n onBqClick={onNext}\n part={`${CALENDAR_PARTS.button} ${CALENDAR_PARTS.next}`}\n size=\"small\"\n type=\"button\"\n >\n <bq-icon aria-hidden=\"true\" class=\"bq-date-picker__nav-icon\" name=\"caret-right\" />\n </bq-button>\n </div>\n);\n","import { type FunctionalComponent, h } from '@stencil/core';\n\nimport type { TDatePickerType, TSelection } from '../bq-date-picker.types';\nimport { isMonthWithinBounds } from '../helper/bounds';\nimport { CALENDAR_PARTS } from '../helper/constants';\nimport { getMonthNames } from '../helper/intl';\nimport { isRangeEnd, isRangeInner, isRangeStart, isSelected } from '../helper/selection';\n\nexport type TCalendarMonthViewProps = {\n /** Year currently shown in the header. */\n year: number;\n /** Focused month (0-based), used for the roving tabindex. */\n focusedMonth: number;\n /** Locale used for localized month names. */\n locale: Intl.LocalesArgument;\n /** Min year/month to keep enabled. */\n minISO?: string;\n /** Max year/month to keep enabled. */\n maxISO?: string;\n /** Current selection (as stored internally: array of YYYY-MM-DD). */\n selection: TSelection;\n /** In-progress range preview while hovering a second endpoint. */\n tentativeRange: TSelection;\n /** Selection type — drives multi / range highlighting. */\n type: TDatePickerType;\n /** Callback fired when the user picks a month. */\n onMonthSelect: (month: number, ev: MouseEvent | KeyboardEvent) => void;\n /** Callback fired when a month button receives focus. */\n onMonthFocus: (month: number) => void;\n /** Callback fired when hovering a month cell (range preview). */\n onMonthHover: (iso: string | undefined) => void;\n /** Optional keydown handler for the grid (roving tabindex management). */\n onGridKeyDown: (ev: KeyboardEvent) => void;\n /** Number of columns rendered by the month grid. */\n gridColumns: number;\n};\n\n/** ISO used to compare a month cell against the internal selection. */\nconst monthCellISO = (year: number, month: number): string => `${year}-${String(month + 1).padStart(2, '0')}-01`;\n\ntype TMonthCellState = {\n iso: string;\n disabled: boolean;\n selected: boolean;\n rangeStart: boolean;\n rangeEnd: boolean;\n rangeInner: boolean;\n isFocused: boolean;\n};\n\nconst buildMonthParts = (state: TMonthCellState): string => {\n const parts: string[] = [CALENDAR_PARTS.month];\n if (state.selected) parts.push(CALENDAR_PARTS.monthSelected);\n if (state.rangeStart) parts.push(CALENDAR_PARTS.rangeStart);\n if (state.rangeEnd) parts.push(CALENDAR_PARTS.rangeEnd);\n if (state.rangeInner) parts.push(CALENDAR_PARTS.rangeInner);\n if (state.disabled) parts.push(CALENDAR_PARTS.disabled);\n return parts.join(' ');\n};\n\nconst buildMonthCellState = (\n year: number,\n month: number,\n focusedMonth: number,\n minISO: string | undefined,\n maxISO: string | undefined,\n selection: TSelection,\n type: TDatePickerType,\n): TMonthCellState => {\n const iso = monthCellISO(year, month);\n const disabled = !isMonthWithinBounds(year, month, minISO, maxISO);\n return {\n iso,\n disabled,\n selected: isSelected(iso, selection, type),\n rangeStart: isRangeStart(iso, selection, type),\n rangeEnd: isRangeEnd(iso, selection, type),\n rangeInner: isRangeInner(iso, selection, type),\n isFocused: focusedMonth === month,\n };\n};\n\ntype TRenderMonthCellArgs = {\n month: number;\n name: string;\n state: TMonthCellState;\n onMonthSelect: (month: number, ev: MouseEvent | KeyboardEvent) => void;\n onMonthFocus: (month: number) => void;\n onMonthHover: (iso: string | undefined) => void;\n};\n\nconst chunkMonths = (months: string[], columns: number): Array<Array<{ month: number; name: string }>> => {\n const rows: Array<Array<{ month: number; name: string }>> = [];\n for (let month = 0; month < months.length; month += columns) {\n rows.push(months.slice(month, month + columns).map((name, offset) => ({ month: month + offset, name })));\n }\n return rows;\n};\n\nconst renderMonthCell = ({ month, name, state, onMonthSelect, onMonthFocus, onMonthHover }: TRenderMonthCellArgs) => (\n // biome-ignore lint/a11y/useFocusableInteractive: gridcell is a structural ARIA container; focus is managed by the child <button> via roving tabindex\n <div\n aria-selected={state.selected ? 'true' : undefined}\n class=\"bq-date-picker__month-gridcell\"\n role=\"gridcell\"\n key={month}\n >\n <button\n aria-disabled={state.disabled ? 'true' : undefined}\n class={{\n 'bq-date-picker__month-cell': true,\n 'is-selected': state.selected,\n 'is-range-start': state.rangeStart,\n 'is-range-end': state.rangeEnd,\n 'is-range-inner': state.rangeInner,\n 'is-out-of-bounds': state.disabled,\n }}\n data-month={month}\n disabled={state.disabled}\n onClick={(ev) => !state.disabled && onMonthSelect(month, ev)}\n onFocus={() => onMonthFocus(month)}\n onMouseEnter={() => onMonthHover(state.iso)}\n onMouseLeave={() => onMonthHover(undefined)}\n part={`${CALENDAR_PARTS.button} ${buildMonthParts(state)}`}\n tabIndex={state.isFocused ? 0 : -1}\n type=\"button\"\n >\n {name}\n </button>\n </div>\n);\n\n/**\n * Month picker — 12 buttons in a 3×4 grid.\n */\nexport const CalendarMonthView: FunctionalComponent<TCalendarMonthViewProps> = ({\n year,\n focusedMonth,\n locale,\n minISO,\n maxISO,\n selection,\n tentativeRange,\n type,\n onMonthSelect,\n onMonthFocus,\n onMonthHover,\n onGridKeyDown,\n gridColumns,\n}) => {\n const months = getMonthNames(locale, 'short');\n const effectiveSelection: TSelection = type === 'range' && tentativeRange.length === 2 ? tentativeRange : selection;\n const rows = chunkMonths(months, gridColumns);\n\n return (\n <div\n class=\"bq-date-picker__months\"\n data-grid-columns={String(gridColumns)}\n onKeyDown={onGridKeyDown}\n part={CALENDAR_PARTS.months}\n role=\"grid\"\n tabIndex={-1}\n >\n {rows.map((row) => (\n // biome-ignore lint/a11y/useFocusableInteractive: gridcell is a structural ARIA container; focus is managed by the child <button> via roving tabindex\n <div class=\"bq-date-picker__month-row\" role=\"row\" key={`month-row-${row.map(({ month }) => month).join('-')}`}>\n {row.map(({ month, name }) => {\n const state = buildMonthCellState(year, month, focusedMonth, minISO, maxISO, effectiveSelection, type);\n return renderMonthCell({ month, name, state, onMonthSelect, onMonthFocus, onMonthHover });\n })}\n </div>\n ))}\n </div>\n );\n};\n","import { type FunctionalComponent, h } from '@stencil/core';\n\nimport type { TDatePickerType, TSelection } from '../bq-date-picker.types';\nimport { isYearWithinBounds } from '../helper/bounds';\nimport { CALENDAR_PARTS } from '../helper/constants';\nimport { isRangeEnd, isRangeInner, isRangeStart, isSelected } from '../helper/selection';\n\nexport type TCalendarYearViewProps = {\n /** Years to render (typically 12). */\n years: number[];\n /** Focused year (roving tabindex target). */\n focusedYear: number;\n /** Optional min bound (any precision — `YYYY`, `YYYY-MM`, `YYYY-MM-DD`). */\n minISO?: string;\n /** Optional max bound (any precision). */\n maxISO?: string;\n /** Current selection (as stored internally: array of YYYY-MM-DD). */\n selection: TSelection;\n /** In-progress range preview while hovering a second endpoint. */\n tentativeRange: TSelection;\n /** Selection type — drives multi / range highlighting. */\n type: TDatePickerType;\n /** Callback fired when the user picks a year. */\n onYearSelect: (year: number, ev: MouseEvent | KeyboardEvent) => void;\n /** Callback fired when a year button receives focus. */\n onYearFocus: (year: number) => void;\n /** Callback fired when hovering a year cell (range preview). */\n onYearHover: (iso: string | undefined) => void;\n /** Optional keydown handler for the grid (roving tabindex management). */\n onGridKeyDown: (ev: KeyboardEvent) => void;\n /** Number of columns rendered by the year grid. */\n gridColumns: number;\n};\n\n/** ISO used to compare a year cell against the internal selection. */\nconst yearCellISO = (year: number): string => `${year}-01-01`;\n\ntype TYearCellState = {\n iso: string;\n disabled: boolean;\n selected: boolean;\n rangeStart: boolean;\n rangeEnd: boolean;\n rangeInner: boolean;\n isFocused: boolean;\n};\n\nconst buildYearParts = (state: TYearCellState): string => {\n const parts: string[] = [CALENDAR_PARTS.year];\n if (state.selected) parts.push(CALENDAR_PARTS.yearSelected);\n if (state.rangeStart) parts.push(CALENDAR_PARTS.rangeStart);\n if (state.rangeEnd) parts.push(CALENDAR_PARTS.rangeEnd);\n if (state.rangeInner) parts.push(CALENDAR_PARTS.rangeInner);\n if (state.disabled) parts.push(CALENDAR_PARTS.disabled);\n return parts.join(' ');\n};\n\nconst buildYearCellState = (\n year: number,\n focusedYear: number,\n minISO: string | undefined,\n maxISO: string | undefined,\n selection: TSelection,\n type: TDatePickerType,\n): TYearCellState => {\n const iso = yearCellISO(year);\n const disabled = !isYearWithinBounds(year, minISO, maxISO);\n return {\n iso,\n disabled,\n selected: isSelected(iso, selection, type),\n rangeStart: isRangeStart(iso, selection, type),\n rangeEnd: isRangeEnd(iso, selection, type),\n rangeInner: isRangeInner(iso, selection, type),\n isFocused: focusedYear === year,\n };\n};\n\ntype TRenderYearCellArgs = {\n year: number;\n state: TYearCellState;\n onYearSelect: (year: number, ev: MouseEvent | KeyboardEvent) => void;\n onYearFocus: (year: number) => void;\n onYearHover: (iso: string | undefined) => void;\n};\n\nconst chunkYears = (years: number[], columns: number): number[][] => {\n const rows: number[][] = [];\n for (let index = 0; index < years.length; index += columns) {\n rows.push(years.slice(index, index + columns));\n }\n return rows;\n};\n\nconst renderYearCell = ({ year, state, onYearSelect, onYearFocus, onYearHover }: TRenderYearCellArgs) => (\n // biome-ignore lint/a11y/useFocusableInteractive: gridcell is a structural ARIA container; focus is managed by the child <button> via roving tabindex\n <div\n aria-selected={state.selected ? 'true' : undefined}\n class=\"bq-date-picker__year-gridcell\"\n key={year}\n role=\"gridcell\"\n >\n <button\n aria-disabled={state.disabled ? 'true' : undefined}\n class={{\n 'bq-date-picker__year-cell': true,\n 'is-selected': state.selected,\n 'is-range-start': state.rangeStart,\n 'is-range-end': state.rangeEnd,\n 'is-range-inner': state.rangeInner,\n 'is-out-of-bounds': state.disabled,\n }}\n data-year={year}\n disabled={state.disabled}\n onClick={(ev) => !state.disabled && onYearSelect(year, ev)}\n onFocus={() => onYearFocus(year)}\n onMouseEnter={() => onYearHover(state.iso)}\n onMouseLeave={() => onYearHover(undefined)}\n part={`${CALENDAR_PARTS.button} ${buildYearParts(state)}`}\n tabIndex={state.isFocused ? 0 : -1}\n type=\"button\"\n >\n {year}\n </button>\n </div>\n);\n\n/**\n * Year picker — 12 buttons for a decade grid.\n */\nexport const CalendarYearView: FunctionalComponent<TCalendarYearViewProps> = ({\n years,\n focusedYear,\n minISO,\n maxISO,\n selection,\n tentativeRange,\n type,\n onYearSelect,\n onYearFocus,\n onYearHover,\n onGridKeyDown,\n gridColumns,\n}) => {\n const effectiveSelection: TSelection = type === 'range' && tentativeRange.length === 2 ? tentativeRange : selection;\n const rows = chunkYears(years, gridColumns);\n\n return (\n <div\n class=\"bq-date-picker__years\"\n data-grid-columns={String(gridColumns)}\n onKeyDown={onGridKeyDown}\n part={CALENDAR_PARTS.years}\n role=\"grid\"\n tabIndex={-1}\n >\n {rows.map((row) => (\n // biome-ignore lint/a11y/useFocusableInteractive: gridcell is a structural ARIA container; focus is managed by the child <button> via roving tabindex\n <div class=\"bq-date-picker__year-row\" key={`year-row-${row.join('-')}`} role=\"row\">\n {row.map((year) => {\n const state = buildYearCellState(year, focusedYear, minISO, maxISO, effectiveSelection, type);\n return renderYearCell({ year, state, onYearSelect, onYearFocus, onYearHover });\n })}\n </div>\n ))}\n </div>\n );\n};\n","import { parseDateInput, toISODateString } from '../../../shared/utils/date/dateParsing';\nimport type { TDatePrecision } from '../bq-date-picker.types';\nimport { padBound } from './bounds';\nimport { serializeValue } from './selection';\n\n/**\n * Result of parsing user-typed input.\n * - `value` is set when parsing succeeded — always at the configured precision.\n * - `invalid: true` when the string could not be parsed or `isDateDisallowed`\n * rejected the result.\n */\nexport type TParsedInput = {\n value?: string;\n invalid?: boolean;\n};\n\n/**\n * Precision-aware, bounds-aware parser for the trigger input field.\n * Returns the parsed date as a wire-format string at the configured\n * precision, clamped against `min`/`max`, or `{ invalid: true }` on failure.\n */\nexport const parseTypedInput = (\n text: string,\n locale: Intl.LocalesArgument,\n precision: TDatePrecision,\n min?: string,\n max?: string,\n isDateDisallowed?: (date: Date) => boolean,\n): TParsedInput => {\n const trimmed = text.trim();\n if (!trimmed) return { value: undefined };\n\n const parsed = parseDateInput(trimmed, locale);\n if (!parsed || isDateDisallowed?.(parsed)) return { invalid: true };\n\n const iso = clampISO(toISODateString(parsed), min, max);\n return { value: serializeValue([iso], 'single', precision) };\n};\n\n/**\n * Lexically clamp a full `YYYY-MM-DD` ISO date to precision-padded bounds.\n * Coarser bounds (`YYYY`, `YYYY-MM`) are padded to the widest matching day\n * before comparing.\n */\nexport const clampISO = (iso: string, min?: string, max?: string): string => {\n const paddedMin = padBound(min, 'min');\n const paddedMax = padBound(max, 'max');\n if (paddedMin && iso < paddedMin) return paddedMin;\n if (paddedMax && iso > paddedMax) return paddedMax;\n return iso;\n};\n","import type { TCalendarView, TDatePrecision } from '../bq-date-picker.types';\nimport { addMonths, startOfMonth } from './calendar';\nimport { DECADE_GRID_SIZE, DEFAULT_ARIA_LABELS } from './constants';\nimport { formatMonth, formatYear } from './intl';\n\ninterface HeaderLabelArgs {\n view: TCalendarView;\n viewDate: Date;\n focusedYear: number;\n decadeStart: number;\n monthCount: number;\n locale: Intl.LocalesArgument;\n}\n\n/**\n * Builds the label shown in the calendar header title button.\n *\n * - `days`: localized \"Month Year\" for a single panel, or \"StartYear – EndYear\"\n * when several months are visible at once.\n * - `months`: the localized year currently in focus.\n * - `years`: the closed range spanning the visible decade.\n */\nexport const getHeaderLabel = ({\n view,\n viewDate,\n focusedYear,\n decadeStart,\n monthCount,\n locale,\n}: HeaderLabelArgs): string => {\n if (view === 'days') {\n if (monthCount > 1) {\n const first = startOfMonth(viewDate);\n const last = startOfMonth(addMonths(viewDate, monthCount - 1));\n const startYear = formatYear(first, locale);\n const endYear = formatYear(last, locale);\n return startYear === endYear ? startYear : `${startYear} – ${endYear}`;\n }\n return formatMonth(viewDate, locale, 'long', true);\n }\n if (view === 'months') {\n return formatYear(new Date(focusedYear, 0, 1), locale);\n }\n const end = decadeStart + DECADE_GRID_SIZE - 1;\n return `${decadeStart} – ${end}`;\n};\n\n/**\n * Aria label announcing what clicking the title switches to.\n * Views cycle days → months → years → back to the base view (days for\n * `precision=\"day\"`, months for `precision=\"month\"`).\n */\nexport const getHeaderTitleLabel = (view: TCalendarView, precision: TDatePrecision = 'day'): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.chooseMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.chooseYear;\n return precision === 'month' ? DEFAULT_ARIA_LABELS.chooseMonth : DEFAULT_ARIA_LABELS.chooseDate;\n};\n\n/** Aria label for the \"previous\" navigation button, per view. */\nexport const getPreviousLabel = (view: TCalendarView): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.previousMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.previousYear;\n return DEFAULT_ARIA_LABELS.previousDecade;\n};\n\n/** Aria label for the \"next\" navigation button, per view. */\nexport const getNextLabel = (view: TCalendarView): string => {\n if (view === 'days') return DEFAULT_ARIA_LABELS.nextMonth;\n if (view === 'months') return DEFAULT_ARIA_LABELS.nextYear;\n return DEFAULT_ARIA_LABELS.nextDecade;\n};\n","import { DECADE_GRID_SIZE } from './constants';\n\n/**\n * Advances a focused month cursor by `delta` months, carrying over to the\n * previous or next year as needed. Pure — accepts and returns primitives so\n * it can be unit-tested and reused by keyboard handlers.\n */\nexport const advanceFocusedMonth = (\n focusedMonth: number,\n focusedYear: number,\n delta: number,\n): { month: number; year: number } => {\n let month = focusedMonth + delta;\n let year = focusedYear;\n while (month < 0) {\n month += 12;\n year -= 1;\n }\n while (month > 11) {\n month -= 12;\n year += 1;\n }\n return { month, year };\n};\n\n/**\n * Advances a focused year cursor by `delta` years, sliding the visible\n * decade grid so the focused year always stays in view.\n */\nexport const advanceFocusedYear = (\n focusedYear: number,\n decadeStart: number,\n delta: number,\n): { year: number; decadeStart: number } => {\n const year = focusedYear + delta;\n let nextDecadeStart = decadeStart;\n if (year < decadeStart) {\n nextDecadeStart = decadeStart - DECADE_GRID_SIZE;\n } else if (year > decadeStart + DECADE_GRID_SIZE - 1) {\n nextDecadeStart = decadeStart + DECADE_GRID_SIZE;\n }\n return { year, decadeStart: nextDecadeStart };\n};\n\n/**\n * Number of columns used to render the months/years grids. The grids widen\n * from 3 → 4 columns when multiple months are visible, so vertical arrow\n * navigation stride must match.\n */\nexport const getGridColumns = (monthCount: number): number => (monthCount > 1 ? 4 : 3);\n","import { formatDisplayValue, isDefined } from '../../../shared/utils';\nimport type { TDatePickerType, TDatePrecision } from '../bq-date-picker.types';\nimport { parseValue, serializeValue } from './selection';\n\n/**\n * Normalizes a raw public `value` string against the current picker `type`\n * and `precision`.\n *\n * Runs the value through `parseValue`/`serializeValue` so any invalid ISO\n * tokens are dropped before the value ever reaches the form, the display\n * input, or the visible selection. Returns `undefined` when normalization\n * leaves an empty string, so callers can distinguish \"no value\" from \"empty\n * string value\".\n */\nexport const normalizeValue = (\n raw: string | undefined,\n type: TDatePickerType,\n precision: TDatePrecision = 'day',\n): string | undefined => {\n const serialized = serializeValue(parseValue(raw, type, precision), type, precision);\n return serialized === '' ? undefined : serialized;\n};\n\n/** Whether a value string is present and non-empty — used to drive UI affordances. */\nexport const computeHasValue = (value: string | undefined): boolean => isDefined(value) && `${value}`.length > 0;\n\n/**\n * Formats the current value for display in the trigger input. Thin wrapper\n * around `formatDisplayValue` that accepts `undefined` and coerces to an\n * empty string, so callers don't have to repeat the null check.\n *\n * Precision-agnostic: internally the selection is stored as full ISO dates\n * (the first day of the month / January 1st for coarser precisions), so\n * `Intl.DateTimeFormat(locale, formatOptions)` produces the right label\n * whether the user asked for `{ year: 'numeric' }` or `{ dateStyle: 'full' }`.\n */\nexport const computeDisplayDate = (\n value: string | undefined,\n type: TDatePickerType,\n locale: Intl.LocalesArgument,\n formatOptions: Intl.DateTimeFormatOptions,\n precision: TDatePrecision = 'day',\n): string | undefined => {\n // Expand precision-truncated wire values back to full ISO so\n // `formatDisplayValue` (which expects YYYY-MM-DD) can parse them.\n const expanded = serializeValue(parseValue(value ?? '', type, precision), type, 'day');\n return formatDisplayValue(expanded, type, locale, formatOptions);\n};\n\n/**\n * Default `Intl.DateTimeFormat` options per precision.\n * Applied when the consumer hasn't explicitly overridden `formatOptions`, so\n * a `precision=\"month\"` picker doesn't show \"1 May 2026\".\n */\nexport const DEFAULT_FORMAT_OPTIONS_BY_PRECISION: Record<TDatePrecision, Intl.DateTimeFormatOptions> = {\n day: { day: 'numeric', month: 'short', year: 'numeric' },\n month: { month: 'long', year: 'numeric' },\n year: { year: 'numeric' },\n};\n","/* -------------------------------------------------------------------------- */\n/* Date picker styles */\n/* Native SCSS — no Tailwind utilities. */\n/* -------------------------------------------------------------------------- */\n\n@import './bq-date-picker.variables';\n\n:host {\n display: block;\n inline-size: 100%;\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n}\n\n/* Hide the label / prefix wrappers when their slots have no content. */\n.bq-date-picker__label.is-hidden,\n.bq-date-picker__prefix.is-hidden {\n display: none;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Label */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__label {\n display: flex;\n align-items: center;\n gap: var(--bq-date-picker--gap);\n margin-block-end: var(--bq-date-picker--label-margin-bottom);\n color: var(--bq-date-picker--label-text-color);\n font-size: var(--bq-date-picker--label-text-size);\n}\n\n/* -------------------------------------------------------------------------- */\n/* Dropdown */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__dropdown {\n display: block;\n inline-size: 100%;\n\n &::part(panel) {\n --bq-panel--width: max-content;\n\n inline-size: max-content;\n max-inline-size: min(calc(100vw - 2rem), 100vw);\n padding: 1rem;\n block-size: auto;\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Input control */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__control {\n display: flex;\n align-items: center;\n inline-size: 100%;\n padding-block: var(--bq-date-picker--paddingY);\n padding-inline: var(--bq-date-picker--padding-start) var(--bq-date-picker--padding-end);\n border: var(--bq-date-picker--border-width) var(--bq-date-picker--border-style)\n var(--bq-date-picker--border-color);\n border-radius: var(--bq-date-picker--border-radius);\n background-color: var(--bq-date-picker--background-color);\n color: var(--bq-date-picker--text-color);\n font-size: var(--bq-date-picker--text-size);\n transition: border-color 150ms ease, box-shadow 150ms ease;\n user-select: none;\n\n // Hover (only when not disabled and not focused)\n &:not(.is-disabled, :focus-within, .is-open):hover {\n border-color: color-mix(\n in srgb,\n var(--bq-date-picker--border-color-focus),\n var(--bq-hover) 20%\n );\n }\n\n // Focus. Border becomes the solid focus color; the ring is drawn via\n // outline so it respects the focus token.\n &:not(.is-disabled):is(:focus-within, .is-open) {\n --bq-ring-width: 1px;\n --bq-ring-offset-width: 0;\n --bq-ring-color-focus: var(--bq-focus);\n\n border-color: var(--bq-focus);\n outline: var(--bq-ring-width) solid var(--bq-ring-color-focus);\n outline-offset: var(--bq-ring-offset-width);\n }\n\n &.is-disabled {\n cursor: not-allowed;\n opacity: 0.6;\n --bq-date-picker--border-color: var(--bq-date-picker--border-color-disabled);\n }\n}\n\n/* ------------------------------- Validation ------------------------------- */\n\n// Validation states rules:\n// - Idle: border = stroke-{state}\n// - Hover: border = color-mix(stroke-{state}, hover 20%) → border-hover-{state}\n// - Focus: border = color-mix(stroke-{state}, active 20%) → border-active-{state}\n// ring = stroke-{state}\n%dp-validation-state {\n --bq-date-picker--border-color: var(--bq-date-picker--validation-color);\n\n &:not(.is-disabled, :focus-within, .is-open):hover {\n border-color: color-mix(in srgb, var(--bq-date-picker--validation-color), var(--bq-hover) 20%);\n }\n\n &:not(.is-disabled):is(:focus-within, .is-open) {\n --bq-ring-color-focus: var(--bq-date-picker--validation-color);\n\n border-color: color-mix(in srgb, var(--bq-date-picker--validation-color), var(--bq-active) 20%);\n }\n}\n\n.bq-date-picker__control.validation-error {\n --bq-date-picker--validation-color: var(--bq-stroke--danger);\n\n @extend %dp-validation-state;\n}\n\n.bq-date-picker__control.validation-success {\n --bq-date-picker--validation-color: var(--bq-stroke--success);\n\n @extend %dp-validation-state;\n}\n\n.bq-date-picker__control.validation-warning {\n --bq-date-picker--validation-color: var(--bq-stroke--warning);\n\n @extend %dp-validation-state;\n}\n\n/* -------------------------------- Input ---------------------------------- */\n\n.bq-date-picker__input {\n flex: 1 1 auto;\n min-inline-size: 0;\n padding: 0;\n margin: 0;\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: inherit;\n\n &::placeholder {\n color: var(--bq-date-picker--text-placeholder-color);\n }\n\n &:focus,\n &:focus-visible {\n outline: none;\n }\n}\n\n/* -------------------------- Prefix --------------------------------------- */\n\n.bq-date-picker__prefix {\n display: inline-flex;\n align-items: center;\n color: var(--bq-date-picker--text-color);\n pointer-events: none;\n margin-inline-end: var(--bq-date-picker--gap);\n\n bq-icon {\n display: inline-flex;\n font-size: var(--bq-date-picker--icon-size);\n }\n}\n\n/* -------------------------------------------------------------------------- */\n/* Actions */\n/* -------------------------------------------------------------------------- */\n\n// Shared styles for the clear and calendar trigger buttons.\n// These buttons are rendered inside the control, so they need to be styled\n// to match the control's height and padding, and to remove their own borders.\n%dp-action-button {\n margin-inline-start: var(--bq-date-picker--gap);\n\n &::part(button) {\n --bq-ring-width: initial;\n --bq-ring-offset-width: initial;\n\n border: none;\n padding: 0;\n }\n\n bq-icon { display: flex; }\n}\n\n/* --------------------------- Clear button -------------------------------- */\n\n// The clear button is only rendered when the picker has a value:\n// it stays hidden until the control is hovered, focused,\n// or the calendar popup is open.\n.bq-date-picker__clear {\n @extend %dp-action-button;\n\n display: none;\n}\n\n.bq-date-picker__control:is(:hover, :focus-within, .is-open):not(.is-disabled)\n .bq-date-picker__clear {\n display: inline-flex;\n}\n\n/* ------------------------- Calendar trigger button ----------------------- */\n\n// The calendar trigger button is always rendered, but it is disabled when the picker is disabled.\n.bq-date-picker__calendar-trigger {\n @extend %dp-action-button;\n\n display: inline-flex;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Calendar */\n/* -------------------------------------------------------------------------- */\n\n.bq-date-picker__calendar {\n display: flex;\n flex-direction: column;\n gap: 0.75rem;\n min-inline-size: 17.5rem;\n color: var(--bq-date-picker--text-color);\n background-color: var(--bq-date-picker--background-color);\n}\n\n/* ------------------------------ Header ----------------------------------- */\n\n.bq-date-picker__header {\n display: grid;\n grid-template-columns: auto 1fr auto;\n align-items: center;\n gap: 0.25rem;\n}\n\n.bq-date-picker__nav-button::part(button) {\n inline-size: 2rem;\n block-size: 2rem;\n}\n\n.bq-date-picker__heading::part(button) {\n font-weight: 600;\n}\n\n.bq-date-picker__heading--static {\n pointer-events: none;\n}\n\n/* ------------------------------- Panels ---------------------------------- */\n\n.bq-date-picker__panels {\n display: flex;\n flex-flow: row wrap;\n gap: 1rem;\n align-items: flex-start;\n justify-content: center;\n}\n\n.bq-date-picker__panel {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n flex: 0 0 auto;\n}\n\n.bq-date-picker__month-label {\n text-align: center;\n font-weight: 600;\n color: var(--bq-date-picker--header-title-color);\n}\n\n// Multi-month panels stack vertically on narrow viewports.\n@media (width <= 40rem) {\n .bq-date-picker__panels {\n flex-direction: column;\n align-items: center;\n }\n}\n\n/* ------------------------------- Day grid -------------------------------- */\n\n.bq-date-picker__table {\n inline-size: 100%;\n border-collapse: collapse;\n border-spacing: 0;\n font-size: inherit;\n}\n\n.bq-date-picker__th {\n padding-block: 0.25rem;\n color: var(--bq-date-picker--text-placeholder-color);\n font-weight: 500;\n font-size: 0.75rem;\n text-align: center;\n text-transform: uppercase;\n}\n\n.bq-date-picker__td {\n padding: 0;\n padding-block: var(--bq-date-picker--row-gap);\n text-align: center;\n}\n\n.bq-date-picker__day {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: var(--bq-date-picker--day-size);\n block-size: var(--bq-date-picker--day-size);\n padding: 0;\n border: none;\n border-radius: var(--bq-date-picker--view-cell-radius);\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n transition: background-color 150ms ease, color 150ms ease;\n\n &:hover:not([aria-disabled=\"true\"], .is-selected) {\n background-color: var(--bq-date-picker--view-cell-background-hover);\n }\n\n &:focus-visible {\n outline: 2px solid var(--bq-date-picker--border-color-focus);\n outline-offset: -2px;\n }\n\n &[aria-disabled=\"true\"],\n &.is-out-of-bounds,\n &.is-disallowed {\n cursor: not-allowed;\n opacity: 0.35;\n }\n\n &.is-outside {\n color: var(--bq-date-picker--text-placeholder-color);\n }\n\n &.is-hidden {\n visibility: hidden;\n pointer-events: none;\n }\n\n &.is-today:not(.is-selected) {\n border: var(--bq-date-picker--currentDate-border-width) var(--bq-date-picker--border-style)\n var(--bq-date-picker--currentDate-border-color);\n }\n\n &.is-selected {\n background-color: var(--bq-date-picker--view-cell-background-selected);\n color: var(--bq-date-picker--view-cell-text-selected);\n\n &:hover:not([aria-disabled=\"true\"]) {\n background-color: var(--bq-date-picker--view-cell-background-selected);\n }\n }\n\n // Range highlighting\n &.is-range-inner {\n border-radius: 0;\n background-color: var(--bq-date-picker--range-inner-background-color);\n color: var(--bq-date-picker--text-color);\n }\n\n &.is-range-start {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n background-color: var(--bq-date-picker--range-background-color);\n color: var(--bq-date-picker--view-cell-text-selected);\n }\n\n &.is-range-end {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n background-color: var(--bq-date-picker--range-background-color);\n color: var(--bq-date-picker--view-cell-text-selected);\n }\n\n &.is-range-start.is-range-end {\n border-radius: var(--bq-date-picker--view-cell-radius);\n }\n}\n\n/* ------------------------- Month / Year grids ---------------------------- */\n\n.bq-date-picker__view {\n min-inline-size:\n calc(var(--bq-date-picker--panel-count, 1) * (var(--bq-date-picker--day-size) * 7) + max(0, var(--bq-date-picker--panel-count, 1) - 1) * 1rem);\n}\n\n.bq-date-picker__months,\n.bq-date-picker__years {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n padding-block: 0.5rem;\n}\n\n.bq-date-picker__month-row,\n.bq-date-picker__year-row {\n display: grid;\n gap: 0.5rem;\n grid-template-columns: repeat(3, 1fr);\n}\n\n.bq-date-picker__months[data-grid-columns='4'] .bq-date-picker__month-row,\n.bq-date-picker__years[data-grid-columns='4'] .bq-date-picker__year-row {\n grid-template-columns: repeat(4, 1fr);\n}\n\n.bq-date-picker__month-gridcell,\n.bq-date-picker__year-gridcell {\n min-inline-size: 0;\n}\n\n// On narrow viewports panels stack, so shrink back to the intrinsic width.\n@media (width <= 40rem) {\n .bq-date-picker__view {\n min-inline-size: auto;\n }\n}\n\n.bq-date-picker__month-cell,\n.bq-date-picker__year-cell {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n inline-size: 100%;\n block-size: var(--bq-date-picker--view-cell-height);\n padding-block: 0.5rem;\n padding-inline: 0.5rem;\n border: none;\n border-radius: var(--bq-date-picker--view-cell-radius);\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n transition: background-color 150ms ease, color 150ms ease;\n\n &:hover:not(:disabled, .is-selected) {\n background-color: var(--bq-date-picker--view-cell-background-hover);\n }\n\n &:focus-visible {\n outline: 2px solid var(--bq-date-picker--border-color-focus);\n outline-offset: 1px;\n }\n\n &.is-selected {\n background-color: var(--bq-date-picker--view-cell-background-selected);\n color: var(--bq-date-picker--view-cell-text-selected);\n }\n\n // Range highlighting — month / year grids have a visible gap between cells,\n // so we keep the pill shape and only differentiate inner cells with a lighter\n // tint. Endpoints already carry `.is-selected`, so they inherit the full\n // selected pill treatment above.\n &.is-range-inner {\n background-color: var(--bq-date-picker--range-inner-background-color);\n color: var(--bq-date-picker--text-color);\n }\n\n &:disabled,\n &.is-out-of-bounds {\n cursor: not-allowed;\n opacity: 0.35;\n }\n}\n\n/* ---------------------- Reduced motion preference ------------------------ */\n\n@media (prefers-reduced-motion: reduce) {\n .bq-date-picker__control,\n .bq-date-picker__day,\n .bq-date-picker__month-cell,\n .bq-date-picker__year-cell {\n transition: none;\n }\n}\n","import type { EventEmitter } from '@stencil/core';\nimport { AttachInternals, Component, Element, Event, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport type { JSX } from '@stencil/core/internal';\n\nimport type { Placement } from '../../services/interfaces';\nimport {\n getTodayISO,\n hasSlotContent,\n isEventTargetChildOfElement,\n isHTMLElement,\n isNil,\n updateFormValidity,\n validatePropValue,\n} from '../../shared/utils';\nimport { INPUT_VALIDATION, type TInputValidation } from '../input/bq-input.types';\nimport type {\n DaysOfWeek,\n TCalendarView,\n TDatePickerType,\n TDatePrecision,\n TFloatingStrategy,\n TMonthsPerView,\n TSelection,\n} from './bq-date-picker.types';\nimport {\n CALENDAR_VIEW,\n DATE_PICKER_TYPE,\n DATE_PRECISION,\n DAYS_OF_WEEK,\n FLOATING_PLACEMENT,\n FLOATING_STRATEGY,\n MONTHS_PER_VIEW,\n} from './bq-date-picker.types';\nimport { CalendarDayView } from './components/CalendarDayView';\nimport { CalendarHeader } from './components/CalendarHeader';\nimport { CalendarMonthView } from './components/CalendarMonthView';\nimport { CalendarYearView } from './components/CalendarYearView';\nimport { isMonthWithinBounds, isYearWithinBounds, padBound } from './helper/bounds';\nimport {\n addDays,\n addMonths,\n addYears,\n clampDate,\n endOfMonth,\n getDecadeStart,\n isWithinBounds,\n parseISO,\n startOfMonth,\n toISO,\n} from './helper/calendar';\nimport { CALENDAR_PARTS, DECADE_GRID_SIZE, DEFAULT_INPUT_ID, MAX_MONTHS_PER_VIEW } from './helper/constants';\nimport { parseTypedInput } from './helper/input';\nimport { formatMonth } from './helper/intl';\nimport { getHeaderLabel, getHeaderTitleLabel, getNextLabel, getPreviousLabel } from './helper/labels';\nimport { advanceFocusedMonth, advanceFocusedYear, getGridColumns } from './helper/navigation';\nimport { applySelection, buildTentativeRange, parseValue, serializeValue } from './helper/selection';\nimport {\n computeDisplayDate,\n computeHasValue,\n DEFAULT_FORMAT_OPTIONS_BY_PRECISION,\n normalizeValue,\n} from './helper/value';\n\n/** Compose the default constraint-validation message for a set of flags. */\nconst defaultValidityMessage = (flags: ValidityStateFlags): string => {\n if (flags.badInput) return 'Please, input or select a valid date';\n if (flags.rangeUnderflow && flags.rangeOverflow) return 'Selected value is outside the allowed range';\n if (flags.rangeUnderflow) return 'Selected value is before the minimum';\n return 'Selected value is after the maximum';\n};\n\n/**\n * The Date Picker is a pure-Stencil calendar input.\n *\n * It supports single, multi, and range selection, three navigation views\n * (days → months → years), full localization via `Intl.DateTimeFormat`,\n * multi-month side-by-side rendering, and RTL layouts.\n *\n * @example How to use it\n * ```html\n * <bq-date-picker\n * first-day-of-week=\"1\"\n * locale=\"en-GB\"\n * name=\"bq-date-picker\"\n * placeholder=\"Enter your date\"\n * type=\"single\"\n * value=\"2026-07-15\"\n * >\n * <label slot=\"label\">Date picker label</label>\n * </bq-date-picker>\n * ```\n *\n * @documentation https://storybook.beeq.design/?path=/docs/components-date-picker--docs\n *\n * @status experimental\n *\n * @dependency bq-button\n * @dependency bq-dropdown\n * @dependency bq-icon\n *\n * @attr {boolean} autofocus - If `true`, the Date picker input will be focused on component render.\n * @attr {string} clear-button-label - The clear button aria label.\n * @attr {string} calendar-button-label - The aria-label for the calendar trigger button.\n * @attr {boolean} disable-clear - If `true`, the clear button won't be displayed.\n * @attr {boolean} disabled - Indicates whether the Date picker input is disabled or not.\n * @attr {number} distance - Represents the distance between the panel and the input.\n * @attr {0 | 1 | 2 | 3 | 4 | 5 | 6} first-day-of-week - The first day of the week (0 = Sunday).\n * @attr {Intl.DateTimeFormatOptions} format-options - Display formatting options.\n * @attr {string} form - The form ID the input belongs to.\n * @attr {string} form-validation-message - Custom native form validation message.\n * @attr {\"days\" | \"months\" | \"years\"} initial-view - The view to open when the panel first opens.\n * @attr {function} is-date-disallowed - Predicate that marks specific dates as unselectable.\n * @attr {Intl.LocalesArgument} locale - Locale used for formatting.\n * @attr {string} max - Latest selectable date (ISO).\n * @attr {string} min - Earliest selectable date (ISO).\n * @attr {number} months - Number of month panels to render side by side (range/multi). Capped at 2.\n * @attr {\"single\" | \"months\"} months-per-view - Prev/Next step size when multi-month is enabled.\n * @attr {string} name - Input name.\n * @attr {boolean} open - If `true`, the panel is visible.\n * @attr {string} panel-height - Overrides the height of the panel.\n * @attr {string} placeholder - Input placeholder text.\n * @attr {\"top\" | \"right\" | \"bottom\" | \"left\" | \"top-start\" | \"top-end\" | \"right-start\" | \"right-end\" | \"bottom-start\" | \"bottom-end\" | \"left-start\" | \"left-end\"} placement - Placement of the panel.\n * @attr {boolean} required - Whether a value must be selected before submitting the form.\n * @attr {boolean} show-outside-days - Whether to render days that belong to adjacent months.\n * @attr {number} skidding - Skidding between the panel and the trigger.\n * @attr {\"fixed\" | \"absolute\"} strategy - Positioning strategy for the panel.\n * @attr {\"single\" | \"multi\" | \"range\"} type - Selection mode.\n * @attr {\"error\" | \"none\" | \"success\" | \"warning\"} validation-status - Validation state.\n * @attr {string} value - The current selection, as a wire-format string. Shape depends on `type` and `precision`:\n * • **single**: a single ISO token — `YYYY-MM-DD` (precision `day`), `YYYY-MM` (precision `month`), `YYYY` (precision `year`).\n * • **range**: `start/end` (two tokens joined with `/`) at the same precision.\n * • **multi**: space-separated tokens at the same precision.\n * Bounds (`min`/`max`) may be supplied at any of these precisions and are honoured accordingly.\n * @attr {\"day\" | \"month\" | \"year\"} precision - Granularity of the value and of the calendar's initial view. Also drives which cells are selectable (day cells at `day`, month cells at `month`, year cells at `year`). Defaults to `\"day\"`.\n *\n * @method clear - Clears the selected value.\n *\n * @event bqBlur - Emitted when the input loses focus.\n * @event bqChange - Emitted when the value changes.\n * @event bqClear - Emitted when the value is cleared.\n * @event bqFocus - Emitted when the input receives focus.\n * @event bqViewChange - Emitted when the internal calendar view changes (days ↔ months ↔ years).\n *\n * @slot label - The label displayed above the input.\n * @slot prefix - Content rendered before the input value.\n * @slot suffix - Icon rendered inside the calendar trigger button (defaults to a calendar icon).\n * @slot clear-icon - Icon used inside the clear button.\n *\n * @part base - The component's base wrapper.\n * @part label - The label slot container.\n * @part control - The input control wrapper.\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n * @part input - The native input element.\n * @part clear-btn - The clear button.\n * @part calendar-trigger - The calendar icon trigger button.\n * @part button - Any button rendered inside the calendar (nav or day/month/year cell).\n * @part panel - The dropdown panel container.\n * @part calendar__container - The calendar panels wrapper.\n * @part calendar__header - The header row (prev / title / next).\n * @part calendar__heading - The header title button (or month label above a panel).\n * @part calendar__previous - The previous navigation button.\n * @part calendar__next - The next navigation button.\n * @part calendar__table - The day-view `<table>` element.\n * @part calendar__head - The day-view table header row wrapper.\n * @part calendar__tr - Any row within the day-view table.\n * @part calendar__th - The day-view weekday header cells.\n * @part calendar__week - Body rows in the day-view table.\n * @part calendar__td - Body cells in the day-view table.\n * @part calendar__day - Any day button in the day view.\n * @part calendar__today - The button representing today's date.\n * @part calendar__selected - Any selected day.\n * @part calendar__outside - Any day outside the visible month.\n * @part calendar__disallowed - Any day rejected by `isDateDisallowed`.\n * @part calendar__disabled - Any button disabled by min/max.\n * @part calendar__range-start - The first day of a range selection.\n * @part calendar__range-end - The last day of a range selection.\n * @part calendar__range-inner - Days between the start and end of a range.\n * @part calendar__months - The month-view grid.\n * @part calendar__month - Any month button.\n * @part calendar__month-selected - The currently selected month.\n * @part calendar__years - The year-view grid.\n * @part calendar__year - Any year button.\n * @part calendar__year-selected - The currently selected year.\n *\n * @cssprop --bq-date-picker--background-color - Input background color.\n * @cssprop --bq-date-picker--border-color - Input border color.\n * @cssprop --bq-date-picker--border-color-disabled - Border color when disabled.\n * @cssprop --bq-date-picker--border-color-focus - Border color on focus.\n * @cssprop --bq-date-picker--border-radius - Input border radius.\n * @cssprop --bq-date-picker--border-style - Border style.\n * @cssprop --bq-date-picker--border-width - Border width.\n * @cssprop --bq-date-picker--currentDate-border-color - Border color for today's date.\n * @cssprop --bq-date-picker--currentDate-border-width - Border width for today's date.\n * @cssprop --bq-date-picker--day-size - Size of a day cell in the calendar.\n * @cssprop --bq-date-picker--gap - Gap between the input content and prefix/suffix.\n * @cssprop --bq-date-picker--header-title-color - Color of the per-panel month label in multi-panel view.\n * @cssprop --bq-date-picker--icon-size - Size of the icons used in prefix/suffix/clear.\n * @cssprop --bq-date-picker--label-margin-bottom - Space below the label.\n * @cssprop --bq-date-picker--label-text-color - Label text color.\n * @cssprop --bq-date-picker--label-text-size - Label text size.\n * @cssprop --bq-date-picker--padding-end - Input padding end.\n * @cssprop --bq-date-picker--padding-start - Input padding start.\n * @cssprop --bq-date-picker--paddingY - Input vertical padding.\n * @cssprop --bq-date-picker--range-background-color - Background color for range start/end days.\n * @cssprop --bq-date-picker--range-inner-background-color - Background color for inner range days.\n * @cssprop --bq-date-picker--row-gap - Vertical space between day-grid rows.\n * @cssprop --bq-date-picker--text-color - Input text color.\n * @cssprop --bq-date-picker--text-placeholder-color - Placeholder text color.\n * @cssprop --bq-date-picker--text-size - Input text size.\n * @cssprop --bq-date-picker--view-cell-background-hover - Hover background for day/month/year cells.\n * @cssprop --bq-date-picker--view-cell-background-selected - Selected background for day/month/year cells.\n * @cssprop --bq-date-picker--view-cell-height - Height of month/year cells.\n * @cssprop --bq-date-picker--view-cell-radius - Border radius of day/month/year cells.\n * @cssprop --bq-date-picker--view-cell-text-selected - Text color for selected day/month/year cells.\n */\n@Component({\n tag: 'bq-date-picker',\n styleUrl: './scss/bq-date-picker.scss',\n formAssociated: true,\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqDatePicker {\n // Own Properties\n // ====================\n\n /**\n * Memoized parsed selection. Key encodes both `value` and `type` so cache\n * misses invalidate correctly. Value derives from `value`; not promoted to\n * `@State()` to preserve a single source of truth.\n */\n private cachedSelection?: { key: string; value: TSelection };\n\n /** Sticky flag: last typed input couldn't be parsed. Cleared on next successful commit or `clear()`. */\n private hasBadInput: boolean = false;\n\n /** Initial `value` captured at load time, restored on form reset. */\n private initialValue?: string;\n\n private inputElem?: HTMLInputElement;\n\n /** Set while `commitSelection` writes back to `this.value`. */\n private isCommittingSelection = false;\n\n private labelElem?: HTMLElement;\n\n /** Pending requestAnimationFrame id used by `focusButton`. */\n private pendingFocusRAF?: number;\n\n private prefixElem?: HTMLElement;\n private triggerBtnElem?: HTMLBqButtonElement;\n\n // Reference to host HTML element\n // ===================================\n\n @AttachInternals() internals!: ElementInternals;\n @Element() el!: HTMLBqDatePickerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() decadeStart: number = getDecadeStart(new Date().getFullYear());\n @State() displayDate?: string;\n @State() focusedISO: string = getTodayISO();\n @State() focusedMonth: number = new Date().getMonth();\n @State() focusedYear: number = new Date().getFullYear();\n @State() hasConstraintError = false;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasValue = false;\n @State() tentativeHover?: string;\n @State() view: TCalendarView = 'days';\n @State() viewDate: Date = new Date();\n\n // Public Property API\n // ========================\n\n /** If `true`, the Date picker input will be focused on component render. */\n @Prop({ reflect: true }) autofocus: boolean = false;\n\n /** The clear button aria label. */\n @Prop({ reflect: true }) clearButtonLabel: string = 'Clear value';\n\n /** The aria-label for the calendar trigger button. */\n @Prop({ reflect: true }) calendarButtonLabel: string = 'Open calendar';\n\n /** If `true`, the clear button won't be displayed. */\n @Prop({ reflect: true }) disableClear: boolean = false;\n\n /** Indicates whether the Date picker input is disabled or not. */\n @Prop({ reflect: true, mutable: true }) disabled: boolean = false;\n\n /** Distance (gutter) between the Date picker panel and the input element. */\n @Prop({ reflect: true }) distance: number = 8;\n\n /** The first day of the week, where Sunday is 0, Monday is 1, etc. */\n @Prop({ reflect: true }) firstDayOfWeek: DaysOfWeek = 1;\n\n /**\n * Options used when formatting the displayed value.\n *\n * When omitted, sensible defaults are picked based on `precision`:\n * - `day` → `{ day: 'numeric', month: 'short', year: 'numeric' }`\n * - `month` → `{ month: 'long', year: 'numeric' }`\n * - `year` → `{ year: 'numeric' }`\n */\n @Prop() formatOptions?: Intl.DateTimeFormatOptions;\n\n /** The ID of the form the input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** Native form validation message (mandatory if `required` is set). */\n @Prop({ mutable: true }) formValidationMessage?: string;\n\n /** The view opened first when the panel becomes visible. */\n @Prop({ reflect: true }) initialView: TCalendarView = 'days';\n\n /** Predicate that marks specific dates as unselectable. */\n @Prop() isDateDisallowed?: (date: Date) => boolean;\n\n /** Locale used for formatting dates. */\n @Prop({ reflect: true }) locale: Intl.LocalesArgument = 'en-GB';\n\n /** Latest date that can be selected (ISO). */\n @Prop({ reflect: true }) max?: string;\n\n /** Earliest date that can be selected (ISO). */\n @Prop({ reflect: true }) min?: string;\n\n /**\n * Number of months to show side by side (range / multi). Capped at 2.\n * Larger values are silently clamped to keep the popover from overflowing\n * the viewport and to preserve keyboard navigation semantics.\n */\n @Prop({ reflect: true, mutable: true }) months: number = 1;\n\n /**\n * How the next/previous buttons should navigate the calendar.\n * - single: navigate one month at a time.\n * - months: navigate by the number of months displayed.\n */\n @Prop({ reflect: true }) monthsPerView: TMonthsPerView = 'single';\n\n /** The Date picker input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, the panel is visible. */\n @Prop({ reflect: true, mutable: true }) open: boolean = false;\n\n /** Overrides the height of the Date picker panel. */\n @Prop({ reflect: true, mutable: true }) panelHeight?: string = 'auto';\n\n /** Placeholder text shown when no value is selected. */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Date picker panel. */\n @Prop({ reflect: true }) placement: Placement = 'bottom-end';\n\n /**\n * Precision of the value produced by the picker.\n *\n * - `day` → `YYYY-MM-DD` (default). Standard drill-down.\n * - `month` → `YYYY-MM`. Selection commits on the months view; no days view.\n * - `year` → `YYYY`. Selection commits on the years view; no months/days view.\n *\n * When precision is coarser than day, `initialView` is forced to match and\n * the header title cycles through the views available for that precision.\n */\n @Prop({ reflect: true }) precision: TDatePrecision = 'day';\n\n /** Whether a value must be selected before submitting the form. */\n @Prop({ reflect: true }) required: boolean = false;\n\n /** Skidding between the panel and the input element. */\n @Prop({ reflect: true }) skidding: number = 0;\n\n /** Whether to render days outside the current month. */\n @Prop({ reflect: true }) showOutsideDays: boolean = false;\n\n /** Positioning strategy for the panel. */\n @Prop({ reflect: true }) strategy: TFloatingStrategy = 'fixed';\n\n /**\n * Selection type.\n * - `single`: single date.\n * - `multi`: multiple discrete dates.\n * - `range`: contiguous range.\n */\n @Prop({ reflect: true }) type: TDatePickerType = 'single';\n\n /** Validation state applied to the input. */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /**\n * Currently selected value, in the precision-aware wire format:\n * - `precision=\"day\"` → tokens are `YYYY-MM-DD`\n * - `precision=\"month\"` → tokens are `YYYY-MM`\n * - `precision=\"year\"` → tokens are `YYYY`\n *\n * How multiple tokens are combined depends on `type`:\n * - `single` → a single token (e.g. `\"2025-05-15\"`, `\"2025-05\"`, `\"2025\"`)\n * - `range` → `\"start/end\"` — two tokens joined with `/`\n * - `multi` → space-separated tokens (e.g. `\"2025-05-15 2025-05-20\"`)\n */\n @Prop({ reflect: true, mutable: true }) value: string | undefined;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange(newValue: string | undefined, oldValue: string | undefined) {\n if (newValue === oldValue) return;\n\n // Normalize invalid tokens before propagating to the form or the UI so\n // consumers can't submit an invalid wire value while the display shows\n // nothing. If normalization rewrote the value, reflect it back on the\n // prop and let the follow-up watcher tick handle the normalized string.\n const normalized = normalizeValue(newValue, this.type, this.precision);\n if (normalized !== newValue) {\n this.value = normalized;\n return;\n }\n\n this.hasBadInput = false;\n this.syncDerivedFromValue();\n if (this.isCommittingSelection) return;\n this.syncViewToValue();\n }\n\n @Watch('formatOptions')\n @Watch('locale')\n handleFormattingChange() {\n // Re-format the display without re-parsing the wire value.\n this.hasValue = computeHasValue(this.value);\n this.displayDate = computeDisplayDate(\n this.value,\n this.type,\n this.locale,\n this.effectiveFormatOptions,\n this.precision,\n );\n }\n\n @Watch('type')\n handleTypeChange() {\n // `type` affects wire-format parsing, display formatting, and validity.\n // Re-normalize the current value against the new type; if that rewrites\n // the value, the `value` watcher takes over. Otherwise refresh derived\n // state and re-sync the visible calendar range.\n const normalized = normalizeValue(this.value, this.type, this.precision);\n if (normalized !== this.value) {\n this.value = normalized;\n return;\n }\n this.syncDerivedFromValue();\n this.syncViewToValue();\n }\n\n @Watch('precision')\n handlePrecisionChange() {\n validatePropValue(DATE_PRECISION, 'day', this.el, 'precision');\n // Precision affects both wire format and default view. Force the calendar\n // to open on the matching view and re-normalize the current value so\n // trailing day/month segments are dropped or padded consistently.\n this.view = this.precisionToView(this.precision);\n const normalized = normalizeValue(this.value, this.type, this.precision);\n if (normalized !== this.value) {\n this.value = normalized;\n return;\n }\n this.syncDerivedFromValue();\n this.syncViewToValue();\n }\n\n @Watch('max')\n @Watch('min')\n handleBoundsChange() {\n this.syncValidity();\n this.syncViewToValue();\n }\n\n @Watch('required')\n handleRequiredChange() {\n this.syncValidity();\n }\n\n @Watch('firstDayOfWeek')\n @Watch('initialView')\n @Watch('monthsPerView')\n @Watch('placement')\n @Watch('precision')\n @Watch('strategy')\n @Watch('type')\n @Watch('validationStatus')\n checkPropValues() {\n validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');\n validatePropValue(CALENDAR_VIEW, 'days', this.el, 'initialView');\n validatePropValue(DATE_PRECISION, 'day', this.el, 'precision');\n validatePropValue(MONTHS_PER_VIEW, 'single', this.el, 'monthsPerView');\n validatePropValue(FLOATING_STRATEGY, 'fixed', this.el, 'strategy');\n validatePropValue(FLOATING_PLACEMENT, 'bottom-end', this.el, 'placement');\n validatePropValue(INPUT_VALIDATION, 'none', this.el, 'validationStatus');\n validatePropValue(DAYS_OF_WEEK, 1, this.el, 'firstDayOfWeek');\n }\n\n @Watch('months')\n handleMonthsChange() {\n // Clamp `months` to an integer in [1, MAX_MONTHS_PER_VIEW]. Non-single\n // pickers may show 1..MAX side-by-side; single pickers ignore the value\n // in `getMonthCount()`, so we still clamp defensively to keep the prop\n // reflected value predictable.\n const clamped = this.clampMonths(this.months);\n if (clamped !== this.months) this.months = clamped;\n }\n\n @Watch('open')\n handleOpen(open: boolean) {\n if (!open) {\n this.tentativeHover = undefined;\n // Return focus to the calendar trigger button after closing the panel,\n // so keyboard users don't lose their position in the document.\n requestAnimationFrame(() => this.triggerBtnElem?.shadowRoot?.querySelector<HTMLButtonElement>('button')?.focus());\n return;\n }\n // Precision locks the initial view; otherwise honor the consumer-provided one.\n this.view = this.precision === 'day' ? this.initialView : this.precisionToView(this.precision);\n this.syncViewToValue();\n // Move keyboard focus into the calendar so screen-reader / keyboard users\n // land on the focused day (or the equivalent focused cell for\n // months/years views). Non-modal popup: focus is *moved*, not trapped.\n this.focusActiveCell();\n }\n\n @Watch('view')\n handleViewChange(next: TCalendarView, prev: TCalendarView) {\n if (next === prev) return;\n this.bqViewChange.emit({ view: next, el: this.el });\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus. */\n @Event() bqBlur!: EventEmitter<HTMLBqDatePickerElement>;\n\n /**\n * Callback handler emitted when the input value changes.\n */\n @Event() bqChange!: EventEmitter<{ value: string | undefined; el: HTMLBqDatePickerElement }>;\n\n /** Callback handler emitted when the value is cleared. */\n @Event() bqClear!: EventEmitter<HTMLBqDatePickerElement>;\n\n /** Callback handler emitted when the input receives focus. */\n @Event() bqFocus!: EventEmitter<HTMLBqDatePickerElement>;\n\n /**\n * Callback handler emitted when the internal calendar view changes\n * (e.g. from `days` to `months`, or from `years` back to `days`).\n */\n @Event() bqViewChange!: EventEmitter<{ view: TCalendarView; el: HTMLBqDatePickerElement }>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n componentWillLoad() {\n this.initialValue = this.value;\n // Precision locks the initial view when set. Otherwise honor `initialView`.\n // When the picker is rendered with `open` already true, `handleOpen` never\n // fires — apply the preference here so the initial paint respects it.\n this.view = this.precision === 'day' ? this.initialView : this.precisionToView(this.precision);\n this.checkPropValues();\n this.handleMonthsChange();\n this.syncViewToValue();\n }\n\n componentDidLoad() {\n this.handleSlotChange();\n this.handleValueChange(this.value, undefined);\n if (this.autofocus) this.inputElem?.focus();\n // `@Watch('open')` doesn't run for the initial prop value, so pickers\n // rendered with `open` never move focus into the calendar. Do it here.\n if (this.open) this.focusActiveCell();\n }\n\n disconnectedCallback() {\n if (this.pendingFocusRAF !== undefined) {\n cancelAnimationFrame(this.pendingFocusRAF);\n this.pendingFocusRAF = undefined;\n }\n }\n\n formAssociatedCallback() {\n this.syncValidity();\n }\n\n formResetCallback() {\n // Native form reset should restore the value the field had when the form\n // was first parsed, not blank it. The `value` watcher takes care of\n // syncing derived state, form value, and validity.\n if (this.value === this.initialValue) return;\n this.value = this.initialValue;\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!isEventTargetChildOfElement(ev, this.el)) return;\n const { open } = ev.detail;\n if (this.open === open) return;\n this.open = open;\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value and any pending validation state (bad input,\n * bounds overflow). Emits `bqClear`. No-op when the component is disabled.\n *\n * @returns A promise that resolves once the value has been cleared.\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n this.clearValue();\n this.bqClear.emit(this.el);\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = (): void => {\n if (this.disabled) return;\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = (): void => {\n if (this.disabled) return;\n this.bqFocus.emit(this.el);\n };\n\n private handleInputChange = (ev: Event): void => {\n if (this.disabled || !isHTMLElement(ev.target, 'input')) return;\n\n const inputValue = ev.target.value.trim();\n if (!inputValue) {\n this.hasBadInput = false;\n this.clearValue();\n this.bqChange.emit({ value: this.value, el: this.el });\n return;\n }\n\n const parsed = parseTypedInput(inputValue, this.locale, this.precision, this.min, this.max, this.isDateDisallowed);\n if (parsed.invalid || parsed.value == null) {\n // Flag as `badInput` and emit `undefined` — never propagate the raw\n // typed string, which would break the precision-aware wire contract.\n this.hasBadInput = true;\n this.internals.setFormValue(null);\n this.syncValidity();\n this.bqChange.emit({ value: undefined, el: this.el });\n return;\n }\n\n this.hasBadInput = false;\n this.value = parsed.value;\n this.bqChange.emit({ value: this.value, el: this.el });\n };\n\n private handleClearClick = (ev: CustomEvent): void => {\n if (this.disabled) return;\n if (this.inputElem) this.inputElem.value = '';\n\n this.clearValue();\n this.bqClear.emit(this.el);\n this.bqChange.emit({ value: this.value, el: this.el });\n this.inputElem?.focus();\n ev.stopPropagation();\n };\n\n /** Toggles the calendar panel open/closed when the trigger button is activated. */\n private handleTriggerClick = (): void => {\n if (this.disabled) return;\n this.open = !this.open;\n };\n\n /**\n * Handles keyboard shortcuts on the text input.\n * - `ArrowDown` / `Alt+ArrowDown` → open panel and focus active cell.\n * - `Escape` → close panel (focus stays on input).\n */\n private handleInputKeyDown = (ev: KeyboardEvent): void => {\n if (this.disabled) return;\n if (ev.key === 'ArrowDown') {\n ev.preventDefault();\n if (!this.open) this.open = true;\n } else if (ev.key === 'Escape' && this.open) {\n ev.preventDefault();\n this.open = false;\n }\n };\n\n private clearValue = (): void => {\n this.value = undefined;\n this.displayDate = undefined;\n this.hasBadInput = false;\n this.internals.setFormValue(null);\n this.tentativeHover = undefined;\n };\n\n private handleSlotChange = (): void => {\n this.hasLabel = this.labelElem ? hasSlotContent(this.labelElem) : false;\n this.hasPrefix = this.prefixElem ? hasSlotContent(this.prefixElem) : false;\n };\n\n private updateFormValidity = (): void => {\n updateFormValidity({\n internals: this.internals,\n required: this.required,\n value: this.value,\n inputElem: this.inputElem,\n validationMessage: this.formValidationMessage,\n defaultMessage: 'Please, input or select a valid date',\n });\n };\n\n /**\n * Recompute all state derived from the public `value` (form value,\n * `hasValue`, formatted display). Called from `value` and any prop that\n * affects display formatting (`type`, `locale`, `formatOptions`).\n */\n private syncDerivedFromValue = (): void => {\n const current = this.value;\n this.internals.setFormValue(!isNil(current) ? `${current}` : null);\n this.syncValidity();\n this.hasValue = computeHasValue(current);\n this.displayDate = computeDisplayDate(current, this.type, this.locale, this.effectiveFormatOptions, this.precision);\n };\n\n /**\n * Runs the full form-validity pipeline in a consistent order: `required`\n * → bounds → `badInput`. Multiple failing constraints are unioned into a\n * single `setValidity` call.\n */\n private syncValidity = (): void => {\n if (!this.internals) return;\n\n this.updateFormValidity();\n\n const boundsFlags = this.computeBoundsValidityFlags();\n const flags: ValidityStateFlags = { ...boundsFlags };\n if (this.hasBadInput) flags.badInput = true;\n\n const hasCustomConstraintError = Object.keys(flags).length > 0;\n if (!hasCustomConstraintError) {\n this.hasConstraintError = !this.internals.validity.valid;\n return;\n }\n\n const message = this.formValidationMessage ?? defaultValidityMessage(flags);\n\n this.internals.states.delete('valid');\n this.internals.states.add('invalid');\n this.internals.setValidity(flags, message, this.inputElem);\n this.hasConstraintError = true;\n };\n\n /** Returns `rangeUnderflow` / `rangeOverflow` flags for the current selection. */\n private computeBoundsValidityFlags = (): ValidityStateFlags => {\n if (!this.min && !this.max) return {};\n const selection = parseValue(this.value, this.type, this.precision);\n if (selection.length === 0) return {};\n\n const paddedMin = padBound(this.min, 'min');\n const paddedMax = padBound(this.max, 'max');\n let rangeUnderflow = false;\n let rangeOverflow = false;\n\n for (const iso of selection) {\n if (paddedMin && iso < paddedMin) rangeUnderflow = true;\n if (paddedMax && iso > paddedMax) rangeOverflow = true;\n }\n\n if (!rangeUnderflow && !rangeOverflow) return {};\n return { rangeUnderflow, rangeOverflow };\n };\n\n private clampMonths = (value: number): number => {\n const rounded = Math.floor(Number(value));\n if (!Number.isFinite(rounded) || rounded < 1) return 1;\n return Math.min(rounded, MAX_MONTHS_PER_VIEW);\n };\n\n /**\n * Align the internal `viewDate` / `focused*` state with the current value.\n * Called when the panel opens and whenever an *external* prop change\n * invalidates the current view (value, type, precision, min/max). Internal\n * commits skip this via `isCommittingSelection` so the user's navigated\n * year isn't clobbered by a subsequent multi/range selection.\n *\n * Uses `parseValue` (precision-aware, always returns full ISO dates) rather\n * than a raw `YYYY-MM-DD` regex so that month/year wire values like\n * `\"2025-05\"` or `\"2025\"` land on the right cell instead of falling back\n * to today.\n */\n private syncViewToValue = (): void => {\n const parsed = parseValue(this.value, this.type, this.precision);\n const focusISO = parsed[0] ?? getTodayISO();\n const focus = parseISO(focusISO) ?? new Date();\n const bounded = clampDate(focus, this.min, this.max);\n\n this.focusedISO = toISO(bounded);\n this.viewDate = startOfMonth(bounded);\n this.focusedMonth = bounded.getMonth();\n this.focusedYear = bounded.getFullYear();\n this.decadeStart = getDecadeStart(bounded.getFullYear());\n };\n\n private get selection(): TSelection {\n const key = `${this.type}|${this.precision}|${this.value ?? ''}`;\n if (this.cachedSelection?.key === key) return this.cachedSelection.value;\n const parsed = parseValue(this.value, this.type, this.precision);\n this.cachedSelection = { key, value: parsed };\n return parsed;\n }\n\n /**\n * Effective `Intl.DateTimeFormatOptions` — user-provided when set, otherwise\n * the precision-appropriate default. Prevents a `month` picker from\n * accidentally rendering \"1 May 2026\" when the consumer just sets\n * `precision=\"month\"` without overriding `formatOptions`.\n */\n private get effectiveFormatOptions(): Intl.DateTimeFormatOptions {\n return this.formatOptions ?? DEFAULT_FORMAT_OPTIONS_BY_PRECISION[this.precision];\n }\n\n /** Map a precision value to the calendar view that commits selections. */\n private precisionToView = (precision: TDatePrecision): TCalendarView => {\n if (precision === 'month') return 'months';\n if (precision === 'year') return 'years';\n return 'days';\n };\n\n private get tentativeRange(): TSelection {\n if (this.type !== 'range') return [];\n const parsed = this.selection;\n // While the user is completing a range (one endpoint chosen) show the\n // hover preview between that endpoint and the current hovered day.\n if (parsed.length === 1) return buildTentativeRange(parsed[0], this.tentativeHover);\n return [];\n }\n\n /* --------------------------- View transitions -------------------------- */\n\n /**\n * Return the date that view transitions (days ⇄ months ⇄ years) should\n * center the focus on.\n *\n * Priority:\n * 1. First entry of the current selection — for `range` this is the start\n * date (selection is sorted on parse), for `multi` it is the earliest.\n * 2. Otherwise the currently displayed `viewDate` (i.e. the month/year the\n * user has navigated to with prev/next).\n */\n private getViewFocusReference = (): Date => {\n const [first] = this.selection;\n if (first) {\n const parsed = parseISO(first);\n if (parsed) return parsed;\n }\n return this.viewDate;\n };\n\n private handleHeaderTitleClick = (): void => {\n if (this.precision === 'year') return;\n\n if (this.view === 'days') {\n const ref = this.getViewFocusReference();\n this.focusedMonth = ref.getMonth();\n this.focusedYear = ref.getFullYear();\n this.view = 'months';\n this.focusActiveCell();\n return;\n }\n if (this.view === 'months') {\n const ref = this.getViewFocusReference();\n this.focusedYear = ref.getFullYear();\n this.decadeStart = getDecadeStart(ref.getFullYear());\n this.view = 'years';\n this.focusActiveCell();\n return;\n }\n // years view → cycle back to the base view for the current precision\n this.view = this.precisionToView(this.precision);\n this.focusActiveCell();\n };\n\n private handleHeaderPrev = (): void => {\n if (this.view === 'days') {\n const step = this.monthsPerView === 'months' ? Math.max(1, this.months) : 1;\n this.viewDate = addMonths(this.viewDate, -step);\n this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));\n } else if (this.view === 'months') {\n this.focusedYear = this.focusedYear - 1;\n } else {\n this.decadeStart = this.decadeStart - DECADE_GRID_SIZE;\n }\n };\n\n private handleHeaderNext = (): void => {\n if (this.view === 'days') {\n const step = this.monthsPerView === 'months' ? Math.max(1, this.months) : 1;\n this.viewDate = addMonths(this.viewDate, step);\n this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));\n } else if (this.view === 'months') {\n this.focusedYear = this.focusedYear + 1;\n } else {\n this.decadeStart = this.decadeStart + DECADE_GRID_SIZE;\n }\n };\n\n private handleMonthSelect = (month: number): void => {\n // When precision is `month`, selecting a month commits the value instead\n // of drilling to the days view. Gate the commit on bounds so keyboard\n // Enter/Space cannot bypass the click-path disabled check.\n if (this.precision === 'month') {\n if (!isMonthWithinBounds(this.focusedYear, month, this.min, this.max)) return;\n this.focusedMonth = month;\n this.viewDate = new Date(this.focusedYear, month, 1);\n this.commitSelection(toISO(new Date(this.focusedYear, month, 1)));\n return;\n }\n\n this.viewDate = new Date(this.focusedYear, month, 1);\n this.focusedMonth = month;\n // Preserve day-of-month from the current focus (value or today), clamped\n // to the last day of the destination month and to min/max bounds.\n const nextFocus = clampDate(\n new Date(\n this.focusedYear,\n month,\n Math.min(new Date(this.focusedISO).getDate() || 1, endOfMonth(this.viewDate).getDate()),\n ),\n this.min,\n this.max,\n );\n this.focusedISO = toISO(nextFocus);\n this.view = 'days';\n this.focusActiveCell();\n };\n\n private handleYearSelect = (year: number): void => {\n // When precision is `year`, selecting a year commits the value instead\n // of drilling to the months view. Gate the commit on bounds so keyboard\n // Enter/Space cannot bypass the click-path disabled check.\n if (this.precision === 'year') {\n if (!isYearWithinBounds(year, this.min, this.max)) return;\n this.focusedYear = year;\n this.viewDate = new Date(year, 0, 1);\n this.commitSelection(toISO(new Date(year, 0, 1)));\n return;\n }\n\n this.focusedYear = year;\n this.viewDate = new Date(year, this.focusedMonth, 1);\n this.view = 'months';\n this.focusActiveCell();\n };\n\n /* ---------------------------- Day selection ---------------------------- */\n\n private handleDaySelect = (iso: string): void => {\n this.commitSelection(iso);\n };\n\n /**\n * Shared commit path used by day / month / year selection. Keeps the\n * selection logic (single/multi/range) and post-commit behaviour (event,\n * open state, tentative hover, view sync) identical across precisions.\n */\n private commitSelection = (iso: string): void => {\n const next = applySelection(iso, this.selection, this.type);\n const shouldStayOpen = this.type === 'multi' || (this.type === 'range' && next.length === 1);\n\n this.hasBadInput = false;\n\n // Guard so `handleValueChange` doesn't re-sync the view back to `parsed[0]`\n // (would jump multi/range pickers to the earliest selected date) or to\n // today (when precision truncation leaves no full ISO to extract).\n this.isCommittingSelection = true;\n this.value = serializeValue(next, this.type, this.precision);\n this.isCommittingSelection = false;\n\n this.focusedISO = iso;\n const parsedIso = parseISO(iso);\n if (parsedIso) {\n this.viewDate = startOfMonth(parsedIso);\n this.focusedMonth = parsedIso.getMonth();\n this.focusedYear = parsedIso.getFullYear();\n if (this.precision !== 'year') {\n this.decadeStart = getDecadeStart(parsedIso.getFullYear());\n }\n }\n this.tentativeHover = this.type === 'range' && next.length === 1 ? iso : undefined;\n\n this.bqChange.emit({ value: this.value, el: this.el });\n this.open = shouldStayOpen;\n };\n\n private handleDayHover = (iso: string | undefined): void => {\n if (this.type !== 'range') return;\n this.tentativeHover = iso;\n };\n\n private handleDayFocus = (iso: string): void => {\n if (this.focusedISO === iso) return;\n this.focusedISO = iso;\n };\n\n /* ------------------------- Grid keyboard nav --------------------------- */\n\n private getRTLDirection = (): 1 | -1 => {\n // Walk up through the composed tree so that dir=\"rtl\" set on <html> or\n // any ancestor is picked up, not just a direct attribute on the host.\n const dir = (this.el.closest('[dir]') as HTMLElement)?.dir ?? getComputedStyle(this.el).direction;\n return dir === 'rtl' ? -1 : 1;\n };\n\n private moveFocusedDay = (deltaDays: number): void => {\n const current = parseISO(this.focusedISO) ?? new Date();\n const next = clampDate(addDays(current, deltaDays), this.min, this.max);\n this.focusedISO = toISO(next);\n if (next.getMonth() !== this.viewDate.getMonth() || next.getFullYear() !== this.viewDate.getFullYear()) {\n this.viewDate = startOfMonth(next);\n }\n this.focusButton(`[data-iso=\"${this.focusedISO}\"]`);\n };\n\n private moveFocusedDayHome = (): void => {\n const first = this.firstDayOfWeek ?? 1;\n const dayOfWeek = parseISO(this.focusedISO)?.getDay() ?? 0;\n this.moveFocusedDay(-((dayOfWeek - first + 7) % 7));\n };\n\n private moveFocusedDayEnd = (): void => {\n const first = this.firstDayOfWeek ?? 1;\n const focus = parseISO(this.focusedISO) ?? new Date();\n const rowIndex = (focus.getDay() - first + 7) % 7;\n this.moveFocusedDay(6 - rowIndex);\n };\n\n private pageFocusedMonth = (direction: -1 | 1, byYear: boolean): void => {\n this.viewDate = byYear ? addYears(this.viewDate, direction) : addMonths(this.viewDate, direction);\n this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));\n };\n\n private selectFocusedDay = (): void => {\n const iso = this.focusedISO;\n const parsed = parseISO(iso);\n if (parsed && isWithinBounds(parsed, this.min, this.max) && !this.isDateDisallowed?.(parsed)) {\n this.handleDaySelect(iso);\n }\n };\n\n private handleDayGridKeyDown = (ev: KeyboardEvent): void => {\n const rtl = this.getRTLDirection();\n\n const handlers: Record<string, () => void> = {\n ArrowLeft: () => this.moveFocusedDay(-1 * rtl),\n ArrowRight: () => this.moveFocusedDay(1 * rtl),\n ArrowUp: () => this.moveFocusedDay(-7),\n ArrowDown: () => this.moveFocusedDay(7),\n Home: () => this.moveFocusedDayHome(),\n End: () => this.moveFocusedDayEnd(),\n PageUp: () => this.pageFocusedMonth(-1, ev.shiftKey),\n PageDown: () => this.pageFocusedMonth(1, ev.shiftKey),\n Escape: () => {\n this.open = false;\n this.inputElem?.focus();\n },\n Enter: () => this.selectFocusedDay(),\n ' ': () => this.selectFocusedDay(),\n };\n\n const handler = handlers[ev.key];\n if (handler) {\n ev.preventDefault();\n handler();\n }\n };\n\n private getGridColumns = (): number => {\n // Months/years grids visually expand from 3 to 4 columns in multi-panel\n // mode. Keep arrow-key stride in sync so vertical navigation still lands\n // on the row directly above/below the current cell.\n return getGridColumns(this.getMonthCount());\n };\n\n private handleMonthGridKeyDown = (ev: KeyboardEvent): void => {\n const rtl = this.getRTLDirection();\n const stride = this.getGridColumns();\n const move = (delta: number) => {\n const { month, year } = advanceFocusedMonth(this.focusedMonth, this.focusedYear, delta);\n this.focusedMonth = month;\n this.focusedYear = year;\n this.focusButton(`[data-month=\"${month}\"]`);\n };\n\n switch (ev.key) {\n case 'ArrowLeft':\n ev.preventDefault();\n move(-1 * rtl);\n return;\n case 'ArrowRight':\n ev.preventDefault();\n move(1 * rtl);\n return;\n case 'ArrowUp':\n ev.preventDefault();\n move(-stride);\n return;\n case 'ArrowDown':\n ev.preventDefault();\n move(stride);\n return;\n case 'Enter':\n case ' ':\n ev.preventDefault();\n this.handleMonthSelect(this.focusedMonth);\n return;\n case 'Escape':\n ev.preventDefault();\n this.view = 'days';\n }\n };\n\n private handleYearGridKeyDown = (ev: KeyboardEvent): void => {\n const rtl = this.getRTLDirection();\n const stride = this.getGridColumns();\n const move = (delta: number) => {\n const { year, decadeStart } = advanceFocusedYear(this.focusedYear, this.decadeStart, delta);\n this.focusedYear = year;\n this.decadeStart = decadeStart;\n this.focusButton(`[data-year=\"${year}\"]`);\n };\n\n switch (ev.key) {\n case 'ArrowLeft':\n ev.preventDefault();\n move(-1 * rtl);\n return;\n case 'ArrowRight':\n ev.preventDefault();\n move(1 * rtl);\n return;\n case 'ArrowUp':\n ev.preventDefault();\n move(-stride);\n return;\n case 'ArrowDown':\n ev.preventDefault();\n move(stride);\n return;\n case 'Enter':\n case ' ':\n ev.preventDefault();\n this.handleYearSelect(this.focusedYear);\n return;\n case 'Escape':\n ev.preventDefault();\n this.view = 'months';\n }\n };\n\n private focusButton = (selector: string): void => {\n // Cancel any prior pending focus request so rapid state changes don't\n // race — only the latest target should win.\n if (this.pendingFocusRAF !== undefined) cancelAnimationFrame(this.pendingFocusRAF);\n this.pendingFocusRAF = requestAnimationFrame(() => {\n this.pendingFocusRAF = undefined;\n const button = this.el.shadowRoot?.querySelector<HTMLButtonElement>(selector);\n button?.focus();\n });\n };\n\n /**\n * Focus the currently active cell for the visible view. Called after the\n * popup opens so keyboard users don't have to tab into the calendar.\n */\n private focusActiveCell = (): void => {\n if (this.view === 'months') {\n this.focusButton(`[data-month=\"${this.focusedMonth}\"]`);\n return;\n }\n if (this.view === 'years') {\n this.focusButton(`[data-year=\"${this.focusedYear}\"]`);\n return;\n }\n this.focusButton(`[data-iso=\"${this.focusedISO}\"]`);\n };\n\n /* -------------------------- Header labels ------------------------------ */\n\n private getMonthCount = (): number => {\n if (this.type === 'single') return 1;\n // `handleMonthsChange` clamps the prop on write, so here we just guard\n // against the initial value before the first watcher tick.\n return this.clampMonths(this.months);\n };\n\n private getHeaderLabel = (): string => {\n return getHeaderLabel({\n view: this.view,\n viewDate: this.viewDate,\n focusedYear: this.focusedYear,\n decadeStart: this.decadeStart,\n monthCount: this.getMonthCount(),\n locale: this.locale,\n });\n };\n\n private getHeaderTitleLabel = (): string => {\n return getHeaderTitleLabel(this.view, this.precision);\n };\n\n private getPreviousLabel = (): string => {\n return getPreviousLabel(this.view);\n };\n\n private getNextLabel = (): string => {\n return getNextLabel(this.view);\n };\n\n private renderDayPanels = (): JSX.Element => {\n const panels: JSX.Element[] = [];\n const monthCount = this.getMonthCount();\n\n for (let i = 0; i < monthCount; i++) {\n const anchor = addMonths(this.viewDate, i);\n const anchorKey = toISO(startOfMonth(anchor));\n panels.push(\n <div\n key={anchorKey}\n class={{\n 'bq-date-picker__panel': true,\n 'bq-date-picker__panel--extra': i > 0,\n }}\n >\n {monthCount > 1 && (\n <div class=\"bq-date-picker__month-label\" part={CALENDAR_PARTS.heading}>\n {formatMonth(anchor, this.locale, 'long', true)}\n </div>\n )}\n <CalendarDayView\n viewDate={anchor}\n selection={this.selection}\n tentativeRange={this.tentativeRange}\n focusedISO={this.focusedISO}\n type={this.type}\n locale={this.locale}\n firstDayOfWeek={this.firstDayOfWeek ?? 1}\n showOutsideDays={this.showOutsideDays}\n minISO={this.min}\n maxISO={this.max}\n isDateDisallowed={this.isDateDisallowed}\n onDaySelect={(iso) => this.handleDaySelect(iso)}\n onDayHover={(iso) => this.handleDayHover(iso)}\n onDayFocus={(iso) => this.handleDayFocus(iso)}\n onGridKeyDown={this.handleDayGridKeyDown}\n />\n </div>,\n );\n }\n\n return <div class=\"bq-date-picker__panels\">{panels}</div>;\n };\n\n private renderMonthsView = (): JSX.Element => {\n const gridColumns = this.getGridColumns();\n return (\n <CalendarMonthView\n year={this.focusedYear}\n focusedMonth={this.focusedMonth}\n gridColumns={gridColumns}\n locale={this.locale}\n minISO={this.min}\n maxISO={this.max}\n selection={this.selection}\n tentativeRange={this.tentativeRange}\n type={this.type}\n onMonthSelect={(month) => this.handleMonthSelect(month)}\n onMonthHover={(iso) => this.handleDayHover(iso)}\n onMonthFocus={(month) => {\n this.focusedMonth = month;\n }}\n onGridKeyDown={this.handleMonthGridKeyDown}\n />\n );\n };\n\n private renderYearsView = (): JSX.Element => {\n const start = this.decadeStart;\n const end = start + DECADE_GRID_SIZE - 1;\n const years = Array.from({ length: DECADE_GRID_SIZE }, (_, i) => start + i);\n const effectiveFocused = this.focusedYear >= start && this.focusedYear <= end ? this.focusedYear : start;\n const gridColumns = this.getGridColumns();\n\n return (\n <CalendarYearView\n years={years}\n focusedYear={effectiveFocused}\n gridColumns={gridColumns}\n minISO={this.min}\n maxISO={this.max}\n selection={this.selection}\n tentativeRange={this.tentativeRange}\n type={this.type}\n onYearSelect={(year) => this.handleYearSelect(year)}\n onYearHover={(iso) => this.handleDayHover(iso)}\n onYearFocus={(year) => {\n this.focusedYear = year;\n }}\n onGridKeyDown={this.handleYearGridKeyDown}\n />\n );\n };\n\n private renderView = (): JSX.Element => {\n if (this.view === 'months') return this.renderMonthsView();\n if (this.view === 'years') return this.renderYearsView();\n return this.renderDayPanels();\n };\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const labelId = `bq-date-picker__label-${this.name || DEFAULT_INPUT_ID}`;\n const popupId = `bq-date-picker__popup-${this.name || DEFAULT_INPUT_ID}`;\n\n return (\n <div class=\"bq-date-picker\" part={CALENDAR_PARTS.base}>\n <label\n class={{ 'bq-date-picker__label': true, 'is-hidden': !this.hasLabel }}\n htmlFor={this.name || DEFAULT_INPUT_ID}\n part={CALENDAR_PARTS.label}\n ref={(labelElem) => {\n this.labelElem = labelElem;\n }}\n >\n <slot id={labelId} name=\"label\" onSlotchange={this.handleSlotChange} />\n </label>\n\n <bq-dropdown\n class=\"bq-date-picker__dropdown\"\n disabled={this.disabled}\n distance={this.distance}\n exportparts=\"panel\"\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n skidding={this.skidding}\n strategy={this.strategy}\n >\n <div\n class={{\n 'bq-date-picker__control': true,\n [`validation-${this.validationStatus}`]: true,\n 'is-disabled': !!this.disabled,\n 'is-open': !!this.open,\n }}\n part={CALENDAR_PARTS.control}\n slot=\"trigger\"\n >\n <span\n class={{ 'bq-date-picker__prefix': true, 'is-hidden': !this.hasPrefix }}\n part={CALENDAR_PARTS.prefix}\n ref={(el) => {\n this.prefixElem = el;\n }}\n >\n <slot name=\"prefix\" onSlotchange={this.handleSlotChange} />\n </span>\n\n <input\n aria-controls={popupId}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-expanded={this.open ? 'true' : 'false'}\n aria-haspopup=\"dialog\"\n aria-invalid={this.validationStatus === 'error' || this.hasConstraintError ? 'true' : 'false'}\n aria-labelledby={this.hasLabel ? labelId : undefined}\n autoCapitalize=\"off\"\n autoComplete=\"off\"\n class=\"bq-date-picker__input\"\n disabled={this.disabled}\n form={this.form}\n id={this.name || DEFAULT_INPUT_ID}\n name={this.name}\n onBlur={this.handleBlur}\n onChange={this.handleInputChange}\n onFocus={this.handleFocus}\n onKeyDown={this.handleInputKeyDown}\n part={CALENDAR_PARTS.input}\n placeholder={this.placeholder}\n readonly={this.type !== 'single'}\n ref={(el) => {\n this.inputElem = el;\n }}\n required={this.required}\n role=\"combobox\"\n spellcheck={false}\n type=\"text\"\n value={this.displayDate}\n />\n\n {this.hasValue && !this.disabled && !this.disableClear && (\n <bq-button\n appearance=\"text\"\n border=\"xs\"\n class=\"bq-date-picker__clear\"\n exportparts=\"button\"\n label={this.clearButtonLabel}\n onBqClick={this.handleClearClick}\n onlyIcon\n part={CALENDAR_PARTS.clearBtn}\n size=\"small\"\n >\n <slot name=\"clear-icon\">\n <bq-icon aria-hidden=\"true\" name=\"x-circle\" />\n </slot>\n </bq-button>\n )}\n\n {/* biome-ignore lint/a11y/noStaticElementInteractions: bq-button renders a native <button> in its shadow DOM */}\n <bq-button\n appearance=\"text\"\n border=\"xs\"\n class=\"bq-date-picker__calendar-trigger\"\n disabled={this.disabled}\n exportparts=\"button\"\n label={this.calendarButtonLabel}\n onClick={(ev: MouseEvent) => ev.stopPropagation()}\n onBqClick={this.handleTriggerClick}\n onlyIcon\n part={`${CALENDAR_PARTS.button} ${CALENDAR_PARTS.suffix} ${CALENDAR_PARTS.calendarTrigger}`}\n ref={(el) => {\n this.triggerBtnElem = el;\n }}\n size=\"small\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSlotChange}>\n <bq-icon aria-hidden=\"true\" name=\"calendar-blank\" />\n </slot>\n </bq-button>\n </div>\n\n <div\n aria-label={this.hasLabel ? undefined : 'Date picker'}\n aria-labelledby={this.hasLabel ? labelId : undefined}\n class=\"bq-date-picker__calendar\"\n id={popupId}\n part={CALENDAR_PARTS.container}\n role=\"dialog\"\n style={{ '--bq-date-picker--panel-count': `${this.getMonthCount()}` }}\n >\n <CalendarHeader\n view={this.view}\n label={this.getHeaderLabel()}\n previousLabel={this.getPreviousLabel()}\n nextLabel={this.getNextLabel()}\n titleLabel={this.getHeaderTitleLabel()}\n titleInteractive={this.precision !== 'year'}\n onPrevious={() => this.handleHeaderPrev()}\n onNext={() => this.handleHeaderNext()}\n onTitleClick={() => this.handleHeaderTitleClick()}\n />\n <div class=\"bq-date-picker__view\">{this.renderView()}</div>\n </div>\n </bq-dropdown>\n </div>\n );\n }\n}\n"],"mappings":";;;;maACA,MAAMA,EAAiB,IAAIC,IAQ3B,MAAMC,EAAmB,CAACC,EAA8BC,KACtD,MAAMC,EAAW,UAAUF,IAAW,SAAWA,EAASG,KAAKC,UAAUJ,MAAWG,KAAKC,UAAUH,KAEnG,IAAII,EAAYR,EAAeS,IAAIJ,GACnC,IAAKG,EAAW,CACdA,EAAY,IAAIE,KAAKC,eAAeR,EAAQC,GAC5CJ,EAAeY,IAAIP,EAAUG,GAG7B,GAAIR,EAAea,KAAO,GAAI,CAC5B,MAAMC,EAAWd,EAAee,OAAOC,OAAOC,MAC9CjB,EAAekB,OAAOJ,E,EAI1B,OAAON,CAAS,EAYlB,MAAMW,EAAqB,CACzBF,EACAG,EACAjB,EACAkB,KAEA,IAAKJ,EAAO,OAAOK,UAEnB,MAAMC,EAAgBrB,EAAiBC,EAAQkB,GAE/C,GAAID,IAAS,QAAS,CACpB,MAAOI,EAAOC,GAAOR,EAAMS,MAAM,KAAKC,KAAKC,GAAY,IAAIC,KAAK,GAAGD,gBACnE,IAAKJ,IAAUC,GAAOK,OAAOC,MAAMP,EAAMQ,YAAcF,OAAOC,MAAMN,EAAIO,WAAY,OAAOV,UAE3F,OAAOC,EAAcU,YAAYT,EAAOC,E,CAG1C,GAAIL,IAAS,QAAS,CACpB,MAAMc,EAAQjB,EAAMS,MAAM,KAAKC,KAAKC,GAAY,IAAIC,KAAK,GAAGD,gBAC5D,GAAIM,EAAMC,MAAMC,GAAMN,OAAOC,MA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