@adyen/bento-vue2 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 -51
- package/dist/@types/packages/vue2/src/components/accordion/components/accordion-item.vue.d.ts +24 -28
- 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 +161 -150
- 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 +77 -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 +4 -6
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +4 -4
- 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 +36 -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 +2 -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 +326 -14
- 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 +1 -21
- 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 +1 -21
- 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 +277 -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-avatar/dropdown-avatar.vue.d.ts +5 -5
- 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 +5 -6
- 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-currency/dropdown-currency.vue.d.ts +5 -5
- 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-payment-method/dropdown-payment-method.vue.d.ts +5 -5
- 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/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +6 -6
- 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 +0 -26
- 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-range-filter/date-range-filter.vue.d.ts +0 -10
- package/dist/@types/packages/vue2/src/components/filter-bar/components/{base-filter/components/filter-bar-filter-button/filter-bar-filter-button.vue.d.ts → filter-bar-button/filter-bar-button.vue.d.ts} +17 -22
- 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/variants/select-country-filter/select-country-filter.vue.d.ts +2 -4
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +2 -4
- 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 +3 -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 +50 -47
- 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/__test__/calendar-month-day-stub.vue.d.ts +1 -1
- 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/controls-group/controls-group.vue.d.ts +1 -1
- 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 -4
- package/dist/@types/packages/vue2/src/components/search-bar/search-bar.vue.d.ts +16 -339
- 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 +4 -7
- package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +5 -9
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +6 -12
- 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 +4 -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/print-development-warning.d.ts +1 -0
- package/dist/accordion.js +69 -177
- package/dist/accordion.js.map +1 -1
- package/dist/alert.js +57 -60
- 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/index23.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 -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 +110 -12
- package/dist/button.js.map +1 -1
- package/dist/card.js +66 -67
- package/dist/card.js.map +1 -1
- package/dist/checkbox.js +27 -26
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.98379576.js → base-button.bd8fa976.js} +24 -27
- package/dist/chunks/base-button.bd8fa976.js.map +1 -0
- package/dist/chunks/base-modal.a365f260.js +207 -0
- package/dist/chunks/base-modal.a365f260.js.map +1 -0
- package/dist/chunks/{button.d0c9527d.js → button.fb307df3.js} +36 -39
- package/dist/chunks/button.fb307df3.js.map +1 -0
- package/dist/chunks/{calendar.0ae43a96.js → calendar.79ea42c1.js} +214 -217
- package/dist/chunks/calendar.79ea42c1.js.map +1 -0
- package/dist/chunks/checkbox.c7d791ed.js +173 -0
- package/dist/chunks/checkbox.c7d791ed.js.map +1 -0
- package/dist/chunks/{chevron-down.b851a6da.js → chevron-up.674ec2e5.js} +8 -8
- package/dist/chunks/chevron-up.674ec2e5.js.map +1 -0
- package/dist/chunks/{controls-group.b827382b.js → controls-group.5d3e04dd.js} +20 -20
- package/dist/chunks/controls-group.5d3e04dd.js.map +1 -0
- package/dist/chunks/{copy.5a4cbd4d.js → copy.ac796536.js} +37 -38
- package/dist/chunks/copy.ac796536.js.map +1 -0
- package/dist/chunks/{dropdown-default-textbox.819e43f7.js → dropdown-default-textbox.109c36d2.js} +38 -40
- package/dist/chunks/dropdown-default-textbox.109c36d2.js.map +1 -0
- package/dist/chunks/{dropdown.c05678d0.js → dropdown.fd93f0ce.js} +351 -335
- package/dist/chunks/dropdown.fd93f0ce.js.map +1 -0
- package/dist/chunks/error-message.3b3c33d4.js +47 -0
- package/dist/chunks/error-message.3b3c33d4.js.map +1 -0
- package/dist/chunks/{footer-actions.67642347.js → footer-actions.f02e8699.js} +23 -23
- package/dist/chunks/footer-actions.f02e8699.js.map +1 -0
- package/dist/chunks/get-slot-text.c1114034.js +9 -0
- package/dist/chunks/get-slot-text.c1114034.js.map +1 -0
- package/dist/chunks/{grid-layout.73f23b1b.js → grid-layout.b7e0d964.js} +2 -2
- package/dist/chunks/{grid-layout.73f23b1b.js.map → grid-layout.b7e0d964.js.map} +1 -1
- package/dist/chunks/{index.56858f4e.js → index.45295dd3.js} +23 -19
- package/dist/chunks/index.45295dd3.js.map +1 -0
- package/dist/chunks/{index.10aaf539.js → index.88ff49c2.js} +136 -142
- package/dist/chunks/index.88ff49c2.js.map +1 -0
- package/dist/chunks/{index.73d50fa6.js → index.9902cae4.js} +65 -68
- package/dist/chunks/{index.73d50fa6.js.map → index.9902cae4.js.map} +1 -1
- package/dist/chunks/{index.0cf00b47.js → index.bd734551.js} +35 -37
- package/dist/chunks/index.bd734551.js.map +1 -0
- package/dist/chunks/{index.133e4da0.js → index.c85a1ab9.js} +81 -79
- package/dist/chunks/{index.133e4da0.js.map → index.c85a1ab9.js.map} +1 -1
- package/dist/chunks/{index.f0f8ed98.js → index.c8f81673.js} +23 -26
- package/dist/chunks/index.c8f81673.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.8d6cccac.js → listbox-option-tag.ec42431b.js} +32 -36
- package/dist/chunks/listbox-option-tag.ec42431b.js.map +1 -0
- package/dist/chunks/{listbox.116ed0c1.js → listbox.e792d2d6.js} +244 -251
- package/dist/chunks/listbox.e792d2d6.js.map +1 -0
- package/dist/chunks/loading-button.429c8416.js +86 -0
- package/dist/chunks/loading-button.429c8416.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.2aff4fa6.js → tooltip.a47ace87.js} +49 -52
- package/dist/chunks/tooltip.a47ace87.js.map +1 -0
- package/dist/chunks/use-default-slot-validator.cbdfe693.js +13 -0
- package/dist/chunks/use-default-slot-validator.cbdfe693.js.map +1 -0
- package/dist/chunks/use-has-slot.6052d56a.js +6 -0
- package/dist/chunks/use-has-slot.6052d56a.js.map +1 -0
- package/dist/code-snippet.js +469 -413
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +492 -494
- package/dist/country.js.map +1 -1
- package/dist/currency.js +32 -35
- package/dist/currency.js.map +1 -1
- package/dist/data-grid.js +595 -603
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +76 -80
- package/dist/date-picker.js.map +1 -1
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +1 -1
- package/dist/dropdown.js +37 -39
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +134 -0
- package/dist/empty-state.js.map +1 -0
- package/dist/filter-bar.js +648 -638
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +64 -64
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +61 -63
- package/dist/header.js.map +1 -1
- package/dist/image.js +82 -0
- package/dist/image.js.map +1 -0
- package/dist/index.js +216 -205
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +2 -2
- package/dist/input-field.js +99 -123
- package/dist/input-field.js.map +1 -1
- package/dist/internal.js +7 -7
- package/dist/link.js +27 -26
- package/dist/link.js.map +1 -1
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +96 -104
- package/dist/menu.js.map +1 -1
- package/dist/modal.js +111 -264
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +148 -145
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +16 -18
- package/dist/payment-method.js.map +1 -1
- package/dist/popover.js +58 -54
- package/dist/popover.js.map +1 -1
- package/dist/popper-container.js +13 -17
- package/dist/popper-container.js.map +1 -1
- package/dist/radio-group.js +71 -72
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +54 -66
- package/dist/search-bar.js.map +1 -1
- package/dist/segmented-control.js +68 -55
- package/dist/segmented-control.js.map +1 -1
- package/dist/sidepanel.js +65 -64
- package/dist/sidepanel.js.map +1 -1
- package/dist/status.js +20 -23
- package/dist/status.js.map +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +110 -141
- package/dist/summary-grid.js.map +1 -1
- package/dist/tabs.js +68 -60
- package/dist/tabs.js.map +1 -1
- package/dist/tag.js +23 -26
- package/dist/tag.js.map +1 -1
- package/dist/textarea.js +97 -96
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +125 -125
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +44 -48
- package/dist/toast.js.map +1 -1
- package/dist/toggle.js +54 -52
- package/dist/toggle.js.map +1 -1
- package/dist/typography.js +1 -1
- package/dist/web-types.json +651 -397
- package/package.json +9 -12
- 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/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.98379576.js.map +0 -1
- package/dist/chunks/button-actions.bd397c79.js +0 -104
- package/dist/chunks/button-actions.bd397c79.js.map +0 -1
- package/dist/chunks/button.d0c9527d.js.map +0 -1
- package/dist/chunks/calendar.0ae43a96.js.map +0 -1
- package/dist/chunks/checkbox.f8457c93.js +0 -164
- package/dist/chunks/checkbox.f8457c93.js.map +0 -1
- package/dist/chunks/chevron-down.b851a6da.js.map +0 -1
- package/dist/chunks/controls-group.b827382b.js.map +0 -1
- package/dist/chunks/copy.5a4cbd4d.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.819e43f7.js.map +0 -1
- package/dist/chunks/dropdown.c05678d0.js.map +0 -1
- package/dist/chunks/error-message.0433b539.js +0 -47
- package/dist/chunks/error-message.0433b539.js.map +0 -1
- package/dist/chunks/footer-actions.67642347.js.map +0 -1
- package/dist/chunks/get-slot-text.e5c766d0.js +0 -9
- package/dist/chunks/get-slot-text.e5c766d0.js.map +0 -1
- package/dist/chunks/index.0cf00b47.js.map +0 -1
- package/dist/chunks/index.10aaf539.js.map +0 -1
- package/dist/chunks/index.56858f4e.js.map +0 -1
- package/dist/chunks/index.f0f8ed98.js.map +0 -1
- package/dist/chunks/listbox-option-tag.8d6cccac.js.map +0 -1
- package/dist/chunks/listbox.116ed0c1.js.map +0 -1
- package/dist/chunks/loading-button.1c201f87.js +0 -84
- package/dist/chunks/loading-button.1c201f87.js.map +0 -1
- package/dist/chunks/tooltip.2aff4fa6.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,37 +1,37 @@
|
|
|
1
|
-
import { ref as u, computed as p, defineComponent as q, toRef as
|
|
2
|
-
import { c as Y } from "./chunks/dropdown-default-textbox.
|
|
3
|
-
import { BentoPopover as W
|
|
4
|
-
import { g as
|
|
5
|
-
import { B as
|
|
6
|
-
import { u as
|
|
7
|
-
import { f as
|
|
8
|
-
import { e as
|
|
9
|
-
import { D as
|
|
10
|
-
import { d as
|
|
11
|
-
import { u as
|
|
12
|
-
import { C as k } from "./chunks/calendar.
|
|
13
|
-
import { b as
|
|
14
|
-
import { E as
|
|
15
|
-
import { B as
|
|
16
|
-
import { n as
|
|
17
|
-
import "./assets/
|
|
1
|
+
import { ref as u, computed as p, defineComponent as q, toRef as x, watch as L, nextTick as E } from "vue";
|
|
2
|
+
import { c as Y } from "./chunks/dropdown-default-textbox.109c36d2.js";
|
|
3
|
+
import { BentoPopover as W } from "./popover.js";
|
|
4
|
+
import { g as d } from "./chunks/unique-id.a2a2b458.js";
|
|
5
|
+
import { B as $ } from "./chunks/index.45295dd3.js";
|
|
6
|
+
import { u as B } from "./chunks/i18n.155748d6.js";
|
|
7
|
+
import { f as O } from "./chunks/index.9902cae4.js";
|
|
8
|
+
import { e as y, d as K, f as j } from "./chunks/index.f55fdc32.js";
|
|
9
|
+
import { D as T, v as z, f as G } from "./chunks/date-input.9186a0bf.js";
|
|
10
|
+
import { d as H } from "./chunks/debounce.f8d92e44.js";
|
|
11
|
+
import { u as J } from "./chunks/use-form-layout-loading.d03e5d48.js";
|
|
12
|
+
import { C as k } from "./chunks/calendar.79ea42c1.js";
|
|
13
|
+
import { b as Be } from "./chunks/calendar.79ea42c1.js";
|
|
14
|
+
import { E as Q } from "./chunks/error-message.3b3c33d4.js";
|
|
15
|
+
import { B as X } from "./chunks/directive.0408e565.js";
|
|
16
|
+
import { n as Z } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
17
|
+
import "./assets/index12.css";
|
|
18
18
|
var l = /* @__PURE__ */ ((a) => (a.INPUT = "input", a))(l || {});
|
|
19
|
-
const
|
|
20
|
-
const { locale: t, t: n } =
|
|
19
|
+
const ee = ({ datePickerValue: a, isDateIncorrect: e }) => {
|
|
20
|
+
const { locale: t, t: n } = B(), f = { de: K, enUS: y, fr: j }, s = u(null);
|
|
21
21
|
return {
|
|
22
22
|
// Values
|
|
23
|
-
dateDisplayValue: p(() => e.value ?
|
|
24
|
-
locale: f[t.value.substring(0, 2)] ||
|
|
23
|
+
dateDisplayValue: p(() => e.value ? s.value : a.value ? O(a.value, T.FULL_DATE, {
|
|
24
|
+
locale: f[t.value.substring(0, 2)] || y
|
|
25
25
|
}) : n("selectDate")),
|
|
26
|
-
textInputValue:
|
|
26
|
+
textInputValue: s,
|
|
27
27
|
// Methods
|
|
28
28
|
formatTextInputDisplayValue: (D = a.value) => {
|
|
29
|
-
e.value || (
|
|
30
|
-
locale: f[t.value.substring(0, 2)] ||
|
|
29
|
+
e.value || (s.value = D ? O(D, T.NUMERIC_DATE_YEAR_FIRST, {
|
|
30
|
+
locale: f[t.value.substring(0, 2)] || y
|
|
31
31
|
}) : null);
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
},
|
|
34
|
+
}, ae = {
|
|
35
35
|
"en-US": {
|
|
36
36
|
optional: "optional",
|
|
37
37
|
required: "required",
|
|
@@ -41,17 +41,17 @@ const re = ({ datePickerValue: a, isDateIncorrect: e }) => {
|
|
|
41
41
|
selectedDateIsNotAvailable: "Selected date is not available",
|
|
42
42
|
datePicker: "Date picker"
|
|
43
43
|
}
|
|
44
|
-
},
|
|
45
|
-
i18n: { messages:
|
|
44
|
+
}, te = 1e3, re = q({
|
|
45
|
+
i18n: { messages: ae },
|
|
46
46
|
name: "bento-date-picker",
|
|
47
47
|
components: {
|
|
48
|
-
BentoTypography:
|
|
48
|
+
BentoTypography: $,
|
|
49
49
|
BentoPopover: W,
|
|
50
50
|
Calendar: k,
|
|
51
|
-
ErrorMessage:
|
|
51
|
+
ErrorMessage: Q,
|
|
52
52
|
DropdownInputDefault: Y
|
|
53
53
|
},
|
|
54
|
-
directives: { BentoClickOutsideDirective:
|
|
54
|
+
directives: { BentoClickOutsideDirective: X },
|
|
55
55
|
props: {
|
|
56
56
|
/**
|
|
57
57
|
* Descriptive supporting text visbile underneath the dropdown.
|
|
@@ -96,96 +96,92 @@ const re = ({ datePickerValue: a, isDateIncorrect: e }) => {
|
|
|
96
96
|
},
|
|
97
97
|
emits: [l.INPUT],
|
|
98
98
|
setup(a, { emit: e }) {
|
|
99
|
-
const { t } =
|
|
99
|
+
const { t } = B(), n = d("bento-date-picker-container"), f = d("bento-date-picker-label"), s = d("bento-date-picker-description"), b = d("bento-date-picker-error"), m = d("bento-date-picker-date-error"), D = p(() => a.label || t("datePicker", { name: n })), g = u(null), R = u(null), o = u(!1), i = u(!1), { isReadOnly: S } = J(x(a, "readonly"));
|
|
100
100
|
L(
|
|
101
101
|
() => a.disabled,
|
|
102
102
|
(r) => {
|
|
103
|
-
r &&
|
|
103
|
+
r && i.value && (i.value = !1);
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
|
-
const { dateDisplayValue:
|
|
107
|
-
datePickerValue:
|
|
106
|
+
const { dateDisplayValue: w, textInputValue: c, formatTextInputDisplayValue: I } = ee({
|
|
107
|
+
datePickerValue: x(a, "value"),
|
|
108
108
|
isDateIncorrect: o
|
|
109
|
-
}), v = p(() => a.isDateDisabled && a.isDateDisabled(new Date(
|
|
109
|
+
}), v = p(() => a.isDateDisabled && a.isDateDisabled(new Date(c.value)) ? t("selectedDateIsNotAvailable") : o.value ? t("provideDateInAFormat") : null), V = p(() => ({
|
|
110
110
|
"b-date-picker__description--error": a.errorMessage || v.value
|
|
111
|
-
})),
|
|
112
|
-
() => `${a.description ?
|
|
113
|
-
),
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
111
|
+
})), U = p(
|
|
112
|
+
() => `${a.description ? s : ""} ${a.errorMessage ? b : ""} ${v.value ? m : ""}`.trim() || null
|
|
113
|
+
), h = (r) => a.isDateDisabled ? !a.isDateDisabled(r) : !0, C = () => {
|
|
114
|
+
i.value = !1;
|
|
115
|
+
}, P = () => {
|
|
116
|
+
i.value = !0, I();
|
|
117
|
+
}, N = (r) => {
|
|
118
|
+
o.value = !1, C(), e(l.INPUT, r);
|
|
119
|
+
}, M = async () => {
|
|
120
|
+
o.value && (o.value = !1, c.value = null), e(l.INPUT, null);
|
|
117
121
|
}, A = (r) => {
|
|
118
|
-
|
|
119
|
-
},
|
|
120
|
-
o.value && (o.value = !1, d.value = null), e(l.INPUT, null);
|
|
121
|
-
}, M = (r) => {
|
|
122
|
-
J(r);
|
|
123
|
-
}, F = X((r) => {
|
|
122
|
+
z(r);
|
|
123
|
+
}, F = H((r) => {
|
|
124
124
|
if (r.length < 10)
|
|
125
125
|
return;
|
|
126
|
-
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(r) &&
|
|
127
|
-
},
|
|
126
|
+
/^\d{4}-(0?[1-9]|1[012])-(0?[1-9]|[12][0-9]|3[01])$/.test(r) && h(new Date(r)) ? (o.value = !1, e(l.INPUT, new Date(r))) : r && (o.value = !0, e(l.INPUT, null));
|
|
127
|
+
}, te);
|
|
128
128
|
return {
|
|
129
129
|
// Refs
|
|
130
|
-
inputContainerRef:
|
|
130
|
+
inputContainerRef: R,
|
|
131
131
|
calendarContainerRef: g,
|
|
132
132
|
// Values,
|
|
133
|
-
dateDisplayValue:
|
|
133
|
+
dateDisplayValue: w,
|
|
134
134
|
datePickerContainerId: n,
|
|
135
|
-
descriptionConditionalClasses:
|
|
135
|
+
descriptionConditionalClasses: V,
|
|
136
136
|
isDateIncorrect: o,
|
|
137
|
-
isDatePickerOpen:
|
|
138
|
-
isReadOnly:
|
|
137
|
+
isDatePickerOpen: i,
|
|
138
|
+
isReadOnly: S,
|
|
139
139
|
dateErrorText: v,
|
|
140
140
|
labelId: f,
|
|
141
|
-
descriptionId:
|
|
142
|
-
errorId:
|
|
143
|
-
dateErrorId:
|
|
141
|
+
descriptionId: s,
|
|
142
|
+
errorId: b,
|
|
143
|
+
dateErrorId: m,
|
|
144
144
|
popoverAriaLabel: D,
|
|
145
|
-
ariaDescribedBy:
|
|
146
|
-
textInputValue:
|
|
147
|
-
// Enums
|
|
148
|
-
BentoTypographyElement: j,
|
|
149
|
-
BentoTypographyVariant: z,
|
|
150
|
-
BentoPopoverPositions: $,
|
|
145
|
+
ariaDescribedBy: U,
|
|
146
|
+
textInputValue: c,
|
|
151
147
|
// Events
|
|
152
|
-
closeDatePicker:
|
|
153
|
-
clearDatePickerValue:
|
|
154
|
-
onDateSelected:
|
|
155
|
-
openDatePicker:
|
|
156
|
-
onDateKeyDown:
|
|
148
|
+
closeDatePicker: C,
|
|
149
|
+
clearDatePickerValue: M,
|
|
150
|
+
onDateSelected: N,
|
|
151
|
+
openDatePicker: P,
|
|
152
|
+
onDateKeyDown: A,
|
|
157
153
|
onDateInputChange: (r) => {
|
|
158
|
-
|
|
154
|
+
c.value = G(r), F(c.value);
|
|
159
155
|
},
|
|
160
156
|
// Keyboard navigation
|
|
161
157
|
onSpaceBarOrEnter: async (r) => {
|
|
162
|
-
var
|
|
163
|
-
|
|
158
|
+
var _;
|
|
159
|
+
i.value || (r.preventDefault(), P(), await E(), a.value || (I(/* @__PURE__ */ new Date()), e(l.INPUT, /* @__PURE__ */ new Date()), await E()), (_ = g.value) == null || _.$refs.calendarRef[0].focusOnDate(a.value));
|
|
164
160
|
}
|
|
165
161
|
};
|
|
166
162
|
}
|
|
167
163
|
});
|
|
168
|
-
var
|
|
164
|
+
var ne = function() {
|
|
169
165
|
var e = this, t = e._self._c;
|
|
170
166
|
return e._self._setupProxy, t("div", { directives: [{ name: "bento-click-outside-directive", rawName: "v-bento-click-outside-directive", value: e.closeDatePicker, expression: "closeDatePicker" }], staticClass: "b-date-picker", on: { "!keydown": [function(n) {
|
|
171
167
|
return !n.type.indexOf("key") && e._k(n.keyCode, "space", 32, n.key, [" ", "Spacebar"]) ? null : e.onSpaceBarOrEnter.apply(null, arguments);
|
|
172
168
|
}, function(n) {
|
|
173
169
|
return !n.type.indexOf("key") && e._k(n.keyCode, "enter", 13, n.key, "Enter") ? null : e.onSpaceBarOrEnter.apply(null, arguments);
|
|
174
|
-
}] } }, [e.label ? t("div", { staticClass: "b-date-picker__label", attrs: { id: e.labelId } }, [t("bento-typography", { attrs: { el:
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
}] } }, [e.label ? t("div", { staticClass: "b-date-picker__label", attrs: { id: e.labelId } }, [t("bento-typography", { attrs: { el: "span", stronger: "" } }, [e._v(e._s(e.label))]), e.optional ? t("bento-typography", { staticClass: "b-date-picker__label-requirement", attrs: { el: "span" } }, [e._v(" (" + e._s(e.$t("optional")) + ") ")]) : e._e(), e.required ? t("bento-typography", { staticClass: "b-date-picker__label-requirement", attrs: { el: "span" } }, [e._v(" (" + e._s(e.$t("required")) + ") ")]) : e._e()], 1) : e._e(), t("div", [t("dropdown-input-default", { ref: "inputContainerRef", attrs: { ariaControls: e.datePickerContainerId, ariaExpanded: e.isDatePickerOpen, "aria-labelledby": e.label ? e.labelId : null, "aria-describedby": e.ariaDescribedBy, disabled: e.disabled, "dynamic-filtering": "", "is-invalid": !!e.errorMessage || !!e.dateErrorText, open: e.isDatePickerOpen, value: e.textInputValue, "display-value": e.dateDisplayValue, "debounce-time": 0, readonly: e.isReadOnly }, on: { input: e.onDateInputChange, open: e.openDatePicker, keydown: e.onDateKeyDown, clear: e.clearDatePickerValue, close: e.closeDatePicker } })], 1), e.dateErrorText ? t("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.dateErrorId, "error-message": e.dateErrorText } }) : e._e(), e.errorMessage ? t("error-message", { staticClass: "b-date-picker__error-message", attrs: { id: e.errorId, "error-message": e.errorMessage } }) : e._e(), e.description ? t("bento-typography", { staticClass: "b-date-picker__description", class: e.descriptionConditionalClasses, attrs: { el: "span" } }, [e._v(" " + e._s(e.description) + " ")]) : e._e(), e.inputContainerRef ? t("bento-popover", { staticClass: "b-date-picker__container", attrs: { id: e.datePickerContainerId, role: "dialog", open: e.isDatePickerOpen, "target-element": e.inputContainerRef, "disable-focus-trap": !0, "aria-label": e.popoverAriaLabel, "aria-modal": !0, position: "bottom-start", "fit-content": "" } }, [t("calendar", { ref: "calendarContainerRef", attrs: { "first-day-of-week": e.firstDayOfWeek, "is-date-disabled": e.isDateDisabled, "number-of-months": 1, value: e.value }, on: { input: e.onDateSelected } })], 1) : e._e()], 1);
|
|
171
|
+
}, oe = [], le = /* @__PURE__ */ Z(
|
|
172
|
+
re,
|
|
173
|
+
ne,
|
|
174
|
+
oe,
|
|
179
175
|
!1,
|
|
180
176
|
null,
|
|
181
|
-
"
|
|
177
|
+
"6ac76f3e",
|
|
182
178
|
null,
|
|
183
179
|
null
|
|
184
180
|
);
|
|
185
|
-
const xe =
|
|
181
|
+
const xe = le.exports;
|
|
186
182
|
export {
|
|
187
183
|
xe as BentoDatePicker,
|
|
188
184
|
l as BentoDatePickerEvent,
|
|
189
|
-
|
|
185
|
+
Be as BentoDatePickerFirstDayOfWeek
|
|
190
186
|
};
|
|
191
187
|
//# sourceMappingURL=date-picker.js.map
|
package/dist/date-picker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sources":["../src/components/date-picker/date-picker.types.ts","../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../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"],"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,GAAA,MAAAC,GAAA,IAAAC,EAAA,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;;;;;;;;;;GC4DAQ,KAAA,KA6BAC,KAAAC,EAAA;AAAA,EAAA,MAAA,EAAA,UAAAC,GAAA;AAAA,EACA,MAAA;AAAA,EACA,YAAA;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,cAAAC;AAAA,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;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"date-picker.js","sources":["../src/components/date-picker/date-picker.types.ts","../src/components/date-picker/composables/use-date-picker-single-calendar-text.ts","../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"],"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,GAAA,MAAAC,GAAA,IAAAC,EAAA,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,yBAA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A,MAAAW,EAAA,GAGApC,EAAA,UAEAkB,EAAA,oBAAA,KAAA,CAAA,GACAjB,EAAA7B,EAAA,OAAA,oBAAA,KAAA,CAAA,GAGA,MAAAgE,EAAA,KAIAC,IAAA5B,EAAA,UAAA,QAAA4B,EAAA,MAAA,YAAA,GAAA,YAAArC,EAAA;AAAA,MAAA;AAAA,IAiCA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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.88ff49c2.js";
|
|
2
|
+
import { b as o } from "./chunks/calendar.79ea42c1.js";
|
|
3
3
|
export {
|
|
4
4
|
t as BentoDateRangePicker,
|
|
5
5
|
r as BentoDateRangePickerEvent,
|
package/dist/date.js
CHANGED
package/dist/divider.js
CHANGED
package/dist/dropdown.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { B as s } from "./chunks/dropdown.
|
|
2
|
-
import { defineComponent as u, computed as
|
|
3
|
-
import { B as y, L as
|
|
1
|
+
import { B as s } from "./chunks/dropdown.fd93f0ce.js";
|
|
2
|
+
import { defineComponent as u, computed as l, toRefs as m, provide as f } from "vue";
|
|
3
|
+
import { B as y, L as c } from "./chunks/listbox-option-tag.ec42431b.js";
|
|
4
4
|
import { n as d } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
5
|
-
import { BentoCountry as v, BentoCountryVariant as
|
|
6
|
-
import { u as
|
|
7
|
-
import { d as
|
|
5
|
+
import { BentoCountry as v, BentoCountryVariant as _ } from "./country.js";
|
|
6
|
+
import { u as w } from "./chunks/useCountryItems.5d7b436e.js";
|
|
7
|
+
import { d as b } from "./chunks/index.45295dd3.js";
|
|
8
8
|
import { BentoPaymentMethod as I } from "./payment-method.js";
|
|
9
|
-
import "./assets/
|
|
9
|
+
import "./assets/index8.css";
|
|
10
10
|
const $ = u({
|
|
11
11
|
name: "bento-dropdown-avatar",
|
|
12
12
|
components: {
|
|
@@ -32,7 +32,7 @@ const $ = u({
|
|
|
32
32
|
const n = (e) => t("input", e);
|
|
33
33
|
return {
|
|
34
34
|
// Values
|
|
35
|
-
dropdownItems:
|
|
35
|
+
dropdownItems: l(
|
|
36
36
|
() => r.items.map(({ value: e, label: a, src: p }) => ({ value: e, label: a, data: p }))
|
|
37
37
|
),
|
|
38
38
|
// Methods
|
|
@@ -45,17 +45,17 @@ var B = function() {
|
|
|
45
45
|
return t._self._setupProxy, n("div", [n("bento-dropdown", t._b({ attrs: { items: t.dropdownItems }, on: { input: t.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ label: o, data: e }) {
|
|
46
46
|
return [n("bento-avatar", { attrs: { username: o, src: e } })];
|
|
47
47
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
48
|
-
},
|
|
48
|
+
}, x = [], g = /* @__PURE__ */ d(
|
|
49
49
|
$,
|
|
50
50
|
B,
|
|
51
|
-
|
|
51
|
+
x,
|
|
52
52
|
!1,
|
|
53
53
|
null,
|
|
54
54
|
null,
|
|
55
55
|
null,
|
|
56
56
|
null
|
|
57
57
|
);
|
|
58
|
-
const Q =
|
|
58
|
+
const Q = g.exports, C = u({
|
|
59
59
|
name: "b-dropdown-country",
|
|
60
60
|
components: {
|
|
61
61
|
BentoDropdown: s,
|
|
@@ -67,7 +67,7 @@ const Q = x.exports, g = u({
|
|
|
67
67
|
* The option elements to populate the country dropdown with.
|
|
68
68
|
* It must be an array of {@see BentoCountryListboxOptions }
|
|
69
69
|
* * @deprecated {string} value.label - Use BentoDropdown instead of custom labels
|
|
70
|
-
* * @property {BentoCountryCode} value.value - Country code of the option
|
|
70
|
+
* * @property {BentoCountryCode | string} value.value - Country code of the option
|
|
71
71
|
*/
|
|
72
72
|
items: {
|
|
73
73
|
type: Array,
|
|
@@ -79,14 +79,14 @@ const Q = x.exports, g = u({
|
|
|
79
79
|
*/
|
|
80
80
|
variant: {
|
|
81
81
|
type: String,
|
|
82
|
-
default:
|
|
83
|
-
validator: (r) => Object.values(
|
|
82
|
+
default: _.CUSTOM,
|
|
83
|
+
validator: (r) => Object.values(_).includes(r)
|
|
84
84
|
}
|
|
85
85
|
},
|
|
86
86
|
emits: ["input"],
|
|
87
87
|
setup(r, { emit: t }) {
|
|
88
|
-
const { variant: n, items: o } = m(r), e = (p) => t("input", p), a =
|
|
89
|
-
return f("skipBentoCountryDeprecateMessage", !0), (n.value === "custom" || o.value.some((p) => p.label)) &&
|
|
88
|
+
const { variant: n, items: o } = m(r), e = (p) => t("input", p), a = w(n, o);
|
|
89
|
+
return f("skipBentoCountryDeprecateMessage", !0), (n.value === "custom" || o.value.some((p) => p.label)) && b(
|
|
90
90
|
'BentoDropdownCountry "custom" variant and "items" prop "label" key',
|
|
91
91
|
"Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels",
|
|
92
92
|
"2.0.0"
|
|
@@ -94,19 +94,17 @@ const Q = x.exports, g = u({
|
|
|
94
94
|
// Values
|
|
95
95
|
countryItems: a,
|
|
96
96
|
// Methods
|
|
97
|
-
onInput: e
|
|
98
|
-
// Enums
|
|
99
|
-
BentoCountryVariant: c
|
|
97
|
+
onInput: e
|
|
100
98
|
};
|
|
101
99
|
}
|
|
102
100
|
});
|
|
103
101
|
var h = function() {
|
|
104
102
|
var t = this, n = t._self._c;
|
|
105
103
|
return t._self._setupProxy, n("div", [n("bento-dropdown", t._b({ attrs: { items: t.countryItems }, on: { input: t.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ value: o, label: e }) {
|
|
106
|
-
return [n("bento-country", { attrs: { code: o, label: e, variant:
|
|
104
|
+
return [n("bento-country", { attrs: { code: o, label: e, variant: "custom" } })];
|
|
107
105
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
108
106
|
}, D = [], A = /* @__PURE__ */ d(
|
|
109
|
-
|
|
107
|
+
C,
|
|
110
108
|
h,
|
|
111
109
|
D,
|
|
112
110
|
!1,
|
|
@@ -119,7 +117,7 @@ const W = A.exports, P = u({
|
|
|
119
117
|
name: "b-dropdown-currency",
|
|
120
118
|
components: {
|
|
121
119
|
BentoDropdown: s,
|
|
122
|
-
ListboxOptionTag:
|
|
120
|
+
ListboxOptionTag: c
|
|
123
121
|
},
|
|
124
122
|
props: {
|
|
125
123
|
...s.props,
|
|
@@ -142,22 +140,22 @@ const W = A.exports, P = u({
|
|
|
142
140
|
};
|
|
143
141
|
}
|
|
144
142
|
});
|
|
145
|
-
var
|
|
143
|
+
var k = function() {
|
|
146
144
|
var t = this, n = t._self._c;
|
|
147
145
|
return t._self._setupProxy, n("bento-dropdown", t._b({ on: { input: t.onInput }, scopedSlots: t._u([{ key: "default", fn: function(o) {
|
|
148
146
|
return [n("listbox-option-tag", { attrs: { option: o } })];
|
|
149
147
|
} }]) }, "bento-dropdown", t.$props, !1));
|
|
150
|
-
},
|
|
148
|
+
}, R = [], S = /* @__PURE__ */ d(
|
|
151
149
|
P,
|
|
152
|
-
S,
|
|
153
150
|
k,
|
|
151
|
+
R,
|
|
154
152
|
!1,
|
|
155
153
|
null,
|
|
156
154
|
null,
|
|
157
155
|
null,
|
|
158
156
|
null
|
|
159
157
|
);
|
|
160
|
-
const X =
|
|
158
|
+
const X = S.exports, F = u({
|
|
161
159
|
name: "bento-dropdown-payment-method",
|
|
162
160
|
components: {
|
|
163
161
|
BentoDropdown: s,
|
|
@@ -184,26 +182,26 @@ const X = R.exports, M = u({
|
|
|
184
182
|
};
|
|
185
183
|
}
|
|
186
184
|
});
|
|
187
|
-
var
|
|
185
|
+
var M = function() {
|
|
188
186
|
var t = this, n = t._self._c;
|
|
189
187
|
return t._self._setupProxy, n("div", [n("bento-dropdown", t._b({ on: { input: t.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ value: o, label: e }) {
|
|
190
188
|
return [n("bento-payment-method", { attrs: { type: o, label: e } })];
|
|
191
189
|
} }]) }, "bento-dropdown", t.$props, !1))], 1);
|
|
192
|
-
},
|
|
190
|
+
}, T = [], O = /* @__PURE__ */ d(
|
|
191
|
+
F,
|
|
193
192
|
M,
|
|
194
193
|
T,
|
|
195
|
-
F,
|
|
196
194
|
!1,
|
|
197
195
|
null,
|
|
198
196
|
null,
|
|
199
197
|
null,
|
|
200
198
|
null
|
|
201
199
|
);
|
|
202
|
-
const Y = O.exports,
|
|
200
|
+
const Y = O.exports, L = u({
|
|
203
201
|
name: "bento-dropdown-tag",
|
|
204
202
|
components: {
|
|
205
203
|
BentoDropdown: s,
|
|
206
|
-
ListboxOptionTag:
|
|
204
|
+
ListboxOptionTag: c
|
|
207
205
|
},
|
|
208
206
|
props: {
|
|
209
207
|
...s.props,
|
|
@@ -212,7 +210,7 @@ const Y = O.exports, U = u({
|
|
|
212
210
|
* It must be an array of {@see BentoTagListboxOptions }
|
|
213
211
|
* * @property {string} value.label - Text to be displayed in the option
|
|
214
212
|
* * @property {string,number} value.value - Value of the option
|
|
215
|
-
* * @property {
|
|
213
|
+
* * @property {string} value.variant - The BentTag variant shown for the option.
|
|
216
214
|
*/
|
|
217
215
|
items: {
|
|
218
216
|
type: Array,
|
|
@@ -224,7 +222,7 @@ const Y = O.exports, U = u({
|
|
|
224
222
|
const n = (e) => t("input", e);
|
|
225
223
|
return {
|
|
226
224
|
// Values
|
|
227
|
-
tagItems:
|
|
225
|
+
tagItems: l(
|
|
228
226
|
() => {
|
|
229
227
|
var e;
|
|
230
228
|
return (e = r.items) == null ? void 0 : e.map(({ label: a, value: p, variant: i }) => ({ label: a, value: p, data: i }));
|
|
@@ -235,22 +233,22 @@ const Y = O.exports, U = u({
|
|
|
235
233
|
};
|
|
236
234
|
}
|
|
237
235
|
});
|
|
238
|
-
var
|
|
236
|
+
var U = function() {
|
|
239
237
|
var t = this, n = t._self._c;
|
|
240
238
|
return t._self._setupProxy, n("bento-dropdown", t._b({ staticClass: "b-dropdown-tag", attrs: { items: t.tagItems, "show-slot-content-in-multiple": "" }, on: { input: t.onInput }, scopedSlots: t._u([{ key: "default", fn: function({ label: o, data: e }) {
|
|
241
239
|
return [n("listbox-option-tag", { attrs: { option: { value: o, data: e, label: "" } } })];
|
|
242
240
|
} }]) }, "bento-dropdown", t.$props, !1));
|
|
243
|
-
},
|
|
244
|
-
U,
|
|
241
|
+
}, j = [], z = /* @__PURE__ */ d(
|
|
245
242
|
L,
|
|
246
|
-
|
|
243
|
+
U,
|
|
244
|
+
j,
|
|
247
245
|
!1,
|
|
248
246
|
null,
|
|
249
|
-
"
|
|
247
|
+
"84d1d030",
|
|
250
248
|
null,
|
|
251
249
|
null
|
|
252
250
|
);
|
|
253
|
-
const Z =
|
|
251
|
+
const Z = z.exports;
|
|
254
252
|
export {
|
|
255
253
|
s as BentoDropdown,
|
|
256
254
|
Q as BentoDropdownAvatar,
|