@adyen/bento-vue2 1.52.0 → 1.54.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/index.d.ts +2104 -2027
- package/dist/action-bar.js +1 -1
- package/dist/assets/accordion-item.css +1 -1
- package/dist/assets/action-bar.css +1 -1
- package/dist/assets/base-modal.css +1 -1
- package/dist/assets/button-actions.css +1 -1
- package/dist/assets/calendar.css +1 -1
- package/dist/assets/card.css +1 -1
- package/dist/assets/checkbox.css +1 -1
- package/dist/assets/dashed-underline.css +1 -1
- package/dist/assets/data-grid.css +1 -1
- package/dist/assets/dialog-page.css +1 -1
- package/dist/assets/dropdown.css +1 -1
- package/dist/assets/file-uploader.css +1 -1
- package/dist/assets/filter-bar.css +1 -1
- package/dist/assets/header-with-views.css +1 -0
- package/dist/assets/input-field-password.css +1 -1
- package/dist/assets/inspector.css +1 -1
- package/dist/assets/link.css +1 -1
- package/dist/assets/menu.css +1 -1
- package/dist/assets/modal-fullscreen.css +1 -1
- package/dist/assets/pagination.css +1 -1
- package/dist/assets/payment-method.css +1 -1
- package/dist/assets/popover.css +1 -1
- package/dist/assets/sidepanel.css +1 -1
- package/dist/assets/summary-grid.css +1 -0
- package/dist/assets/tabs.css +1 -1
- package/dist/assets/textarea.css +1 -1
- package/dist/assets/use-cached-selected-values.css +1 -1
- package/dist/button.js +1 -1
- package/dist/card.js +1 -1
- package/dist/checkbox.js +2 -2
- package/dist/chunks/{action-bar.DuJkjAt1.js → action-bar.CH1Mswou.js} +5 -5
- package/dist/chunks/{action-bar.DuJkjAt1.js.map → action-bar.CH1Mswou.js.map} +1 -1
- package/dist/chunks/{base-modal.CiTysydg.js → base-modal.kHzGyWf6.js} +4 -4
- package/dist/chunks/{base-modal.CiTysydg.js.map → base-modal.kHzGyWf6.js.map} +1 -1
- package/dist/chunks/bin.DuebwJYu.js +24 -0
- package/dist/chunks/bin.DuebwJYu.js.map +1 -0
- package/dist/chunks/{button-actions-with-menu.B9oXYIgo.js → button-actions-with-menu.mqNecwDb.js} +5 -5
- package/dist/chunks/{button-actions-with-menu.B9oXYIgo.js.map → button-actions-with-menu.mqNecwDb.js.map} +1 -1
- package/dist/chunks/{button-actions.DAvSJtOB.js → button-actions.XlUhz42n.js} +42 -100
- package/dist/chunks/{button-actions.DAvSJtOB.js.map → button-actions.XlUhz42n.js.map} +1 -1
- package/dist/chunks/{calendar.Bq67h02Z.js → calendar.D4dMXwc0.js} +4 -4
- package/dist/chunks/{calendar.Bq67h02Z.js.map → calendar.D4dMXwc0.js.map} +1 -1
- package/dist/chunks/{card.AQO_BjGb.js → card.BT04hjvV.js} +2 -2
- package/dist/chunks/{card.AQO_BjGb.js.map → card.BT04hjvV.js.map} +1 -1
- package/dist/chunks/{checkbox-group.CqSIn-lG.js → checkbox-group.DZF4UIym.js} +4 -4
- package/dist/chunks/{checkbox-group.CqSIn-lG.js.map → checkbox-group.DZF4UIym.js.map} +1 -1
- package/dist/chunks/{checkbox.BeYtbfPv.js → checkbox.DloQJI-K.js} +57 -51
- package/dist/chunks/checkbox.DloQJI-K.js.map +1 -0
- package/dist/chunks/{click-outside.DSszkIvs.js → click-outside.C1Ud8AA2.js} +2 -2
- package/dist/chunks/{click-outside.DSszkIvs.js.map → click-outside.C1Ud8AA2.js.map} +1 -1
- package/dist/chunks/{code-snippet.CW42FdpP.js → code-snippet.B3GhZo7r.js} +5 -5
- package/dist/chunks/{code-snippet.CW42FdpP.js.map → code-snippet.B3GhZo7r.js.map} +1 -1
- package/dist/chunks/{controls-group.D0_cJaFF.js → controls-group.C-HKhH1m.js} +2 -2
- package/dist/chunks/{controls-group.D0_cJaFF.js.map → controls-group.C-HKhH1m.js.map} +1 -1
- package/dist/chunks/{copy.2iD8aI5a.js → copy.k18tXmP1.js} +3 -3
- package/dist/chunks/{copy.2iD8aI5a.js.map → copy.k18tXmP1.js.map} +1 -1
- package/dist/chunks/{dashboard-section.Cmulh6WM.js → dashboard-section.DlIwNKkx.js} +4 -4
- package/dist/chunks/{dashboard-section.Cmulh6WM.js.map → dashboard-section.DlIwNKkx.js.map} +1 -1
- package/dist/chunks/{dashed-underline.eMF75SuT.js → dashed-underline.BbQIbZfu.js} +8 -8
- package/dist/chunks/{dashed-underline.eMF75SuT.js.map → dashed-underline.BbQIbZfu.js.map} +1 -1
- package/dist/chunks/{data-grid-template.CdHnPE1-.js → data-grid-template.BJTWe6Ty.js} +3 -3
- package/dist/chunks/{data-grid-template.CdHnPE1-.js.map → data-grid-template.BJTWe6Ty.js.map} +1 -1
- package/dist/chunks/{data-grid.DedjAz4_.js → data-grid.BjtvKzyw.js} +213 -203
- package/dist/chunks/data-grid.BjtvKzyw.js.map +1 -0
- package/dist/chunks/{date-picker.BdMr3Sn2.js → date-picker.Dy0k-7_1.js} +16 -16
- package/dist/chunks/{date-picker.BdMr3Sn2.js.map → date-picker.Dy0k-7_1.js.map} +1 -1
- package/dist/chunks/{date-range-picker.BHfvD0GK.js → date-range-picker.B_uiZRMc.js} +25 -25
- package/dist/chunks/{date-range-picker.BHfvD0GK.js.map → date-range-picker.B_uiZRMc.js.map} +1 -1
- package/dist/chunks/{directive.O3yEdalv.js → directive.Cbdox5VL.js} +2 -2
- package/dist/chunks/{directive.O3yEdalv.js.map → directive.Cbdox5VL.js.map} +1 -1
- package/dist/chunks/{dropdown-tag.CvZ1jckk.js → dropdown-tag.D3py85f0.js} +4 -4
- package/dist/chunks/{dropdown-tag.CvZ1jckk.js.map → dropdown-tag.D3py85f0.js.map} +1 -1
- package/dist/chunks/{dropdown.CcHoKbLz.js → dropdown.CI6ccgJJ.js} +89 -82
- package/dist/chunks/dropdown.CI6ccgJJ.js.map +1 -0
- package/dist/chunks/{error-message.B1-ekAMa.js → error-message.qHRfH-8Y.js} +2 -2
- package/dist/chunks/{error-message.B1-ekAMa.js.map → error-message.qHRfH-8Y.js.map} +1 -1
- package/dist/chunks/es6.BtaxuP0b.js.map +1 -1
- package/dist/chunks/{file-uploader.Dlfzh5QQ.js → file-uploader.BOWE87dN.js} +473 -452
- package/dist/chunks/file-uploader.BOWE87dN.js.map +1 -0
- package/dist/chunks/{filter-bar.CwqoJGiK.js → filter-bar.pVpO62X3.js} +620 -613
- package/dist/chunks/filter-bar.pVpO62X3.js.map +1 -0
- package/dist/chunks/{focus-trap.CWlKh48z.js → focus-trap.V3Q8H_5C.js} +2 -2
- package/dist/chunks/{focus-trap.CWlKh48z.js.map → focus-trap.V3Q8H_5C.js.map} +1 -1
- package/dist/chunks/{footer-actions.BkHpWa7A.js → footer-actions.DYi_MR9I.js} +2 -2
- package/dist/chunks/{footer-actions.BkHpWa7A.js.map → footer-actions.DYi_MR9I.js.map} +1 -1
- package/dist/chunks/header-with-views.CLSMOYua.js +1536 -0
- package/dist/chunks/header-with-views.CLSMOYua.js.map +1 -0
- package/dist/chunks/{header.BAKjEGmH.js → header.DWx6s2nt.js} +4 -4
- package/dist/chunks/{header.BAKjEGmH.js.map → header.DWx6s2nt.js.map} +1 -1
- package/dist/chunks/index.48Mn1OCp.js +387 -0
- package/dist/chunks/{index.-wO_BQCb.js.map → index.48Mn1OCp.js.map} +1 -1
- package/dist/chunks/{info-icon-with-popover.CxXWP4TR.js → info-icon-with-popover.B4wYDzGz.js} +2 -2
- package/dist/chunks/{info-icon-with-popover.CxXWP4TR.js.map → info-icon-with-popover.B4wYDzGz.js.map} +1 -1
- package/dist/chunks/{info-icon.D3neDWqH.js → info-icon.J62KXp9I.js} +3 -3
- package/dist/chunks/{info-icon.D3neDWqH.js.map → info-icon.J62KXp9I.js.map} +1 -1
- package/dist/chunks/input-field-password.D6lhO8b2.js +228 -0
- package/dist/chunks/input-field-password.D6lhO8b2.js.map +1 -0
- package/dist/chunks/{input-field-phone-number.TXnK0dch.js → input-field-phone-number.CYRNWZL8.js} +3 -3
- package/dist/chunks/{input-field-phone-number.TXnK0dch.js.map → input-field-phone-number.CYRNWZL8.js.map} +1 -1
- package/dist/chunks/{input-field.De4sp76g.js → input-field.CsnMZceM.js} +3 -3
- package/dist/chunks/{input-field.De4sp76g.js.map → input-field.CsnMZceM.js.map} +1 -1
- package/dist/chunks/inspector.types.Cmq6sdCz.js +105 -0
- package/dist/chunks/inspector.types.Cmq6sdCz.js.map +1 -0
- package/dist/chunks/{layout-row.dh2VyGoD.js → layout-row.DWRoI0dm.js} +2 -2
- package/dist/chunks/{layout-row.dh2VyGoD.js.map → layout-row.DWRoI0dm.js.map} +1 -1
- package/dist/chunks/{listbox-option-tag.xGQr3Su1.js → listbox-option-tag.BHI-8rRX.js} +2 -2
- package/dist/chunks/{listbox-option-tag.xGQr3Su1.js.map → listbox-option-tag.BHI-8rRX.js.map} +1 -1
- package/dist/chunks/{menu.li3Kg9Uq.js → menu.BoxhffPs.js} +84 -83
- package/dist/chunks/{menu.li3Kg9Uq.js.map → menu.BoxhffPs.js.map} +1 -1
- package/dist/chunks/{modal-fullscreen.C4eL63TC.js → modal-fullscreen.E7e13pW9.js} +3 -3
- package/dist/chunks/{modal-fullscreen.C4eL63TC.js.map → modal-fullscreen.E7e13pW9.js.map} +1 -1
- package/dist/chunks/{modal.BpDz0Dhc.js → modal.BUPJIcb6.js} +4 -4
- package/dist/chunks/{modal.BpDz0Dhc.js.map → modal.BUPJIcb6.js.map} +1 -1
- package/dist/chunks/{on-click-outside.MUWbmGDn.js → on-click-outside.D9aY9g8G.js} +3 -2
- package/dist/chunks/{on-click-outside.MUWbmGDn.js.map → on-click-outside.D9aY9g8G.js.map} +1 -1
- package/dist/chunks/{pagination.FuELftBG.js → pagination.FBlW1fUz.js} +3 -3
- package/dist/chunks/{pagination.FuELftBG.js.map → pagination.FBlW1fUz.js.map} +1 -1
- package/dist/chunks/{payment-method.NZKiNOmM.js → payment-method.Cx4nPDtE.js} +6 -6
- package/dist/chunks/payment-method.Cx4nPDtE.js.map +1 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js +5 -0
- package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -0
- package/dist/chunks/{popover.Cb6utVhS.js → popover.C4PNSrnW.js} +3 -3
- package/dist/chunks/{popover.Cb6utVhS.js.map → popover.C4PNSrnW.js.map} +1 -1
- package/dist/chunks/{popper-container.CiEkF7eb.js → popper-container.DWY19wS0.js} +2 -2
- package/dist/chunks/{popper-container.CiEkF7eb.js.map → popper-container.DWY19wS0.js.map} +1 -1
- package/dist/chunks/{promo-banner.PnHud5Wi.js → promo-banner.DgCKKp6o.js} +6 -6
- package/dist/chunks/{promo-banner.PnHud5Wi.js.map → promo-banner.DgCKKp6o.js.map} +1 -1
- package/dist/chunks/{radio-group._8PsjPCZ.js → radio-group.WbbrQhEO.js} +4 -4
- package/dist/chunks/{radio-group._8PsjPCZ.js.map → radio-group.WbbrQhEO.js.map} +1 -1
- package/dist/chunks/{search-bar.CVY2e8_B.js → search-bar.CFKWbNeA.js} +3 -3
- package/dist/chunks/{search-bar.CVY2e8_B.js.map → search-bar.CFKWbNeA.js.map} +1 -1
- package/dist/chunks/{secondary-nav.LxcuTR16.js → secondary-nav.C0gPD0MR.js} +3 -3
- package/dist/chunks/{secondary-nav.LxcuTR16.js.map → secondary-nav.C0gPD0MR.js.map} +1 -1
- package/dist/chunks/{segmented-control.D69WXQGh.js → segmented-control.DGNMY2BP.js} +2 -2
- package/dist/chunks/{segmented-control.D69WXQGh.js.map → segmented-control.DGNMY2BP.js.map} +1 -1
- package/dist/chunks/{selection-card-group.MTKkCBeK.js → selection-card-group.BmKUEuny.js} +4 -4
- package/dist/chunks/{selection-card-group.MTKkCBeK.js.map → selection-card-group.BmKUEuny.js.map} +1 -1
- package/dist/chunks/{sidepanel.BStCbRqN.js → sidepanel.CyhG1nQR.js} +4 -4
- package/dist/chunks/{sidepanel.BStCbRqN.js.map → sidepanel.CyhG1nQR.js.map} +1 -1
- package/dist/chunks/{structured-list-item.CeosjL40.js → structured-list-item.Co5P9bFC.js} +4 -4
- package/dist/chunks/{structured-list-item.CeosjL40.js.map → structured-list-item.Co5P9bFC.js.map} +1 -1
- package/dist/chunks/summary-grid.types.egM7irBt.js +295 -0
- package/dist/chunks/summary-grid.types.egM7irBt.js.map +1 -0
- package/dist/chunks/tabs.C8CgvNt4.js +214 -0
- package/dist/chunks/tabs.C8CgvNt4.js.map +1 -0
- package/dist/chunks/{tag.OgtZ3-ql.js → tag.CyspYb1E.js} +2 -2
- package/dist/chunks/{tag.OgtZ3-ql.js.map → tag.CyspYb1E.js.map} +1 -1
- package/dist/chunks/{teleport.B5fwsT5y.js → teleport.BHfrns33.js} +2 -2
- package/dist/chunks/{teleport.B5fwsT5y.js.map → teleport.BHfrns33.js.map} +1 -1
- package/dist/chunks/{textarea.BEISPJua.js → textarea.CC8esIW6.js} +75 -71
- package/dist/chunks/textarea.CC8esIW6.js.map +1 -0
- package/dist/chunks/{timeline-item.BeWMuM8A.js → timeline-item.Byorbxmc.js} +5 -5
- package/dist/chunks/{timeline-item.BeWMuM8A.js.map → timeline-item.Byorbxmc.js.map} +1 -1
- package/dist/chunks/{tooltip.RPURZd36.js → tooltip.DOvci5lX.js} +2 -2
- package/dist/chunks/{tooltip.RPURZd36.js.map → tooltip.DOvci5lX.js.map} +1 -1
- package/dist/chunks/{tutorial.Ba8PTa0x.js → tutorial.QwHbq1FO.js} +5 -5
- package/dist/chunks/{tutorial.Ba8PTa0x.js.map → tutorial.QwHbq1FO.js.map} +1 -1
- package/dist/chunks/{use-cached-selected-values.CxlYYUbd.js → use-cached-selected-values.DHpjo2tV.js} +36 -32
- package/dist/chunks/{use-cached-selected-values.CxlYYUbd.js.map → use-cached-selected-values.DHpjo2tV.js.map} +1 -1
- package/dist/click-outside.js +1 -1
- package/dist/code-snippet.js +1 -1
- package/dist/dashboard-template.js +1 -1
- package/dist/dashed-underline.js +2 -2
- package/dist/data-grid-template.js +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/date-picker.js +2 -2
- package/dist/date-range-picker.js +2 -2
- package/dist/dropdown.js +3 -3
- package/dist/file-uploader.js +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/focus-trap.js +1 -1
- package/dist/header-with-views.js +5 -0
- package/dist/header-with-views.js.map +1 -0
- package/dist/header.js +1 -1
- package/dist/index.js +196 -194
- package/dist/index.js.map +1 -1
- package/dist/info-icon.js +1 -1
- package/dist/input-field-password.js +1 -1
- package/dist/input-field-phone-number.js +1 -1
- package/dist/input-field.js +1 -1
- package/dist/inspector.js +1 -1
- package/dist/internal.js +11 -11
- package/dist/layout.js +1 -1
- package/dist/menu.js +1 -1
- package/dist/modal-fullscreen.js +1 -1
- package/dist/modal.js +2 -2
- package/dist/pagination.js +1 -1
- package/dist/payment-method.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/popper-container.js +1 -1
- package/dist/promo-banner.js +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/search-bar.js +2 -2
- package/dist/secondary-nav.js +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/selection-card.js +1 -1
- package/dist/sidepanel.js +1 -1
- package/dist/structured-list.js +1 -1
- package/dist/styles/bento-dark.css +89 -17
- package/dist/styles/bento-light.css +89 -17
- package/dist/styles/bento.css +89 -17
- package/dist/styles/legacy.css +77 -5
- package/dist/styles/styleguide.css +89 -17
- package/dist/summary-grid.js +1 -1
- package/dist/tabs.js +1 -1
- package/dist/tag.js +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timeline.js +1 -1
- package/dist/tutorial.js +1 -1
- package/dist/use-form-v4.js +8300 -0
- package/dist/use-form-v4.js.map +1 -0
- package/dist/web-types.json +4514 -3895
- package/package.json +8 -7
- package/dist/assets/summary-grid-item-custom.css +0 -1
- package/dist/chunks/checkbox.BeYtbfPv.js.map +0 -1
- package/dist/chunks/data-grid.DedjAz4_.js.map +0 -1
- package/dist/chunks/dropdown.CcHoKbLz.js.map +0 -1
- package/dist/chunks/file-uploader.Dlfzh5QQ.js.map +0 -1
- package/dist/chunks/filter-bar.CwqoJGiK.js.map +0 -1
- package/dist/chunks/index.-wO_BQCb.js +0 -370
- package/dist/chunks/input-field-password.CO0lAgMh.js +0 -194
- package/dist/chunks/input-field-password.CO0lAgMh.js.map +0 -1
- package/dist/chunks/inspector.types.ClnPOYmb.js +0 -101
- package/dist/chunks/inspector.types.ClnPOYmb.js.map +0 -1
- package/dist/chunks/payment-method.NZKiNOmM.js.map +0 -1
- package/dist/chunks/payment-method.types.CJKfZQN5.js +0 -5
- package/dist/chunks/payment-method.types.CJKfZQN5.js.map +0 -1
- package/dist/chunks/summary-grid-item-custom.CF_TS7oA.js +0 -578
- package/dist/chunks/summary-grid-item-custom.CF_TS7oA.js.map +0 -1
- package/dist/chunks/tabs.UFoTqvew.js +0 -154
- package/dist/chunks/tabs.UFoTqvew.js.map +0 -1
- package/dist/chunks/textarea.BEISPJua.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-tag.CvZ1jckk.js","sources":["../../src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue","../../src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue","../../src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue","../../src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue","../../src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue"],"sourcesContent":["<template>\n <div>\n <bento-dropdown v-slot=\"{ label, data }\" v-bind=\"$props\" :items=\"dropdownItems\" @input=\"onInput\">\n <bento-avatar :username=\"label\" :src=\"data\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoAvatarListboxOptions } from './dropdown-avatar.types';\n import { BentoAvatar } from '@/components/avatar';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the avatar dropdown with.\n * It must be an array of {@see BentoAvatarListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option.\n * * @property {string,number} value.value - Value of the option.\n * * @property {string} value.src - Image source of the avatar image.\n */\n items: {\n type: Array as PropType<BentoAvatarListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const dropdownItems = computed(() => props.items.map(({ value, label, src }) => ({ value, label, data: src })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Avatar Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownAvatar } from '@adyen/bento-vue2';\n * import type { BentoAvatarListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownAvatar },\n * template: `\n * <bento-dropdown-avatar\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('user-id-1') // Default value\n * const options: BentoAvatarListboxOptions = [\n * { label: 'User 1', value: 'user-id-1' },\n * { label: 'User 2', value: 'user-id-2', src: 'image-source.jpeg' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-avatar',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ label }\" v-bind=\"$props\" :items=\"countryItems\" @input=\"onInput\">\n <bento-typography el=\"span\">{{ label }}</bento-typography>\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType, toRefs } from 'vue';\n import { BentoCountryListboxOptions } from './dropdown-country.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoTypography } from '@/components/typography';\n import { useCountryItems } from './composables/use-country-items';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoCountryVariant } from '@/components/country';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCountryListboxOptions }\n * * @deprecated {string} value.label - Use BentoDropdown instead of custom labels\n * * @property {BentoCountryCode | string} value.value - Country code of the option\n */\n items: {\n type: Array as PropType<BentoCountryListboxOptions>,\n default: () => [],\n },\n\n /**\n * Which label variant to display.\n * @values iso, name, phone_code, capital\n */\n variant: {\n type: String as PropType<BentoCountryVariant | `${BentoCountryVariant}`>,\n default: BentoCountryVariant.CUSTOM,\n validator: (value: BentoCountryVariant) => Object.values(BentoCountryVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const { variant, items } = toRefs(props);\n const countryItems = useCountryItems(variant, items);\n\n if (variant.value === 'custom' || items.value.some(item => item.label)) {\n deprecate(\n 'BentoDropdownCountry \"custom\" variant and \"items\" prop \"label\" key',\n 'Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Country Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-country\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-country',\n });\n</script>\n","<template>\n <bento-dropdown v-slot=\"slotProps\" v-bind=\"$props\" @input=\"onInput\">\n <listbox-option-tag :option=\"slotProps\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import type { BentoCurrencyListboxOptions } from './dropdown-currency.types';\n import type { BentoListboxSelectedValue } from '@/types';\n import { ListboxOptionTag } from '@/internal';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCurrencyListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option\n */\n items: {\n type: Array as PropType<BentoCurrencyListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency Dropdown showing a selectable list of currencies.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-currency\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-currency',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ value, label }\" v-bind=\"$props\" @input=\"onInput\">\n <bento-payment-method :type=\"value\" :label=\"label\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { BentoPaymentMethodListboxOptions } from './dropdown-payment-method.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoPaymentMethod } from '@/components/payment-method';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the payment method dropdown with.\n * It must be an array of {@see BentoPaymentMethodListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}\n */\n items: {\n type: Array as PropType<BentoPaymentMethodListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Payment method Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownPaymentMethod } from '@adyen/bento-vue2';\n * import type { BentoPaymentMethodListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownPaymentMethod },\n * template: `\n * <bento-dropdown-payment-method\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 'Visa'\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('Ideal') // Default value\n * const options: BentoPaymentMethodListboxOptions = [\n * { label: 'Option 1', value: 'Ideal' },\n * { label: 'Option 2', value: 'Visa' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-payment-method',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n class=\"b-dropdown-tag\"\n :items=\"tagItems\"\n show-slot-content-in-multiple\n @input=\"onInput\"\n >\n <listbox-option-tag :option=\"{ value: label, data, label: '' }\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoTagListboxOptions } from './dropdown-tag.types';\n import type { BentoListboxSelectedValue } from '../../../../../types';\n import { ListboxOptionTag } from '../../../../internal';\n import BentoDropdown from '../../../dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the tag dropdown with.\n * It must be an array of {@see BentoTagListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n * * @property {string} value.variant - The BentTag variant shown for the option.\n */\n items: {\n type: Array as PropType<BentoTagListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const tagItems = computed(() => props.items?.map(({ label, value, variant }) => ({ label, value, data: variant })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Tag Dropdown showing a selectable list of tags.\n *\n * @example\n * import { BentoDropdownTag } from '@adyen/bento-vue2';\n * import type { BentoTagListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownTag },\n * template: `\n * <bento-dropdown-tag\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('unique-id-1') // Default value\n * const options: BentoTagListboxOptions = [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-tag',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-tag.scss\" />\n"],"names":["__default__$4","defineComponent","onInput","selectedValue","emit","dropdownItems","computed","props","value","label","src","__default__$3","variant","items","toRefs","countryItems","useCountryItems","item","deprecate","__default__$2","__default__$1","__default__","tagItems","_a"],"mappings":";;;;;;;;;;AAkEI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBApCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEAE,IAAAC,EAAA,MAAAC,EAAA,MAAA,IAAA,CAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,KAAAC,EAAA,OAAA,EAAA,OAAAF,GAAA,OAAAC,GAAA,MAAAC,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;sBCqDAC,IAAAV,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7CAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEA,EAAA,SAAAS,GAAA,OAAAC,EAAA,IAAAC,EAAAP,CAAA,GACAQ,IAAAC,EAAAJ,GAAAC,CAAA;AAEA,YAAAD,EAAA,UAAA,YAAAC,EAAA,MAAA,KAAA,CAAAI,MAAAA,EAAA,KAAA,MACIC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;sBCQRC,IAAAlB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;0CAlCA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;;;;;;;;;;;;;;;;sBCkCAiB,IAAAnB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;0CAlCA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;;;;;;;;;;;;;;;;sBCsCAkB,IAAApB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBAlCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEAmB,IAAAhB,EAAA,MAAA;;AAAA,cAAAiB,IAAAhB,EAAA,UAAA,gBAAAgB,EAAA,IAAA,CAAA,EAAA,OAAAd,GAAA,OAAAD,GAAA,SAAAI,EAAA,OAAA,EAAA,OAAAH,GAAA,OAAAD,GAAA,MAAAI,EAAA;AAAA,KAAA;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dropdown-tag.D3py85f0.js","sources":["../../src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue","../../src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue","../../src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue","../../src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue","../../src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue"],"sourcesContent":["<template>\n <div>\n <bento-dropdown v-slot=\"{ label, data }\" v-bind=\"$props\" :items=\"dropdownItems\" @input=\"onInput\">\n <bento-avatar :username=\"label\" :src=\"data\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoAvatarListboxOptions } from './dropdown-avatar.types';\n import { BentoAvatar } from '@/components/avatar';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the avatar dropdown with.\n * It must be an array of {@see BentoAvatarListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option.\n * * @property {string,number} value.value - Value of the option.\n * * @property {string} value.src - Image source of the avatar image.\n */\n items: {\n type: Array as PropType<BentoAvatarListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const dropdownItems = computed(() => props.items.map(({ value, label, src }) => ({ value, label, data: src })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Avatar Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownAvatar } from '@adyen/bento-vue2';\n * import type { BentoAvatarListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownAvatar },\n * template: `\n * <bento-dropdown-avatar\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('user-id-1') // Default value\n * const options: BentoAvatarListboxOptions = [\n * { label: 'User 1', value: 'user-id-1' },\n * { label: 'User 2', value: 'user-id-2', src: 'image-source.jpeg' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-avatar',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ label }\" v-bind=\"$props\" :items=\"countryItems\" @input=\"onInput\">\n <bento-typography el=\"span\">{{ label }}</bento-typography>\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType, toRefs } from 'vue';\n import { BentoCountryListboxOptions } from './dropdown-country.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoTypography } from '@/components/typography';\n import { useCountryItems } from './composables/use-country-items';\n import { deprecate } from '@/utils/ts/deprecate';\n import { BentoCountryVariant } from '@/components/country';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCountryListboxOptions }\n * * @deprecated {string} value.label - Use BentoDropdown instead of custom labels\n * * @property {BentoCountryCode | string} value.value - Country code of the option\n */\n items: {\n type: Array as PropType<BentoCountryListboxOptions>,\n default: () => [],\n },\n\n /**\n * Which label variant to display.\n * @values iso, name, phone_code, capital\n */\n variant: {\n type: String as PropType<BentoCountryVariant | `${BentoCountryVariant}`>,\n default: BentoCountryVariant.CUSTOM,\n validator: (value: BentoCountryVariant) => Object.values(BentoCountryVariant).includes(value),\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const { variant, items } = toRefs(props);\n const countryItems = useCountryItems(variant, items);\n\n if (variant.value === 'custom' || items.value.some(item => item.label)) {\n deprecate(\n 'BentoDropdownCountry \"custom\" variant and \"items\" prop \"label\" key',\n 'Use any of the other BentoDropdownCountry variants instead OR use BentoDropdown component for custom labels',\n '2.0.0'\n );\n }\n</script>\n\n<script lang=\"ts\">\n /**\n * A Country Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-country\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-country',\n });\n</script>\n","<template>\n <bento-dropdown v-slot=\"slotProps\" v-bind=\"$props\" @input=\"onInput\">\n <listbox-option-tag :option=\"slotProps\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import type { BentoCurrencyListboxOptions } from './dropdown-currency.types';\n import type { BentoListboxSelectedValue } from '@/types';\n import { ListboxOptionTag } from '@/internal';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the country dropdown with.\n * It must be an array of {@see BentoCurrencyListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {BentoCurrencyISOCode} value.code - Currency ISO code of the option\n */\n items: {\n type: Array as PropType<BentoCurrencyListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Currency Dropdown showing a selectable list of currencies.\n *\n * @example\n * import { BentoDropdownCountry, BentoCountryCode } from '@adyen/bento-vue2';\n * import type { BentoCountryListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdown },\n * template: `\n * <bento-dropdown-currency\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 2\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref(BentoCountryCode.NL) // Default value\n * const options: BentoCountryListboxOptions = [\n * { label: 'Option 1', value: BentoCountryCode.NL },\n * { label: 'Option 2', value: BentoCountryCode.BE },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'b-dropdown-currency',\n });\n</script>\n","<template>\n <div>\n <bento-dropdown v-slot=\"{ value, label }\" v-bind=\"$props\" @input=\"onInput\">\n <bento-payment-method :type=\"value\" :label=\"label\" />\n </bento-dropdown>\n </div>\n</template>\n\n<script setup lang=\"ts\">\n import { defineComponent, PropType } from 'vue';\n import { BentoPaymentMethodListboxOptions } from './dropdown-payment-method.types';\n import { BentoListboxSelectedValue } from '@/types';\n import { BentoPaymentMethod } from '@/components/payment-method';\n import BentoDropdown from '@/components/dropdown/dropdown.vue';\n\n defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the payment method dropdown with.\n * It must be an array of {@see BentoPaymentMethodListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string} value.value - Payment type code that translates to a payment icon name {@see https://adyen-ui-assets.netlify.app/?path=/story/packages-ui-assets-payment-method-icons--icons}\n */\n items: {\n type: Array as PropType<BentoPaymentMethodListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n</script>\n\n<script lang=\"ts\">\n /**\n * A Payment method Dropdown showing a selectable list of countries.\n *\n * @example\n * import { BentoDropdownPaymentMethod } from '@adyen/bento-vue2';\n * import type { BentoPaymentMethodListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownPaymentMethod },\n * template: `\n * <bento-dropdown-payment-method\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :multiple=\"true\"\n * :isOptionsDisabled=\"option => option.value === 'Visa'\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('ideal') // Default value\n * const options: BentoPaymentMethodListboxOptions = [\n * { label: 'Option 1', value: 'ideal' },\n * { label: 'Option 2', value: 'visa' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-payment-method',\n });\n</script>\n","<template>\n <bento-dropdown\n v-slot=\"{ label, data }\"\n v-bind=\"$props\"\n class=\"b-dropdown-tag\"\n :items=\"tagItems\"\n show-slot-content-in-multiple\n @input=\"onInput\"\n >\n <listbox-option-tag :option=\"{ value: label, data, label: '' }\" />\n </bento-dropdown>\n</template>\n\n<script setup lang=\"ts\">\n import { computed, defineComponent, PropType } from 'vue';\n import type { BentoTagListboxOptions } from './dropdown-tag.types';\n import type { BentoListboxSelectedValue } from '../../../../../types';\n import { ListboxOptionTag } from '../../../../internal';\n import BentoDropdown from '../../../dropdown.vue';\n\n const props = defineProps({\n ...BentoDropdown.props,\n /**\n * The option elements to populate the tag dropdown with.\n * It must be an array of {@see BentoTagListboxOptions }\n * * @property {string} value.label - Text to be displayed in the option\n * * @property {string,number} value.value - Value of the option\n * * @property {string} value.variant - The BentTag variant shown for the option.\n */\n items: {\n type: Array as PropType<BentoTagListboxOptions>,\n default: () => [],\n },\n });\n\n const emit = defineEmits([\"input\"]);\n\n const onInput = (selectedValue: BentoListboxSelectedValue) => emit('input', selectedValue);\n\n const tagItems = computed(() => props.items?.map(({ label, value, variant }) => ({ label, value, data: variant })));\n</script>\n\n<script lang=\"ts\">\n /**\n * A Tag Dropdown showing a selectable list of tags.\n *\n * @example\n * import { BentoDropdownTag } from '@adyen/bento-vue2';\n * import type { BentoTagListboxOptions } from '@adyen/bento-vue2'\n *\n * export default {\n * components: { BentoDropdownTag },\n * template: `\n * <bento-dropdown-tag\n * v-model=\"selectedValue\"\n * :disabled=\"false\"\n * :items=\"options\"\n * />\n * `,\n * setup() {\n * const selectedValue = ref('unique-id-1') // Default value\n * const options: BentoTagListboxOptions = [\n * { label: 'Offline', value: 'unique-id-1', variant: 'red' },\n * { label: 'Online', value: 'unique-id-2', variant: 'green' },\n * ];\n * return { options, selectedValue };\n * }\n * }\n */\n export default defineComponent({\n name: 'bento-dropdown-tag',\n });\n</script>\n\n<style lang=\"scss\" scoped src=\"./dropdown-tag.scss\" />\n"],"names":["__default__$4","defineComponent","onInput","selectedValue","emit","dropdownItems","computed","props","value","label","src","__default__$3","variant","items","toRefs","countryItems","useCountryItems","item","deprecate","__default__$2","__default__$1","__default__","tagItems","_a"],"mappings":";;;;;;;;;;AAkEI,MAAAA,IAAAC,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBApCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEAE,IAAAC,EAAA,MAAAC,EAAA,MAAA,IAAA,CAAA,EAAA,OAAAC,GAAA,OAAAC,GAAA,KAAAC,EAAA,OAAA,EAAA,OAAAF,GAAA,OAAAC,GAAA,MAAAC,EAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;sBCqDAC,IAAAV,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;iBA7CAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEA,EAAA,SAAAS,GAAA,OAAAC,EAAA,IAAAC,EAAAP,CAAA,GACAQ,IAAAC,EAAAJ,GAAAC,CAAA;AAEA,YAAAD,EAAA,UAAA,YAAAC,EAAA,MAAA,KAAA,CAAAI,MAAAA,EAAA,KAAA,MACIC;AAAA,MAAA;AAAA,MACI;AAAA,MACA;AAAA,IACA;;;;;;;;;;;;;;;;sBCQRC,IAAAlB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;0CAlCA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;;;;;;;;;;;;;;;;sBCkCAiB,IAAAnB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;0CAlCA,CAAAE,MAAAC,EAAA,SAAAD,CAAA;;;;;;;;;;;;;;;;sBCsCAkB,IAAApB,EAAA;AAAA,EAA+B,MAAA;AAE/B,CAAA;;;;;;;;;;;;;;;;;;iBAlCAC,IAAA,CAAAC,MAAAC,EAAA,SAAAD,CAAA,GAEAmB,IAAAhB,EAAA,MAAA;;AAAA,cAAAiB,IAAAhB,EAAA,UAAA,gBAAAgB,EAAA,IAAA,CAAA,EAAA,OAAAd,GAAA,OAAAD,GAAA,SAAAI,EAAA,OAAA,EAAA,OAAAH,GAAA,OAAAD,GAAA,MAAAI,EAAA;AAAA,KAAA;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ref as C, watch as ue, computed as p, defineComponent as
|
|
1
|
+
import { ref as C, watch as ue, computed as p, defineComponent as A, useSlots as pe, toRefs as fe, nextTick as L, useAttrs as Le, toRef as x, inject as Oe } from "vue";
|
|
2
2
|
import { d as ie, B as Ee } from "./typography.J1v_SPG3.js";
|
|
3
|
+
import { a as U, b as M, c as De, B as P, D as Be } from "./dropdown-default-textbox.CDTdHfTv.js";
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { n as F } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
6
|
+
import { s as q } from "./events.CMzGybJJ.js";
|
|
3
7
|
import { g as k } from "./generate-uid.NJ8tVoha.js";
|
|
4
|
-
import { u as
|
|
8
|
+
import { u as Ie } from "./aria-label.CaUURpnB.js";
|
|
5
9
|
import { u as V } from "./i18n.BQkEbtPM.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { a as U, b as P, c as Ie, B as F, D as Te } from "./dropdown-default-textbox.CDTdHfTv.js";
|
|
10
|
+
import { u as Te } from "./use-form-layout-loading.D3lALhtC.js";
|
|
8
11
|
import { u as Ne } from "./use-has-slot.C9lQZ6nz.js";
|
|
9
|
-
import { a as u, b as H, B as J, c as
|
|
12
|
+
import { a as u, b as H, B as J, c as Ae, u as Re } from "./use-cached-selected-values.DHpjo2tV.js";
|
|
10
13
|
import { B as D, a as $e } from "./keyboard-navigation.pB8weElW.js";
|
|
11
|
-
import { B as Me } from "./directive.
|
|
12
|
-
import { F as Pe, E as ke } from "./error-message.
|
|
13
|
-
import { P as re } from "./popper-container.
|
|
14
|
-
import { B as Fe } from "./popover.
|
|
15
|
-
import { n as K } from "./_plugin-vue2_normalizer.CeySl7Fu.js";
|
|
16
|
-
/* empty css */
|
|
17
|
-
import { s as q } from "./events.CMzGybJJ.js";
|
|
14
|
+
import { B as Me } from "./directive.Cbdox5VL.js";
|
|
15
|
+
import { F as Pe, E as ke } from "./error-message.qHRfH-8Y.js";
|
|
16
|
+
import { P as re } from "./popper-container.DWY19wS0.js";
|
|
17
|
+
import { B as Fe } from "./popover.C4PNSrnW.js";
|
|
18
18
|
import "../assets/dropdown.css";
|
|
19
19
|
const Ke = {
|
|
20
20
|
"en-US": {
|
|
@@ -53,14 +53,14 @@ const Ke = {
|
|
|
53
53
|
title: l("cancel"),
|
|
54
54
|
event: c
|
|
55
55
|
}
|
|
56
|
-
]), d = (
|
|
57
|
-
n.value =
|
|
58
|
-
}, g = (
|
|
59
|
-
d(
|
|
60
|
-
}, h = (
|
|
61
|
-
d(
|
|
62
|
-
}, v = (
|
|
63
|
-
d(
|
|
56
|
+
]), d = (y) => {
|
|
57
|
+
n.value = y, t.value || e(u.SELECT, y);
|
|
58
|
+
}, g = (y) => {
|
|
59
|
+
d(y), e(u.TAB);
|
|
60
|
+
}, h = (y) => {
|
|
61
|
+
d(y), e(u.ENTER);
|
|
62
|
+
}, v = (y) => {
|
|
63
|
+
d(y), e(u.SPACE);
|
|
64
64
|
}, O = () => {
|
|
65
65
|
c(), e(u.ESCAPE);
|
|
66
66
|
}, w = () => {
|
|
@@ -81,16 +81,20 @@ const Ke = {
|
|
|
81
81
|
onEscapeKey: O,
|
|
82
82
|
onOutsideDropdownClick: m
|
|
83
83
|
};
|
|
84
|
-
}, je =
|
|
84
|
+
}, je = A({
|
|
85
85
|
i18n: { messages: Ke },
|
|
86
86
|
name: "bento-dropdown-options-container"
|
|
87
|
-
}), We = /* @__PURE__ */
|
|
87
|
+
}), We = /* @__PURE__ */ A({
|
|
88
88
|
...je,
|
|
89
89
|
props: {
|
|
90
90
|
/**
|
|
91
91
|
* Defines a string value that labels an interactive element.
|
|
92
92
|
*/
|
|
93
93
|
ariaLabel: { type: String, default: null },
|
|
94
|
+
/**
|
|
95
|
+
* Indicates that dropdown items are loading
|
|
96
|
+
*/
|
|
97
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
94
98
|
/**
|
|
95
99
|
* Empty state props used with the inner empty state component which is displayed when no search results are found.
|
|
96
100
|
*/
|
|
@@ -144,7 +148,7 @@ const Ke = {
|
|
|
144
148
|
validator: (a) => Object.values(J).includes(a)
|
|
145
149
|
},
|
|
146
150
|
/**
|
|
147
|
-
* Indicates if new options are loading.
|
|
151
|
+
* Indicates if new options are lazy loading.
|
|
148
152
|
*/
|
|
149
153
|
loading: { type: Boolean, default: !1 },
|
|
150
154
|
/**
|
|
@@ -196,7 +200,7 @@ const Ke = {
|
|
|
196
200
|
"b-dropdown-options-container--single": !(e != null && e.multiple)
|
|
197
201
|
})), g = p(() => ({
|
|
198
202
|
"b-dropdown-options-container__listbox--single": !(e != null && e.multiple)
|
|
199
|
-
})), { actions: h, internalSelectedValue: v, listeners: O, onEscapeKey: w, onOutsideDropdownClick: S } = ze(l, s, m, o),
|
|
203
|
+
})), { actions: h, internalSelectedValue: v, listeners: O, onEscapeKey: w, onOutsideDropdownClick: S } = ze(l, s, m, o), y = p(() => e != null && e.multiple ? Fe : re), I = p(() => {
|
|
200
204
|
var T;
|
|
201
205
|
const B = {
|
|
202
206
|
"min-width": `${(T = e == null ? void 0 : e.targetElement) == null ? void 0 : T.clientWidth}px`,
|
|
@@ -228,25 +232,25 @@ const Ke = {
|
|
|
228
232
|
});
|
|
229
233
|
return t({
|
|
230
234
|
onOutsideDropdownClick: S
|
|
231
|
-
}), { __sfc: !0, slots: n, emit: o, props: e, selectedValue: l, multiple: s, dropdownOptionsListboxRef: i, t: c, isDropdownOpen: m, noResultsMessage: r, conditionalClasses: d, conditionalListboxClasses: g, actions: h, internalSelectedValue: v, listeners: O, onEscapeKey: w, onOutsideDropdownClick: S, popperContainerOrPopoverComponent:
|
|
235
|
+
}), { __sfc: !0, slots: n, emit: o, props: e, selectedValue: l, multiple: s, dropdownOptionsListboxRef: i, t: c, isDropdownOpen: m, noResultsMessage: r, conditionalClasses: d, conditionalListboxClasses: g, actions: h, internalSelectedValue: v, listeners: O, onEscapeKey: w, onOutsideDropdownClick: S, popperContainerOrPopoverComponent: y, popperContainerOrPopoverProps: I, BentoListbox: H };
|
|
232
236
|
}
|
|
233
237
|
});
|
|
234
238
|
var Ue = function() {
|
|
235
239
|
var t = this, o = t._self._c, e = t._self._setupProxy;
|
|
236
240
|
return o(e.popperContainerOrPopoverComponent, t._b({ tag: "component", staticClass: "b-dropdown-options-container", class: e.conditionalClasses, attrs: { "aria-label": t.ariaLabel } }, "component", e.popperContainerOrPopoverProps, !1), [o("div", { on: { keydown: function(n) {
|
|
237
241
|
return !n.type.indexOf("key") && t._k(n.keyCode, "esc", 27, n.key, ["Esc", "Escape"]) ? null : e.onEscapeKey.apply(null, arguments);
|
|
238
|
-
} } }, [o(e.BentoListbox, t._g({ ref: "dropdownOptionsListboxRef", staticClass: "b-dropdown-options-container__listbox", class: e.conditionalListboxClasses, attrs: { id: t.id, "aria-label": t.ariaLabel, "empty-state": t.emptyState, "is-option-disabled": t.isOptionDisabled, items: t.items, "selected-value": e.internalSelectedValue, multiple: e.multiple, "static-categories": t.staticCategories, "no-results-message": e.noResultsMessage, searching: t.searching, loading: t.loading, "lazy-load-type": t.lazyLoadType, "has-more-items": t.hasMoreItems, "virtual-scroll": t.virtualScroll }, scopedSlots: t._u([t._l(e.slots, function(n, l) {
|
|
242
|
+
} } }, [o(e.BentoListbox, t._g({ ref: "dropdownOptionsListboxRef", staticClass: "b-dropdown-options-container__listbox", class: e.conditionalListboxClasses, attrs: { id: t.id, "aria-label": t.ariaLabel, "component-loading": t.componentLoading, "empty-state": t.emptyState, "is-option-disabled": t.isOptionDisabled, items: t.items, "selected-value": e.internalSelectedValue, multiple: e.multiple, "static-categories": t.staticCategories, "no-results-message": e.noResultsMessage, searching: t.searching, loading: t.loading, "lazy-load-type": t.lazyLoadType, "has-more-items": t.hasMoreItems, "virtual-scroll": t.virtualScroll }, scopedSlots: t._u([t._l(e.slots, function(n, l) {
|
|
239
243
|
return { key: l, fn: function(s) {
|
|
240
244
|
return [t._t(l, null, null, s)];
|
|
241
245
|
} };
|
|
242
246
|
})], null, !0) }, e.listeners))], 1)]);
|
|
243
|
-
}, qe = [], He = /* @__PURE__ */
|
|
247
|
+
}, qe = [], He = /* @__PURE__ */ F(
|
|
244
248
|
We,
|
|
245
249
|
Ue,
|
|
246
250
|
qe,
|
|
247
251
|
!1,
|
|
248
252
|
null,
|
|
249
|
-
"
|
|
253
|
+
"35feb278"
|
|
250
254
|
);
|
|
251
255
|
const Je = He.exports;
|
|
252
256
|
let de = 0;
|
|
@@ -258,7 +262,7 @@ const Ve = {
|
|
|
258
262
|
var Ye = function() {
|
|
259
263
|
var t = this, o = t._self._c;
|
|
260
264
|
return o("svg", t._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", t.$attrs, !1), [t.$attrs["svg-title"] ? o("title", [t._v(t._s(t.$attrs["svg-title"]))]) : t._e(), o("path", { attrs: { fill: "#00112C", d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z" } })]);
|
|
261
|
-
}, Ze = [], Qe = /* @__PURE__ */
|
|
265
|
+
}, Ze = [], Qe = /* @__PURE__ */ F(
|
|
262
266
|
Ve,
|
|
263
267
|
Ye,
|
|
264
268
|
Ze,
|
|
@@ -276,7 +280,7 @@ const Ge = {
|
|
|
276
280
|
var et = function() {
|
|
277
281
|
var t = this, o = t._self._c;
|
|
278
282
|
return o("svg", t._b({ staticClass: "ui-assets-icons-16", attrs: { role: "img", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" } }, "svg", t.$attrs, !1), [t.$attrs["svg-title"] ? o("title", [t._v(t._s(t.$attrs["svg-title"]))]) : t._e(), o("path", { attrs: { fill: "#00112C", d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z" } })]);
|
|
279
|
-
}, tt = [], ot = /* @__PURE__ */
|
|
283
|
+
}, tt = [], ot = /* @__PURE__ */ F(
|
|
280
284
|
Ge,
|
|
281
285
|
et,
|
|
282
286
|
tt,
|
|
@@ -284,10 +288,10 @@ var et = function() {
|
|
|
284
288
|
null,
|
|
285
289
|
null
|
|
286
290
|
);
|
|
287
|
-
const nt = ot.exports, at =
|
|
291
|
+
const nt = ot.exports, at = A({
|
|
288
292
|
name: "dropdown-small-textbox",
|
|
289
293
|
inheritAttrs: !1
|
|
290
|
-
}), st = /* @__PURE__ */
|
|
294
|
+
}), st = /* @__PURE__ */ A({
|
|
291
295
|
...at,
|
|
292
296
|
props: {
|
|
293
297
|
/**
|
|
@@ -364,17 +368,17 @@ const nt = ot.exports, at = R({
|
|
|
364
368
|
}, d = (v) => {
|
|
365
369
|
q(v), o("clear");
|
|
366
370
|
}, g = {
|
|
367
|
-
[
|
|
368
|
-
[
|
|
369
|
-
[
|
|
370
|
-
[
|
|
371
|
-
[
|
|
371
|
+
[M.INPUT]: i,
|
|
372
|
+
[M.OPEN]: m,
|
|
373
|
+
[M.CLOSE]: r,
|
|
374
|
+
[M.CLEAR]: d,
|
|
375
|
+
[M.KEYDOWN]: c
|
|
372
376
|
}, h = () => {
|
|
373
377
|
n.value.focus();
|
|
374
378
|
};
|
|
375
379
|
return t({
|
|
376
380
|
focus: h
|
|
377
|
-
}), { __sfc: !0, emit: o, props: e, baseTextbox: n, conditionalClasses: l, isDropdownOpen: s, onInput: i, onKeyDown: c, openDropdown: m, closeDropdown: r, clearValue: d, listeners: g, focus: h, BentoDropdownSize:
|
|
381
|
+
}), { __sfc: !0, emit: o, props: e, baseTextbox: n, conditionalClasses: l, isDropdownOpen: s, onInput: i, onKeyDown: c, openDropdown: m, closeDropdown: r, clearValue: d, listeners: g, focus: h, BentoDropdownSize: P, DropdownBaseTextbox: De, ChevronDownSmallIcon: Xe, ChevronUpSmallIcon: nt };
|
|
378
382
|
}
|
|
379
383
|
});
|
|
380
384
|
var lt = function() {
|
|
@@ -382,7 +386,7 @@ var lt = function() {
|
|
|
382
386
|
return o("div", { staticClass: "b-dropdown-small-textbox", class: e.conditionalClasses }, [o(e.DropdownBaseTextbox, t._g(t._b({ ref: "baseTextbox", staticClass: "b-dropdown-small-textbox__textbox", attrs: { size: e.BentoDropdownSize.SMALL }, scopedSlots: t._u([{ key: "icon", fn: function() {
|
|
383
387
|
return [o("div", { staticClass: "b-dropdown-small-textbox__chevron" }, [o(e.ChevronUpSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], attrs: { "svg-title": "opened" } }), o(e.ChevronDownSmallIcon, { directives: [{ name: "show", rawName: "v-show", value: !e.isDropdownOpen, expression: "!isDropdownOpen" }], attrs: { "svg-title": "closed" } })], 1)];
|
|
384
388
|
}, proxy: !0 }]) }, "dropdown-base-textbox", { ...t.$attrs, ...t.$props }, !1), e.listeners))], 1);
|
|
385
|
-
}, it = [], rt = /* @__PURE__ */
|
|
389
|
+
}, it = [], rt = /* @__PURE__ */ F(
|
|
386
390
|
st,
|
|
387
391
|
lt,
|
|
388
392
|
it,
|
|
@@ -419,18 +423,18 @@ const dt = rt.exports, ct = (a, t) => t.value.reduce((o, e) => {
|
|
|
419
423
|
isMultiple: s
|
|
420
424
|
}, i, c, m) => {
|
|
421
425
|
const r = async (f) => {
|
|
422
|
-
var
|
|
423
|
-
n.value && await L(), (E = (
|
|
426
|
+
var b, E;
|
|
427
|
+
n.value && await L(), (E = (b = t.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : b.$el.querySelectorAll('[role="option"]')[f]) == null || E.focus();
|
|
424
428
|
}, d = async (f) => {
|
|
425
|
-
var E,
|
|
429
|
+
var E, K;
|
|
426
430
|
n.value && await L();
|
|
427
|
-
const
|
|
431
|
+
const b = (E = t.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : E.$el.querySelectorAll(
|
|
428
432
|
"button"
|
|
429
433
|
);
|
|
430
|
-
|
|
434
|
+
b.length ? (K = b[f]) == null || K.focus() : r(f);
|
|
431
435
|
}, g = (f) => {
|
|
432
|
-
var
|
|
433
|
-
return (
|
|
436
|
+
var b;
|
|
437
|
+
return (b = t.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : b.setListboxFocusedIndex(
|
|
434
438
|
f
|
|
435
439
|
);
|
|
436
440
|
}, h = ({ detail: f }) => {
|
|
@@ -445,8 +449,8 @@ const dt = rt.exports, ct = (a, t) => t.value.reduce((o, e) => {
|
|
|
445
449
|
e.value || (c(), L(() => {
|
|
446
450
|
var f;
|
|
447
451
|
if (s) {
|
|
448
|
-
const
|
|
449
|
-
(f =
|
|
452
|
+
const b = t.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children;
|
|
453
|
+
(f = b == null ? void 0 : b[b.length - 1].$el.querySelectorAll('[role="option"]')[l.length - 1]) == null || f.focus();
|
|
450
454
|
} else
|
|
451
455
|
g(l.length - 1), r(l.length - 1);
|
|
452
456
|
}));
|
|
@@ -454,7 +458,7 @@ const dt = rt.exports, ct = (a, t) => t.value.reduce((o, e) => {
|
|
|
454
458
|
e.value && (m(), ve(a));
|
|
455
459
|
}, S = () => {
|
|
456
460
|
e.value && m();
|
|
457
|
-
},
|
|
461
|
+
}, y = () => {
|
|
458
462
|
e.value || c(), L(() => {
|
|
459
463
|
s ? d(0) : r(0);
|
|
460
464
|
});
|
|
@@ -474,7 +478,7 @@ const dt = rt.exports, ct = (a, t) => t.value.reduce((o, e) => {
|
|
|
474
478
|
[D.ARROW_UP]: v,
|
|
475
479
|
[D.END]: O,
|
|
476
480
|
[D.ESCAPE]: w,
|
|
477
|
-
[D.HOME]:
|
|
481
|
+
[D.HOME]: y,
|
|
478
482
|
[D.TAB]: S
|
|
479
483
|
}));
|
|
480
484
|
}, ft = ({ inputContainerRef: a, isDropdownOpen: t }, o) => {
|
|
@@ -515,15 +519,15 @@ const mt = {
|
|
|
515
519
|
all: "Todos",
|
|
516
520
|
clearFilter: "Limpar filtro"
|
|
517
521
|
}
|
|
518
|
-
},
|
|
522
|
+
}, yt = Symbol("input field component injection key"), Ft = Symbol("input field hint injection key"), Kt = Symbol("input field parent component injection key"), bt = A({
|
|
519
523
|
i18n: { messages: mt },
|
|
520
524
|
name: "b-dropdown",
|
|
521
525
|
components: {
|
|
522
|
-
DropdownInputDefault:
|
|
526
|
+
DropdownInputDefault: Be,
|
|
523
527
|
DropdownInputSmall: dt
|
|
524
528
|
}
|
|
525
|
-
}), _t = /* @__PURE__ */
|
|
526
|
-
...
|
|
529
|
+
}), _t = /* @__PURE__ */ A({
|
|
530
|
+
...bt,
|
|
527
531
|
props: {
|
|
528
532
|
/**
|
|
529
533
|
* @deprecated from version 2.0.0. Use the aria-label attribute instead.
|
|
@@ -600,9 +604,13 @@ const mt = {
|
|
|
600
604
|
*/
|
|
601
605
|
label: { type: String, default: null },
|
|
602
606
|
/**
|
|
603
|
-
* Indicates if new options are loading.
|
|
607
|
+
* Indicates if new options are lazy loading.
|
|
604
608
|
*/
|
|
605
609
|
loading: { type: Boolean, default: !1 },
|
|
610
|
+
/**
|
|
611
|
+
* Indicates that dropdown items are loading
|
|
612
|
+
*/
|
|
613
|
+
componentLoading: { type: Boolean, default: !1 },
|
|
606
614
|
/**
|
|
607
615
|
* The type of `Lazy Load`.
|
|
608
616
|
* Type "automatic" will enable infinite scrolling
|
|
@@ -651,7 +659,7 @@ const mt = {
|
|
|
651
659
|
size: {
|
|
652
660
|
type: String,
|
|
653
661
|
default: null,
|
|
654
|
-
validator: (a) => Object.values(
|
|
662
|
+
validator: (a) => Object.values(P).includes(a)
|
|
655
663
|
},
|
|
656
664
|
/**
|
|
657
665
|
* If enabled, dropdown will display non-selectable, static categories
|
|
@@ -682,21 +690,21 @@ const mt = {
|
|
|
682
690
|
emits: ["input", "show-more"],
|
|
683
691
|
setup(a, { expose: t, emit: o }) {
|
|
684
692
|
var le;
|
|
685
|
-
const e = a, n = Le(), l = pe(), s = Ne(l), { t: i } = V(), c = C(null), m = C(null), r = C(null), d = C(!1), g = k("bento-dropdown-options-container"), h = k("dropdown-label"), v = k("dropdown-description"), O = k("dropdown-error"), { isReadOnly: w } =
|
|
693
|
+
const e = a, n = Le(), l = pe(), s = Ne(l), { t: i } = V(), c = C(null), m = C(null), r = C(null), d = C(!1), g = k("bento-dropdown-options-container"), h = k("dropdown-label"), v = k("dropdown-description"), O = k("dropdown-error"), { isReadOnly: w } = Te(x(e, "readonly")), { cachedSelectedListboxOptions: S, cachedListboxSelectedValues: y, setCachedValues: I } = Ae(
|
|
686
694
|
x(e, "items"),
|
|
687
695
|
x(e, "value"),
|
|
688
696
|
x(e, "multiple")
|
|
689
|
-
), B = C(n["aria-label"]), { ariaLabel: T, label: f } = fe(e),
|
|
697
|
+
), B = C(n["aria-label"]), { ariaLabel: T, label: f } = fe(e), b = Ie({
|
|
690
698
|
// TODO: take ariaLabel ref away when aria-label prop is removed
|
|
691
699
|
ariaLabel: T || B,
|
|
692
700
|
label: f,
|
|
693
701
|
defaultFallback: i("ariaLabelFallback")
|
|
694
|
-
}), E = e.size ===
|
|
702
|
+
}), E = e.size === P.SMALL || Oe(yt, !1), K = p(() => E ? P.SMALL : P.DEFAULT), me = p(() => ({
|
|
695
703
|
"b-dropdown--condensed": e.condensed
|
|
696
|
-
})),
|
|
704
|
+
})), ye = p(() => ({
|
|
697
705
|
"b-dropdown__description--error": !!e.errorMessage
|
|
698
|
-
})), N = C(""),
|
|
699
|
-
items:
|
|
706
|
+
})), N = C(""), R = x(e, "items"), Y = x(e, "staticCategories"), Z = vt(N, R, (le = e == null ? void 0 : e.search) == null ? void 0 : le.searchEvent, Y), j = p(() => e.dynamicFiltering && !!N.value), be = ut({
|
|
707
|
+
items: R,
|
|
700
708
|
placeholder: x(e, "placeholder"),
|
|
701
709
|
isMultiSelect: x(e, "multiple"),
|
|
702
710
|
selectedValues: S
|
|
@@ -707,33 +715,32 @@ const mt = {
|
|
|
707
715
|
);
|
|
708
716
|
if (!e.multiple && e.staticCategories) {
|
|
709
717
|
const _ = e.items.find(
|
|
710
|
-
(
|
|
718
|
+
(W) => W.items.some((xe) => xe.value === e.value)
|
|
711
719
|
);
|
|
712
|
-
return _ ? _.items.find((
|
|
720
|
+
return _ ? _.items.find((W) => W.value === e.value) : null;
|
|
713
721
|
}
|
|
714
722
|
return e.items.find(({ value: _ }) => _ === (e == null ? void 0 : e.value));
|
|
715
723
|
}), Q = p(() => {
|
|
716
724
|
const _ = Z.value.findIndex(({ value: $ }) => e.value === $);
|
|
717
|
-
return _ >
|
|
718
|
-
}), { isMultiLevelSelect: X, flattenedItemsList: G } =
|
|
719
|
-
var _;
|
|
725
|
+
return _ > -1 ? _ : 0;
|
|
726
|
+
}), { isMultiLevelSelect: X, flattenedItemsList: G } = Re(R), ge = p(() => {
|
|
720
727
|
if (e.multiple) {
|
|
721
|
-
const
|
|
722
|
-
return !e.hasMoreItems &&
|
|
728
|
+
const _ = Array.isArray(e.value) ? e.value.length : 0, $ = X.value ? G.value.length : R.value.length;
|
|
729
|
+
return _ === 0 ? null : !e.hasMoreItems && $ > 0 && $ === _ ? i("all") : _;
|
|
723
730
|
}
|
|
724
731
|
return null;
|
|
725
732
|
}), he = p(
|
|
726
733
|
() => `${e.description ? v : ""} ${e.errorMessage ? O : ""}`.trim() || null
|
|
727
734
|
), ee = () => {
|
|
728
735
|
w.value || (d.value = !0);
|
|
729
|
-
},
|
|
736
|
+
}, z = () => {
|
|
730
737
|
d.value = !1;
|
|
731
738
|
}, te = () => {
|
|
732
|
-
w.value || (d.value = !d.value,
|
|
739
|
+
w.value || (d.value = !d.value, j.value && (N.value = ""));
|
|
733
740
|
}, Ce = () => {
|
|
734
|
-
|
|
741
|
+
j.value && (N.value = ""), d.value && (d.value = !1, r.value.onOutsideDropdownClick());
|
|
735
742
|
}, oe = (_) => {
|
|
736
|
-
e.multiple || (N.value = "", d.value = !1), I(_), o("input",
|
|
743
|
+
e.multiple || (N.value = "", d.value = !1), I(_), o("input", y.value);
|
|
737
744
|
}, ne = () => {
|
|
738
745
|
o(u.SHOW_MORE);
|
|
739
746
|
}, we = pt(
|
|
@@ -748,15 +755,15 @@ const mt = {
|
|
|
748
755
|
},
|
|
749
756
|
te,
|
|
750
757
|
ee,
|
|
751
|
-
|
|
758
|
+
z
|
|
752
759
|
), ae = ft(
|
|
753
760
|
{
|
|
754
761
|
inputContainerRef: c,
|
|
755
762
|
isDropdownOpen: d
|
|
756
763
|
},
|
|
757
|
-
|
|
764
|
+
z
|
|
758
765
|
), Se = {
|
|
759
|
-
[u.CLOSE_DROPDOWN]:
|
|
766
|
+
[u.CLOSE_DROPDOWN]: z,
|
|
760
767
|
[u.SELECT]: oe,
|
|
761
768
|
[u.SHOW_MORE]: ne,
|
|
762
769
|
...ae
|
|
@@ -773,7 +780,7 @@ const mt = {
|
|
|
773
780
|
};
|
|
774
781
|
return t({
|
|
775
782
|
focus: se
|
|
776
|
-
}), { __sfc: !0, attrs: n, slots: l, hasSlot: s, props: e, emit: o, t: i, inputContainerRef: c, inputContainerRefWrapper: m, optionsContainerRef: r, isDropdownOpen: d, dropdownOptionsContainerId: g, labelId: h, descriptionId: v, errorId: O, isReadOnly: w, cachedSelectedListboxOptions: S, cachedListboxSelectedValues:
|
|
783
|
+
}), { __sfc: !0, attrs: n, slots: l, hasSlot: s, props: e, emit: o, t: i, inputContainerRef: c, inputContainerRefWrapper: m, optionsContainerRef: r, isDropdownOpen: d, dropdownOptionsContainerId: g, labelId: h, descriptionId: v, errorId: O, isReadOnly: w, cachedSelectedListboxOptions: S, cachedListboxSelectedValues: y, setCachedValues: I, ariaLabelAttribute: B, ariaLabel: T, label: f, computedAriaLabel: b, isInputComponent: E, size: K, conditionalClasses: me, descriptionConditionalClasses: ye, searchTerm: N, items: R, staticCategories: Y, filteredItems: Z, isSearching: j, displayValue: be, selectedValueItem: _e, selectedValueIndex: Q, isMultiLevelSelect: X, flattenedItemsList: G, additionalItemsSelected: ge, ariaDescribedBy: he, openDropdown: ee, closeDropdown: z, toggleDropdown: te, clickOutsideDropdown: Ce, onOptionSelected: oe, emitShowMoreEvent: ne, textboxKeyboardNavigationListeners: we, listboxKeyboardNavigationListeners: ae, listboxListeners: Se, focus: se, BentoDropdownOptionsContainer: Je, BentoTypography: Ee, ErrorMessage: ke, FieldLabel: Pe, vBentoClickOutsideDirective: Me, vBentoKeyboardNavigationDirective: $e };
|
|
777
784
|
}
|
|
778
785
|
});
|
|
779
786
|
var gt = function() {
|
|
@@ -785,27 +792,27 @@ var gt = function() {
|
|
|
785
792
|
return { key: s, fn: function(i) {
|
|
786
793
|
return [t._t(s, null, null, i)];
|
|
787
794
|
} };
|
|
788
|
-
})], null, !0) })], 1), e.inputContainerRef ? o(e.BentoDropdownOptionsContainer, t._g({ ref: "optionsContainerRef", attrs: { id: e.dropdownOptionsContainerId, "aria-label": e.computedAriaLabel, "empty-state": t.emptyState, "debounce-time": (n = t.search) == null ? void 0 : n.debounceTime, disabled: t.disabled, "is-option-disabled": t.isOptionDisabled, items: e.filteredItems, multiple: t.multiple, "static-categories": e.staticCategories, open: e.isDropdownOpen, "selected-value": e.cachedSelectedListboxOptions, searching: e.isSearching, "target-element": e.inputContainerRefWrapper, loading: t.loading, "has-more-items": t.hasMoreItems, "lazy-load-type": t.lazyLoadType, "virtual-scroll": t.virtualScroll }, scopedSlots: t._u([t._l(e.slots, function(l, s) {
|
|
795
|
+
})], null, !0) })], 1), e.inputContainerRef ? o(e.BentoDropdownOptionsContainer, t._g({ ref: "optionsContainerRef", attrs: { id: e.dropdownOptionsContainerId, "aria-label": e.computedAriaLabel, "component-loading": t.componentLoading, "empty-state": t.emptyState, "debounce-time": (n = t.search) == null ? void 0 : n.debounceTime, disabled: t.disabled, "is-option-disabled": t.isOptionDisabled, items: e.filteredItems, multiple: t.multiple, "static-categories": e.staticCategories, open: e.isDropdownOpen, "selected-value": e.cachedSelectedListboxOptions, searching: e.isSearching, "target-element": e.inputContainerRefWrapper, loading: t.loading, "has-more-items": t.hasMoreItems, "lazy-load-type": t.lazyLoadType, "virtual-scroll": t.virtualScroll }, scopedSlots: t._u([t._l(e.slots, function(l, s) {
|
|
789
796
|
return { key: s, fn: function(i) {
|
|
790
797
|
return [t._t(s, null, null, i)];
|
|
791
798
|
} };
|
|
792
799
|
})], null, !0) }, e.listboxListeners)) : t._e(), t.errorMessage ? o(e.ErrorMessage, { staticClass: "b-dropdown__error-message", attrs: { id: e.errorId, "error-message": t.errorMessage } }) : t._e(), t.description || e.hasSlot("description") ? o(e.BentoTypography, { staticClass: "b-dropdown__description", class: e.descriptionConditionalClasses, attrs: { id: e.descriptionId, el: "span" } }, [t._t("description", function() {
|
|
793
800
|
return [t._v(" " + t._s(t.description) + " ")];
|
|
794
801
|
})], 2) : t._e()], 1);
|
|
795
|
-
}, ht = [], Ct = /* @__PURE__ */
|
|
802
|
+
}, ht = [], Ct = /* @__PURE__ */ F(
|
|
796
803
|
_t,
|
|
797
804
|
gt,
|
|
798
805
|
ht,
|
|
799
806
|
!1,
|
|
800
807
|
null,
|
|
801
|
-
"
|
|
808
|
+
"1bb5aad4"
|
|
802
809
|
);
|
|
803
810
|
const zt = Ct.exports;
|
|
804
811
|
export {
|
|
805
812
|
zt as B,
|
|
806
813
|
Ft as I,
|
|
807
|
-
|
|
814
|
+
yt as a,
|
|
808
815
|
Kt as b,
|
|
809
816
|
vt as u
|
|
810
817
|
};
|
|
811
|
-
//# sourceMappingURL=dropdown.
|
|
818
|
+
//# sourceMappingURL=dropdown.CI6ccgJJ.js.map
|