@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
|
@@ -3,36 +3,56 @@
|
|
|
3
3
|
* © https://beeq.design - Apache 2 License.
|
|
4
4
|
*/
|
|
5
5
|
import { h } from "@stencil/core";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
6
|
+
import { getTodayISO, hasSlotContent, isEventTargetChildOfElement, isHTMLElement, isNil, updateFormValidity, validatePropValue, } from "../../shared/utils";
|
|
7
|
+
import { INPUT_VALIDATION } from "../input/bq-input.types";
|
|
8
|
+
import { CALENDAR_VIEW, DATE_PICKER_TYPE, DATE_PRECISION, DAYS_OF_WEEK, FLOATING_PLACEMENT, FLOATING_STRATEGY, MONTHS_PER_VIEW, } from "./bq-date-picker.types";
|
|
9
|
+
import { CalendarDayView } from "./components/CalendarDayView";
|
|
10
|
+
import { CalendarHeader } from "./components/CalendarHeader";
|
|
11
|
+
import { CalendarMonthView } from "./components/CalendarMonthView";
|
|
12
|
+
import { CalendarYearView } from "./components/CalendarYearView";
|
|
13
|
+
import { isMonthWithinBounds, isYearWithinBounds, padBound } from "./helper/bounds";
|
|
14
|
+
import { addDays, addMonths, addYears, clampDate, endOfMonth, getDecadeStart, isWithinBounds, parseISO, startOfMonth, toISO, } from "./helper/calendar";
|
|
15
|
+
import { CALENDAR_PARTS, DECADE_GRID_SIZE, DEFAULT_INPUT_ID, MAX_MONTHS_PER_VIEW } from "./helper/constants";
|
|
16
|
+
import { parseTypedInput } from "./helper/input";
|
|
17
|
+
import { formatMonth } from "./helper/intl";
|
|
18
|
+
import { getHeaderLabel, getHeaderTitleLabel, getNextLabel, getPreviousLabel } from "./helper/labels";
|
|
19
|
+
import { advanceFocusedMonth, advanceFocusedYear, getGridColumns } from "./helper/navigation";
|
|
20
|
+
import { applySelection, buildTentativeRange, parseValue, serializeValue } from "./helper/selection";
|
|
21
|
+
import { computeDisplayDate, computeHasValue, DEFAULT_FORMAT_OPTIONS_BY_PRECISION, normalizeValue, } from "./helper/value";
|
|
22
|
+
/** Compose the default constraint-validation message for a set of flags. */
|
|
23
|
+
const defaultValidityMessage = (flags) => {
|
|
24
|
+
if (flags.badInput)
|
|
25
|
+
return 'Please, input or select a valid date';
|
|
26
|
+
if (flags.rangeUnderflow && flags.rangeOverflow)
|
|
27
|
+
return 'Selected value is outside the allowed range';
|
|
28
|
+
if (flags.rangeUnderflow)
|
|
29
|
+
return 'Selected value is before the minimum';
|
|
30
|
+
return 'Selected value is after the maximum';
|
|
31
|
+
};
|
|
10
32
|
/**
|
|
11
|
-
* The Date Picker is a
|
|
33
|
+
* The Date Picker is a pure-Stencil calendar input.
|
|
34
|
+
*
|
|
35
|
+
* It supports single, multi, and range selection, three navigation views
|
|
36
|
+
* (days → months → years), full localization via `Intl.DateTimeFormat`,
|
|
37
|
+
* multi-month side-by-side rendering, and RTL layouts.
|
|
12
38
|
*
|
|
13
39
|
* @example How to use it
|
|
14
40
|
* ```html
|
|
15
41
|
* <bq-date-picker
|
|
16
42
|
* first-day-of-week="1"
|
|
17
43
|
* locale="en-GB"
|
|
18
|
-
* months-per-view="single"
|
|
19
|
-
* months="2"
|
|
20
44
|
* name="bq-date-picker"
|
|
21
45
|
* placeholder="Enter your date"
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* type="range"
|
|
25
|
-
* validation-status="none"
|
|
26
|
-
* value="2024-05-25"
|
|
46
|
+
* type="single"
|
|
47
|
+
* value="2026-07-15"
|
|
27
48
|
* >
|
|
28
|
-
* <label
|
|
29
|
-
* Date picker label
|
|
30
|
-
* </label>
|
|
49
|
+
* <label slot="label">Date picker label</label>
|
|
31
50
|
* </bq-date-picker>
|
|
32
51
|
* ```
|
|
33
52
|
*
|
|
34
|
-
* @documentation https://
|
|
35
|
-
*
|
|
53
|
+
* @documentation https://storybook.beeq.design/?path=/docs/components-date-picker--docs
|
|
54
|
+
*
|
|
55
|
+
* @status experimental
|
|
36
56
|
*
|
|
37
57
|
* @dependency bq-button
|
|
38
58
|
* @dependency bq-dropdown
|
|
@@ -40,104 +60,141 @@ import { isCallyLibraryLoaded, loadCallyLibrary } from "./libs/callyLibrary";
|
|
|
40
60
|
*
|
|
41
61
|
* @attr {boolean} autofocus - If `true`, the Date picker input will be focused on component render.
|
|
42
62
|
* @attr {string} clear-button-label - The clear button aria label.
|
|
63
|
+
* @attr {string} calendar-button-label - The aria-label for the calendar trigger button.
|
|
43
64
|
* @attr {boolean} disable-clear - If `true`, the clear button won't be displayed.
|
|
44
65
|
* @attr {boolean} disabled - Indicates whether the Date picker input is disabled or not.
|
|
45
|
-
* @attr {number} distance - Represents the distance
|
|
46
|
-
* @attr {0 | 1 | 2 | 3 | 4 | 5 | 6} first-day-of-week - The first day of the week
|
|
47
|
-
* @attr {Intl.DateTimeFormatOptions} format-options -
|
|
48
|
-
* @attr {string} form - The
|
|
49
|
-
* @attr {string} form-validation-message -
|
|
50
|
-
* @attr {
|
|
51
|
-
* @attr {
|
|
52
|
-
* @attr {
|
|
53
|
-
* @attr {string}
|
|
54
|
-
* @attr {
|
|
55
|
-
* @attr {
|
|
56
|
-
* @attr {
|
|
57
|
-
* @attr {string}
|
|
58
|
-
* @attr {
|
|
59
|
-
* @attr {
|
|
60
|
-
* @attr {
|
|
61
|
-
* @attr {
|
|
62
|
-
* @attr {
|
|
63
|
-
* @attr {
|
|
64
|
-
* @attr {
|
|
65
|
-
* @attr {"
|
|
66
|
-
* @attr {
|
|
66
|
+
* @attr {number} distance - Represents the distance between the panel and the input.
|
|
67
|
+
* @attr {0 | 1 | 2 | 3 | 4 | 5 | 6} first-day-of-week - The first day of the week (0 = Sunday).
|
|
68
|
+
* @attr {Intl.DateTimeFormatOptions} format-options - Display formatting options.
|
|
69
|
+
* @attr {string} form - The form ID the input belongs to.
|
|
70
|
+
* @attr {string} form-validation-message - Custom native form validation message.
|
|
71
|
+
* @attr {"days" | "months" | "years"} initial-view - The view to open when the panel first opens.
|
|
72
|
+
* @attr {function} is-date-disallowed - Predicate that marks specific dates as unselectable.
|
|
73
|
+
* @attr {Intl.LocalesArgument} locale - Locale used for formatting.
|
|
74
|
+
* @attr {string} max - Latest selectable date (ISO).
|
|
75
|
+
* @attr {string} min - Earliest selectable date (ISO).
|
|
76
|
+
* @attr {number} months - Number of month panels to render side by side (range/multi). Capped at 2.
|
|
77
|
+
* @attr {"single" | "months"} months-per-view - Prev/Next step size when multi-month is enabled.
|
|
78
|
+
* @attr {string} name - Input name.
|
|
79
|
+
* @attr {boolean} open - If `true`, the panel is visible.
|
|
80
|
+
* @attr {string} panel-height - Overrides the height of the panel.
|
|
81
|
+
* @attr {string} placeholder - Input placeholder text.
|
|
82
|
+
* @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.
|
|
83
|
+
* @attr {boolean} required - Whether a value must be selected before submitting the form.
|
|
84
|
+
* @attr {boolean} show-outside-days - Whether to render days that belong to adjacent months.
|
|
85
|
+
* @attr {number} skidding - Skidding between the panel and the trigger.
|
|
86
|
+
* @attr {"fixed" | "absolute"} strategy - Positioning strategy for the panel.
|
|
87
|
+
* @attr {"single" | "multi" | "range"} type - Selection mode.
|
|
88
|
+
* @attr {"error" | "none" | "success" | "warning"} validation-status - Validation state.
|
|
89
|
+
* @attr {string} value - The current selection, as a wire-format string. Shape depends on `type` and `precision`:
|
|
90
|
+
* • **single**: a single ISO token — `YYYY-MM-DD` (precision `day`), `YYYY-MM` (precision `month`), `YYYY` (precision `year`).
|
|
91
|
+
* • **range**: `start/end` (two tokens joined with `/`) at the same precision.
|
|
92
|
+
* • **multi**: space-separated tokens at the same precision.
|
|
93
|
+
* Bounds (`min`/`max`) may be supplied at any of these precisions and are honoured accordingly.
|
|
94
|
+
* @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"`.
|
|
67
95
|
*
|
|
68
96
|
* @method clear - Clears the selected value.
|
|
69
97
|
*
|
|
70
|
-
* @event bqBlur -
|
|
71
|
-
* @event bqChange -
|
|
72
|
-
* @event bqClear -
|
|
73
|
-
* @event bqFocus -
|
|
98
|
+
* @event bqBlur - Emitted when the input loses focus.
|
|
99
|
+
* @event bqChange - Emitted when the value changes.
|
|
100
|
+
* @event bqClear - Emitted when the value is cleared.
|
|
101
|
+
* @event bqFocus - Emitted when the input receives focus.
|
|
102
|
+
* @event bqViewChange - Emitted when the internal calendar view changes (days ↔ months ↔ years).
|
|
103
|
+
*
|
|
104
|
+
* @slot label - The label displayed above the input.
|
|
105
|
+
* @slot prefix - Content rendered before the input value.
|
|
106
|
+
* @slot suffix - Icon rendered inside the calendar trigger button (defaults to a calendar icon).
|
|
107
|
+
* @slot clear-icon - Icon used inside the clear button.
|
|
74
108
|
*
|
|
75
109
|
* @part base - The component's base wrapper.
|
|
76
|
-
* @part button - The native HTML button used under the hood in the clear button.
|
|
77
|
-
* @part calendar__button - Any button used in the calendar-month component.
|
|
78
|
-
* @part calendar__button - Any button within the calendar-range component.
|
|
79
|
-
* @part calendar__container - The calendar-range container for the entire component.
|
|
80
|
-
* @part calendar__day - The buttons corresponding to each day in the calendar-month grid.
|
|
81
|
-
* @part calendar__disabled - A button that is disabled due to min/max on the calendar-range component.
|
|
82
|
-
* @part calendar__disallowed - Any day that has been disallowed via isDateDisallowed.
|
|
83
|
-
* @part calendar__head - The calendar-month table's header row.
|
|
84
|
-
* @part calendar__header - The calendar-range container for the heading and buttons.
|
|
85
|
-
* @part calendar__heading - The calendar-month heading container that labels the month.
|
|
86
|
-
* @part calendar__heading - The calendar-range heading containing the month and year.
|
|
87
|
-
* @part calendar__next - The next page button on the calendar-range component.
|
|
88
|
-
* @part calendar__outside - Any days which are outside the current month.
|
|
89
|
-
* @part calendar__previous - The previous page button on the calendar-range component.
|
|
90
|
-
* @part calendar__range-end - The day at the end of a date range.
|
|
91
|
-
* @part calendar__range-inner - Any days between the start and end of a date range.
|
|
92
|
-
* @part calendar__range-start - The day at the start of a date range.
|
|
93
|
-
* @part calendar__selected - Any days which are selected.
|
|
94
|
-
* @part calendar__table - The calendar-month <table> element.
|
|
95
|
-
* @part calendar__td - The calendar-month table's body cells.
|
|
96
|
-
* @part calendar__th - The calendar-month table's header cells.
|
|
97
|
-
* @part calendar__today - The Today's day.
|
|
98
|
-
* @part calendar__tr - Any row within the table on the calendar-month component.
|
|
99
|
-
* @part calendar__week - The calendar-month table's body rows.
|
|
100
|
-
* @part clear-btn - The clear button.
|
|
101
|
-
* @part control - The input control wrapper.
|
|
102
|
-
* @part input - The native HTML input element used under the hood.
|
|
103
110
|
* @part label - The label slot container.
|
|
104
|
-
* @part
|
|
111
|
+
* @part control - The input control wrapper.
|
|
105
112
|
* @part prefix - The prefix slot container.
|
|
106
113
|
* @part suffix - The suffix slot container.
|
|
114
|
+
* @part input - The native input element.
|
|
115
|
+
* @part clear-btn - The clear button.
|
|
116
|
+
* @part calendar-trigger - The calendar icon trigger button.
|
|
117
|
+
* @part button - Any button rendered inside the calendar (nav or day/month/year cell).
|
|
118
|
+
* @part panel - The dropdown panel container.
|
|
119
|
+
* @part calendar__container - The calendar panels wrapper.
|
|
120
|
+
* @part calendar__header - The header row (prev / title / next).
|
|
121
|
+
* @part calendar__heading - The header title button (or month label above a panel).
|
|
122
|
+
* @part calendar__previous - The previous navigation button.
|
|
123
|
+
* @part calendar__next - The next navigation button.
|
|
124
|
+
* @part calendar__table - The day-view `<table>` element.
|
|
125
|
+
* @part calendar__head - The day-view table header row wrapper.
|
|
126
|
+
* @part calendar__tr - Any row within the day-view table.
|
|
127
|
+
* @part calendar__th - The day-view weekday header cells.
|
|
128
|
+
* @part calendar__week - Body rows in the day-view table.
|
|
129
|
+
* @part calendar__td - Body cells in the day-view table.
|
|
130
|
+
* @part calendar__day - Any day button in the day view.
|
|
131
|
+
* @part calendar__today - The button representing today's date.
|
|
132
|
+
* @part calendar__selected - Any selected day.
|
|
133
|
+
* @part calendar__outside - Any day outside the visible month.
|
|
134
|
+
* @part calendar__disallowed - Any day rejected by `isDateDisallowed`.
|
|
135
|
+
* @part calendar__disabled - Any button disabled by min/max.
|
|
136
|
+
* @part calendar__range-start - The first day of a range selection.
|
|
137
|
+
* @part calendar__range-end - The last day of a range selection.
|
|
138
|
+
* @part calendar__range-inner - Days between the start and end of a range.
|
|
139
|
+
* @part calendar__months - The month-view grid.
|
|
140
|
+
* @part calendar__month - Any month button.
|
|
141
|
+
* @part calendar__month-selected - The currently selected month.
|
|
142
|
+
* @part calendar__years - The year-view grid.
|
|
143
|
+
* @part calendar__year - Any year button.
|
|
144
|
+
* @part calendar__year-selected - The currently selected year.
|
|
107
145
|
*
|
|
108
|
-
* @cssprop --bq-date-picker--background-color -
|
|
109
|
-
* @cssprop --bq-date-picker--border-color -
|
|
110
|
-
* @cssprop --bq-date-picker--border-color-disabled -
|
|
111
|
-
* @cssprop --bq-date-picker--border-color-focus -
|
|
112
|
-
* @cssprop --bq-date-picker--border-radius -
|
|
113
|
-
* @cssprop --bq-date-picker--border-style -
|
|
114
|
-
* @cssprop --bq-date-picker--border-width -
|
|
115
|
-
* @cssprop --bq-date-picker--currentDate-border-color -
|
|
116
|
-
* @cssprop --bq-date-picker--currentDate-border-width -
|
|
117
|
-
* @cssprop --bq-date-picker--day-size -
|
|
118
|
-
* @cssprop --bq-date-picker--gap - Gap between
|
|
119
|
-
* @cssprop --bq-date-picker--
|
|
120
|
-
* @cssprop --bq-date-picker--
|
|
121
|
-
* @cssprop --bq-date-picker--label-
|
|
122
|
-
* @cssprop --bq-date-picker--label-text-
|
|
123
|
-
* @cssprop --bq-date-picker--
|
|
124
|
-
* @cssprop --bq-date-picker--padding-
|
|
125
|
-
* @cssprop --bq-date-picker--
|
|
126
|
-
* @cssprop --bq-date-picker--
|
|
127
|
-
* @cssprop --bq-date-picker--range-
|
|
128
|
-
* @cssprop --bq-date-picker--
|
|
129
|
-
* @cssprop --bq-date-picker--
|
|
130
|
-
* @cssprop --bq-date-picker--text-
|
|
146
|
+
* @cssprop --bq-date-picker--background-color - Input background color.
|
|
147
|
+
* @cssprop --bq-date-picker--border-color - Input border color.
|
|
148
|
+
* @cssprop --bq-date-picker--border-color-disabled - Border color when disabled.
|
|
149
|
+
* @cssprop --bq-date-picker--border-color-focus - Border color on focus.
|
|
150
|
+
* @cssprop --bq-date-picker--border-radius - Input border radius.
|
|
151
|
+
* @cssprop --bq-date-picker--border-style - Border style.
|
|
152
|
+
* @cssprop --bq-date-picker--border-width - Border width.
|
|
153
|
+
* @cssprop --bq-date-picker--currentDate-border-color - Border color for today's date.
|
|
154
|
+
* @cssprop --bq-date-picker--currentDate-border-width - Border width for today's date.
|
|
155
|
+
* @cssprop --bq-date-picker--day-size - Size of a day cell in the calendar.
|
|
156
|
+
* @cssprop --bq-date-picker--gap - Gap between the input content and prefix/suffix.
|
|
157
|
+
* @cssprop --bq-date-picker--header-title-color - Color of the per-panel month label in multi-panel view.
|
|
158
|
+
* @cssprop --bq-date-picker--icon-size - Size of the icons used in prefix/suffix/clear.
|
|
159
|
+
* @cssprop --bq-date-picker--label-margin-bottom - Space below the label.
|
|
160
|
+
* @cssprop --bq-date-picker--label-text-color - Label text color.
|
|
161
|
+
* @cssprop --bq-date-picker--label-text-size - Label text size.
|
|
162
|
+
* @cssprop --bq-date-picker--padding-end - Input padding end.
|
|
163
|
+
* @cssprop --bq-date-picker--padding-start - Input padding start.
|
|
164
|
+
* @cssprop --bq-date-picker--paddingY - Input vertical padding.
|
|
165
|
+
* @cssprop --bq-date-picker--range-background-color - Background color for range start/end days.
|
|
166
|
+
* @cssprop --bq-date-picker--range-inner-background-color - Background color for inner range days.
|
|
167
|
+
* @cssprop --bq-date-picker--row-gap - Vertical space between day-grid rows.
|
|
168
|
+
* @cssprop --bq-date-picker--text-color - Input text color.
|
|
169
|
+
* @cssprop --bq-date-picker--text-placeholder-color - Placeholder text color.
|
|
170
|
+
* @cssprop --bq-date-picker--text-size - Input text size.
|
|
171
|
+
* @cssprop --bq-date-picker--view-cell-background-hover - Hover background for day/month/year cells.
|
|
172
|
+
* @cssprop --bq-date-picker--view-cell-background-selected - Selected background for day/month/year cells.
|
|
173
|
+
* @cssprop --bq-date-picker--view-cell-height - Height of month/year cells.
|
|
174
|
+
* @cssprop --bq-date-picker--view-cell-radius - Border radius of day/month/year cells.
|
|
175
|
+
* @cssprop --bq-date-picker--view-cell-text-selected - Text color for selected day/month/year cells.
|
|
131
176
|
*/
|
|
132
177
|
export class BqDatePicker {
|
|
133
178
|
// Own Properties
|
|
134
179
|
// ====================
|
|
135
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Memoized parsed selection. Key encodes both `value` and `type` so cache
|
|
182
|
+
* misses invalidate correctly. Value derives from `value`; not promoted to
|
|
183
|
+
* `@State()` to preserve a single source of truth.
|
|
184
|
+
*/
|
|
185
|
+
cachedSelection;
|
|
186
|
+
/** Sticky flag: last typed input couldn't be parsed. Cleared on next successful commit or `clear()`. */
|
|
187
|
+
hasBadInput = false;
|
|
188
|
+
/** Initial `value` captured at load time, restored on form reset. */
|
|
189
|
+
initialValue;
|
|
136
190
|
inputElem;
|
|
137
|
-
|
|
191
|
+
/** Set while `commitSelection` writes back to `this.value`. */
|
|
192
|
+
isCommittingSelection = false;
|
|
138
193
|
labelElem;
|
|
194
|
+
/** Pending requestAnimationFrame id used by `focusButton`. */
|
|
195
|
+
pendingFocusRAF;
|
|
139
196
|
prefixElem;
|
|
140
|
-
|
|
197
|
+
triggerBtnElem;
|
|
141
198
|
// Reference to host HTML element
|
|
142
199
|
// ===================================
|
|
143
200
|
internals;
|
|
@@ -145,158 +202,275 @@ export class BqDatePicker {
|
|
|
145
202
|
// State() variables
|
|
146
203
|
// Inlined decorator, alphabetical order
|
|
147
204
|
// =======================================
|
|
148
|
-
|
|
149
|
-
focusedDate;
|
|
205
|
+
decadeStart = getDecadeStart(new Date().getFullYear());
|
|
150
206
|
displayDate;
|
|
207
|
+
focusedISO = getTodayISO();
|
|
208
|
+
focusedMonth = new Date().getMonth();
|
|
209
|
+
focusedYear = new Date().getFullYear();
|
|
210
|
+
hasConstraintError = false;
|
|
151
211
|
hasLabel = false;
|
|
152
212
|
hasPrefix = false;
|
|
153
|
-
hasRangeEnd = false;
|
|
154
|
-
hasSuffix = false;
|
|
155
213
|
hasValue = false;
|
|
214
|
+
tentativeHover;
|
|
215
|
+
view = 'days';
|
|
216
|
+
viewDate = new Date();
|
|
156
217
|
// Public Property API
|
|
157
218
|
// ========================
|
|
158
|
-
/** If `true`, the Date picker input will be focused on component render */
|
|
159
|
-
autofocus;
|
|
160
|
-
/** The clear button aria label */
|
|
219
|
+
/** If `true`, the Date picker input will be focused on component render. */
|
|
220
|
+
autofocus = false;
|
|
221
|
+
/** The clear button aria label. */
|
|
161
222
|
clearButtonLabel = 'Clear value';
|
|
162
|
-
/**
|
|
223
|
+
/** The aria-label for the calendar trigger button. */
|
|
224
|
+
calendarButtonLabel = 'Open calendar';
|
|
225
|
+
/** If `true`, the clear button won't be displayed. */
|
|
163
226
|
disableClear = false;
|
|
164
|
-
/**
|
|
165
|
-
* Indicates whether the Date picker input is disabled or not.
|
|
166
|
-
* If `true`, the Date picker is disabled and cannot be interacted with.
|
|
167
|
-
*/
|
|
227
|
+
/** Indicates whether the Date picker input is disabled or not. */
|
|
168
228
|
disabled = false;
|
|
169
|
-
/**
|
|
229
|
+
/** Distance (gutter) between the Date picker panel and the input element. */
|
|
170
230
|
distance = 8;
|
|
171
|
-
/** The first day of the week, where Sunday is 0, Monday is 1, etc */
|
|
231
|
+
/** The first day of the week, where Sunday is 0, Monday is 1, etc. */
|
|
172
232
|
firstDayOfWeek = 1;
|
|
173
|
-
/**
|
|
174
|
-
*
|
|
233
|
+
/**
|
|
234
|
+
* Options used when formatting the displayed value.
|
|
235
|
+
*
|
|
236
|
+
* When omitted, sensible defaults are picked based on `precision`:
|
|
237
|
+
* - `day` → `{ day: 'numeric', month: 'short', year: 'numeric' }`
|
|
238
|
+
* - `month` → `{ month: 'long', year: 'numeric' }`
|
|
239
|
+
* - `year` → `{ year: 'numeric' }`
|
|
175
240
|
*/
|
|
176
|
-
formatOptions
|
|
177
|
-
|
|
178
|
-
month: 'short',
|
|
179
|
-
year: 'numeric',
|
|
180
|
-
};
|
|
181
|
-
/** The ID of the form that the Date picker input belongs to. */
|
|
241
|
+
formatOptions;
|
|
242
|
+
/** The ID of the form the input belongs to. */
|
|
182
243
|
form;
|
|
183
|
-
/**
|
|
244
|
+
/** Native form validation message (mandatory if `required` is set). */
|
|
184
245
|
formValidationMessage;
|
|
185
|
-
/**
|
|
246
|
+
/** The view opened first when the panel becomes visible. */
|
|
247
|
+
initialView = 'days';
|
|
248
|
+
/** Predicate that marks specific dates as unselectable. */
|
|
186
249
|
isDateDisallowed;
|
|
187
|
-
/**
|
|
188
|
-
* Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument
|
|
189
|
-
*/
|
|
250
|
+
/** Locale used for formatting dates. */
|
|
190
251
|
locale = 'en-GB';
|
|
191
|
-
/**
|
|
252
|
+
/** Latest date that can be selected (ISO). */
|
|
192
253
|
max;
|
|
193
|
-
/**
|
|
254
|
+
/** Earliest date that can be selected (ISO). */
|
|
194
255
|
min;
|
|
195
|
-
/** Number of months to show when range is `true` */
|
|
196
|
-
months;
|
|
197
256
|
/**
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
257
|
+
* Number of months to show side by side (range / multi). Capped at 2.
|
|
258
|
+
* Larger values are silently clamped to keep the popover from overflowing
|
|
259
|
+
* the viewport and to preserve keyboard navigation semantics.
|
|
260
|
+
*/
|
|
261
|
+
months = 1;
|
|
262
|
+
/**
|
|
263
|
+
* How the next/previous buttons should navigate the calendar.
|
|
264
|
+
* - single: navigate one month at a time.
|
|
265
|
+
* - months: navigate by the number of months displayed.
|
|
201
266
|
*/
|
|
202
267
|
monthsPerView = 'single';
|
|
203
268
|
/** The Date picker input name. */
|
|
204
269
|
name;
|
|
205
|
-
/** If `true`, the
|
|
270
|
+
/** If `true`, the panel is visible. */
|
|
206
271
|
open = false;
|
|
207
|
-
/**
|
|
272
|
+
/** Overrides the height of the Date picker panel. */
|
|
208
273
|
panelHeight = 'auto';
|
|
209
|
-
/**
|
|
274
|
+
/** Placeholder text shown when no value is selected. */
|
|
210
275
|
placeholder;
|
|
211
|
-
/** Position of the Date picker panel */
|
|
276
|
+
/** Position of the Date picker panel. */
|
|
212
277
|
placement = 'bottom-end';
|
|
213
|
-
/**
|
|
214
|
-
|
|
215
|
-
|
|
278
|
+
/**
|
|
279
|
+
* Precision of the value produced by the picker.
|
|
280
|
+
*
|
|
281
|
+
* - `day` → `YYYY-MM-DD` (default). Standard drill-down.
|
|
282
|
+
* - `month` → `YYYY-MM`. Selection commits on the months view; no days view.
|
|
283
|
+
* - `year` → `YYYY`. Selection commits on the years view; no months/days view.
|
|
284
|
+
*
|
|
285
|
+
* When precision is coarser than day, `initialView` is forced to match and
|
|
286
|
+
* the header title cycles through the views available for that precision.
|
|
287
|
+
*/
|
|
288
|
+
precision = 'day';
|
|
289
|
+
/** Whether a value must be selected before submitting the form. */
|
|
290
|
+
required = false;
|
|
291
|
+
/** Skidding between the panel and the input element. */
|
|
216
292
|
skidding = 0;
|
|
217
|
-
/** Whether to
|
|
293
|
+
/** Whether to render days outside the current month. */
|
|
218
294
|
showOutsideDays = false;
|
|
219
|
-
/**
|
|
295
|
+
/** Positioning strategy for the panel. */
|
|
220
296
|
strategy = 'fixed';
|
|
221
|
-
/**
|
|
222
|
-
|
|
223
|
-
|
|
297
|
+
/**
|
|
298
|
+
* Selection type.
|
|
299
|
+
* - `single`: single date.
|
|
300
|
+
* - `multi`: multiple discrete dates.
|
|
301
|
+
* - `range`: contiguous range.
|
|
302
|
+
*/
|
|
224
303
|
type = 'single';
|
|
304
|
+
/** Validation state applied to the input. */
|
|
305
|
+
validationStatus = 'none';
|
|
225
306
|
/**
|
|
226
|
-
*
|
|
307
|
+
* Currently selected value, in the precision-aware wire format:
|
|
308
|
+
* - `precision="day"` → tokens are `YYYY-MM-DD`
|
|
309
|
+
* - `precision="month"` → tokens are `YYYY-MM`
|
|
310
|
+
* - `precision="year"` → tokens are `YYYY`
|
|
227
311
|
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* - `
|
|
231
|
-
* - `
|
|
232
|
-
* - `'warning'`: The input has a validation warning.
|
|
233
|
-
* - `'success'`: The input has passed validation.
|
|
312
|
+
* How multiple tokens are combined depends on `type`:
|
|
313
|
+
* - `single` → a single token (e.g. `"2025-05-15"`, `"2025-05"`, `"2025"`)
|
|
314
|
+
* - `range` → `"start/end"` — two tokens joined with `/`
|
|
315
|
+
* - `multi` → space-separated tokens (e.g. `"2025-05-15 2025-05-20"`)
|
|
234
316
|
*/
|
|
235
|
-
validationStatus = 'none';
|
|
236
|
-
/** The select input value represents the currently selected date or range and can be used to reset the field to a previous value.
|
|
237
|
-
* All dates are expected in ISO-8601 format (YYYY-MM-DD). */
|
|
238
317
|
value;
|
|
239
318
|
// Prop lifecycle events
|
|
240
319
|
// =======================
|
|
241
320
|
handleValueChange(newValue, oldValue) {
|
|
242
321
|
if (newValue === oldValue)
|
|
243
322
|
return;
|
|
244
|
-
|
|
245
|
-
|
|
323
|
+
// Normalize invalid tokens before propagating to the form or the UI so
|
|
324
|
+
// consumers can't submit an invalid wire value while the display shows
|
|
325
|
+
// nothing. If normalization rewrote the value, reflect it back on the
|
|
326
|
+
// prop and let the follow-up watcher tick handle the normalized string.
|
|
327
|
+
const normalized = normalizeValue(newValue, this.type, this.precision);
|
|
328
|
+
if (normalized !== newValue) {
|
|
329
|
+
this.value = normalized;
|
|
246
330
|
return;
|
|
247
|
-
|
|
248
|
-
this.
|
|
249
|
-
this.
|
|
250
|
-
this.
|
|
251
|
-
|
|
331
|
+
}
|
|
332
|
+
this.hasBadInput = false;
|
|
333
|
+
this.syncDerivedFromValue();
|
|
334
|
+
if (this.isCommittingSelection)
|
|
335
|
+
return;
|
|
336
|
+
this.syncViewToValue();
|
|
337
|
+
}
|
|
338
|
+
handleFormattingChange() {
|
|
339
|
+
// Re-format the display without re-parsing the wire value.
|
|
340
|
+
this.hasValue = computeHasValue(this.value);
|
|
341
|
+
this.displayDate = computeDisplayDate(this.value, this.type, this.locale, this.effectiveFormatOptions, this.precision);
|
|
342
|
+
}
|
|
343
|
+
handleTypeChange() {
|
|
344
|
+
// `type` affects wire-format parsing, display formatting, and validity.
|
|
345
|
+
// Re-normalize the current value against the new type; if that rewrites
|
|
346
|
+
// the value, the `value` watcher takes over. Otherwise refresh derived
|
|
347
|
+
// state and re-sync the visible calendar range.
|
|
348
|
+
const normalized = normalizeValue(this.value, this.type, this.precision);
|
|
349
|
+
if (normalized !== this.value) {
|
|
350
|
+
this.value = normalized;
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
this.syncDerivedFromValue();
|
|
354
|
+
this.syncViewToValue();
|
|
355
|
+
}
|
|
356
|
+
handlePrecisionChange() {
|
|
357
|
+
validatePropValue(DATE_PRECISION, 'day', this.el, 'precision');
|
|
358
|
+
// Precision affects both wire format and default view. Force the calendar
|
|
359
|
+
// to open on the matching view and re-normalize the current value so
|
|
360
|
+
// trailing day/month segments are dropped or padded consistently.
|
|
361
|
+
this.view = this.precisionToView(this.precision);
|
|
362
|
+
const normalized = normalizeValue(this.value, this.type, this.precision);
|
|
363
|
+
if (normalized !== this.value) {
|
|
364
|
+
this.value = normalized;
|
|
365
|
+
return;
|
|
366
|
+
}
|
|
367
|
+
this.syncDerivedFromValue();
|
|
368
|
+
this.syncViewToValue();
|
|
369
|
+
}
|
|
370
|
+
handleBoundsChange() {
|
|
371
|
+
this.syncValidity();
|
|
372
|
+
this.syncViewToValue();
|
|
373
|
+
}
|
|
374
|
+
handleRequiredChange() {
|
|
375
|
+
this.syncValidity();
|
|
252
376
|
}
|
|
253
377
|
checkPropValues() {
|
|
254
378
|
validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');
|
|
379
|
+
validatePropValue(CALENDAR_VIEW, 'days', this.el, 'initialView');
|
|
380
|
+
validatePropValue(DATE_PRECISION, 'day', this.el, 'precision');
|
|
381
|
+
validatePropValue(MONTHS_PER_VIEW, 'single', this.el, 'monthsPerView');
|
|
382
|
+
validatePropValue(FLOATING_STRATEGY, 'fixed', this.el, 'strategy');
|
|
383
|
+
validatePropValue(FLOATING_PLACEMENT, 'bottom-end', this.el, 'placement');
|
|
384
|
+
validatePropValue(INPUT_VALIDATION, 'none', this.el, 'validationStatus');
|
|
385
|
+
validatePropValue(DAYS_OF_WEEK, 1, this.el, 'firstDayOfWeek');
|
|
386
|
+
}
|
|
387
|
+
handleMonthsChange() {
|
|
388
|
+
// Clamp `months` to an integer in [1, MAX_MONTHS_PER_VIEW]. Non-single
|
|
389
|
+
// pickers may show 1..MAX side-by-side; single pickers ignore the value
|
|
390
|
+
// in `getMonthCount()`, so we still clamp defensively to keep the prop
|
|
391
|
+
// reflected value predictable.
|
|
392
|
+
const clamped = this.clampMonths(this.months);
|
|
393
|
+
if (clamped !== this.months)
|
|
394
|
+
this.months = clamped;
|
|
395
|
+
}
|
|
396
|
+
handleOpen(open) {
|
|
397
|
+
if (!open) {
|
|
398
|
+
this.tentativeHover = undefined;
|
|
399
|
+
// Return focus to the calendar trigger button after closing the panel,
|
|
400
|
+
// so keyboard users don't lose their position in the document.
|
|
401
|
+
requestAnimationFrame(() => this.triggerBtnElem?.shadowRoot?.querySelector('button')?.focus());
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
// Precision locks the initial view; otherwise honor the consumer-provided one.
|
|
405
|
+
this.view = this.precision === 'day' ? this.initialView : this.precisionToView(this.precision);
|
|
406
|
+
this.syncViewToValue();
|
|
407
|
+
// Move keyboard focus into the calendar so screen-reader / keyboard users
|
|
408
|
+
// land on the focused day (or the equivalent focused cell for
|
|
409
|
+
// months/years views). Non-modal popup: focus is *moved*, not trapped.
|
|
410
|
+
this.focusActiveCell();
|
|
411
|
+
}
|
|
412
|
+
handleViewChange(next, prev) {
|
|
413
|
+
if (next === prev)
|
|
414
|
+
return;
|
|
415
|
+
this.bqViewChange.emit({ view: next, el: this.el });
|
|
255
416
|
}
|
|
256
417
|
// Events section
|
|
257
418
|
// Requires JSDocs for public API documentation
|
|
258
419
|
// ==============================================
|
|
259
|
-
/** Callback handler emitted when the input loses focus */
|
|
420
|
+
/** Callback handler emitted when the input loses focus. */
|
|
260
421
|
bqBlur;
|
|
261
422
|
/**
|
|
262
|
-
* Callback handler emitted when the input value
|
|
263
|
-
* This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.
|
|
423
|
+
* Callback handler emitted when the input value changes.
|
|
264
424
|
*/
|
|
265
425
|
bqChange;
|
|
266
|
-
/** Callback handler emitted when the
|
|
426
|
+
/** Callback handler emitted when the value is cleared. */
|
|
267
427
|
bqClear;
|
|
268
|
-
/** Callback handler emitted when the input
|
|
428
|
+
/** Callback handler emitted when the input receives focus. */
|
|
269
429
|
bqFocus;
|
|
430
|
+
/**
|
|
431
|
+
* Callback handler emitted when the internal calendar view changes
|
|
432
|
+
* (e.g. from `days` to `months`, or from `years` back to `days`).
|
|
433
|
+
*/
|
|
434
|
+
bqViewChange;
|
|
270
435
|
// Component lifecycle events
|
|
271
436
|
// Ordered by their natural call order
|
|
272
437
|
// =====================================
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
}
|
|
438
|
+
componentWillLoad() {
|
|
439
|
+
this.initialValue = this.value;
|
|
440
|
+
// Precision locks the initial view when set. Otherwise honor `initialView`.
|
|
441
|
+
// When the picker is rendered with `open` already true, `handleOpen` never
|
|
442
|
+
// fires — apply the preference here so the initial paint respects it.
|
|
443
|
+
this.view = this.precision === 'day' ? this.initialView : this.precisionToView(this.precision);
|
|
444
|
+
this.checkPropValues();
|
|
445
|
+
this.handleMonthsChange();
|
|
446
|
+
this.syncViewToValue();
|
|
283
447
|
}
|
|
284
448
|
componentDidLoad() {
|
|
285
449
|
this.handleSlotChange();
|
|
286
450
|
this.handleValueChange(this.value, undefined);
|
|
451
|
+
if (this.autofocus)
|
|
452
|
+
this.inputElem?.focus();
|
|
453
|
+
// `@Watch('open')` doesn't run for the initial prop value, so pickers
|
|
454
|
+
// rendered with `open` never move focus into the calendar. Do it here.
|
|
455
|
+
if (this.open)
|
|
456
|
+
this.focusActiveCell();
|
|
287
457
|
}
|
|
288
|
-
|
|
289
|
-
if (this.
|
|
290
|
-
this.
|
|
458
|
+
disconnectedCallback() {
|
|
459
|
+
if (this.pendingFocusRAF !== undefined) {
|
|
460
|
+
cancelAnimationFrame(this.pendingFocusRAF);
|
|
461
|
+
this.pendingFocusRAF = undefined;
|
|
291
462
|
}
|
|
292
463
|
}
|
|
293
464
|
formAssociatedCallback() {
|
|
294
|
-
this.
|
|
465
|
+
this.syncValidity();
|
|
295
466
|
}
|
|
296
467
|
formResetCallback() {
|
|
297
|
-
|
|
468
|
+
// Native form reset should restore the value the field had when the form
|
|
469
|
+
// was first parsed, not blank it. The `value` watcher takes care of
|
|
470
|
+
// syncing derived state, form value, and validity.
|
|
471
|
+
if (this.value === this.initialValue)
|
|
298
472
|
return;
|
|
299
|
-
this.
|
|
473
|
+
this.value = this.initialValue;
|
|
300
474
|
}
|
|
301
475
|
// Listeners
|
|
302
476
|
// ==============
|
|
@@ -308,15 +482,6 @@ export class BqDatePicker {
|
|
|
308
482
|
return;
|
|
309
483
|
this.open = open;
|
|
310
484
|
}
|
|
311
|
-
handleClickOutside(ev) {
|
|
312
|
-
const { open, type, hasRangeEnd } = this;
|
|
313
|
-
if (!open || type !== 'range' || ev.button !== 0)
|
|
314
|
-
return;
|
|
315
|
-
if (isEventTargetChildOfElement(ev, this.el) || hasRangeEnd)
|
|
316
|
-
return;
|
|
317
|
-
this.tentative = undefined;
|
|
318
|
-
this.hasRangeEnd = false;
|
|
319
|
-
}
|
|
320
485
|
// Public methods API
|
|
321
486
|
// These methods are exposed on the host element.
|
|
322
487
|
// Always use two lines.
|
|
@@ -324,255 +489,631 @@ export class BqDatePicker {
|
|
|
324
489
|
// Requires JSDocs for public API documentation.
|
|
325
490
|
// ===============================================
|
|
326
491
|
/**
|
|
327
|
-
* Clears the selected value
|
|
328
|
-
*
|
|
492
|
+
* Clears the selected value and any pending validation state (bad input,
|
|
493
|
+
* bounds overflow). Emits `bqClear`. No-op when the component is disabled.
|
|
494
|
+
*
|
|
495
|
+
* @returns A promise that resolves once the value has been cleared.
|
|
329
496
|
*/
|
|
330
497
|
async clear() {
|
|
331
498
|
if (this.disabled)
|
|
332
499
|
return;
|
|
333
|
-
this.
|
|
334
|
-
this.internals.setFormValue(undefined);
|
|
500
|
+
this.clearValue();
|
|
335
501
|
this.bqClear.emit(this.el);
|
|
336
502
|
}
|
|
337
503
|
// Local methods
|
|
338
504
|
// Internal business logic.
|
|
339
505
|
// These methods cannot be called from the host element.
|
|
340
506
|
// =======================================================
|
|
341
|
-
/**
|
|
342
|
-
* Handles the blur event for the date picker input.
|
|
343
|
-
* @returns {void}
|
|
344
|
-
*/
|
|
345
507
|
handleBlur = () => {
|
|
346
508
|
if (this.disabled)
|
|
347
509
|
return;
|
|
348
510
|
this.bqBlur.emit(this.el);
|
|
349
511
|
};
|
|
350
|
-
/**
|
|
351
|
-
* Handles the focus event for the date picker input.
|
|
352
|
-
* @returns {void}
|
|
353
|
-
*/
|
|
354
512
|
handleFocus = () => {
|
|
355
513
|
if (this.disabled)
|
|
356
514
|
return;
|
|
357
515
|
this.bqFocus.emit(this.el);
|
|
358
516
|
};
|
|
359
|
-
|
|
360
|
-
* Updates the focused date in the calendar component.
|
|
361
|
-
* Falls back to today's date if no value is set.
|
|
362
|
-
* @returns {void}
|
|
363
|
-
*/
|
|
364
|
-
setFocusedDate = () => {
|
|
365
|
-
const { callyElem, isCallyLoaded, value } = this;
|
|
366
|
-
if (!callyElem || !isCallyLoaded)
|
|
367
|
-
return;
|
|
368
|
-
const nextFocused = value ? extractFocusedDate(value) : getTodayISO();
|
|
369
|
-
if (this.focusedDate === nextFocused)
|
|
370
|
-
return;
|
|
371
|
-
this.focusedDate = nextFocused;
|
|
372
|
-
if (callyElem.focusedDate !== this.focusedDate) {
|
|
373
|
-
// We need to set the focused date in the calendar component via a ref
|
|
374
|
-
// because it doesn't work when passed as a prop (the Cally element does not re-render)
|
|
375
|
-
callyElem.focusedDate = this.focusedDate;
|
|
376
|
-
}
|
|
377
|
-
};
|
|
378
|
-
/**
|
|
379
|
-
* Handles user input changes with locale-aware date parsing.
|
|
380
|
-
* Validates against disallowed dates and min/max constraints.
|
|
381
|
-
* @param {Event} ev - The change event.
|
|
382
|
-
* @returns {void}
|
|
383
|
-
*/
|
|
384
|
-
handleChange = (ev) => {
|
|
517
|
+
handleInputChange = (ev) => {
|
|
385
518
|
if (this.disabled || !isHTMLElement(ev.target, 'input'))
|
|
386
519
|
return;
|
|
387
520
|
const inputValue = ev.target.value.trim();
|
|
388
521
|
if (!inputValue) {
|
|
522
|
+
this.hasBadInput = false;
|
|
389
523
|
this.clearValue();
|
|
390
524
|
this.bqChange.emit({ value: this.value, el: this.el });
|
|
391
525
|
return;
|
|
392
526
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
//
|
|
397
|
-
this.
|
|
398
|
-
this.
|
|
399
|
-
this.
|
|
400
|
-
|
|
401
|
-
}
|
|
402
|
-
// Check if date is disallowed
|
|
403
|
-
if (this.isDateDisallowed?.(dateValue)) {
|
|
404
|
-
this.internals.setFormValue(undefined);
|
|
405
|
-
this.updateFormValidity();
|
|
406
|
-
this.bqChange.emit({ value: inputValue, el: this.el });
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
// Valid date: normalize to ISO format and clamp to range if needed
|
|
410
|
-
// Note: clamping is done based on string comparison of ISO dates and only when min/max are set
|
|
411
|
-
let isoDate = toISODateString(dateValue);
|
|
412
|
-
isoDate = clampDateToRange(isoDate, this.min, this.max);
|
|
413
|
-
this.value = isoDate;
|
|
414
|
-
this.displayDate = formatDisplayValue(isoDate, this.type, this.locale, this.formatOptions);
|
|
415
|
-
this.internals.setFormValue(isoDate);
|
|
416
|
-
this.updateFormValidity();
|
|
417
|
-
this.bqChange.emit({ value: this.value, el: this.el });
|
|
418
|
-
};
|
|
419
|
-
/**
|
|
420
|
-
* Handles the change event when the user selects a date in the calendar component.
|
|
421
|
-
* @param {Event} ev - The change event.
|
|
422
|
-
* @returns {void}
|
|
423
|
-
*/
|
|
424
|
-
handleCalendarChange = (ev) => {
|
|
425
|
-
if (this.isInternalUpdate)
|
|
426
|
-
return;
|
|
427
|
-
const shouldStayOpen = this.type === 'multi';
|
|
428
|
-
const value = ev.target.value;
|
|
429
|
-
if (this.value === value) {
|
|
430
|
-
this.open = shouldStayOpen;
|
|
527
|
+
const parsed = parseTypedInput(inputValue, this.locale, this.precision, this.min, this.max, this.isDateDisallowed);
|
|
528
|
+
if (parsed.invalid || parsed.value == null) {
|
|
529
|
+
// Flag as `badInput` and emit `undefined` — never propagate the raw
|
|
530
|
+
// typed string, which would break the precision-aware wire contract.
|
|
531
|
+
this.hasBadInput = true;
|
|
532
|
+
this.internals.setFormValue(null);
|
|
533
|
+
this.syncValidity();
|
|
534
|
+
this.bqChange.emit({ value: undefined, el: this.el });
|
|
431
535
|
return;
|
|
432
536
|
}
|
|
433
|
-
this.
|
|
434
|
-
this.value = value;
|
|
435
|
-
this.displayDate = formatDisplayValue(value, this.type, this.locale, this.formatOptions);
|
|
436
|
-
this.inputElem.value = this.displayDate;
|
|
437
|
-
this.inputElem.focus();
|
|
438
|
-
this.internals.setFormValue(value);
|
|
537
|
+
this.hasBadInput = false;
|
|
538
|
+
this.value = parsed.value;
|
|
439
539
|
this.bqChange.emit({ value: this.value, el: this.el });
|
|
440
|
-
this.open = shouldStayOpen;
|
|
441
|
-
};
|
|
442
|
-
/**
|
|
443
|
-
* Handles the range start event when the user starts selecting a date range
|
|
444
|
-
* @param {CustomEvent} ev - The range start event.
|
|
445
|
-
* @returns {void}
|
|
446
|
-
*/
|
|
447
|
-
handleCalendarRangeStart = (ev) => {
|
|
448
|
-
this.hasRangeEnd = false;
|
|
449
|
-
this.tentative = ev.detail;
|
|
450
540
|
};
|
|
451
|
-
/**
|
|
452
|
-
* Handles the range end event when the user finishes selecting a date range
|
|
453
|
-
* @returns {void}
|
|
454
|
-
*/
|
|
455
|
-
handleCalendarRangeEnd = () => {
|
|
456
|
-
this.hasRangeEnd = true;
|
|
457
|
-
};
|
|
458
|
-
/**
|
|
459
|
-
* Handles the clear click event when the user clicks the clear button
|
|
460
|
-
* @param {CustomEvent} ev - The clear click event.
|
|
461
|
-
* @returns {void}
|
|
462
|
-
*/
|
|
463
541
|
handleClearClick = (ev) => {
|
|
464
542
|
if (this.disabled)
|
|
465
543
|
return;
|
|
466
|
-
this.inputElem
|
|
544
|
+
if (this.inputElem)
|
|
545
|
+
this.inputElem.value = '';
|
|
467
546
|
this.clearValue();
|
|
468
|
-
this.hasRangeEnd = false;
|
|
469
547
|
this.bqClear.emit(this.el);
|
|
470
548
|
this.bqChange.emit({ value: this.value, el: this.el });
|
|
471
|
-
this.inputElem
|
|
549
|
+
this.inputElem?.focus();
|
|
472
550
|
ev.stopPropagation();
|
|
473
551
|
};
|
|
552
|
+
/** Toggles the calendar panel open/closed when the trigger button is activated. */
|
|
553
|
+
handleTriggerClick = () => {
|
|
554
|
+
if (this.disabled)
|
|
555
|
+
return;
|
|
556
|
+
this.open = !this.open;
|
|
557
|
+
};
|
|
474
558
|
/**
|
|
475
|
-
*
|
|
476
|
-
*
|
|
559
|
+
* Handles keyboard shortcuts on the text input.
|
|
560
|
+
* - `ArrowDown` / `Alt+ArrowDown` → open panel and focus active cell.
|
|
561
|
+
* - `Escape` → close panel (focus stays on input).
|
|
477
562
|
*/
|
|
563
|
+
handleInputKeyDown = (ev) => {
|
|
564
|
+
if (this.disabled)
|
|
565
|
+
return;
|
|
566
|
+
if (ev.key === 'ArrowDown') {
|
|
567
|
+
ev.preventDefault();
|
|
568
|
+
if (!this.open)
|
|
569
|
+
this.open = true;
|
|
570
|
+
}
|
|
571
|
+
else if (ev.key === 'Escape' && this.open) {
|
|
572
|
+
ev.preventDefault();
|
|
573
|
+
this.open = false;
|
|
574
|
+
}
|
|
575
|
+
};
|
|
478
576
|
clearValue = () => {
|
|
479
577
|
this.value = undefined;
|
|
480
578
|
this.displayDate = undefined;
|
|
481
|
-
this.
|
|
579
|
+
this.hasBadInput = false;
|
|
580
|
+
this.internals.setFormValue(null);
|
|
581
|
+
this.tentativeHover = undefined;
|
|
582
|
+
};
|
|
583
|
+
handleSlotChange = () => {
|
|
584
|
+
this.hasLabel = this.labelElem ? hasSlotContent(this.labelElem) : false;
|
|
585
|
+
this.hasPrefix = this.prefixElem ? hasSlotContent(this.prefixElem) : false;
|
|
586
|
+
};
|
|
587
|
+
updateFormValidity = () => {
|
|
588
|
+
updateFormValidity({
|
|
589
|
+
internals: this.internals,
|
|
590
|
+
required: this.required,
|
|
591
|
+
value: this.value,
|
|
592
|
+
inputElem: this.inputElem,
|
|
593
|
+
validationMessage: this.formValidationMessage,
|
|
594
|
+
defaultMessage: 'Please, input or select a valid date',
|
|
595
|
+
});
|
|
482
596
|
};
|
|
483
597
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
598
|
+
* Recompute all state derived from the public `value` (form value,
|
|
599
|
+
* `hasValue`, formatted display). Called from `value` and any prop that
|
|
600
|
+
* affects display formatting (`type`, `locale`, `formatOptions`).
|
|
486
601
|
*/
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
602
|
+
syncDerivedFromValue = () => {
|
|
603
|
+
const current = this.value;
|
|
604
|
+
this.internals.setFormValue(!isNil(current) ? `${current}` : null);
|
|
605
|
+
this.syncValidity();
|
|
606
|
+
this.hasValue = computeHasValue(current);
|
|
607
|
+
this.displayDate = computeDisplayDate(current, this.type, this.locale, this.effectiveFormatOptions, this.precision);
|
|
491
608
|
};
|
|
492
609
|
/**
|
|
493
|
-
*
|
|
494
|
-
*
|
|
495
|
-
*
|
|
496
|
-
* @returns {JSX.Element | null} The calendar month element.
|
|
610
|
+
* Runs the full form-validity pipeline in a consistent order: `required`
|
|
611
|
+
* → bounds → `badInput`. Multiple failing constraints are unioned into a
|
|
612
|
+
* single `setValidity` call.
|
|
497
613
|
*/
|
|
498
|
-
|
|
499
|
-
if (!this.
|
|
500
|
-
return
|
|
501
|
-
|
|
614
|
+
syncValidity = () => {
|
|
615
|
+
if (!this.internals)
|
|
616
|
+
return;
|
|
617
|
+
this.updateFormValidity();
|
|
618
|
+
const boundsFlags = this.computeBoundsValidityFlags();
|
|
619
|
+
const flags = { ...boundsFlags };
|
|
620
|
+
if (this.hasBadInput)
|
|
621
|
+
flags.badInput = true;
|
|
622
|
+
const hasCustomConstraintError = Object.keys(flags).length > 0;
|
|
623
|
+
if (!hasCustomConstraintError) {
|
|
624
|
+
this.hasConstraintError = !this.internals.validity.valid;
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
const message = this.formValidationMessage ?? defaultValidityMessage(flags);
|
|
628
|
+
this.internals.states.delete('valid');
|
|
629
|
+
this.internals.states.add('invalid');
|
|
630
|
+
this.internals.setValidity(flags, message, this.inputElem);
|
|
631
|
+
this.hasConstraintError = true;
|
|
632
|
+
};
|
|
633
|
+
/** Returns `rangeUnderflow` / `rangeOverflow` flags for the current selection. */
|
|
634
|
+
computeBoundsValidityFlags = () => {
|
|
635
|
+
if (!this.min && !this.max)
|
|
636
|
+
return {};
|
|
637
|
+
const selection = parseValue(this.value, this.type, this.precision);
|
|
638
|
+
if (selection.length === 0)
|
|
639
|
+
return {};
|
|
640
|
+
const paddedMin = padBound(this.min, 'min');
|
|
641
|
+
const paddedMax = padBound(this.max, 'max');
|
|
642
|
+
let rangeUnderflow = false;
|
|
643
|
+
let rangeOverflow = false;
|
|
644
|
+
for (const iso of selection) {
|
|
645
|
+
if (paddedMin && iso < paddedMin)
|
|
646
|
+
rangeUnderflow = true;
|
|
647
|
+
if (paddedMax && iso > paddedMax)
|
|
648
|
+
rangeOverflow = true;
|
|
649
|
+
}
|
|
650
|
+
if (!rangeUnderflow && !rangeOverflow)
|
|
651
|
+
return {};
|
|
652
|
+
return { rangeUnderflow, rangeOverflow };
|
|
653
|
+
};
|
|
654
|
+
clampMonths = (value) => {
|
|
655
|
+
const rounded = Math.floor(Number(value));
|
|
656
|
+
if (!Number.isFinite(rounded) || rounded < 1)
|
|
657
|
+
return 1;
|
|
658
|
+
return Math.min(rounded, MAX_MONTHS_PER_VIEW);
|
|
502
659
|
};
|
|
503
660
|
/**
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
*
|
|
509
|
-
* and the class name is used for responsive design.
|
|
661
|
+
* Align the internal `viewDate` / `focused*` state with the current value.
|
|
662
|
+
* Called when the panel opens and whenever an *external* prop change
|
|
663
|
+
* invalidates the current view (value, type, precision, min/max). Internal
|
|
664
|
+
* commits skip this via `isCommittingSelection` so the user's navigated
|
|
665
|
+
* year isn't clobbered by a subsequent multi/range selection.
|
|
510
666
|
*
|
|
511
|
-
*
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
667
|
+
* Uses `parseValue` (precision-aware, always returns full ISO dates) rather
|
|
668
|
+
* than a raw `YYYY-MM-DD` regex so that month/year wire values like
|
|
669
|
+
* `"2025-05"` or `"2025"` land on the right cell instead of falling back
|
|
670
|
+
* to today.
|
|
671
|
+
*/
|
|
672
|
+
syncViewToValue = () => {
|
|
673
|
+
const parsed = parseValue(this.value, this.type, this.precision);
|
|
674
|
+
const focusISO = parsed[0] ?? getTodayISO();
|
|
675
|
+
const focus = parseISO(focusISO) ?? new Date();
|
|
676
|
+
const bounded = clampDate(focus, this.min, this.max);
|
|
677
|
+
this.focusedISO = toISO(bounded);
|
|
678
|
+
this.viewDate = startOfMonth(bounded);
|
|
679
|
+
this.focusedMonth = bounded.getMonth();
|
|
680
|
+
this.focusedYear = bounded.getFullYear();
|
|
681
|
+
this.decadeStart = getDecadeStart(bounded.getFullYear());
|
|
682
|
+
};
|
|
683
|
+
get selection() {
|
|
684
|
+
const key = `${this.type}|${this.precision}|${this.value ?? ''}`;
|
|
685
|
+
if (this.cachedSelection?.key === key)
|
|
686
|
+
return this.cachedSelection.value;
|
|
687
|
+
const parsed = parseValue(this.value, this.type, this.precision);
|
|
688
|
+
this.cachedSelection = { key, value: parsed };
|
|
689
|
+
return parsed;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Effective `Intl.DateTimeFormatOptions` — user-provided when set, otherwise
|
|
693
|
+
* the precision-appropriate default. Prevents a `month` picker from
|
|
694
|
+
* accidentally rendering "1 May 2026" when the consumer just sets
|
|
695
|
+
* `precision="month"` without overriding `formatOptions`.
|
|
515
696
|
*/
|
|
516
|
-
|
|
517
|
-
|
|
697
|
+
get effectiveFormatOptions() {
|
|
698
|
+
return this.formatOptions ?? DEFAULT_FORMAT_OPTIONS_BY_PRECISION[this.precision];
|
|
699
|
+
}
|
|
700
|
+
/** Map a precision value to the calendar view that commits selections. */
|
|
701
|
+
precisionToView = (precision) => {
|
|
702
|
+
if (precision === 'month')
|
|
703
|
+
return 'months';
|
|
704
|
+
if (precision === 'year')
|
|
705
|
+
return 'years';
|
|
706
|
+
return 'days';
|
|
707
|
+
};
|
|
708
|
+
get tentativeRange() {
|
|
709
|
+
if (this.type !== 'range')
|
|
518
710
|
return [];
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
711
|
+
const parsed = this.selection;
|
|
712
|
+
// While the user is completing a range (one endpoint chosen) show the
|
|
713
|
+
// hover preview between that endpoint and the current hovered day.
|
|
714
|
+
if (parsed.length === 1)
|
|
715
|
+
return buildTentativeRange(parsed[0], this.tentativeHover);
|
|
716
|
+
return [];
|
|
717
|
+
}
|
|
718
|
+
/* --------------------------- View transitions -------------------------- */
|
|
719
|
+
/**
|
|
720
|
+
* Return the date that view transitions (days ⇄ months ⇄ years) should
|
|
721
|
+
* center the focus on.
|
|
722
|
+
*
|
|
723
|
+
* Priority:
|
|
724
|
+
* 1. First entry of the current selection — for `range` this is the start
|
|
725
|
+
* date (selection is sorted on parse), for `multi` it is the earliest.
|
|
726
|
+
* 2. Otherwise the currently displayed `viewDate` (i.e. the month/year the
|
|
727
|
+
* user has navigated to with prev/next).
|
|
728
|
+
*/
|
|
729
|
+
getViewFocusReference = () => {
|
|
730
|
+
const [first] = this.selection;
|
|
731
|
+
if (first) {
|
|
732
|
+
const parsed = parseISO(first);
|
|
733
|
+
if (parsed)
|
|
734
|
+
return parsed;
|
|
525
735
|
}
|
|
526
|
-
return
|
|
736
|
+
return this.viewDate;
|
|
737
|
+
};
|
|
738
|
+
handleHeaderTitleClick = () => {
|
|
739
|
+
if (this.precision === 'year')
|
|
740
|
+
return;
|
|
741
|
+
if (this.view === 'days') {
|
|
742
|
+
const ref = this.getViewFocusReference();
|
|
743
|
+
this.focusedMonth = ref.getMonth();
|
|
744
|
+
this.focusedYear = ref.getFullYear();
|
|
745
|
+
this.view = 'months';
|
|
746
|
+
this.focusActiveCell();
|
|
747
|
+
return;
|
|
748
|
+
}
|
|
749
|
+
if (this.view === 'months') {
|
|
750
|
+
const ref = this.getViewFocusReference();
|
|
751
|
+
this.focusedYear = ref.getFullYear();
|
|
752
|
+
this.decadeStart = getDecadeStart(ref.getFullYear());
|
|
753
|
+
this.view = 'years';
|
|
754
|
+
this.focusActiveCell();
|
|
755
|
+
return;
|
|
756
|
+
}
|
|
757
|
+
// years view → cycle back to the base view for the current precision
|
|
758
|
+
this.view = this.precisionToView(this.precision);
|
|
759
|
+
this.focusActiveCell();
|
|
760
|
+
};
|
|
761
|
+
handleHeaderPrev = () => {
|
|
762
|
+
if (this.view === 'days') {
|
|
763
|
+
const step = this.monthsPerView === 'months' ? Math.max(1, this.months) : 1;
|
|
764
|
+
this.viewDate = addMonths(this.viewDate, -step);
|
|
765
|
+
this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));
|
|
766
|
+
}
|
|
767
|
+
else if (this.view === 'months') {
|
|
768
|
+
this.focusedYear = this.focusedYear - 1;
|
|
769
|
+
}
|
|
770
|
+
else {
|
|
771
|
+
this.decadeStart = this.decadeStart - DECADE_GRID_SIZE;
|
|
772
|
+
}
|
|
773
|
+
};
|
|
774
|
+
handleHeaderNext = () => {
|
|
775
|
+
if (this.view === 'days') {
|
|
776
|
+
const step = this.monthsPerView === 'months' ? Math.max(1, this.months) : 1;
|
|
777
|
+
this.viewDate = addMonths(this.viewDate, step);
|
|
778
|
+
this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));
|
|
779
|
+
}
|
|
780
|
+
else if (this.view === 'months') {
|
|
781
|
+
this.focusedYear = this.focusedYear + 1;
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
this.decadeStart = this.decadeStart + DECADE_GRID_SIZE;
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
handleMonthSelect = (month) => {
|
|
788
|
+
// When precision is `month`, selecting a month commits the value instead
|
|
789
|
+
// of drilling to the days view. Gate the commit on bounds so keyboard
|
|
790
|
+
// Enter/Space cannot bypass the click-path disabled check.
|
|
791
|
+
if (this.precision === 'month') {
|
|
792
|
+
if (!isMonthWithinBounds(this.focusedYear, month, this.min, this.max))
|
|
793
|
+
return;
|
|
794
|
+
this.focusedMonth = month;
|
|
795
|
+
this.viewDate = new Date(this.focusedYear, month, 1);
|
|
796
|
+
this.commitSelection(toISO(new Date(this.focusedYear, month, 1)));
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
this.viewDate = new Date(this.focusedYear, month, 1);
|
|
800
|
+
this.focusedMonth = month;
|
|
801
|
+
// Preserve day-of-month from the current focus (value or today), clamped
|
|
802
|
+
// to the last day of the destination month and to min/max bounds.
|
|
803
|
+
const nextFocus = clampDate(new Date(this.focusedYear, month, Math.min(new Date(this.focusedISO).getDate() || 1, endOfMonth(this.viewDate).getDate())), this.min, this.max);
|
|
804
|
+
this.focusedISO = toISO(nextFocus);
|
|
805
|
+
this.view = 'days';
|
|
806
|
+
this.focusActiveCell();
|
|
807
|
+
};
|
|
808
|
+
handleYearSelect = (year) => {
|
|
809
|
+
// When precision is `year`, selecting a year commits the value instead
|
|
810
|
+
// of drilling to the months view. Gate the commit on bounds so keyboard
|
|
811
|
+
// Enter/Space cannot bypass the click-path disabled check.
|
|
812
|
+
if (this.precision === 'year') {
|
|
813
|
+
if (!isYearWithinBounds(year, this.min, this.max))
|
|
814
|
+
return;
|
|
815
|
+
this.focusedYear = year;
|
|
816
|
+
this.viewDate = new Date(year, 0, 1);
|
|
817
|
+
this.commitSelection(toISO(new Date(year, 0, 1)));
|
|
818
|
+
return;
|
|
819
|
+
}
|
|
820
|
+
this.focusedYear = year;
|
|
821
|
+
this.viewDate = new Date(year, this.focusedMonth, 1);
|
|
822
|
+
this.view = 'months';
|
|
823
|
+
this.focusActiveCell();
|
|
824
|
+
};
|
|
825
|
+
/* ---------------------------- Day selection ---------------------------- */
|
|
826
|
+
handleDaySelect = (iso) => {
|
|
827
|
+
this.commitSelection(iso);
|
|
527
828
|
};
|
|
528
829
|
/**
|
|
529
|
-
*
|
|
530
|
-
*
|
|
830
|
+
* Shared commit path used by day / month / year selection. Keeps the
|
|
831
|
+
* selection logic (single/multi/range) and post-commit behaviour (event,
|
|
832
|
+
* open state, tentative hover, view sync) identical across precisions.
|
|
531
833
|
*/
|
|
532
|
-
|
|
533
|
-
const
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
834
|
+
commitSelection = (iso) => {
|
|
835
|
+
const next = applySelection(iso, this.selection, this.type);
|
|
836
|
+
const shouldStayOpen = this.type === 'multi' || (this.type === 'range' && next.length === 1);
|
|
837
|
+
this.hasBadInput = false;
|
|
838
|
+
// Guard so `handleValueChange` doesn't re-sync the view back to `parsed[0]`
|
|
839
|
+
// (would jump multi/range pickers to the earliest selected date) or to
|
|
840
|
+
// today (when precision truncation leaves no full ISO to extract).
|
|
841
|
+
this.isCommittingSelection = true;
|
|
842
|
+
this.value = serializeValue(next, this.type, this.precision);
|
|
843
|
+
this.isCommittingSelection = false;
|
|
844
|
+
this.focusedISO = iso;
|
|
845
|
+
const parsedIso = parseISO(iso);
|
|
846
|
+
if (parsedIso) {
|
|
847
|
+
this.viewDate = startOfMonth(parsedIso);
|
|
848
|
+
this.focusedMonth = parsedIso.getMonth();
|
|
849
|
+
this.focusedYear = parsedIso.getFullYear();
|
|
850
|
+
if (this.precision !== 'year') {
|
|
851
|
+
this.decadeStart = getDecadeStart(parsedIso.getFullYear());
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
this.tentativeHover = this.type === 'range' && next.length === 1 ? iso : undefined;
|
|
855
|
+
this.bqChange.emit({ value: this.value, el: this.el });
|
|
856
|
+
this.open = shouldStayOpen;
|
|
857
|
+
};
|
|
858
|
+
handleDayHover = (iso) => {
|
|
859
|
+
if (this.type !== 'range')
|
|
860
|
+
return;
|
|
861
|
+
this.tentativeHover = iso;
|
|
862
|
+
};
|
|
863
|
+
handleDayFocus = (iso) => {
|
|
864
|
+
if (this.focusedISO === iso)
|
|
865
|
+
return;
|
|
866
|
+
this.focusedISO = iso;
|
|
867
|
+
};
|
|
868
|
+
/* ------------------------- Grid keyboard nav --------------------------- */
|
|
869
|
+
getRTLDirection = () => {
|
|
870
|
+
// Walk up through the composed tree so that dir="rtl" set on <html> or
|
|
871
|
+
// any ancestor is picked up, not just a direct attribute on the host.
|
|
872
|
+
const dir = this.el.closest('[dir]')?.dir ?? getComputedStyle(this.el).direction;
|
|
873
|
+
return dir === 'rtl' ? -1 : 1;
|
|
874
|
+
};
|
|
875
|
+
moveFocusedDay = (deltaDays) => {
|
|
876
|
+
const current = parseISO(this.focusedISO) ?? new Date();
|
|
877
|
+
const next = clampDate(addDays(current, deltaDays), this.min, this.max);
|
|
878
|
+
this.focusedISO = toISO(next);
|
|
879
|
+
if (next.getMonth() !== this.viewDate.getMonth() || next.getFullYear() !== this.viewDate.getFullYear()) {
|
|
880
|
+
this.viewDate = startOfMonth(next);
|
|
881
|
+
}
|
|
882
|
+
this.focusButton(`[data-iso="${this.focusedISO}"]`);
|
|
883
|
+
};
|
|
884
|
+
moveFocusedDayHome = () => {
|
|
885
|
+
const first = this.firstDayOfWeek ?? 1;
|
|
886
|
+
const dayOfWeek = parseISO(this.focusedISO)?.getDay() ?? 0;
|
|
887
|
+
this.moveFocusedDay(-((dayOfWeek - first + 7) % 7));
|
|
888
|
+
};
|
|
889
|
+
moveFocusedDayEnd = () => {
|
|
890
|
+
const first = this.firstDayOfWeek ?? 1;
|
|
891
|
+
const focus = parseISO(this.focusedISO) ?? new Date();
|
|
892
|
+
const rowIndex = (focus.getDay() - first + 7) % 7;
|
|
893
|
+
this.moveFocusedDay(6 - rowIndex);
|
|
894
|
+
};
|
|
895
|
+
pageFocusedMonth = (direction, byYear) => {
|
|
896
|
+
this.viewDate = byYear ? addYears(this.viewDate, direction) : addMonths(this.viewDate, direction);
|
|
897
|
+
this.focusedISO = toISO(clampDate(startOfMonth(this.viewDate), this.min, this.max));
|
|
898
|
+
};
|
|
899
|
+
selectFocusedDay = () => {
|
|
900
|
+
const iso = this.focusedISO;
|
|
901
|
+
const parsed = parseISO(iso);
|
|
902
|
+
if (parsed && isWithinBounds(parsed, this.min, this.max) && !this.isDateDisallowed?.(parsed)) {
|
|
903
|
+
this.handleDaySelect(iso);
|
|
904
|
+
}
|
|
905
|
+
};
|
|
906
|
+
handleDayGridKeyDown = (ev) => {
|
|
907
|
+
const rtl = this.getRTLDirection();
|
|
908
|
+
const handlers = {
|
|
909
|
+
ArrowLeft: () => this.moveFocusedDay(-1 * rtl),
|
|
910
|
+
ArrowRight: () => this.moveFocusedDay(1 * rtl),
|
|
911
|
+
ArrowUp: () => this.moveFocusedDay(-7),
|
|
912
|
+
ArrowDown: () => this.moveFocusedDay(7),
|
|
913
|
+
Home: () => this.moveFocusedDayHome(),
|
|
914
|
+
End: () => this.moveFocusedDayEnd(),
|
|
915
|
+
PageUp: () => this.pageFocusedMonth(-1, ev.shiftKey),
|
|
916
|
+
PageDown: () => this.pageFocusedMonth(1, ev.shiftKey),
|
|
917
|
+
Escape: () => {
|
|
918
|
+
this.open = false;
|
|
919
|
+
this.inputElem?.focus();
|
|
920
|
+
},
|
|
921
|
+
Enter: () => this.selectFocusedDay(),
|
|
922
|
+
' ': () => this.selectFocusedDay(),
|
|
923
|
+
};
|
|
924
|
+
const handler = handlers[ev.key];
|
|
925
|
+
if (handler) {
|
|
926
|
+
ev.preventDefault();
|
|
927
|
+
handler();
|
|
928
|
+
}
|
|
929
|
+
};
|
|
930
|
+
getGridColumns = () => {
|
|
931
|
+
// Months/years grids visually expand from 3 to 4 columns in multi-panel
|
|
932
|
+
// mode. Keep arrow-key stride in sync so vertical navigation still lands
|
|
933
|
+
// on the row directly above/below the current cell.
|
|
934
|
+
return getGridColumns(this.getMonthCount());
|
|
935
|
+
};
|
|
936
|
+
handleMonthGridKeyDown = (ev) => {
|
|
937
|
+
const rtl = this.getRTLDirection();
|
|
938
|
+
const stride = this.getGridColumns();
|
|
939
|
+
const move = (delta) => {
|
|
940
|
+
const { month, year } = advanceFocusedMonth(this.focusedMonth, this.focusedYear, delta);
|
|
941
|
+
this.focusedMonth = month;
|
|
942
|
+
this.focusedYear = year;
|
|
943
|
+
this.focusButton(`[data-month="${month}"]`);
|
|
944
|
+
};
|
|
945
|
+
switch (ev.key) {
|
|
946
|
+
case 'ArrowLeft':
|
|
947
|
+
ev.preventDefault();
|
|
948
|
+
move(-1 * rtl);
|
|
949
|
+
return;
|
|
950
|
+
case 'ArrowRight':
|
|
951
|
+
ev.preventDefault();
|
|
952
|
+
move(1 * rtl);
|
|
953
|
+
return;
|
|
954
|
+
case 'ArrowUp':
|
|
955
|
+
ev.preventDefault();
|
|
956
|
+
move(-stride);
|
|
957
|
+
return;
|
|
958
|
+
case 'ArrowDown':
|
|
959
|
+
ev.preventDefault();
|
|
960
|
+
move(stride);
|
|
961
|
+
return;
|
|
962
|
+
case 'Enter':
|
|
963
|
+
case ' ':
|
|
964
|
+
ev.preventDefault();
|
|
965
|
+
this.handleMonthSelect(this.focusedMonth);
|
|
966
|
+
return;
|
|
967
|
+
case 'Escape':
|
|
968
|
+
ev.preventDefault();
|
|
969
|
+
this.view = 'days';
|
|
970
|
+
}
|
|
971
|
+
};
|
|
972
|
+
handleYearGridKeyDown = (ev) => {
|
|
973
|
+
const rtl = this.getRTLDirection();
|
|
974
|
+
const stride = this.getGridColumns();
|
|
975
|
+
const move = (delta) => {
|
|
976
|
+
const { year, decadeStart } = advanceFocusedYear(this.focusedYear, this.decadeStart, delta);
|
|
977
|
+
this.focusedYear = year;
|
|
978
|
+
this.decadeStart = decadeStart;
|
|
979
|
+
this.focusButton(`[data-year="${year}"]`);
|
|
980
|
+
};
|
|
981
|
+
switch (ev.key) {
|
|
982
|
+
case 'ArrowLeft':
|
|
983
|
+
ev.preventDefault();
|
|
984
|
+
move(-1 * rtl);
|
|
985
|
+
return;
|
|
986
|
+
case 'ArrowRight':
|
|
987
|
+
ev.preventDefault();
|
|
988
|
+
move(1 * rtl);
|
|
989
|
+
return;
|
|
990
|
+
case 'ArrowUp':
|
|
991
|
+
ev.preventDefault();
|
|
992
|
+
move(-stride);
|
|
993
|
+
return;
|
|
994
|
+
case 'ArrowDown':
|
|
995
|
+
ev.preventDefault();
|
|
996
|
+
move(stride);
|
|
997
|
+
return;
|
|
998
|
+
case 'Enter':
|
|
999
|
+
case ' ':
|
|
1000
|
+
ev.preventDefault();
|
|
1001
|
+
this.handleYearSelect(this.focusedYear);
|
|
1002
|
+
return;
|
|
1003
|
+
case 'Escape':
|
|
1004
|
+
ev.preventDefault();
|
|
1005
|
+
this.view = 'months';
|
|
1006
|
+
}
|
|
1007
|
+
};
|
|
1008
|
+
focusButton = (selector) => {
|
|
1009
|
+
// Cancel any prior pending focus request so rapid state changes don't
|
|
1010
|
+
// race — only the latest target should win.
|
|
1011
|
+
if (this.pendingFocusRAF !== undefined)
|
|
1012
|
+
cancelAnimationFrame(this.pendingFocusRAF);
|
|
1013
|
+
this.pendingFocusRAF = requestAnimationFrame(() => {
|
|
1014
|
+
this.pendingFocusRAF = undefined;
|
|
1015
|
+
const button = this.el.shadowRoot?.querySelector(selector);
|
|
1016
|
+
button?.focus();
|
|
541
1017
|
});
|
|
542
1018
|
};
|
|
543
1019
|
/**
|
|
544
|
-
*
|
|
545
|
-
*
|
|
546
|
-
*
|
|
547
|
-
* @returns The Cally calendar component tag name.
|
|
1020
|
+
* Focus the currently active cell for the visible view. Called after the
|
|
1021
|
+
* popup opens so keyboard users don't have to tab into the calendar.
|
|
548
1022
|
*/
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
1023
|
+
focusActiveCell = () => {
|
|
1024
|
+
if (this.view === 'months') {
|
|
1025
|
+
this.focusButton(`[data-month="${this.focusedMonth}"]`);
|
|
1026
|
+
return;
|
|
1027
|
+
}
|
|
1028
|
+
if (this.view === 'years') {
|
|
1029
|
+
this.focusButton(`[data-year="${this.focusedYear}"]`);
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
this.focusButton(`[data-iso="${this.focusedISO}"]`);
|
|
1033
|
+
};
|
|
1034
|
+
/* -------------------------- Header labels ------------------------------ */
|
|
1035
|
+
getMonthCount = () => {
|
|
1036
|
+
if (this.type === 'single')
|
|
1037
|
+
return 1;
|
|
1038
|
+
// `handleMonthsChange` clamps the prop on write, so here we just guard
|
|
1039
|
+
// against the initial value before the first watcher tick.
|
|
1040
|
+
return this.clampMonths(this.months);
|
|
1041
|
+
};
|
|
1042
|
+
getHeaderLabel = () => {
|
|
1043
|
+
return getHeaderLabel({
|
|
1044
|
+
view: this.view,
|
|
1045
|
+
viewDate: this.viewDate,
|
|
1046
|
+
focusedYear: this.focusedYear,
|
|
1047
|
+
decadeStart: this.decadeStart,
|
|
1048
|
+
monthCount: this.getMonthCount(),
|
|
1049
|
+
locale: this.locale,
|
|
1050
|
+
});
|
|
1051
|
+
};
|
|
1052
|
+
getHeaderTitleLabel = () => {
|
|
1053
|
+
return getHeaderTitleLabel(this.view, this.precision);
|
|
1054
|
+
};
|
|
1055
|
+
getPreviousLabel = () => {
|
|
1056
|
+
return getPreviousLabel(this.view);
|
|
1057
|
+
};
|
|
1058
|
+
getNextLabel = () => {
|
|
1059
|
+
return getNextLabel(this.view);
|
|
1060
|
+
};
|
|
1061
|
+
renderDayPanels = () => {
|
|
1062
|
+
const panels = [];
|
|
1063
|
+
const monthCount = this.getMonthCount();
|
|
1064
|
+
for (let i = 0; i < monthCount; i++) {
|
|
1065
|
+
const anchor = addMonths(this.viewDate, i);
|
|
1066
|
+
const anchorKey = toISO(startOfMonth(anchor));
|
|
1067
|
+
panels.push(h("div", { key: anchorKey, class: {
|
|
1068
|
+
'bq-date-picker__panel': true,
|
|
1069
|
+
'bq-date-picker__panel--extra': i > 0,
|
|
1070
|
+
} }, monthCount > 1 && (h("div", { class: "bq-date-picker__month-label", part: CALENDAR_PARTS.heading }, formatMonth(anchor, this.locale, 'long', true))), h(CalendarDayView, { viewDate: anchor, selection: this.selection, tentativeRange: this.tentativeRange, focusedISO: this.focusedISO, type: this.type, locale: this.locale, firstDayOfWeek: this.firstDayOfWeek ?? 1, showOutsideDays: this.showOutsideDays, minISO: this.min, maxISO: this.max, isDateDisallowed: this.isDateDisallowed, onDaySelect: (iso) => this.handleDaySelect(iso), onDayHover: (iso) => this.handleDayHover(iso), onDayFocus: (iso) => this.handleDayFocus(iso), onGridKeyDown: this.handleDayGridKeyDown })));
|
|
1071
|
+
}
|
|
1072
|
+
return h("div", { class: "bq-date-picker__panels" }, panels);
|
|
1073
|
+
};
|
|
1074
|
+
renderMonthsView = () => {
|
|
1075
|
+
const gridColumns = this.getGridColumns();
|
|
1076
|
+
return (h(CalendarMonthView, { year: this.focusedYear, focusedMonth: this.focusedMonth, gridColumns: gridColumns, locale: this.locale, minISO: this.min, maxISO: this.max, selection: this.selection, tentativeRange: this.tentativeRange, type: this.type, onMonthSelect: (month) => this.handleMonthSelect(month), onMonthHover: (iso) => this.handleDayHover(iso), onMonthFocus: (month) => {
|
|
1077
|
+
this.focusedMonth = month;
|
|
1078
|
+
}, onGridKeyDown: this.handleMonthGridKeyDown }));
|
|
1079
|
+
};
|
|
1080
|
+
renderYearsView = () => {
|
|
1081
|
+
const start = this.decadeStart;
|
|
1082
|
+
const end = start + DECADE_GRID_SIZE - 1;
|
|
1083
|
+
const years = Array.from({ length: DECADE_GRID_SIZE }, (_, i) => start + i);
|
|
1084
|
+
const effectiveFocused = this.focusedYear >= start && this.focusedYear <= end ? this.focusedYear : start;
|
|
1085
|
+
const gridColumns = this.getGridColumns();
|
|
1086
|
+
return (h(CalendarYearView, { years: years, focusedYear: effectiveFocused, gridColumns: gridColumns, minISO: this.min, maxISO: this.max, selection: this.selection, tentativeRange: this.tentativeRange, type: this.type, onYearSelect: (year) => this.handleYearSelect(year), onYearHover: (iso) => this.handleDayHover(iso), onYearFocus: (year) => {
|
|
1087
|
+
this.focusedYear = year;
|
|
1088
|
+
}, onGridKeyDown: this.handleYearGridKeyDown }));
|
|
1089
|
+
};
|
|
1090
|
+
renderView = () => {
|
|
1091
|
+
if (this.view === 'months')
|
|
1092
|
+
return this.renderMonthsView();
|
|
1093
|
+
if (this.view === 'years')
|
|
1094
|
+
return this.renderYearsView();
|
|
1095
|
+
return this.renderDayPanels();
|
|
1096
|
+
};
|
|
552
1097
|
// render() function
|
|
553
1098
|
// Always the last one in the class.
|
|
554
1099
|
// ===================================
|
|
555
1100
|
render() {
|
|
556
|
-
const CallyCalendar = this.calendarType;
|
|
557
1101
|
const labelId = `bq-date-picker__label-${this.name || DEFAULT_INPUT_ID}`;
|
|
558
|
-
|
|
1102
|
+
const popupId = `bq-date-picker__popup-${this.name || DEFAULT_INPUT_ID}`;
|
|
1103
|
+
return (h("div", { key: 'fbfb1d3294161587b4dc1097f472a7c56d42113d', class: "bq-date-picker", part: CALENDAR_PARTS.base }, h("label", { key: '653bbad6d53c67fac40fde49fe19eb53dd9058a3', class: { 'bq-date-picker__label': true, 'is-hidden': !this.hasLabel }, htmlFor: this.name || DEFAULT_INPUT_ID, part: CALENDAR_PARTS.label, ref: (labelElem) => {
|
|
559
1104
|
this.labelElem = labelElem;
|
|
560
|
-
} }, h("slot", { key: '
|
|
1105
|
+
} }, h("slot", { key: '07e94277fbaf22b70bdd99d07159d41890210aa4', id: labelId, name: "label", onSlotchange: this.handleSlotChange })), h("bq-dropdown", { key: '41797796782799bb526b0f7848d13142824a6992', class: "bq-date-picker__dropdown", disabled: this.disabled, distance: this.distance, exportparts: "panel", open: this.open, panelHeight: this.panelHeight, placement: this.placement, skidding: this.skidding, strategy: this.strategy }, h("div", { key: '34a12c0fedb7ef5e0b01027d6880d76b98aba95c', class: {
|
|
561
1106
|
'bq-date-picker__control': true,
|
|
562
1107
|
[`validation-${this.validationStatus}`]: true,
|
|
563
|
-
disabled: this.disabled,
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
this.suffixElem = spanElem;
|
|
573
|
-
} }, h("slot", { key: '5501e90797705d98883a0a9ec178ae21922407dd', name: "suffix", onSlotchange: this.handleSlotChange }, h("bq-icon", { key: '0a7e047ade9014cb9997a0ffcf47098bbe6160eb', class: "flex", name: "calendar-blank" })))), this.isCallyLoaded && (h(CallyCalendar, { key: 'cdbb9f9cb40d03b40f743d1086f9cc3c0055c233', "aria-labelledby": labelId, "aria-modal": "true", exportparts: CALENDAR_CONTAINER_EXPORT_PARTS, firstDayOfWeek: this.firstDayOfWeek, isDateDisallowed: this.isDateDisallowed, locale: this.locale, max: this.max, min: this.min, months: this.months, onChange: this.handleCalendarChange, onRangeend: this.handleCalendarRangeEnd, onRangestart: this.handleCalendarRangeStart, pageBy: this.monthsPerView, ref: (elem) => {
|
|
574
|
-
this.callyElem = elem;
|
|
575
|
-
}, role: "dialog", showOutsideDays: this.showOutsideDays, tentative: this.tentative, value: this.value }, h("bq-icon", { key: '4c10bc74c6e248f07b66fc4af28917a9b83bcc48', color: "text--primary", label: "Previous", name: "caret-left", slot: "previous" }), h("bq-icon", { key: '4f1875fa4e48db09e83ae5aa5c4c7ab0591cb2d4', color: "text--primary", label: "Next", name: "caret-right", slot: "next" }), h("div", { key: '92d856991700e38e8fbf383eae2b8d2c85d0faed', class: "flex flex-wrap justify-center gap-[--bq-spacing-m]" }, this.generateCalendarMonths()))))));
|
|
1108
|
+
'is-disabled': !!this.disabled,
|
|
1109
|
+
'is-open': !!this.open,
|
|
1110
|
+
}, part: CALENDAR_PARTS.control, slot: "trigger" }, h("span", { key: '074fef90f99a4f04b9dcf93662f32474872fae8d', class: { 'bq-date-picker__prefix': true, 'is-hidden': !this.hasPrefix }, part: CALENDAR_PARTS.prefix, ref: (el) => {
|
|
1111
|
+
this.prefixElem = el;
|
|
1112
|
+
} }, h("slot", { key: '040653982a81730279c4115a19415b01dbc24930', name: "prefix", onSlotchange: this.handleSlotChange })), h("input", { key: 'a72cc21a3811e27890881cd6b24340f3014bd891', "aria-controls": popupId, "aria-disabled": this.disabled ? 'true' : 'false', "aria-expanded": this.open ? 'true' : 'false', "aria-haspopup": "dialog", "aria-invalid": this.validationStatus === 'error' || this.hasConstraintError ? 'true' : 'false', "aria-labelledby": this.hasLabel ? labelId : undefined, autoCapitalize: "off", autoComplete: "off", class: "bq-date-picker__input", disabled: this.disabled, form: this.form, id: this.name || DEFAULT_INPUT_ID, name: this.name, onBlur: this.handleBlur, onChange: this.handleInputChange, onFocus: this.handleFocus, onKeyDown: this.handleInputKeyDown, part: CALENDAR_PARTS.input, placeholder: this.placeholder, readonly: this.type !== 'single', ref: (el) => {
|
|
1113
|
+
this.inputElem = el;
|
|
1114
|
+
}, required: this.required, role: "combobox", spellcheck: false, type: "text", value: this.displayDate }), this.hasValue && !this.disabled && !this.disableClear && (h("bq-button", { key: '4755ef5fd92ad15e4251e8e6b1a0c54fcab70211', appearance: "text", border: "xs", class: "bq-date-picker__clear", exportparts: "button", label: this.clearButtonLabel, onBqClick: this.handleClearClick, onlyIcon: true, part: CALENDAR_PARTS.clearBtn, size: "small" }, h("slot", { key: '3822545148e63e70ba3db113f68ef433f8cec557', name: "clear-icon" }, h("bq-icon", { key: '68fb241e92345c8ba00234a4549fde7596356244', "aria-hidden": "true", name: "x-circle" })))), h("bq-button", { key: 'a0d973454fe7a4a5176ec74cbfd4f53f8b5e502b', appearance: "text", border: "xs", class: "bq-date-picker__calendar-trigger", disabled: this.disabled, exportparts: "button", label: this.calendarButtonLabel, onClick: (ev) => ev.stopPropagation(), onBqClick: this.handleTriggerClick, onlyIcon: true, part: `${CALENDAR_PARTS.button} ${CALENDAR_PARTS.suffix} ${CALENDAR_PARTS.calendarTrigger}`, ref: (el) => {
|
|
1115
|
+
this.triggerBtnElem = el;
|
|
1116
|
+
}, size: "small" }, h("slot", { key: '232204777692c2fec6f341bb1839084aa0f333a3', name: "suffix", onSlotchange: this.handleSlotChange }, h("bq-icon", { key: '61a8deb36c0a991e7d3a9922150eeb1740494c7e', "aria-hidden": "true", name: "calendar-blank" })))), h("div", { key: 'f65869f887710ff537b00812aacf2bbd01ddeb3e', "aria-label": this.hasLabel ? undefined : 'Date picker', "aria-labelledby": this.hasLabel ? labelId : undefined, class: "bq-date-picker__calendar", id: popupId, part: CALENDAR_PARTS.container, role: "dialog", style: { '--bq-date-picker--panel-count': `${this.getMonthCount()}` } }, h(CalendarHeader, { key: 'a07e486177b1df9f477de1fe6c0c484356e0d6b9', view: this.view, label: this.getHeaderLabel(), previousLabel: this.getPreviousLabel(), nextLabel: this.getNextLabel(), titleLabel: this.getHeaderTitleLabel(), titleInteractive: this.precision !== 'year', onPrevious: () => this.handleHeaderPrev(), onNext: () => this.handleHeaderNext(), onTitleClick: () => this.handleHeaderTitleClick() }), h("div", { key: '00a0802e6eb76113fd68ee8852a98c762dc015bb', class: "bq-date-picker__view" }, this.renderView())))));
|
|
576
1117
|
}
|
|
577
1118
|
static get is() { return "bq-date-picker"; }
|
|
578
1119
|
static get encapsulation() { return "shadow"; }
|
|
@@ -602,12 +1143,13 @@ export class BqDatePicker {
|
|
|
602
1143
|
"optional": false,
|
|
603
1144
|
"docs": {
|
|
604
1145
|
"tags": [],
|
|
605
|
-
"text": "If `true`, the Date picker input will be focused on component render"
|
|
1146
|
+
"text": "If `true`, the Date picker input will be focused on component render."
|
|
606
1147
|
},
|
|
607
1148
|
"getter": false,
|
|
608
1149
|
"setter": false,
|
|
609
1150
|
"reflect": true,
|
|
610
|
-
"attribute": "autofocus"
|
|
1151
|
+
"attribute": "autofocus",
|
|
1152
|
+
"defaultValue": "false"
|
|
611
1153
|
},
|
|
612
1154
|
"clearButtonLabel": {
|
|
613
1155
|
"type": "string",
|
|
@@ -618,10 +1160,10 @@ export class BqDatePicker {
|
|
|
618
1160
|
"references": {}
|
|
619
1161
|
},
|
|
620
1162
|
"required": false,
|
|
621
|
-
"optional":
|
|
1163
|
+
"optional": false,
|
|
622
1164
|
"docs": {
|
|
623
1165
|
"tags": [],
|
|
624
|
-
"text": "The clear button aria label"
|
|
1166
|
+
"text": "The clear button aria label."
|
|
625
1167
|
},
|
|
626
1168
|
"getter": false,
|
|
627
1169
|
"setter": false,
|
|
@@ -629,6 +1171,26 @@ export class BqDatePicker {
|
|
|
629
1171
|
"attribute": "clear-button-label",
|
|
630
1172
|
"defaultValue": "'Clear value'"
|
|
631
1173
|
},
|
|
1174
|
+
"calendarButtonLabel": {
|
|
1175
|
+
"type": "string",
|
|
1176
|
+
"mutable": false,
|
|
1177
|
+
"complexType": {
|
|
1178
|
+
"original": "string",
|
|
1179
|
+
"resolved": "string",
|
|
1180
|
+
"references": {}
|
|
1181
|
+
},
|
|
1182
|
+
"required": false,
|
|
1183
|
+
"optional": false,
|
|
1184
|
+
"docs": {
|
|
1185
|
+
"tags": [],
|
|
1186
|
+
"text": "The aria-label for the calendar trigger button."
|
|
1187
|
+
},
|
|
1188
|
+
"getter": false,
|
|
1189
|
+
"setter": false,
|
|
1190
|
+
"reflect": true,
|
|
1191
|
+
"attribute": "calendar-button-label",
|
|
1192
|
+
"defaultValue": "'Open calendar'"
|
|
1193
|
+
},
|
|
632
1194
|
"disableClear": {
|
|
633
1195
|
"type": "boolean",
|
|
634
1196
|
"mutable": false,
|
|
@@ -638,10 +1200,10 @@ export class BqDatePicker {
|
|
|
638
1200
|
"references": {}
|
|
639
1201
|
},
|
|
640
1202
|
"required": false,
|
|
641
|
-
"optional":
|
|
1203
|
+
"optional": false,
|
|
642
1204
|
"docs": {
|
|
643
1205
|
"tags": [],
|
|
644
|
-
"text": "If `true`, the clear button won't be displayed"
|
|
1206
|
+
"text": "If `true`, the clear button won't be displayed."
|
|
645
1207
|
},
|
|
646
1208
|
"getter": false,
|
|
647
1209
|
"setter": false,
|
|
@@ -658,14 +1220,14 @@ export class BqDatePicker {
|
|
|
658
1220
|
"references": {}
|
|
659
1221
|
},
|
|
660
1222
|
"required": false,
|
|
661
|
-
"optional":
|
|
1223
|
+
"optional": false,
|
|
662
1224
|
"docs": {
|
|
663
1225
|
"tags": [],
|
|
664
|
-
"text": "Indicates whether the Date picker input is disabled or not
|
|
1226
|
+
"text": "Indicates whether the Date picker input is disabled or not."
|
|
665
1227
|
},
|
|
666
1228
|
"getter": false,
|
|
667
1229
|
"setter": false,
|
|
668
|
-
"reflect":
|
|
1230
|
+
"reflect": true,
|
|
669
1231
|
"attribute": "disabled",
|
|
670
1232
|
"defaultValue": "false"
|
|
671
1233
|
},
|
|
@@ -678,10 +1240,10 @@ export class BqDatePicker {
|
|
|
678
1240
|
"references": {}
|
|
679
1241
|
},
|
|
680
1242
|
"required": false,
|
|
681
|
-
"optional":
|
|
1243
|
+
"optional": false,
|
|
682
1244
|
"docs": {
|
|
683
1245
|
"tags": [],
|
|
684
|
-
"text": "
|
|
1246
|
+
"text": "Distance (gutter) between the Date picker panel and the input element."
|
|
685
1247
|
},
|
|
686
1248
|
"getter": false,
|
|
687
1249
|
"setter": false,
|
|
@@ -705,10 +1267,10 @@ export class BqDatePicker {
|
|
|
705
1267
|
}
|
|
706
1268
|
},
|
|
707
1269
|
"required": false,
|
|
708
|
-
"optional":
|
|
1270
|
+
"optional": false,
|
|
709
1271
|
"docs": {
|
|
710
1272
|
"tags": [],
|
|
711
|
-
"text": "The first day of the week, where Sunday is 0, Monday is 1, etc"
|
|
1273
|
+
"text": "The first day of the week, where Sunday is 0, Monday is 1, etc."
|
|
712
1274
|
},
|
|
713
1275
|
"getter": false,
|
|
714
1276
|
"setter": false,
|
|
@@ -730,14 +1292,13 @@ export class BqDatePicker {
|
|
|
730
1292
|
}
|
|
731
1293
|
},
|
|
732
1294
|
"required": false,
|
|
733
|
-
"optional":
|
|
1295
|
+
"optional": true,
|
|
734
1296
|
"docs": {
|
|
735
1297
|
"tags": [],
|
|
736
|
-
"text": "
|
|
1298
|
+
"text": "Options used when formatting the displayed value.\n\nWhen omitted, sensible defaults are picked based on `precision`:\n- `day` \u2192 `{ day: 'numeric', month: 'short', year: 'numeric' }`\n- `month` \u2192 `{ month: 'long', year: 'numeric' }`\n- `year` \u2192 `{ year: 'numeric' }`"
|
|
737
1299
|
},
|
|
738
1300
|
"getter": false,
|
|
739
|
-
"setter": false
|
|
740
|
-
"defaultValue": "{\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n }"
|
|
1301
|
+
"setter": false
|
|
741
1302
|
},
|
|
742
1303
|
"form": {
|
|
743
1304
|
"type": "string",
|
|
@@ -751,7 +1312,7 @@ export class BqDatePicker {
|
|
|
751
1312
|
"optional": true,
|
|
752
1313
|
"docs": {
|
|
753
1314
|
"tags": [],
|
|
754
|
-
"text": "The ID of the form
|
|
1315
|
+
"text": "The ID of the form the input belongs to."
|
|
755
1316
|
},
|
|
756
1317
|
"getter": false,
|
|
757
1318
|
"setter": false,
|
|
@@ -770,13 +1331,40 @@ export class BqDatePicker {
|
|
|
770
1331
|
"optional": true,
|
|
771
1332
|
"docs": {
|
|
772
1333
|
"tags": [],
|
|
773
|
-
"text": "
|
|
1334
|
+
"text": "Native form validation message (mandatory if `required` is set)."
|
|
774
1335
|
},
|
|
775
1336
|
"getter": false,
|
|
776
1337
|
"setter": false,
|
|
777
1338
|
"reflect": false,
|
|
778
1339
|
"attribute": "form-validation-message"
|
|
779
1340
|
},
|
|
1341
|
+
"initialView": {
|
|
1342
|
+
"type": "string",
|
|
1343
|
+
"mutable": false,
|
|
1344
|
+
"complexType": {
|
|
1345
|
+
"original": "TCalendarView",
|
|
1346
|
+
"resolved": "\"days\" | \"months\" | \"years\"",
|
|
1347
|
+
"references": {
|
|
1348
|
+
"TCalendarView": {
|
|
1349
|
+
"location": "import",
|
|
1350
|
+
"path": "./bq-date-picker.types",
|
|
1351
|
+
"id": "../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts::TCalendarView",
|
|
1352
|
+
"referenceLocation": "TCalendarView"
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
},
|
|
1356
|
+
"required": false,
|
|
1357
|
+
"optional": false,
|
|
1358
|
+
"docs": {
|
|
1359
|
+
"tags": [],
|
|
1360
|
+
"text": "The view opened first when the panel becomes visible."
|
|
1361
|
+
},
|
|
1362
|
+
"getter": false,
|
|
1363
|
+
"setter": false,
|
|
1364
|
+
"reflect": true,
|
|
1365
|
+
"attribute": "initial-view",
|
|
1366
|
+
"defaultValue": "'days'"
|
|
1367
|
+
},
|
|
780
1368
|
"isDateDisallowed": {
|
|
781
1369
|
"type": "unknown",
|
|
782
1370
|
"mutable": false,
|
|
@@ -794,7 +1382,7 @@ export class BqDatePicker {
|
|
|
794
1382
|
"optional": true,
|
|
795
1383
|
"docs": {
|
|
796
1384
|
"tags": [],
|
|
797
|
-
"text": "
|
|
1385
|
+
"text": "Predicate that marks specific dates as unselectable."
|
|
798
1386
|
},
|
|
799
1387
|
"getter": false,
|
|
800
1388
|
"setter": false
|
|
@@ -816,7 +1404,7 @@ export class BqDatePicker {
|
|
|
816
1404
|
"optional": false,
|
|
817
1405
|
"docs": {
|
|
818
1406
|
"tags": [],
|
|
819
|
-
"text": "
|
|
1407
|
+
"text": "Locale used for formatting dates."
|
|
820
1408
|
},
|
|
821
1409
|
"getter": false,
|
|
822
1410
|
"setter": false,
|
|
@@ -836,7 +1424,7 @@ export class BqDatePicker {
|
|
|
836
1424
|
"optional": true,
|
|
837
1425
|
"docs": {
|
|
838
1426
|
"tags": [],
|
|
839
|
-
"text": "
|
|
1427
|
+
"text": "Latest date that can be selected (ISO)."
|
|
840
1428
|
},
|
|
841
1429
|
"getter": false,
|
|
842
1430
|
"setter": false,
|
|
@@ -855,7 +1443,7 @@ export class BqDatePicker {
|
|
|
855
1443
|
"optional": true,
|
|
856
1444
|
"docs": {
|
|
857
1445
|
"tags": [],
|
|
858
|
-
"text": "
|
|
1446
|
+
"text": "Earliest date that can be selected (ISO)."
|
|
859
1447
|
},
|
|
860
1448
|
"getter": false,
|
|
861
1449
|
"setter": false,
|
|
@@ -864,7 +1452,7 @@ export class BqDatePicker {
|
|
|
864
1452
|
},
|
|
865
1453
|
"months": {
|
|
866
1454
|
"type": "number",
|
|
867
|
-
"mutable":
|
|
1455
|
+
"mutable": true,
|
|
868
1456
|
"complexType": {
|
|
869
1457
|
"original": "number",
|
|
870
1458
|
"resolved": "number",
|
|
@@ -874,26 +1462,34 @@ export class BqDatePicker {
|
|
|
874
1462
|
"optional": false,
|
|
875
1463
|
"docs": {
|
|
876
1464
|
"tags": [],
|
|
877
|
-
"text": "Number of months to show
|
|
1465
|
+
"text": "Number of months to show side by side (range / multi). Capped at 2.\nLarger values are silently clamped to keep the popover from overflowing\nthe viewport and to preserve keyboard navigation semantics."
|
|
878
1466
|
},
|
|
879
1467
|
"getter": false,
|
|
880
1468
|
"setter": false,
|
|
881
1469
|
"reflect": true,
|
|
882
|
-
"attribute": "months"
|
|
1470
|
+
"attribute": "months",
|
|
1471
|
+
"defaultValue": "1"
|
|
883
1472
|
},
|
|
884
1473
|
"monthsPerView": {
|
|
885
1474
|
"type": "string",
|
|
886
1475
|
"mutable": false,
|
|
887
1476
|
"complexType": {
|
|
888
|
-
"original": "
|
|
1477
|
+
"original": "TMonthsPerView",
|
|
889
1478
|
"resolved": "\"months\" | \"single\"",
|
|
890
|
-
"references": {
|
|
1479
|
+
"references": {
|
|
1480
|
+
"TMonthsPerView": {
|
|
1481
|
+
"location": "import",
|
|
1482
|
+
"path": "./bq-date-picker.types",
|
|
1483
|
+
"id": "../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts::TMonthsPerView",
|
|
1484
|
+
"referenceLocation": "TMonthsPerView"
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
891
1487
|
},
|
|
892
1488
|
"required": false,
|
|
893
1489
|
"optional": false,
|
|
894
1490
|
"docs": {
|
|
895
1491
|
"tags": [],
|
|
896
|
-
"text": "
|
|
1492
|
+
"text": "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."
|
|
897
1493
|
},
|
|
898
1494
|
"getter": false,
|
|
899
1495
|
"setter": false,
|
|
@@ -929,10 +1525,10 @@ export class BqDatePicker {
|
|
|
929
1525
|
"references": {}
|
|
930
1526
|
},
|
|
931
1527
|
"required": false,
|
|
932
|
-
"optional":
|
|
1528
|
+
"optional": false,
|
|
933
1529
|
"docs": {
|
|
934
1530
|
"tags": [],
|
|
935
|
-
"text": "If `true`, the
|
|
1531
|
+
"text": "If `true`, the panel is visible."
|
|
936
1532
|
},
|
|
937
1533
|
"getter": false,
|
|
938
1534
|
"setter": false,
|
|
@@ -952,7 +1548,7 @@ export class BqDatePicker {
|
|
|
952
1548
|
"optional": true,
|
|
953
1549
|
"docs": {
|
|
954
1550
|
"tags": [],
|
|
955
|
-
"text": "
|
|
1551
|
+
"text": "Overrides the height of the Date picker panel."
|
|
956
1552
|
},
|
|
957
1553
|
"getter": false,
|
|
958
1554
|
"setter": false,
|
|
@@ -972,7 +1568,7 @@ export class BqDatePicker {
|
|
|
972
1568
|
"optional": true,
|
|
973
1569
|
"docs": {
|
|
974
1570
|
"tags": [],
|
|
975
|
-
"text": "
|
|
1571
|
+
"text": "Placeholder text shown when no value is selected."
|
|
976
1572
|
},
|
|
977
1573
|
"getter": false,
|
|
978
1574
|
"setter": false,
|
|
@@ -995,10 +1591,10 @@ export class BqDatePicker {
|
|
|
995
1591
|
}
|
|
996
1592
|
},
|
|
997
1593
|
"required": false,
|
|
998
|
-
"optional":
|
|
1594
|
+
"optional": false,
|
|
999
1595
|
"docs": {
|
|
1000
1596
|
"tags": [],
|
|
1001
|
-
"text": "Position of the Date picker panel"
|
|
1597
|
+
"text": "Position of the Date picker panel."
|
|
1002
1598
|
},
|
|
1003
1599
|
"getter": false,
|
|
1004
1600
|
"setter": false,
|
|
@@ -1006,6 +1602,33 @@ export class BqDatePicker {
|
|
|
1006
1602
|
"attribute": "placement",
|
|
1007
1603
|
"defaultValue": "'bottom-end'"
|
|
1008
1604
|
},
|
|
1605
|
+
"precision": {
|
|
1606
|
+
"type": "string",
|
|
1607
|
+
"mutable": false,
|
|
1608
|
+
"complexType": {
|
|
1609
|
+
"original": "TDatePrecision",
|
|
1610
|
+
"resolved": "\"day\" | \"month\" | \"year\"",
|
|
1611
|
+
"references": {
|
|
1612
|
+
"TDatePrecision": {
|
|
1613
|
+
"location": "import",
|
|
1614
|
+
"path": "./bq-date-picker.types",
|
|
1615
|
+
"id": "../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts::TDatePrecision",
|
|
1616
|
+
"referenceLocation": "TDatePrecision"
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
"required": false,
|
|
1621
|
+
"optional": false,
|
|
1622
|
+
"docs": {
|
|
1623
|
+
"tags": [],
|
|
1624
|
+
"text": "Precision of the value produced by the picker.\n\n- `day` \u2192 `YYYY-MM-DD` (default). Standard drill-down.\n- `month` \u2192 `YYYY-MM`. Selection commits on the months view; no days view.\n- `year` \u2192 `YYYY`. Selection commits on the years view; no months/days view.\n\nWhen precision is coarser than day, `initialView` is forced to match and\nthe header title cycles through the views available for that precision."
|
|
1625
|
+
},
|
|
1626
|
+
"getter": false,
|
|
1627
|
+
"setter": false,
|
|
1628
|
+
"reflect": true,
|
|
1629
|
+
"attribute": "precision",
|
|
1630
|
+
"defaultValue": "'day'"
|
|
1631
|
+
},
|
|
1009
1632
|
"required": {
|
|
1010
1633
|
"type": "boolean",
|
|
1011
1634
|
"mutable": false,
|
|
@@ -1015,15 +1638,16 @@ export class BqDatePicker {
|
|
|
1015
1638
|
"references": {}
|
|
1016
1639
|
},
|
|
1017
1640
|
"required": false,
|
|
1018
|
-
"optional":
|
|
1641
|
+
"optional": false,
|
|
1019
1642
|
"docs": {
|
|
1020
1643
|
"tags": [],
|
|
1021
|
-
"text": "
|
|
1644
|
+
"text": "Whether a value must be selected before submitting the form."
|
|
1022
1645
|
},
|
|
1023
1646
|
"getter": false,
|
|
1024
1647
|
"setter": false,
|
|
1025
1648
|
"reflect": true,
|
|
1026
|
-
"attribute": "required"
|
|
1649
|
+
"attribute": "required",
|
|
1650
|
+
"defaultValue": "false"
|
|
1027
1651
|
},
|
|
1028
1652
|
"skidding": {
|
|
1029
1653
|
"type": "number",
|
|
@@ -1034,10 +1658,10 @@ export class BqDatePicker {
|
|
|
1034
1658
|
"references": {}
|
|
1035
1659
|
},
|
|
1036
1660
|
"required": false,
|
|
1037
|
-
"optional":
|
|
1661
|
+
"optional": false,
|
|
1038
1662
|
"docs": {
|
|
1039
1663
|
"tags": [],
|
|
1040
|
-
"text": "
|
|
1664
|
+
"text": "Skidding between the panel and the input element."
|
|
1041
1665
|
},
|
|
1042
1666
|
"getter": false,
|
|
1043
1667
|
"setter": false,
|
|
@@ -1057,7 +1681,7 @@ export class BqDatePicker {
|
|
|
1057
1681
|
"optional": false,
|
|
1058
1682
|
"docs": {
|
|
1059
1683
|
"tags": [],
|
|
1060
|
-
"text": "Whether to
|
|
1684
|
+
"text": "Whether to render days outside the current month."
|
|
1061
1685
|
},
|
|
1062
1686
|
"getter": false,
|
|
1063
1687
|
"setter": false,
|
|
@@ -1069,15 +1693,22 @@ export class BqDatePicker {
|
|
|
1069
1693
|
"type": "string",
|
|
1070
1694
|
"mutable": false,
|
|
1071
1695
|
"complexType": {
|
|
1072
|
-
"original": "
|
|
1696
|
+
"original": "TFloatingStrategy",
|
|
1073
1697
|
"resolved": "\"absolute\" | \"fixed\"",
|
|
1074
|
-
"references": {
|
|
1698
|
+
"references": {
|
|
1699
|
+
"TFloatingStrategy": {
|
|
1700
|
+
"location": "import",
|
|
1701
|
+
"path": "./bq-date-picker.types",
|
|
1702
|
+
"id": "../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts::TFloatingStrategy",
|
|
1703
|
+
"referenceLocation": "TFloatingStrategy"
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1075
1706
|
},
|
|
1076
1707
|
"required": false,
|
|
1077
|
-
"optional":
|
|
1708
|
+
"optional": false,
|
|
1078
1709
|
"docs": {
|
|
1079
1710
|
"tags": [],
|
|
1080
|
-
"text": "
|
|
1711
|
+
"text": "Positioning strategy for the panel."
|
|
1081
1712
|
},
|
|
1082
1713
|
"getter": false,
|
|
1083
1714
|
"setter": false,
|
|
@@ -1085,25 +1716,6 @@ export class BqDatePicker {
|
|
|
1085
1716
|
"attribute": "strategy",
|
|
1086
1717
|
"defaultValue": "'fixed'"
|
|
1087
1718
|
},
|
|
1088
|
-
"tentative": {
|
|
1089
|
-
"type": "string",
|
|
1090
|
-
"mutable": true,
|
|
1091
|
-
"complexType": {
|
|
1092
|
-
"original": "string",
|
|
1093
|
-
"resolved": "string",
|
|
1094
|
-
"references": {}
|
|
1095
|
-
},
|
|
1096
|
-
"required": false,
|
|
1097
|
-
"optional": true,
|
|
1098
|
-
"docs": {
|
|
1099
|
-
"tags": [],
|
|
1100
|
-
"text": "The date that is tentatively selected e.g. the start of a range selection"
|
|
1101
|
-
},
|
|
1102
|
-
"getter": false,
|
|
1103
|
-
"setter": false,
|
|
1104
|
-
"reflect": true,
|
|
1105
|
-
"attribute": "tentative"
|
|
1106
|
-
},
|
|
1107
1719
|
"type": {
|
|
1108
1720
|
"type": "string",
|
|
1109
1721
|
"mutable": false,
|
|
@@ -1123,7 +1735,7 @@ export class BqDatePicker {
|
|
|
1123
1735
|
"optional": false,
|
|
1124
1736
|
"docs": {
|
|
1125
1737
|
"tags": [],
|
|
1126
|
-
"text": "
|
|
1738
|
+
"text": "Selection type.\n- `single`: single date.\n- `multi`: multiple discrete dates.\n- `range`: contiguous range."
|
|
1127
1739
|
},
|
|
1128
1740
|
"getter": false,
|
|
1129
1741
|
"setter": false,
|
|
@@ -1149,11 +1761,8 @@ export class BqDatePicker {
|
|
|
1149
1761
|
"required": false,
|
|
1150
1762
|
"optional": false,
|
|
1151
1763
|
"docs": {
|
|
1152
|
-
"tags": [
|
|
1153
|
-
|
|
1154
|
-
"text": "This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n- `'none'`: No validation status is set.\n- `'error'`: The input has a validation error.\n- `'warning'`: The input has a validation warning.\n- `'success'`: The input has passed validation."
|
|
1155
|
-
}],
|
|
1156
|
-
"text": "The validation status of the Select input."
|
|
1764
|
+
"tags": [],
|
|
1765
|
+
"text": "Validation state applied to the input."
|
|
1157
1766
|
},
|
|
1158
1767
|
"getter": false,
|
|
1159
1768
|
"setter": false,
|
|
@@ -1165,7 +1774,7 @@ export class BqDatePicker {
|
|
|
1165
1774
|
"type": "string",
|
|
1166
1775
|
"mutable": true,
|
|
1167
1776
|
"complexType": {
|
|
1168
|
-
"original": "string",
|
|
1777
|
+
"original": "string | undefined",
|
|
1169
1778
|
"resolved": "string",
|
|
1170
1779
|
"references": {}
|
|
1171
1780
|
},
|
|
@@ -1173,7 +1782,7 @@ export class BqDatePicker {
|
|
|
1173
1782
|
"optional": false,
|
|
1174
1783
|
"docs": {
|
|
1175
1784
|
"tags": [],
|
|
1176
|
-
"text": "
|
|
1785
|
+
"text": "Currently selected value, in the precision-aware wire format:\n- `precision=\"day\"` \u2192 tokens are `YYYY-MM-DD`\n- `precision=\"month\"` \u2192 tokens are `YYYY-MM`\n- `precision=\"year\"` \u2192 tokens are `YYYY`\n\nHow multiple tokens are combined depends on `type`:\n- `single` \u2192 a single token (e.g. `\"2025-05-15\"`, `\"2025-05\"`, `\"2025\"`)\n- `range` \u2192 `\"start/end\"` \u2014 two tokens joined with `/`\n- `multi` \u2192 space-separated tokens (e.g. `\"2025-05-15 2025-05-20\"`)"
|
|
1177
1786
|
},
|
|
1178
1787
|
"getter": false,
|
|
1179
1788
|
"setter": false,
|
|
@@ -1184,14 +1793,18 @@ export class BqDatePicker {
|
|
|
1184
1793
|
}
|
|
1185
1794
|
static get states() {
|
|
1186
1795
|
return {
|
|
1187
|
-
"
|
|
1188
|
-
"focusedDate": {},
|
|
1796
|
+
"decadeStart": {},
|
|
1189
1797
|
"displayDate": {},
|
|
1798
|
+
"focusedISO": {},
|
|
1799
|
+
"focusedMonth": {},
|
|
1800
|
+
"focusedYear": {},
|
|
1801
|
+
"hasConstraintError": {},
|
|
1190
1802
|
"hasLabel": {},
|
|
1191
1803
|
"hasPrefix": {},
|
|
1192
|
-
"
|
|
1193
|
-
"
|
|
1194
|
-
"
|
|
1804
|
+
"hasValue": {},
|
|
1805
|
+
"tentativeHover": {},
|
|
1806
|
+
"view": {},
|
|
1807
|
+
"viewDate": {}
|
|
1195
1808
|
};
|
|
1196
1809
|
}
|
|
1197
1810
|
static get events() {
|
|
@@ -1203,7 +1816,7 @@ export class BqDatePicker {
|
|
|
1203
1816
|
"composed": true,
|
|
1204
1817
|
"docs": {
|
|
1205
1818
|
"tags": [],
|
|
1206
|
-
"text": "Callback handler emitted when the input loses focus"
|
|
1819
|
+
"text": "Callback handler emitted when the input loses focus."
|
|
1207
1820
|
},
|
|
1208
1821
|
"complexType": {
|
|
1209
1822
|
"original": "HTMLBqDatePickerElement",
|
|
@@ -1223,10 +1836,10 @@ export class BqDatePicker {
|
|
|
1223
1836
|
"composed": true,
|
|
1224
1837
|
"docs": {
|
|
1225
1838
|
"tags": [],
|
|
1226
|
-
"text": "Callback handler emitted when the input value
|
|
1839
|
+
"text": "Callback handler emitted when the input value changes."
|
|
1227
1840
|
},
|
|
1228
1841
|
"complexType": {
|
|
1229
|
-
"original": "{ value: string; el: HTMLBqDatePickerElement }",
|
|
1842
|
+
"original": "{ value: string | undefined; el: HTMLBqDatePickerElement }",
|
|
1230
1843
|
"resolved": "{ value: string; el: HTMLBqDatePickerElement; }",
|
|
1231
1844
|
"references": {
|
|
1232
1845
|
"HTMLBqDatePickerElement": {
|
|
@@ -1243,7 +1856,7 @@ export class BqDatePicker {
|
|
|
1243
1856
|
"composed": true,
|
|
1244
1857
|
"docs": {
|
|
1245
1858
|
"tags": [],
|
|
1246
|
-
"text": "Callback handler emitted when the
|
|
1859
|
+
"text": "Callback handler emitted when the value is cleared."
|
|
1247
1860
|
},
|
|
1248
1861
|
"complexType": {
|
|
1249
1862
|
"original": "HTMLBqDatePickerElement",
|
|
@@ -1263,7 +1876,7 @@ export class BqDatePicker {
|
|
|
1263
1876
|
"composed": true,
|
|
1264
1877
|
"docs": {
|
|
1265
1878
|
"tags": [],
|
|
1266
|
-
"text": "Callback handler emitted when the input
|
|
1879
|
+
"text": "Callback handler emitted when the input receives focus."
|
|
1267
1880
|
},
|
|
1268
1881
|
"complexType": {
|
|
1269
1882
|
"original": "HTMLBqDatePickerElement",
|
|
@@ -1275,6 +1888,32 @@ export class BqDatePicker {
|
|
|
1275
1888
|
}
|
|
1276
1889
|
}
|
|
1277
1890
|
}
|
|
1891
|
+
}, {
|
|
1892
|
+
"method": "bqViewChange",
|
|
1893
|
+
"name": "bqViewChange",
|
|
1894
|
+
"bubbles": true,
|
|
1895
|
+
"cancelable": true,
|
|
1896
|
+
"composed": true,
|
|
1897
|
+
"docs": {
|
|
1898
|
+
"tags": [],
|
|
1899
|
+
"text": "Callback handler emitted when the internal calendar view changes\n(e.g. from `days` to `months`, or from `years` back to `days`)."
|
|
1900
|
+
},
|
|
1901
|
+
"complexType": {
|
|
1902
|
+
"original": "{ view: TCalendarView; el: HTMLBqDatePickerElement }",
|
|
1903
|
+
"resolved": "{ view: \"days\" | \"months\" | \"years\"; el: HTMLBqDatePickerElement; }",
|
|
1904
|
+
"references": {
|
|
1905
|
+
"TCalendarView": {
|
|
1906
|
+
"location": "import",
|
|
1907
|
+
"path": "./bq-date-picker.types",
|
|
1908
|
+
"id": "../../packages/beeq/src/components/date-picker/bq-date-picker.types.ts::TCalendarView",
|
|
1909
|
+
"referenceLocation": "TCalendarView"
|
|
1910
|
+
},
|
|
1911
|
+
"HTMLBqDatePickerElement": {
|
|
1912
|
+
"location": "global",
|
|
1913
|
+
"id": "global::HTMLBqDatePickerElement"
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1278
1917
|
}];
|
|
1279
1918
|
}
|
|
1280
1919
|
static get methods() {
|
|
@@ -1292,10 +1931,10 @@ export class BqDatePicker {
|
|
|
1292
1931
|
"return": "Promise<void>"
|
|
1293
1932
|
},
|
|
1294
1933
|
"docs": {
|
|
1295
|
-
"text": "Clears the selected value.",
|
|
1934
|
+
"text": "Clears the selected value and any pending validation state (bad input,\nbounds overflow). Emits `bqClear`. No-op when the component is disabled.",
|
|
1296
1935
|
"tags": [{
|
|
1297
1936
|
"name": "returns",
|
|
1298
|
-
"text":
|
|
1937
|
+
"text": "A promise that resolves once the value has been cleared."
|
|
1299
1938
|
}]
|
|
1300
1939
|
}
|
|
1301
1940
|
}
|
|
@@ -1306,9 +1945,60 @@ export class BqDatePicker {
|
|
|
1306
1945
|
return [{
|
|
1307
1946
|
"propName": "value",
|
|
1308
1947
|
"methodName": "handleValueChange"
|
|
1948
|
+
}, {
|
|
1949
|
+
"propName": "formatOptions",
|
|
1950
|
+
"methodName": "handleFormattingChange"
|
|
1951
|
+
}, {
|
|
1952
|
+
"propName": "locale",
|
|
1953
|
+
"methodName": "handleFormattingChange"
|
|
1309
1954
|
}, {
|
|
1310
1955
|
"propName": "type",
|
|
1956
|
+
"methodName": "handleTypeChange"
|
|
1957
|
+
}, {
|
|
1958
|
+
"propName": "precision",
|
|
1959
|
+
"methodName": "handlePrecisionChange"
|
|
1960
|
+
}, {
|
|
1961
|
+
"propName": "max",
|
|
1962
|
+
"methodName": "handleBoundsChange"
|
|
1963
|
+
}, {
|
|
1964
|
+
"propName": "min",
|
|
1965
|
+
"methodName": "handleBoundsChange"
|
|
1966
|
+
}, {
|
|
1967
|
+
"propName": "required",
|
|
1968
|
+
"methodName": "handleRequiredChange"
|
|
1969
|
+
}, {
|
|
1970
|
+
"propName": "firstDayOfWeek",
|
|
1311
1971
|
"methodName": "checkPropValues"
|
|
1972
|
+
}, {
|
|
1973
|
+
"propName": "initialView",
|
|
1974
|
+
"methodName": "checkPropValues"
|
|
1975
|
+
}, {
|
|
1976
|
+
"propName": "monthsPerView",
|
|
1977
|
+
"methodName": "checkPropValues"
|
|
1978
|
+
}, {
|
|
1979
|
+
"propName": "placement",
|
|
1980
|
+
"methodName": "checkPropValues"
|
|
1981
|
+
}, {
|
|
1982
|
+
"propName": "precision",
|
|
1983
|
+
"methodName": "checkPropValues"
|
|
1984
|
+
}, {
|
|
1985
|
+
"propName": "strategy",
|
|
1986
|
+
"methodName": "checkPropValues"
|
|
1987
|
+
}, {
|
|
1988
|
+
"propName": "type",
|
|
1989
|
+
"methodName": "checkPropValues"
|
|
1990
|
+
}, {
|
|
1991
|
+
"propName": "validationStatus",
|
|
1992
|
+
"methodName": "checkPropValues"
|
|
1993
|
+
}, {
|
|
1994
|
+
"propName": "months",
|
|
1995
|
+
"methodName": "handleMonthsChange"
|
|
1996
|
+
}, {
|
|
1997
|
+
"propName": "open",
|
|
1998
|
+
"methodName": "handleOpen"
|
|
1999
|
+
}, {
|
|
2000
|
+
"propName": "view",
|
|
2001
|
+
"methodName": "handleViewChange"
|
|
1312
2002
|
}];
|
|
1313
2003
|
}
|
|
1314
2004
|
static get listeners() {
|
|
@@ -1318,12 +2008,6 @@ export class BqDatePicker {
|
|
|
1318
2008
|
"target": undefined,
|
|
1319
2009
|
"capture": true,
|
|
1320
2010
|
"passive": false
|
|
1321
|
-
}, {
|
|
1322
|
-
"name": "click",
|
|
1323
|
-
"method": "handleClickOutside",
|
|
1324
|
-
"target": "body",
|
|
1325
|
-
"capture": true,
|
|
1326
|
-
"passive": false
|
|
1327
2011
|
}];
|
|
1328
2012
|
}
|
|
1329
2013
|
static get attachInternalsMemberName() { return "internals"; }
|