@beeq/core 1.8.0-beta.3 → 1.8.0-beta.5
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.css +1 -1
- package/dist/beeq/beeq.esm.js +43 -1
- package/dist/beeq/beeq.esm.js.map +1 -1
- package/dist/beeq/index.esm.js +64 -1
- package/dist/beeq/index.esm.js.map +1 -1
- package/dist/beeq/p-01df4baa.js +1826 -0
- package/dist/beeq/p-01df4baa.js.map +1 -0
- package/dist/beeq/p-01fe8efb.entry.js +182 -0
- package/dist/beeq/p-01fe8efb.entry.js.map +1 -0
- package/dist/beeq/p-03373320.entry.js +318 -0
- package/dist/beeq/p-03373320.entry.js.map +1 -0
- package/dist/beeq/{p-b7f02fb6.entry.js → p-03c586df.entry.js} +288 -2
- package/dist/beeq/p-03c586df.entry.js.map +1 -0
- package/dist/beeq/{p-b994054a.entry.js → p-0a981080.entry.js} +150 -2
- package/dist/beeq/{p-6823479d.entry.js.map → p-0a981080.entry.js.map} +1 -1
- package/dist/beeq/{p-010fb578.entry.js → p-0ce76c54.entry.js} +99 -2
- package/dist/beeq/{p-45b7b5cf.entry.js.map → p-0ce76c54.entry.js.map} +1 -1
- package/dist/beeq/p-115ed5b2.js +25 -1
- package/dist/beeq/p-115ed5b2.js.map +1 -1
- package/dist/beeq/p-1c8b6eb4.js +12 -1
- package/dist/beeq/p-1c8b6eb4.js.map +1 -1
- package/dist/beeq/p-1defeea3.js +69 -0
- package/dist/beeq/{p-951ba558.js.map → p-1defeea3.js.map} +1 -1
- package/dist/beeq/p-1f3a4359.js +11 -1
- package/dist/beeq/p-1f3a4359.js.map +1 -1
- package/dist/beeq/p-2bb049ae.entry.js +334 -0
- package/dist/beeq/p-2bb049ae.entry.js.map +1 -0
- package/dist/beeq/p-3043c826.entry.js +133 -0
- package/dist/beeq/p-3043c826.entry.js.map +1 -0
- package/dist/beeq/p-38e70f78.entry.js +133 -0
- package/dist/beeq/p-38e70f78.entry.js.map +1 -0
- package/dist/beeq/p-398bfb48.entry.js +242 -0
- package/dist/beeq/{p-7871f3f0.entry.js.map → p-398bfb48.entry.js.map} +1 -1
- package/dist/beeq/p-3f9a348a.entry.js +272 -0
- package/dist/beeq/{p-2e61db84.entry.js.map → p-3f9a348a.entry.js.map} +1 -1
- package/dist/beeq/p-3fd0d92d.js +1228 -1
- package/dist/beeq/p-3fd0d92d.js.map +1 -1
- package/dist/beeq/p-41ac1d84.entry.js +195 -0
- package/dist/beeq/p-41ac1d84.entry.js.map +1 -0
- package/dist/beeq/p-4eabcd51.entry.js +82 -0
- package/dist/beeq/{p-d5992d3d.entry.js.map → p-4eabcd51.entry.js.map} +1 -1
- package/dist/beeq/p-544deac1.entry.js +528 -0
- package/dist/beeq/p-544deac1.entry.js.map +1 -0
- package/dist/beeq/p-57621be1.js +9 -1
- package/dist/beeq/p-57621be1.js.map +1 -1
- package/dist/beeq/p-5ff6621d.entry.js +134 -0
- package/dist/beeq/p-5ff6621d.entry.js.map +1 -0
- package/dist/beeq/p-60cbc966.entry.js +85 -0
- package/dist/beeq/{p-95d0abdc.entry.js.map → p-60cbc966.entry.js.map} +1 -1
- package/dist/beeq/p-687da041.js +20 -1
- package/dist/beeq/p-687da041.js.map +1 -1
- package/dist/beeq/p-68ff188d.entry.js +144 -0
- package/dist/beeq/p-68ff188d.entry.js.map +1 -0
- package/dist/beeq/p-69c766a3.entry.js +213 -0
- package/dist/beeq/p-69c766a3.entry.js.map +1 -0
- package/dist/beeq/p-76486949.entry.js +347 -0
- package/dist/beeq/p-76486949.entry.js.map +1 -0
- package/dist/beeq/p-83d6d9ad.js +14 -0
- package/dist/beeq/{p-513bab02.js.map → p-83d6d9ad.js.map} +1 -1
- package/dist/beeq/p-8b16f130.entry.js +210 -0
- package/dist/beeq/{p-010fb578.entry.js.map → p-8b16f130.entry.js.map} +1 -1
- package/dist/beeq/p-8e1c6978.entry.js +443 -0
- package/dist/beeq/p-8e1c6978.entry.js.map +1 -0
- package/dist/beeq/p-8f1c68c0.js +71 -0
- package/dist/beeq/p-8f1c68c0.js.map +1 -0
- package/dist/beeq/p-99829fc7.js +8 -1
- package/dist/beeq/p-99829fc7.js.map +1 -1
- package/dist/beeq/p-9cab14ee.entry.js +119 -0
- package/dist/beeq/{p-f7a0a316.entry.js.map → p-9cab14ee.entry.js.map} +1 -1
- package/dist/beeq/p-a23b23c4.entry.js +213 -0
- package/dist/beeq/p-a23b23c4.entry.js.map +1 -0
- package/dist/beeq/p-a5dc1c94.js +118 -1
- package/dist/beeq/p-a5dc1c94.js.map +1 -1
- package/dist/beeq/p-a608a4fb.entry.js +112 -0
- package/dist/beeq/{p-9da0e8d7.entry.js.map → p-a608a4fb.entry.js.map} +1 -1
- package/dist/beeq/p-a8cad5ab.js +5 -1
- package/dist/beeq/p-a8cad5ab.js.map +1 -1
- package/dist/beeq/p-aacaaa35.entry.js +209 -0
- package/dist/beeq/{p-ded1aed2.entry.js.map → p-aacaaa35.entry.js.map} +1 -1
- package/dist/beeq/p-af062402.js +7 -1
- package/dist/beeq/p-af062402.js.map +1 -1
- package/dist/beeq/p-b2df1479.entry.js +270 -0
- package/dist/beeq/p-b2df1479.entry.js.map +1 -0
- package/dist/beeq/p-b77b52f2.entry.js +188 -0
- package/dist/beeq/{p-0cbec77b.entry.js.map → p-b77b52f2.entry.js.map} +1 -1
- package/dist/beeq/p-c78ae3c2.js +1983 -0
- package/dist/beeq/p-c78ae3c2.js.map +1 -0
- package/dist/beeq/p-c83bc7fd.entry.js +157 -0
- package/dist/beeq/p-c83bc7fd.entry.js.map +1 -0
- package/dist/beeq/p-cb2b0014.entry.js +363 -0
- package/dist/beeq/p-cb2b0014.entry.js.map +1 -0
- package/dist/beeq/p-cb917e68.entry.js +177 -0
- package/dist/beeq/p-cb917e68.entry.js.map +1 -0
- package/dist/beeq/p-cfb8829b.entry.js +100 -0
- package/dist/beeq/{p-b2acd8f3.entry.js.map → p-cfb8829b.entry.js.map} +1 -1
- package/dist/beeq/p-d7067dae.entry.js +151 -0
- package/dist/beeq/{p-1202161d.entry.js.map → p-d7067dae.entry.js.map} +1 -1
- package/dist/beeq/p-d7ce7165.js +91 -0
- package/dist/beeq/p-d7ce7165.js.map +1 -0
- package/dist/beeq/p-d7dc7086.entry.js +267 -0
- package/dist/beeq/p-d7dc7086.entry.js.map +1 -0
- package/dist/beeq/p-ecd27cf2.js +11 -1
- package/dist/beeq/p-ecd27cf2.js.map +1 -1
- package/dist/beeq/p-edfd9767.js +31 -0
- package/dist/beeq/p-edfd9767.js.map +1 -0
- package/dist/beeq/p-f11a3beb.entry.js +90 -0
- package/dist/beeq/{p-fbf6b04b.entry.js.map → p-f11a3beb.entry.js.map} +1 -1
- package/dist/beeq/p-f1d6a960.entry.js +271 -0
- package/dist/beeq/p-f1d6a960.entry.js.map +1 -0
- package/dist/beeq/p-f350516b.entry.js +154 -0
- package/dist/beeq/p-f350516b.entry.js.map +1 -0
- package/dist/beeq/p-f979d79a.entry.js +120 -0
- package/dist/beeq/{p-83207939.entry.js.map → p-f979d79a.entry.js.map} +1 -1
- package/dist/beeq/{p-d5992d3d.entry.js → p-faa3be41.entry.js} +155 -2
- package/dist/beeq/{p-e7ede06e.entry.js.map → p-faa3be41.entry.js.map} +1 -1
- package/dist/beeq/p-fb20c6eb.entry.js +458 -0
- package/dist/beeq/p-fb20c6eb.entry.js.map +1 -0
- package/dist/beeq/p-fe278ecc.entry.js +267 -0
- package/dist/beeq/p-fe278ecc.entry.js.map +1 -0
- package/dist/cjs/assetsPath-8bd8d221.js +77 -0
- package/dist/cjs/assetsPath-8bd8d221.js.map +1 -0
- package/dist/cjs/beeq.cjs.js +3 -3
- package/dist/cjs/beeq.cjs.js.map +1 -1
- package/dist/cjs/bq-accordion-group.cjs.entry.js +3 -4
- package/dist/cjs/bq-accordion-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-accordion.cjs.entry.js +83 -48
- package/dist/cjs/bq-accordion.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-alert.cjs.entry.js +57 -43
- package/dist/cjs/bq-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-avatar.cjs.entry.js +40 -40
- package/dist/cjs/bq-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-badge.cjs.entry.js +42 -42
- package/dist/cjs/bq-badge.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js +39 -29
- package/dist/cjs/bq-breadcrumb-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-breadcrumb.cjs.entry.js +45 -30
- package/dist/cjs/bq-breadcrumb.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-button_2.cjs.entry.js +138 -90
- package/dist/cjs/bq-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-card.cjs.entry.js +3 -4
- package/dist/cjs/bq-card.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-checkbox.cjs.entry.js +63 -54
- package/dist/cjs/bq-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-date-picker.cjs.entry.js +160 -140
- package/dist/cjs/bq-date-picker.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dialog.cjs.entry.js +71 -50
- package/dist/cjs/bq-dialog.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-divider.cjs.entry.js +23 -21
- package/dist/cjs/bq-divider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-drawer.cjs.entry.js +48 -34
- package/dist/cjs/bq-drawer.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-dropdown_2.cjs.entry.js +44 -34
- package/dist/cjs/bq-dropdown_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-empty-state.cjs.entry.js +25 -22
- package/dist/cjs/bq-empty-state.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-input.cjs.entry.js +116 -90
- package/dist/cjs/bq-input.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-notification.cjs.entry.js +63 -49
- package/dist/cjs/bq-notification.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-group.cjs.entry.js +3 -3
- package/dist/cjs/bq-option-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option-list_2.cjs.entry.js +73 -54
- package/dist/cjs/bq-option-list_2.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-option.cjs.entry.js +61 -45
- package/dist/cjs/bq-option.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-page-title.cjs.entry.js +36 -32
- package/dist/cjs/bq-page-title.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-progress.cjs.entry.js +3 -4
- package/dist/cjs/bq-progress.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio-group.cjs.entry.js +12 -7
- package/dist/cjs/bq-radio-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-radio.cjs.entry.js +43 -37
- package/dist/cjs/bq-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-select.cjs.entry.js +185 -168
- package/dist/cjs/bq-select.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu-item.cjs.entry.js +68 -55
- package/dist/cjs/bq-side-menu-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-side-menu.cjs.entry.js +47 -32
- package/dist/cjs/bq-side-menu.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-slider.cjs.entry.js +160 -145
- package/dist/cjs/bq-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-spinner.cjs.entry.js +52 -51
- package/dist/cjs/bq-spinner.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-status.cjs.entry.js +3 -4
- package/dist/cjs/bq-status.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-step-item.cjs.entry.js +15 -11
- package/dist/cjs/bq-step-item.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-steps.cjs.entry.js +12 -10
- package/dist/cjs/bq-steps.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-switch.cjs.entry.js +43 -32
- package/dist/cjs/bq-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab-group.cjs.entry.js +64 -57
- package/dist/cjs/bq-tab-group.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tab.cjs.entry.js +43 -33
- package/dist/cjs/bq-tab.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-textarea.cjs.entry.js +80 -58
- package/dist/cjs/bq-textarea.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-toast.cjs.entry.js +44 -38
- package/dist/cjs/bq-toast.cjs.entry.js.map +1 -1
- package/dist/cjs/bq-tooltip.cjs.entry.js +46 -42
- package/dist/cjs/bq-tooltip.cjs.entry.js.map +1 -1
- package/dist/cjs/{cssVariables-a0e1e906.js → cssVariables-dd190bc2.js} +2 -2
- package/dist/cjs/cssVariables-dd190bc2.js.map +1 -0
- package/dist/cjs/{debounce-f94a239b.js → debounce-1f7e1176.js} +3 -3
- package/dist/cjs/debounce-1f7e1176.js.map +1 -0
- package/dist/cjs/{index-e6d59dbb.js → index-34edf639.js} +48 -15
- package/dist/cjs/index-34edf639.js.map +1 -0
- package/dist/cjs/{index-e4c116b6.js → index-fc7876d6.js} +63 -19
- package/dist/cjs/index-fc7876d6.js.map +1 -0
- package/dist/cjs/index.cjs.js +5 -5
- package/dist/cjs/{isDefined-a9dd6d5b.js → isDefined-f3968296.js} +1 -2
- package/dist/cjs/isDefined-f3968296.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{slot-dd6f7db9.js → slot-2fee189a.js} +3 -4
- package/dist/{beeq/p-d7a88b16.js.map → cjs/slot-2fee189a.js.map} +1 -1
- package/dist/collection/_storybook/foundation/helper/index.js +3 -3
- package/dist/collection/_storybook/foundation/helper/index.js.map +1 -1
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/accordion/bq-accordion.js +72 -39
- package/dist/collection/components/accordion/bq-accordion.js.map +1 -1
- package/dist/collection/components/accordion/helper/index.js +10 -4
- package/dist/collection/components/accordion/helper/index.js.map +1 -1
- package/dist/collection/components/accordion/scss/bq-accordion.css +1 -1
- package/dist/collection/components/accordion-group/bq-accordion-group.js +5 -0
- package/dist/collection/components/accordion-group/bq-accordion-group.js.map +1 -1
- package/dist/collection/components/accordion-group/scss/bq-accordion-group.css +1 -1
- package/dist/collection/components/alert/bq-alert.js +55 -37
- package/dist/collection/components/alert/bq-alert.js.map +1 -1
- package/dist/collection/components/alert/scss/bq-alert.css +1 -1
- package/dist/collection/components/avatar/bq-avatar.js +40 -36
- package/dist/collection/components/avatar/bq-avatar.js.map +1 -1
- package/dist/collection/components/avatar/scss/bq-avatar.css +1 -1
- package/dist/collection/components/badge/bq-badge.js +40 -36
- package/dist/collection/components/badge/bq-badge.js.map +1 -1
- package/dist/collection/components/badge/scss/bq-badge.css +1 -1
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js +45 -26
- package/dist/collection/components/breadcrumb/bq-breadcrumb.js.map +1 -1
- package/dist/collection/components/breadcrumb/scss/bq-breadcrumb.css +1 -1
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js +40 -24
- package/dist/collection/components/breadcrumb-item/bq-breadcrumb-item.js.map +1 -1
- package/dist/collection/components/breadcrumb-item/scss/bq-breadcrumb-item.css +1 -1
- package/dist/collection/components/button/bq-button.js +84 -43
- package/dist/collection/components/button/bq-button.js.map +1 -1
- package/dist/collection/components/button/scss/bq-button.css +1 -1
- package/dist/collection/components/card/bq-card.js +5 -0
- package/dist/collection/components/card/bq-card.js.map +1 -1
- package/dist/collection/components/card/scss/bq-card.css +1 -1
- package/dist/collection/components/checkbox/bq-checkbox.js +63 -50
- 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 +158 -134
- package/dist/collection/components/date-picker/bq-date-picker.js.map +1 -1
- package/dist/collection/components/date-picker/scss/bq-date-picker.css +1 -1
- package/dist/collection/components/dialog/bq-dialog.js +70 -45
- package/dist/collection/components/dialog/bq-dialog.js.map +1 -1
- package/dist/collection/components/dialog/scss/bq-dialog.css +1 -1
- package/dist/collection/components/divider/bq-divider.js +21 -15
- package/dist/collection/components/divider/bq-divider.js.map +1 -1
- package/dist/collection/components/divider/scss/bq-divider.css +1 -1
- package/dist/collection/components/drawer/bq-drawer.js +47 -29
- package/dist/collection/components/drawer/bq-drawer.js.map +1 -1
- package/dist/collection/components/drawer/scss/bq-drawer.css +1 -1
- package/dist/collection/components/dropdown/bq-dropdown.js +34 -23
- package/dist/collection/components/dropdown/bq-dropdown.js.map +1 -1
- package/dist/collection/components/empty-state/bq-empty-state.js +25 -18
- package/dist/collection/components/empty-state/bq-empty-state.js.map +1 -1
- package/dist/collection/components/icon/bq-icon.js +41 -37
- package/dist/collection/components/icon/bq-icon.js.map +1 -1
- package/dist/collection/components/icon/helper/request.js +2 -2
- package/dist/collection/components/icon/helper/request.js.map +1 -1
- package/dist/collection/components/icon/scss/bq-icon.css +1 -1
- package/dist/collection/components/input/bq-input.js +113 -83
- package/dist/collection/components/input/bq-input.js.map +1 -1
- package/dist/collection/components/input/scss/bq-input.css +1 -1
- package/dist/collection/components/notification/bq-notification.js +61 -43
- package/dist/collection/components/notification/bq-notification.js.map +1 -1
- package/dist/collection/components/notification/scss/bq-notification.css +1 -1
- package/dist/collection/components/option/bq-option.js +60 -40
- package/dist/collection/components/option/bq-option.js.map +1 -1
- package/dist/collection/components/option/scss/bq-option.css +1 -1
- package/dist/collection/components/option-group/bq-option-group.js +5 -0
- package/dist/collection/components/option-group/bq-option-group.js.map +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 +10 -0
- package/dist/collection/components/option-list/bq-option-list.js.map +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 +35 -27
- package/dist/collection/components/page-title/bq-page-title.js.map +1 -1
- package/dist/collection/components/page-title/scss/bq-page-title.css +1 -1
- package/dist/collection/components/panel/bq-panel.js +11 -6
- package/dist/collection/components/panel/bq-panel.js.map +1 -1
- package/dist/collection/components/panel/scss/bq-panel.css +1 -1
- package/dist/collection/components/progress/bq-progress.js +5 -0
- package/dist/collection/components/progress/bq-progress.js.map +1 -1
- package/dist/collection/components/progress/scss/bq-progress.css +1 -1
- package/dist/collection/components/radio/bq-radio.js +43 -34
- 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 +12 -3
- package/dist/collection/components/radio-group/bq-radio-group.js.map +1 -1
- package/dist/collection/components/select/bq-select.js +182 -161
- package/dist/collection/components/select/bq-select.js.map +1 -1
- package/dist/collection/components/select/scss/bq-select.css +1 -1
- package/dist/collection/components/side-menu/bq-side-menu.js +50 -29
- package/dist/collection/components/side-menu/bq-side-menu.js.map +1 -1
- package/dist/collection/components/side-menu/scss/bq-side-menu.css +1 -1
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js +68 -51
- package/dist/collection/components/side-menu-item/bq-side-menu-item.js.map +1 -1
- package/dist/collection/components/side-menu-item/scss/bq-side-menu-item.css +1 -1
- package/dist/collection/components/slider/bq-slider.js +159 -140
- package/dist/collection/components/slider/bq-slider.js.map +1 -1
- package/dist/collection/components/slider/scss/bq-slider.css +1 -1
- package/dist/collection/components/spinner/bq-spinner.js +51 -46
- package/dist/collection/components/spinner/bq-spinner.js.map +1 -1
- package/dist/collection/components/spinner/scss/bq-spinner.css +1 -1
- package/dist/collection/components/status/bq-status.js +5 -0
- package/dist/collection/components/status/bq-status.js.map +1 -1
- package/dist/collection/components/status/scss/bq-status.css +1 -1
- package/dist/collection/components/step-item/bq-step-item.js +17 -7
- package/dist/collection/components/step-item/bq-step-item.js.map +1 -1
- package/dist/collection/components/step-item/scss/bq-step-item.css +1 -1
- package/dist/collection/components/steps/bq-steps.js +12 -6
- package/dist/collection/components/steps/bq-steps.js.map +1 -1
- package/dist/collection/components/steps/scss/bq-steps.css +1 -1
- package/dist/collection/components/switch/bq-switch.js +42 -27
- package/dist/collection/components/switch/bq-switch.js.map +1 -1
- package/dist/collection/components/switch/scss/bq-switch.css +1 -1
- package/dist/collection/components/tab/bq-tab.js +42 -28
- package/dist/collection/components/tab/bq-tab.js.map +1 -1
- package/dist/collection/components/tab/scss/bq-tab.css +1 -1
- package/dist/collection/components/tab-group/bq-tab-group.js +64 -53
- package/dist/collection/components/tab-group/bq-tab-group.js.map +1 -1
- package/dist/collection/components/tag/bq-tag.js +64 -46
- package/dist/collection/components/tag/bq-tag.js.map +1 -1
- package/dist/collection/components/tag/scss/bq-tag.css +1 -1
- package/dist/collection/components/textarea/bq-textarea.js +78 -52
- package/dist/collection/components/textarea/bq-textarea.js.map +1 -1
- package/dist/collection/components/textarea/scss/bq-textarea.css +1 -1
- package/dist/collection/components/toast/bq-toast.js +43 -33
- package/dist/collection/components/toast/bq-toast.js.map +1 -1
- package/dist/collection/components/toast/scss/bq-toast.css +1 -1
- package/dist/collection/components/tooltip/bq-tooltip.js +45 -38
- package/dist/collection/components/tooltip/bq-tooltip.js.map +1 -1
- package/dist/collection/components/tooltip/scss/bq-tooltip.css +1 -1
- package/dist/collection/index.js +0 -1
- package/dist/collection/index.js.map +1 -1
- package/dist/collection/services/libraries/floating-ui/index.js +4 -0
- package/dist/collection/services/libraries/floating-ui/index.js.map +1 -1
- package/dist/collection/shared/utils/assetsPath.js +45 -57
- package/dist/collection/shared/utils/assetsPath.js.map +1 -1
- package/dist/collection/shared/utils/cssVariables.js +1 -1
- package/dist/collection/shared/utils/cssVariables.js.map +1 -1
- package/dist/collection/shared/utils/debounce.js +2 -2
- package/dist/collection/shared/utils/debounce.js.map +1 -1
- package/dist/collection/shared/utils/slot.js +2 -3
- package/dist/collection/shared/utils/slot.js.map +1 -1
- package/dist/components/bq-accordion-group.js +2 -3
- package/dist/components/bq-accordion-group.js.map +1 -1
- package/dist/components/bq-accordion.js +81 -46
- package/dist/components/bq-accordion.js.map +1 -1
- package/dist/components/bq-alert.js +54 -40
- package/dist/components/bq-alert.js.map +1 -1
- package/dist/components/bq-avatar.js +39 -39
- package/dist/components/bq-avatar.js.map +1 -1
- package/dist/components/bq-badge2.js +39 -39
- package/dist/components/bq-badge2.js.map +1 -1
- package/dist/components/bq-breadcrumb-item.js +37 -27
- package/dist/components/bq-breadcrumb-item.js.map +1 -1
- package/dist/components/bq-breadcrumb.js +44 -29
- package/dist/components/bq-breadcrumb.js.map +1 -1
- package/dist/components/bq-button2.js +84 -47
- package/dist/components/bq-button2.js.map +1 -1
- package/dist/components/bq-card.js +2 -3
- package/dist/components/bq-card.js.map +1 -1
- package/dist/components/bq-checkbox.js +62 -53
- package/dist/components/bq-checkbox.js.map +1 -1
- package/dist/components/bq-date-picker.js +157 -137
- package/dist/components/bq-date-picker.js.map +1 -1
- package/dist/components/bq-dialog.js +69 -48
- package/dist/components/bq-dialog.js.map +1 -1
- package/dist/components/bq-divider2.js +20 -18
- package/dist/components/bq-divider2.js.map +1 -1
- package/dist/components/bq-drawer.js +46 -32
- package/dist/components/bq-drawer.js.map +1 -1
- package/dist/components/bq-dropdown2.js +32 -24
- package/dist/components/bq-dropdown2.js.map +1 -1
- package/dist/components/bq-empty-state.js +23 -20
- package/dist/components/bq-empty-state.js.map +1 -1
- package/dist/components/bq-icon2.js +112 -42
- package/dist/components/bq-icon2.js.map +1 -1
- package/dist/components/bq-input.js +112 -86
- package/dist/components/bq-input.js.map +1 -1
- package/dist/components/bq-notification.js +60 -46
- package/dist/components/bq-notification.js.map +1 -1
- package/dist/components/bq-option-group.js +2 -2
- package/dist/components/bq-option-group.js.map +1 -1
- package/dist/components/bq-option-list2.js +7 -3
- package/dist/components/bq-option-list2.js.map +1 -1
- package/dist/components/bq-option.js +59 -43
- package/dist/components/bq-option.js.map +1 -1
- package/dist/components/bq-page-title.js +34 -30
- package/dist/components/bq-page-title.js.map +1 -1
- package/dist/components/bq-panel2.js +10 -8
- package/dist/components/bq-panel2.js.map +1 -1
- package/dist/components/bq-progress.js +2 -3
- package/dist/components/bq-progress.js.map +1 -1
- package/dist/components/bq-radio-group.js +10 -5
- package/dist/components/bq-radio-group.js.map +1 -1
- package/dist/components/bq-radio.js +43 -37
- package/dist/components/bq-radio.js.map +1 -1
- package/dist/components/bq-select.js +181 -164
- package/dist/components/bq-select.js.map +1 -1
- package/dist/components/bq-side-menu-item.js +67 -54
- package/dist/components/bq-side-menu-item.js.map +1 -1
- package/dist/components/bq-side-menu.js +47 -31
- package/dist/components/bq-side-menu.js.map +1 -1
- package/dist/components/bq-slider.js +158 -143
- package/dist/components/bq-slider.js.map +1 -1
- package/dist/components/bq-spinner.js +49 -48
- package/dist/components/bq-spinner.js.map +1 -1
- package/dist/components/bq-status.js +2 -3
- package/dist/components/bq-status.js.map +1 -1
- package/dist/components/bq-step-item.js +14 -10
- package/dist/components/bq-step-item.js.map +1 -1
- package/dist/components/bq-steps.js +11 -9
- package/dist/components/bq-steps.js.map +1 -1
- package/dist/components/bq-switch.js +41 -30
- package/dist/components/bq-switch.js.map +1 -1
- package/dist/components/bq-tab-group.js +62 -55
- package/dist/components/bq-tab-group.js.map +1 -1
- package/dist/components/bq-tab.js +41 -31
- package/dist/components/bq-tab.js.map +1 -1
- package/dist/components/bq-tag2.js +63 -49
- package/dist/components/bq-tag2.js.map +1 -1
- package/dist/components/bq-textarea.js +77 -55
- package/dist/components/bq-textarea.js.map +1 -1
- package/dist/components/bq-toast.js +42 -36
- package/dist/components/bq-toast.js.map +1 -1
- package/dist/components/bq-tooltip2.js +44 -40
- package/dist/components/bq-tooltip2.js.map +1 -1
- package/dist/components/cssVariables.js +1 -1
- package/dist/components/cssVariables.js.map +1 -1
- package/dist/components/debounce.js +2 -2
- package/dist/components/debounce.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +62 -18
- package/dist/components/index2.js.map +1 -1
- package/dist/components/isDefined.js +0 -1
- package/dist/components/isDefined.js.map +1 -1
- package/dist/components/slot.js +2 -3
- package/dist/components/slot.js.map +1 -1
- package/dist/esm/assetsPath-beeee241.js +74 -0
- package/dist/esm/assetsPath-beeee241.js.map +1 -0
- package/dist/esm/beeq.js +4 -4
- package/dist/esm/beeq.js.map +1 -1
- package/dist/esm/bq-accordion-group.entry.js +3 -4
- package/dist/esm/bq-accordion-group.entry.js.map +1 -1
- package/dist/esm/bq-accordion.entry.js +83 -48
- package/dist/esm/bq-accordion.entry.js.map +1 -1
- package/dist/esm/bq-alert.entry.js +57 -43
- package/dist/esm/bq-alert.entry.js.map +1 -1
- package/dist/esm/bq-avatar.entry.js +40 -40
- package/dist/esm/bq-avatar.entry.js.map +1 -1
- package/dist/esm/bq-badge.entry.js +42 -42
- package/dist/esm/bq-badge.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb-item.entry.js +39 -29
- package/dist/esm/bq-breadcrumb-item.entry.js.map +1 -1
- package/dist/esm/bq-breadcrumb.entry.js +45 -30
- package/dist/esm/bq-breadcrumb.entry.js.map +1 -1
- package/dist/esm/bq-button_2.entry.js +138 -90
- package/dist/esm/bq-button_2.entry.js.map +1 -1
- package/dist/esm/bq-card.entry.js +3 -4
- package/dist/esm/bq-card.entry.js.map +1 -1
- package/dist/esm/bq-checkbox.entry.js +63 -54
- package/dist/esm/bq-checkbox.entry.js.map +1 -1
- package/dist/esm/bq-date-picker.entry.js +160 -140
- package/dist/esm/bq-date-picker.entry.js.map +1 -1
- package/dist/esm/bq-dialog.entry.js +71 -50
- package/dist/esm/bq-dialog.entry.js.map +1 -1
- package/dist/esm/bq-divider.entry.js +23 -21
- package/dist/esm/bq-divider.entry.js.map +1 -1
- package/dist/esm/bq-drawer.entry.js +48 -34
- package/dist/esm/bq-drawer.entry.js.map +1 -1
- package/dist/esm/bq-dropdown_2.entry.js +44 -34
- package/dist/esm/bq-dropdown_2.entry.js.map +1 -1
- package/dist/esm/bq-empty-state.entry.js +25 -22
- package/dist/esm/bq-empty-state.entry.js.map +1 -1
- package/dist/esm/bq-input.entry.js +116 -90
- package/dist/esm/bq-input.entry.js.map +1 -1
- package/dist/esm/bq-notification.entry.js +63 -49
- package/dist/esm/bq-notification.entry.js.map +1 -1
- package/dist/esm/bq-option-group.entry.js +3 -3
- package/dist/esm/bq-option-group.entry.js.map +1 -1
- package/dist/esm/bq-option-list_2.entry.js +73 -54
- package/dist/esm/bq-option-list_2.entry.js.map +1 -1
- package/dist/esm/bq-option.entry.js +61 -45
- package/dist/esm/bq-option.entry.js.map +1 -1
- package/dist/esm/bq-page-title.entry.js +36 -32
- package/dist/esm/bq-page-title.entry.js.map +1 -1
- package/dist/esm/bq-progress.entry.js +3 -4
- package/dist/esm/bq-progress.entry.js.map +1 -1
- package/dist/esm/bq-radio-group.entry.js +12 -7
- package/dist/esm/bq-radio-group.entry.js.map +1 -1
- package/dist/esm/bq-radio.entry.js +43 -37
- package/dist/esm/bq-radio.entry.js.map +1 -1
- package/dist/esm/bq-select.entry.js +185 -168
- package/dist/esm/bq-select.entry.js.map +1 -1
- package/dist/esm/bq-side-menu-item.entry.js +68 -55
- package/dist/esm/bq-side-menu-item.entry.js.map +1 -1
- package/dist/esm/bq-side-menu.entry.js +47 -32
- package/dist/esm/bq-side-menu.entry.js.map +1 -1
- package/dist/esm/bq-slider.entry.js +160 -145
- package/dist/esm/bq-slider.entry.js.map +1 -1
- package/dist/esm/bq-spinner.entry.js +52 -51
- package/dist/esm/bq-spinner.entry.js.map +1 -1
- package/dist/esm/bq-status.entry.js +3 -4
- package/dist/esm/bq-status.entry.js.map +1 -1
- package/dist/esm/bq-step-item.entry.js +15 -11
- package/dist/esm/bq-step-item.entry.js.map +1 -1
- package/dist/esm/bq-steps.entry.js +12 -10
- package/dist/esm/bq-steps.entry.js.map +1 -1
- package/dist/esm/bq-switch.entry.js +43 -32
- package/dist/esm/bq-switch.entry.js.map +1 -1
- package/dist/esm/bq-tab-group.entry.js +64 -57
- package/dist/esm/bq-tab-group.entry.js.map +1 -1
- package/dist/esm/bq-tab.entry.js +43 -33
- package/dist/esm/bq-tab.entry.js.map +1 -1
- package/dist/esm/bq-textarea.entry.js +80 -58
- package/dist/esm/bq-textarea.entry.js.map +1 -1
- package/dist/esm/bq-toast.entry.js +44 -38
- package/dist/esm/bq-toast.entry.js.map +1 -1
- package/dist/esm/bq-tooltip.entry.js +46 -42
- package/dist/esm/bq-tooltip.entry.js.map +1 -1
- package/dist/esm/{cssVariables-23e3ca0d.js → cssVariables-000c23ad.js} +2 -2
- package/dist/esm/cssVariables-000c23ad.js.map +1 -0
- package/dist/esm/{debounce-c82e3da1.js → debounce-3e72f418.js} +3 -3
- package/dist/esm/debounce-3e72f418.js.map +1 -0
- package/dist/esm/{index-efc1c2ef.js → index-033f1efb.js} +48 -16
- package/dist/esm/index-033f1efb.js.map +1 -0
- package/dist/esm/{index-136429a6.js → index-1618c78b.js} +63 -19
- package/dist/esm/index-1618c78b.js.map +1 -0
- package/dist/esm/index.js +6 -6
- package/dist/esm/{isDefined-1e676215.js → isDefined-0cb07ee6.js} +1 -2
- package/dist/esm/isDefined-0cb07ee6.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{slot-179d109d.js → slot-58bfedb5.js} +3 -4
- package/dist/esm/slot-58bfedb5.js.map +1 -0
- package/dist/hydrate/index.d.ts +10 -4
- package/dist/hydrate/index.js +3857 -1984
- package/dist/hydrate/index.mjs +3857 -1984
- package/dist/types/_storybook/foundation/helper/index.d.ts +1 -3
- package/dist/types/components/button/bq-button.d.ts +5 -0
- package/dist/types/components/radio/bq-radio.d.ts +0 -5
- package/dist/types/index.d.ts +1 -1
- package/dist/types/shared/utils/assetsPath.d.ts +6 -19
- package/dist/types/stencil-public-runtime.d.ts +4 -0
- package/package.json +4 -4
- package/dist/beeq/p-05b44bb7.entry.js +0 -6
- package/dist/beeq/p-05b44bb7.entry.js.map +0 -1
- package/dist/beeq/p-0cbec77b.entry.js +0 -6
- package/dist/beeq/p-1202161d.entry.js +0 -6
- package/dist/beeq/p-17b341dd.entry.js +0 -6
- package/dist/beeq/p-17b341dd.entry.js.map +0 -1
- package/dist/beeq/p-1d81f9e5.entry.js +0 -6
- package/dist/beeq/p-1d81f9e5.entry.js.map +0 -1
- package/dist/beeq/p-2714ce21.entry.js +0 -6
- package/dist/beeq/p-2714ce21.entry.js.map +0 -1
- package/dist/beeq/p-2e61db84.entry.js +0 -6
- package/dist/beeq/p-32f74048.entry.js +0 -6
- package/dist/beeq/p-32f74048.entry.js.map +0 -1
- package/dist/beeq/p-339d14c8.entry.js +0 -6
- package/dist/beeq/p-339d14c8.entry.js.map +0 -1
- package/dist/beeq/p-35ec6cac.entry.js +0 -6
- package/dist/beeq/p-35ec6cac.entry.js.map +0 -1
- package/dist/beeq/p-38d4bd8a.js +0 -6
- package/dist/beeq/p-38d4bd8a.js.map +0 -1
- package/dist/beeq/p-3ea228d3.entry.js +0 -6
- package/dist/beeq/p-3ea228d3.entry.js.map +0 -1
- package/dist/beeq/p-45b7b5cf.entry.js +0 -6
- package/dist/beeq/p-45e674b4.entry.js +0 -6
- package/dist/beeq/p-45e674b4.entry.js.map +0 -1
- package/dist/beeq/p-4954154f.entry.js +0 -6
- package/dist/beeq/p-4954154f.entry.js.map +0 -1
- package/dist/beeq/p-513bab02.js +0 -6
- package/dist/beeq/p-5a9a73a0.js +0 -6
- package/dist/beeq/p-5a9a73a0.js.map +0 -1
- package/dist/beeq/p-5f3ce05a.entry.js +0 -6
- package/dist/beeq/p-5f3ce05a.entry.js.map +0 -1
- package/dist/beeq/p-6823479d.entry.js +0 -6
- package/dist/beeq/p-76e714c6.js +0 -7
- package/dist/beeq/p-76e714c6.js.map +0 -1
- package/dist/beeq/p-7871f3f0.entry.js +0 -6
- package/dist/beeq/p-7a049750.entry.js +0 -6
- package/dist/beeq/p-7a049750.entry.js.map +0 -1
- package/dist/beeq/p-83207939.entry.js +0 -6
- package/dist/beeq/p-8d8993ba.entry.js +0 -6
- package/dist/beeq/p-8d8993ba.entry.js.map +0 -1
- package/dist/beeq/p-9406afc0.entry.js +0 -6
- package/dist/beeq/p-9406afc0.entry.js.map +0 -1
- package/dist/beeq/p-94899104.entry.js +0 -6
- package/dist/beeq/p-94899104.entry.js.map +0 -1
- package/dist/beeq/p-951ba558.js +0 -6
- package/dist/beeq/p-95d0abdc.entry.js +0 -6
- package/dist/beeq/p-9da0e8d7.entry.js +0 -6
- package/dist/beeq/p-a535a72f.entry.js +0 -6
- package/dist/beeq/p-a535a72f.entry.js.map +0 -1
- package/dist/beeq/p-a5a17e6e.entry.js +0 -6
- package/dist/beeq/p-a5a17e6e.entry.js.map +0 -1
- package/dist/beeq/p-b2acd8f3.entry.js +0 -6
- package/dist/beeq/p-b7f02fb6.entry.js.map +0 -1
- package/dist/beeq/p-b994054a.entry.js.map +0 -1
- package/dist/beeq/p-be4941d0.entry.js +0 -6
- package/dist/beeq/p-be4941d0.entry.js.map +0 -1
- package/dist/beeq/p-d7a88b16.js +0 -6
- package/dist/beeq/p-dd206dba.entry.js +0 -6
- package/dist/beeq/p-dd206dba.entry.js.map +0 -1
- package/dist/beeq/p-ded1aed2.entry.js +0 -6
- package/dist/beeq/p-e08d9b52.entry.js +0 -6
- package/dist/beeq/p-e08d9b52.entry.js.map +0 -1
- package/dist/beeq/p-e572b038.entry.js +0 -6
- package/dist/beeq/p-e572b038.entry.js.map +0 -1
- package/dist/beeq/p-e5afdf8c.js +0 -6
- package/dist/beeq/p-e5afdf8c.js.map +0 -1
- package/dist/beeq/p-e7ede06e.entry.js +0 -6
- package/dist/beeq/p-f7a0a316.entry.js +0 -6
- package/dist/beeq/p-fbf6b04b.entry.js +0 -6
- package/dist/cjs/assetsPath-7ead23b7.js +0 -89
- package/dist/cjs/assetsPath-7ead23b7.js.map +0 -1
- package/dist/cjs/cssVariables-a0e1e906.js.map +0 -1
- package/dist/cjs/debounce-f94a239b.js.map +0 -1
- package/dist/cjs/index-e4c116b6.js.map +0 -1
- package/dist/cjs/index-e6d59dbb.js.map +0 -1
- package/dist/cjs/isDefined-a9dd6d5b.js.map +0 -1
- package/dist/cjs/slot-dd6f7db9.js.map +0 -1
- package/dist/components/assetsPath.js +0 -86
- package/dist/components/assetsPath.js.map +0 -1
- package/dist/esm/assetsPath-c02b0e16.js +0 -86
- package/dist/esm/assetsPath-c02b0e16.js.map +0 -1
- package/dist/esm/cssVariables-23e3ca0d.js.map +0 -1
- package/dist/esm/debounce-c82e3da1.js.map +0 -1
- package/dist/esm/index-136429a6.js.map +0 -1
- package/dist/esm/index-efc1c2ef.js.map +0 -1
- package/dist/esm/isDefined-1e676215.js.map +0 -1
- package/dist/esm/slot-179d109d.js.map +0 -1
|
@@ -45,137 +45,6 @@ import { hasSlotContent, isDefined, isEventTargetChildOfElement, isHTMLElement,
|
|
|
45
45
|
*/
|
|
46
46
|
export class BqDatePicker {
|
|
47
47
|
constructor() {
|
|
48
|
-
this.fallbackInputId = 'date-picker';
|
|
49
|
-
// Export parts of the calendar-month component
|
|
50
|
-
this.COMMON_EXPORT_PARTS = 'calendar__heading,calendar__table,calendar__tr,calendar__head,calendar__week,calendar__th,calendar__td';
|
|
51
|
-
this.BUTTON_EXPORT_PARTS = 'calendar__button,calendar__day,calendar__selected,calendar__today,calendar__disallowed,calendar__outside,calendar__range-start,calendar__range-end,calendar__range-inner';
|
|
52
|
-
// Local methods
|
|
53
|
-
// Internal business logic.
|
|
54
|
-
// These methods cannot be called from the host element.
|
|
55
|
-
// =======================================================
|
|
56
|
-
this.handleBlur = () => {
|
|
57
|
-
if (this.disabled)
|
|
58
|
-
return;
|
|
59
|
-
this.bqBlur.emit(this.el);
|
|
60
|
-
};
|
|
61
|
-
this.handleFocus = () => {
|
|
62
|
-
if (this.disabled)
|
|
63
|
-
return;
|
|
64
|
-
this.bqFocus.emit(this.el);
|
|
65
|
-
};
|
|
66
|
-
this.setFocusedDate = () => {
|
|
67
|
-
if (!this.callyElem)
|
|
68
|
-
return;
|
|
69
|
-
// We need to set the focused date in the calendar component via a ref
|
|
70
|
-
// because it doesn't work when passed as a prop (the Cally element does not re-render)
|
|
71
|
-
this.callyElem.focusedDate = this.value
|
|
72
|
-
? this.formatFocusedDate(this.value)
|
|
73
|
-
: new Date().toLocaleDateString('fr-CA');
|
|
74
|
-
};
|
|
75
|
-
this.handleChange = (ev) => {
|
|
76
|
-
if (this.disabled)
|
|
77
|
-
return;
|
|
78
|
-
if (!isHTMLElement(ev.target, 'input'))
|
|
79
|
-
return;
|
|
80
|
-
const dateValue = new Date(ev.target.value);
|
|
81
|
-
if (!isNaN(dateValue.getTime())) {
|
|
82
|
-
// We need to force the value to respect the format: yyyy-mm-dd, hence the hardcoded locale
|
|
83
|
-
this.value = dateValue.toLocaleDateString('fr-CA');
|
|
84
|
-
this.displayDate = this.formatDisplayValue(this.value);
|
|
85
|
-
this.bqChange.emit({ value: this.value, el: this.el });
|
|
86
|
-
}
|
|
87
|
-
};
|
|
88
|
-
this.handleCalendarChange = (ev) => {
|
|
89
|
-
const { value } = ev.target;
|
|
90
|
-
this.value = value;
|
|
91
|
-
this.displayDate = this.formatDisplayValue(this.value);
|
|
92
|
-
this.inputElem.value = this.displayDate;
|
|
93
|
-
this.inputElem.focus();
|
|
94
|
-
this.bqChange.emit({ value: this.value, el: this.el });
|
|
95
|
-
this.open = this.type === 'multi';
|
|
96
|
-
};
|
|
97
|
-
this.handleCalendarRangeStart = (ev) => {
|
|
98
|
-
this.hasRangeEnd = false;
|
|
99
|
-
this.tentative = new Date(ev.detail).toLocaleDateString('fr-CA');
|
|
100
|
-
};
|
|
101
|
-
this.handleCalendarRangeEnd = () => {
|
|
102
|
-
this.hasRangeEnd = true;
|
|
103
|
-
};
|
|
104
|
-
this.handleClearClick = (ev) => {
|
|
105
|
-
if (this.disabled)
|
|
106
|
-
return;
|
|
107
|
-
this.inputElem.value = '';
|
|
108
|
-
this.value = this.inputElem.value;
|
|
109
|
-
this.hasRangeEnd = false;
|
|
110
|
-
this.bqClear.emit(this.el);
|
|
111
|
-
this.bqChange.emit({ value: this.value, el: this.el });
|
|
112
|
-
this.inputElem.focus();
|
|
113
|
-
ev.stopPropagation();
|
|
114
|
-
};
|
|
115
|
-
this.handleLabelSlotChange = () => {
|
|
116
|
-
this.hasLabel = hasSlotContent(this.labelElem);
|
|
117
|
-
};
|
|
118
|
-
this.handlePrefixSlotChange = () => {
|
|
119
|
-
this.hasPrefix = hasSlotContent(this.prefixElem);
|
|
120
|
-
};
|
|
121
|
-
this.handleSuffixSlotChange = () => {
|
|
122
|
-
this.hasSuffix = hasSlotContent(this.suffixElem);
|
|
123
|
-
};
|
|
124
|
-
this.generateCalendarMonth = (offset, className = '') => {
|
|
125
|
-
return (h("calendar-month", { offset: offset, class: className, exportparts: `${this.COMMON_EXPORT_PARTS},${this.BUTTON_EXPORT_PARTS}` }));
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* Generates an array of JSX.Element representing calendar months.
|
|
129
|
-
*
|
|
130
|
-
* If the type of the date picker is 'range' or 'multi' and the number of months is specified,
|
|
131
|
-
* it generates an array of calendar months with the specified length. Each month will have an offset
|
|
132
|
-
* and a class name based on its position in the array. The offset is used to determine the month to display,
|
|
133
|
-
* and the class name is used for responsive design.
|
|
134
|
-
*
|
|
135
|
-
* If the type of the date picker is not 'range' or 'multi', or if the number of months is not specified,
|
|
136
|
-
* it generates an array with a single calendar month.
|
|
137
|
-
*
|
|
138
|
-
* @returns {JSX.Element[]} An array of JSX.Element representing calendar months.
|
|
139
|
-
*/
|
|
140
|
-
this.generateCalendarMonths = () => {
|
|
141
|
-
if (this.type === 'range' || (this.type === 'multi' && this.months)) {
|
|
142
|
-
return Array.from({ length: this.months }, (_, i) => {
|
|
143
|
-
const offset = i > 0 ? i : undefined;
|
|
144
|
-
const className = offset ? 'hidden sm:block' : '';
|
|
145
|
-
return this.generateCalendarMonth(offset, className);
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
return [this.generateCalendarMonth()];
|
|
149
|
-
};
|
|
150
|
-
/**
|
|
151
|
-
* Extracts and returns the first date part from a given string.
|
|
152
|
-
* When the type of the date picker is 'range' or 'multi', the first or initial date part of the value
|
|
153
|
-
* should be the focused date in the calendar.
|
|
154
|
-
*
|
|
155
|
-
* @param value - The value to be processed, can be a string.
|
|
156
|
-
* @returns The extracted last date portion of the value.
|
|
157
|
-
*/
|
|
158
|
-
this.formatFocusedDate = (value) => {
|
|
159
|
-
if (!value)
|
|
160
|
-
return;
|
|
161
|
-
const dateRegex = /\b\d{4}-\d{2}-\d{2}\b/;
|
|
162
|
-
const match = dateRegex.exec(value);
|
|
163
|
-
return match ? match[0] : null;
|
|
164
|
-
};
|
|
165
|
-
this.formatDisplayValue = (value) => {
|
|
166
|
-
if (!value)
|
|
167
|
-
return;
|
|
168
|
-
const dateFormatter = new Intl.DateTimeFormat(this.locale, this.formatOptions);
|
|
169
|
-
if (this.type === 'range') {
|
|
170
|
-
const [start, end] = value.split('/').map((dateStr) => new Date(dateStr));
|
|
171
|
-
return dateFormatter.formatRange(start, end);
|
|
172
|
-
}
|
|
173
|
-
if (this.type === 'multi') {
|
|
174
|
-
const dates = value.split(' ').map((dateStr) => new Date(dateStr));
|
|
175
|
-
return dates.map((date) => dateFormatter.format(date)).join(', ');
|
|
176
|
-
}
|
|
177
|
-
return dateFormatter.format(new Date(value));
|
|
178
|
-
};
|
|
179
48
|
this.focusedDate = undefined;
|
|
180
49
|
this.displayDate = undefined;
|
|
181
50
|
this.hasLabel = false;
|
|
@@ -215,6 +84,20 @@ export class BqDatePicker {
|
|
|
215
84
|
this.validationStatus = 'none';
|
|
216
85
|
this.value = undefined;
|
|
217
86
|
}
|
|
87
|
+
// Own Properties
|
|
88
|
+
// ====================
|
|
89
|
+
callyElem;
|
|
90
|
+
inputElem;
|
|
91
|
+
labelElem;
|
|
92
|
+
prefixElem;
|
|
93
|
+
suffixElem;
|
|
94
|
+
fallbackInputId = 'date-picker';
|
|
95
|
+
// Export parts of the calendar-month component
|
|
96
|
+
COMMON_EXPORT_PARTS = 'calendar__heading,calendar__table,calendar__tr,calendar__head,calendar__week,calendar__th,calendar__td';
|
|
97
|
+
BUTTON_EXPORT_PARTS = 'calendar__button,calendar__day,calendar__selected,calendar__today,calendar__disallowed,calendar__outside,calendar__range-start,calendar__range-end,calendar__range-inner';
|
|
98
|
+
// Reference to host HTML element
|
|
99
|
+
// ===================================
|
|
100
|
+
el;
|
|
218
101
|
// Prop lifecycle events
|
|
219
102
|
// =======================
|
|
220
103
|
handleValueChange() {
|
|
@@ -229,6 +112,20 @@ export class BqDatePicker {
|
|
|
229
112
|
checkPropValues() {
|
|
230
113
|
validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');
|
|
231
114
|
}
|
|
115
|
+
// Events section
|
|
116
|
+
// Requires JSDocs for public API documentation
|
|
117
|
+
// ==============================================
|
|
118
|
+
/** Callback handler emitted when the input loses focus */
|
|
119
|
+
bqBlur;
|
|
120
|
+
/**
|
|
121
|
+
* Callback handler emitted when the input value has changed and the input loses focus.
|
|
122
|
+
* This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.
|
|
123
|
+
*/
|
|
124
|
+
bqChange;
|
|
125
|
+
/** Callback handler emitted when the input value has been cleared */
|
|
126
|
+
bqClear;
|
|
127
|
+
/** Callback handler emitted when the input has received focus */
|
|
128
|
+
bqFocus;
|
|
232
129
|
// Component lifecycle events
|
|
233
130
|
// Ordered by their natural call order
|
|
234
131
|
// =====================================
|
|
@@ -277,6 +174,133 @@ export class BqDatePicker {
|
|
|
277
174
|
this.value = undefined;
|
|
278
175
|
this.bqClear.emit(this.el);
|
|
279
176
|
}
|
|
177
|
+
// Local methods
|
|
178
|
+
// Internal business logic.
|
|
179
|
+
// These methods cannot be called from the host element.
|
|
180
|
+
// =======================================================
|
|
181
|
+
handleBlur = () => {
|
|
182
|
+
if (this.disabled)
|
|
183
|
+
return;
|
|
184
|
+
this.bqBlur.emit(this.el);
|
|
185
|
+
};
|
|
186
|
+
handleFocus = () => {
|
|
187
|
+
if (this.disabled)
|
|
188
|
+
return;
|
|
189
|
+
this.bqFocus.emit(this.el);
|
|
190
|
+
};
|
|
191
|
+
setFocusedDate = () => {
|
|
192
|
+
if (!this.callyElem)
|
|
193
|
+
return;
|
|
194
|
+
// We need to set the focused date in the calendar component via a ref
|
|
195
|
+
// because it doesn't work when passed as a prop (the Cally element does not re-render)
|
|
196
|
+
this.callyElem.focusedDate = this.value
|
|
197
|
+
? this.formatFocusedDate(this.value)
|
|
198
|
+
: new Date().toLocaleDateString('fr-CA');
|
|
199
|
+
};
|
|
200
|
+
handleChange = (ev) => {
|
|
201
|
+
if (this.disabled)
|
|
202
|
+
return;
|
|
203
|
+
if (!isHTMLElement(ev.target, 'input'))
|
|
204
|
+
return;
|
|
205
|
+
const dateValue = new Date(ev.target.value);
|
|
206
|
+
if (!isNaN(dateValue.getTime())) {
|
|
207
|
+
// We need to force the value to respect the format: yyyy-mm-dd, hence the hardcoded locale
|
|
208
|
+
this.value = dateValue.toLocaleDateString('fr-CA');
|
|
209
|
+
this.displayDate = this.formatDisplayValue(this.value);
|
|
210
|
+
this.bqChange.emit({ value: this.value, el: this.el });
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
handleCalendarChange = (ev) => {
|
|
214
|
+
const { value } = ev.target;
|
|
215
|
+
this.value = value;
|
|
216
|
+
this.displayDate = this.formatDisplayValue(this.value);
|
|
217
|
+
this.inputElem.value = this.displayDate;
|
|
218
|
+
this.inputElem.focus();
|
|
219
|
+
this.bqChange.emit({ value: this.value, el: this.el });
|
|
220
|
+
this.open = this.type === 'multi';
|
|
221
|
+
};
|
|
222
|
+
handleCalendarRangeStart = (ev) => {
|
|
223
|
+
this.hasRangeEnd = false;
|
|
224
|
+
this.tentative = new Date(ev.detail).toLocaleDateString('fr-CA');
|
|
225
|
+
};
|
|
226
|
+
handleCalendarRangeEnd = () => {
|
|
227
|
+
this.hasRangeEnd = true;
|
|
228
|
+
};
|
|
229
|
+
handleClearClick = (ev) => {
|
|
230
|
+
if (this.disabled)
|
|
231
|
+
return;
|
|
232
|
+
this.inputElem.value = '';
|
|
233
|
+
this.value = this.inputElem.value;
|
|
234
|
+
this.hasRangeEnd = false;
|
|
235
|
+
this.bqClear.emit(this.el);
|
|
236
|
+
this.bqChange.emit({ value: this.value, el: this.el });
|
|
237
|
+
this.inputElem.focus();
|
|
238
|
+
ev.stopPropagation();
|
|
239
|
+
};
|
|
240
|
+
handleLabelSlotChange = () => {
|
|
241
|
+
this.hasLabel = hasSlotContent(this.labelElem);
|
|
242
|
+
};
|
|
243
|
+
handlePrefixSlotChange = () => {
|
|
244
|
+
this.hasPrefix = hasSlotContent(this.prefixElem);
|
|
245
|
+
};
|
|
246
|
+
handleSuffixSlotChange = () => {
|
|
247
|
+
this.hasSuffix = hasSlotContent(this.suffixElem);
|
|
248
|
+
};
|
|
249
|
+
generateCalendarMonth = (offset, className = '') => {
|
|
250
|
+
return (h("calendar-month", { offset: offset, class: className, exportparts: `${this.COMMON_EXPORT_PARTS},${this.BUTTON_EXPORT_PARTS}` }));
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Generates an array of JSX.Element representing calendar months.
|
|
254
|
+
*
|
|
255
|
+
* If the type of the date picker is 'range' or 'multi' and the number of months is specified,
|
|
256
|
+
* it generates an array of calendar months with the specified length. Each month will have an offset
|
|
257
|
+
* and a class name based on its position in the array. The offset is used to determine the month to display,
|
|
258
|
+
* and the class name is used for responsive design.
|
|
259
|
+
*
|
|
260
|
+
* If the type of the date picker is not 'range' or 'multi', or if the number of months is not specified,
|
|
261
|
+
* it generates an array with a single calendar month.
|
|
262
|
+
*
|
|
263
|
+
* @returns {JSX.Element[]} An array of JSX.Element representing calendar months.
|
|
264
|
+
*/
|
|
265
|
+
generateCalendarMonths = () => {
|
|
266
|
+
if (this.type === 'range' || (this.type === 'multi' && this.months)) {
|
|
267
|
+
return Array.from({ length: this.months }, (_, i) => {
|
|
268
|
+
const offset = i > 0 ? i : undefined;
|
|
269
|
+
const className = offset ? 'hidden sm:block' : '';
|
|
270
|
+
return this.generateCalendarMonth(offset, className);
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
return [this.generateCalendarMonth()];
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Extracts and returns the first date part from a given string.
|
|
277
|
+
* When the type of the date picker is 'range' or 'multi', the first or initial date part of the value
|
|
278
|
+
* should be the focused date in the calendar.
|
|
279
|
+
*
|
|
280
|
+
* @param value - The value to be processed, can be a string.
|
|
281
|
+
* @returns The extracted last date portion of the value.
|
|
282
|
+
*/
|
|
283
|
+
formatFocusedDate = (value) => {
|
|
284
|
+
if (!value)
|
|
285
|
+
return;
|
|
286
|
+
const dateRegex = /\b\d{4}-\d{2}-\d{2}\b/;
|
|
287
|
+
const match = dateRegex.exec(value);
|
|
288
|
+
return match ? match[0] : null;
|
|
289
|
+
};
|
|
290
|
+
formatDisplayValue = (value) => {
|
|
291
|
+
if (!value)
|
|
292
|
+
return;
|
|
293
|
+
const dateFormatter = new Intl.DateTimeFormat(this.locale, this.formatOptions);
|
|
294
|
+
if (this.type === 'range') {
|
|
295
|
+
const [start, end] = value.split('/').map((dateStr) => new Date(dateStr));
|
|
296
|
+
return dateFormatter.formatRange(start, end);
|
|
297
|
+
}
|
|
298
|
+
if (this.type === 'multi') {
|
|
299
|
+
const dates = value.split(' ').map((dateStr) => new Date(dateStr));
|
|
300
|
+
return dates.map((date) => dateFormatter.format(date)).join(', ');
|
|
301
|
+
}
|
|
302
|
+
return dateFormatter.format(new Date(value));
|
|
303
|
+
};
|
|
280
304
|
get CalendarType() {
|
|
281
305
|
const componentTypes = {
|
|
282
306
|
single: 'calendar-date',
|
|
@@ -292,16 +316,16 @@ export class BqDatePicker {
|
|
|
292
316
|
render() {
|
|
293
317
|
const CallyCalendar = this.CalendarType;
|
|
294
318
|
const labelId = `bq-date-picker__label-${this.name || this.fallbackInputId}`;
|
|
295
|
-
return (h("div", { key: 'fecf008fc4d06999e00cf4c3934d74938532d6f2', class: "bq-date-picker", part: "base" }, h("label", { key: '
|
|
319
|
+
return (h("div", { key: 'fecf008fc4d06999e00cf4c3934d74938532d6f2', class: "bq-date-picker", part: "base" }, h("label", { key: '1d90b1bea164099d02a6f89565812b6a6a8a8b4f', id: labelId, class: { 'bq-date-picker__label': true, '!hidden': !this.hasLabel }, "aria-label": this.name || this.fallbackInputId, htmlFor: this.name || this.fallbackInputId, ref: (labelElem) => (this.labelElem = labelElem), part: "label" }, h("slot", { key: 'e87e7ba439ab6815aa511c77804cc1534b33f077', name: "label", onSlotchange: this.handleLabelSlotChange })), h("bq-dropdown", { key: '3133b6b891614878c705587ffc60c930f1f1289d', class: "bq-date-picker__dropdown is-full [&::part(panel)]:p-m [&::part(panel)]:is-auto", disabled: this.disabled, distance: this.distance, open: this.open, panelHeight: this.panelHeight, placement: this.placement, skidding: this.skidding, strategy: this.strategy, exportparts: "panel" }, h("div", { key: '22acc32aebfa68babf19daff7b9996c44b8a6493', class: {
|
|
296
320
|
'bq-date-picker__control': true,
|
|
297
321
|
[`validation-${this.validationStatus}`]: true,
|
|
298
322
|
disabled: this.disabled,
|
|
299
|
-
}, part: "control", slot: "trigger" }, h("span", { key: '
|
|
323
|
+
}, part: "control", slot: "trigger" }, h("span", { key: '4eedc11f668fd443ed43203c7351822578b57965', class: { 'bq-date-picker__control--prefix': true, '!hidden': !this.hasPrefix }, ref: (spanElem) => (this.prefixElem = spanElem), part: "prefix" }, h("slot", { key: 'a68aadcbf45fe56a97b214ef1de89956db7a30f5', name: "prefix", onSlotchange: this.handlePrefixSlotChange })), h("input", { key: 'a76ac38f10cc2f5e0c9d0662d3bc1da8ac017234', id: this.name || this.fallbackInputId, class: "bq-date-picker__control--input", autoComplete: "off", autoCapitalize: "off", "aria-disabled": this.disabled ? 'true' : 'false', "aria-controls": `${this.name}`, "aria-haspopup": "dialog", disabled: this.disabled, form: this.form, name: this.name, placeholder: this.placeholder, readonly: this.type !== 'single', ref: (inputElem) => (this.inputElem = inputElem), required: this.required, spellcheck: false, type: "text", value: this.displayDate, part: "input",
|
|
300
324
|
// Events
|
|
301
325
|
onBlur: this.handleBlur, onFocus: this.handleFocus, onChange: this.handleChange }), this.hasValue && !this.disabled && !this.disableClear && (
|
|
302
326
|
// The clear button will be visible as long as the input has a value
|
|
303
327
|
// and the parent group is hovered or has focus-within
|
|
304
|
-
h("bq-button", { key: '
|
|
328
|
+
h("bq-button", { key: '959a737f939b2edb28e6f3ba49a2a2f2a7737ea0', class: "bq-date-picker__control--clear ms-[--bq-date-picker--gap] hidden", appearance: "text", "aria-label": this.clearButtonLabel, size: "small", onBqClick: this.handleClearClick, part: "clear-btn", exportparts: "button" }, h("slot", { key: '268726c361f74822b7a203745a41d6c03a4592db', name: "clear-icon" }, h("bq-icon", { key: 'f9342e15716577e3129ea09d6b9c3f99b39223a9', weight: "bold", name: "x-circle", class: "flex" })))), h("span", { key: '7c1a5096ebee64156a6c76efd9c34f01f70ed6f6', class: "bq-date-picker__control--suffix", ref: (spanElem) => (this.suffixElem = spanElem), part: "suffix" }, h("slot", { key: 'ba3d95b9b94398ca0a0e88647ff5ef6f9dc2538d', name: "suffix", onSlotchange: this.handleSuffixSlotChange }, h("bq-icon", { key: '38cf9be76e35e5b02141a5e0d6a938aebbff39b0', name: "calendar-blank", weight: "bold", class: "flex" })))), h(CallyCalendar, { key: '8cdb5f879e00437a8f36d61dcd8a0d9f1d85a47d', isDateDisallowed: this.isDateDisallowed, locale: this.locale, value: this.value, min: this.min, max: this.max, months: this.months, tentative: this.tentative, pageBy: this.monthsPerView, firstDayOfWeek: this.firstDayOfWeek, showOutsideDays: this.showOutsideDays, onChange: this.handleCalendarChange, onRangestart: this.handleCalendarRangeStart, onRangeend: this.handleCalendarRangeEnd, exportparts: "container:calendar__container,header:calendar__header,button:calendar__button,previous:calendar__previous,next:calendar__next,disabled:calendar__disabled,heading:calendar__heading", ref: (elem) => (this.callyElem = elem) }, h("bq-icon", { key: 'e0313d7bd9c231b4cea839549a27489d0e1d35dc', color: "text--primary", slot: "previous", name: "caret-left", label: "Previous" }), h("bq-icon", { key: '5d03ea06201aef51de86cf75c631c38a92e9cef7', color: "text--primary", slot: "next", name: "caret-right", label: "Next" }), h("div", { key: '16d28cdca9784a6f96cf1f6182df03028f34c0d6', class: "flex flex-wrap justify-center gap-[--bq-spacing-m]" }, this.generateCalendarMonths())))));
|
|
305
329
|
}
|
|
306
330
|
static get is() { return "bq-date-picker"; }
|
|
307
331
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bq-date-picker.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/bq-date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/G,OAAO,EAAE,gBAAgB,EAA+B,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EACL,cAAc,EACd,SAAS,EACT,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAQH,MAAM,OAAO,YAAY;;QAUf,oBAAe,GAAG,aAAa,CAAC;QAExC,+CAA+C;QAC9B,wBAAmB,GAClC,wGAAwG,CAAC;QAC1F,wBAAmB,GAClC,0KAA0K,CAAC;QAkO7K,gBAAgB;QAChB,2BAA2B;QAC3B,wDAAwD;QACxD,0DAA0D;QAElD,eAAU,GAAG,GAAG,EAAE;YACxB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,CAAC,CAAC;QAEM,gBAAW,GAAG,GAAG,EAAE;YACzB,IAAI,IAAI,CAAC,QAAQ;gBAAE,OAAO;YAE1B,IAAI,CAAC,OAAO,CAAC,IAAI,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { CalendarDate } from 'cally';\n\nimport { DATE_PICKER_TYPE, DaysOfWeek, TDatePickerType } from './bq-date-picker.types';\nimport { Placement } from '../../services/interfaces';\nimport {\n hasSlotContent,\n isDefined,\n isEventTargetChildOfElement,\n isHTMLElement,\n validatePropValue,\n} from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part input - The native HTML input element used under the hood.\n * @part label - The label slot container.\n * @part panel - The date picker panel container\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n\n// Parts from the Cally library for calendar-date and calendar-range components:\n * @part calendar__container - The container for the entire component.\n * @part calendar__header - The container for heading and button's.\n * @part calendar__button - Any button within the component.\n * @part calendar__previous - The previous page button.\n * @part calendar__next - The next page button.\n * @part calendar__disabled - A button that is disabled due to min/max.\n * @part calendar__heading - The heading containing the month and year.\n\n// Parts specific to the calendar-month component:\n * @part calendar__heading - The heading that labels the month.\n * @part calendar__table - The <table> element.\n * @part calendar__tr - Any row within the table.\n * @part calendar__head - The table's header row.\n * @part calendar__week - The table's body rows.\n * @part calendar__th - The table's header cells.\n * @part calendar__td - The table's body cells.\n * @part calendar__button - Any button used in the component.\n * @part calendar__day - The buttons corresponding to each day in the grid.\n * @part calendar__selected - Any days which are selected.\n * @part calendar__today - Today's day.\n * @part calendar__disallowed - Any day that has been disallowed via isDateDisallowed.\n * @part calendar__outside - Any days which are outside the current month.\n * @part calendar__range-start - The day at the start of a date range.\n * @part calendar__range-end - The day at the end of a date range.\n * @part calendar__range-inner - Any days between the start and end of a date range.\n */\n@Component({\n tag: 'bq-date-picker',\n styleUrl: './scss/bq-date-picker.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqDatePicker {\n // Own Properties\n // ====================\n\n private callyElem?: InstanceType<typeof CalendarDate>;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private fallbackInputId = 'date-picker';\n\n // Export parts of the calendar-month component\n private readonly COMMON_EXPORT_PARTS =\n 'calendar__heading,calendar__table,calendar__tr,calendar__head,calendar__week,calendar__th,calendar__td';\n private readonly BUTTON_EXPORT_PARTS =\n 'calendar__button,calendar__day,calendar__selected,calendar__today,calendar__disallowed,calendar__outside,calendar__range-start,calendar__range-end,calendar__range-inner';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDatePickerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() focusedDate: string;\n @State() displayDate: string;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasRangeEnd = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /** If `true`, the Date picker input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /** If `true`, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /**\n * Indicates whether the Date picker input is disabled or not.\n * If `true`, the Date picker is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the Date picker panel and the input element. */\n @Prop({ reflect: true }) distance?: number = 8;\n\n /** The first day of the week, where Sunday is 0, Monday is 1, etc */\n @Prop({ reflect: true }) firstDayOfWeek?: DaysOfWeek = 1;\n\n /** The options to use when formatting the displayed value.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options\n */\n @Prop() formatOptions: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n };\n\n /** The ID of the form that the Date picker input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** A function that takes a date and returns true if the date should not be selectable */\n @Prop({ reflect: true }) isDateDisallowed?: (date: Date) => boolean;\n\n /** The locale for formatting dates. If not set, will use the browser's locale.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\n */\n @Prop({ reflect: true }) locale: Intl.LocalesArgument = 'en-GB';\n\n /** The latest date that can be selected */\n @Prop({ reflect: true }) max?: string;\n\n /** The earliest date that can be selected */\n @Prop({ reflect: true }) min?: string;\n\n /** Number of months to show when range is `true` */\n @Prop({ reflect: true }) months: number;\n\n /**\n * Specifies how the next/previous buttons should navigate the calendar.\n * - single: The buttons will navigate by a single month at a time.\n * - months: The buttons will navigate by the number of months displayed per view.\n */\n @Prop({ reflect: true }) monthsPerView: 'single' | 'months' = 'single';\n\n /** The Date picker input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, the Date picker panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the Date picker panel. */\n @Prop({ reflect: true, mutable: true }) panelHeight?: string = 'auto';\n\n /** The Date picker input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Date picker panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-end';\n\n /** Indicates whether or not the Date picker input is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /** Represents the skidding between the Date picker panel and the input element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Whether to show days outside the month */\n @Prop({ reflect: true }) showOutsideDays: boolean = false;\n\n /** Defines the strategy to position the Date picker panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n /** The date that is tentatively selected e.g. the start of a range selection */\n @Prop({ reflect: true, mutable: true }) tentative?: string;\n\n /** It defines how the calendar will behave, allowing single date selection, range selection, or multiple date selection */\n @Prop({ reflect: true }) type: TDatePickerType = 'single';\n\n /**\n * The validation status of the Select input.\n *\n * @remarks\n * This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The select input value represents the currently selected date or range and can be used to reset the field to a previous value.\n * All dates are expected in ISO-8601 format (YYYY-MM-DD). */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (Array.isArray(this.value)) {\n this.hasValue = this.value.some((val) => val.length > 0);\n return;\n }\n\n this.hasValue = isDefined(this.value);\n this.displayDate = this.formatDisplayValue(this.value);\n\n this.setFocusedDate();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqDatePickerElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqDatePickerElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqDatePickerElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqDatePickerElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.handleValueChange();\n }\n\n componentWillLoad() {\n this.handleValueChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!ev.composedPath().includes(this.el)) return;\n\n this.open = ev.detail.open;\n this.setFocusedDate();\n }\n\n @Listen('click', { target: 'body', capture: true })\n handleClickOutside(ev: MouseEvent) {\n const { open, type, hasRangeEnd } = this;\n if (!open || type !== 'range' || ev.button !== 0) return;\n if (isEventTargetChildOfElement(ev, this.el) || hasRangeEnd) return;\n if (isEventTargetChildOfElement(ev, this.el)) return;\n\n if (!hasRangeEnd) {\n this.tentative = undefined;\n this.hasRangeEnd = false;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value.\n *\n * @return {Promise<void>}\n * @memberof BqInput\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n\n this.value = undefined;\n\n this.bqClear.emit(this.el);\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private setFocusedDate = () => {\n if (!this.callyElem) return;\n // We need to set the focused date in the calendar component via a ref\n // because it doesn't work when passed as a prop (the Cally element does not re-render)\n this.callyElem.focusedDate = this.value\n ? this.formatFocusedDate(this.value)\n : new Date().toLocaleDateString('fr-CA');\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n\n const dateValue = new Date(ev.target.value);\n if (!isNaN(dateValue.getTime())) {\n // We need to force the value to respect the format: yyyy-mm-dd, hence the hardcoded locale\n this.value = dateValue.toLocaleDateString('fr-CA');\n this.displayDate = this.formatDisplayValue(this.value);\n this.bqChange.emit({ value: this.value, el: this.el });\n }\n };\n\n private handleCalendarChange = (ev: Event) => {\n const { value } = ev.target as unknown as { value: string };\n\n this.value = value;\n this.displayDate = this.formatDisplayValue(this.value);\n this.inputElem.value = this.displayDate;\n this.inputElem.focus();\n\n this.bqChange.emit({ value: this.value, el: this.el });\n\n this.open = this.type === 'multi';\n };\n\n private handleCalendarRangeStart = (ev: CustomEvent) => {\n this.hasRangeEnd = false;\n this.tentative = new Date(ev.detail).toLocaleDateString('fr-CA');\n };\n\n private handleCalendarRangeEnd = () => {\n this.hasRangeEnd = true;\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n if (this.disabled) return;\n\n this.inputElem.value = '';\n this.value = this.inputElem.value;\n this.hasRangeEnd = false;\n\n this.bqClear.emit(this.el);\n this.bqChange.emit({ value: this.value, el: this.el });\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem);\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem);\n };\n\n private generateCalendarMonth = (offset?: number, className = ''): JSX.Element => {\n return (\n <calendar-month\n offset={offset}\n class={className}\n exportparts={`${this.COMMON_EXPORT_PARTS},${this.BUTTON_EXPORT_PARTS}`}\n />\n );\n };\n\n /**\n * Generates an array of JSX.Element representing calendar months.\n *\n * If the type of the date picker is 'range' or 'multi' and the number of months is specified,\n * it generates an array of calendar months with the specified length. Each month will have an offset\n * and a class name based on its position in the array. The offset is used to determine the month to display,\n * and the class name is used for responsive design.\n *\n * If the type of the date picker is not 'range' or 'multi', or if the number of months is not specified,\n * it generates an array with a single calendar month.\n *\n * @returns {JSX.Element[]} An array of JSX.Element representing calendar months.\n */\n private generateCalendarMonths = (): JSX.Element[] => {\n if (this.type === 'range' || (this.type === 'multi' && this.months)) {\n return Array.from({ length: this.months }, (_, i) => {\n const offset = i > 0 ? i : undefined;\n const className = offset ? 'hidden sm:block' : '';\n return this.generateCalendarMonth(offset, className);\n });\n }\n\n return [this.generateCalendarMonth()];\n };\n\n /**\n * Extracts and returns the first date part from a given string.\n * When the type of the date picker is 'range' or 'multi', the first or initial date part of the value\n * should be the focused date in the calendar.\n *\n * @param value - The value to be processed, can be a string.\n * @returns The extracted last date portion of the value.\n */\n private formatFocusedDate = (value: string): string | null => {\n if (!value) return;\n\n const dateRegex = /\\b\\d{4}-\\d{2}-\\d{2}\\b/;\n const match = dateRegex.exec(value);\n return match ? match[0] : null;\n };\n\n private formatDisplayValue = (value: string): string | undefined => {\n if (!value) return;\n\n const dateFormatter = new Intl.DateTimeFormat(this.locale, this.formatOptions);\n\n if (this.type === 'range') {\n const [start, end] = value.split('/').map((dateStr) => new Date(dateStr));\n return dateFormatter.formatRange(start, end);\n }\n\n if (this.type === 'multi') {\n const dates = value.split(' ').map((dateStr) => new Date(dateStr));\n return dates.map((date) => dateFormatter.format(date)).join(', ');\n }\n\n return dateFormatter.format(new Date(value));\n };\n\n private get CalendarType() {\n const componentTypes = {\n single: 'calendar-date',\n multi: 'calendar-multi',\n range: 'calendar-range',\n } as const;\n\n // Return the corresponding component type, based on the type prop value\n return componentTypes[this.type] || componentTypes.single;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const CallyCalendar = this.CalendarType;\n const labelId = `bq-date-picker__label-${this.name || this.fallbackInputId}`;\n\n return (\n <div class=\"bq-date-picker\" part=\"base\">\n {/* Label */}\n <label\n id={labelId}\n class={{ 'bq-date-picker__label': true, '!hidden': !this.hasLabel }}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem: HTMLSpanElement) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n {/* Select date picker dropdown */}\n <bq-dropdown\n class=\"bq-date-picker__dropdown is-full [&::part(panel)]:p-m [&::part(panel)]:is-auto\"\n disabled={this.disabled}\n distance={this.distance}\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n skidding={this.skidding}\n strategy={this.strategy}\n exportparts=\"panel\"\n >\n {/* Input control group */}\n <div\n class={{\n 'bq-date-picker__control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n slot=\"trigger\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-date-picker__control--prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem: HTMLSpanElement) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-date-picker__control--input\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n autoFocus={this.autofocus}\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-controls={`${this.name}`}\n aria-haspopup=\"dialog\"\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.type !== 'single'}\n ref={(inputElem: HTMLInputElement) => (this.inputElem = inputElem)}\n required={this.required}\n spellcheck={false}\n type=\"text\"\n value={this.displayDate}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onChange={this.handleChange}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-date-picker__control--clear ms-[--bq-date-picker--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon weight=\"bold\" name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class=\"bq-date-picker__control--suffix\"\n ref={(spanElem: HTMLSpanElement) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange}>\n <bq-icon name=\"calendar-blank\" weight=\"bold\" class=\"flex\" />\n </slot>\n </span>\n </div>\n <CallyCalendar\n isDateDisallowed={this.isDateDisallowed}\n locale={this.locale as string}\n value={this.value}\n min={this.min}\n max={this.max}\n months={this.months}\n tentative={this.tentative}\n pageBy={this.monthsPerView}\n firstDayOfWeek={this.firstDayOfWeek}\n showOutsideDays={this.showOutsideDays}\n onChange={this.handleCalendarChange}\n onRangestart={this.handleCalendarRangeStart}\n onRangeend={this.handleCalendarRangeEnd}\n exportparts=\"container:calendar__container,header:calendar__header,button:calendar__button,previous:calendar__previous,next:calendar__next,disabled:calendar__disabled,heading:calendar__heading\"\n ref={(elem) => (this.callyElem = elem as InstanceType<typeof CalendarDate>)}\n >\n <bq-icon color=\"text--primary\" slot=\"previous\" name=\"caret-left\" label=\"Previous\" />\n <bq-icon color=\"text--primary\" slot=\"next\" name=\"caret-right\" label=\"Next\" />\n\n <div class=\"flex flex-wrap justify-center gap-[--bq-spacing-m]\">{this.generateCalendarMonths()}</div>\n </CallyCalendar>\n </bq-dropdown>\n </div>\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"bq-date-picker.js","sourceRoot":"","sources":["../../../../../../src/components/date-picker/bq-date-picker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAG/G,OAAO,EAAE,gBAAgB,EAA+B,MAAM,wBAAwB,CAAC;AAEvF,OAAO,EACL,cAAc,EACd,SAAS,EACT,2BAA2B,EAC3B,aAAa,EACb,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAQH,MAAM,OAAO,YAAY;;;;wBA6BH,KAAK;yBACJ,KAAK;2BACH,KAAK;yBACP,KAAK;wBACN,KAAK;;gCASoB,aAAa;4BAGjB,KAAK;wBAMA,KAAK;wBAGN,CAAC;8BAGS,CAAC;6BAKJ;YAClD,GAAG,EAAE,S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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Listen, Method, Prop, State, Watch } from '@stencil/core';\nimport { CalendarDate } from 'cally';\n\nimport { DATE_PICKER_TYPE, DaysOfWeek, TDatePickerType } from './bq-date-picker.types';\nimport { Placement } from '../../services/interfaces';\nimport {\n hasSlotContent,\n isDefined,\n isEventTargetChildOfElement,\n isHTMLElement,\n validatePropValue,\n} from '../../shared/utils';\nimport { TInputValidation } from '../input/bq-input.types';\n\n/**\n * @part base - The component's base wrapper.\n * @part button - The native HTML button used under the hood in the clear button.\n * @part clear-btn - The clear button.\n * @part control - The input control wrapper.\n * @part input - The native HTML input element used under the hood.\n * @part label - The label slot container.\n * @part panel - The date picker panel container\n * @part prefix - The prefix slot container.\n * @part suffix - The suffix slot container.\n\n// Parts from the Cally library for calendar-date and calendar-range components:\n * @part calendar__container - The container for the entire component.\n * @part calendar__header - The container for heading and button's.\n * @part calendar__button - Any button within the component.\n * @part calendar__previous - The previous page button.\n * @part calendar__next - The next page button.\n * @part calendar__disabled - A button that is disabled due to min/max.\n * @part calendar__heading - The heading containing the month and year.\n\n// Parts specific to the calendar-month component:\n * @part calendar__heading - The heading that labels the month.\n * @part calendar__table - The <table> element.\n * @part calendar__tr - Any row within the table.\n * @part calendar__head - The table's header row.\n * @part calendar__week - The table's body rows.\n * @part calendar__th - The table's header cells.\n * @part calendar__td - The table's body cells.\n * @part calendar__button - Any button used in the component.\n * @part calendar__day - The buttons corresponding to each day in the grid.\n * @part calendar__selected - Any days which are selected.\n * @part calendar__today - Today's day.\n * @part calendar__disallowed - Any day that has been disallowed via isDateDisallowed.\n * @part calendar__outside - Any days which are outside the current month.\n * @part calendar__range-start - The day at the start of a date range.\n * @part calendar__range-end - The day at the end of a date range.\n * @part calendar__range-inner - Any days between the start and end of a date range.\n */\n@Component({\n tag: 'bq-date-picker',\n styleUrl: './scss/bq-date-picker.scss',\n shadow: {\n delegatesFocus: true,\n },\n})\nexport class BqDatePicker {\n // Own Properties\n // ====================\n\n private callyElem?: InstanceType<typeof CalendarDate>;\n private inputElem?: HTMLInputElement;\n private labelElem?: HTMLElement;\n private prefixElem?: HTMLElement;\n private suffixElem?: HTMLElement;\n\n private fallbackInputId = 'date-picker';\n\n // Export parts of the calendar-month component\n private readonly COMMON_EXPORT_PARTS =\n 'calendar__heading,calendar__table,calendar__tr,calendar__head,calendar__week,calendar__th,calendar__td';\n private readonly BUTTON_EXPORT_PARTS =\n 'calendar__button,calendar__day,calendar__selected,calendar__today,calendar__disallowed,calendar__outside,calendar__range-start,calendar__range-end,calendar__range-inner';\n\n // Reference to host HTML element\n // ===================================\n\n @Element() el!: HTMLBqDatePickerElement;\n\n // State() variables\n // Inlined decorator, alphabetical order\n // =======================================\n\n @State() focusedDate: string;\n @State() displayDate: string;\n @State() hasLabel = false;\n @State() hasPrefix = false;\n @State() hasRangeEnd = false;\n @State() hasSuffix = false;\n @State() hasValue = false;\n\n // Public Property API\n // ========================\n\n /** If `true`, the Date picker input will be focused on component render */\n @Prop({ reflect: true }) autofocus: boolean;\n\n /** The clear button aria label */\n @Prop({ reflect: true }) clearButtonLabel? = 'Clear value';\n\n /** If `true`, the clear button won't be displayed */\n @Prop({ reflect: true }) disableClear? = false;\n\n /**\n * Indicates whether the Date picker input is disabled or not.\n * If `true`, the Date picker is disabled and cannot be interacted with.\n */\n @Prop({ mutable: true }) disabled?: boolean = false;\n\n /** Represents the distance (gutter or margin) between the Date picker panel and the input element. */\n @Prop({ reflect: true }) distance?: number = 8;\n\n /** The first day of the week, where Sunday is 0, Monday is 1, etc */\n @Prop({ reflect: true }) firstDayOfWeek?: DaysOfWeek = 1;\n\n /** The options to use when formatting the displayed value.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat#using_options\n */\n @Prop() formatOptions: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n };\n\n /** The ID of the form that the Date picker input belongs to. */\n @Prop({ reflect: true }) form?: string;\n\n /** A function that takes a date and returns true if the date should not be selectable */\n @Prop({ reflect: true }) isDateDisallowed?: (date: Date) => boolean;\n\n /** The locale for formatting dates. If not set, will use the browser's locale.\n * Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument\n */\n @Prop({ reflect: true }) locale: Intl.LocalesArgument = 'en-GB';\n\n /** The latest date that can be selected */\n @Prop({ reflect: true }) max?: string;\n\n /** The earliest date that can be selected */\n @Prop({ reflect: true }) min?: string;\n\n /** Number of months to show when range is `true` */\n @Prop({ reflect: true }) months: number;\n\n /**\n * Specifies how the next/previous buttons should navigate the calendar.\n * - single: The buttons will navigate by a single month at a time.\n * - months: The buttons will navigate by the number of months displayed per view.\n */\n @Prop({ reflect: true }) monthsPerView: 'single' | 'months' = 'single';\n\n /** The Date picker input name. */\n @Prop({ reflect: true }) name!: string;\n\n /** If `true`, the Date picker panel will be visible. */\n @Prop({ reflect: true, mutable: true }) open?: boolean = false;\n\n /** When set, it will override the height of the Date picker panel. */\n @Prop({ reflect: true, mutable: true }) panelHeight?: string = 'auto';\n\n /** The Date picker input placeholder text value */\n @Prop({ reflect: true }) placeholder?: string;\n\n /** Position of the Date picker panel */\n @Prop({ reflect: true }) placement?: Placement = 'bottom-end';\n\n /** Indicates whether or not the Date picker input is required to be filled out before submitting the form. */\n @Prop({ reflect: true }) required?: boolean;\n\n /** Represents the skidding between the Date picker panel and the input element. */\n @Prop({ reflect: true }) skidding?: number = 0;\n\n /** Whether to show days outside the month */\n @Prop({ reflect: true }) showOutsideDays: boolean = false;\n\n /** Defines the strategy to position the Date picker panel */\n @Prop({ reflect: true }) strategy?: 'fixed' | 'absolute' = 'fixed';\n\n /** The date that is tentatively selected e.g. the start of a range selection */\n @Prop({ reflect: true, mutable: true }) tentative?: string;\n\n /** It defines how the calendar will behave, allowing single date selection, range selection, or multiple date selection */\n @Prop({ reflect: true }) type: TDatePickerType = 'single';\n\n /**\n * The validation status of the Select input.\n *\n * @remarks\n * This property is used to indicate the validation status of the select input. It can be set to one of the following values:\n * - `'none'`: No validation status is set.\n * - `'error'`: The input has a validation error.\n * - `'warning'`: The input has a validation warning.\n * - `'success'`: The input has passed validation.\n */\n @Prop({ reflect: true }) validationStatus: TInputValidation = 'none';\n\n /** The select input value represents the currently selected date or range and can be used to reset the field to a previous value.\n * All dates are expected in ISO-8601 format (YYYY-MM-DD). */\n @Prop({ reflect: true, mutable: true }) value: string;\n\n // Prop lifecycle events\n // =======================\n\n @Watch('value')\n handleValueChange() {\n if (Array.isArray(this.value)) {\n this.hasValue = this.value.some((val) => val.length > 0);\n return;\n }\n\n this.hasValue = isDefined(this.value);\n this.displayDate = this.formatDisplayValue(this.value);\n\n this.setFocusedDate();\n }\n\n @Watch('type')\n checkPropValues() {\n validatePropValue(DATE_PICKER_TYPE, 'single', this.el, 'type');\n }\n\n // Events section\n // Requires JSDocs for public API documentation\n // ==============================================\n\n /** Callback handler emitted when the input loses focus */\n @Event() bqBlur!: EventEmitter<HTMLBqDatePickerElement>;\n\n /**\n * Callback handler emitted when the input value has changed and the input loses focus.\n * This handler is called whenever the user finishes typing or pasting text into the input field and then clicks outside of the input field.\n */\n @Event() bqChange!: EventEmitter<{ value: string; el: HTMLBqDatePickerElement }>;\n\n /** Callback handler emitted when the input value has been cleared */\n @Event() bqClear!: EventEmitter<HTMLBqDatePickerElement>;\n\n /** Callback handler emitted when the input has received focus */\n @Event() bqFocus!: EventEmitter<HTMLBqDatePickerElement>;\n\n // Component lifecycle events\n // Ordered by their natural call order\n // =====================================\n\n connectedCallback() {\n this.handleValueChange();\n }\n\n componentWillLoad() {\n this.handleValueChange();\n }\n\n // Listeners\n // ==============\n\n @Listen('bqOpen', { capture: true })\n handleOpenChange(ev: CustomEvent<{ open: boolean }>) {\n if (!ev.composedPath().includes(this.el)) return;\n\n this.open = ev.detail.open;\n this.setFocusedDate();\n }\n\n @Listen('click', { target: 'body', capture: true })\n handleClickOutside(ev: MouseEvent) {\n const { open, type, hasRangeEnd } = this;\n if (!open || type !== 'range' || ev.button !== 0) return;\n if (isEventTargetChildOfElement(ev, this.el) || hasRangeEnd) return;\n if (isEventTargetChildOfElement(ev, this.el)) return;\n\n if (!hasRangeEnd) {\n this.tentative = undefined;\n this.hasRangeEnd = false;\n }\n }\n\n // Public methods API\n // These methods are exposed on the host element.\n // Always use two lines.\n // Public Methods must be async.\n // Requires JSDocs for public API documentation.\n // ===============================================\n\n /**\n * Clears the selected value.\n *\n * @return {Promise<void>}\n * @memberof BqInput\n */\n @Method()\n async clear(): Promise<void> {\n if (this.disabled) return;\n\n this.value = undefined;\n\n this.bqClear.emit(this.el);\n }\n\n // Local methods\n // Internal business logic.\n // These methods cannot be called from the host element.\n // =======================================================\n\n private handleBlur = () => {\n if (this.disabled) return;\n\n this.bqBlur.emit(this.el);\n };\n\n private handleFocus = () => {\n if (this.disabled) return;\n\n this.bqFocus.emit(this.el);\n };\n\n private setFocusedDate = () => {\n if (!this.callyElem) return;\n // We need to set the focused date in the calendar component via a ref\n // because it doesn't work when passed as a prop (the Cally element does not re-render)\n this.callyElem.focusedDate = this.value\n ? this.formatFocusedDate(this.value)\n : new Date().toLocaleDateString('fr-CA');\n };\n\n private handleChange = (ev: Event) => {\n if (this.disabled) return;\n\n if (!isHTMLElement(ev.target, 'input')) return;\n\n const dateValue = new Date(ev.target.value);\n if (!isNaN(dateValue.getTime())) {\n // We need to force the value to respect the format: yyyy-mm-dd, hence the hardcoded locale\n this.value = dateValue.toLocaleDateString('fr-CA');\n this.displayDate = this.formatDisplayValue(this.value);\n this.bqChange.emit({ value: this.value, el: this.el });\n }\n };\n\n private handleCalendarChange = (ev: Event) => {\n const { value } = ev.target as unknown as { value: string };\n\n this.value = value;\n this.displayDate = this.formatDisplayValue(this.value);\n this.inputElem.value = this.displayDate;\n this.inputElem.focus();\n\n this.bqChange.emit({ value: this.value, el: this.el });\n\n this.open = this.type === 'multi';\n };\n\n private handleCalendarRangeStart = (ev: CustomEvent) => {\n this.hasRangeEnd = false;\n this.tentative = new Date(ev.detail).toLocaleDateString('fr-CA');\n };\n\n private handleCalendarRangeEnd = () => {\n this.hasRangeEnd = true;\n };\n\n private handleClearClick = (ev: CustomEvent) => {\n if (this.disabled) return;\n\n this.inputElem.value = '';\n this.value = this.inputElem.value;\n this.hasRangeEnd = false;\n\n this.bqClear.emit(this.el);\n this.bqChange.emit({ value: this.value, el: this.el });\n this.inputElem.focus();\n\n ev.stopPropagation();\n };\n\n private handleLabelSlotChange = () => {\n this.hasLabel = hasSlotContent(this.labelElem);\n };\n\n private handlePrefixSlotChange = () => {\n this.hasPrefix = hasSlotContent(this.prefixElem);\n };\n\n private handleSuffixSlotChange = () => {\n this.hasSuffix = hasSlotContent(this.suffixElem);\n };\n\n private generateCalendarMonth = (offset?: number, className = ''): JSX.Element => {\n return (\n <calendar-month\n offset={offset}\n class={className}\n exportparts={`${this.COMMON_EXPORT_PARTS},${this.BUTTON_EXPORT_PARTS}`}\n />\n );\n };\n\n /**\n * Generates an array of JSX.Element representing calendar months.\n *\n * If the type of the date picker is 'range' or 'multi' and the number of months is specified,\n * it generates an array of calendar months with the specified length. Each month will have an offset\n * and a class name based on its position in the array. The offset is used to determine the month to display,\n * and the class name is used for responsive design.\n *\n * If the type of the date picker is not 'range' or 'multi', or if the number of months is not specified,\n * it generates an array with a single calendar month.\n *\n * @returns {JSX.Element[]} An array of JSX.Element representing calendar months.\n */\n private generateCalendarMonths = (): JSX.Element[] => {\n if (this.type === 'range' || (this.type === 'multi' && this.months)) {\n return Array.from({ length: this.months }, (_, i) => {\n const offset = i > 0 ? i : undefined;\n const className = offset ? 'hidden sm:block' : '';\n return this.generateCalendarMonth(offset, className);\n });\n }\n\n return [this.generateCalendarMonth()];\n };\n\n /**\n * Extracts and returns the first date part from a given string.\n * When the type of the date picker is 'range' or 'multi', the first or initial date part of the value\n * should be the focused date in the calendar.\n *\n * @param value - The value to be processed, can be a string.\n * @returns The extracted last date portion of the value.\n */\n private formatFocusedDate = (value: string): string | null => {\n if (!value) return;\n\n const dateRegex = /\\b\\d{4}-\\d{2}-\\d{2}\\b/;\n const match = dateRegex.exec(value);\n return match ? match[0] : null;\n };\n\n private formatDisplayValue = (value: string): string | undefined => {\n if (!value) return;\n\n const dateFormatter = new Intl.DateTimeFormat(this.locale, this.formatOptions);\n\n if (this.type === 'range') {\n const [start, end] = value.split('/').map((dateStr) => new Date(dateStr));\n return dateFormatter.formatRange(start, end);\n }\n\n if (this.type === 'multi') {\n const dates = value.split(' ').map((dateStr) => new Date(dateStr));\n return dates.map((date) => dateFormatter.format(date)).join(', ');\n }\n\n return dateFormatter.format(new Date(value));\n };\n\n private get CalendarType() {\n const componentTypes = {\n single: 'calendar-date',\n multi: 'calendar-multi',\n range: 'calendar-range',\n } as const;\n\n // Return the corresponding component type, based on the type prop value\n return componentTypes[this.type] || componentTypes.single;\n }\n\n // render() function\n // Always the last one in the class.\n // ===================================\n\n render() {\n const CallyCalendar = this.CalendarType;\n const labelId = `bq-date-picker__label-${this.name || this.fallbackInputId}`;\n\n return (\n <div class=\"bq-date-picker\" part=\"base\">\n {/* Label */}\n <label\n id={labelId}\n class={{ 'bq-date-picker__label': true, '!hidden': !this.hasLabel }}\n aria-label={this.name || this.fallbackInputId}\n htmlFor={this.name || this.fallbackInputId}\n ref={(labelElem: HTMLSpanElement) => (this.labelElem = labelElem)}\n part=\"label\"\n >\n <slot name=\"label\" onSlotchange={this.handleLabelSlotChange} />\n </label>\n {/* Select date picker dropdown */}\n <bq-dropdown\n class=\"bq-date-picker__dropdown is-full [&::part(panel)]:p-m [&::part(panel)]:is-auto\"\n disabled={this.disabled}\n distance={this.distance}\n open={this.open}\n panelHeight={this.panelHeight}\n placement={this.placement}\n skidding={this.skidding}\n strategy={this.strategy}\n exportparts=\"panel\"\n >\n {/* Input control group */}\n <div\n class={{\n 'bq-date-picker__control': true,\n [`validation-${this.validationStatus}`]: true,\n disabled: this.disabled,\n }}\n part=\"control\"\n slot=\"trigger\"\n >\n {/* Prefix */}\n <span\n class={{ 'bq-date-picker__control--prefix': true, '!hidden': !this.hasPrefix }}\n ref={(spanElem: HTMLSpanElement) => (this.prefixElem = spanElem)}\n part=\"prefix\"\n >\n <slot name=\"prefix\" onSlotchange={this.handlePrefixSlotChange} />\n </span>\n {/* HTML Input */}\n <input\n id={this.name || this.fallbackInputId}\n class=\"bq-date-picker__control--input\"\n autoComplete=\"off\"\n autoCapitalize=\"off\"\n aria-disabled={this.disabled ? 'true' : 'false'}\n aria-controls={`${this.name}`}\n aria-haspopup=\"dialog\"\n disabled={this.disabled}\n form={this.form}\n name={this.name}\n placeholder={this.placeholder}\n readonly={this.type !== 'single'}\n ref={(inputElem: HTMLInputElement) => (this.inputElem = inputElem)}\n required={this.required}\n spellcheck={false}\n type=\"text\"\n value={this.displayDate}\n part=\"input\"\n // Events\n onBlur={this.handleBlur}\n onFocus={this.handleFocus}\n onChange={this.handleChange}\n />\n {/* Clear Button */}\n {this.hasValue && !this.disabled && !this.disableClear && (\n // The clear button will be visible as long as the input has a value\n // and the parent group is hovered or has focus-within\n <bq-button\n class=\"bq-date-picker__control--clear ms-[--bq-date-picker--gap] hidden\"\n appearance=\"text\"\n aria-label={this.clearButtonLabel}\n size=\"small\"\n onBqClick={this.handleClearClick}\n part=\"clear-btn\"\n exportparts=\"button\"\n >\n <slot name=\"clear-icon\">\n <bq-icon weight=\"bold\" name=\"x-circle\" class=\"flex\" />\n </slot>\n </bq-button>\n )}\n {/* Suffix */}\n <span\n class=\"bq-date-picker__control--suffix\"\n ref={(spanElem: HTMLSpanElement) => (this.suffixElem = spanElem)}\n part=\"suffix\"\n >\n <slot name=\"suffix\" onSlotchange={this.handleSuffixSlotChange}>\n <bq-icon name=\"calendar-blank\" weight=\"bold\" class=\"flex\" />\n </slot>\n </span>\n </div>\n <CallyCalendar\n isDateDisallowed={this.isDateDisallowed}\n locale={this.locale as string}\n value={this.value}\n min={this.min}\n max={this.max}\n months={this.months}\n tentative={this.tentative}\n pageBy={this.monthsPerView}\n firstDayOfWeek={this.firstDayOfWeek}\n showOutsideDays={this.showOutsideDays}\n onChange={this.handleCalendarChange}\n onRangestart={this.handleCalendarRangeStart}\n onRangeend={this.handleCalendarRangeEnd}\n exportparts=\"container:calendar__container,header:calendar__header,button:calendar__button,previous:calendar__previous,next:calendar__next,disabled:calendar__disabled,heading:calendar__heading\"\n ref={(elem) => (this.callyElem = elem as InstanceType<typeof CalendarDate>)}\n >\n <bq-icon color=\"text--primary\" slot=\"previous\" name=\"caret-left\" label=\"Previous\" />\n <bq-icon color=\"text--primary\" slot=\"next\" name=\"caret-right\" label=\"Next\" />\n\n <div class=\"flex flex-wrap justify-center gap-[--bq-spacing-m]\">{this.generateCalendarMonths()}</div>\n </CallyCalendar>\n </bq-dropdown>\n </div>\n );\n }\n}\n"]}
|