@beeq/core 1.12.4 → 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/{p-b4b02b99.entry.js → p-0d078519.entry.js} +2 -2
- package/dist/beeq/{p-b4b02b99.entry.js.map → p-0d078519.entry.js.map} +1 -1
- package/dist/beeq/{p-49a999b4.entry.js → p-1a2c4878.entry.js} +2 -2
- package/dist/beeq/p-21db4f39.entry.js +6 -0
- package/dist/beeq/p-21db4f39.entry.js.map +1 -0
- package/dist/beeq/{p-21db2c4e.entry.js → p-24bb2588.entry.js} +2 -2
- package/dist/beeq/{p-21db2c4e.entry.js.map → p-24bb2588.entry.js.map} +1 -1
- package/dist/beeq/{p-327cb74b.entry.js → p-2a081a54.entry.js} +2 -2
- package/dist/beeq/{p-327cb74b.entry.js.map → p-2a081a54.entry.js.map} +1 -1
- package/dist/beeq/{p-8974f66f.entry.js → p-2e1fffcd.entry.js} +2 -2
- package/dist/beeq/p-2fd6ea70.entry.js +6 -0
- package/dist/beeq/{p-d4df64ae.entry.js.map → p-2fd6ea70.entry.js.map} +1 -1
- package/dist/beeq/{p-f4c66e83.entry.js → p-30d1bd84.entry.js} +2 -2
- package/dist/beeq/{p-f4c66e83.entry.js.map → p-30d1bd84.entry.js.map} +1 -1
- package/dist/beeq/{p-b31d249b.entry.js → p-38006c8e.entry.js} +2 -2
- package/dist/beeq/{p-b8bac7c7.entry.js → p-3d754d97.entry.js} +2 -2
- package/dist/beeq/{p-b8bac7c7.entry.js.map → p-3d754d97.entry.js.map} +1 -1
- package/dist/beeq/{p-25772ebd.entry.js → p-45ae19aa.entry.js} +2 -2
- package/dist/beeq/p-45ae19aa.entry.js.map +1 -0
- package/dist/beeq/{p-f0a2c87e.entry.js → p-56b49d4e.entry.js} +2 -2
- package/dist/beeq/{p-f0a2c87e.entry.js.map → p-56b49d4e.entry.js.map} +1 -1
- package/dist/beeq/{p-644013aa.entry.js → p-58813f83.entry.js} +2 -2
- package/dist/beeq/{p-644013aa.entry.js.map → p-58813f83.entry.js.map} +1 -1
- package/dist/beeq/{p-0a3c5b97.entry.js → p-5eba392c.entry.js} +2 -2
- package/dist/beeq/{p-fe22de00.entry.js → p-6a38fcaf.entry.js} +2 -2
- package/dist/beeq/{p-d7c20c6f.entry.js → p-6be3f23a.entry.js} +2 -2
- package/dist/beeq/{p-d7c20c6f.entry.js.map → p-6be3f23a.entry.js.map} +1 -1
- package/dist/beeq/{p-ef783b95.entry.js → p-72ff2fe2.entry.js} +2 -2
- package/dist/beeq/{p-1764899f.entry.js → p-7ebe6b9d.entry.js} +2 -2
- package/dist/beeq/{p-1764899f.entry.js.map → p-7ebe6b9d.entry.js.map} +1 -1
- package/dist/beeq/{p-69cf0536.entry.js → p-817f7a5e.entry.js} +2 -2
- package/dist/beeq/{p-69cf0536.entry.js.map → p-817f7a5e.entry.js.map} +1 -1
- package/dist/beeq/{p-fb763ec5.entry.js → p-8bd7f4c2.entry.js} +2 -2
- package/dist/beeq/{p-8d9bef7a.entry.js → p-8be7ceb5.entry.js} +2 -2
- package/dist/beeq/{p-8d9bef7a.entry.js.map → p-8be7ceb5.entry.js.map} +1 -1
- package/dist/beeq/{p-f07f4d99.entry.js → p-9413a4d3.entry.js} +2 -2
- package/dist/beeq/{p-b7c6fdbd.entry.js → p-96f72671.entry.js} +2 -2
- package/dist/beeq/p-96f72671.entry.js.map +1 -0
- 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-7972ba08.entry.js → p-a55354ee.entry.js} +2 -2
- package/dist/beeq/{p-365f0372.entry.js → p-a72671f9.entry.js} +2 -2
- package/dist/beeq/p-a72671f9.entry.js.map +1 -0
- package/dist/beeq/{p-56810dba.entry.js → p-bdb983f9.entry.js} +2 -2
- package/dist/beeq/{p-56810dba.entry.js.map → p-bdb983f9.entry.js.map} +1 -1
- package/dist/beeq/{p-2a7c5b1e.entry.js → p-d6c35472.entry.js} +2 -2
- package/dist/beeq/{p-2a7c5b1e.entry.js.map → p-d6c35472.entry.js.map} +1 -1
- package/dist/beeq/{p-84e96891.entry.js → p-d792e3d3.entry.js} +2 -2
- package/dist/beeq/{p-5645238d.entry.js → p-e9a1b183.entry.js} +2 -2
- package/dist/beeq/p-f688d230.entry.js +6 -0
- package/dist/beeq/{p-79aab4dd.entry.js.map → p-f688d230.entry.js.map} +1 -1
- package/dist/beeq/{p-b6f5430a.entry.js → p-f891fb4b.entry.js} +2 -2
- package/dist/beeq/{p-b26ee039.entry.js → p-fa123a10.entry.js} +2 -2
- package/dist/beeq/{p-b26ee039.entry.js.map → p-fa123a10.entry.js.map} +1 -1
- 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 +2153 -50
- package/dist/cjs/beeq.cjs.js +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +2 -2
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +1741 -364
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +5 -5
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +4 -4
- package/dist/cjs/bq-drawer.cjs.entry.js +5 -5
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +4 -4
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +6 -6
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +8 -8
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +6 -6
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +6 -6
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +4 -4
- package/dist/cjs/bq-page-title.cjs.entry.js +4 -4
- package/dist/cjs/bq-progress.cjs.entry.js +5 -5
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +4 -4
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +1 -1
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +2 -2
- package/dist/cjs/bq-slider.cjs.entry.js +3 -3
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +4 -4
- package/dist/cjs/bq-status.cjs.entry.js +2 -2
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +5 -5
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +2 -2
- package/dist/cjs/bq-switch.cjs.entry.js +4 -4
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/bq-tab.cjs.entry.js +3 -3
- package/dist/cjs/bq-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bq-toast.cjs.entry.js +2 -2
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +4 -4
- package/dist/cjs/event-BhuEFC-I.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/slot-DKWrtk4b.js.map +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/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 +5 -4
- 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/svg/.icons-meta.json +13 -0
- package/dist/collection/components/input/bq-input.js +7 -7
- 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/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 +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 +3 -3
- 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 +5 -5
- package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
- package/dist/collection/components/toast/bq-toast.js +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/utils/event.js.map +1 -1
- package/dist/collection/shared/utils/slot.js.map +1 -1
- package/dist/components/bq-accordion-group.js +1 -1
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +1 -1
- package/dist/components/bq-alert.js +1 -1
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +1 -1
- package/dist/components/bq-avatar.js.map +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-breadcrumb.js.map +1 -1
- package/dist/components/bq-button.js +1 -1
- package/dist/components/bq-card.js +1 -1
- package/dist/components/bq-card.js.map +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-empty-state.js.map +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-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +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-item.js.map +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-spinner.js.map +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-tab.js.map +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-CK3SnGa2.js → p-BBCVL6R0.js} +2 -2
- package/dist/components/{p-MSqM1CAF.js → p-BS8hIETL.js} +2 -2
- package/dist/components/{p-MSqM1CAF.js.map → p-BS8hIETL.js.map} +1 -1
- package/dist/components/{p-wi7vUIoV.js → p-CWawcXxA.js} +2 -2
- package/dist/components/{p-wi7vUIoV.js.map → p-CWawcXxA.js.map} +1 -1
- package/dist/components/{p-CNITfoR_.js → p-D6ngGq0Y.js} +2 -2
- package/dist/components/{p-CNITfoR_.js.map → p-D6ngGq0Y.js.map} +1 -1
- package/dist/components/{p-jrBUnEFW.js → p-DMKBBBUE.js} +2 -2
- package/dist/components/{p-jrBUnEFW.js.map → p-DMKBBBUE.js.map} +1 -1
- package/dist/components/p-Dd3v3b2E.js +6 -0
- package/dist/components/{p-CfP6le1E.js.map → p-Dd3v3b2E.js.map} +1 -1
- package/dist/components/p-Dx-CEPSQ.js.map +1 -1
- package/dist/components/{p-BOuMP_Rm.js → p-iyX-PhkX.js} +2 -2
- package/dist/components/{p-BOuMP_Rm.js.map → p-iyX-PhkX.js.map} +1 -1
- package/dist/components/p-uqkxeAeG.js.map +1 -1
- package/dist/components/{p-2bpX-u8x.js → p-v3c5-Hhf.js} +2 -2
- package/dist/custom-elements.json +25333 -1261
- package/dist/esm/beeq.js +1 -1
- package/dist/esm/bq-accordion.entry.js +1 -1
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +1 -1
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +2 -2
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +4 -4
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +1743 -366
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +5 -5
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +4 -4
- package/dist/esm/bq-drawer.entry.js +5 -5
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +4 -4
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +6 -6
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +8 -8
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +6 -6
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +1 -1
- package/dist/esm/bq-option-list_2.entry.js +6 -6
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +4 -4
- package/dist/esm/bq-page-title.entry.js +4 -4
- package/dist/esm/bq-progress.entry.js +5 -5
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +1 -1
- package/dist/esm/bq-radio.entry.js +4 -4
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +1 -1
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +1 -1
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +2 -2
- package/dist/esm/bq-slider.entry.js +3 -3
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +4 -4
- package/dist/esm/bq-status.entry.js +2 -2
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +5 -5
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +2 -2
- package/dist/esm/bq-switch.entry.js +4 -4
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +3 -3
- package/dist/esm/bq-tab.entry.js +3 -3
- package/dist/esm/bq-textarea.entry.js +5 -5
- package/dist/esm/bq-toast.entry.js +2 -2
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +4 -4
- package/dist/esm/event-Dx-CEPSQ.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/slot-uqkxeAeG.js.map +1 -1
- package/dist/hydrate/index.js +1980 -601
- package/dist/hydrate/index.mjs +1980 -601
- package/dist/stencil.config.js +6 -0
- package/dist/stencil.config.js.map +1 -1
- package/dist/types/components/checkbox/bq-checkbox.d.ts +2 -1
- 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/radio/bq-radio.d.ts +2 -1
- package/dist/types/components.d.ts +437 -350
- package/dist/types/shared/utils/event.d.ts +1 -1
- package/dist/types/shared/utils/slot.d.ts +1 -1
- package/package.json +1 -1
- package/dist/beeq/p-0cfa8d0b.entry.js +0 -6
- package/dist/beeq/p-0cfa8d0b.entry.js.map +0 -1
- package/dist/beeq/p-25772ebd.entry.js.map +0 -1
- package/dist/beeq/p-365f0372.entry.js.map +0 -1
- package/dist/beeq/p-53ea5999.entry.js +0 -6
- package/dist/beeq/p-53ea5999.entry.js.map +0 -1
- package/dist/beeq/p-79aab4dd.entry.js +0 -6
- package/dist/beeq/p-b7c6fdbd.entry.js.map +0 -1
- package/dist/beeq/p-d4df64ae.entry.js +0 -6
- 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-CfP6le1E.js +0 -6
- package/dist/types/components/date-picker/libs/callyLibrary.d.ts +0 -15
- /package/dist/beeq/{p-49a999b4.entry.js.map → p-1a2c4878.entry.js.map} +0 -0
- /package/dist/beeq/{p-8974f66f.entry.js.map → p-2e1fffcd.entry.js.map} +0 -0
- /package/dist/beeq/{p-b31d249b.entry.js.map → p-38006c8e.entry.js.map} +0 -0
- /package/dist/beeq/{p-0a3c5b97.entry.js.map → p-5eba392c.entry.js.map} +0 -0
- /package/dist/beeq/{p-fe22de00.entry.js.map → p-6a38fcaf.entry.js.map} +0 -0
- /package/dist/beeq/{p-ef783b95.entry.js.map → p-72ff2fe2.entry.js.map} +0 -0
- /package/dist/beeq/{p-fb763ec5.entry.js.map → p-8bd7f4c2.entry.js.map} +0 -0
- /package/dist/beeq/{p-f07f4d99.entry.js.map → p-9413a4d3.entry.js.map} +0 -0
- /package/dist/beeq/{p-7972ba08.entry.js.map → p-a55354ee.entry.js.map} +0 -0
- /package/dist/beeq/{p-84e96891.entry.js.map → p-d792e3d3.entry.js.map} +0 -0
- /package/dist/beeq/{p-5645238d.entry.js.map → p-e9a1b183.entry.js.map} +0 -0
- /package/dist/beeq/{p-b6f5430a.entry.js.map → p-f891fb4b.entry.js.map} +0 -0
- /package/dist/components/{p-CK3SnGa2.js.map → p-BBCVL6R0.js.map} +0 -0
- /package/dist/components/{p-2bpX-u8x.js.map → p-v3c5-Hhf.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["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","next","table","head","tr","th","week","td","day","today","selected","outside","disallowed","disabled","rangeStart","rangeEnd","rangeInner","months","month","monthSelected","years","year","yearSelected","calendarTrigger","DECADE_GRID_SIZE","MAX_MONTHS_PER_VIEW","boundYear","iso","match","exec","Number","boundYearMonth","isYearWithinBounds","min","max","minYear","maxYear","monthAtOrAfter","bound","ym","y","monthAtOrBefore","isMonthWithinBounds","padBound","kind","yearMatch","String","Date","getDate","padStart","parseISO","test","m","d","split","map","date","getFullYear","getMonth","toISO","toLocaleDateString","ISO_DATE_LOCALE","isValidISO","startOfMonth","endOfMonth","addDays","amount","setDate","addMonths","Math","addYears","setFullYear","isSameDay","a","b","compareISO","buildMonthMatrix","anchor","firstDayOfWeek","start","offset","getDay","gridStart","cells","i","push","rows","r","slice","getDecadeStart","floor","clampDate","minISO","maxISO","isWithinBounds","minPadded","maxPadded","sortRange","cache","Map","CACHE_MAX_SIZE","cacheKey","locale","options","localeKey","JSON","stringify","getFormatter","key","formatter","get","Intl","DateTimeFormat","set","size","firstKey","keys","value","undefined","delete","formatMonth","monthStyle","includeYear","format","formatYear","getWeekdayNames","style","shortFormatter","weekday","longFormatter","Array","from","length","_","dayIndex","short","long","getMonthNames","PRECISION_ISO_REGEX","expandToken","token","precision","truncateISO","isValidToken","parseValue","type","trimmed","trim","parts","filter","end","valid","Set","sort","serializeValue","selection","join","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","parseDateInput","invalid","clampISO","toISODateString","paddedMin","paddedMax","getHeaderLabel","decadeStart","monthCount","first","last","startYear","endYear","getHeaderTitleLabel","getPreviousLabel","getNextLabel","advanceFocusedMonth","delta","advanceFocusedYear","nextDecadeStart","getGridColumns","normalizeValue","raw","serialized","computeHasValue","isDefined","computeDisplayDate","formatOptions","expanded","formatDisplayValue","DEFAULT_FORMAT_OPTIONS_BY_PRECISION","bqDatePickerCss","defaultValidityMessage","flags","badInput","rangeUnderflow","rangeOverflow","BqDatePicker","cachedSelection","hasBadInput","initialValue","inputElem","isCommittingSelection","labelElem","pendingFocusRAF","prefixElem","triggerBtnElem","internals","displayDate","getTodayISO","hasConstraintError","hasLabel","hasPrefix","hasValue","tentativeHover","autofocus","clearButtonLabel","calendarButtonLabel","disableClear","distance","form","formValidationMessage","initialView","monthsPerView","open","panelHeight","placeholder","placement","required","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","clear","clearValue","handleBlur","handleFocus","handleInputChange","isHTMLElement","target","inputValue","setFormValue","handleClearClick","stopPropagation","handleTriggerClick","handleInputKeyDown","preventDefault","hasSlotContent","updateFormValidity","validationMessage","defaultMessage","current","isNil","boundsFlags","computeBoundsValidityFlags","hasCustomConstraintError","Object","validity","message","states","add","setValidity","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/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":["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":";;;;2WAcO,MAAMA,EAAmB,CAAC,QAAS,OAAQ,UAAW,WCZtD,MAAMC,EAAsC,CAAC,EAAG,EAAG,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