@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/sidepanel.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import { B as
|
|
4
|
-
import { F as $ } from "./chunks/footer-actions.
|
|
1
|
+
import { defineComponent as L, ref as r, inject as B, onUnmounted as V, computed as p, watch as h, nextTick as N, toRefs as F, provide as O } from "vue";
|
|
2
|
+
import { a as w } from "./chunks/button.fb307df3.js";
|
|
3
|
+
import { B as G } from "./chunks/index.45295dd3.js";
|
|
4
|
+
import { F as $ } from "./chunks/footer-actions.f02e8699.js";
|
|
5
5
|
import { A as H } from "./chunks/arrow-left.1d5d08bd.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { n as
|
|
8
|
-
import { B as
|
|
9
|
-
import { C as
|
|
10
|
-
import "./assets/
|
|
11
|
-
var
|
|
12
|
-
const
|
|
6
|
+
import { u as R } from "./chunks/i18n.155748d6.js";
|
|
7
|
+
import { n as k } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
8
|
+
import { B as j } from "./chunks/index.c85a1ab9.js";
|
|
9
|
+
import { C as J } from "./chunks/cross.a2cadac5.js";
|
|
10
|
+
import "./assets/index31.css";
|
|
11
|
+
var T = /* @__PURE__ */ ((l) => (l.UPDATE_ACTIVE_PAGE = "update:active-page", l.UPDATE_IS_OPEN = "update:is-open", l))(T || {}), y = /* @__PURE__ */ ((l) => (l.TRANSITION_LEVEL_DEEPER = "b-sidepanel-page__animation--level-deeper", l.TRANSITION_LEVEL_UPPER = "b-sidepanel-page__animation--level-upper", l))(y || {});
|
|
12
|
+
const D = Symbol("sidepanel registerPage injection key"), x = Symbol("sidepanel config data injection key"), K = {
|
|
13
13
|
"en-US": {
|
|
14
14
|
goToPreviousPage: "Go to previous page"
|
|
15
15
|
}
|
|
16
|
-
},
|
|
17
|
-
i18n: { messages:
|
|
18
|
-
}, z = /* @__PURE__ */
|
|
19
|
-
...
|
|
16
|
+
}, Y = {
|
|
17
|
+
i18n: { messages: K }
|
|
18
|
+
}, z = /* @__PURE__ */ L({
|
|
19
|
+
...Y,
|
|
20
20
|
__name: "sidepanel-page",
|
|
21
21
|
props: {
|
|
22
22
|
/**
|
|
@@ -78,34 +78,34 @@ const k = Symbol("sidepanel registerPage injection key"), D = Symbol("sidepanel
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
setup(l) {
|
|
81
|
-
const a = l, { t } =
|
|
82
|
-
|
|
83
|
-
const { activePage:
|
|
84
|
-
"b-sidepanel-page__header--with-border": o.value && !
|
|
85
|
-
})),
|
|
81
|
+
const a = l, { t } = R(), e = r(null), o = r(!1), P = r(!0), i = r(!1), u = B(D), { unregisterPage: n } = u({ title: a.title, pageId: a.pageId });
|
|
82
|
+
V(() => n());
|
|
83
|
+
const { activePage: v, animation: _, goToPreviousPage: d, hasPreviousPages: f, isOpen: E } = B(x), g = p(() => v.value ? v.value === a.pageId : !0), C = p(() => a.previousPage ? !0 : a.previousPage === null ? !1 : f.value && g.value), I = p(() => ({
|
|
84
|
+
"b-sidepanel-page__header--with-border": o.value && !P.value
|
|
85
|
+
})), A = p(() => ({
|
|
86
86
|
"b-sidepanel-page__actions--with-border": o.value && !i.value
|
|
87
|
-
})),
|
|
88
|
-
e.value && (
|
|
89
|
-
},
|
|
90
|
-
|
|
87
|
+
})), S = () => {
|
|
88
|
+
e.value && (P.value = e.value.scrollTop === 0, i.value = e.value.scrollHeight - e.value.clientHeight === e.value.scrollTop);
|
|
89
|
+
}, m = async (s) => {
|
|
90
|
+
s && (await N(), o.value = e.value && e.value.scrollHeight > e.value.clientHeight);
|
|
91
91
|
};
|
|
92
|
-
return
|
|
93
|
-
_.value ===
|
|
94
|
-
}, BentoButton:
|
|
92
|
+
return h(() => E.value, m, { immediate: !0 }), h(() => g.value, m, { immediate: !0 }), { __sfc: !0, props: a, t, contentElement: e, hasScroll: o, isScrollAtTop: P, isScrollAtBottom: i, registerPage: u, unregisterPage: n, activePage: v, animation: _, goToPreviousPage: d, hasPreviousPages: f, isOpen: E, showPage: g, showBackButton: C, headerConditionalClasses: I, actionsConditionalClasses: A, onScroll: S, calculateScroll: m, updateAnimation: () => {
|
|
93
|
+
_.value === y.TRANSITION_LEVEL_UPPER && (_.value = y.TRANSITION_LEVEL_DEEPER);
|
|
94
|
+
}, BentoButton: w, BentoTypography: G, FooterActions: $, ArrowLeftIcon: H };
|
|
95
95
|
}
|
|
96
96
|
});
|
|
97
97
|
var M = function() {
|
|
98
98
|
var a = this, t = a._self._c, e = a._self._setupProxy;
|
|
99
|
-
return t("Transition", { attrs: { name: e.animation, mode: "out-in" }, on: { "after-leave": e.updateAnimation } }, [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showPage, expression: "showPage" }], staticClass: "b-sidepanel-page" }, [t("div", { staticClass: "b-sidepanel-page__header", class: e.headerConditionalClasses }, [e.showBackButton ? t(e.BentoButton, { attrs: { variant:
|
|
99
|
+
return t("Transition", { attrs: { name: e.animation, mode: "out-in" }, on: { "after-leave": e.updateAnimation } }, [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showPage, expression: "showPage" }], staticClass: "b-sidepanel-page" }, [t("div", { staticClass: "b-sidepanel-page__header", class: e.headerConditionalClasses }, [e.showBackButton ? t(e.BentoButton, { attrs: { variant: "tertiary" }, on: { click: function(o) {
|
|
100
100
|
return e.goToPreviousPage(a.previousPage);
|
|
101
|
-
} } }, [t(e.ArrowLeftIcon, { attrs: { "svg-title": e.t("goToPreviousPage") } })], 1) : a._e(), t(e.BentoTypography, { staticClass: "b-sidepanel-page__title", attrs: { el:
|
|
102
|
-
}, q = [], Q = /* @__PURE__ */
|
|
101
|
+
} } }, [t(e.ArrowLeftIcon, { attrs: { "svg-title": e.t("goToPreviousPage") } })], 1) : a._e(), t(e.BentoTypography, { staticClass: "b-sidepanel-page__title", attrs: { el: "h2", variant: "title" } }, [a._v(" " + a._s(a.title) + " ")])], 1), t("div", { ref: "contentElement", staticClass: "b-sidepanel-page__content", on: { scroll: e.onScroll } }, [t(e.BentoTypography, { attrs: { el: "div", variant: "body" } }, [a._t("default")], 2)], 1), a.actions ? t("div", { staticClass: "b-sidepanel-page__actions", class: e.actionsConditionalClasses }, [t(e.FooterActions, { attrs: { actions: a.actions, "actions-label": a.actionsLabel, "destructive-actions": a.destructiveActions } })], 1) : a._e()])]);
|
|
102
|
+
}, q = [], Q = /* @__PURE__ */ k(
|
|
103
103
|
z,
|
|
104
104
|
M,
|
|
105
105
|
q,
|
|
106
106
|
!1,
|
|
107
107
|
null,
|
|
108
|
-
"
|
|
108
|
+
"1d34045b",
|
|
109
109
|
null,
|
|
110
110
|
null
|
|
111
111
|
);
|
|
@@ -115,7 +115,7 @@ const _e = Q.exports, W = {
|
|
|
115
115
|
}
|
|
116
116
|
}, X = {
|
|
117
117
|
i18n: { messages: W }
|
|
118
|
-
}, Z = /* @__PURE__ */
|
|
118
|
+
}, Z = /* @__PURE__ */ L({
|
|
119
119
|
...X,
|
|
120
120
|
__name: "sidepanel",
|
|
121
121
|
props: {
|
|
@@ -144,51 +144,52 @@ const _e = Q.exports, W = {
|
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
setup(l, { emit: a }) {
|
|
147
|
-
const t = l, { activePage: e, isOpen: o } =
|
|
148
|
-
if (
|
|
149
|
-
const
|
|
150
|
-
|
|
147
|
+
const t = l, { activePage: e, isOpen: o } = F(t), { t: P } = R(), i = r(null), u = r([]), n = r([]), v = p(() => n.value.length > 1), _ = r(y.TRANSITION_LEVEL_DEEPER), d = r(!1), f = p(() => n.value[n.value.length - 1]), E = p(() => u.value.some((s) => s.pageId === e.value)), g = (s) => {
|
|
148
|
+
if (s) {
|
|
149
|
+
const c = n.value.indexOf(s);
|
|
150
|
+
c !== -1 ? n.value = n.value.slice(0, c + 1) : n.value = [s];
|
|
151
151
|
} else
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
n.value.pop();
|
|
153
|
+
_.value = y.TRANSITION_LEVEL_UPPER, a(T.UPDATE_ACTIVE_PAGE, f.value);
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
h(
|
|
156
156
|
() => e.value,
|
|
157
157
|
async () => {
|
|
158
|
-
if (await
|
|
158
|
+
if (await N(), e.value && !E.value) {
|
|
159
159
|
console.error(`The activePage passed "${e.value}" does not match the id of any SidepanelPage`);
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
|
-
e.value !==
|
|
162
|
+
e.value !== f.value && n.value.push(e.value);
|
|
163
163
|
},
|
|
164
164
|
{ immediate: !0 }
|
|
165
165
|
);
|
|
166
|
-
const
|
|
167
|
-
"b-sidepanel__hide":
|
|
168
|
-
})),
|
|
169
|
-
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
},
|
|
173
|
-
|
|
166
|
+
const C = p(() => ({
|
|
167
|
+
"b-sidepanel__hide": d.value
|
|
168
|
+
})), I = (s) => {
|
|
169
|
+
d.value && s.pseudoElement === "::backdrop" && (i.value.close(), n.value[0] && a(T.UPDATE_ACTIVE_PAGE, n.value[0]), n.value = [], d.value = !1, a(T.UPDATE_IS_OPEN, !1));
|
|
170
|
+
}, A = (s) => {
|
|
171
|
+
s && s.preventDefault(), i.value.open && (d.value = !0);
|
|
172
|
+
}, S = ({ target: s }) => {
|
|
173
|
+
s && s.tagName === "DIALOG" && A();
|
|
174
174
|
};
|
|
175
|
-
|
|
175
|
+
h(
|
|
176
176
|
() => o.value,
|
|
177
177
|
async () => {
|
|
178
|
-
await
|
|
178
|
+
await N(), i.value && (o.value ? (i.value.showModal(), n.value.length || n.value.push(e.value)) : i.value.open && A());
|
|
179
179
|
},
|
|
180
180
|
{ immediate: !0 }
|
|
181
181
|
);
|
|
182
|
-
const
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
const m = (s) => () => {
|
|
183
|
+
var c;
|
|
184
|
+
u.value = (c = u.value) == null ? void 0 : c.filter(({ pageId: U }) => U !== s);
|
|
185
|
+
}, b = ({ title: s, pageId: c }) => (u.value.push({ title: s, pageId: c }), { unregisterPage: m(c) });
|
|
186
|
+
return O(x, {
|
|
186
187
|
activePage: e,
|
|
187
|
-
animation:
|
|
188
|
-
goToPreviousPage:
|
|
189
|
-
hasPreviousPages:
|
|
188
|
+
animation: _,
|
|
189
|
+
goToPreviousPage: g,
|
|
190
|
+
hasPreviousPages: v,
|
|
190
191
|
isOpen: o
|
|
191
|
-
}),
|
|
192
|
+
}), O(D, b), { __sfc: !0, props: t, emit: a, activePage: e, isOpen: o, t: P, sidepanel: i, pages: u, previousPages: n, hasPreviousPages: v, animation: _, isClosing: d, lastPage: f, isActivePageValid: E, goToPreviousPage: g, conditionalClasses: C, closeSidepanelAfterAnimation: I, startCloseSidepanelAnimation: A, closeSidepanelOnClickOutside: S, unregisterPage: m, registerPage: b, BentoButton: w, BentoFocusTrap: j, CrossIcon: J };
|
|
192
193
|
}
|
|
193
194
|
});
|
|
194
195
|
var ee = function() {
|
|
@@ -197,22 +198,22 @@ var ee = function() {
|
|
|
197
198
|
a.isDismissible && e.closeSidepanelOnClickOutside(o);
|
|
198
199
|
}, keydown: function(o) {
|
|
199
200
|
return !o.type.indexOf("key") && a._k(o.keyCode, "esc", 27, o.key, ["Esc", "Escape"]) ? null : e.startCloseSidepanelAnimation.apply(null, arguments);
|
|
200
|
-
} } }, [t(e.BentoFocusTrap, [t("div", { staticClass: "b-sidepanel__close-button" }, [t(e.BentoButton, { attrs: { variant:
|
|
201
|
-
}, ae = [], te = /* @__PURE__ */
|
|
201
|
+
} } }, [t(e.BentoFocusTrap, [t("div", { staticClass: "b-sidepanel__close-button" }, [t(e.BentoButton, { attrs: { variant: "tertiary" }, on: { click: e.startCloseSidepanelAnimation } }, [t(e.CrossIcon, { attrs: { "svg-title": e.t("close") } })], 1)], 1), a._t("default")], 2)], 1);
|
|
202
|
+
}, ae = [], te = /* @__PURE__ */ k(
|
|
202
203
|
Z,
|
|
203
204
|
ee,
|
|
204
205
|
ae,
|
|
205
206
|
!1,
|
|
206
207
|
null,
|
|
207
|
-
"
|
|
208
|
+
"d408ac3c",
|
|
208
209
|
null,
|
|
209
210
|
null
|
|
210
211
|
);
|
|
211
212
|
const de = te.exports;
|
|
212
213
|
export {
|
|
213
214
|
de as BentoSidepanel,
|
|
214
|
-
|
|
215
|
-
|
|
215
|
+
y as BentoSidepanelAnimation,
|
|
216
|
+
T as BentoSidepanelEvent,
|
|
216
217
|
_e as BentoSidepanelPage
|
|
217
218
|
};
|
|
218
219
|
//# sourceMappingURL=sidepanel.js.map
|
package/dist/sidepanel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sidepanel.js","sources":["../src/components/sidepanel/sidepanel.types.ts","../src/components/sidepanel/sidepanel.keys.ts","../src/components/sidepanel/components/sidepanel-page.vue","../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nexport interface BentoSidepanelPageObject {\n title: string;\n pageId: string;\n}\n\nexport enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n\nexport enum BentoSidepanelAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-sidepanel-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-sidepanel-page__animation--level-upper',\n}\n\nexport interface BentoSidepanelConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n goToPreviousPage: (page: string) => void;\n hasPreviousPages: Ref<boolean>;\n isOpen: Ref<boolean>;\n}\n\nexport type BentoSidepanelRegisterPage = (props: BentoSidepanelPageObject) => void;\n","export const SIDEPANEL_REGISTER_PAGE_INJECTION_KEY = Symbol('sidepanel registerPage injection key');\nexport const SIDEPANEL_CONFIG_INJECTION_KEY = Symbol('sidepanel config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\">\n <div v-show=\"showPage\" class=\"b-sidepanel-page\">\n <div class=\"b-sidepanel-page__header\" :class=\"headerConditionalClasses\">\n <bento-button\n v-if=\"showBackButton\"\n :variant=\"BentoButtonVariant.TERTIARY\"\n @click=\"goToPreviousPage(previousPage)\"\n >\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n\n <bento-typography\n class=\"b-sidepanel-page__title\"\n :el=\"BentoTypographyElement.H2\"\n :variant=\"BentoTypographyVariant.TITLE\"\n >\n {{ title }}\n </bento-typography>\n </div>\n <div ref=\"contentElement\" class=\"b-sidepanel-page__content\" @scroll=\"onScroll\">\n <bento-typography :el=\"BentoTypographyElement.DIV\" :variant=\"BentoTypographyVariant.BODY\">\n <slot />\n </bento-typography>\n </div>\n <div v-if=\"actions\" class=\"b-sidepanel-page__actions\" :class=\"actionsConditionalClasses\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, PropType, ref, watch } from 'vue';\n\n import { BentoButton, BentoButtonActionsList, BentoButtonVariant } from '@/components/button';\n import { BentoTypography, BentoTypographyElement, BentoTypographyVariant } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { BentoSidepanelAnimation, BentoSidepanelConfigData, BentoSidepanelRegisterPage } from '../sidepanel.types';\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from '../sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isScrollAtTop = ref(true);\n const isScrollAtBottom = ref(false);\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoSidepanelRegisterPage>(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY);\n\n registerPage({ title: props.title, pageId: props.pageId });\n\n const { activePage, animation, goToPreviousPage, hasPreviousPages, isOpen } =\n inject<BentoSidepanelConfigData>(SIDEPANEL_CONFIG_INJECTION_KEY);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-sidepanel-page__header--with-border': hasScroll.value && !isScrollAtTop.value,\n }));\n\n const actionsConditionalClasses = computed(() => ({\n 'b-sidepanel-page__actions--with-border': hasScroll.value && !isScrollAtBottom.value,\n }));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n isScrollAtTop.value = contentElement.value.scrollTop === 0;\n isScrollAtBottom.value =\n contentElement.value.scrollHeight - contentElement.value.clientHeight === contentElement.value.scrollTop;\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Animation\n const updateAnimation = () => {\n if (animation.value === BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER) {\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @click=\"isDismissible && closeSidepanelOnClickOutside($event)\"\n @keydown.esc=\"startCloseSidepanelAnimation\"\n >\n <bento-focus-trap>\n <div class=\"b-sidepanel__close-button\">\n <bento-button :variant=\"BentoButtonVariant.TERTIARY\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton, BentoButtonVariant } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import {\n BentoSidepanelAnimation,\n BentoSidepanelEvent,\n BentoSidepanelPageObject,\n BentoSidepanelRegisterPage,\n } from './sidepanel.types';\n\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from './sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<BentoSidepanelPageObject[]>([]);\n const previousPages = ref([]);\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const animation = ref(BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n\n // Previous page/back button logic\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page.pageId === activePage.value));\n\n const goToPreviousPage = (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER;\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n\n if (!!activePage.value && !isActivePageValid.value) {\n // eslint-disable-next-line no-console\n console.error(`The activePage passed \"${activePage.value}\" does not match the id of any SidepanelPage`);\n return;\n }\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel__hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = (event: AnimationEvent) => {\n if (isClosing.value && event.pseudoElement === '::backdrop') {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeSidepanelOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === 'DIALOG') {\n startCloseSidepanelAnimation();\n }\n };\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n () => isOpen.value,\n async () => {\n // Wait for sidepanel ref to be created\n await nextTick();\n\n if (!sidepanel.value) {\n return;\n }\n\n if (isOpen.value) {\n sidepanel.value.showModal();\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (sidepanel.value.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true }\n );\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoSidepanelRegisterPage = ({ title, pageId }) => {\n pages.value.push({ title, pageId });\n };\n\n provide(SIDEPANEL_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n goToPreviousPage,\n hasPreviousPages,\n isOpen,\n });\n provide(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["BentoSidepanelEvent","BentoSidepanelEvent2","BentoSidepanelAnimation","BentoSidepanelAnimation2","SIDEPANEL_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_CONFIG_INJECTION_KEY","__default__$1","messages$1","useI18n","contentElement","ref","hasScroll","isScrollAtTop","isScrollAtBottom","registerPage","inject","props","activePage","animation","goToPreviousPage","hasPreviousPages","isOpen","showPage","computed","showBackButton","headerConditionalClasses","actionsConditionalClasses","onScroll","calculateScroll","watchedValue","nextTick","watch","__default__","messages","toRefs","t","sidepanel","pages","previousPages","isClosing","lastPage","isActivePageValid","page","index","emit","conditionalClasses","closeSidepanelAfterAn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;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAlC,IAAA,CAAA,EAAA,OAAAqC,GAAA,QAAAC,EAAA,MAAA;AACI,MAAAf,EAAA,MAAA,KAAA,EAAA,OAAAc,GAAA,QAAAC,EAAA,CAAA;AAAA,IAAkC;AAGtC,WAAAC,EAAAhD,GAAA;AAAA,MAAwC,YAAAY;AAAA,MACpC,WAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,QAAAC;AAAA,IACA,CAAA,GAEJgC,EAAAjD,GAAAU,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"sidepanel.js","sources":["../src/components/sidepanel/sidepanel.types.ts","../src/components/sidepanel/sidepanel.keys.ts","../src/components/sidepanel/components/sidepanel-page.vue","../src/components/sidepanel/sidepanel.vue"],"sourcesContent":["import { Ref } from 'vue';\n\nexport interface BentoSidepanelPageObject {\n title: string;\n pageId: string;\n}\n\nexport enum BentoSidepanelEvent {\n UPDATE_ACTIVE_PAGE = 'update:active-page',\n UPDATE_IS_OPEN = 'update:is-open',\n}\n\nexport enum BentoSidepanelAnimation {\n TRANSITION_LEVEL_DEEPER = 'b-sidepanel-page__animation--level-deeper',\n TRANSITION_LEVEL_UPPER = 'b-sidepanel-page__animation--level-upper',\n}\n\nexport interface BentoSidepanelConfigData {\n activePage: Ref<string>;\n animation: Ref<string>;\n goToPreviousPage: (page: string) => void;\n hasPreviousPages: Ref<boolean>;\n isOpen: Ref<boolean>;\n}\n\nexport type BentoSidepanelRegisterPage = (props: BentoSidepanelPageObject) => { unregisterPage: () => void };\n","export const SIDEPANEL_REGISTER_PAGE_INJECTION_KEY = Symbol('sidepanel registerPage injection key');\nexport const SIDEPANEL_CONFIG_INJECTION_KEY = Symbol('sidepanel config data injection key');\n","<template>\n <Transition :name=\"animation\" mode=\"out-in\" @after-leave=\"updateAnimation\">\n <div v-show=\"showPage\" class=\"b-sidepanel-page\">\n <div class=\"b-sidepanel-page__header\" :class=\"headerConditionalClasses\">\n <bento-button v-if=\"showBackButton\" variant=\"tertiary\" @click=\"goToPreviousPage(previousPage)\">\n <arrow-left-icon :svg-title=\"t('goToPreviousPage')\" />\n </bento-button>\n\n <bento-typography class=\"b-sidepanel-page__title\" el=\"h2\" variant=\"title\">\n {{ title }}\n </bento-typography>\n </div>\n <div ref=\"contentElement\" class=\"b-sidepanel-page__content\" @scroll=\"onScroll\">\n <bento-typography el=\"div\" variant=\"body\">\n <slot />\n </bento-typography>\n </div>\n <div v-if=\"actions\" class=\"b-sidepanel-page__actions\" :class=\"actionsConditionalClasses\">\n <footer-actions\n :actions=\"actions\"\n :actions-label=\"actionsLabel\"\n :destructive-actions=\"destructiveActions\"\n />\n </div>\n </div>\n </Transition>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, inject, nextTick, onUnmounted, PropType, ref, watch } from 'vue';\n\n import { BentoButton, BentoButtonActionsList } from '@/components/button';\n import { BentoTypography } from '@/components/typography';\n import { FooterActions } from '@/components/internal/footer-actions';\n import ArrowLeftIcon from '@adyen/ui-assets-icons-16/vue/arrow-left';\n\n import { BentoSidepanelAnimation, BentoSidepanelConfigData, BentoSidepanelRegisterPage } from '../sidepanel.types';\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from '../sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * List of actions that will be used to render the buttons.\n * First element in the list will be rendered as \"primary\".\n * All elements after the first will be rendered as \"secondary\".\n *\n * ```\n * [{\n * title: 'Primary',\n * event: () => { ... },\n * icon: FourPeopleIcon\n * }, {\n * title: 'Secondary',\n * event: () => { ... }\n * }]\n * ```\n */\n actions: {\n type: Array as PropType<BentoButtonActionsList>,\n default: null,\n },\n\n /**\n * Text label that is displayed left to the action buttons\n */\n actionsLabel: {\n type: String,\n default: null,\n },\n\n /**\n * If passed - sets first button color to red\n */\n destructiveActions: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Identifier of the page, used with activePage prop to handle sidepanel navigation\n */\n pageId: {\n type: String,\n default: undefined,\n },\n\n /**\n * ID of the page for the back button to navigate to. Only use it to overwrite the default back behavior\n * Used when the back button should not take the user to the natural previous page\n * Set to `null` to hide back button in the page\n */\n previousPage: {\n type: String,\n default: undefined,\n },\n\n /**\n * Title of the sidepanel page\n */\n title: {\n type: String,\n default: null,\n },\n });\n\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n // Refs\n const contentElement = ref<HTMLDivElement>(null);\n const hasScroll = ref(false);\n const isScrollAtTop = ref(true);\n const isScrollAtBottom = ref(false);\n\n // Register page to parent component and inject data from parent component\n const registerPage = inject<BentoSidepanelRegisterPage>(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY);\n const { unregisterPage } = registerPage({ title: props.title, pageId: props.pageId });\n\n // Unregister page on unmounting the page\n onUnmounted(() => unregisterPage());\n\n const { activePage, animation, goToPreviousPage, hasPreviousPages, isOpen } =\n inject<BentoSidepanelConfigData>(SIDEPANEL_CONFIG_INJECTION_KEY);\n\n // Logic to choose which page is active/shown\n const showPage = computed(() => (activePage.value ? activePage.value === props.pageId : true));\n\n // Logic to determine whether the back button should be shown on the page\n const showBackButton = computed(() => {\n if (props.previousPage) {\n return true;\n }\n if (props.previousPage === null) {\n return false;\n }\n return hasPreviousPages.value && showPage.value;\n });\n\n // Scrolling styling logic\n const headerConditionalClasses = computed(() => ({\n 'b-sidepanel-page__header--with-border': hasScroll.value && !isScrollAtTop.value,\n }));\n\n const actionsConditionalClasses = computed(() => ({\n 'b-sidepanel-page__actions--with-border': hasScroll.value && !isScrollAtBottom.value,\n }));\n\n const onScroll = () => {\n if (!contentElement.value) {\n return;\n }\n isScrollAtTop.value = contentElement.value.scrollTop === 0;\n isScrollAtBottom.value =\n contentElement.value.scrollHeight - contentElement.value.clientHeight === contentElement.value.scrollTop;\n };\n\n const calculateScroll = async watchedValue => {\n if (!watchedValue) {\n return;\n }\n // Wait for content to be rendered to be able to calculate the height\n await nextTick();\n hasScroll.value = contentElement.value && contentElement.value.scrollHeight > contentElement.value.clientHeight;\n };\n\n watch(() => isOpen.value, calculateScroll, { immediate: true });\n watch(() => showPage.value, calculateScroll, { immediate: true });\n\n // Animation\n const updateAnimation = () => {\n if (animation.value === BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER) {\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER;\n }\n };\n</script>\n\n<script lang=\"ts\">\n /**\n * SidepanelPage is used to render different pages of Sidepanel component\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n\n<style lang=\"scss\" scoped src=\"./sidepanel-page.scss\" />\n","<template>\n <dialog\n ref=\"sidepanel\"\n class=\"b-sidepanel\"\n :class=\"conditionalClasses\"\n @animationend=\"closeSidepanelAfterAnimation\"\n @click=\"isDismissible && closeSidepanelOnClickOutside($event)\"\n @keydown.esc=\"startCloseSidepanelAnimation\"\n >\n <bento-focus-trap>\n <div class=\"b-sidepanel__close-button\">\n <bento-button variant=\"tertiary\" @click=\"startCloseSidepanelAnimation\">\n <cross-icon :svg-title=\"t('close')\" />\n </bento-button>\n </div>\n <slot />\n </bento-focus-trap>\n </dialog>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, nextTick, provide, ref, toRefs, watch } from 'vue';\n\n import { BentoButton } from '@/components/button';\n import { BentoFocusTrap } from '@/components/focus-trap';\n import CrossIcon from '@adyen/ui-assets-icons-16/vue/cross';\n\n import {\n BentoSidepanelAnimation,\n BentoSidepanelEvent,\n BentoSidepanelPageObject,\n BentoSidepanelRegisterPage,\n } from './sidepanel.types';\n\n import { SIDEPANEL_CONFIG_INJECTION_KEY, SIDEPANEL_REGISTER_PAGE_INJECTION_KEY } from './sidepanel.keys';\n\n import { useI18n } from '@/utils/ts/i18n';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n const props = defineProps({\n /**\n * The id of the current active page\n * Should be the same id as the BentoSidepanelPage to be displayed\n * If the component only has one page, it can be left null/undefined.\n */\n activePage: {\n type: String,\n default: null,\n },\n\n /**\n * If set to true, it allows the sidepanel to be closed\n */\n isDismissible: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Controls the sidepanel's state from the outside. Set it to true to open the sidepanel\n */\n isOpen: {\n type: Boolean,\n default: null,\n },\n });\n\n const emit = defineEmits<{\n /**\n * Emits update event when page is changed internally\n */\n (e: BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, page: string): void;\n /**\n * Emits close-sidepanel event when the sidepanel is closed\n */\n (e: BentoSidepanelEvent.UPDATE_IS_OPEN, isOpen: boolean): void;\n }>();\n\n // Refs\n const { activePage, isOpen } = toRefs(props);\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const sidepanel = ref(null);\n const pages = ref<BentoSidepanelPageObject[]>([]);\n const previousPages = ref([]);\n const hasPreviousPages = computed(() => previousPages.value.length > 1);\n const animation = ref(BentoSidepanelAnimation.TRANSITION_LEVEL_DEEPER);\n const isClosing = ref(false);\n\n // Previous page/back button logic\n const lastPage = computed(() => previousPages.value[previousPages.value.length - 1]);\n const isActivePageValid = computed(() => pages.value.some(page => page.pageId === activePage.value));\n\n const goToPreviousPage = (page: string) => {\n if (page) {\n const index = previousPages.value.indexOf(page);\n if (index !== -1) {\n previousPages.value = previousPages.value.slice(0, index + 1);\n } else {\n previousPages.value = [page];\n }\n } else {\n previousPages.value.pop();\n }\n\n animation.value = BentoSidepanelAnimation.TRANSITION_LEVEL_UPPER;\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, lastPage.value);\n };\n\n // Add new page to the previousPage array to keep track of user navigation\n watch(\n () => activePage.value,\n async () => {\n await nextTick();\n\n if (!!activePage.value && !isActivePageValid.value) {\n // eslint-disable-next-line no-console\n console.error(`The activePage passed \"${activePage.value}\" does not match the id of any SidepanelPage`);\n return;\n }\n if (activePage.value !== lastPage.value) {\n previousPages.value.push(activePage.value);\n }\n },\n { immediate: true }\n );\n\n // Animation styling\n const conditionalClasses = computed(() => ({\n 'b-sidepanel__hide': isClosing.value,\n }));\n\n // Handle closing and closing animation for dialog element\n const closeSidepanelAfterAnimation = (event: AnimationEvent) => {\n if (isClosing.value && event.pseudoElement === '::backdrop') {\n sidepanel.value.close();\n if (previousPages.value[0]) {\n emit(BentoSidepanelEvent.UPDATE_ACTIVE_PAGE, previousPages.value[0]);\n }\n previousPages.value = [];\n isClosing.value = false;\n emit(BentoSidepanelEvent.UPDATE_IS_OPEN, false);\n }\n };\n\n const startCloseSidepanelAnimation = (event?: Event) => {\n if (event) {\n event.preventDefault();\n }\n if (!sidepanel.value.open) {\n return;\n }\n isClosing.value = true;\n };\n\n /**\n * Since the dialog HTML element doesn't automatically close when clicking outside, a check on when the user is clicking is needed.\n * If the click doesn't happen in the dialog box itself, the modal closes\n */\n const closeSidepanelOnClickOutside = ({ target }: Event): void => {\n if (target && (target as HTMLElement).tagName === 'DIALOG') {\n startCloseSidepanelAnimation();\n }\n };\n\n // Watching isOpen prop to toggle open/close the dialog element\n watch(\n () => isOpen.value,\n async () => {\n // Wait for sidepanel ref to be created\n await nextTick();\n\n if (!sidepanel.value) {\n return;\n }\n\n if (isOpen.value) {\n sidepanel.value.showModal();\n if (!previousPages.value.length) {\n previousPages.value.push(activePage.value);\n }\n } else if (sidepanel.value.open) {\n startCloseSidepanelAnimation();\n }\n },\n { immediate: true }\n );\n\n // unregister page if removed / destroyed\n const unregisterPage = (pageIdToRemove: string) => () => {\n pages.value = pages.value?.filter(({ pageId }) => pageId !== pageIdToRemove);\n };\n\n // Provide data and function to register page to subcomponent\n const registerPage: BentoSidepanelRegisterPage = ({ title, pageId }) => {\n pages.value.push({ title, pageId });\n\n return { unregisterPage: unregisterPage(pageId) };\n };\n\n provide(SIDEPANEL_CONFIG_INJECTION_KEY, {\n activePage,\n animation,\n goToPreviousPage,\n hasPreviousPages,\n isOpen,\n });\n provide(SIDEPANEL_REGISTER_PAGE_INJECTION_KEY, registerPage);\n</script>\n\n<script lang=\"ts\">\n /**\n * Sidepanel component is a slide-in panel that should be used for presenting actions, settings or features that are directly associated with a specific task or interaction on the main screen.\n *\n * @example\n * import { BentoSidepanel, BentoSidepanelPage } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoSidepanel, BentoSidepanelPage },\n * template: `\n * <bento-sidepanel active-page='step1' is-open='true'>\n * <bento-sidepanel-page\n * title='Step 1'\n * pageId='step1'\n * :actions=\"[\n * {\n * title: 'Next step',\n * event: () => {\n * activePage.value = 'step2';\n * },\n * }]\">\n * Step 1 info\n * </bento-sidepanel-page>\n * <bento-sidepanel-page\n * title='Step 2'\n * pageId='step2'\n * :actions=\"[\n * {\n * title: 'Save',\n * event: () => {},\n * }]\">\n * Step 2 info\n * </bento-sidepanel-page>\n * </bento-sidepanel>\n * `\n * }\n */\n export default {\n i18n: { messages },\n };\n</script>\n<style lang=\"scss\" scoped src=\"./sidepanel.scss\" />\n"],"names":["BentoSidepanelEvent","BentoSidepanelEvent2","BentoSidepanelAnimation","BentoSidepanelAnimation2","SIDEPANEL_REGISTER_PAGE_INJECTION_KEY","SIDEPANEL_CONFIG_INJECTION_KEY","__default__$1","messages$1","useI18n","contentElement","ref","hasScroll","isScrollAtTop","isScrollAtBottom","registerPage","inject","unregisterPage","props","onUnmounted","activePage","animation","goToPreviousPage","hasPreviousPages","isOpen","showPage","computed","showBackButton","headerConditionalClasses","actionsConditionalClasses","onScroll","calculateScroll","watchedValue","nextTick","watch","__default__","messages","toRefs","t","sidepanel","pages","previousPages","isClosing","lastPage","isActivePageValid","page","index","emit","conditionalClasses","closeSidepanelAfterAnimation","event","startCloseSidepanelAnimation","closeSidepanelOnClickOutside","target","pageIdToRemove","_a","pageId","title","provide"],"mappings":";;;;;;;;;;AAOY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,qBAAA,sBACAA,EAAA,iBAAA,kBAFQA,IAAAD,KAAA,CAAA,CAAA,GAKAE,IAAA,kBAAAC,OACRA,EAAA,0BAAA,6CACAA,EAAA,yBAAA,4CAFQA,IAAAD,KAAA,CAAA,CAAA;ACZC,MAAAE,IAAA,OAAA,sCAAA,GACAC,IAAA,OAAA,qCAAA;;;;GCwNTC,IAAA;AAAA,EAAe,MAAA,EAAA,UAAAC,EAAA;AAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7GA,EAAA,EAAA,IAAAC,EAAA,GAGAC,IAAAC,EAAA,IAAA,GACAC,IAAAD,EAAA,EAAA,GACAE,IAAAF,EAAA,EAAA,GACAG,IAAAH,EAAA,EAAA,GAGAI,IAAAC,EAAAX,CAAA,GACA,EAAA,gBAAAY,EAAA,IAAAF,EAAA,EAAA,OAAAG,EAAA,OAAA,QAAAA,EAAA,OAAA,CAAA;AAGA,IAAAC,EAAA,MAAAF,EAAA,CAAA;AAEA,UAAA,EAAA,YAAAG,GAAA,WAAAC,GAAA,kBAAAC,GAAA,kBAAAC,GAAA,QAAAC,EAAA,IAAAR,EAAAV,CAAA,GAIAmB,IAAAC,EAAA,MAAAN,EAAA,QAAAA,EAAA,UAAAF,EAAA,SAAA,EAAA,GAGAS,IAAAD,EAAA,MACIR,EAAA,eACI,KAEJ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QAAAC,EAAA,MAAA;AACI,MAAAA,KAAAA,EAAA,YAAA,YACIF,EAAA;AAAA,IACJ;AAIJ,IAAAjB;AAAA,MAAA,MAAAV,EAAA;AAAA,MACiB,YAAA;AAKT,QAFA,MAAAS,EAAA,GAEAM,EAAA,UAIAf,EAAA,SACIe,EAAA,MAAA,UAAA,GACAE,EAAA,MAAA,UACIA,EAAA,MAAA,KAAArB,EAAA,KAAA,KACJmB,EAAA,MAAA,QAEAY,EAAA;AAAA,MACJ;AAAA,MACJ,EAAA,WAAA,GAAA;AAAA,IACkB;AAItB,UAAAlC,IAAA,CAAAqC,MAAA,MAAA;;AACI,MAAAd,EAAA,SAAAe,IAAAf,EAAA,UAAA,gBAAAe,EAAA,OAAA,CAAA,EAAA,QAAAC,EAAA,MAAAA,MAAAF;AAAA,IAA2E,GAI/EvC,IAAA,CAAA,EAAA,OAAA0C,GAAA,QAAAD,EAAA,OACIhB,EAAA,MAAA,KAAA,EAAA,OAAAiB,GAAA,QAAAD,EAAA,CAAA,GAEA,EAAA,gBAAAvC,EAAAuC,CAAA,EAAA;AAGJ,WAAAE,EAAApD,GAAA;AAAA,MAAwC,YAAAc;AAAA,MACpC,WAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,kBAAAC;AAAA,MACA,QAAAC;AAAA,IACA,CAAA,GAEJkC,EAAArD,GAAAU,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/status.js
CHANGED
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { B as o
|
|
3
|
-
import { n as
|
|
4
|
-
import "./assets/
|
|
5
|
-
var
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as n, computed as a } from "vue";
|
|
2
|
+
import { B as o } from "./chunks/index.45295dd3.js";
|
|
3
|
+
import { n as l } from "./chunks/_plugin-vue2_normalizer.71e2aa87.js";
|
|
4
|
+
import "./assets/index32.css";
|
|
5
|
+
var r = /* @__PURE__ */ ((s) => (s.BLUE = "blue", s.GREEN = "green", s.GREY = "grey", s.ORANGE = "orange", s.RED = "red", s.YELLOW = "yellow", s))(r || {});
|
|
6
|
+
const _ = n({
|
|
7
7
|
name: "bento-status",
|
|
8
8
|
components: { BentoTypography: o },
|
|
9
9
|
props: {
|
|
10
10
|
variant: {
|
|
11
11
|
type: String,
|
|
12
12
|
required: !0,
|
|
13
|
-
validator: (
|
|
13
|
+
validator: (s) => Object.values(r).includes(s)
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
|
-
setup(
|
|
16
|
+
setup(s) {
|
|
17
17
|
return {
|
|
18
18
|
// Values
|
|
19
|
-
conditionalClass:
|
|
20
|
-
[`b-status__indicator--${
|
|
21
|
-
}))
|
|
22
|
-
// Enums
|
|
23
|
-
BentoTypographyElement: l,
|
|
24
|
-
BentoTypographyVariant: _
|
|
19
|
+
conditionalClass: a(() => ({
|
|
20
|
+
[`b-status__indicator--${s.variant}`]: !0
|
|
21
|
+
}))
|
|
25
22
|
};
|
|
26
23
|
}
|
|
27
24
|
});
|
|
28
25
|
var c = function() {
|
|
29
|
-
var t = this,
|
|
30
|
-
return t._self._setupProxy,
|
|
31
|
-
},
|
|
32
|
-
|
|
26
|
+
var t = this, e = t._self._c;
|
|
27
|
+
return t._self._setupProxy, e("div", { staticClass: "b-status", attrs: { role: "status" } }, [e("span", { staticClass: "b-status__indicator", class: t.conditionalClass, attrs: { role: "presentation" } }), e("bento-typography", { staticClass: "b-status__label", attrs: { el: "span", variant: "body" } }, [t._t("default")], 2)], 1);
|
|
28
|
+
}, i = [], p = /* @__PURE__ */ l(
|
|
29
|
+
_,
|
|
33
30
|
c,
|
|
34
|
-
|
|
31
|
+
i,
|
|
35
32
|
!1,
|
|
36
33
|
null,
|
|
37
|
-
"
|
|
34
|
+
"4eb7001b",
|
|
38
35
|
null,
|
|
39
36
|
null
|
|
40
37
|
);
|
|
41
|
-
const
|
|
38
|
+
const m = p.exports;
|
|
42
39
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
m as BentoStatus,
|
|
41
|
+
r as BentoStatusVariant
|
|
45
42
|
};
|
|
46
43
|
//# sourceMappingURL=status.js.map
|
package/dist/status.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sources":["../src/components/status/status.types.ts","../src/components/status/status.vue"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"status.js","sources":["../src/components/status/status.types.ts","../src/components/status/status.vue"],"sourcesContent":["/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoStatusVariant {\n BLUE = 'blue',\n GREEN = 'green',\n GREY = 'grey',\n ORANGE = 'orange',\n RED = 'red',\n YELLOW = 'yellow',\n}\n","<template>\n <div class=\"b-status\" role=\"status\">\n <span class=\"b-status__indicator\" :class=\"conditionalClass\" role=\"presentation\"></span>\n <bento-typography class=\"b-status__label\" el=\"span\" variant=\"body\">\n <slot></slot>\n </bento-typography>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoStatusVariant } from './status.types';\n\n /**\n * A Status component is used to indicate a\n * passage of time or a particular step of a process.\n *\n * @example\n * import { BentoStatus } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoStatus },\n * template: `\n * <bento-status variant=\"red\">\n * 1 week ago\n * </bento-status>\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-status',\n components: { BentoTypography },\n props: {\n variant: {\n type: String as PropType<BentoStatusVariant | `${BentoStatusVariant}`>,\n required: true,\n validator: (type: BentoStatusVariant) => Object.values(BentoStatusVariant).includes(type),\n },\n },\n setup(props) {\n const conditionalClass = computed(() => ({\n [`b-status__indicator--${props.variant}`]: true,\n }));\n\n return {\n // Values\n conditionalClass,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./status.scss\" />\n"],"names":["BentoStatusVariant","BentoStatusVariant2","_sfc_main","defineComponent","BentoTypography","type","props","computed"],"mappings":";;;;AAGY,IAAAA,IAAA,kBAAAC,OACRA,EAAA,OAAA,QACAA,EAAA,QAAA,SACAA,EAAA,OAAA,QACAA,EAAA,SAAA,UACAA,EAAA,MAAA,OACAA,EAAA,SAAA,UANQA,IAAAD,KAAA,CAAA,CAAA;AC2BZ,MAAAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,iBAAAC,EAAA;AAAA,EACA,OAAA;AAAA,IACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,WAAA,CAAAC,MAAA,OAAA,OAAAL,CAAA,EAAA,SAAAK,CAAA;AAAA,IACA;AAAA,EACA;AAAA,EACA,MAAAC,GAAA;AAMA,WAAA;AAAA;AAAA,MAAA,kBAJAC,EAAA,OAAA;AAAA,QAAA,CAAA,wBAAAD,EAAA,SAAA,GAAA;AAAA,MACA,EAAA;AAAA,IAKA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;"}
|
package/dist/structured-list.js
CHANGED