@adyen/bento-vue2 1.9.0 → 1.11.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 +2 -0
- package/dist/@types/packages/vue2/src/components/button/button.vue.d.ts +19 -3580
- package/dist/@types/packages/vue2/src/components/button/components/button-actions/button-actions.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/button/components/loading-button/loading-button.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/checkbox/checkbox.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/checkbox/components/checkbox-group/checkbox-group.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/code-snippet/{composables/useLanguage.d.ts → utils/get-lang-loader.d.ts} +1 -3
- package/dist/@types/packages/vue2/src/components/country/composables/index.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryCapital/useCountryCapital.d.ts → use-country-capital/use-country-capital.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryName/useCountryName.d.ts → use-country-name/use-country-name.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/composables/{useCountryPhoneCode/useCountryPhoneCode.d.ts → use-country-phone-code/use-country-phon-code.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/country/country.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-cell-actions/data-grid-cell-actions.vue.d.ts +33 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns-types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +20 -4
- package/dist/@types/packages/vue2/src/components/data-grid/components/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/index.d.ts +10 -8
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-calculate-column-width/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateColumnWidth/useCalculateColumnWidth.d.ts → use-calculate-column-width/use-calculate-column-width.d.ts} +2 -2
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-column-reorderer/use-column-reorderer.d.ts +121 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/use-config-settings/use-config-settings.d.ts +154 -0
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useKeyboardNavigator/useKeyboardNavigator.d.ts → use-keyboard-navigator/use-keyboard-navigator.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useResizer.d.ts → use-resizer.d.ts} +0 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useScroller/useScroller.d.ts → use-scroller/use-scroller.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/composables/{useSelector.d.ts → use-selector.d.ts} +1 -1
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.types.d.ts +5 -2
- package/dist/@types/packages/vue2/src/components/data-grid/data-grid.vue.d.ts +16 -7
- package/dist/@types/packages/vue2/src/components/divider/divider.keys.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/divider/divider.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.types.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +3 -3
- 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/composables/useDropdownOptionsListbox.d.ts +2 -1
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +1598 -6
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/empty-state/empty-state.vue.d.ts +3 -3
- package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +84 -12
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-country-filter/select-country-filter.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/components/select-filter/variants/select-tag-filter/select-tag-filter.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/filter-bar/filter-bar.types.d.ts +3 -1
- package/dist/@types/packages/vue2/src/components/internal/controls-group/controls-group.vue.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.types.d.ts +8 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/copy.vue.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/internal/copy/index.d.ts +1 -0
- 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.types.d.ts +2 -1
- 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 +82 -0
- 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 +10 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue.d.ts +9 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/components/listbox-single-select-category/listbox-single-select-category.vue.d.ts +12 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue.d.ts +10 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/composables/use-multi-level-items/use-multi-level-items.d.ts +6 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +12 -3
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.types.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/menu/components/menu-item/menu-item.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/menu/menu.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +1 -1
- package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +251 -3
- package/dist/@types/packages/vue2/src/components/radio-group/radio-group.vue.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-category/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-category/secondary-nav-category.vue.d.ts +18 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-item/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/components/secondary-nav-item/secondary-nav-item.vue.d.ts +19 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/index.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.keys.d.ts +3 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.types.d.ts +14 -0
- package/dist/@types/packages/vue2/src/components/secondary-nav/secondary-nav.vue.d.ts +20 -0
- package/dist/@types/packages/vue2/src/components/structured-list/components/structered-list-item/structured-list-item.vue.d.ts +3 -4
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.types.d.ts +2 -0
- package/dist/@types/packages/vue2/src/components/structured-list/structured-list.vue.d.ts +16 -3
- package/dist/@types/packages/vue2/src/components/timeline/components/timeline-item/timeline-item.vue.d.ts +15 -10
- package/dist/@types/packages/vue2/src/components/timeline/timeline.types.d.ts +9 -0
- package/dist/@types/packages/vue2/src/index.d.ts +1 -0
- package/dist/@types/packages/vue2/src/types/elements.d.ts +2 -1
- package/dist/@types/packages/vue2/src/utils/ts/deprecate.d.ts +1 -0
- package/dist/accordion.js +2 -2
- package/dist/action-bar.js +5 -5
- package/dist/alert.js +8 -8
- package/dist/alert.js.map +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- 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/fixed-scroller.css +1 -1
- package/dist/assets/index10.css +1 -1
- package/dist/assets/index11.css +1 -1
- package/dist/assets/index12.css +1 -1
- package/dist/assets/index13.css +1 -1
- package/dist/assets/index14.css +1 -1
- package/dist/assets/index15.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index2.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index21.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index24.css +1 -1
- package/dist/assets/index25.css +1 -1
- package/dist/assets/index26.css +1 -1
- package/dist/assets/index27.css +1 -1
- package/dist/assets/index28.css +1 -1
- package/dist/assets/index29.css +1 -1
- package/dist/assets/index3.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index31.css +1 -1
- package/dist/assets/index32.css +1 -1
- package/dist/assets/index33.css +1 -1
- package/dist/assets/index34.css +1 -1
- package/dist/assets/index35.css +1 -1
- package/dist/assets/index36.css +1 -1
- package/dist/assets/index37.css +1 -1
- package/dist/assets/index38.css +1 -1
- package/dist/assets/index39.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index40.css +1 -1
- package/dist/assets/index41.css +1 -1
- package/dist/assets/index42.css +1 -1
- package/dist/assets/index43.css +1 -1
- package/dist/assets/index44.css +1 -1
- package/dist/assets/index45.css +1 -1
- package/dist/assets/index46.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.css +1 -1
- package/dist/assets/loading-button.css +1 -1
- package/dist/avatar-image.js +1 -1
- package/dist/button.js +19 -17
- package/dist/button.js.map +1 -1
- package/dist/card.js +2 -2
- package/dist/checkbox.js +61 -48
- package/dist/checkbox.js.map +1 -1
- package/dist/chunks/{base-button.df9a9bea.js → base-button.bd61ab14.js} +2 -2
- package/dist/chunks/{base-button.df9a9bea.js.map → base-button.bd61ab14.js.map} +1 -1
- package/dist/chunks/{base-modal.75319f4e.js → base-modal.5640a66a.js} +33 -33
- package/dist/chunks/base-modal.5640a66a.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.32770485.js → button-actions-with-menu.767344df.js} +3 -3
- package/dist/chunks/{button-actions-with-menu.32770485.js.map → button-actions-with-menu.767344df.js.map} +1 -1
- package/dist/chunks/button.bb5b4909.js +100 -0
- package/dist/chunks/button.bb5b4909.js.map +1 -0
- package/dist/chunks/{calendar.a885d8fc.js → calendar.4ab3c2dc.js} +4 -4
- package/dist/chunks/{calendar.a885d8fc.js.map → calendar.4ab3c2dc.js.map} +1 -1
- package/dist/chunks/checkbox.c684c20a.js +188 -0
- package/dist/chunks/checkbox.c684c20a.js.map +1 -0
- package/dist/chunks/{controls-group.dd967ccf.js → controls-group.d25f5044.js} +15 -11
- package/dist/chunks/controls-group.d25f5044.js.map +1 -0
- package/dist/chunks/copy.36c058e9.js +122 -0
- package/dist/chunks/copy.36c058e9.js.map +1 -0
- package/dist/chunks/country.types.002caff2.js +5871 -0
- package/dist/chunks/country.types.002caff2.js.map +1 -0
- package/dist/chunks/{cross-circle-fill.7c07d16a.js → cross-circle-fill.27580c4b.js} +5 -5
- package/dist/chunks/{cross-circle-fill.7c07d16a.js.map → cross-circle-fill.27580c4b.js.map} +1 -1
- package/dist/chunks/{dropdown-default-textbox.465db4d4.js → dropdown-default-textbox.1cba89ea.js} +11 -11
- package/dist/chunks/dropdown-default-textbox.1cba89ea.js.map +1 -0
- package/dist/chunks/{dropdown.6461dbe3.js → dropdown.4152cc00.js} +351 -313
- package/dist/chunks/dropdown.4152cc00.js.map +1 -0
- package/dist/chunks/{field-label.01df3cba.js → field-label.a0c54b7d.js} +5 -5
- package/dist/chunks/{field-label.01df3cba.js.map → field-label.a0c54b7d.js.map} +1 -1
- package/dist/chunks/{fixed-scroller.42354ccc.js → fixed-scroller.5c90f692.js} +2 -2
- package/dist/chunks/{fixed-scroller.42354ccc.js.map → fixed-scroller.5c90f692.js.map} +1 -1
- package/dist/chunks/{footer-actions.2cd9079e.js → footer-actions.b14cfca8.js} +3 -3
- package/dist/chunks/{footer-actions.2cd9079e.js.map → footer-actions.b14cfca8.js.map} +1 -1
- package/dist/chunks/{index.16914bb1.js → index.179d485c.js} +29 -29
- package/dist/chunks/{index.16914bb1.js.map → index.179d485c.js.map} +1 -1
- package/dist/chunks/index.1e8c900a.js +32 -0
- package/dist/chunks/index.1e8c900a.js.map +1 -0
- package/dist/chunks/{index.152b2b16.js → index.58282364.js} +3 -3
- package/dist/chunks/{index.152b2b16.js.map → index.58282364.js.map} +1 -1
- package/dist/chunks/{index.322692c8.js → index.720f0cbf.js} +2 -2
- package/dist/chunks/{index.322692c8.js.map → index.720f0cbf.js.map} +1 -1
- package/dist/chunks/index.75f0e99f.js +147 -0
- package/dist/chunks/index.75f0e99f.js.map +1 -0
- package/dist/chunks/{index.6cef7328.js → index.7d2ea1de.js} +2 -2
- package/dist/chunks/{index.6cef7328.js.map → index.7d2ea1de.js.map} +1 -1
- package/dist/chunks/{index.02da8d63.js → index.aaedd8f9.js} +3 -3
- package/dist/chunks/{index.02da8d63.js.map → index.aaedd8f9.js.map} +1 -1
- package/dist/chunks/{index.b201e81d.js → index.b0a89960.js} +22 -22
- package/dist/chunks/index.b0a89960.js.map +1 -0
- package/dist/chunks/{index.d1beb704.js → index.f18f79eb.js} +5 -5
- package/dist/chunks/{index.d1beb704.js.map → index.f18f79eb.js.map} +1 -1
- package/dist/chunks/{index.f358c4bd.js → index.f2223abb.js} +163 -155
- package/dist/chunks/index.f2223abb.js.map +1 -0
- package/dist/chunks/{listbox-option-tag.55cd9c16.js → listbox-option-tag.9103c011.js} +3 -3
- package/dist/chunks/{listbox-option-tag.55cd9c16.js.map → listbox-option-tag.9103c011.js.map} +1 -1
- package/dist/chunks/{listbox.a117e6d4.js → listbox.7cf6d6b4.js} +475 -392
- package/dist/chunks/listbox.7cf6d6b4.js.map +1 -0
- package/dist/chunks/{loading-button.459b9ab4.js → loading-button.fb025a2e.js} +20 -20
- package/dist/chunks/{loading-button.459b9ab4.js.map → loading-button.fb025a2e.js.map} +1 -1
- package/dist/chunks/{tooltip.b8929659.js → tooltip.f48beb54.js} +22 -22
- package/dist/chunks/tooltip.f48beb54.js.map +1 -0
- package/dist/chunks/use-has-slot.fbeb19ec.js.map +1 -1
- package/dist/chunks/useCountryItems.6b7985bf.js +29 -0
- package/dist/chunks/{useCountryItems.34ac8740.js.map → useCountryItems.6b7985bf.js.map} +1 -1
- package/dist/code-snippet.js +10 -12
- package/dist/code-snippet.js.map +1 -1
- package/dist/country.js +41 -5902
- package/dist/country.js.map +1 -1
- package/dist/currency.js +1 -1
- package/dist/data-grid.js +901 -711
- package/dist/data-grid.js.map +1 -1
- package/dist/date-picker.js +18 -18
- package/dist/date-range-picker.js +2 -2
- package/dist/date.js +1 -1
- package/dist/divider.js +2 -18
- package/dist/divider.js.map +1 -1
- package/dist/dropdown.js +41 -41
- package/dist/dropdown.js.map +1 -1
- package/dist/empty-state.js +18 -18
- package/dist/empty-state.js.map +1 -1
- package/dist/filter-bar.js +512 -504
- package/dist/filter-bar.js.map +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/form-layout.js +2 -2
- package/dist/form-layout.js.map +1 -1
- package/dist/header.js +3 -3
- package/dist/index.js +178 -174
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +3 -3
- package/dist/input-field.js +4 -4
- package/dist/internal.js +17 -15
- package/dist/link.js +2 -2
- package/dist/loading-indicator.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal.js +62 -60
- package/dist/modal.js.map +1 -1
- package/dist/pagination.js +22 -22
- package/dist/pagination.js.map +1 -1
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/radio-group.js +46 -45
- package/dist/radio-group.js.map +1 -1
- package/dist/search-bar.js +10 -10
- package/dist/secondary-nav.js +98 -0
- package/dist/secondary-nav.js.map +1 -0
- package/dist/segmented-control.js +3 -3
- package/dist/sidepanel.js +5 -5
- package/dist/status.js +2 -2
- package/dist/stepper.js +3 -3
- package/dist/structured-list.js +1 -1
- package/dist/summary-grid.js +3 -3
- package/dist/tabs.js +3 -3
- package/dist/tag.js +3 -3
- package/dist/textarea.js +95 -88
- package/dist/textarea.js.map +1 -1
- package/dist/timeline.js +198 -191
- package/dist/timeline.js.map +1 -1
- package/dist/toast.js +3 -3
- package/dist/toggle.js +1 -1
- package/dist/tutorial.js +5 -5
- package/dist/typography.js +1 -1
- package/dist/web-types.json +822 -409
- package/package.json +6 -3
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useColumnReorderer/useColumnReorderer.d.ts +0 -67
- package/dist/@types/packages/vue2/src/components/data-grid/composables/useConfigSettings/useConfigSettings.d.ts +0 -73
- package/dist/chunks/base-modal.75319f4e.js.map +0 -1
- package/dist/chunks/button.7dd8d4de.js +0 -125
- package/dist/chunks/button.7dd8d4de.js.map +0 -1
- package/dist/chunks/checkbox.65743b08.js +0 -184
- package/dist/chunks/checkbox.65743b08.js.map +0 -1
- package/dist/chunks/controls-group.dd967ccf.js.map +0 -1
- package/dist/chunks/copy.e12b418e.js +0 -103
- package/dist/chunks/copy.e12b418e.js.map +0 -1
- package/dist/chunks/dropdown-default-textbox.465db4d4.js.map +0 -1
- package/dist/chunks/dropdown.6461dbe3.js.map +0 -1
- package/dist/chunks/index.0890dc99.js +0 -130
- package/dist/chunks/index.0890dc99.js.map +0 -1
- package/dist/chunks/index.b201e81d.js.map +0 -1
- package/dist/chunks/index.f358c4bd.js.map +0 -1
- package/dist/chunks/listbox.a117e6d4.js.map +0 -1
- package/dist/chunks/tooltip.b8929659.js.map +0 -1
- package/dist/chunks/useCountryItems.34ac8740.js +0 -29
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateColumnWidth/useCalculateColumnWidth.types.d.ts → use-calculate-column-width/use-calculate-column-width.types.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useCalculateStickyElementHeight/useCalculateStickyElementHeight.d.ts → use-calculate-sticky-element-height/use-calculate-sticky-element-height.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useKeyboardNavigator/useKeyboardNavigator.types.d.ts → use-keyboard-navigator/use-keyboard-navigator.types.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useLazyLoading/useLazyLoading.d.ts → use-lazy-loading/use-lazy-loading.d.ts} +0 -0
- /package/dist/@types/packages/vue2/src/components/data-grid/composables/{useSorter.d.ts → use-sorter.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.f358c4bd.js","sources":["../../node_modules/@adyen/ui-assets-icons-16/dist/vue/options-vertical.vue","../../src/components/menu/components/menu-item/menu-item.vue","../../src/components/menu/menu.types.ts","../../src/components/menu/components/menu-list-container/menu-list-container.vue","../../src/components/menu/components/sub-menu-item-list/sub-menu-item-list.vue","../../src/components/menu/components/menu-item-list/menu-item-list.vue","../../src/components/menu/menu.keys.ts","../../src/components/menu/menu.vue"],"sourcesContent":["\n<template>\n <svg role=\"img\" v-bind=\"$attrs\" class=\"ui-assets-icons-16\" xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" fill=\"none\"><title v-if=\"$attrs['svg-title']\">{{ $attrs['svg-title'] }}</title><path fill=\"#00112C\" d=\"M8 4C8.29667 4 8.58668 3.91203 8.83335 3.74721C9.08003 3.58238 9.27229 3.34811 9.38582 3.07403C9.49935 2.79994 9.52906 2.49834 9.47118 2.20737C9.4133 1.91639 9.27044 1.64912 9.06066 1.43934C8.85088 1.22956 8.58361 1.0867 8.29264 1.02882C8.00167 0.970945 7.70006 1.00065 7.42598 1.11418C7.15189 1.22771 6.91762 1.41997 6.7528 1.66665C6.58797 1.91332 6.5 2.20333 6.5 2.5C6.5 2.89783 6.65803 3.27936 6.93934 3.56066C7.22064 3.84197 7.60218 4 8 4Z\"/><path fill=\"#00112C\" d=\"M8 15C8.29667 15 8.58668 14.912 8.83335 14.7472C9.08003 14.5824 9.27229 14.3481 9.38582 14.074C9.49935 13.7999 9.52906 13.4983 9.47118 13.2074C9.4133 12.9164 9.27044 12.6491 9.06066 12.4393C8.85088 12.2296 8.58361 12.0867 8.29264 12.0288C8.00167 11.9709 7.70006 12.0007 7.42598 12.1142C7.15189 12.2277 6.91762 12.42 6.7528 12.6666C6.58797 12.9133 6.5 13.2033 6.5 13.5C6.5 13.8978 6.65803 14.2794 6.93934 14.5607C7.22064 14.842 7.60218 15 8 15Z\"/><path fill=\"#00112C\" d=\"M8.83335 9.24721C8.58668 9.41203 8.29667 9.5 8 9.5C7.60218 9.5 7.22064 9.34197 6.93934 9.06066C6.65803 8.77936 6.5 8.39783 6.5 8C6.5 7.70333 6.58797 7.41332 6.7528 7.16665C6.91762 6.91997 7.15189 6.72771 7.42598 6.61418C7.70006 6.50065 8.00167 6.47094 8.29264 6.52882C8.58361 6.5867 8.85088 6.72956 9.06066 6.93934C9.27044 7.14912 9.4133 7.41639 9.47118 7.70737C9.52906 7.99834 9.49935 8.29994 9.38582 8.57403C9.27229 8.84811 9.08003 9.08238 8.83335 9.24721Z\"/></svg>\n</template>\n<script>\n let uuid = 0;\n\n export default {\n beforeCreate() {\n this.uuid = uuid.toString();\n uuid += 1;\n },\n };\n</script>\n<style>\n @import '../css/main.css';\n</style>\n","<template>\n <base-button\n class=\"b-menu-item\"\n role=\"menuitem\"\n :class=\"conditionalClasses\"\n :disabled=\"disabled\"\n tabindex=\"-1\"\n @click=\"onClick\"\n >\n <template v-if=\"icon\" #iconLeft>\n <component :is=\"icon\" class=\"b-menu-item__icon-left\" aria-hidden=\"true\" />\n </template>\n <template #default>\n <bento-typography el=\"span\" variant=\"body\" :stronger=\"isTitle\" class=\"b-menu-item__primary-text\">\n {{ text }}\n </bento-typography>\n <bento-typography v-if=\"secondaryText\" el=\"span\" variant=\"body\" class=\"b-menu-item__secondary-text\">\n {{ secondaryText }}\n </bento-typography>\n </template>\n <template v-if=\"chevron\" #iconRight><chevron-right-icon aria-hidden=\"true\" /></template>\n </base-button>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import ChevronRightIcon from '@adyen/ui-assets-icons-16/vue/chevron-right';\n import { BaseButton, BentoBaseButtonEvent } from '@/components/internal/base-button';\n import { BentoTypography } from '@/components/typography';\n import { BentoMenuItem } from './menu-item.types';\n\n /**\n * Menu item component to render items in a menu. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item',\n components: { BaseButton, BentoTypography, ChevronRightIcon },\n props: {\n /**\n * menu-item text that gets displayed as the main label\n */\n text: {\n type: String,\n required: true,\n },\n /**\n * menu-item action that gets executed when the MeniItem is clicked\n */\n handler: {\n type: Function as PropType<BentoMenuItem['handler']>,\n required: true,\n },\n /**\n * menu-item text that gets displayed as the secondary label\n */\n secondaryText: {\n type: String,\n default: null,\n },\n /**\n * Optional chevron icon displayed to the right of the menu-item\n */\n chevron: {\n type: Boolean,\n default: false,\n },\n /**\n * Optional icon displayed to the left of the menu-item\n */\n icon: {\n // Types for Vue2 (Object) and Vue3 (Function)\n // TODO: Remove Object when fully migrated to Vue3\n type: [Object, Function] as PropType<BentoMenuItem['icon']>,\n default: null,\n },\n /**\n * Disables menu-item button functionality\n */\n disabled: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays an indent variant od the menu-item\n */\n indent: {\n type: Boolean,\n default: false,\n },\n /**\n * Displays menu-item button as critical\n */\n critical: {\n type: Boolean,\n default: false,\n },\n /**\n * Renders the text in a bold variant\n */\n isTitle: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoBaseButtonEvent.CLICK],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-menu-item--critical': props.critical,\n 'b-menu-item--indent': props.indent,\n }));\n\n const onClick = (e: MouseEvent) => {\n e.stopPropagation();\n props.handler();\n emit(BentoBaseButtonEvent.CLICK);\n };\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n onClick,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item.scss\" />\n","import { BentoButton } from '../button';\n\nexport enum BentoMenuEvent {\n BACK = 'back',\n CLOSE = 'close',\n OPEN = 'open',\n}\n\ntype ButtonProps = InstanceType<typeof BentoButton>['$props'];\n\nexport type BentoMenuButtonProps = {\n variant?: ButtonProps['variant'];\n condensed?: ButtonProps['condensed'];\n disabled?: ButtonProps['disabled'];\n};\n","<template>\n <div class=\"b-menu-list-container\"><slot></slot></div>\n</template>\n\n<script lang=\"ts\">\n import { defineComponent } from 'vue';\n\n /**\n * Menu list container component to set the correct styling in a menu list. For internal use only.\n */\n export default defineComponent({\n name: 'bento-menu-list-container',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-list-container.scss\" />\n","<template>\n <transition name=\"b-sub-menu-item-list__transition\" appear>\n <menu-list-container class=\"b-sub-menu-item-list\">\n <ul\n ref=\"subMenuItemListRefLocal\"\n role=\"menu\"\n class=\"b-sub-menu-item-list__list\"\n @keydown.down.stop=\"focusNext\"\n @keydown.up.stop=\"focusPrevious\"\n @keydown.esc.stop=\"onBackButton\"\n >\n <li\n v-for=\"(item, index) in computedItems\"\n :key=\"`sub-menu-item-list-item-${index}`\"\n :class=\"[\n { 'b-sub-menu-item-list__back-button': index === 0 },\n { 'b-sub-menu-item-list__first-item': index == 1 },\n ]\"\n role=\"none\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"item.handler\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :is-title=\"item.isTitle\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n @click=\"item.clickHandler\"\n />\n </li>\n </ul>\n </menu-list-container>\n </transition>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, onMounted, PropType, ref } from 'vue';\n import ChevronLeftIcon from '@adyen/ui-assets-icons-16/vue/chevron-left';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import messages from '../../messages.json';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n\n /**\n * SubMenuItemList component to render a submenu with the sliding transition. For internal use only.\n */\n export default defineComponent({\n i18n: { messages },\n name: 'sub-menu-item-list',\n components: { MenuItem, MenuListContainer },\n props: {\n items: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n title: {\n type: String,\n required: true,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.BACK],\n setup(props, { emit }) {\n const subMenuItemListRefLocal = ref(null);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.items.length);\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const onBackButton = () => emit(BentoMenuEvent.BACK);\n\n const computedItems = computed(() => {\n const items = props.items?.map(el => ({\n ...el,\n indent: !el.icon,\n isTitle: false,\n clickHandler: closeMenu,\n }));\n return [\n {\n text: props.title,\n secondaryText: null,\n critical: false,\n icon: ChevronLeftIcon,\n isTitle: true,\n disabled: false,\n indent: false,\n handler: onBackButton,\n clickHandler: onBackButton,\n },\n ...items,\n ];\n });\n\n const focusItem = async () => {\n subMenuItemListRefLocal.value?.children?.[subMenuFocusedIndex.value]?.children?.[0]?.focus();\n };\n\n onMounted(async () => {\n // Using setTimeout otherwise the sliding animation doesn't work anymore. The timeout imer is the same as the transition time (0.15s)\n setTimeout(() => focusItem(), 150);\n });\n\n const focusPrevious = () => {\n if (subMenuFocusedIndex.value > 0) {\n subMenuFocusedIndex.value -= 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n subMenuFocusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (subMenuFocusedIndex.value < numberOfItems.value) {\n subMenuFocusedIndex.value += 1;\n if (computedItems.value[subMenuFocusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n subMenuFocusedIndex.value = 0;\n }\n focusItem();\n };\n\n return {\n // Enums\n BentoMenuEvent,\n\n // Values\n subMenuItemListRefLocal,\n subMenuFocusedIndex,\n ChevronLeftIcon,\n computedItems,\n\n // Methods\n closeMenu,\n onBackButton,\n focusPrevious,\n focusNext,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./sub-menu-item-list.scss\" />\n","<template>\n <menu-list-container ref=\"menuItemListWrapperRef\" :style=\"{ height: computedHeight }\">\n <ul\n ref=\"menuItemListRef\"\n class=\"b-menu-item-list\"\n role=\"menu\"\n @keydown.down=\"focusNext\"\n @keydown.up=\"focusPrevious\"\n @keydown.esc=\"closeMenu\"\n @keydown.tab=\"closeMenu\"\n >\n <li\n v-for=\"(item, index) in computedData\"\n :key=\"`menu-item-${index}`\"\n class=\"b-menu-item-list__item\"\n role=\"none\"\n @keydown.right=\"focusRight(item, index)\"\n @keydown.left=\"focusLeft()\"\n >\n <menu-item\n :text=\"item.text\"\n :handler=\"!item.items?.length ? item.handler : () => null\"\n :secondary-text=\"item.secondaryText\"\n :icon=\"item.icon\"\n :chevron=\"!!item.items?.length\"\n :disabled=\"item.disabled\"\n :critical=\"item.critical\"\n :indent=\"item.indent\"\n :tabindex=\"index === subMenuFocusedIndex ? '0' : '-1'\"\n :aria-haspopup=\"!!item.items?.length\"\n :aria-expanded=\"showSubMenu && visibleSubMenuIndex === index\"\n @click=\"toggleMenu(item, index)\"\n />\n <sub-menu-item-list\n v-if=\"item.items?.length && showSubMenu && visibleSubMenuIndex === index\"\n ref=\"subMenuItemListRef\"\n :items=\"item.items\"\n :title=\"item.text\"\n @back=\"onBackButton\"\n @close=\"closeMenu\"\n />\n </li>\n </ul>\n </menu-list-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoMenuItem, MenuItem } from '../menu-item';\n import { BentoMenuEvent } from '../../menu.types';\n import MenuListContainer from '../menu-list-container/menu-list-container.vue';\n import SubMenuItemList from '../sub-menu-item-list/sub-menu-item-list.vue';\n\n /**\n * MenuItem list to be used in the Menu component. For internal use only.\n */\n export default defineComponent({\n name: 'menu-item-list',\n components: { MenuItem, MenuListContainer, SubMenuItemList },\n props: {\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n /**\n * Displays the menu-items of the list in the indent variant. Only applies to elements that don't have an icon to their left.\n */\n indentItems: {\n type: Boolean,\n default: false,\n },\n /**\n * If set to true, focuses the last item on the list instead of the first. Used for accessibility purposes when the menu is opened with the 'up' arrow key.\n */\n focusLastElement: {\n type: Boolean,\n default: false,\n },\n },\n emits: [BentoMenuEvent.CLOSE],\n setup(props, { emit }) {\n const menuItemListRef = ref(null);\n const menuItemListWrapperRef = ref(null);\n const subMenuItemListRef = ref(null);\n const showSubMenu = ref(false);\n const visibleSubMenuIndex = ref(null);\n const focusedIndex = ref(props.focusLastElement ? props.data.length - 1 : 0);\n const subMenuFocusedIndex = ref(0);\n const numberOfItems = ref(props.data.length - 1);\n const hasMenuItemsWithIcon = computed(() => props.data.some(el => el.icon));\n\n const computedData = computed(() => {\n if (props.indentItems || hasMenuItemsWithIcon.value) {\n return props.data.map(el => {\n let indent = false;\n if (!el.icon) {\n indent = true;\n }\n return {\n ...el,\n // eslint-disable-next-line no-param-reassign\n indent,\n };\n });\n }\n return props.data;\n });\n\n const focusItem = () => menuItemListRef.value?.children[focusedIndex.value]?.children[0]?.focus();\n\n const closeMenu = () => emit(BentoMenuEvent.CLOSE);\n\n const toggleMenu = async (item: BentoMenuItem, index: number) => {\n if (item.items) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n } else {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = false;\n closeMenu();\n }\n };\n\n const focusPrevious = () => {\n if (focusedIndex.value > 0) {\n focusedIndex.value -= 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusPrevious();\n }\n } else {\n focusedIndex.value = numberOfItems.value;\n }\n focusItem();\n };\n\n const focusNext = () => {\n if (focusedIndex.value < numberOfItems.value) {\n focusedIndex.value += 1;\n if (computedData.value[focusedIndex.value].disabled) {\n focusNext();\n }\n } else {\n focusedIndex.value = 0;\n }\n focusItem();\n };\n\n const focusRight = (item, index) => {\n if (item?.items?.length) {\n visibleSubMenuIndex.value = index;\n showSubMenu.value = true;\n }\n };\n\n const focusLeft = () => {\n if (visibleSubMenuIndex.value && showSubMenu.value) {\n visibleSubMenuIndex.value = null;\n showSubMenu.value = false;\n }\n };\n\n const onBackButton = () => {\n showSubMenu.value = false;\n visibleSubMenuIndex.value = null;\n // Focus the right element\n focusItem();\n };\n\n const subMenuHeight = computed(() => subMenuItemListRef.value?.[0]?.$el?.offsetHeight);\n\n // When we show the sub menu we need to set the height of the container because of the way the submenus are handled,\n // but the main menu doesn't need a height, as the popover will generate it with the right height\n const computedHeight = computed(() => (showSubMenu.value ? `${subMenuHeight.value}px` : ''));\n\n return {\n // Values\n menuItemListRef,\n menuItemListWrapperRef,\n subMenuItemListRef,\n\n computedData,\n computedHeight,\n\n focusedIndex,\n subMenuFocusedIndex,\n\n showSubMenu,\n visibleSubMenuIndex,\n\n // Methods\n toggleMenu,\n closeMenu,\n focusPrevious,\n focusNext,\n focusRight,\n focusLeft,\n onBackButton,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu-item-list.scss\" />\n","export const MENU_INVERSE_INJECTION_KEY = Symbol('menu inverse style injection key');\n","<template>\n <div\n v-bento-click-outside-directive=\"closeMenu\"\n :class=\"computedClasses\"\n class=\"b-menu\"\n @keydown.down=\"onKeyDown\"\n @keydown.up=\"onKeyUp\"\n @keydown.esc=\"closeMenu\"\n >\n <bento-button\n ref=\"menuButtonRef\"\n aria-haspopup=\"true\"\n v-bind=\"button\"\n :aria-expanded=\"`${showMenu}`\"\n :aria-controls=\"showMenu ? menuId : null\"\n :inverse=\"isInverseColorSet\"\n @click=\"toggleShowMenu\"\n >\n <template #iconLeft>\n <slot>\n <options-vertical-icon :title=\"$t('menuButton')\" />\n </slot>\n </template>\n </bento-button>\n <bento-popover\n v-if=\"menuButtonRef\"\n :id=\"menuId\"\n :open=\"showMenu\"\n class=\"b-menu__popover\"\n :style=\"computedMenuWidth\"\n :target-element=\"menuButtonRef\"\n :position=\"menuPosition\"\n :fixed-positioning=\"menuFixedPositioning\"\n :fallback-position=\"[\n 'bottom-start',\n 'bottom-end',\n 'top-start',\n 'top-end',\n 'right-start',\n 'right-end',\n 'left-start',\n 'left-end',\n ]\"\n without-space\n >\n <menu-item-list :data=\"data\" :focus-last-element=\"isLastElementFocused\" @close=\"closeMenu\" />\n </bento-popover>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, inject, PropType, ref } from 'vue';\n import OptionsVerticalIcon from '@adyen/ui-assets-icons-16/vue/options-vertical';\n import { generateUid } from '@/utils/ts/unique-id';\n import { BentoClickOutsideDirective } from '@/directives';\n import { BentoButton } from '@/components/button';\n import { BentoPopover, BentoPopoverPositions } from '@/components/popover';\n import { BentoMenuItem, MenuItemList } from './components';\n import { BentoMenuButtonProps, BentoMenuEvent } from './menu.types';\n import { MENU_INVERSE_INJECTION_KEY } from './menu.keys';\n import messages from './messages.json';\n\n /**\n * Menu component to render a series of buttons. Csan render nested submenus.\n *\n * @example\n * import { BentoMenu } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoMenu },\n * template: `\n * <bento-menu\n * :data=[\n * { text: 'Menu item text', handler: () => { some code here } },\n * { text: 'Another menu item text', handler: () => { some other code here }, critical: true }\n * ]\n * />\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-menu',\n components: { BentoButton, BentoPopover, MenuItemList, OptionsVerticalIcon },\n directives: { BentoClickOutsideDirective },\n props: {\n /**\n * Object containing props to change the menu button appearance. Accepts the same props present in BentoButton.\n */\n button: {\n type: Object as PropType<BentoMenuButtonProps>,\n default: () =>\n ({\n variant: 'secondary',\n } as BentoMenuButtonProps),\n },\n /**\n * The data to be displayed in the list\n */\n data: {\n type: Array as PropType<BentoMenuItem[]>,\n required: true,\n },\n\n /**\n * The position of where the menu should open.\n */\n menuPosition: {\n type: String as PropType<BentoPopoverPositions | `${BentoPopoverPositions}`>,\n default: BentoPopoverPositions.BOTTOM_START,\n validator: (value: BentoPopoverPositions) => Object.values(BentoPopoverPositions).includes(value),\n },\n\n /**\n * Instructs the menu popover to be visible outside of the containing container.\n * @see {@link https://floating-ui.com/docs/usefloating#strategy}\n */\n menuFixedPositioning: {\n type: Boolean,\n default: false,\n },\n\n /**\n * Sets a custom width for the menu popover.\n */\n menuWidth: {\n type: Number,\n default: null,\n },\n },\n emits: [BentoMenuEvent.CLOSE, BentoMenuEvent.OPEN],\n setup(props, { emit }) {\n const menuButtonRef = ref(null);\n const showMenu = ref(false);\n const isLastElementFocused = ref(false);\n const menuId = generateUid('menu');\n const popoverId = generateUid('menu-popover');\n\n const isInverseColorSet = inject(MENU_INVERSE_INJECTION_KEY, ref(false));\n\n const computedClasses = computed(() => ({\n 'b-menu--inverse': isInverseColorSet.value,\n }));\n\n const computedMenuWidth = computed(() => (props.menuWidth ? { width: `${props.menuWidth}px` } : null));\n\n const openMenu = () => {\n showMenu.value = true;\n emit(BentoMenuEvent.OPEN);\n };\n\n const closeMenu = () => {\n if (showMenu.value) {\n showMenu.value = false;\n menuButtonRef.value.$el.focus();\n emit(BentoMenuEvent.CLOSE);\n }\n };\n\n const toggleShowMenu = (e: MouseEvent) => {\n e.stopPropagation();\n if (!showMenu.value) {\n openMenu();\n } else {\n closeMenu();\n }\n };\n\n const onKeyDown = () => {\n isLastElementFocused.value = false;\n openMenu();\n };\n\n const onKeyUp = () => {\n isLastElementFocused.value = true;\n openMenu();\n };\n\n return {\n // Values\n menuButtonRef,\n menuId,\n popoverId,\n showMenu,\n computedMenuWidth,\n isLastElementFocused,\n\n // Classes\n computedClasses,\n isInverseColorSet,\n\n // Methods\n onKeyDown,\n onKeyUp,\n closeMenu,\n toggleShowMenu,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./menu.scss\" />\n"],"names":["uuid","_sfc_main$5","_sfc_main$4","defineComponent","BaseButton","BentoTypography","ChevronRightIcon","BentoBaseButtonEvent","props","emit","computed","e","BentoMenuEvent","BentoMenuEvent2","_sfc_main$3","_sfc_main$2","messages","MenuItem","MenuListContainer","subMenuItemListRefLocal","ref","subMenuFocusedIndex","numberOfItems","closeMenu","onBackButton","computedItems","items","_a","el","ChevronLeftIcon","focusItem","_e","_d","_c","_b","onMounted","focusPrevious","focusNext","_sfc_main$1","SubMenuItemList","menuItemListRef","menuItemListWrapperRef","subMenuItemListRef","showSubMenu","visibleSubMenuIndex","focusedIndex","hasMenuItemsWithIcon","computedData","indent","toggleMenu","item","index","focusRight","focusLeft","subMenuHeight","computedHeight","MENU_INVERSE_INJECTION_KEY","_sfc_main","BentoButton","BentoPopover","MenuItemList","OptionsVerticalIcon","BentoClickOutsideDirective","BentoPopoverPositions","value","menuButtonRef","showMenu","isLastElementFocused","menuId","generateUid","popoverId","isInverseColorSet","inject","computedClasses","computedMenuWidth","openMenu"],"mappings":";;;;;;;;;;AAKA,IAAAA,IAAA;AAEA,MAAAC,IAAA;AAAA,EACA,eAAA;AACA,SAAA,OAAAD,EAAA,SAAA,GACAA,KAAA;AAAA,EACA;AACA;;;;;;;;;;;;;;qBCsBAE,IAAAC,EAAA;AAAA,EAAA,MAAA;AAAA,EACA,YAAA,EAAA,YAAAC,GAAA,iBAAAC,GAAA,kBAAAC,EAAA;AAAA,EACA,OAAA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,eAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,SAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,MAAA;AAAA;AAAA;AAAA,MAIA,MAAA,CAAA,QAAA,QAAA;AAAA,MAGA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IACA,UAAA;AAAA,MAIA,MAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA;AAAA;AAAA;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@@
|
|
|
1
|
-
{"version":3,"file":"listbox.a117e6d4.js","sources":["../../src/composables/use-checkbox-select-all/use-checkbox-select-all.ts","../../src/composables/use-virtual-list/use-virtual-list.ts","../../src/types/listbox.ts","../../src/components/internal/listbox/components/listbox-option/listbox-option.vue","../../src/components/internal/listbox/components/listbox-single-select-option/listbox-single-select-option.vue","../../src/components/internal/listbox/composables/useListboxKeyboardNavigation.ts","../../src/components/internal/listbox/components/listbox-single-select/listbox-single-select.vue","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.types.ts","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/components/listbox-multi-select-category/listbox-multi-select-category.vue","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.types.ts","../../src/components/internal/listbox/components/listbox-multi-select/components/listbox-multi-select-options/listbox-multi-select-options.vue","../../src/components/internal/listbox/components/listbox-multi-select/listbox-multi-select.vue","../../src/components/internal/listbox/listbox.vue"],"sourcesContent":["import { computed } from 'vue';\nimport type { ComputedRef } from 'vue';\nimport type { BentoListboxMultiSelectValue, Fn } from '@/types';\nimport { BentoListboxOptions } from '@/types';\n\n/**\n * Callback function that alllows to select all the items when called\n * @callback selectAllCallback\n */\n\n/**\n * Callback function that alllows to select all the items when called\n * @callback unselectAllCallback\n */\n\n/**\n * @typedef {Object} UseCheckboxSelectAll\n * @property {Ref<boolean>} isAllSelected - Indicates if all values are selected. Pass this to the :value property.\n * @property {Ref<boolean>} isIndeterminate - Indicates if it is in an indeterminated state (not all values are selected nor unselected). Pass this to the :indeterminate property.\n * @property {(selectedValue: boolean) => void} toggleSelectAll - Handles the select all flow, selects or unselects all and nullifies the indeterminated state. Pass this to the @input method.\n */\n\n/**\n * Composable to handle a 3 way checkbox state that allows to manage\n * a \"select all\", \"unselect all\" and an intermediate state where\n * not all are selected.\n *\n * @example\n * const checkboxVModelRef = ref<number[]>([]);\n *\n * const { isAllSelected, isIndeterminate, toggleSelectAll, updateIndeterminate } = useCheckboxSelectAll(\n * checkboxVModelRef,\n * () => { checkboxVModelRef.value = [...] // select all logic },\n * () => { checkboxVModelRef.value = [] // unselect all logic },\n * );\n * toggleSelectAll(true|false); // Hook this to the @input method\n * updateIndeterminate(totalOfAvailableItems);\n *\n *\n * @param {ComputedRef<BentoListboxMultiSelectValue>} selectedItemsList - Reference to the list of selected values\n * @param {ComputedRef<BentoListboxOptions>} items - Reference to the list of all available items in the dropdown\n * @param {selectAllCallback} selectAll - Callback function that alllows to select all the items when called\n * @param {unselectAllCallback} unselectAll - Callback function that alllows to select all the items when called\n * @returns {UseCheckboxSelectAll} Values to be set to the bento-checkbox value and indeterminate props, as well as functions to update them accordingly\n *\n */\nexport const useCheckboxSelectAll = (\n selectedItemsList: ComputedRef<BentoListboxMultiSelectValue>,\n items: ComputedRef<BentoListboxOptions>,\n selectAll: Fn,\n unselectAll: Fn\n) => {\n const isAllSelected = computed(\n () => !!selectedItemsList.value?.length && selectedItemsList.value?.length === items.value.length\n );\n const isIndeterminate = computed(() => {\n // eslint-disable-next-line eqeqeq\n if (selectedItemsList.value == undefined || selectedItemsList.value.length === 0) {\n return false;\n }\n\n return selectedItemsList.value?.length !== items.value.length;\n });\n\n const toggleSelectAll = (selectedValue: boolean) => {\n if (selectedValue) {\n selectAll();\n } else {\n unselectAll();\n }\n };\n\n return {\n isAllSelected,\n isIndeterminate,\n\n toggleSelectAll,\n };\n};\n","import { computed, onMounted, onUnmounted, Ref, ref, watch } from 'vue';\nimport type {\n UseVirtualListContainerProps,\n UseVirtualListOptions,\n UseVirtualListWrapperProps,\n} from './use-virtual-list.types';\nimport { observeSizeOfElement } from '../../utils/ts/resize';\n\n/**\n * Sets up a virtual scrolling functionality on a container element and a list of items to virtually scroll over.\n * This composables returns the containerProps and wrapperProps objects that should be v-binded onto the container and wrapper elements\n * of the list you wish to virtually scroll.\n *\n * This will return a filtered down list object the user can render based on how much the user has scrolled on the container.\n *\n * @usage\n * <template>\n * <div v-bind=\"containerProps\" @scroll=\"onScroll\">\n * <ul v-bind=\"wrapperProps\">\n * <li v-for=\"item in list\" :key=\"item.index\" style=\"height: 22px\">\n * {{ item.label }}\n * </li>\n * </ul>\n * </div>\n * </template>\n *\n * <script setup lang=\"ts\"\n * import { useVirtualList } from '@adyen/bento-vue2';\n *\n * const DEFAULT_OPTIONS: { label: string }[] = new Array(100)\n * .fill(0)\n * .map((_, index) => ({ label: `Option ${index + 1}` }));\n * const ITEMS = ref(DEFAULT_OPTIONS);\n * const ITEM_HEIGHT = 30;\n *\n * const { containerProps, wrapperProps, list, onScroll } = useVirtualList(ITEMS, { itemHeight: ITEM_HEIGHT });\n * </script>\n *\n *\n * @param items - a reference to a list of items to virtually scroll over.\n * @param options - customises how the Virtual scroller list functions.\n * @param options.itemHeight - the height in pixel or a function that returns the height in pixels for each item.\n * @param options.overscan - number of pre-rendered DOM nodes. Prevents whitespace between items if you scroll very quickly.\n * @param options.prefixHeight - the prefix height of elements present the scrollable area but not present in the items property.\n * @param options.disabled - if set to true, disables the virtual scrolling functionality.\n */\nexport function useVirtualList<T>(\n items: Ref<T[]>,\n { disabled, itemHeight, overscan = 5, prefixHeight }: UseVirtualListOptions\n) {\n const containerRef = ref<HTMLElement | null>(null);\n const list = ref<T[]>([]) as Ref<T[]>;\n const startIndex = ref(0);\n const endIndex = ref(0);\n const containerHeight = ref(0);\n let listObserver;\n\n const wrapperProps = computed<UseVirtualListWrapperProps>(() => {\n const totalHeight =\n typeof itemHeight === 'number'\n ? items.value.length * itemHeight\n : items.value.reduce((sum, _, index) => sum + itemHeight(index), 0);\n\n const offSetTop =\n typeof itemHeight === 'number'\n ? startIndex.value * itemHeight\n : items.value.slice(0, startIndex.value).reduce((sum, _, i) => sum + itemHeight(i), 0);\n\n return {\n style: {\n marginTop: `${offSetTop}px`,\n height: `${totalHeight - offSetTop}px`,\n },\n };\n });\n\n /**\n * Gets the offset for the first item to show within the visible area.\n * @returns offset number.\n */\n const getOffset = () => {\n const prefixHeightIfSet = prefixHeight?.value ?? 0;\n const scrollTop = Math.max(containerRef.value.scrollTop - prefixHeightIfSet, 0);\n if (typeof itemHeight === 'number') {\n return Math.floor(scrollTop / itemHeight);\n }\n\n let sum = 0;\n let offset = 0;\n\n for (let i = 0; i < items.value.length; i += 1) {\n const size = itemHeight(i);\n sum += size;\n if (sum >= scrollTop) {\n offset = i;\n break;\n }\n }\n return offset;\n };\n\n /**\n * Gets the visible number of items based on the container size and item heights.\n * @returns visible number of items.\n */\n const getVisibileNumberOfItems = () => {\n containerHeight.value = containerRef.value.clientHeight;\n if (typeof itemHeight === 'number') {\n return Math.ceil(containerHeight.value / itemHeight);\n }\n\n const start = startIndex.value ?? 0;\n let sum = 0;\n let capacity = 0;\n for (let i = start; i < items.value.length; i += 1) {\n const size = itemHeight(i);\n sum += size;\n capacity = i;\n if (sum > containerHeight.value) {\n break;\n }\n }\n return capacity - start;\n };\n\n const updateVisibleItems = () => {\n if (containerRef.value) {\n const visibleCount = getVisibileNumberOfItems();\n startIndex.value = getOffset();\n endIndex.value = Math.min(startIndex.value + visibleCount + overscan, items.value.length);\n list.value = items.value.slice(startIndex.value, endIndex.value);\n }\n };\n\n const onScroll = () => {\n updateVisibleItems();\n };\n\n if (!disabled) {\n onMounted(() => {\n if (containerRef.value) {\n containerHeight.value = containerRef.value.clientHeight;\n // When the listbox opens we need to update the height\n listObserver = observeSizeOfElement(containerRef.value, ({ clientHeight }) => {\n containerHeight.value = clientHeight;\n updateVisibleItems();\n });\n updateVisibleItems();\n }\n });\n\n onUnmounted(() => {\n listObserver?.disconnect();\n });\n\n watch(\n () => items.value,\n () => {\n updateVisibleItems();\n }\n );\n }\n\n const containerProps: UseVirtualListContainerProps = {\n ref: containerRef,\n style: { overflowY: 'auto' },\n };\n\n if (disabled) {\n return {\n containerRef,\n containerProps,\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n onScroll: () => {},\n list: items,\n };\n }\n\n return {\n containerRef,\n containerProps,\n onScroll,\n list,\n wrapperProps,\n };\n}\n","import { BentoSearchBarItem } from '@/components/search-bar';\nimport { BentoEmptyState } from '@/components/empty-state';\nimport { OmitStrict } from './omit-strict';\nimport { BentoButtonActionObject } from '@/components/button';\nimport { UseVirtualListItemHeight } from '@/composables/use-virtual-list';\n\nexport type BentoListboxValue = string | number;\n\nexport type BentoListboxMultiSelectValue = BentoListboxValue[];\n\nexport interface BentoListboxOptionItem extends BentoSearchBarItem {\n data?: unknown;\n description?: string;\n value: BentoListboxValue;\n items?: Array<BentoListboxOptionItem>; // Reference itself for multi-level options\n}\n\nexport type BentoListboxSelectedValue = BentoListboxValue | BentoListboxMultiSelectValue;\n\nexport type BentoListboxOptions = Array<BentoListboxOptionItem>;\n\nexport type BentoListboxIsOptionDisabled = undefined | ((optionValue: BentoListboxOptionItem) => boolean);\n\nexport enum BentoListboxEvent {\n SELECT = 'select',\n SHOW_MORE = 'show-more',\n ESCAPE = 'escape-pressed',\n CLICK = 'click',\n ENTER = 'enter-pressed',\n SPACE = 'space-pressed',\n TAB = 'tab-pressed',\n CLOSE_DROPDOWN = 'close-dropdown',\n}\n\n/**\n * @deprecated for usage with properties since version 2.0. Use the string literal instead.\n */\nexport enum BentoListboxLazyLoadType {\n AUTOMATIC = 'automatic',\n BUTTON = 'button',\n NONE = 'none',\n}\n\nexport interface BentoListboxSearchOptions {\n /**\n * Custom debounce time. Default: 300\n */\n debounceTime?: number;\n\n /**\n * The event that triggers upon user filtering the listbox items.\n */\n searchEvent: (searchValue: string) => void;\n}\n\nexport type BentoListboxEmptyStateProps = { action: { icon?: any } & BentoButtonActionObject } & OmitStrict<\n InstanceType<typeof BentoEmptyState>['$props'],\n 'variant' | 'image' | 'description'\n>;\n\nexport type BentoListboxVirtulisationOptions = boolean | { itemHeight: UseVirtualListItemHeight };\n","<template>\n <label\n class=\"b-listbox-option\"\n role=\"option\"\n :class=\"conditionalClasses\"\n v-bind=\"$attrs\"\n @click=\"onClick\"\n @keydown.enter=\"onOptionSelected(BentoListboxEvent.ENTER, $event)\"\n @keydown.space=\"onOptionSelected(BentoListboxEvent.SPACE, $event)\"\n @keydown.tab=\"onOptionSelected(BentoListboxEvent.TAB, $event)\"\n >\n <slot></slot>\n </label>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent } from 'vue';\n import { BentoKeyboardNavigationKeyDownEvent, BentoListboxEvent } from '@/types';\n\n /**\n * listbox option wrapper.\n * Contains only styles and allows the Multi-Select and Single-Select DRY the styles.\n *\n * Options and Attributes are inherited (`inheritAttrs: true`)\n *\n * @example\n * <bento-listbox-option\n * ...props\n * ...attrs\n * />\n */\n export default defineComponent({\n name: 'bento-listbox-option',\n props: {\n /**\n * Setting this property to true will disable the option.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * Indicates if the value is selected. Only one element can be selected at a time.\n */\n selected: { type: Boolean, default: false },\n },\n emits: [BentoListboxEvent.CLICK, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit }) {\n const conditionalClasses = computed(() => ({\n 'b-listbox-option--disabled': props.disabled,\n 'b-listbox-option--selected': props.selected,\n }));\n\n const onClick = (e: Event) => {\n emit(BentoListboxEvent.CLICK, e);\n };\n\n const onOptionSelected = (eventName, e: Event) => {\n emit(eventName, e);\n };\n\n return {\n // Enums\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Values\n conditionalClasses,\n\n // Events\n onClick,\n onOptionSelected,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-option.scss\" />\n","<template>\n <bento-listbox-option\n class=\"b-listbox-single-select-option\"\n :disabled=\"disabled\"\n :selected=\"selected\"\n :aria-selected=\"ariaSelected\"\n :aria-disabled=\"ariaDisabled\"\n :tabindex=\"tabIndex\"\n @click=\"onOptionSelected(BentoListboxEvent.SELECT)\"\n @[BentoListboxEvent.ENTER]=\"onOptionSelected(BentoListboxEvent.ENTER)\"\n @[BentoListboxEvent.SPACE]=\"onOptionSelected(BentoListboxEvent.SPACE)\"\n @[BentoListboxEvent.TAB]=\"onOptionSelected(BentoListboxEvent.TAB)\"\n >\n <slot v-bind=\"option\">\n <span class=\"b-listbox-single-select-option__text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"option.description\"\n class=\"b-listbox-single-select-option__description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n <span class=\"b-listbox-single-select-option__check-icon\">\n <checkmark-icon v-show=\"selected\" svg-title=\"selected\" />\n </span>\n </bento-listbox-option>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTypography } from '@/components/typography';\n import { BentoListboxOption } from '../listbox-option';\n import { BentoListboxEvent, BentoListboxOptionItem } from '@/types';\n import CheckmarkIcon from '@adyen/ui-assets-icons-16/vue/checkmark';\n\n /**\n * Listbox option element.\n *\n * @example\n * <bento-listbox-single-select-option\n * v-for=\"option in options\"\n * :key=\"option.value\"\n * :option=\"option\"\n * :selected=\"option.selected\"\n * @select=\"onOptionSelected\"\n * />\n */\n export default defineComponent({\n name: 'bento-listbox-single-select-option',\n components: {\n BentoListboxOption,\n BentoTypography,\n CheckmarkIcon,\n },\n props: {\n /**\n * Setting this property to true will disable the option.\n */\n disabled: { type: Boolean, default: false },\n\n /**\n * The option item that contains all the option item's data.\n * @type {BentoListboxOptionItem}\n */\n option: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n\n /**\n * Indicates if the value is selected. Only one element can be selected at a time.\n */\n selected: { type: Boolean, default: false },\n },\n emits: [BentoListboxEvent.ENTER, BentoListboxEvent.SELECT, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit }) {\n const onOptionSelected = eventName => {\n if (props.disabled) {\n return;\n }\n\n /**\n * Trigerred when an option is clicked or selected via keyboard navigation.\n * Indicates which option was selected.\n *\n * @event {string} - The corresponding event\n * @property {number} selectedValue - Selected option's value\n */\n emit(eventName, props.option.value);\n };\n\n const ariaDisabled = computed(() => (props.disabled ? true : null));\n const ariaSelected = computed(() => (props.selected ? true : null));\n const tabIndex = computed(() => (props.disabled ? -1 : 0));\n\n return {\n // Values\n ariaDisabled,\n ariaSelected,\n tabIndex,\n\n // Enums\n BentoListboxEvent,\n\n // Events\n onOptionSelected,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-single-select-option.scss\" />\n","import { computed, onMounted, ref } from 'vue';\n\nconst enum ListboxKeyboardNavigationMutationDirection {\n INCREASE = 'increase',\n DECREASE = 'decrease',\n}\n\nexport const useListboxKeyboardNavigation = ({ items, isOptionDisabled }, focusItem) => {\n const numberOfItems = computed(() => items.value.length - 1);\n const focusedIndex = ref(0);\n\n onMounted(() => {\n if (isOptionDisabled) {\n focusedIndex.value = items.value.findIndex(el => !isOptionDisabled(el));\n }\n });\n\n const isItemDisabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && isOptionDisabled(items.value[itemIndex]));\n\n const isItemEnabled = (itemIndex: number) =>\n !isOptionDisabled || (!!isOptionDisabled && !isOptionDisabled(items.value[itemIndex]));\n\n const mutateFocusedIndex = (direction: ListboxKeyboardNavigationMutationDirection) => {\n switch (direction) {\n case ListboxKeyboardNavigationMutationDirection.INCREASE:\n focusedIndex.value += 1;\n break;\n case ListboxKeyboardNavigationMutationDirection.DECREASE:\n focusedIndex.value -= 1;\n break;\n default:\n break;\n }\n };\n\n const calculateFocusedIndex = ({ edgeCaseItem, isItemBeforeEdgeCaseItem }, callback, direction) => {\n const isEdgeCaseItem = focusedIndex.value === edgeCaseItem;\n if (isEdgeCaseItem) {\n return;\n }\n if (isItemBeforeEdgeCaseItem) {\n if (isItemEnabled(edgeCaseItem)) {\n mutateFocusedIndex(direction);\n }\n } else {\n mutateFocusedIndex(direction);\n if (isItemDisabled(focusedIndex.value)) {\n callback();\n }\n }\n focusItem(focusedIndex.value);\n };\n\n const moveToNextElement = () => {\n const isIndexSecondToLastItemInArray = focusedIndex.value === numberOfItems.value - 2;\n calculateFocusedIndex(\n {\n isItemBeforeEdgeCaseItem: isIndexSecondToLastItemInArray,\n edgeCaseItem: numberOfItems.value,\n },\n moveToNextElement,\n ListboxKeyboardNavigationMutationDirection.INCREASE\n );\n };\n\n const moveToPreviousElement = () => {\n const IsIndexSecondItemInArray = focusedIndex.value === 1;\n calculateFocusedIndex(\n {\n edgeCaseItem: 0,\n isItemBeforeEdgeCaseItem: IsIndexSecondItemInArray,\n },\n moveToPreviousElement,\n ListboxKeyboardNavigationMutationDirection.DECREASE\n );\n };\n\n const moveToFirstElement = () => {\n focusedIndex.value = 0;\n if (isItemDisabled(focusedIndex.value)) {\n moveToNextElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n const moveToLastElement = () => {\n focusedIndex.value = numberOfItems.value;\n if (isItemDisabled(focusedIndex.value)) {\n moveToPreviousElement();\n } else {\n focusItem(focusedIndex.value);\n }\n };\n\n return {\n moveToFirstElement,\n moveToLastElement,\n moveToNextElement,\n moveToPreviousElement,\n };\n};\n","<template>\n <div v-bento-keyboard-navigation-directive v-on=\"listboxListeners\">\n <bento-listbox-single-select-option\n v-for=\"option in items\"\n :key=\"option.value\"\n ref=\"listboxItemRef\"\n role=\"option\"\n :option=\"option\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :selected=\"option.value === selectedValue\"\n v-on=\"listboxOptionListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-single-select-option>\n </div>\n</template>\n<script lang=\"ts\">\n import { defineComponent, PropType, ref, toRef } from 'vue';\n import { BentoListboxSingleSelectOption } from '../listbox-single-select-option';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n\n /**\n * Listbox single-select options list\n *\n * @example\n * import { BentoListboxMultiSelect } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoListboxMultiSelect },\n * template: `\n * <bento-listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'bento-listbox-single-select',\n components: {\n BentoListboxSingleSelectOption,\n },\n directives: { BentoKeyboardNavigationDirective },\n inheritAttrs: false,\n props: {\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * The `input` value.\n * Providing an empty string will select no options.\n * Set to an empty string `''` if you don't want any of the available options to be selected\n */\n selectedValue: {\n type: [String, Number] as PropType<BentoListboxSelectedValue>,\n default: undefined,\n },\n },\n emits: [BentoListboxEvent.SELECT, BentoListboxEvent.ENTER, BentoListboxEvent.SPACE, BentoListboxEvent.TAB],\n setup(props, { emit, slots }) {\n const listboxItemRef = ref([]);\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const focusItem = (nextFocusedItemIndex: number) => listboxItemRef.value[nextFocusedItemIndex].$el.focus();\n\n // Keyboard navigation\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: toRef(props, 'items'),\n isOptionDisabled: props.isOptionDisabled,\n },\n focusItem\n );\n\n const listboxListeners = {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: moveToPreviousElement,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: moveToNextElement,\n [BentoKeyboardNavigationKeyDownEvent.HOME]: moveToFirstElement,\n [BentoKeyboardNavigationKeyDownEvent.END]: moveToLastElement,\n };\n\n const listboxOptionListeners = {\n [BentoListboxEvent.SELECT]: onOptionSelected(BentoListboxEvent.SELECT),\n [BentoListboxEvent.SPACE]: onOptionSelected(BentoListboxEvent.SPACE),\n [BentoListboxEvent.TAB]: onOptionSelected(BentoListboxEvent.TAB),\n [BentoListboxEvent.ENTER]: onOptionSelected(BentoListboxEvent.ENTER),\n };\n\n return {\n // Enums\n BentoListboxEvent,\n\n // Values\n listboxItemRef,\n slots,\n\n // Methods\n onOptionSelected,\n\n // Keyboard navigation\n listboxListeners,\n listboxOptionListeners,\n };\n },\n });\n</script>\n","export enum ListboxMultiSelectCategoryClass {\n DISABLED = 'disabled',\n}\n\nexport enum ListboxMultiSelectCategoryEvent {\n SELECT_CATEGORY = 'select-category',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <bento-listbox-option class=\"b-listbox-multi-select-category__option\" :class=\"conditionalClass\">\n <bento-checkbox\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n :disabled=\"hasAllPropsDisabled\"\n :aria-label=\"category.label\"\n :value=\"category.value\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span class=\"b-listbox-multi-select-category__label\">\n <bento-typography el=\"span\" class=\"b-listbox-multi-select-category__label-text\">\n {{ category.label }}\n </bento-typography>\n <div\n class=\"b-listbox-multi-select-category__label-chevron\"\n data-testid=\"toggle-listbox\"\n @click.capture=\"toggleOpen\"\n >\n <chevron-up-icon v-if=\"isOpen\" :svg-title=\"chevronTitle\" />\n <chevron-down-icon v-else :svg-title=\"chevronTitle\" />\n </div>\n </span>\n </bento-listbox-option>\n\n <div v-show=\"isOpen\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoTypography } from '@/components/typography';\n import { BentoListboxOption } from '../../../../../listbox-option';\n import {\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxValue,\n } from '@/types';\n import { useCheckboxSelectAll } from '@/composables';\n import {\n ListboxMultiSelectCategoryClass,\n ListboxMultiSelectCategoryEvent,\n } from './listbox-multi-select-category.types';\n import { useI18n } from '@/utils/ts/i18n';\n import ChevronDownIcon from '@adyen/ui-assets-icons-16/vue/chevron-down';\n import ChevronUpIcon from '@adyen/ui-assets-icons-16/vue/chevron-up';\n import messages from './messages.json';\n\n /**\n * Listbox multi-select category list.\n * Allows the rendering of nested lists\n *\n * @example\n * import { ListboxMultiSelectCategory } from '@/internal/listbox';\n *\n * export default {\n * components: { BentoListboxMultiSelectCategory },\n * template: `\n * <listbox-multi-select-category\n * :category=\"option\"\n * :is-option-disabled=\"true\"\n * :selected-items-list=\"['option-1']\"\n * @select-category=\"$emit('select-category', option)\"\n * @unselect-category=\"$emit('unselect-category', option)\"\n * >\n * <listbox-multi-select-options\n * category-items\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :is-multi-level=\"true\"\n * :selected-items-list=\"['option-']\"\n * :searching=\"false\"\n * @toggle-checkbox-selection=\"value => toggleCheckboxSelection(value)\"\n * />\n * </listbox-multi-select-category>\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-listbox-multi-select-category',\n components: {\n BentoCheckbox,\n BentoTypography,\n BentoListboxOption,\n ChevronDownIcon,\n ChevronUpIcon,\n },\n props: {\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n * @property {BentoListboxOptionItem} value.items - Category items list\n */\n category: {\n type: Object as PropType<BentoListboxOptionItem>,\n required: true,\n },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: [Function] as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The `input` value.\n * Providing an empty array will select no options.\n */\n selectedItemsList: {\n type: Array as PropType<BentoListboxValue[]>,\n default: () => [],\n },\n },\n emits: [ListboxMultiSelectCategoryEvent.SELECT_CATEGORY, ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY],\n setup(props, { emit }) {\n const isOpen = ref(false);\n const { t } = useI18n();\n\n // This method should be used to determine if an option is disabled as it works for both vue 2 & 3.\n const vue2Vue3FixedisOptionDisabled = option =>\n props.isOptionDisabled ? props.isOptionDisabled(option) : false;\n\n const hasAllPropsDisabled = computed(() =>\n props.category.items.every(option => vue2Vue3FixedisOptionDisabled(option))\n );\n\n const conditionalClass = computed(() => ({\n [`b-listbox-multi-select-category--${ListboxMultiSelectCategoryClass.DISABLED}`]:\n hasAllPropsDisabled.value,\n }));\n\n const toggleOpen = (event: Event) => {\n event.preventDefault();\n isOpen.value = !isOpen.value;\n };\n\n const optionStates = (option: BentoListboxOptionItem) => {\n const isDisabled = vue2Vue3FixedisOptionDisabled(option);\n const isPreSelected =\n (props.selectedItemsList as BentoListboxMultiSelectValue)?.includes(option.value) || false;\n return { isDisabled, isPreSelected };\n };\n\n const enabledItems = computed(() =>\n props.category.items.filter(option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n })\n );\n\n const visibleSelectedList = computed(\n () =>\n enabledItems.value?.filter(({ value }) =>\n props.selectedItemsList?.includes(value)\n ) as unknown as BentoListboxMultiSelectValue\n );\n\n const chevronTitle = computed(() => {\n const messageName = isOpen.value ? 'categoryOpened' : 'categoryClosed';\n return t(messageName, { category: props.category.label }) as string;\n });\n\n const selectAll = () => {\n emit(ListboxMultiSelectCategoryEvent.SELECT_CATEGORY);\n };\n const unselectAll = () => {\n emit(ListboxMultiSelectCategoryEvent.UNSELECT_CATEGORY);\n };\n\n const { isAllSelected, isIndeterminate, toggleSelectAll } = useCheckboxSelectAll(\n visibleSelectedList,\n enabledItems,\n selectAll,\n unselectAll\n );\n\n return {\n // Values\n chevronTitle,\n conditionalClass,\n hasAllPropsDisabled,\n isOpen,\n isAllSelected,\n isIndeterminate,\n\n // Methods\n toggleOpen,\n toggleSelectAll,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-category.scss\" />\n","export enum ListboxMultiSelectOptionsEvent {\n SELECT_CATEGORY = 'select-category',\n TOGGLE_CHECKBOX_SELECTION = 'toggle-checkbox-selection',\n UNSELECT_CATEGORY = 'unselect-category',\n}\n","<template>\n <div>\n <div v-for=\"option in items\" :key=\"`selected-${option.value}`\">\n <template v-if=\"searching && isMultiLevel\">\n <bento-listbox-option\n class=\"b-listbox-multi-select-options\"\n :class=\"conditionalClasses\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n >\n <bento-checkbox\n :model-value=\"isOptionSelected(option)\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"value => selectSearch(value, option)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n </bento-listbox-option>\n </template>\n\n <template v-else>\n <!-- Category -->\n <template v-if=\"option.items\">\n <listbox-multi-select-category\n :category=\"option\"\n :is-option-disabled=\"isOptionDisabled\"\n :selected-items-list=\"selectedItemsList\"\n @select-category=\"$emit(ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, option)\"\n @unselect-category=\"$emit(ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, option)\"\n >\n <listbox-multi-select-options\n category-items\n :items=\"option.items\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevel\"\n :selected-items-list=\"selectedItemsList\"\n :searching=\"searching\"\n @toggle-checkbox-selection=\"value => toggleCheckboxSelection(value)\"\n />\n </listbox-multi-select-category>\n </template>\n\n <!-- Option -->\n <bento-listbox-option\n v-else\n class=\"b-listbox-multi-select-options\"\n :class=\"conditionalClasses\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n >\n <bento-checkbox\n :model-value=\"selectedItemsList\"\n :aria-label=\"option.label\"\n :disabled=\"isOptionDisabled ? isOptionDisabled(option) : null\"\n :value=\"option.value\"\n @update:model-value=\"toggleCheckboxSelection(option.value)\"\n />\n <slot v-bind=\"option\">\n <span class=\"b-listbox-multi-select__option-text\">\n <bento-typography el=\"span\">{{ option.label }}</bento-typography>\n <bento-typography\n v-if=\"shouldShowDescription(option)\"\n class=\"b-listbox-multi-select__option-description\"\n el=\"span\"\n >\n {{ option.description }}\n </bento-typography>\n </span>\n </slot>\n </bento-listbox-option>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoListboxOption } from '../../../listbox-option';\n import { BentoTypography } from '@/components/typography';\n import { ListboxMultiSelectCategory } from './components/listbox-multi-select-category';\n import {\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxValue,\n } from '@/types';\n import { ListboxMultiSelectOptionsEvent } from './listbox-multi-select-options.types';\n\n /**\n * Listbox multi-select options list\n *\n * @example\n * import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n *\n * export default {\n * components: { ListboxMultiSelect },\n * template: `\n * <listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default defineComponent({\n name: 'listbox-multi-select-options',\n components: {\n BentoCheckbox,\n BentoListboxOption,\n BentoTypography,\n ListboxMultiSelectCategory,\n },\n props: {\n /**\n * Indicates if the items listed are inside a category\n * so they can be padded to right by one level in recursion.\n * Items of categories are automatically defined as \"categoryItems\"\n */\n categoryItems: { type: Boolean, default: false },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * Indicates if the elements options are inside a multi-level category\n */\n isMultiLevel: { type: Boolean, default: false },\n\n /**\n * Flag that indicates that an external search it's being made\n * to filter out the items inside the the multi-select listbox\n *\n * If enabled, hides the \"Select all\" checkbox in \"multiple\" mode.\n */\n searching: { type: Boolean, default: false },\n\n /**\n * List of selected items.\n * Providing an empty array will select no options.\n */\n selectedItemsList: {\n type: Array as PropType<BentoListboxValue[]>,\n default: () => [],\n },\n },\n emits: [\n ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION,\n ListboxMultiSelectOptionsEvent.SELECT_CATEGORY,\n ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY,\n ],\n setup(props, { emit }) {\n const toggleCheckboxSelection = (value: BentoListboxValue) => {\n emit(ListboxMultiSelectOptionsEvent.TOGGLE_CHECKBOX_SELECTION, value);\n };\n\n const isCategory = (option: BentoListboxOptionItem) => !!option.items;\n const shouldShowDescription = (option: BentoListboxOptionItem) => {\n const isSearchingMultiLevel = props.isMultiLevel && props.searching;\n\n return option.description && (!props.isMultiLevel || isSearchingMultiLevel);\n };\n\n const isOptionSelected = option => {\n if (option.items) {\n return !!option.items.find(item => props.selectedItemsList.includes(item.value));\n }\n return props.selectedItemsList.includes(option.value);\n };\n\n // eslint-disable-next-line consistent-return\n const selectSearch = (selectedValue, option) => {\n if (isCategory(option)) {\n return selectedValue\n ? emit(ListboxMultiSelectOptionsEvent.SELECT_CATEGORY, option)\n : emit(ListboxMultiSelectOptionsEvent.UNSELECT_CATEGORY, option);\n }\n\n toggleCheckboxSelection(option.value);\n };\n\n const conditionalClasses = computed(() => ({\n 'b-listbox-multi-select-options__category-option': props.categoryItems,\n }));\n\n return {\n // Values\n conditionalClasses,\n\n // Methods\n isCategory,\n isOptionSelected,\n shouldShowDescription,\n toggleCheckboxSelection,\n selectSearch,\n\n // Enums\n BentoListboxEvent,\n ListboxMultiSelectOptionsEvent,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select-options.scss\" />\n","<template>\n <div v-bento-keyboard-navigation-directive class=\"b-listbox-multi-select\" v-on=\"listboxListeners\">\n <!-- Select all -->\n <bento-listbox-option ref=\"selectAllListboxItemsRef\" class=\"b-listbox-multi-select__option\">\n <bento-checkbox\n :aria-label=\"selectAllCheckboxText\"\n :model-value=\"isAllSelected\"\n :indeterminate=\"isIndeterminate\"\n @update:model-value=\"toggleSelectAll\"\n />\n <bento-typography el=\"span\">\n {{ selectAllCheckboxText }}\n </bento-typography>\n </bento-listbox-option>\n\n <!-- Selected options -->\n <div v-if=\"isAnOptionSelected\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"selectedListboxItemsRef\"\n :items=\"selectedOptions\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"toggleCheckboxSelection(BentoListboxEvent.ENTER, $event)\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </listbox-multi-select-options>\n </div>\n\n <!-- Available options -->\n <div v-show=\"!isAllItemsIncludingDisabled\">\n <hr class=\"b-listbox-multi-select__divider\" />\n\n <listbox-multi-select-options\n ref=\"listboxItemsRef\"\n :items=\"items\"\n :is-option-disabled=\"isOptionDisabled\"\n :is-multi-level=\"isMultiLevelSelect\"\n :searching=\"searching\"\n :selected-items-list=\"selectedItemsList\"\n @toggle-checkbox-selection=\"toggleCheckboxSelection(BentoListboxEvent.SELECT, $event)\"\n @select-category=\"selectAllCategory\"\n @unselect-category=\"unselectAllCategory\"\n @[BentoListboxEvent.SPACE]=\"toggleCheckboxSelection(BentoListboxEvent.SPACE, $event)\"\n @[BentoListboxEvent.TAB]=\"toggleCheckboxSelection(BentoListboxEvent.TAB, $event)\"\n @[BentoListboxEvent.ENTER]=\"toggleCheckboxSelection(BentoListboxEvent.ENTER, $event)\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </listbox-multi-select-options>\n </div>\n </div>\n</template>\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, watch } from 'vue';\n import { BentoCheckbox } from '@/components/checkbox';\n import { BentoListboxOption } from '../listbox-option';\n import { BentoTypography } from '@/components/typography';\n import { useCheckboxSelectAll } from '@/composables';\n import { useI18n } from '@/utils/ts/i18n';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxMultiSelectValue,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n BentoListboxValue,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n import { ListboxMultiSelectOptions } from './components/listbox-multi-select-options';\n\n import messages from './messages.json';\n import { useListboxKeyboardNavigation } from '../../composables/useListboxKeyboardNavigation';\n\n type MessageSchema = (typeof messages)['en-US'];\n\n /**\n * Listbox multi-select options list\n *\n * @example\n * import { BentoListboxMultiSelect } from '@adyen/bento-vue2';\n *\n * export default {\n * components: { BentoListboxMultiSelect },\n * template: `\n * <bento-listbox-multi-select\n * :items=\"[{ label: 'Option 1', value: 'option-1' }]\"\n * :selected-values=\"['option-1']\"\n * />\n * `\n * }\n */\n export default defineComponent({\n i18n: { messages },\n name: 'bento-listbox-multi-select',\n components: {\n BentoCheckbox,\n BentoListboxOption,\n BentoTypography,\n ListboxMultiSelectOptions,\n },\n directives: { BentoKeyboardNavigationDirective },\n props: {\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => false,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }.\n *\n * @property {string} value.label - Text to be displayed in the option\n * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * Flag that indicates that an external search it's being made\n * to filter out the items inside the the multi-select listbox\n *\n * If enabled, hides the \"Select all\" checkbox in \"multiple\" mode.\n */\n searching: { type: Boolean, default: false },\n\n /**\n * The `input` value.\n * Providing an empty array will select no options.\n */\n selectedValues: {\n type: Array as PropType<BentoListboxSelectedValue>,\n default: () => [] as BentoListboxSelectedValue,\n },\n },\n emits: [BentoListboxEvent.SELECT],\n setup(props, { emit, slots }) {\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n\n const selectAllListboxItemsRef = ref(null);\n const selectedListboxItemsRef = ref(null);\n const listboxItemsRef = ref(null);\n\n const selectedItemsList = ref();\n watch(\n () => props.selectedValues,\n () => {\n selectedItemsList.value = ([...((props.selectedValues as Array<unknown>) ?? [])] ||\n []) as BentoListboxMultiSelectValue;\n },\n {\n immediate: true,\n }\n );\n\n const isMultiLevelSelect = computed(() => !!props.items.find(({ items }) => !!items));\n\n const flattenedItemsList = computed(() => {\n if (isMultiLevelSelect.value) {\n return props.items.reduce((acc, val) => {\n if (val.items) {\n acc.push(...val.items.flat());\n } else {\n acc.push(val);\n }\n return acc;\n }, []);\n }\n\n return props.items;\n });\n\n const optionStates = (option: BentoListboxOptionItem) => {\n const isDisabled = props.isOptionDisabled(option);\n const isPreSelected =\n (selectedItemsList.value as BentoListboxMultiSelectValue)?.includes(option.value) || false;\n return { isDisabled, isPreSelected };\n };\n\n // Items that are not disabled and pre-selected disabled items\n const enabledItems = computed(() =>\n props.searching && isMultiLevelSelect\n ? props.items\n : flattenedItemsList.value.filter(option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n })\n );\n\n const visibleSelectedList = computed(\n () =>\n enabledItems.value?.filter(option => {\n if (option.items && isMultiLevelSelect.value && props.searching) {\n const amountOfSelectedCategoryOptions = option.items.filter(categoryOption =>\n ((props.selectedValues as Array<BentoListboxSelectedValue>) ?? []).includes(\n categoryOption.value\n )\n ).length;\n return amountOfSelectedCategoryOptions === option.items.length;\n }\n\n return selectedItemsList.value?.includes(option.value); // Check for category\n }) as BentoListboxMultiSelectValue\n );\n\n const calculateTotalItems = () => {\n if (isMultiLevelSelect.value && !props.searching) {\n return enabledItems.value.length;\n }\n\n return props.items.length;\n };\n\n const selectAllCheckboxText = computed(() => {\n const total = calculateTotalItems();\n const amountSelectedValues = visibleSelectedList.value?.length || 0;\n\n if (amountSelectedValues === 0) {\n return t('selectAll', { total });\n }\n\n return amountSelectedValues === total\n ? t('allSelected', { total })\n : t('numberOfTotalSelected', { number: amountSelectedValues, total });\n });\n\n const selectAll = (selectableItems: BentoListboxOptions) => {\n const filterOutDisabledAndNotPreselectedOptions = option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return (isDisabled && isPreSelected) || !isDisabled;\n };\n\n // Adding or removing this list of values\n const addOrRemoveList = selectableItems\n .filter(filterOutDisabledAndNotPreselectedOptions)\n .filter(item => !selectedItemsList.value.includes(item.value)) // MAKE SURE NOT TO ADD DUPLICATES\n .map(({ value }) => value);\n\n selectedItemsList.value = [...selectedItemsList.value, ...addOrRemoveList];\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\n };\n\n const unselectAll = (selectableItems: BentoListboxOptions) => {\n const findEnabledUnselectedItems = option => {\n const { isDisabled, isPreSelected } = optionStates(option);\n return !(isDisabled && isPreSelected);\n };\n\n const unselectedItemsList = selectableItems\n .filter(findEnabledUnselectedItems)\n .map(({ value }) => value);\n selectedItemsList.value = selectedItemsList.value.filter(item => !unselectedItemsList?.includes(item));\n emit(BentoListboxEvent.SELECT, selectedItemsList.value);\n };\n\n const selectAllItems = () => {\n selectAll(flattenedItemsList.value);\n };\n\n const unselectAllItems = () => {\n unselectAll(flattenedItemsList.value);\n };\n\n const { isAllSelected, isIndeterminate, toggleSelectAll } = useCheckboxSelectAll(\n visibleSelectedList,\n enabledItems,\n selectAllItems,\n unselectAllItems\n );\n\n const selectAllCategory = (category: BentoListboxOptionItem) => {\n selectAll(category.items);\n };\n\n const unselectAllCategory = (category: BentoListboxOptionItem) => {\n unselectAll(category.items);\n };\n\n const toggleCheckboxSelection = (eventName, value: BentoListboxValue) => {\n let exists = false;\n selectedItemsList.value = selectedItemsList.value.filter(option => {\n if (value === option) {\n exists = true;\n return false;\n }\n\n return true;\n });\n\n if (!exists) {\n selectedItemsList.value.push(value);\n }\n emit(eventName, selectedItemsList.value);\n };\n\n const selectedOptions = computed(() => {\n const isOptionSelected = option =>\n (selectedItemsList.value as unknown as Array<string | number>).includes(option.value);\n const categoryOptionsSelected = categoryOptions =>\n !!categoryOptions.find(option => isOptionSelected(option));\n\n const options = props.items.filter(option => {\n // Check selected categories category\n if (option.items && categoryOptionsSelected(option.items)) {\n return true;\n }\n\n return isOptionSelected(option);\n });\n return options;\n });\n\n const isAnOptionSelected = computed(() => selectedOptions.value?.length > 0);\n\n const isAllItemsIncludingDisabled = computed(\n () => visibleSelectedList.value?.length === flattenedItemsList.value?.length\n );\n\n const computedSelectAllListboxItemsRefs = computed(() =>\n selectAllListboxItemsRef.value ? [selectAllListboxItemsRef.value] : []\n );\n\n // Keyboard navigation\n const computedselectedListboxItemsRefs = computed(() =>\n selectedListboxItemsRef.value?.$children?.length ? selectedListboxItemsRef.value.$children : []\n );\n\n const computedlistboxItems = computed(() =>\n listboxItemsRef.value?.$children?.length ? listboxItemsRef.value.$children : []\n );\n\n const computedselectAllItemRefs = computed(() => ({ label: selectAllCheckboxText, value: isAllSelected }));\n\n const computedItems = computed(() => [\n computedselectAllItemRefs,\n ...selectedOptions.value,\n ...flattenedItemsList.value,\n ]);\n\n const focusItem = (nextFocusedItemIndex: number) => {\n const multiSelectListboxItems = [\n ...computedSelectAllListboxItemsRefs.value,\n ...computedselectedListboxItemsRefs.value,\n ...computedlistboxItems.value,\n ];\n multiSelectListboxItems[nextFocusedItemIndex].$el.focus();\n };\n\n const { moveToNextElement, moveToPreviousElement, moveToFirstElement, moveToLastElement } =\n useListboxKeyboardNavigation(\n {\n items: ref(computedItems),\n isOptionDisabled: props.isOptionDisabled,\n },\n focusItem\n );\n\n const listboxListeners = {\n [BentoKeyboardNavigationKeyDownEvent.ARROW_UP]: moveToPreviousElement,\n [BentoKeyboardNavigationKeyDownEvent.ARROW_DOWN]: moveToNextElement,\n [BentoKeyboardNavigationKeyDownEvent.HOME]: moveToFirstElement,\n [BentoKeyboardNavigationKeyDownEvent.END]: moveToLastElement,\n };\n\n return {\n // Refs\n selectAllListboxItemsRef,\n selectedListboxItemsRef,\n listboxItemsRef,\n\n // Values\n isAllSelected,\n isAllItemsIncludingDisabled,\n isAnOptionSelected,\n isIndeterminate,\n isMultiLevelSelect,\n flattenedItemsList,\n selectedItemsList,\n selectAllCheckboxText,\n selectedOptions,\n slots,\n\n // Enums\n BentoListboxEvent,\n\n // Methods\n selectAllCategory,\n toggleCheckboxSelection,\n toggleSelectAll,\n unselectAllCategory,\n\n // Events\n listboxListeners,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox-multi-select.scss\" />\n","<template>\n <div\n :id=\"id\"\n v-bento-keyboard-navigation-directive\n v-bind=\"containerProps\"\n class=\"b-listbox\"\n role=\"listbox\"\n tabindex=\"-1\"\n :aria-busy=\"ariaBusy\"\n :aria-atomic=\"ariaAtomic\"\n :aria-label=\"ariaLabel\"\n :aria-live=\"ariaLive\"\n @scroll=\"onListboxContainerScroll\"\n >\n <div v-bind=\"wrapperProps\">\n <!-- Empty search message -->\n <div v-if=\"isSearchResultEmpty\" class=\"b-listbox__empty-search-message\">\n <bento-empty-state v-if=\"emptyState\" v-bind=\"limitedEmptyStateProps\" />\n <bento-typography v-else el=\"span\">{{ noResultsMessage }}</bento-typography>\n </div>\n\n <template v-else>\n <!-- Multi select -->\n <template v-if=\"multiple\">\n <bento-listbox-multi-select\n ref=\"listboxItemRef\"\n :items=\"items\"\n :selected-values=\"selectedValue\"\n :searching=\"searching\"\n :is-option-disabled=\"isOptionDisabled\"\n v-on=\"listboxListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-multi-select>\n </template>\n\n <!-- Single select -->\n <template v-else>\n <bento-listbox-single-select\n ref=\"listboxItemRef\"\n :items=\"virtualisedItems\"\n :selected-value=\"selectedValue\"\n :is-option-disabled=\"isOptionDisabled\"\n v-on=\"listboxListeners\"\n >\n <template v-for=\"(_, innerSlot) of slots\" #[innerSlot]=\"scope\">\n <slot :name=\"innerSlot\" v-bind=\"scope\" />\n </template>\n </bento-listbox-single-select>\n </template>\n <div v-if=\"shouldDisplayShowMoreButton\" class=\"b-listbox__lazy-load\">\n <bento-loading-button :state=\"loadingButtonState\" variant=\"secondary\" @click.capture=\"emitShowMore\">\n {{ showMoreButtonText }}\n </bento-loading-button>\n </div>\n <div v-else-if=\"loading\" class=\"b-listbox__lazy-load\">\n <bento-loading-indicator />\n </div>\n </template>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType, ref, toRef } from 'vue';\n import {\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEmptyStateProps,\n BentoListboxEvent,\n BentoListboxIsOptionDisabled,\n BentoListboxLazyLoadType,\n BentoListboxOptionItem,\n BentoListboxOptions,\n BentoListboxSelectedValue,\n BentoListboxVirtulisationOptions,\n } from '@/types';\n import { BentoKeyboardNavigationDirective } from '@/directives';\n import { BentoListboxSingleSelect } from './components/listbox-single-select';\n import { BentoListboxMultiSelect } from './components/listbox-multi-select';\n import { BentoTypography } from '@/components/typography';\n import { BentoLoadingIndicator } from '@/components/loading-indicator';\n import { BentoLoadingButton, BentoLoadingButtonState } from '@/components/button';\n import { BentoEmptyState } from '@/components/empty-state';\n import { useI18n } from '@/utils/ts/i18n';\n import { debounce } from '@/utils/ts/debounce';\n import { useVirtualList } from '@/composables/use-virtual-list';\n import type { HTMLAttributes } from 'vue/types/jsx';\n\n import messages from './messages.json';\n\n type MessageSchema = (typeof messages)['en-US'];\n const DEFAULT_DROPDOWN_ITEM_HEIGHT = 36;\n\n /**\n * Listbox container.\n * It lists all the available options.\n *\n * @example\n * <bento-listbox\n * v-slot=\"{label, value}\"\n * :id=\"listboxOptionsContainerId\"\n * :aria-label=\"ariaLabel\"\n * :disabled=\"disabled\"\n * :multiple=\"multiple\"\n * :selected=\"value\"\n * :isOptionDisabled=\"option => option.value === 2\"\n * :items=\"[{\n * { label: 'Option 1', value: 1 },\n * { label: 'Option 2', value: 2 },\n * }]\"\n * @select=\"onOptionSelected\"\n * >\n * </bento-listbox>\n */\n export default defineComponent({\n name: 'bento-listbox',\n components: {\n BentoEmptyState,\n BentoListboxSingleSelect,\n BentoListboxMultiSelect,\n BentoTypography,\n BentoLoadingIndicator,\n BentoLoadingButton,\n },\n directives: { BentoKeyboardNavigationDirective },\n i18n: { messages },\n props: {\n /**\n * Defines a string value that labels an interactive element.\n */\n ariaLabel: { type: String, default: null },\n\n /**\n * Empty state props that will be used with the inner empty state component to be displayed when no search results are found.\n */\n emptyState: {\n type: Object as PropType<BentoListboxEmptyStateProps>,\n default: undefined,\n },\n\n /**\n * Indicates whether there are more items to load\n */\n hasMoreItems: { type: Boolean, default: false },\n\n /**\n * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.\n */\n id: { type: String, required: true },\n\n /**\n * Function that allows the options to be disabled\n *\n * @type {BentoListboxIsOptionDisabled}\n * @param {BentoListboxOptionItem} option - Listbox option object\n * @param {string} option.label - Option's label text\n * @param {string|number} option.value - Option's value\n * @param {unknown} option.data - Option's extra data to be passed to the default slot\n */\n isOptionDisabled: {\n type: Function as PropType<BentoListboxIsOptionDisabled>,\n default: () => undefined,\n },\n\n /**\n * The option elements to populate the listbox with.\n * It must be an array of {@see BentoListboxOptionItem }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n */\n items: {\n type: Array as PropType<BentoListboxOptions>,\n required: true,\n },\n\n /**\n * Indicates if new options are loading.\n */\n loading: { type: Boolean, default: false },\n\n /**\n * The type of `Lazy Load`.\n * Type \"automatic\" will enable infinite scrolling\n * Type \"button\" will enable lazy loading with \"Show more\" button\n */\n lazyLoadType: {\n type: String as PropType<BentoListboxLazyLoadType | `${BentoListboxLazyLoadType}`>,\n default: BentoListboxLazyLoadType.NONE,\n validator: (value: BentoListboxLazyLoadType) => Object.values(BentoListboxLazyLoadType).includes(value),\n },\n\n /**\n * If enabled, the user will be able to select multiple items.\n */\n multiple: { type: Boolean, default: false },\n\n /**\n * Messaged displayed when no items are listed in the listbox\n */\n noResultsMessage: { type: String, required: true },\n\n /**\n * Flag that indicates that an external search it's being made\n * to filter out the items inside the the multi-select listbox\n *\n * If enabled, hides the \"Select all\" checkbox in \"multiple\" mode.\n */\n searching: BentoListboxMultiSelect.props.searching,\n\n /**\n * The `input` value.\n * Providing an empty string or empty array will select no options.\n * Set to an empty string `''` if you don't want any of the available options to be selected for single select\n */\n selectedValue: {\n type: [String, Number, Array] as PropType<BentoListboxSelectedValue>,\n default: undefined,\n },\n\n /**\n * Enables virtual scrolling if set to true or by providing an object with itemHeight function.\n * The itemHeight function is used to calculate the height of rendered item given it's index.\n */\n virtualScroll: {\n type: [Boolean, Object] as PropType<BentoListboxVirtulisationOptions>,\n default: false,\n },\n },\n emits: [\n BentoListboxEvent.SELECT,\n BentoListboxEvent.SPACE,\n BentoListboxEvent.SHOW_MORE,\n BentoListboxEvent.ENTER,\n BentoListboxEvent.ESCAPE,\n BentoListboxEvent.TAB,\n ],\n setup(props, { emit, slots }) {\n const listboxItemRef = ref([]);\n const items = toRef(props, 'items');\n const { t } = useI18n<{ message: MessageSchema }>({ messages });\n const isLazyLoadListbox = computed(() => props.lazyLoadType !== BentoListboxLazyLoadType.AUTOMATIC);\n const hasAutomaticLazyLoader = computed(() => props.lazyLoadType === BentoListboxLazyLoadType.AUTOMATIC);\n\n // Virtual scrolling\n const virtualScrollItemHeight = () => {\n if (typeof props?.virtualScroll === 'object' && props?.virtualScroll?.itemHeight) {\n return props.virtualScroll.itemHeight;\n }\n return DEFAULT_DROPDOWN_ITEM_HEIGHT;\n };\n const {\n containerRef: listboxRef,\n containerProps,\n onScroll: onContainerScroll,\n list: virtualisedItems,\n wrapperProps,\n } = useVirtualList<BentoListboxOptionItem>(items, {\n itemHeight: virtualScrollItemHeight(),\n // Disable virtual scrolling if not enabled or if lazy loading is enabled or if multi-select\n disabled: props?.multiple || props?.virtualScroll === false || props?.lazyLoadType !== 'none',\n });\n\n // Aria a11y\n const ariaAtomic = computed<HTMLAttributes['aria-atomic']>(() =>\n isLazyLoadListbox.value ? 'true' : undefined\n );\n const ariaBusy = computed<HTMLAttributes['aria-busy']>(() =>\n isLazyLoadListbox.value && props.loading ? 'true' : 'false'\n );\n const ariaLive = computed<HTMLAttributes['aria-live']>(() =>\n isLazyLoadListbox.value ? 'polite' : undefined\n );\n\n const onOptionSelected = eventName => (selectedValue: BentoListboxSelectedValue) => {\n emit(eventName, selectedValue);\n };\n\n const emitShowMore = () => {\n emit(BentoListboxEvent.SHOW_MORE);\n };\n\n const emitShowMoreOnScrollEnd = debounce(() => {\n const container = listboxRef.value;\n\n if (!container) {\n return;\n }\n\n const isAtBottom = Math.round(container.scrollTop) + container.clientHeight >= container.scrollHeight;\n\n if (props.hasMoreItems && isAtBottom && !props.loading) {\n emitShowMore();\n }\n });\n\n const onListboxContainerScroll = () => {\n if (hasAutomaticLazyLoader.value) {\n emitShowMoreOnScrollEnd();\n } else {\n onContainerScroll();\n }\n };\n\n const isSearchResultEmpty = computed(() => props.searching && props.items?.length === 0);\n\n const shouldDisplayShowMoreButton = computed(\n () => props.lazyLoadType === BentoListboxLazyLoadType.BUTTON && props.hasMoreItems\n );\n\n const loadingButtonState = computed(() =>\n props.loading ? BentoLoadingButtonState.LOADING : BentoLoadingButtonState.START\n );\n\n const showMoreButtonText = computed(() => (props.loading ? t('loading') : t('showMore')));\n\n const limitedEmptyStateProps = computed<InstanceType<typeof BentoEmptyState>['$props']>(() => ({\n ...props.emptyState,\n variant: 'condensed',\n }));\n\n const listboxListeners = {\n [BentoListboxEvent.SELECT]: onOptionSelected(BentoListboxEvent.SELECT),\n [BentoListboxEvent.SPACE]: onOptionSelected(BentoListboxEvent.SPACE),\n [BentoListboxEvent.TAB]: onOptionSelected(BentoListboxEvent.TAB),\n [BentoListboxEvent.ENTER]: onOptionSelected(BentoListboxEvent.ENTER),\n };\n\n return {\n // Refs\n listboxRef,\n listboxItemRef,\n\n // a11y\n ariaAtomic,\n ariaBusy,\n ariaLive,\n\n // Values\n containerProps,\n isSearchResultEmpty,\n limitedEmptyStateProps,\n loadingButtonState,\n slots,\n shouldDisplayShowMoreButton,\n showMoreButtonText,\n virtualisedItems,\n wrapperProps,\n\n // Enums\n BentoKeyboardNavigationKeyDownEvent,\n BentoListboxEvent,\n\n // Methods\n onListboxContainerScroll,\n onOptionSelected,\n emitShowMore,\n listboxListeners,\n };\n },\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./listbox.scss\" />\n"],"names":["useCheckboxSelectAll","selectedItemsList","items","selectAll","unselectAll","isAllSelected","computed","_a","_b","isIndeterminate","selectedValue","useVirtualList","disabled","itemHeight","overscan","prefixHeight","containerRef","ref","list","startIndex","endIndex","containerHeight","listObserver","wrapperProps","totalHeight","sum","_","index","offSetTop","i","getOffset","prefixHeightIfSet","scrollTop","offset","size","getVisibileNumberOfItems","start","capacity","updateVisibleItems","visibleCount","onScroll","onMounted","observeSizeOfElement","clientHeight","onUnmounted","watch","containerProps","BentoListboxEvent","BentoListboxEvent2","BentoListboxLazyLoadType","BentoListboxLazyLoadType2","_sfc_main$6","defineComponent","props","emit","conditionalClasses","BentoKeyboardNavigationKeyDownEvent","e","eventName","_sfc_main$5","BentoListboxOption","BentoTypography","CheckmarkIcon","onOptionSelected","ariaDisabled","ariaSelected","tabIndex","useListboxKeyboardNavigation","isOptionDisabled","focusItem","numberOfItems","focusedIndex","el","isItemDisabled","itemIndex","isItemEnabled","mutateFocusedIndex","direction","calculateFocusedIndex","edgeCaseItem","isItemBeforeEdgeCaseItem","callback","moveToNextElement","isIndexSecondToLastItemInArray","moveToPreviousElement","IsIndexSecondItemInArray","_sfc_main$4","BentoListboxSingleSelectOption","BentoKeyboardNavigationDirective","slots","listboxItemRef","nextFocusedItemIndex","moveToFirstElement","moveToLastElement","toRef","listboxListeners","listboxOptionListeners","ListboxMultiSelectCategoryClass","ListboxMultiSelectCategoryClass2","ListboxMultiSelectCategoryEvent","ListboxMultiSelectCategoryEvent2","_sfc_main$3","messages$2","BentoCheckbox","ChevronDownIcon","ChevronUpIcon","isOpen","t","useI18n","vue2Vue3FixedisOptionDisabled","option","hasAllPropsDisabled","conditionalClass","toggleOpen","event","optionStates","isDisabled","isPreSelected","enabledItems","visibleSelectedList","value","chevronTitle","messageName","toggleSelectAll","ListboxMultiSelectOptionsEvent","ListboxMultiSelectOptionsEvent2","_sfc_main$2","ListboxMultiSelectCategory","toggleCheckboxSelection","isCategory","shouldShowDescription","isSearchingMultiLevel","isOptionSelected","item","selectSearch","_sfc_main$1","messages$1","ListboxMultiSelectOptions","selectAllListboxItemsRef","selectedListboxItemsRef","listboxItemsRef","isMultiLevelSelect","flattenedItemsList","acc","val","categoryOption","calculateTotalItems","selectAllCheckboxText","total","amountSelectedValues","selectableItems","filterOutDisabledAndNotPreselectedOptions","addOrRemoveList","findEnabledUnselectedItems","unselectedItemsList","selectAllItems","unselectAllItems","selectAllCategory","category","unselectAllCategory","exists","selectedOptions","categoryOptionsSelected","categoryOptions","isAnOptionSelected","isAllItemsIncludingDisabled","computedSelectAllListboxItemsRefs","computedselectedListboxItemsRefs","computedlistboxItems","computedselectAllItemRefs","computedItems","DEFAULT_DROPDOWN_ITEM_HEIGHT","_sfc_main","BentoEmptyState","BentoListboxSingleSelect","BentoListboxMultiSelect","BentoLoadingIndicator","BentoLoadingButton","messages","isLazyLoadListbox","hasAutomaticLazyLoader","virtualScrollItemHeight","listboxRef","onContainerScroll","virtualisedItems","ariaAtomic","ariaBusy","ariaLive","emitShowMore","emitShowMoreOnScrollEnd","debounce","container","isAtBottom","onListboxContainer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oBAAAH;AAAA,MACA,OAAA3G;AAAA,MACA,6BAAA0G;AAAA,MACA,oBAAAG;AAAA,MACA,kBAAAd;AAAA,MACA,cAAAjK;AAAA;AAAA,MACA,qCAAAiC;AAAA,MAGA,mBAAAT;AAAA;AAAA,MACA,0BAAAkJ;AAAA,MAGA,kBAAAlI;AAAA,MACA,cAAA6H;AAAA,MACA,kBAAA7F;AAAA,IACA;AAAA,EACA;AAEA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.b8929659.js","sources":["../../src/directives/tooltip/tooltip.types.ts","../../src/types/utils-events.ts","../../src/components/tooltip/tooltip.vue","../../src/directives/tooltip/tooltip.ts"],"sourcesContent":["import { PopperContainerPositionBasic } from '@/components/popper-container';\nimport type { DirectiveBinding } from 'vue/types/options';\n\nexport const BentoTooltipPosition = { ...PopperContainerPositionBasic };\nexport type BentoTooltipPosition = PopperContainerPositionBasic;\n\nexport enum BentoTooltipState {\n HIDDEN = 'hidden',\n}\n\nexport interface BentoTooltipDirectiveBinding extends Readonly<DirectiveBinding> {\n readonly value: string;\n}\n","import type { Vue } from 'vue-demi';\n\nexport interface ListenOptions {\n capture?: boolean;\n passive?: boolean;\n once?: boolean;\n self?: boolean;\n vm?: Vue;\n onCleanup?: () => void;\n}\n\nexport enum EventKey {\n ESCAPE = 'Escape',\n ENTER = 'Enter',\n ARROW_LEFT = 'ArrowLeft',\n ARROW_UP = 'ArrowUp',\n ARROW_RIGHT = 'ArrowRight',\n ARROW_DOWN = 'ArrowDown',\n PAGE_UP = 'PageUp',\n PAGE_DOWN = 'PageDown',\n END = 'End',\n HOME = 'Home',\n}\n\n/**\n * @deprecated `Event.keyCode` is deprecated. Use `EventKey` instead\n */\nexport enum KeyCode {\n ESCAPE = 27,\n ENTER = 13,\n ARROW_LEFT = 37,\n ARROW_UP = 38,\n ARROW_RIGHT = 39,\n ARROW_DOWN = 40,\n PAGE_UP = 33,\n PAGE_DOWN = 34,\n END = 35,\n HOME = 36,\n}\n","<template>\n <popper-container\n :id=\"id\"\n :aria-role=\"PopperContainerAriaRole.TOOLTIP\"\n :aria-hidden=\"!isShown\"\n :arrow=\"{ classes: ['b-tooltip__arrow'] }\"\n :class=\"conditionalClasses\"\n :fallback-position=\"['top', 'bottom', 'right', 'left']\"\n :is-hidden=\"!isShown\"\n :offset=\"[0, 4]\"\n :position=\"position\"\n :tabindex=\"tabIndex\"\n :target-element=\"targetElement\"\n class=\"b-tooltip\"\n >\n <bento-typography el=\"span\" variant=\"caption\">\n {{ content }}\n </bento-typography>\n </popper-container>\n</template>\n\n<script lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoTooltipPosition, BentoTooltipState } from '@/directives/tooltip/tooltip.types';\n import { PopperContainer, PopperContainerAriaRole } from '@/components/popper-container';\n import { BentoTypography } from '@/components/typography';\n import { VueNodeElement } from '@/types';\n\n /**\n * Tooltip container, to be used internally to render the tooltip container where the text is shown.\n */\n export const Tooltip = {\n name: 'tooltip',\n components: { BentoTypography, PopperContainer },\n props: {\n /**\n * The tooltip's id. Necessary for accessibility purposes.\n */\n id: { type: String, default: null },\n /**\n * Tooltip's target reference to the DOM element or Vue component.\n * The tooltip will position itself relatively to target element, in the specified position.\n */\n targetElement: { type: [Element, Object] as PropType<VueNodeElement>, required: true },\n /**\n * Tooltip's position relative to the target element.\n * Possible values are: 'top', 'bottom', 'left' and 'right'.\n */\n position: {\n type: String as PropType<BentoTooltipPosition>,\n default: BentoTooltipPosition.TOP,\n validator: value => Object.values(BentoTooltipPosition).includes(value as BentoTooltipPosition),\n },\n /**\n * Tooltip's offset.\n * If specified, the tooltip will have an offset in pixels between it and the target element\n * in specified position.\n */\n offset: { type: Number, default: 0 },\n /**\n * Tooltip's text content.\n */\n content: { type: String, required: true },\n /**\n * Shows / Hides the Tooltip component\n */\n isShown: { type: Boolean, default: false },\n },\n setup(props) {\n const conditionalClasses = computed(() => ({\n [`b-tooltip--${BentoTooltipState.HIDDEN}`]: !props.isShown,\n }));\n\n const tabIndex = computed((): number => (props.isShown ? 1 : -1));\n\n return {\n // Enums\n PopperContainerAriaRole,\n\n // Values\n conditionalClasses,\n tabIndex,\n };\n },\n };\n\n export default defineComponent(Tooltip);\n</script>\n\n<style lang=\"scss\" scoped src=\"./tooltip.scss\" />\n","import { nextTick, reactive } from 'vue';\nimport { listen } from '@/utils/ts/events';\nimport { generateUid } from '@/utils/ts/unique-id';\nimport { EventKey } from '@/types/utils-events';\nimport { BentoTooltipDirectiveBinding, BentoTooltipPosition } from './tooltip.types';\nimport { createApp, h, isVue2, Vue2 } from 'vue-demi';\nimport BentoTooltip from '@/components/tooltip/tooltip.vue';\n\ninterface TooltipInstance {\n target: HTMLElement;\n content: string;\n position: BentoTooltipPosition;\n removeListeners: Array<() => void>;\n}\n\n/**\n * Tooltip directive to render a tooltip on a given HTML element or component.\n *\n * @usage\n * import { BentoTooltipDirective, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltipDirective },\n * template: `\n * <bento-button\n * v-bento-tooltip-directive:BentoTooltipPosition.BOTTOM=\"refToTextContent\"\n * >\n * Button text\n * </bento-button>\n * `,\n * }\n */\nconst tooltipInstances: Array<TooltipInstance> = [];\nconst ariaDescribedByAttr = 'aria-describedby';\nconst tooltipId = generateUid('tooltip');\n\nlet tooltipVNode;\n\n// Reusable Tooltip component instance.\nlet tooltip;\n// Global visibility state to prevent tooltips from showing after it being instructed to hide\nlet open = false;\n\nconst tooltipProps = reactive({\n targetElement: null,\n content: 'START_MESSAGE',\n id: tooltipId,\n position: undefined,\n isShown: false,\n});\n\n/**\n * Creates a new Tooltip component instance and inserts it into DOM.\n * @param {HTMLElement} el the target element for the Tooltip\n * @internal\n */\nconst createTooltip = (el: HTMLElement) => {\n // Sets the target's tabindex so as to make the tooltip interactive via keyboard navigation\n el.setAttribute('tabindex', '0');\n\n if (isVue2) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for Vue method in Vue 3 but this code only executes in vue 2 so ignoring.\n const TooltipComponent = Vue2.extend(BentoTooltip);\n tooltip = new TooltipComponent({ propsData: { targetElement: el, content: '', id: tooltipId } }).$mount();\n document.body.appendChild(tooltip.$el);\n } else {\n tooltipProps.targetElement = el;\n tooltip = createApp({\n components: { BentoTooltip },\n setup() {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore: Type error for h method in Vue 2 but this code only executes in vue 3 so ignoring.\n return () => h(BentoTooltip, { ...tooltipProps }, '');\n },\n });\n tooltipVNode = document.createElement('div');\n tooltipVNode.id = 'tooltip-parent';\n document.body.appendChild(tooltipVNode);\n tooltip.mount('#tooltip-parent');\n }\n};\n\n/**\n * Removes Tooltip component instance from the DOM and destroys it.\n * @internal\n */\nconst destroyTooltip = () => {\n if (isVue2) {\n document.body.removeChild(tooltip.$el);\n tooltip.$destroy();\n } else {\n tooltip.unmount();\n document.body.removeChild(tooltipVNode);\n }\n\n tooltip = undefined;\n};\n\n/**\n * Returns tooltip position based on the specified argument.\n * By default returns 'top' if no argument is specified.\n * @param {BentoTooltipDirectiveBinding} binding Directive binding object.\n * @returns {string} Tooltip position.\n * @internal\n */\nconst getTooltipPosition = (binding: BentoTooltipDirectiveBinding): BentoTooltipPosition =>\n Object.values(BentoTooltipPosition).includes(binding.arg as BentoTooltipPosition)\n ? (binding.arg as BentoTooltipPosition)\n : BentoTooltipPosition.TOP;\n\n/**\n * Get the correct Tooltip instance for the given target element\n * @param {HTMLElement} el the target element for the Tooltip\n * @returns\n */\nconst getTooltipInstanceForTarget = (el: HTMLElement): TooltipInstance =>\n tooltipInstances.find(\n ctx =>\n // isEqualNode doesn't work correct for svg element, hence the second check here\n ctx.target.isEqualNode(el) && ctx.target === el\n );\n\n/**\n * On mouse enter event updates tooltip with correct content and position, and shows tooltip.\n * @param {?HTMLElement} el - Target element\n * @internal\n */\nconst showTooltip = (el?: HTMLElement) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n\n // If tooltip content is empty – do not show the tooltip\n if (!tooltipInstance.content || !el) {\n return;\n }\n\n if (el) {\n el.setAttribute(ariaDescribedByAttr, tooltipId);\n }\n\n // If the Tooltip is inside a dialog, move tooltip element inside of it\n // It gets restored to <body> when it gets hidden\n let isDialogOpen = false;\n document.querySelectorAll('dialog').forEach(node => {\n isDialogOpen = node?.open || isDialogOpen;\n });\n\n if (isDialogOpen) {\n if (isVue2) {\n el.after(tooltip.$el);\n // eslint-disable-next-line no-underscore-dangle\n } else if (tooltip?._instance?.vnode?.el) {\n // eslint-disable-next-line no-underscore-dangle\n el.after(tooltip?._instance?.vnode?.el);\n }\n isDialogOpen = false;\n }\n\n open = true;\n\n tooltip.content = tooltipInstance.content;\n tooltip.position = tooltipInstance.position;\n\n tooltipProps.content = tooltipInstance.content;\n tooltipProps.position = tooltipInstance.position;\n\n // Do calculations on a next tick, otherwise tooltip position calculations will be wrong\n nextTick(() => {\n // Do not open tooltip if it has been instructed to hide in process\n if (!open) {\n return;\n }\n tooltip.targetElement = el;\n tooltip.isShown = true;\n\n tooltipProps.targetElement = el;\n tooltipProps.isShown = true;\n });\n};\n\n/**\n * On mouse leave event hides the tooltip.\n * @internal\n */\nconst hideTooltip = (el?: HTMLElement) => {\n // Restore the tooltip element to body if it got move out of <body>\n if (tooltip.$el?.parentElement?.tagName && tooltip.$el?.parentElement?.tagName !== 'BODY') {\n document.body.appendChild(tooltip.$el);\n }\n\n open = false;\n tooltip.isShown = false;\n tooltipProps.isShown = false;\n if (el) {\n el.removeAttribute(ariaDescribedByAttr);\n }\n};\n\nconst tooltipBind = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n // eslint-disable-next-line no-prototype-builtins\n if (!binding.hasOwnProperty('value') || binding.value) {\n // Create Tooltip component singleton instance\n if (tooltipInstances.length === 0) {\n createTooltip(el);\n }\n\n const show = () => showTooltip(el);\n const hide = () => hideTooltip(el);\n\n // Create and store context object, which has directive related handlers and content.\n const tooltipInstance: TooltipInstance = {\n target: el,\n content: binding.value,\n position: getTooltipPosition(binding),\n removeListeners: [\n listen(el, 'mouseenter', show),\n listen(el, 'mouseleave', hide),\n listen(el, 'focus', show),\n listen(el, 'blur', hide),\n listen(el, 'keydown', evt => {\n const keyboardEvent = <KeyboardEvent>evt;\n if (keyboardEvent.key === EventKey.ESCAPE) {\n hide();\n }\n }),\n ],\n };\n\n tooltipInstances.push(tooltipInstance);\n }\n};\n\nconst tooltipUpdate = (el: HTMLElement, binding: BentoTooltipDirectiveBinding) => {\n const tooltipInstance = getTooltipInstanceForTarget(el);\n if (tooltipInstance) {\n // Update tooltip content value if it is changed\n if (tooltipInstance?.content !== binding.value) {\n tooltipInstance.content = binding.value;\n // If tooltip is currently shown for current element – update tooltip's content value\n if (tooltip.isShown && tooltip.targetElement.isEqualNode(el)) {\n if (!tooltipInstance.content) {\n tooltip.isShown = false;\n } else {\n tooltip.content = binding.value;\n }\n }\n }\n // Update tooltip position if it is changed\n if (tooltipInstance.position !== binding.arg) {\n const position = getTooltipPosition(binding);\n tooltipInstance.position = position;\n tooltip.position = position;\n }\n } else if (!tooltipInstance && binding.value) {\n // If I don't have a tooltip instance yet but the value passed was updated\n tooltipBind(el, binding);\n }\n};\n\nconst tooltipUnbind = (el: HTMLElement) => {\n const context = getTooltipInstanceForTarget(el);\n\n // Prevent unbinding/removing when there's nothing to unbind, leads to stack overflow errors\n if (!context) {\n return;\n }\n\n context.removeListeners.forEach(removeListener => {\n removeListener();\n });\n\n // If el is removed while tooltip is displayed, the tooltip doesnt hide as\n // there is no el to trigger mouseleave/blur.\n hideTooltip();\n\n tooltipInstances.splice(tooltipInstances.indexOf(context), 1);\n\n // If all the elements using the directive are removed, then no point having\n // the component on the page.\n if (tooltipInstances.length === 0) {\n destroyTooltip();\n }\n};\n\n/**\n * This directive allows you to bind a tooltip to an element.\n * Tooltip can be configured to be shown in one of four positions: 'top', 'left', 'right' and 'bottom'.\n *\n * @example\n * import { BentoTooltipDirective as BentoTooltip, BentoTooltipPosition } from '@adyen/bento-vue2';\n *\n * export default {\n * directives: { BentoTooltip },\n * methods: {\n * contentExpression() {\n * return 'tooltip content';\n * },\n * },\n * template: `<div>\n * <div v-bento-tooltip:left=\"refToTooltipContent\"></div>\n * <div v-bento-tooltip:[TooltipPosition.BOTTOM]=\"refToTooltipContent\"></div>\n *\n * <!-- If you don't specify the position then by default it's `TooltipPosition.TOP` -->\n * <div v-bento-tooltip=\"refToTooltipContent\"></div>\n *\n * <!-- Tooltip content can also be a data property or a method or a computed property as well -->\n * <div v-bento-tooltip=\"contentExpression()\"></div>\n * </div>`,\n * };\n */\nexport const BentoTooltipDirective = {\n // Vue 2 Directive hooks\n bind(el, binding) {\n tooltipBind(el, binding);\n },\n update(el, binding) {\n tooltipUpdate(el, binding);\n },\n unbind(el) {\n tooltipUnbind(el);\n },\n // Vue 3 Directive hooks\n beforeMount(el, binding) {\n tooltipBind(el, binding);\n },\n mounted(el, binding) {\n tooltipUpdate(el, binding);\n },\n updated(el, binding) {\n tooltipUpdate(el, binding);\n },\n unmounted(el) {\n tooltipUnbind(el);\n },\n};\n"],"names":["BentoTooltipPosition","PopperContainerPositionBasic","BentoTooltipState","BentoTooltipState2","EventKey","EventKey2","KeyCode","KeyCode2","Tooltip","BentoTypography","PopperContainer","value","props","conditionalClasses","computed","tabIndex","PopperContainerAriaRole","_sfc_main","defineComponent","tooltipInstances","ariaDescribedByAttr","tooltipId","generateUid","tooltip","open","tooltipProps","reactive","createTooltip","el","TooltipComponent","Vue2","BentoTooltip","destroyTooltip","getTooltipPosition","binding","getTooltipInstanceForTarget","ctx","showTooltip","tooltipInstance","isDialogOpen","node","nextTick","hideTooltip","_b","_a","_d","_c","tooltipBind","show","hide","listen","evt","tooltipUpdate","position","tooltipUnbind","context","removeListener","BentoTooltipDirective"],"mappings":";;;;;;;;AAGa,MAAAA,IAAA,EAAA,GAAAC,EAAA;AAGD,IAAAC,IAAA,kBAAAC,OACR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AM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,OAAAN,GAAA;AAEI,IAAA0B,EAAA1B,CAAA;AAAA,EAAgB;AAAA;AAAA,EACpB,YAAAA,GAAAM,GAAA;AAGI,IAAAa,EAAAnB,GAAAM,CAAA;AAAA,EAAuB;AAAA,EAC3B,QAAAN,GAAAM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,QAAAN,GAAAM,GAAA;AAEI,IAAAkB,EAAAxB,GAAAM,CAAA;AAAA,EAAyB;AAAA,EAC7B,UAAAN,GAAA;AAEI,IAAA0B,EAAA1B,CAAA;AAAA,EAAgB;AAExB;"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { computed as a } from "vue";
|
|
2
|
-
import { BentoCountryVariant as o, useCountryName as l, useCountryCapital as n, useCountryPhoneCode as s } from "../country.js";
|
|
3
|
-
import { u as C } from "./i18n.eb5b985b.js";
|
|
4
|
-
const y = (r, u) => {
|
|
5
|
-
const { locale: t } = C(void 0, !0);
|
|
6
|
-
return a(() => {
|
|
7
|
-
switch (r == null ? void 0 : r.value) {
|
|
8
|
-
case o.PHONE_CODE:
|
|
9
|
-
return u.value.map(({ value: e }) => ({
|
|
10
|
-
value: e,
|
|
11
|
-
label: s(e).value
|
|
12
|
-
}));
|
|
13
|
-
case o.CAPITAL:
|
|
14
|
-
return u.value.map(({ value: e }) => ({
|
|
15
|
-
value: e,
|
|
16
|
-
label: n(e, t).value
|
|
17
|
-
}));
|
|
18
|
-
case o.NAME:
|
|
19
|
-
return u.value.map(({ value: e }) => ({ value: e, label: l(e, t).value }));
|
|
20
|
-
case o.CUSTOM:
|
|
21
|
-
default:
|
|
22
|
-
return u.value;
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export {
|
|
27
|
-
y as u
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=useCountryItems.34ac8740.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|