@adyen/bento-vue3 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/components.d.ts +8 -4
- package/dist/@types/packages/core/src/components/button/button.types.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/accordion/accordion.keys.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/accordion/accordion.types.d.ts +1 -24
- package/dist/@types/packages/vue2/src/components/accordion/accordion.vue.d.ts +17 -57
- package/dist/@types/packages/vue2/src/components/accordion/components/accordion-item.vue.d.ts +27 -29
- package/dist/@types/packages/vue2/src/components/accordion/index.d.ts +2 -3
- package/dist/@types/packages/vue2/src/components/alert/alert.vue.d.ts +0 -4
- package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -4
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +136 -128
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +3 -5
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/card/card.vue.d.ts +46 -15
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +6 -7
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +4 -3
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +37 -11
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/currency/currency.vue.d.ts +0 -3
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +3 -22
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/components/data-grid-config-settings-column-row/data-grid-config-settings-column-row.vue.d.ts +0 -5
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-config-settings/data-grid-config-settings.vue.d.ts +0 -24
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +277 -16
- package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/date-picker/date-picker.vue.d.ts +0 -20
- package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/date-range-picker/date-range-picker.vue.d.ts +0 -20
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +3 -6
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-default-textbox/dropdown-default-textbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +164 -104
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +7 -9
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.types.d.ts +27 -0
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +76 -0
- package/dist/@types/packages/vue2/src/components/empty-state/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +19 -25
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/components/all-filters-modal-button/all-filters-modal-button.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/base-filter.vue.d.ts +1 -27
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter-button/base-filter-button.vue.d.ts +1 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-filter/date-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/date-range-filter/date-range-filter.vue.d.ts +1 -11
- package/dist/@types/packages/vue2/src/components/filter-bar/components/filter-bar-button/filter-bar-button.vue.d.ts +53 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/filter-bar-button/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/input-filter/input-filter.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/range-filter/range-filter.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/select-filter.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/focus-trap/focus-trap.vue.d.ts +7 -0
- package/dist/@types/packages/vue2/src/components/header/header.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/image/const.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/image/image.types.d.ts +19 -0
- package/dist/@types/packages/vue2/src/components/image/image.vue.d.ts +50 -0
- package/dist/@types/packages/vue2/src/components/image/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/info-icon/info-icon.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/input-field/input-field.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +61 -58
- package/dist/@types/packages/vue2/src/components/internal/avatar/avatar.vue.d.ts +0 -3
- package/dist/@types/packages/vue2/src/components/internal/base-button/base-button.vue.d.ts +1 -4
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/calendar-month.vue.d.ts +0 -5
- package/dist/@types/packages/vue2/src/components/internal/calendar/components/calendar-month/components/calendar-month-day/calendar-month-day.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-option-tag/listbox-option-tag.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +3 -7
- package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +4 -0
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +6 -31
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/__mocks__/base-modal.vue.d.ts +0 -5
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +14 -9
- package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +2 -2
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +4 -14
- package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +7 -6
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-context/pagination-context.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-controls/pagination-controls.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/pagination/components/pagination-results-per-page/pagination-results-per-page.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/payment-method/payment-method.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/popover/components/popover-dismiss-button/popover-dismiss-button.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/popover/components/popover-title/popover-title.vue.d.ts +1 -2
- package/dist/@types/packages/vue2/src/components/popover/popover.vue.d.ts +9 -9
- package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +5 -14
- package/dist/@types/packages/vue2/src/components/radio-group/components/radio-button/radio-button.vue.d.ts +4 -6
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.types.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +4 -3
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +19 -390
- package/dist/@types/packages/vue2/src/components/segmented-control/components/segmented-control-button/segmented-control-button.vue.d.ts +0 -3
- package/dist/@types/packages/vue2/src/components/segmented-control/segmented-control.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/sidepanel/sidepanel.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/status/status.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +2 -23
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-amount/summary-grid-item-amount.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-numeric/summary-grid-item-numeric.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-percentage/summary-grid-item-percentage.vue.d.ts +2 -5
- package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item-text/summary-grid-item-text.vue.d.ts +1 -4
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/tabs/components/tab.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tabs/tabs.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/tabs/tabs.types.d.ts +6 -2
- package/dist/@types/packages/vue2/src/components/tabs/tabs.vue.d.ts +4 -9
- package/dist/@types/packages/vue2/src/components/tag/tag.vue.d.ts +6 -9
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +6 -10
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +4 -10
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/toast/components/toast-item/toast-item.vue.d.ts +0 -5
- package/dist/@types/packages/vue2/src/components/toggle/toggle.vue.d.ts +4 -6
- package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +24 -40
- package/dist/@types/packages/vue2/src/composables/use-default-slot-validator/use-default-slot-validator.d.ts +2 -1
- package/dist/@types/packages/vue2/src/composables/use-has-slot/use-has-slot.d.ts +8 -1
- package/dist/@types/packages/vue2/src/index.d.ts +3 -0
- package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/utils/ts/get-slot-text/get-slot-text.d.ts +1 -1
- package/dist/@types/packages/vue2/src/utils/ts/print-development-warning.d.ts +1 -0
- package/dist/accordion.js +104 -254
- package/dist/accordion.js.map +1 -1
- package/dist/alert.js +61 -64
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-button.css +1 -1
- package/dist/assets/base-modal.css +1 -0
- package/dist/assets/button.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/chevron-up.css +1 -0
- package/dist/assets/controls-group.css +1 -1
- package/dist/assets/copy.css +1 -1
- package/dist/assets/dropdown-default-textbox.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/error-message.css +1 -1
- package/dist/assets/footer-actions.css +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -0
- package/dist/assets/index5.css +1 -1
- package/dist/assets/index6.css +1 -1
- package/dist/assets/index7.css +1 -1
- package/dist/assets/index8.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/listbox-option-tag.css +1 -1
- package/dist/assets/listbox.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/assets/tooltip.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/badge.js +2 -2
- package/dist/button.js +143 -12
- package/dist/button.js.map +1 -1
- package/dist/card.js +99 -94
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +40 -39
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/base-button.6d2843c2.js +108 -0
- package/dist/chunks/base-button.6d2843c2.js.map +1 -0
- package/dist/chunks/base-modal.3ccb9eb5.js +291 -0
- package/dist/chunks/base-modal.3ccb9eb5.js.map +1 -0
- package/dist/chunks/{button.e1c39f66.js → button.a8462029.js} +39 -42
- package/dist/chunks/button.a8462029.js.map +1 -0
- package/dist/chunks/{calendar.09b683b3.js → calendar.3f930683.js} +237 -240
- package/dist/chunks/calendar.3f930683.js.map +1 -0
- package/dist/chunks/checkbox.5e1e05ae.js +235 -0
- package/dist/chunks/checkbox.5e1e05ae.js.map +1 -0
- package/dist/chunks/{chevron-down.69bedf14.js → chevron-up.c03b58f8.js} +8 -8
- package/dist/chunks/chevron-up.c03b58f8.js.map +1 -0
- package/dist/chunks/controls-group.3b0dfb94.js +136 -0
- package/dist/chunks/controls-group.3b0dfb94.js.map +1 -0
- package/dist/chunks/{copy.2cf5e6c3.js → copy.1d14b783.js} +49 -50
- package/dist/chunks/copy.1d14b783.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.203e747f.js → dropdown-default-textbox.a90e84f9.js} +88 -90
- package/dist/chunks/dropdown-default-textbox.a90e84f9.js.map +1 -0
- package/dist/chunks/{dropdown.8b415aac.js → dropdown.b798a82e.js} +348 -330
- package/dist/chunks/dropdown.b798a82e.js.map +1 -0
- package/dist/chunks/{error-message.ddfe8ea5.js → error-message.9acead25.js} +16 -16
- package/dist/chunks/error-message.9acead25.js.map +1 -0
- package/dist/chunks/footer-actions.9537d0df.js +111 -0
- package/dist/chunks/footer-actions.9537d0df.js.map +1 -0
- package/dist/chunks/get-slot-text.bead058f.js +9 -0
- package/dist/chunks/get-slot-text.bead058f.js.map +1 -0
- package/dist/chunks/{grid-layout.a30855ff.js → grid-layout.984317d7.js} +2 -2
- package/dist/chunks/{grid-layout.a30855ff.js.map → grid-layout.984317d7.js.map} +1 -1
- package/dist/chunks/index.228ecda0.js +101 -0
- package/dist/chunks/index.228ecda0.js.map +1 -0
- package/dist/chunks/index.89b00b94.js +124 -0
- package/dist/chunks/index.89b00b94.js.map +1 -0
- package/dist/chunks/{index.3da90517.js → index.9d8273fc.js} +38 -40
- package/dist/chunks/index.9d8273fc.js.map +1 -0
- package/dist/chunks/{index.c9225c3b.js → index.c2a80208.js} +195 -201
- package/dist/chunks/index.c2a80208.js.map +1 -0
- package/dist/chunks/{index.13949709.js → index.d26fdf71.js} +116 -113
- package/dist/chunks/{index.13949709.js.map → index.d26fdf71.js.map} +1 -1
- package/dist/chunks/{index.d27367cd.js → index.e84dbeae.js} +80 -83
- package/dist/chunks/{index.d27367cd.js.map → index.e84dbeae.js.map} +1 -1
- package/dist/chunks/listbox-option-tag.0c9c571e.js +129 -0
- package/dist/chunks/listbox-option-tag.0c9c571e.js.map +1 -0
- package/dist/chunks/{listbox.0c7c4e5e.js → listbox.6b52af1a.js} +315 -334
- package/dist/chunks/listbox.6b52af1a.js.map +1 -0
- package/dist/chunks/{loading-button.61d8ebe5.js → loading-button.081adbf3.js} +33 -33
- package/dist/chunks/loading-button.081adbf3.js.map +1 -0
- package/dist/chunks/tabs.keys.358742f2.js +7 -0
- package/dist/chunks/tabs.keys.358742f2.js.map +1 -0
- package/dist/chunks/{tooltip.835d9b52.js → tooltip.e4e34b86.js} +56 -59
- package/dist/chunks/tooltip.e4e34b86.js.map +1 -0
- package/dist/chunks/use-default-slot-validator.1169c221.js +16 -0
- package/dist/chunks/use-default-slot-validator.1169c221.js.map +1 -0
- package/dist/chunks/use-has-slot.9fac7123.js +16 -0
- package/dist/chunks/use-has-slot.9fac7123.js.map +1 -0
- package/dist/code-snippet.js +548 -463
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +501 -505
- package/dist/country.js.map +1 -1
- package/dist/currency.js +38 -41
- package/dist/currency.js.map +1 -1
- package/dist/data-grid.js +837 -833
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +83 -87
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/dropdown.js +30 -32
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +166 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/filter-bar.js +986 -935
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +72 -72
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +50 -52
- package/dist/header.js.map +1 -1
- package/dist/image.js +76 -0
- package/dist/image.js.map +1 -0
- package/dist/index.js +239 -232
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +2 -2
- package/dist/input-field.js +241 -269
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/link.js +38 -36
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +131 -139
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +121 -356
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +182 -185
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +19 -23
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +56 -52
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +36 -41
- package/dist/popper-container.js.map +1 -1
- package/dist/radio-group.js +112 -113
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +77 -91
- package/dist/search-bar.js.map +1 -1
- package/dist/segmented-control.js +88 -75
- package/dist/segmented-control.js.map +1 -1
- package/dist/sidepanel.js +122 -121
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +18 -21
- package/dist/status.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +129 -162
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +83 -75
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +32 -35
- package/dist/tag.js.map +1 -1
- package/dist/textarea.js +156 -155
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +212 -213
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +68 -72
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +75 -73
- package/dist/toggle.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +1 -1
- package/package.json +11 -10
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateBodyFitContentDynamicStyles/useCalculateBodyFitContentDynamicStyles.d.ts +0 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useCalculateBodyFitContentDynamicStyles/useCalculateBodyFitContentDynamicStyles.types.d.ts +0 -8
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/components/filter-bar-filter-button/filter-bar-filter-button.vue.d.ts +0 -58
- package/dist/@types/packages/vue2/src/components/filter-bar/components/base-filter/components/index.d.ts +0 -1
- package/dist/assets/button-actions.css +0 -1
- package/dist/assets/chevron-down.css +0 -1
- package/dist/chunks/base-button.20be08da.js +0 -111
- package/dist/chunks/base-button.20be08da.js.map +0 -1
- package/dist/chunks/button-actions.54e28e75.js +0 -124
- package/dist/chunks/button-actions.54e28e75.js.map +0 -1
- package/dist/chunks/button.e1c39f66.js.map +0 -1
- package/dist/chunks/calendar.09b683b3.js.map +0 -1
- package/dist/chunks/checkbox.a404069b.js +0 -226
- package/dist/chunks/checkbox.a404069b.js.map +0 -1
- package/dist/chunks/chevron-down.69bedf14.js.map +0 -1
- package/dist/chunks/controls-group.60fb2a86.js +0 -136
- package/dist/chunks/controls-group.60fb2a86.js.map +0 -1
- package/dist/chunks/copy.2cf5e6c3.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.203e747f.js.map +0 -1
- package/dist/chunks/dropdown.8b415aac.js.map +0 -1
- package/dist/chunks/error-message.ddfe8ea5.js.map +0 -1
- package/dist/chunks/footer-actions.0f640f87.js +0 -106
- package/dist/chunks/footer-actions.0f640f87.js.map +0 -1
- package/dist/chunks/get-slot-text.2db867f8.js +0 -9
- package/dist/chunks/get-slot-text.2db867f8.js.map +0 -1
- package/dist/chunks/index.222d29b0.js +0 -120
- package/dist/chunks/index.222d29b0.js.map +0 -1
- package/dist/chunks/index.3da90517.js.map +0 -1
- package/dist/chunks/index.aa34e363.js +0 -104
- package/dist/chunks/index.aa34e363.js.map +0 -1
- package/dist/chunks/index.c9225c3b.js.map +0 -1
- package/dist/chunks/listbox-option-tag.5ae8b79b.js +0 -133
- package/dist/chunks/listbox-option-tag.5ae8b79b.js.map +0 -1
- package/dist/chunks/listbox.0c7c4e5e.js.map +0 -1
- package/dist/chunks/loading-button.61d8ebe5.js.map +0 -1
- package/dist/chunks/tooltip.835d9b52.js.map +0 -1
- package/dist/chunks/use-default-slot-validator.83d977a1.js +0 -11
- package/dist/chunks/use-default-slot-validator.83d977a1.js.map +0 -1
- package/dist/chunks/use-has-slot.068222e6.js +0 -5
- package/dist/chunks/use-has-slot.068222e6.js.map +0 -1
package/dist/date-picker.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as I, computed as g, defineComponent as X, toRef as U, watch as Z, nextTick as M, resolveComponent as v, resolveDirective as x, withDirectives as ee, openBlock as l, createElementBlock as $, withKeys as h, createVNode as T, withCtx as y, createTextVNode as P, toDisplayString as E, createBlock as c, createCommentVNode as u, createElementVNode as ae, normalizeClass as te } from "vue";
|
|
2
2
|
import { B as re } from "./chunks/directive.0408e565.js";
|
|
3
|
-
import { BentoPopover as
|
|
3
|
+
import { BentoPopover as ne } from "./popover.js";
|
|
4
4
|
import { g as k } from "./chunks/unique-id.a2a2b458.js";
|
|
5
|
-
import { B as
|
|
5
|
+
import { B as oe } from "./chunks/index.89b00b94.js";
|
|
6
6
|
import { u as K } from "./chunks/i18n.6c402773.js";
|
|
7
|
-
import { D as
|
|
8
|
-
import { f as q } from "./chunks/index.
|
|
9
|
-
import { e as
|
|
10
|
-
import { d as
|
|
11
|
-
import { u as
|
|
12
|
-
import { C as
|
|
13
|
-
import { b as
|
|
14
|
-
import { c as
|
|
15
|
-
import { E as
|
|
16
|
-
import { _ as
|
|
17
|
-
import "./assets/
|
|
7
|
+
import { D as A, v as le, f as ie } from "./chunks/date-input.9186a0bf.js";
|
|
8
|
+
import { f as q } from "./chunks/index.e84dbeae.js";
|
|
9
|
+
import { e as S, d as se, f as de } from "./chunks/index.f55fdc32.js";
|
|
10
|
+
import { d as ue } from "./chunks/debounce.f8d92e44.js";
|
|
11
|
+
import { u as pe } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
12
|
+
import { C as _ } from "./chunks/calendar.3f930683.js";
|
|
13
|
+
import { b as Le } from "./chunks/calendar.3f930683.js";
|
|
14
|
+
import { c as ce } from "./chunks/dropdown-default-textbox.a90e84f9.js";
|
|
15
|
+
import { E as fe } from "./chunks/error-message.9acead25.js";
|
|
16
|
+
import { _ as De } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
17
|
+
import "./assets/index24.css";
|
|
18
18
|
var p = /* @__PURE__ */ ((e) => (e.INPUT = "input", e))(p || {});
|
|
19
|
-
const
|
|
20
|
-
const { locale: i, t: f } = K(), D = { de:
|
|
19
|
+
const me = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
20
|
+
const { locale: i, t: f } = K(), D = { de: se, enUS: S, fr: de }, s = I(null);
|
|
21
21
|
return {
|
|
22
22
|
// Values
|
|
23
|
-
dateDisplayValue:
|
|
24
|
-
locale: D[i.value.substring(0, 2)] ||
|
|
23
|
+
dateDisplayValue: g(() => t.value ? s.value : e.value ? q(e.value, A.FULL_DATE, {
|
|
24
|
+
locale: D[i.value.substring(0, 2)] || S
|
|
25
25
|
}) : f("selectDate")),
|
|
26
26
|
textInputValue: s,
|
|
27
27
|
// Methods
|
|
28
28
|
formatTextInputDisplayValue: (d = e.value) => {
|
|
29
|
-
t.value || (s.value = d ? q(d,
|
|
30
|
-
locale: D[i.value.substring(0, 2)] ||
|
|
29
|
+
t.value || (s.value = d ? q(d, A.NUMERIC_DATE_YEAR_FIRST, {
|
|
30
|
+
locale: D[i.value.substring(0, 2)] || S
|
|
31
31
|
}) : null);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
@@ -41,15 +41,15 @@ const ye = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
|
41
41
|
selectedDateIsNotAvailable: "Selected date is not available",
|
|
42
42
|
datePicker: "Date picker"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, be = 1e3, ve = X({
|
|
45
45
|
i18n: { messages: F },
|
|
46
46
|
name: "bento-date-picker",
|
|
47
47
|
components: {
|
|
48
|
-
BentoTypography:
|
|
49
|
-
BentoPopover:
|
|
50
|
-
Calendar:
|
|
51
|
-
ErrorMessage:
|
|
52
|
-
DropdownInputDefault:
|
|
48
|
+
BentoTypography: oe,
|
|
49
|
+
BentoPopover: ne,
|
|
50
|
+
Calendar: _,
|
|
51
|
+
ErrorMessage: fe,
|
|
52
|
+
DropdownInputDefault: ce
|
|
53
53
|
},
|
|
54
54
|
directives: { BentoClickOutsideDirective: re },
|
|
55
55
|
props: {
|
|
@@ -68,11 +68,11 @@ const ye = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
|
68
68
|
/**
|
|
69
69
|
* Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday
|
|
70
70
|
*/
|
|
71
|
-
firstDayOfWeek:
|
|
71
|
+
firstDayOfWeek: _.props.firstDayOfWeek,
|
|
72
72
|
/**
|
|
73
73
|
* Indicate if a date should be disabled or not
|
|
74
74
|
*/
|
|
75
|
-
isDateDisabled:
|
|
75
|
+
isDateDisabled: _.props.isDateDisabled,
|
|
76
76
|
/**
|
|
77
77
|
* Text that is displayed as a label above the element.
|
|
78
78
|
*/
|
|
@@ -96,122 +96,118 @@ const ye = ({ datePickerValue: e, isDateIncorrect: t }) => {
|
|
|
96
96
|
},
|
|
97
97
|
emits: [p.INPUT],
|
|
98
98
|
setup(e, { emit: t }) {
|
|
99
|
-
const { t: i } = K({ messages: F }), f = k("bento-date-picker-container"), D = k("bento-date-picker-label"), s = k("bento-date-picker-description"),
|
|
99
|
+
const { t: i } = K({ messages: F }), f = k("bento-date-picker-container"), D = k("bento-date-picker-label"), s = k("bento-date-picker-description"), o = k("bento-date-picker-error"), m = k("bento-date-picker-date-error"), d = g(() => e.label || i("datePicker", { name: f })), C = I(null), B = I(null), r = I(!1), n = I(!1), { isReadOnly: L } = pe(U(e, "readonly"));
|
|
100
100
|
Z(
|
|
101
101
|
() => e.disabled,
|
|
102
102
|
(a) => {
|
|
103
|
-
a &&
|
|
103
|
+
a && n.value && (n.value = !1);
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
|
-
const { dateDisplayValue: Y, textInputValue: b, formatTextInputDisplayValue: V } =
|
|
107
|
-
datePickerValue:
|
|
106
|
+
const { dateDisplayValue: Y, textInputValue: b, formatTextInputDisplayValue: V } = me({
|
|
107
|
+
datePickerValue: U(e, "value"),
|
|
108
108
|
isDateIncorrect: r
|
|
109
|
-
}),
|
|
110
|
-
"b-date-picker__description--error": e.errorMessage ||
|
|
111
|
-
})), j =
|
|
112
|
-
() => `${e.description ? s : ""} ${e.errorMessage ?
|
|
109
|
+
}), O = g(() => e.isDateDisabled && e.isDateDisabled(new Date(b.value)) ? i("selectedDateIsNotAvailable") : r.value ? i("provideDateInAFormat") : null), W = g(() => ({
|
|
110
|
+
"b-date-picker__description--error": e.errorMessage || O.value
|
|
111
|
+
})), j = g(
|
|
112
|
+
() => `${e.description ? s : ""} ${e.errorMessage ? o : ""} ${O.value ? m : ""}`.trim() || null
|
|
113
113
|
), z = (a) => e.isDateDisabled ? !e.isDateDisabled(a) : !0, R = () => {
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
114
|
+
n.value = !1;
|
|
115
|
+
}, N = () => {
|
|
116
|
+
n.value = !0, V();
|
|
117
117
|
}, G = (a) => {
|
|
118
118
|
r.value = !1, R(), t(p.INPUT, a);
|
|
119
119
|
}, H = async () => {
|
|
120
120
|
r.value && (r.value = !1, b.value = null), t(p.INPUT, null);
|
|
121
121
|
}, J = (a) => {
|
|
122
|
-
|
|
123
|
-
}, Q =
|
|
122
|
+
le(a);
|
|
123
|
+
}, Q = ue((a) => {
|
|
124
124
|
if (a.length < 10)
|
|
125
125
|
return;
|
|
126
126
|
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(a) && z(new Date(a)) ? (r.value = !1, t(p.INPUT, new Date(a))) : a && (r.value = !0, t(p.INPUT, null));
|
|
127
|
-
},
|
|
127
|
+
}, be);
|
|
128
128
|
return {
|
|
129
129
|
// Refs
|
|
130
|
-
inputContainerRef:
|
|
131
|
-
calendarContainerRef:
|
|
130
|
+
inputContainerRef: B,
|
|
131
|
+
calendarContainerRef: C,
|
|
132
132
|
// Values,
|
|
133
133
|
dateDisplayValue: Y,
|
|
134
134
|
datePickerContainerId: f,
|
|
135
135
|
descriptionConditionalClasses: W,
|
|
136
136
|
isDateIncorrect: r,
|
|
137
|
-
isDatePickerOpen:
|
|
137
|
+
isDatePickerOpen: n,
|
|
138
138
|
isReadOnly: L,
|
|
139
|
-
dateErrorText:
|
|
139
|
+
dateErrorText: O,
|
|
140
140
|
labelId: D,
|
|
141
141
|
descriptionId: s,
|
|
142
|
-
errorId:
|
|
142
|
+
errorId: o,
|
|
143
143
|
dateErrorId: m,
|
|
144
144
|
popoverAriaLabel: d,
|
|
145
145
|
ariaDescribedBy: j,
|
|
146
146
|
textInputValue: b,
|
|
147
|
-
// Enums
|
|
148
|
-
BentoTypographyElement: ie,
|
|
149
|
-
BentoTypographyVariant: se,
|
|
150
|
-
BentoPopoverPositions: ne,
|
|
151
147
|
// Events
|
|
152
148
|
closeDatePicker: R,
|
|
153
149
|
clearDatePickerValue: H,
|
|
154
150
|
onDateSelected: G,
|
|
155
|
-
openDatePicker:
|
|
151
|
+
openDatePicker: N,
|
|
156
152
|
onDateKeyDown: J,
|
|
157
153
|
onDateInputChange: (a) => {
|
|
158
|
-
b.value =
|
|
154
|
+
b.value = ie(a), Q(b.value);
|
|
159
155
|
},
|
|
160
156
|
// Keyboard navigation
|
|
161
157
|
onSpaceBarOrEnter: async (a) => {
|
|
162
|
-
var
|
|
163
|
-
|
|
158
|
+
var w;
|
|
159
|
+
n.value || (a.preventDefault(), N(), await M(), e.value || (V(/* @__PURE__ */ new Date()), t(p.INPUT, /* @__PURE__ */ new Date()), await M()), (w = C.value) == null || w.$refs.calendarRef[0].focusOnDate(e.value));
|
|
164
160
|
}
|
|
165
161
|
};
|
|
166
162
|
}
|
|
167
163
|
});
|
|
168
|
-
const
|
|
169
|
-
function
|
|
170
|
-
const
|
|
171
|
-
return ee((l(),
|
|
164
|
+
const ye = ["id"];
|
|
165
|
+
function ke(e, t, i, f, D, s) {
|
|
166
|
+
const o = v("bento-typography"), m = v("dropdown-input-default"), d = v("error-message"), C = v("calendar"), B = v("bento-popover"), r = x("bento-click-outside-directive");
|
|
167
|
+
return ee((l(), $("div", {
|
|
172
168
|
class: "b-date-picker",
|
|
173
169
|
onKeydownCapture: [
|
|
174
|
-
t[0] || (t[0] =
|
|
175
|
-
t[1] || (t[1] =
|
|
170
|
+
t[0] || (t[0] = h((...n) => e.onSpaceBarOrEnter && e.onSpaceBarOrEnter(...n), ["space"])),
|
|
171
|
+
t[1] || (t[1] = h((...n) => e.onSpaceBarOrEnter && e.onSpaceBarOrEnter(...n), ["enter"]))
|
|
176
172
|
]
|
|
177
173
|
}, [
|
|
178
|
-
e.label ? (l(),
|
|
174
|
+
e.label ? (l(), $("div", {
|
|
179
175
|
key: 0,
|
|
180
176
|
id: e.labelId,
|
|
181
177
|
class: "b-date-picker__label"
|
|
182
178
|
}, [
|
|
183
|
-
|
|
184
|
-
el:
|
|
179
|
+
T(o, {
|
|
180
|
+
el: "span",
|
|
185
181
|
stronger: ""
|
|
186
182
|
}, {
|
|
187
183
|
default: y(() => [
|
|
188
|
-
|
|
184
|
+
P(E(e.label), 1)
|
|
189
185
|
]),
|
|
190
186
|
_: 1
|
|
191
|
-
}
|
|
192
|
-
e.optional ? (l(), c(
|
|
187
|
+
}),
|
|
188
|
+
e.optional ? (l(), c(o, {
|
|
193
189
|
key: 0,
|
|
194
190
|
class: "b-date-picker__label-requirement",
|
|
195
|
-
el:
|
|
191
|
+
el: "span"
|
|
196
192
|
}, {
|
|
197
193
|
default: y(() => [
|
|
198
|
-
|
|
194
|
+
P(" (" + E(e.$t("optional")) + ") ", 1)
|
|
199
195
|
]),
|
|
200
196
|
_: 1
|
|
201
|
-
}
|
|
202
|
-
e.required ? (l(), c(
|
|
197
|
+
})) : u("", !0),
|
|
198
|
+
e.required ? (l(), c(o, {
|
|
203
199
|
key: 1,
|
|
204
200
|
class: "b-date-picker__label-requirement",
|
|
205
|
-
el:
|
|
201
|
+
el: "span"
|
|
206
202
|
}, {
|
|
207
203
|
default: y(() => [
|
|
208
|
-
|
|
204
|
+
P(" (" + E(e.$t("required")) + ") ", 1)
|
|
209
205
|
]),
|
|
210
206
|
_: 1
|
|
211
|
-
}
|
|
212
|
-
], 8,
|
|
207
|
+
})) : u("", !0)
|
|
208
|
+
], 8, ye)) : u("", !0),
|
|
213
209
|
ae("div", null, [
|
|
214
|
-
|
|
210
|
+
T(m, {
|
|
215
211
|
ref: "inputContainerRef",
|
|
216
212
|
ariaControls: e.datePickerContainerId,
|
|
217
213
|
ariaExpanded: e.isDatePickerOpen,
|
|
@@ -244,17 +240,17 @@ function Pe(e, t, i, f, D, s) {
|
|
|
244
240
|
"error-message": e.errorMessage,
|
|
245
241
|
class: "b-date-picker__error-message"
|
|
246
242
|
}, null, 8, ["id", "error-message"])) : u("", !0),
|
|
247
|
-
e.description ? (l(), c(
|
|
243
|
+
e.description ? (l(), c(o, {
|
|
248
244
|
key: 3,
|
|
249
245
|
class: te(["b-date-picker__description", e.descriptionConditionalClasses]),
|
|
250
|
-
el:
|
|
246
|
+
el: "span"
|
|
251
247
|
}, {
|
|
252
248
|
default: y(() => [
|
|
253
|
-
|
|
249
|
+
P(E(e.description), 1)
|
|
254
250
|
]),
|
|
255
251
|
_: 1
|
|
256
|
-
}, 8, ["class"
|
|
257
|
-
e.inputContainerRef ? (l(), c(
|
|
252
|
+
}, 8, ["class"])) : u("", !0),
|
|
253
|
+
e.inputContainerRef ? (l(), c(B, {
|
|
258
254
|
key: 4,
|
|
259
255
|
id: e.datePickerContainerId,
|
|
260
256
|
class: "b-date-picker__container",
|
|
@@ -264,11 +260,11 @@ function Pe(e, t, i, f, D, s) {
|
|
|
264
260
|
"disable-focus-trap": !0,
|
|
265
261
|
"aria-label": e.popoverAriaLabel,
|
|
266
262
|
"aria-modal": !0,
|
|
267
|
-
position:
|
|
263
|
+
position: "bottom-start",
|
|
268
264
|
"fit-content": ""
|
|
269
265
|
}, {
|
|
270
266
|
default: y(() => [
|
|
271
|
-
|
|
267
|
+
T(C, {
|
|
272
268
|
ref: "calendarContainerRef",
|
|
273
269
|
"first-day-of-week": e.firstDayOfWeek,
|
|
274
270
|
"is-date-disabled": e.isDateDisabled,
|
|
@@ -278,15 +274,15 @@ function Pe(e, t, i, f, D, s) {
|
|
|
278
274
|
}, null, 8, ["first-day-of-week", "is-date-disabled", "value", "onInput"])
|
|
279
275
|
]),
|
|
280
276
|
_: 1
|
|
281
|
-
}, 8, ["id", "open", "target-element", "aria-label"
|
|
277
|
+
}, 8, ["id", "open", "target-element", "aria-label"])) : u("", !0)
|
|
282
278
|
], 32)), [
|
|
283
279
|
[r, e.closeDatePicker]
|
|
284
280
|
]);
|
|
285
281
|
}
|
|
286
|
-
const
|
|
282
|
+
const Ae = /* @__PURE__ */ De(ve, [["render", ke], ["__scopeId", "data-v-5947eaf2"]]);
|
|
287
283
|
export {
|
|
288
|
-
|
|
284
|
+
Ae as BentoDatePicker,
|
|
289
285
|
p as BentoDatePickerEvent,
|
|
290
|
-
|
|
286
|
+
Le as BentoDatePickerFirstDayOfWeek
|
|
291
287
|
};
|
|
292
288
|
//# sourceMappingURL=date-picker.js.map
|
package/dist/date-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sources":["../../vue2/src/components/date-picker/date-picker.types.ts","../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["export { CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek } from '@/internal';\nexport type {\n CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n CalendarSingleDateValue as BentoDatePickerValue,\n} from '@/internal';\n\nexport enum BentoDatePickerEvent {\n INPUT = 'input',\n}\n","import { computed, ref } from 'vue';\nimport { de, enUS, fr } from 'date-fns/locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport format from 'date-fns/format';\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({ datePickerValue, isDateIncorrect }) => {\n const { locale, t } = useI18n();\n const locales = { de, enUS, fr };\n\n const textInputValue = ref(null);\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return t('selectDate') as string;\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" if there's a valid date selected\n return format(datePickerValue.value as Date, DateFormat.FULL_DATE, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n });\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the yyyy-MM-dd format and sets it as \"formatTextInputDisplayValue\" value\n * @param {DATE} dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (isDateIncorrect.value) {\n return;\n }\n\n textInputValue.value = dateToFormat\n ? format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n })\n : null;\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <div v-if=\"label\" :id=\"labelId\" class=\"b-date-picker__label\">\n <bento-typography :el=\"BentoTypographyElement.SPAN\" stronger>{{ label }}</bento-typography>\n <bento-typography\n v-if=\"optional\"\n class=\"b-date-picker__label-requirement\"\n :el=\"BentoTypographyElement.SPAN\"\n >\n ({{ $t('optional') }})\n </bento-typography>\n <bento-typography\n v-if=\"required\"\n class=\"b-date-picker__label-requirement\"\n :el=\"BentoTypographyElement.SPAN\"\n >\n ({{ $t('required') }})\n </bento-typography>\n </div>\n\n <!-- Input -->\n <div>\n <dropdown-input-default\n ref=\"inputContainerRef\"\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n :el=\"BentoTypographyElement.SPAN\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n :position=\"BentoPopoverPositions.BOTTOM_START\"\n fit-content\n >\n <calendar\n ref=\"calendarContainerRef\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"value\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, Ref, ref, toRef, watch } from 'vue';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoDatePickerEvent, BentoDatePickerValue } from './date-picker.types';\n import { Calendar, ErrorMessage } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '../typography';\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-date-picker',\n components: {\n BentoTypography,\n BentoPopover,\n Calendar,\n ErrorMessage,\n DropdownInputDefault,\n },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Descriptive supporting text visbile underneath the dropdown.\n */\n description: { type: String, default: undefined },\n\n /**\n * Disables dropdown functionality.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Displays component in an error state with an error message\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Text that is displayed as a label above the element.\n */\n label: { type: String, default: undefined },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date picker.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Selected date\n */\n value: { type: [Date, Object] as PropType<BentoDatePickerValue>, default: null },\n },\n emits: [BentoDatePickerEvent.INPUT],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const isDateIncorrect = ref(false);\n const isDatePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n });\n\n const dateErrorText = computed(() => {\n if (props.isDateDisabled && props.isDateDisabled(new Date(textInputValue.value))) {\n return t('selectedDateIsNotAvailable');\n }\n\n return isDateIncorrect.value ? t('provideDateInAFormat') : null;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const isDateEnabled = (date: Date) => {\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(date);\n }\n\n return true;\n };\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n isDateIncorrect.value = false;\n\n closeDatePicker();\n emit(BentoDatePickerEvent.INPUT, selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n textInputValue.value = null;\n }\n emit(BentoDatePickerEvent.INPUT, null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateDate = debounce((stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n // Checks for YYYY-MM-DD format\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n const isValidDate = dateRegex.test(stringDate) && isDateEnabled(new Date(stringDate));\n if (isValidDate) {\n isDateIncorrect.value = false;\n emit(BentoDatePickerEvent.INPUT, new Date(stringDate));\n } else if (stringDate) {\n // Only set to true if the value exists (not null/undefined)\n isDateIncorrect.value = true;\n emit(BentoDatePickerEvent.INPUT, null);\n }\n }, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = formatDateInputValue(stringDate);\n validateDate(textInputValue.value);\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!props.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emit(BentoDatePickerEvent.INPUT, new Date());\n\n // Wait for new value to be set with the emit\n await nextTick();\n }\n\n // Focus on date\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(props.value);\n };\n\n return {\n // Refs\n inputContainerRef,\n calendarContainerRef,\n\n // Values,\n dateDisplayValue,\n datePickerContainerId,\n descriptionConditionalClasses,\n isDateIncorrect,\n isDatePickerOpen,\n isReadOnly,\n dateErrorText,\n labelId,\n descriptionId,\n errorId,\n dateErrorId,\n popoverAriaLabel,\n ariaDescribedBy,\n textInputValue,\n\n // Enums\n BentoTypographyElement,\n BentoTypographyVariant,\n BentoPopoverPositions,\n\n // Events\n closeDatePicker,\n clearDatePickerValue,\n onDateSelected,\n openDatePicker,\n onDateKeyDown,\n onDateInputChange,\n\n // Keyboard navigation\n onSpaceBarOrEnter,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["BentoDatePickerEvent","BentoDatePickerEvent2","useDatePickerSingleCalendarText","datePickerValue","isDateIncorrect","locale","t","useI18n","locales","de","enUS","fr","textInputValue","ref","computed","format","DateFormat","dateToFormat","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","BentoClickOutsideDirective","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","date","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","debounce","stringDate","BentoTypographyElement","BentoTypographyVariant","BentoPopoverPositions","formatDateInputValue","nextTick","_a","_ctx","createCommentVNode","openBlock","createBlock","_component_bento_typography","_hoisted_1","createElementVNode","createVNode","_component_dropdown_input_default","_component_error_message","normalize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AT,EAAA;AAAA,MACK,iBAAAA,EAAA;AAAA;IAKA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAMSD,EAAA,eAAAE,EAAA,GAAAC,EAAAC,GAAA;AAAA,MAJP,KAAA;AAAA,MACH,OAAAM,GAAA,CAAA,8BAAAV,EAAA,6BAAA,CAAA;AAAA,MAEY,IAAAA,EAAA,uBAAA;AAAA,IAAA,GAAA;AAAA;;;;IAKX,GAAA,GAAA,CAAA,SAAA,IAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAoBMD,EAAA,qBAAAE,EAAA,GAAAC,EAAAQ,GAAA;AAAA,MAnBc,KAAA;AAAA,MACrB,IAAAX,EAAA;AAAA,MACA,OAAA;AAAA,MACE,MAAA;AAAA,MACN,MAAAA,EAAA;AAAA,MACA,kBAAAA,EAAA;AAAA,MACY,sBAAA;AAAA,MACI,cAAAA,EAAA;AAAA,MACN,cAAA;AAAA,MACA,UAAAA,EAAA,sBAAA;AAAA;;MAGH,SAAAY,EAAA,MAAA;AAAA,QAAAL,EAAAM,GAAA;AAAA,UACgB,KAAA;AAAA,UACnB,qBAAAb,EAAA;AAAA,UACmB,oBAAAA,EAAA;AAAA,UACP,oBAAA;AAAA,UACL,OAAAA,EAAA;AAAA;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","sources":["../../vue2/src/components/date-picker/date-picker.types.ts","../../vue2/src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../../vue2/src/components/date-picker/date-picker.vue"],"sourcesContent":["export { CalendarFirstDayOfWeek as BentoDatePickerFirstDayOfWeek } from '@/internal';\nexport type {\n CalendarIsDateDisabled as BentoDatePickerIsDateDisabled,\n CalendarSingleDateValue as BentoDatePickerValue,\n} from '@/internal';\n\nexport enum BentoDatePickerEvent {\n INPUT = 'input',\n}\n","import { computed, ref } from 'vue';\nimport { de, enUS, fr } from 'date-fns/locale';\nimport { useI18n } from '@/utils/ts/i18n';\nimport { UseDateDisplayText } from './use-date-picker-single-calendar-text.types';\nimport { DateFormat } from '@/types';\nimport format from 'date-fns/format';\n\n/**\n * Composable that sets and formats the date to be displayed in the input box of a Single Date Picker\n * @param {Ref<Date>} option.datePickerValue Ref to the datePickerValue set in the DatePicker component\n * @param {Ref<boolean>} option.isDateIncorrect Indicates if the date is correct or not\n */\nexport const useDatePickerSingleCalendarText: UseDateDisplayText<Date> = ({ datePickerValue, isDateIncorrect }) => {\n const { locale, t } = useI18n();\n const locales = { de, enUS, fr };\n\n const textInputValue = ref(null);\n\n const dateDisplayValue = computed(() => {\n // Display incorrect date when there's an error with the input\n if (isDateIncorrect.value) {\n return textInputValue.value;\n }\n\n // Display \"Select a date\" when there's no date selected or input\n if (!datePickerValue.value) {\n return t('selectDate') as string;\n }\n\n // Display the date in format \"dd MMM, yyyy (25 Jun, 2023)\" if there's a valid date selected\n return format(datePickerValue.value as Date, DateFormat.FULL_DATE, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n });\n });\n\n /**\n * Formats the \"dateToFormat\" date value with the yyyy-MM-dd format and sets it as \"formatTextInputDisplayValue\" value\n * @param {DATE} dateToFormat - Date to be assigned and formatted\n */\n const formatTextInputDisplayValue = (dateToFormat: Date = datePickerValue.value) => {\n // If date is incorrect, leave the textInputValue intact\n if (isDateIncorrect.value) {\n return;\n }\n\n textInputValue.value = dateToFormat\n ? format(dateToFormat, DateFormat.NUMERIC_DATE_YEAR_FIRST, {\n locale: locales[locale.value.substring(0, 2)] || enUS,\n })\n : null;\n };\n\n return {\n // Values\n dateDisplayValue,\n textInputValue,\n\n // Methods\n formatTextInputDisplayValue,\n };\n};\n","<!-- TODO: Remove aria props as these are part of JSX elements /vue/types/jsx.d.ts -->\n<!-- eslint-disable vue/attribute-hyphenation -->\n<template>\n <div\n v-bento-click-outside-directive=\"closeDatePicker\"\n class=\"b-date-picker\"\n @keydown.space.capture=\"onSpaceBarOrEnter\"\n @keydown.enter.capture=\"onSpaceBarOrEnter\"\n >\n <!-- Label -->\n <div v-if=\"label\" :id=\"labelId\" class=\"b-date-picker__label\">\n <bento-typography el=\"span\" stronger>{{ label }}</bento-typography>\n <bento-typography v-if=\"optional\" class=\"b-date-picker__label-requirement\" el=\"span\">\n ({{ $t('optional') }})\n </bento-typography>\n <bento-typography v-if=\"required\" class=\"b-date-picker__label-requirement\" el=\"span\">\n ({{ $t('required') }})\n </bento-typography>\n </div>\n\n <!-- Input -->\n <div>\n <dropdown-input-default\n ref=\"inputContainerRef\"\n :ariaControls=\"datePickerContainerId\"\n :ariaExpanded=\"isDatePickerOpen\"\n :aria-labelledby=\"label ? labelId : null\"\n :aria-describedby=\"ariaDescribedBy\"\n :disabled=\"disabled\"\n dynamic-filtering\n :is-invalid=\"!!errorMessage || !!dateErrorText\"\n :open=\"isDatePickerOpen\"\n :value=\"textInputValue\"\n :display-value=\"dateDisplayValue\"\n :debounce-time=\"0\"\n :readonly=\"isReadOnly\"\n @input=\"onDateInputChange\"\n @open=\"openDatePicker\"\n @keydown=\"onDateKeyDown\"\n @clear=\"clearDatePickerValue\"\n @close=\"closeDatePicker\"\n />\n </div>\n\n <!-- Error Messages -->\n <error-message\n v-if=\"dateErrorText\"\n :id=\"dateErrorId\"\n :error-message=\"dateErrorText\"\n class=\"b-date-picker__error-message\"\n />\n <error-message\n v-if=\"errorMessage\"\n :id=\"errorId\"\n :error-message=\"errorMessage\"\n class=\"b-date-picker__error-message\"\n />\n\n <!-- Description -->\n <bento-typography\n v-if=\"description\"\n class=\"b-date-picker__description\"\n :class=\"descriptionConditionalClasses\"\n el=\"span\"\n >\n {{ description }}\n </bento-typography>\n\n <!-- Calendar container -->\n <bento-popover\n v-if=\"inputContainerRef\"\n :id=\"datePickerContainerId\"\n class=\"b-date-picker__container\"\n role=\"dialog\"\n :open=\"isDatePickerOpen\"\n :target-element=\"inputContainerRef\"\n :disable-focus-trap=\"true\"\n :aria-label=\"popoverAriaLabel\"\n :aria-modal=\"true\"\n position=\"bottom-start\"\n fit-content\n >\n <calendar\n ref=\"calendarContainerRef\"\n :first-day-of-week=\"firstDayOfWeek\"\n :is-date-disabled=\"isDateDisabled\"\n :number-of-months=\"1\"\n :value=\"value\"\n @input=\"onDateSelected\"\n />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, nextTick, PropType, Ref, ref, toRef, watch } from 'vue';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoDatePickerEvent, BentoDatePickerValue } from './date-picker.types';\n import { Calendar, ErrorMessage } from '@/internal';\n import { DropdownInputDefault } from '@/components/dropdown/components';\n import { BentoPopover } from '@/components/popover';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoTypography } from '../typography';\n import { useDatePickerSingleCalendarText } from './composables/use-date-picker-single-calendar-text';\n import { formatDateInputValue, validateDateInput } from '@/utils/ts/date-input';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import { useFormLayoutFieldLoading } from '@/composables';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEBOUNCE_TIME = 1000;\n\n /**\n * Date picker selector.\n *\n * @example\n * import { BentoDatePicker } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoDatePicker },\n * template: `\n * <bento-date-picker\n * label=\"Label\"\n * description=\"Supporting text\"\n * required\n * optional\n * disabled\n * @input=\"onDateChanged\"\n * v-model=\"selectedDate\"\n * />\n * `,\n * setup() {\n * const selectedDate = ref(new Date()); // reactive({ startDate: new Date(), endDate: new Date() })\n * return {\n * selectedDate,\n * }\n * }\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-date-picker',\n components: {\n BentoTypography,\n BentoPopover,\n Calendar,\n ErrorMessage,\n DropdownInputDefault,\n },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Descriptive supporting text visbile underneath the dropdown.\n */\n description: { type: String, default: undefined },\n\n /**\n * Disables dropdown functionality.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Displays component in an error state with an error message\n */\n errorMessage: { type: String, default: null },\n\n /**\n * Allows you to set the first day of the week. 0 is sunday, 1 is monday, 6 is saturday\n */\n firstDayOfWeek: Calendar.props.firstDayOfWeek,\n\n /**\n * Indicate if a date should be disabled or not\n */\n isDateDisabled: Calendar.props.isDateDisabled,\n\n /**\n * Text that is displayed as a label above the element.\n */\n label: { type: String, default: undefined },\n\n /**\n * Highlights the dropdown is optional.\n */\n optional: { type: Boolean, default: false },\n\n /**\n * The Boolean readonly property, when present, makes the element not mutable, meaning the user can not edit the date picker.\n */\n readonly: { type: Boolean, default: false },\n\n /**\n * Highlights the dropdown is required.\n */\n required: { type: Boolean, default: false },\n\n /**\n * Selected date\n */\n value: { type: [Date, Object] as PropType<BentoDatePickerValue>, default: null },\n },\n emits: [BentoDatePickerEvent.INPUT],\n setup(props, { emit }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const datePickerContainerId = generateUid('bento-date-picker-container');\n const labelId = generateUid('bento-date-picker-label');\n const descriptionId = generateUid('bento-date-picker-description');\n const errorId = generateUid('bento-date-picker-error');\n const dateErrorId = generateUid('bento-date-picker-date-error');\n const popoverAriaLabel = computed(() => props.label || t('datePicker', { name: datePickerContainerId }));\n\n // Refs\n const calendarContainerRef = ref(null);\n const inputContainerRef = ref(null);\n\n // Values\n const isDateIncorrect = ref(false);\n const isDatePickerOpen = ref(false);\n const { isReadOnly } = useFormLayoutFieldLoading(toRef(props, 'readonly'));\n\n watch(\n () => props.disabled,\n disabled => {\n // Close date picker popover if it's opened when it's disabled\n if (disabled && isDatePickerOpen.value) {\n isDatePickerOpen.value = false;\n }\n }\n );\n\n const { dateDisplayValue, textInputValue, formatTextInputDisplayValue } = useDatePickerSingleCalendarText({\n datePickerValue: toRef(props, 'value') as Ref<Date>,\n isDateIncorrect,\n });\n\n const dateErrorText = computed(() => {\n if (props.isDateDisabled && props.isDateDisabled(new Date(textInputValue.value))) {\n return t('selectedDateIsNotAvailable');\n }\n\n return isDateIncorrect.value ? t('provideDateInAFormat') : null;\n });\n\n const descriptionConditionalClasses = computed(() => ({\n 'b-date-picker__description--error': props.errorMessage || dateErrorText.value,\n }));\n\n const ariaDescribedBy = computed(\n () =>\n `${props.description ? descriptionId : ''} ${props.errorMessage ? errorId : ''} ${\n dateErrorText.value ? dateErrorId : ''\n }`.trim() || null\n );\n\n const isDateEnabled = (date: Date) => {\n // Check if function is set, otherwise all dates are enabled\n if (props.isDateDisabled) {\n return !props.isDateDisabled(date);\n }\n\n return true;\n };\n\n const closeDatePicker = () => {\n isDatePickerOpen.value = false;\n };\n\n const openDatePicker = () => {\n isDatePickerOpen.value = true;\n\n formatTextInputDisplayValue();\n };\n\n const onDateSelected = (selectedDate: Date) => {\n // Reset the error state when a valid date is selected\n isDateIncorrect.value = false;\n\n closeDatePicker();\n emit(BentoDatePickerEvent.INPUT, selectedDate);\n };\n\n const clearDatePickerValue = async () => {\n if (isDateIncorrect.value) {\n isDateIncorrect.value = false;\n textInputValue.value = null;\n }\n emit(BentoDatePickerEvent.INPUT, null);\n };\n\n const onDateKeyDown = (event: KeyboardEvent) => {\n validateDateInput(event);\n };\n\n const validateDate = debounce((stringDate: string) => {\n // Validate only if the date is complete\n if (stringDate.length < 10) {\n return;\n }\n\n // Checks for YYYY-MM-DD format\n const dateRegex = /^\\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/;\n const isValidDate = dateRegex.test(stringDate) && isDateEnabled(new Date(stringDate));\n if (isValidDate) {\n isDateIncorrect.value = false;\n emit(BentoDatePickerEvent.INPUT, new Date(stringDate));\n } else if (stringDate) {\n // Only set to true if the value exists (not null/undefined)\n isDateIncorrect.value = true;\n emit(BentoDatePickerEvent.INPUT, null);\n }\n }, DEBOUNCE_TIME);\n\n const onDateInputChange = (stringDate: string) => {\n textInputValue.value = formatDateInputValue(stringDate);\n validateDate(textInputValue.value);\n };\n\n /**\n * Space bar and Enter keyDown event handler.\n *\n * * Opens the date picker dialog on the first keydown.\n * * Move focus to selected date, i.e., the date displayed in the date input text field. If no date has been selected, places focus on the current date.\n * @param {KeyboardEvent} event Event being triggered\n */\n const onSpaceBarOrEnter = async (event: KeyboardEvent) => {\n if (isDatePickerOpen.value) {\n return;\n }\n event.preventDefault();\n\n openDatePicker();\n\n // Wait for the date picker dialog to open\n await nextTick();\n\n // Set current date (today) if no date is selected\n if (!props.value) {\n // Format the opened date picker date to YYYY-MM-DD\n formatTextInputDisplayValue(new Date());\n emit(BentoDatePickerEvent.INPUT, new Date());\n\n // Wait for new value to be set with the emit\n await nextTick();\n }\n\n // Focus on date\n calendarContainerRef.value?.$refs.calendarRef[0].focusOnDate(props.value);\n };\n\n return {\n // Refs\n inputContainerRef,\n calendarContainerRef,\n\n // Values,\n dateDisplayValue,\n datePickerContainerId,\n descriptionConditionalClasses,\n isDateIncorrect,\n isDatePickerOpen,\n isReadOnly,\n dateErrorText,\n labelId,\n descriptionId,\n errorId,\n dateErrorId,\n popoverAriaLabel,\n ariaDescribedBy,\n textInputValue,\n\n // Events\n closeDatePicker,\n clearDatePickerValue,\n onDateSelected,\n openDatePicker,\n onDateKeyDown,\n onDateInputChange,\n\n // Keyboard navigation\n onSpaceBarOrEnter,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./date-picker.scss\" />\n"],"names":["BentoDatePickerEvent","BentoDatePickerEvent2","useDatePickerSingleCalendarText","datePickerValue","isDateIncorrect","locale","t","useI18n","locales","de","enUS","fr","textInputValue","ref","computed","format","DateFormat","dateToFormat","DEBOUNCE_TIME","_sfc_main","defineComponent","messages","BentoTypography","BentoPopover","Calendar","ErrorMessage","DropdownInputDefault","BentoClickOutsideDirective","props","emit","datePickerContainerId","generateUid","labelId","descriptionId","errorId","dateErrorId","popoverAriaLabel","calendarContainerRef","inputContainerRef","isDatePickerOpen","isReadOnly","useFormLayoutFieldLoading","toRef","watch","disabled","dateDisplayValue","formatTextInputDisplayValue","dateErrorText","descriptionConditionalClasses","ariaDescribedBy","isDateEnabled","date","closeDatePicker","openDatePicker","onDateSelected","selectedDate","clearDatePickerValue","onDateKeyDown","event","validateDateInput","validateDate","debounce","stringDate","formatDateInputValue","nextTick","_a","_ctx","createCommentVNode","openBlock","createBlock","_component_bento_typography","_hoisted_1","createElementVNode","createVNode","_component_dropdown_input_default","_component_error_message","normalizeClass","_component_bento_popover","withCtx","_component_calendar"],"mappings":";;;;;;;;;;;;;;;;;AAMY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,QAAA,SADQA,IAAAD,KAAA,CAAA,CAAA;ACML,MAAAE,KAAA,CAAA,EAAA,iBAAAC,GAAA,iBAAAC,EAAA,MAAA;AACH,QAAA,EAAA,QAAAC,GAAA,GAAAC,EAAA,IAAAC,EAAA,GACAC,IAAA,EAAA,IAAAC,IAAA,MAAAC,GAAA,IAAAC,GAAA,GAEAC,IAAAC,EAAA,IAAA;AAoCA,SAAA;AAAA;AAAA,IAAO,kBAlCPC,EAAA,MAEIV,EAAA,QACIQ,EAAA,QAIJT,EAAA,QAKAY,EAAAZ,EAAA,OAAAa,EAAA,WAAA;AAAA,MAAmE,QAAAR,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,IACd,CAAA,IALjDJ,EAAA,YAAA,CAMH;AAAA,IAsBD,gBAAAM;AAAA;AAAA,IACA,6BAhBJ,CAAAK,IAAAd,EAAA,UAAA;AAEI,MAAAC,EAAA,UAIAQ,EAAA,QAAAK,IAAAF,EAAAE,GAAAD,EAAA,yBAAA;AAAA,QAC+D,QAAAR,EAAAH,EAAA,MAAA,UAAA,GAAA,CAAA,CAAA,KAAAK;AAAA,MACJ,CAAA,IAAA;AAAA,IAErD;AAAA,EASN;AAER;;;;;;;;;;GCoDIQ,KAAA,KA6BAC,KAAAC,EAAA;AAAA,EAA+B,MAAA,EAAA,UAAAC,EAAA;AAAA,EACV,MAAA;AAAA,EACX,YAAA;AAAA,IACM,iBAAAC;AAAA,IACR,cAA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AAA;AAAA,MACK,iBAAAA,EAAA;AAAA;IAKA,GAAA,MAAA,GAAA,CAAA,MAAA,eAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAMSD,EAAA,eAAAE,EAAA,GAAAC,EAAAC,GAAA;AAAA,MAJP,KAAA;AAAA,MACL,OAAAM,GAAA,CAAA,8BAAAV,EAAA,6BAAA,CAAA;AAAA;;;;;;IAOG,GAAA,GAAA,CAAA,OAAA,CAAA,KAAAC,EAAA,IAAA,EAAA;AAAA,IAoBMD,EAAA,qBAAAE,EAAA,GAAAC,EAAAQ,GAAA;AAAA,MAnBc,KAAA;AAAA,MACrB,IAAAX,EAAA;AAAA,MACA,OAAA;AAAA,MACE,MAAA;AAAA,MACN,MAAAA,EAAA;AAAA,MACA,kBAAAA,EAAA;AAAA,MACY,sBAAA;AAAA,MACI,cAAAA,EAAA;AAAA,MACR,cAAA;AAAA,MACE,UAAA;AAAA;;MAGH,SAAAY,EAAA,MAAA;AAAA,QAAAL,EAAAM,GAAA;AAAA,UACgB,KAAA;AAAA,UACnB,qBAAAb,EAAA;AAAA,UACmB,oBAAAA,EAAA;AAAA,UACP,oBAAA;AAAA,UACL,OAAAA,EAAA;AAAA;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as t, a as r } from "./chunks/index.
|
|
2
|
-
import { b as o } from "./chunks/calendar.
|
|
1
|
+
import { B as t, a as r } from "./chunks/index.c2a80208.js";
|
|
2
|
+
import { b as o } from "./chunks/calendar.3f930683.js";
|
|
3
3
|
export {
|
|
4
4
|
t as BentoDateRangePicker,
|
|
5
5
|
r as BentoDateRangePickerEvent,
|
package/dist/date.js
CHANGED
package/dist/dropdown.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { B as d } from "./chunks/dropdown.
|
|
2
|
-
import { defineComponent as _, computed as I, resolveComponent as u, openBlock as l, createElementBlock as
|
|
3
|
-
import { B as
|
|
1
|
+
import { B as d } from "./chunks/dropdown.b798a82e.js";
|
|
2
|
+
import { defineComponent as _, computed as I, resolveComponent as u, openBlock as l, createElementBlock as b, createVNode as m, mergeProps as f, withCtx as y, toRefs as g, provide as h, createBlock as v } from "vue";
|
|
3
|
+
import { B as C, L as B } from "./chunks/listbox-option-tag.0c9c571e.js";
|
|
4
4
|
import { _ as w } from "./chunks/_plugin-vue_export-helper.dad06003.js";
|
|
5
|
-
import { BentoCountry as D, BentoCountryVariant as
|
|
5
|
+
import { BentoCountry as D, BentoCountryVariant as $ } from "./country.js";
|
|
6
6
|
import { u as A } from "./chunks/useCountryItems.e83ef8f0.js";
|
|
7
|
-
import { d as
|
|
8
|
-
import { BentoPaymentMethod as
|
|
9
|
-
import "./assets/
|
|
10
|
-
const
|
|
7
|
+
import { d as k } from "./chunks/index.89b00b94.js";
|
|
8
|
+
import { BentoPaymentMethod as M } from "./payment-method.js";
|
|
9
|
+
import "./assets/index12.css";
|
|
10
|
+
const T = _({
|
|
11
11
|
name: "bento-dropdown-avatar",
|
|
12
12
|
components: {
|
|
13
13
|
BentoDropdown: d,
|
|
14
|
-
BentoAvatar:
|
|
14
|
+
BentoAvatar: C
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
...d.props,
|
|
@@ -42,7 +42,7 @@ const k = _({
|
|
|
42
42
|
});
|
|
43
43
|
function O(o, e, p, r, t, a) {
|
|
44
44
|
const n = u("bento-avatar"), s = u("bento-dropdown");
|
|
45
|
-
return l(),
|
|
45
|
+
return l(), b("div", null, [
|
|
46
46
|
m(s, f(o.$props, {
|
|
47
47
|
items: o.dropdownItems,
|
|
48
48
|
onInput: o.onInput
|
|
@@ -57,7 +57,7 @@ function O(o, e, p, r, t, a) {
|
|
|
57
57
|
}, 16, ["items", "onInput"])
|
|
58
58
|
]);
|
|
59
59
|
}
|
|
60
|
-
const K = /* @__PURE__ */ w(
|
|
60
|
+
const K = /* @__PURE__ */ w(T, [["render", O]]), P = _({
|
|
61
61
|
name: "b-dropdown-country",
|
|
62
62
|
components: {
|
|
63
63
|
BentoDropdown: d,
|
|
@@ -69,7 +69,7 @@ const K = /* @__PURE__ */ w(k, [["render", O]]), P = _({
|
|
|
69
69
|
* The option elements to populate the country dropdown with.
|
|
70
70
|
* It must be an array of {@see BentoCountryListboxOptions }
|
|
71
71
|
* * @deprecated {string} value.label - Use BentoDropdown instead of custom labels
|
|
72
|
-
* * @property {BentoCountryCode} value.value - Country code of the option
|
|
72
|
+
* * @property {BentoCountryCode | string} value.value - Country code of the option
|
|
73
73
|
*/
|
|
74
74
|
items: {
|
|
75
75
|
type: Array,
|
|
@@ -81,14 +81,14 @@ const K = /* @__PURE__ */ w(k, [["render", O]]), P = _({
|
|
|
81
81
|
*/
|
|
82
82
|
variant: {
|
|
83
83
|
type: String,
|
|
84
|
-
default:
|
|
85
|
-
validator: (o) => Object.values(
|
|
84
|
+
default: $.CUSTOM,
|
|
85
|
+
validator: (o) => Object.values($).includes(o)
|
|
86
86
|
}
|
|
87
87
|
},
|
|
88
88
|
emits: ["input"],
|
|
89
89
|
setup(o, { emit: e }) {
|
|
90
90
|
const { variant: p, items: r } = g(o), t = (n) => e("input", n), a = A(p, r);
|
|
91
|
-
return
|
|
91
|
+
return h("skipBentoCountryDeprecateMessage", !0), (p.value === "custom" || r.value.some((n) => n.label)) && k(
|
|
92
92
|
'BentoDropdownCountry "custom" variant and "items" prop "label" key',
|
|
93
93
|
"Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels",
|
|
94
94
|
"2.0.0"
|
|
@@ -96,15 +96,13 @@ const K = /* @__PURE__ */ w(k, [["render", O]]), P = _({
|
|
|
96
96
|
// Values
|
|
97
97
|
countryItems: a,
|
|
98
98
|
// Methods
|
|
99
|
-
onInput: t
|
|
100
|
-
// Enums
|
|
101
|
-
BentoCountryVariant: b
|
|
99
|
+
onInput: t
|
|
102
100
|
};
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
|
-
function
|
|
103
|
+
function L(o, e, p, r, t, a) {
|
|
106
104
|
const n = u("bento-country"), s = u("bento-dropdown");
|
|
107
|
-
return l(),
|
|
105
|
+
return l(), b("div", null, [
|
|
108
106
|
m(s, f(o.$props, {
|
|
109
107
|
items: o.countryItems,
|
|
110
108
|
onInput: o.onInput
|
|
@@ -113,14 +111,14 @@ function S(o, e, p, r, t, a) {
|
|
|
113
111
|
m(n, {
|
|
114
112
|
code: c,
|
|
115
113
|
label: i,
|
|
116
|
-
variant:
|
|
117
|
-
}, null, 8, ["code", "label"
|
|
114
|
+
variant: "custom"
|
|
115
|
+
}, null, 8, ["code", "label"])
|
|
118
116
|
]),
|
|
119
117
|
_: 1
|
|
120
118
|
}, 16, ["items", "onInput"])
|
|
121
119
|
]);
|
|
122
120
|
}
|
|
123
|
-
const Q = /* @__PURE__ */ w(P, [["render",
|
|
121
|
+
const Q = /* @__PURE__ */ w(P, [["render", L]]), R = _({
|
|
124
122
|
name: "b-dropdown-currency",
|
|
125
123
|
components: {
|
|
126
124
|
BentoDropdown: d,
|
|
@@ -147,7 +145,7 @@ const Q = /* @__PURE__ */ w(P, [["render", S]]), U = _({
|
|
|
147
145
|
};
|
|
148
146
|
}
|
|
149
147
|
});
|
|
150
|
-
function
|
|
148
|
+
function S(o, e, p, r, t, a) {
|
|
151
149
|
const n = u("listbox-option-tag"), s = u("bento-dropdown");
|
|
152
150
|
return l(), v(s, f(o.$props, { onInput: o.onInput }), {
|
|
153
151
|
default: y((c) => [
|
|
@@ -156,11 +154,11 @@ function V(o, e, p, r, t, a) {
|
|
|
156
154
|
_: 1
|
|
157
155
|
}, 16, ["onInput"]);
|
|
158
156
|
}
|
|
159
|
-
const W = /* @__PURE__ */ w(
|
|
157
|
+
const W = /* @__PURE__ */ w(R, [["render", S]]), U = _({
|
|
160
158
|
name: "bento-dropdown-payment-method",
|
|
161
159
|
components: {
|
|
162
160
|
BentoDropdown: d,
|
|
163
|
-
BentoPaymentMethod:
|
|
161
|
+
BentoPaymentMethod: M
|
|
164
162
|
},
|
|
165
163
|
props: {
|
|
166
164
|
...d.props,
|
|
@@ -183,9 +181,9 @@ const W = /* @__PURE__ */ w(U, [["render", V]]), L = _({
|
|
|
183
181
|
};
|
|
184
182
|
}
|
|
185
183
|
});
|
|
186
|
-
function
|
|
184
|
+
function V(o, e, p, r, t, a) {
|
|
187
185
|
const n = u("bento-payment-method"), s = u("bento-dropdown");
|
|
188
|
-
return l(),
|
|
186
|
+
return l(), b("div", null, [
|
|
189
187
|
m(s, f(o.$props, { onInput: o.onInput }), {
|
|
190
188
|
default: y(({ value: c, label: i }) => [
|
|
191
189
|
m(n, {
|
|
@@ -197,7 +195,7 @@ function R(o, e, p, r, t, a) {
|
|
|
197
195
|
}, 16, ["onInput"])
|
|
198
196
|
]);
|
|
199
197
|
}
|
|
200
|
-
const X = /* @__PURE__ */ w(
|
|
198
|
+
const X = /* @__PURE__ */ w(U, [["render", V]]), j = _({
|
|
201
199
|
name: "bento-dropdown-tag",
|
|
202
200
|
components: {
|
|
203
201
|
BentoDropdown: d,
|
|
@@ -210,7 +208,7 @@ const X = /* @__PURE__ */ w(L, [["render", R]]), j = _({
|
|
|
210
208
|
* It must be an array of {@see BentoTagListboxOptions }
|
|
211
209
|
* * @property {string} value.label - Text to be displayed in the option
|
|
212
210
|
* * @property {string,number} value.value - Value of the option
|
|
213
|
-
* * @property {
|
|
211
|
+
* * @property {string} value.variant - The BentTag variant shown for the option.
|
|
214
212
|
*/
|
|
215
213
|
items: {
|
|
216
214
|
type: Array,
|
|
@@ -233,7 +231,7 @@ const X = /* @__PURE__ */ w(L, [["render", R]]), j = _({
|
|
|
233
231
|
};
|
|
234
232
|
}
|
|
235
233
|
});
|
|
236
|
-
function
|
|
234
|
+
function x(o, e, p, r, t, a) {
|
|
237
235
|
const n = u("listbox-option-tag"), s = u("bento-dropdown");
|
|
238
236
|
return l(), v(s, f(o.$props, {
|
|
239
237
|
class: "b-dropdown-tag",
|
|
@@ -249,7 +247,7 @@ function E(o, e, p, r, t, a) {
|
|
|
249
247
|
_: 1
|
|
250
248
|
}, 16, ["items", "onInput"]);
|
|
251
249
|
}
|
|
252
|
-
const Y = /* @__PURE__ */ w(j, [["render",
|
|
250
|
+
const Y = /* @__PURE__ */ w(j, [["render", x], ["__scopeId", "data-v-c5f7c077"]]);
|
|
253
251
|
export {
|
|
254
252
|
d as BentoDropdown,
|
|
255
253
|
K as BentoDropdownAvatar,
|