@adyen/bento-vue3 1.11.0 → 1.12.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.
Files changed (220) hide show
  1. package/dist/@types/packages/vue2/src/components/avatar-image/avatar-image.vue.d.ts +1 -1
  2. package/dist/@types/packages/vue2/src/components/code-snippet/code-snippet.vue.d.ts +1 -1
  3. package/dist/@types/packages/vue2/src/components/data-grid/components/data-grid-columns/data-grid-columns.vue.d.ts +11 -0
  4. package/dist/@types/packages/vue2/src/components/data-grid/composables/use-scroller/use-scroller.d.ts +1 -0
  5. package/dist/@types/packages/vue2/src/components/date/date.vue.d.ts +1 -1
  6. package/dist/@types/packages/vue2/src/components/date-range-picker/components/date-range-picker-calendar/date-range-picker-calendar.vue.d.ts +2 -2
  7. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-base-textbox/dropdown-base-textbox.vue.d.ts +43 -34
  8. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/dropdown-options-container.vue.d.ts +50 -1052
  9. package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-small-textbox/dropdown-small-textbox.vue.d.ts +7 -13
  10. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/dropdown-avatar.vue.d.ts +4 -5
  11. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-avatar/index.d.ts +2 -0
  12. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/dropdown-country.vue.d.ts +4 -5
  13. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/index.d.ts +2 -0
  14. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/dropdown-currency.vue.d.ts +4 -4
  15. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-currency/index.d.ts +2 -0
  16. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/dropdown-payment-method.vue.d.ts +4 -4
  17. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-payment-method/index.d.ts +2 -0
  18. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/dropdown-tag.vue.d.ts +4 -5
  19. package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-tag/index.d.ts +2 -0
  20. package/dist/@types/packages/vue2/src/components/dropdown/composables/index.d.ts +2 -0
  21. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-display-value.d.ts +2 -0
  22. package/dist/@types/packages/vue2/src/components/dropdown/composables/{useDisplayValue.types.d.ts → use-display-value.types.d.ts} +16 -0
  23. package/dist/@types/packages/vue2/src/components/dropdown/composables/{useKeyboardNavigation.d.ts → use-keyboard-navigation.d.ts} +3 -13
  24. package/dist/@types/packages/vue2/src/components/dropdown/composables/use-keyboard-navigation.types.d.ts +15 -0
  25. package/dist/@types/packages/vue2/src/components/dropdown/dropdown.vue.d.ts +50 -2435
  26. package/dist/@types/packages/vue2/src/components/dropdown/index.d.ts +6 -5
  27. package/dist/@types/packages/vue2/src/components/filter-bar/components/all-filters-modal/all-filters-modal.vue.d.ts +12 -12
  28. package/dist/@types/packages/vue2/src/components/input-field/input-field.vue.d.ts +1 -1
  29. package/dist/@types/packages/vue2/src/components/internal/listbox/listbox.vue.d.ts +1 -1
  30. package/dist/@types/packages/vue2/src/components/link/link.vue.d.ts +17 -11
  31. package/dist/@types/packages/vue2/src/components/modal/components/base-modal/base-modal.vue.d.ts +17 -61
  32. package/dist/@types/packages/vue2/src/components/modal/components/modal-default/modal-default.vue.d.ts +60 -50
  33. package/dist/@types/packages/vue2/src/components/modal/components/modal-dialog/modal-dialog.vue.d.ts +40 -357
  34. package/dist/@types/packages/vue2/src/components/modal/modal.vue.d.ts +77 -84
  35. package/dist/@types/packages/vue2/src/components/pagination/pagination.vue.d.ts +1 -1
  36. package/dist/@types/packages/vue2/src/components/popper-container/popper-container.vue.d.ts +1 -1
  37. package/dist/@types/packages/vue2/src/components/summary-grid/components/summary-grid-item/summary-grid-item.vue.d.ts +3 -3
  38. package/dist/@types/packages/vue2/src/components/textarea/textarea.vue.d.ts +1 -1
  39. package/dist/@types/packages/vue2/src/components/tooltip/tooltip.vue.d.ts +5 -5
  40. package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.types.d.ts +6 -0
  41. package/dist/@types/packages/vue2/src/templates/data-grid-template/data-grid-template.vue.d.ts +10 -0
  42. package/dist/@types/packages/vue2/src/templates/data-grid-template/index.d.ts +1 -0
  43. package/dist/accordion.js +2 -2
  44. package/dist/action-bar.js +5 -5
  45. package/dist/alert.js +3 -3
  46. package/dist/assets/base-modal.css +1 -1
  47. package/dist/assets/button.css +1 -1
  48. package/dist/assets/dropdown-default-textbox.css +1 -1
  49. package/dist/assets/dropdown.css +1 -1
  50. package/dist/assets/index10.css +1 -1
  51. package/dist/assets/index11.css +1 -1
  52. package/dist/assets/index12.css +1 -1
  53. package/dist/assets/index13.css +1 -1
  54. package/dist/assets/index14.css +1 -1
  55. package/dist/assets/index15.css +1 -1
  56. package/dist/assets/index16.css +1 -1
  57. package/dist/assets/index17.css +1 -1
  58. package/dist/assets/index18.css +1 -1
  59. package/dist/assets/index19.css +1 -1
  60. package/dist/assets/index2.css +1 -1
  61. package/dist/assets/index20.css +1 -1
  62. package/dist/assets/index21.css +1 -1
  63. package/dist/assets/index22.css +1 -1
  64. package/dist/assets/index23.css +1 -1
  65. package/dist/assets/index24.css +1 -1
  66. package/dist/assets/index25.css +1 -1
  67. package/dist/assets/index26.css +1 -1
  68. package/dist/assets/index27.css +1 -1
  69. package/dist/assets/index28.css +1 -1
  70. package/dist/assets/index29.css +1 -1
  71. package/dist/assets/index3.css +1 -1
  72. package/dist/assets/index30.css +1 -1
  73. package/dist/assets/index31.css +1 -1
  74. package/dist/assets/index32.css +1 -1
  75. package/dist/assets/index33.css +1 -1
  76. package/dist/assets/index34.css +1 -1
  77. package/dist/assets/index35.css +1 -1
  78. package/dist/assets/index36.css +1 -1
  79. package/dist/assets/index37.css +1 -1
  80. package/dist/assets/index38.css +1 -1
  81. package/dist/assets/index39.css +1 -1
  82. package/dist/assets/index4.css +1 -1
  83. package/dist/assets/index40.css +1 -1
  84. package/dist/assets/index41.css +1 -1
  85. package/dist/assets/index42.css +1 -1
  86. package/dist/assets/index43.css +1 -1
  87. package/dist/assets/index44.css +1 -1
  88. package/dist/assets/index45.css +1 -1
  89. package/dist/assets/index46.css +1 -1
  90. package/dist/assets/index47.css +1 -1
  91. package/dist/assets/index5.css +1 -1
  92. package/dist/assets/index6.css +1 -1
  93. package/dist/assets/index7.css +1 -1
  94. package/dist/assets/index8.css +1 -1
  95. package/dist/assets/index9.css +1 -1
  96. package/dist/avatar-image.js +1 -1
  97. package/dist/badge.js +1 -1
  98. package/dist/button.js +5 -5
  99. package/dist/card.js +25 -24
  100. package/dist/card.js.map +1 -1
  101. package/dist/checkbox.js +6 -6
  102. package/dist/chunks/{base-button.39fae75f.js → base-button.9f2acdeb.js} +2 -2
  103. package/dist/chunks/{base-button.39fae75f.js.map → base-button.9f2acdeb.js.map} +1 -1
  104. package/dist/chunks/base-modal.56a671c3.js +284 -0
  105. package/dist/chunks/base-modal.56a671c3.js.map +1 -0
  106. package/dist/chunks/{button-actions-with-menu.2ff339f6.js → button-actions-with-menu.080ccaf8.js} +3 -3
  107. package/dist/chunks/{button-actions-with-menu.2ff339f6.js.map → button-actions-with-menu.080ccaf8.js.map} +1 -1
  108. package/dist/chunks/{button.623a46d2.js → button.7ce49c43.js} +2 -2
  109. package/dist/chunks/{button.623a46d2.js.map → button.7ce49c43.js.map} +1 -1
  110. package/dist/chunks/{calendar.b1d05580.js → calendar.f0f7b405.js} +8 -7
  111. package/dist/chunks/{calendar.b1d05580.js.map → calendar.f0f7b405.js.map} +1 -1
  112. package/dist/chunks/{checkbox.d65694f2.js → checkbox.c63cd1d8.js} +3 -3
  113. package/dist/chunks/{checkbox.d65694f2.js.map → checkbox.c63cd1d8.js.map} +1 -1
  114. package/dist/chunks/{controls-group.30352ce4.js → controls-group.1660076e.js} +3 -3
  115. package/dist/chunks/{controls-group.30352ce4.js.map → controls-group.1660076e.js.map} +1 -1
  116. package/dist/chunks/{copy.2a9cddc1.js → copy.91983fad.js} +4 -4
  117. package/dist/chunks/{copy.2a9cddc1.js.map → copy.91983fad.js.map} +1 -1
  118. package/dist/chunks/dropdown-default-textbox.157f95f0.js +399 -0
  119. package/dist/chunks/dropdown-default-textbox.157f95f0.js.map +1 -0
  120. package/dist/chunks/dropdown.b0e80aaa.js +902 -0
  121. package/dist/chunks/dropdown.b0e80aaa.js.map +1 -0
  122. package/dist/chunks/{field-label.b681234d.js → field-label.894140ec.js} +2 -2
  123. package/dist/chunks/{field-label.b681234d.js.map → field-label.894140ec.js.map} +1 -1
  124. package/dist/chunks/{fixed-scroller.ebfb2f80.js → fixed-scroller.708a4c4e.js} +2 -2
  125. package/dist/chunks/{fixed-scroller.ebfb2f80.js.map → fixed-scroller.708a4c4e.js.map} +1 -1
  126. package/dist/chunks/{footer-actions.03015ba1.js → footer-actions.21ba3026.js} +3 -3
  127. package/dist/chunks/{footer-actions.03015ba1.js.map → footer-actions.21ba3026.js.map} +1 -1
  128. package/dist/chunks/{index.80078bf9.js → index.266dd8ff.js} +2 -2
  129. package/dist/chunks/{index.80078bf9.js.map → index.266dd8ff.js.map} +1 -1
  130. package/dist/chunks/{index.45d00aad.js → index.3ec651d0.js} +5 -4
  131. package/dist/chunks/{index.45d00aad.js.map → index.3ec651d0.js.map} +1 -1
  132. package/dist/chunks/{index.0a8ddfaa.js → index.46b7b1d3.js} +6 -6
  133. package/dist/chunks/{index.0a8ddfaa.js.map → index.46b7b1d3.js.map} +1 -1
  134. package/dist/chunks/{index.1dac266a.js → index.62c5d91f.js} +3 -3
  135. package/dist/chunks/{index.1dac266a.js.map → index.62c5d91f.js.map} +1 -1
  136. package/dist/chunks/{index.cf561336.js → index.762f7ec9.js} +6 -6
  137. package/dist/chunks/{index.cf561336.js.map → index.762f7ec9.js.map} +1 -1
  138. package/dist/chunks/{index.a4a6e52f.js → index.9ae856b3.js} +3 -3
  139. package/dist/chunks/{index.a4a6e52f.js.map → index.9ae856b3.js.map} +1 -1
  140. package/dist/chunks/{index.03605cb0.js → index.a25e53b8.js} +5 -5
  141. package/dist/chunks/{index.03605cb0.js.map → index.a25e53b8.js.map} +1 -1
  142. package/dist/chunks/{index.ef1c4d59.js → index.d57976cb.js} +320 -317
  143. package/dist/chunks/index.d57976cb.js.map +1 -0
  144. package/dist/chunks/{index.09f7f1b5.js → index.fcfca776.js} +2 -2
  145. package/dist/chunks/{index.09f7f1b5.js.map → index.fcfca776.js.map} +1 -1
  146. package/dist/chunks/{listbox-option-tag.ff6d6f32.js → listbox-option-tag.1f42ad7f.js} +3 -3
  147. package/dist/chunks/{listbox-option-tag.ff6d6f32.js.map → listbox-option-tag.1f42ad7f.js.map} +1 -1
  148. package/dist/chunks/{listbox.dd9883c5.js → listbox.2c0a69a6.js} +6 -6
  149. package/dist/chunks/{listbox.dd9883c5.js.map → listbox.2c0a69a6.js.map} +1 -1
  150. package/dist/chunks/{loading-button.30c5fede.js → loading-button.52696f0f.js} +2 -2
  151. package/dist/chunks/{loading-button.30c5fede.js.map → loading-button.52696f0f.js.map} +1 -1
  152. package/dist/chunks/{tooltip.785993dd.js → tooltip.d366f95d.js} +3 -3
  153. package/dist/chunks/{tooltip.785993dd.js.map → tooltip.d366f95d.js.map} +1 -1
  154. package/dist/chunks/{useCountryItems.d2a1f224.js → use-country-items.d2a1f224.js} +1 -1
  155. package/dist/chunks/use-country-items.d2a1f224.js.map +1 -0
  156. package/dist/code-snippet.js +7 -7
  157. package/dist/code-snippet.js.map +1 -1
  158. package/dist/country.js +2 -2
  159. package/dist/currency.js +1 -1
  160. package/dist/data-grid.js +658 -649
  161. package/dist/data-grid.js.map +1 -1
  162. package/dist/date-picker.js +36 -35
  163. package/dist/date-picker.js.map +1 -1
  164. package/dist/date-range-picker.js +2 -2
  165. package/dist/date.js +1 -1
  166. package/dist/dropdown.js +122 -174
  167. package/dist/dropdown.js.map +1 -1
  168. package/dist/empty-state.js +3 -3
  169. package/dist/filter-bar.js +20 -19
  170. package/dist/filter-bar.js.map +1 -1
  171. package/dist/focus-trap.js +1 -1
  172. package/dist/form-layout.js +2 -2
  173. package/dist/header.js +3 -3
  174. package/dist/index.js +203 -200
  175. package/dist/info-icon.js +3 -3
  176. package/dist/input-field.js +4 -4
  177. package/dist/internal.js +7 -7
  178. package/dist/link.js +40 -30
  179. package/dist/link.js.map +1 -1
  180. package/dist/loading-indicator.js +1 -1
  181. package/dist/menu.js +1 -1
  182. package/dist/modal.js +297 -404
  183. package/dist/modal.js.map +1 -1
  184. package/dist/pagination.js +122 -122
  185. package/dist/pagination.js.map +1 -1
  186. package/dist/payment-method.js +2 -2
  187. package/dist/popover.js +1 -1
  188. package/dist/popper-container.js +1 -1
  189. package/dist/radio-group.js +4 -4
  190. package/dist/search-bar.js +2 -2
  191. package/dist/secondary-nav.js +2 -2
  192. package/dist/segmented-control.js +3 -3
  193. package/dist/sidepanel.js +5 -5
  194. package/dist/status.js +2 -2
  195. package/dist/stepper.js +3 -3
  196. package/dist/structured-list.js +1 -1
  197. package/dist/summary-grid.js +3 -3
  198. package/dist/tabs.js +39 -39
  199. package/dist/tabs.js.map +1 -1
  200. package/dist/tag.js +3 -3
  201. package/dist/textarea.js +4 -4
  202. package/dist/timeline.js +5 -5
  203. package/dist/toast.js +3 -3
  204. package/dist/toggle.js +2 -2
  205. package/dist/tutorial.js +5 -5
  206. package/dist/typography.js +1 -1
  207. package/dist/web-types.json +1 -1
  208. package/package.json +2 -2
  209. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDisplayValue.d.ts +0 -2
  210. package/dist/@types/packages/vue2/src/components/dropdown/composables/useDropdownSearchFilter.d.ts +0 -3
  211. package/dist/chunks/base-modal.161ce8f0.js +0 -310
  212. package/dist/chunks/base-modal.161ce8f0.js.map +0 -1
  213. package/dist/chunks/dropdown-default-textbox.a731b5fb.js +0 -420
  214. package/dist/chunks/dropdown-default-textbox.a731b5fb.js.map +0 -1
  215. package/dist/chunks/dropdown.96431c25.js +0 -993
  216. package/dist/chunks/dropdown.96431c25.js.map +0 -1
  217. package/dist/chunks/index.ef1c4d59.js.map +0 -1
  218. package/dist/chunks/useCountryItems.d2a1f224.js.map +0 -1
  219. /package/dist/@types/packages/vue2/src/components/dropdown/components/dropdown-options-container/composables/{useDropdownOptionsListbox.d.ts → use-dropdown-options-listbox.d.ts} +0 -0
  220. /package/dist/@types/packages/vue2/src/components/dropdown/components/variants/dropdown-country/composables/{useCountryItems.d.ts → use-country-items.d.ts} +0 -0
@@ -1,993 +0,0 @@
1
- import { ref as $, watch as ye, computed as f, defineComponent as le, toRefs as ge, resolveComponent as O, openBlock as g, createBlock as M, resolveDynamicComponent as he, mergeProps as I, withCtx as P, createElementVNode as j, withKeys as ke, createVNode as W, toHandlers as x, createSlots as Y, renderList as G, renderSlot as U, normalizeProps as Q, guardReactiveProps as X, createElementBlock as R, toDisplayString as ae, createCommentVNode as N, normalizeClass as ee, withDirectives as H, vShow as ce, nextTick as _, toRef as E, resolveDirective as fe, createTextVNode as Ke } from "vue";
2
- import { B as Fe, d as ze } from "./index.09f7f1b5.js";
3
- import { D as We, a as A, b as J, c as Ue } from "./dropdown-default-textbox.a731b5fb.js";
4
- import { _ as F } from "./_plugin-vue_export-helper.dad06003.js";
5
- import { g as K } from "./unique-id.a2a2b458.js";
6
- import { u as xe } from "./aria-label.ac9651a5.js";
7
- import { u as ie } from "./i18n.6c402773.js";
8
- import { u as He } from "./use-form-layout-loading.d03e5d48.js";
9
- import { B as D, a as je } from "./keyboard-navigation.ca47dfa8.js";
10
- import { a as r, B as te, b as oe, u as qe } from "./listbox.dd9883c5.js";
11
- import { B as we } from "./directive.0408e565.js";
12
- import { u as Ve } from "./use-has-slot.4d98bf29.js";
13
- import { a as Z } from "./index.a4a6e52f.js";
14
- import { a as pe } from "./index.03605cb0.js";
15
- import { E as Je, F as Ze } from "./field-label.b681234d.js";
16
- import "../assets/dropdown.css";
17
- var B = /* @__PURE__ */ ((e) => (e.DEFAULT = "DropdownInputDefault", e.SMALL = "DropdownInputSmall", e))(B || {});
18
- const ne = {
19
- "en-US": {
20
- apply: "Apply",
21
- cancel: "Cancel",
22
- noOptionsMatchThisSearch: "No options match this search"
23
- }
24
- }, Ye = (e, o, i, t) => {
25
- const n = $(e.value), { t: l } = ie({ messages: ne });
26
- ye(e, () => {
27
- n.value = e.value;
28
- });
29
- const d = f(
30
- () => JSON.stringify(n.value) === JSON.stringify(e.value)
31
- ), s = () => {
32
- t(r.SELECT, n.value), t(r.CLOSE_DROPDOWN);
33
- }, a = () => {
34
- n.value = e.value, t(r.CLOSE_DROPDOWN);
35
- }, p = () => {
36
- i.value && o.value && (n.value = e.value);
37
- }, L = f(() => [
38
- {
39
- title: l("apply"),
40
- event: s,
41
- disabled: d.value
42
- },
43
- {
44
- title: l("cancel"),
45
- event: a
46
- }
47
- ]), m = (u) => {
48
- n.value = u, o.value || t(r.SELECT, u);
49
- }, w = (u) => {
50
- m(u), t(r.TAB);
51
- }, b = (u) => {
52
- m(u), t(r.ENTER);
53
- }, y = (u) => {
54
- m(u), t(r.SPACE);
55
- }, S = () => {
56
- a(), t(r.ESCAPE);
57
- }, C = () => {
58
- t(r.SHOW_MORE);
59
- }, T = {
60
- [r.SELECT]: m,
61
- [r.SHOW_MORE]: C,
62
- [r.TAB]: w,
63
- [r.SPACE]: y,
64
- [r.ENTER]: b
65
- };
66
- return {
67
- // Values
68
- actions: L,
69
- internalSelectedValue: n,
70
- // Methods
71
- listeners: T,
72
- onEscapeKey: S,
73
- onOutsideDropdownClick: p
74
- };
75
- }, Ge = le({
76
- i18n: { messages: ne },
77
- name: "bento-dropdown-options-container",
78
- components: {
79
- BentoListbox: te,
80
- PopperContainer: Z,
81
- BentoPopover: pe
82
- },
83
- directives: { BentoClickOutsideDirective: we },
84
- props: {
85
- /**
86
- * Defines a string value that labels an interactive element.
87
- */
88
- ariaLabel: { type: String, default: null },
89
- /**
90
- * Empty state props used with the inner empty state component which is displayed when no search results are found.
91
- */
92
- emptyState: {
93
- type: Object,
94
- default: void 0
95
- },
96
- /**
97
- * Disables dropdown functionality
98
- */
99
- disabled: { type: Boolean, default: !1 },
100
- /**
101
- * Indicates whether there are more items to load
102
- */
103
- hasMoreItems: { type: Boolean, default: !1 },
104
- /**
105
- * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
106
- */
107
- id: { type: String, required: !0 },
108
- /**
109
- * Function that allows the options to be disabled
110
- *
111
- * @type {BentoDropdownIsOptionDisabled}
112
- * @param {BentoDropdownOptionItem} option - Dropdown option object
113
- * @param {string} option.label - Option's label text
114
- * @param {string|number} option.value - Option's value
115
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
116
- */
117
- isOptionDisabled: {
118
- type: Function,
119
- default: void 0
120
- },
121
- /**
122
- * Dropdown input size
123
- */
124
- inputSize: {
125
- type: String,
126
- default: B.DEFAULT,
127
- validator: (e) => Object.values(B).includes(e)
128
- },
129
- /**
130
- * The option elements to populate the dropdown with.
131
- * It must be an array of {@see BentoDropdownOptionItem }
132
- * * @property {string} value.label - Text to be displayed in the option
133
- * * @property {string,number} value.value - Value of the option
134
- */
135
- items: {
136
- type: Array,
137
- required: !0
138
- },
139
- /**
140
- * Indicates if new options are loading.
141
- */
142
- loading: { type: Boolean, default: !1 },
143
- /**
144
- * The type of `Lazy Load`.
145
- * Type "automatic" will enable infinite scrolling
146
- * Type "button" will enable lazy loading with "Show more" button
147
- */
148
- lazyLoadType: {
149
- type: String,
150
- default: oe.AUTOMATIC,
151
- validator: (e) => Object.values(oe).includes(e)
152
- },
153
- /**
154
- * If enabled, the user will be able to select multiple items.
155
- */
156
- multiple: { type: Boolean, default: !1 },
157
- /**
158
- * If enabled, dropdown will display non-selectable, static categories
159
- */
160
- staticCategories: { type: Boolean, default: !1 },
161
- /**
162
- * Indicates if the dropdown is open so that
163
- * the container can be displayed.
164
- */
165
- open: { type: Boolean, required: !0 },
166
- /**
167
- * The `input` value.
168
- * Providing an empty string or empty array will select no options.
169
- * Set to an empty string `''` if you don't want any of the available options to be selected for single select
170
- */
171
- selectedValue: {
172
- type: [String, Number, Array],
173
- default: null
174
- },
175
- /**
176
- * Flag that indicates that an external search it's being made
177
- * to filter out the items inside the the multi-select listbox
178
- *
179
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
180
- */
181
- searching: te.props.searching,
182
- /**
183
- * Reference to the DOM element or Vue component for positioning
184
- * the Dropdown container.
185
- */
186
- targetElement: { type: Z.props.targetElement.type, required: !0 },
187
- /**
188
- * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
189
- * The itemHeight function is used to calculate the height of rendered item given it's index.
190
- */
191
- virtualScroll: {
192
- type: [Boolean, Object],
193
- default: !1
194
- }
195
- },
196
- emits: [
197
- r.CLOSE_DROPDOWN,
198
- r.SHOW_MORE,
199
- r.SELECT,
200
- r.ENTER,
201
- r.ESCAPE,
202
- r.SPACE,
203
- r.TAB
204
- ],
205
- setup(e, { emit: o, slots: i }) {
206
- const { selectedValue: t, multiple: n } = ge(e), l = $(null), { t: d } = ie({ messages: ne }), s = f(() => e.open && !e.disabled), a = f(() => d("noOptionsMatchThisSearch")), p = f(() => ({
207
- "b-dropdown-options-container--single": !(e != null && e.multiple)
208
- })), L = f(() => ({
209
- "b-dropdown-options-container__listbox--small": e.inputSize === B.SMALL,
210
- "b-dropdown-options-container__listbox--single": !(e != null && e.multiple)
211
- })), { actions: m, internalSelectedValue: w, listeners: b, onEscapeKey: y, onOutsideDropdownClick: S } = Ye(t, n, s, o), C = f(
212
- () => e != null && e.multiple ? pe : Z
213
- ), T = f(() => {
214
- var c;
215
- const u = {
216
- "min-width": `${(c = e == null ? void 0 : e.targetElement) == null ? void 0 : c.clientWidth}px`,
217
- "max-width": "min(500px, 95%)"
218
- };
219
- return e != null && e.multiple ? {
220
- actionsLayout: "space-between",
221
- actions: m.value,
222
- divider: !0,
223
- fallbackPosition: ["top-start"],
224
- id: K(`dropdown-options-${e.id}`),
225
- open: e.open,
226
- position: "bottom-start",
227
- style: {
228
- width: "auto",
229
- ...u
230
- },
231
- targetElement: e.targetElement
232
- } : {
233
- fallbackPosition: ["top-start"],
234
- offset: [0, 8],
235
- position: "bottom-start",
236
- style: {
237
- display: s.value ? "block" : "none",
238
- ...u
239
- },
240
- targetElement: e.targetElement
241
- };
242
- });
243
- return {
244
- // Values
245
- isDropdownOpen: s,
246
- conditionalClasses: p,
247
- conditionalListboxClasses: L,
248
- noResultsMessage: a,
249
- slots: i,
250
- actions: m,
251
- internalSelectedValue: w,
252
- // Component wrapper
253
- popperContainerOrPopoverComponent: C,
254
- popperContainerOrPopoverProps: T,
255
- // Refs
256
- dropdownOptionsListboxRef: l,
257
- // Events
258
- onEscapeKey: y,
259
- onOutsideDropdownClick: S,
260
- listeners: b
261
- };
262
- }
263
- });
264
- function Qe(e, o, i, t, n, l) {
265
- const d = O("bento-listbox");
266
- return g(), M(he(e.popperContainerOrPopoverComponent), I({
267
- class: ["b-dropdown-options-container", e.conditionalClasses]
268
- }, e.popperContainerOrPopoverProps), {
269
- default: P(() => [
270
- j("div", {
271
- onKeydown: o[0] || (o[0] = ke((...s) => e.onEscapeKey && e.onEscapeKey(...s), ["esc"]))
272
- }, [
273
- W(d, I({
274
- id: e.id,
275
- ref: "dropdownOptionsListboxRef",
276
- "aria-label": e.ariaLabel,
277
- class: ["b-dropdown-options-container__listbox", e.conditionalListboxClasses],
278
- "empty-state": e.emptyState,
279
- "is-option-disabled": e.isOptionDisabled,
280
- items: e.items,
281
- "selected-value": e.internalSelectedValue,
282
- multiple: e.multiple,
283
- "static-categories": e.staticCategories,
284
- "no-results-message": e.noResultsMessage,
285
- searching: e.searching,
286
- loading: e.loading,
287
- "lazy-load-type": e.lazyLoadType,
288
- "has-more-items": e.hasMoreItems,
289
- "virtual-scroll": e.virtualScroll
290
- }, x(e.listeners)), Y({ _: 2 }, [
291
- G(e.slots, (s, a) => ({
292
- name: a,
293
- fn: P((p) => [
294
- U(e.$slots, a, Q(X(p)), void 0, !0)
295
- ])
296
- }))
297
- ]), 1040, ["id", "aria-label", "class", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
298
- ], 32)
299
- ]),
300
- _: 3
301
- }, 16, ["class"]);
302
- }
303
- const Xe = /* @__PURE__ */ F(Ge, [["render", Qe], ["__scopeId", "data-v-f073599e"]]);
304
- let me = 0;
305
- const et = {
306
- beforeCreate() {
307
- this.uuid = me.toString(), me += 1;
308
- }
309
- }, tt = { key: 0 }, ot = /* @__PURE__ */ j("path", {
310
- fill: "#00112C",
311
- d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z"
312
- }, null, -1);
313
- function nt(e, o, i, t, n, l) {
314
- return g(), R("svg", I({ role: "img" }, e.$attrs, {
315
- class: "ui-assets-icons-16",
316
- xmlns: "http://www.w3.org/2000/svg",
317
- width: "16",
318
- height: "16",
319
- fill: "none"
320
- }), [
321
- e.$attrs["svg-title"] ? (g(), R("title", tt, ae(e.$attrs["svg-title"]), 1)) : N("", !0),
322
- ot
323
- ], 16);
324
- }
325
- const lt = /* @__PURE__ */ F(et, [["render", nt]]);
326
- let ve = 0;
327
- const at = {
328
- beforeCreate() {
329
- this.uuid = ve.toString(), ve += 1;
330
- }
331
- }, it = { key: 0 }, st = /* @__PURE__ */ j("path", {
332
- fill: "#00112C",
333
- d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z"
334
- }, null, -1);
335
- function rt(e, o, i, t, n, l) {
336
- return g(), R("svg", I({ role: "img" }, e.$attrs, {
337
- class: "ui-assets-icons-16",
338
- xmlns: "http://www.w3.org/2000/svg",
339
- width: "16",
340
- height: "16",
341
- fill: "none"
342
- }), [
343
- e.$attrs["svg-title"] ? (g(), R("title", it, ae(e.$attrs["svg-title"]), 1)) : N("", !0),
344
- st
345
- ], 16);
346
- }
347
- const dt = /* @__PURE__ */ F(at, [["render", rt]]), ut = le({
348
- name: "dropdown-small-textbox",
349
- components: { ChevronDownSmallIcon: lt, ChevronUpSmallIcon: dt, DropdownBaseTextbox: We },
350
- inheritAttrs: !1,
351
- props: {
352
- /**
353
- * The number of additional items that have been selected in the dropdown.
354
- */
355
- additionalItemsSelected: { type: [Number, String], default: 0 },
356
- /**
357
- * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
358
- */
359
- ariaControls: {
360
- type: String,
361
- required: !0
362
- },
363
- /**
364
- * Indicates whether the content the textbox triggers is visible or not. Needs to be set accordingly when the textbox is used and changed every time the popover is shown/hidden.
365
- */
366
- ariaExpanded: {
367
- type: [String, Boolean],
368
- required: !0
369
- },
370
- /**
371
- * If no label element is used then the aria-label is be set should be set.
372
- */
373
- ariaLabel: {
374
- type: String,
375
- default: null
376
- },
377
- /**
378
- * Corresponds to the label's id that labels the textbox element.
379
- */
380
- ariaLabelledby: {
381
- type: String,
382
- default: null
383
- },
384
- /**
385
- * Custom debounce time. Default: 300
386
- */
387
- debounceTime: { type: Number, default: 300 },
388
- /**
389
- * Disables any textbox functionality
390
- */
391
- disabled: { type: Boolean, default: !1 },
392
- /**
393
- * Selected option's label
394
- */
395
- displayValue: { type: String, default: null },
396
- /**
397
- * Sets the possibility to type into the textbox
398
- */
399
- dynamicFiltering: {
400
- type: Boolean,
401
- default: !1
402
- },
403
- /**
404
- * Marks the textbox as invalid, rendering an error state
405
- */
406
- isInvalid: { type: Boolean, default: !1 },
407
- /**
408
- * Indicates if the dropdown is open so that
409
- * the respective event can be emitted
410
- */
411
- open: { type: Boolean, default: !1 },
412
- /**
413
- * Sets the dropdown to readonly state
414
- */
415
- readonly: { type: Boolean, default: !1 },
416
- /**
417
- * The input value
418
- */
419
- value: { type: String, default: "" }
420
- },
421
- emits: [A.OPEN, A.CLOSE],
422
- setup(e, { emit: o }) {
423
- const i = f(() => ({
424
- [`b-dropdown-small-textbox--${J.DISABLED}`]: e.disabled,
425
- [`b-dropdown-small-textbox--${J.READONLY}`]: e.readonly,
426
- [`b-dropdown-small-textbox--${J.OPENED}`]: e.open
427
- })), t = f(() => e.open && !e.disabled && !e.readonly), n = () => {
428
- o(A.OPEN);
429
- }, l = () => {
430
- o(A.CLOSE);
431
- }, d = {
432
- [A.OPEN]: n,
433
- [A.CLOSE]: l
434
- };
435
- return {
436
- // Values
437
- conditionalClasses: i,
438
- isDropdownOpen: t,
439
- // Events
440
- listeners: d
441
- };
442
- }
443
- });
444
- const ct = { class: "b-dropdown-small-textbox__chevron" };
445
- function ft(e, o, i, t, n, l) {
446
- const d = O("chevron-up-small-icon"), s = O("chevron-down-small-icon"), a = O("dropdown-base-textbox");
447
- return g(), R("div", {
448
- class: ee(["b-dropdown-small-textbox", e.conditionalClasses])
449
- }, [
450
- W(a, I({ ...e.$attrs, ...e.$props }, { class: "b-dropdown-small-textbox__textbox" }, x(e.listeners)), {
451
- icon: P(() => [
452
- j("div", ct, [
453
- H(W(d, { "svg-title": "opened" }, null, 512), [
454
- [ce, e.isDropdownOpen]
455
- ]),
456
- H(W(s, { "svg-title": "closed" }, null, 512), [
457
- [ce, !e.isDropdownOpen]
458
- ])
459
- ])
460
- ]),
461
- _: 1
462
- }, 16)
463
- ], 2);
464
- }
465
- const pt = /* @__PURE__ */ F(ut, [["render", ft], ["__scopeId", "data-v-36f61648"]]), mt = ({ items: e, placeholder: o, selectedValue: i, staticCategories: t }) => {
466
- let n;
467
- if (t) {
468
- const l = e.value.find((d) => d.items.some((s) => s.value === i.value));
469
- n = l == null ? void 0 : l.items.find((d) => d.value === i.value);
470
- } else
471
- n = e.value.find(({ value: l }) => l === i.value);
472
- return (n == null ? void 0 : n.label) || o.value || null;
473
- }, vt = ({ selectedValues: e, items: o, placeholder: i }) => {
474
- var t;
475
- return !e.value || ((t = e.value) == null ? void 0 : t.length) === 0 ? i.value || null : e.value.map((n) => {
476
- const { label: l } = o.value.find(({ value: d }) => d === n);
477
- return l;
478
- }).join(", ");
479
- }, bt = ({ selectedValues: e, items: o, placeholder: i }) => {
480
- var t;
481
- return !e.value || !((t = e.value) != null && t.length) ? i.value || null : o.value.reduce((n, l) => {
482
- if (l.items) {
483
- const d = l.items.filter(
484
- (a) => e.value.includes(a.value)
485
- );
486
- d.length === l.items.length ? n.push(l.label) : d.forEach(({ label: a }) => n.push(a));
487
- }
488
- return e.value.includes(l.value) && n.push(l.label), n;
489
- }, []).join(", ");
490
- }, yt = ({ items: e, placeholder: o, value: i, multiple: t, staticCategories: n }) => {
491
- const l = f(() => e.value.find((s) => {
492
- var a;
493
- return (a = s.items) == null ? void 0 : a.length;
494
- }));
495
- return f(() => t.value ? l.value ? bt({ selectedValues: i, placeholder: o, items: e }) : vt({ selectedValues: i, items: e, placeholder: o }) : mt({
496
- items: e,
497
- placeholder: o,
498
- selectedValue: i,
499
- staticCategories: n.value
500
- }));
501
- }, Se = (e) => {
502
- var o;
503
- (o = e.value.$children) == null || o[0].$refs.textbox.focus();
504
- }, gt = ({
505
- inputContainerRef: e,
506
- optionsContainerRef: o,
507
- selectedValueIndex: i,
508
- isDropdownOpen: t,
509
- isDynamicFltering: n,
510
- items: l,
511
- isMultiple: d
512
- }, s, a, p) => {
513
- const L = ({ detail: u }) => {
514
- u.preventDefault(), t.value || (a(), _(() => {
515
- var c, h;
516
- d ? (c = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus() : (h = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || h[i.value].$el.focus();
517
- }));
518
- }, m = ({ detail: u }) => {
519
- u.preventDefault(), t.value || (a(), _(() => {
520
- var c;
521
- (c = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus();
522
- }));
523
- }, w = () => {
524
- t.value || (a(), _(() => {
525
- var u, c;
526
- if (d) {
527
- const h = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children;
528
- (u = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || u[h.length - 1].$children[l.length - 1].$el.focus();
529
- } else
530
- (c = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[l.length - 1].$el.focus();
531
- }));
532
- }, b = () => {
533
- t.value && (p(), Se(e));
534
- }, y = () => {
535
- t.value || a(), _(() => {
536
- var u;
537
- (u = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || u[0].$el.focus();
538
- });
539
- }, S = ({ detail: u }) => {
540
- u.preventDefault(), s(), t.value && _(() => {
541
- var c, h;
542
- d ? (c = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[0].$el.focus() : (h = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || h[i.value].$el.focus();
543
- });
544
- }, C = () => {
545
- s(), t.value && _(() => {
546
- var u, c;
547
- d ? (u = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || u[0].$el.focus() : (c = o.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef.$children) == null || c[i.value].$el.focus();
548
- });
549
- };
550
- return f(() => ({
551
- ...n.value ? {} : { [D.SPACE]: S },
552
- [D.ENTER]: C,
553
- [D.ARROW_DOWN]: L,
554
- [D.ARROW_UP]: m,
555
- [D.END]: w,
556
- [D.ESCAPE]: b,
557
- [D.HOME]: y
558
- }));
559
- }, ht = ({ inputContainerRef: e, isDropdownOpen: o }, i) => {
560
- const t = () => {
561
- o.value && i(), _(() => {
562
- Se(e);
563
- });
564
- };
565
- return {
566
- [r.ENTER]: t,
567
- [r.ESCAPE]: t,
568
- [r.TAB]: t,
569
- [r.SPACE]: t
570
- };
571
- };
572
- function wt(e, o, i) {
573
- const t = $(e), n = $(o), l = (s, a = []) => a.flatMap((p) => p.label.toLocaleLowerCase().includes(s) ? [p, ...l(s, p.items)] : p.items ? [...l(s, p.items)] : []);
574
- return ye(t, () => {
575
- i !== void 0 && i(t.value);
576
- }), f(() => {
577
- if (!t.value || i !== void 0)
578
- return n.value;
579
- const s = t.value.toLocaleLowerCase();
580
- return l(s, n.value);
581
- });
582
- }
583
- const be = {
584
- "en-US": {
585
- all: "All",
586
- clearSearch: "Clear filter",
587
- ariaLabelFallback: "Dropdown"
588
- }
589
- }, St = le({
590
- i18n: { messages: be },
591
- name: "b-dropdown",
592
- components: {
593
- BentoDropdownOptionsContainer: Xe,
594
- BentoTypography: Fe,
595
- DropdownInputDefault: Ue,
596
- DropdownInputSmall: pt,
597
- ErrorMessage: Je,
598
- FieldLabel: Ze
599
- },
600
- directives: { BentoClickOutsideDirective: we, BentoKeyboardNavigationDirective: je },
601
- props: {
602
- /**
603
- * @deprecated from version 2.0.0. Use the aria-label attribute instead.
604
- */
605
- /**
606
- * Defines a string value that labels an interactive element.
607
- */
608
- ariaLabel: { type: String, default: null },
609
- /**
610
- * Renders the dropdown with a condensed style.
611
- */
612
- condensed: { type: Boolean, default: !1 },
613
- /**
614
- * Empty state props used with the inner empty state component which is displayed when no search results are found.
615
- */
616
- emptyState: {
617
- type: Object,
618
- default: void 0
619
- },
620
- /**
621
- * Disables dropdown functionality.
622
- */
623
- disabled: { type: Boolean, default: !1 },
624
- /**
625
- * Text that appears in the form control when it has no value set
626
- */
627
- placeholder: {
628
- type: String,
629
- default: null
630
- },
631
- /**
632
- * Sets the possibility to type into the textbox.
633
- */
634
- dynamicFiltering: {
635
- type: Boolean,
636
- default: !1
637
- },
638
- /**
639
- * Highlights the dropdown in an erroneous state.
640
- *
641
- * @deprecated Use "errorMessage" prop instead
642
- */
643
- error: { type: Boolean, default: !1 },
644
- /**
645
- * Highlights the dropdown in an erroneous state with an error message.
646
- */
647
- errorMessage: { type: String, default: null },
648
- /**
649
- * Text that is displayed as a label above the element.
650
- */
651
- label: { type: String, default: null },
652
- /**
653
- * Descriptive supporting text visbile underneath the dropdown.
654
- */
655
- description: { type: String, default: null },
656
- /**
657
- * Indicates whether there are more items to load
658
- */
659
- hasMoreItems: { type: Boolean, default: !1 },
660
- /**
661
- * Function that dertermines which options are disabled from interaction.
662
- *
663
- * @type {BentoListboxIsOptionDisabled}
664
- * @param {BentoListboxOptionItem} option - Dropdown option object
665
- * @param {string} option.label - Option's label text
666
- * @param {string|number} option.value - Option's value
667
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
668
- */
669
- isOptionDisabled: {
670
- type: Function,
671
- default: void 0
672
- },
673
- /**
674
- * The option elements to populate the dropdown with.
675
- * It must be an array of {@see BentoListboxOptionItem }
676
- * * @property {string} value.label - Text to be displayed in the option
677
- * * @property {string,number} value.value - Value of the option
678
- */
679
- items: {
680
- type: Array,
681
- default: () => []
682
- },
683
- /**
684
- * Indicates if new options are loading.
685
- */
686
- loading: { type: Boolean, default: !1 },
687
- /**
688
- * The type of `Lazy Load`.
689
- * Type "automatic" will enable infinite scrolling
690
- * Type "button" will enable lazy loading with "Show more" button
691
- */
692
- lazyLoadType: {
693
- type: String,
694
- default: te.props.lazyLoadType.default,
695
- validator: (e) => Object.values(oe).includes(e)
696
- },
697
- /*
698
- * If enabled, the user will be able to select multiple items.
699
- */
700
- multiple: { type: Boolean, default: !1 },
701
- /**
702
- * Highlights the dropdown is optional.
703
- */
704
- optional: { type: Boolean, default: !1 },
705
- /**
706
- * Sets the dropdown to readonly state
707
- */
708
- readonly: { type: Boolean, default: !1 },
709
- /**
710
- * Highlights the dropdown is required.
711
- */
712
- required: { type: Boolean, default: !1 },
713
- /**
714
- * Toggles whether to use the slot content select items shown in the textbox in multiple mode.
715
- */
716
- showSlotContentInMultiple: { type: Boolean, default: !1 },
717
- /**
718
- * Dropdown input size
719
- * * @see BentoDropdownSize
720
- */
721
- size: {
722
- type: String,
723
- default: B.DEFAULT,
724
- validator: (e) => Object.values(B).includes(e)
725
- },
726
- /**
727
- * Adds a info icon next to the label to display the passed tooltip message.
728
- */
729
- tooltipText: { type: String, default: null },
730
- /**
731
- * If enabled, dropdown will display non-selectable, static categories
732
- */
733
- staticCategories: { type: Boolean, default: !1 },
734
- /**
735
- * The `input` value.
736
- * Providing an empty string will select no options.
737
- * Set to an empty string `''` if you don't want any of the available options to be selected.
738
- */
739
- value: {
740
- type: [String, Number, Array],
741
- default: null
742
- },
743
- /**
744
- * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
745
- * The itemHeight function is used to calculate the height of rendered item given it's index.
746
- */
747
- virtualScroll: {
748
- type: [Boolean, Object],
749
- default: !1
750
- },
751
- /**
752
- * Dropdown search options and events.
753
- * @see BentoDropdownSearchOptions
754
- */
755
- search: {
756
- type: Object,
757
- default: void 0
758
- }
759
- },
760
- emits: ["input", r.SHOW_MORE],
761
- setup(e, { attrs: o, emit: i, slots: t }) {
762
- var ue;
763
- const { t: n } = ie({ messages: be }), l = $(null), d = $(null), s = $(null), a = $(!1), p = K("bento-dropdown-options-container"), L = K("dropdown-label"), m = K("dropdown-description"), w = K("dropdown-error"), { isReadOnly: b } = He(E(e, "readonly")), y = $(o["aria-label"]), { ariaLabel: S } = ge(e), C = xe({
764
- ariaLabel: y.value,
765
- // TODO: take this line away when the aria-label props is removed
766
- label: S,
767
- defaultFallback: n("ariaLabelFallback")
768
- }), T = f(() => ({
769
- "b-dropdown--condensed": e.condensed
770
- })), u = f(() => ({
771
- "b-dropdown__description--error": !!e.errorMessage
772
- })), c = $(""), h = E(e, "items"), $e = wt(c, h, (ue = e == null ? void 0 : e.search) == null ? void 0 : ue.searchEvent), q = f(() => e.dynamicFiltering && !!c.value), Le = yt({
773
- items: h,
774
- staticCategories: E(e, "staticCategories"),
775
- multiple: E(e, "multiple"),
776
- placeholder: E(e, "placeholder"),
777
- value: E(e, "value")
778
- }), Oe = f(() => e.size === B.DEFAULT), Ce = f(() => {
779
- if (e != null && e.multiple)
780
- return e.items.filter(
781
- ({ value: v }) => (e == null ? void 0 : e.value) && (e == null ? void 0 : e.value).includes(v)
782
- );
783
- if (!e.multiple && e.staticCategories) {
784
- const v = e.items.find(
785
- (z) => z.items.some((Pe) => Pe.value === e.value)
786
- );
787
- return v ? v.items.find((z) => z.value === e.value) : null;
788
- }
789
- return e.items.find(({ value: v }) => v === (e == null ? void 0 : e.value));
790
- }), Ee = f(() => {
791
- const v = e.items.findIndex(({ value: k }) => e.value === k);
792
- return v > 0 ? v : 0;
793
- }), { isMultiLevelSelect: De, flattenedItemsList: _e } = qe(h), Be = f(() => {
794
- var v;
795
- if (e.multiple) {
796
- const k = (v = e == null ? void 0 : e.value) == null ? void 0 : v.length;
797
- return (De.value ? _e.value.length : h.value.length) === k ? n("all") : k;
798
- }
799
- return null;
800
- }), Ie = f(
801
- () => `${e.description ? m : ""} ${e.errorMessage ? w : ""}`.trim() || null
802
- ), Re = () => {
803
- b.value || (a.value = !0);
804
- }, V = () => {
805
- a.value = !1;
806
- }, se = () => {
807
- b.value || (a.value = !a.value, q.value && (c.value = ""));
808
- }, Te = () => {
809
- q.value && (c.value = ""), a.value && (a.value = !1, s.value.onOutsideDropdownClick());
810
- }, re = (v) => {
811
- e.multiple || (c.value = "", a.value = !1), i("input", v);
812
- }, de = () => {
813
- i(r.SHOW_MORE);
814
- }, Ae = gt(
815
- {
816
- inputContainerRef: l,
817
- optionsContainerRef: s,
818
- selectedValueIndex: Ee,
819
- isDropdownOpen: a,
820
- isDynamicFltering: E(e, "dynamicFiltering"),
821
- items: e.items,
822
- isMultiple: e.multiple
823
- },
824
- se,
825
- Re,
826
- V
827
- ), Me = ht(
828
- {
829
- inputContainerRef: l,
830
- isDropdownOpen: a
831
- },
832
- V
833
- ), Ne = {
834
- [r.CLOSE_DROPDOWN]: V,
835
- [r.SELECT]: re,
836
- [r.SHOW_MORE]: de,
837
- ...Me
838
- };
839
- return e.error && ze(
840
- 'BentoDropdown "error" property',
841
- `Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
842
- Having the field as "undefined" will hide/remove the error.
843
- <bento-dropdown errorMessage="Error message text" />`,
844
- "2.0.0"
845
- ), {
846
- // Values
847
- conditionalClasses: T,
848
- computedAriaLabel: C,
849
- additionalItemsSelected: Be,
850
- idDefaultSize: Oe,
851
- isDropdownOpen: a,
852
- displayValue: Le,
853
- dropdownOptionsContainerId: p,
854
- filteredItems: $e,
855
- isSearching: q,
856
- isReadOnly: b,
857
- searchTerm: c,
858
- labelId: L,
859
- descriptionId: m,
860
- errorId: w,
861
- ariaDescribedBy: Ie,
862
- selectedValueItem: Ce,
863
- // Conciliation of Vue2 $scopedSlots and Vue3 $scopes.
864
- // The setup method and the "useSlots" composible define
865
- // { slots } as a proxy of $scopedSlots and $scopes in their
866
- // respective Vue version. Source: https://github.com/vuejs/composition-api/issues/84#issuecomment-524885445
867
- slots: t,
868
- descriptionConditionalClasses: u,
869
- // Methods
870
- hasSlot: Ve(t),
871
- // Refs
872
- inputContainerRef: l,
873
- inputContainerRefWrapper: d,
874
- optionsContainerRef: s,
875
- // Events
876
- clickOutsideDropdown: Te,
877
- toggleDropdown: se,
878
- onOptionSelected: re,
879
- emitShowMoreEvent: de,
880
- textboxKeyboardNavigationListeners: Ae,
881
- listboxListeners: Ne
882
- };
883
- }
884
- });
885
- function $t(e, o, i, t, n, l) {
886
- var w;
887
- const d = O("field-label"), s = O("bento-dropdown-options-container"), a = O("error-message"), p = O("bento-typography"), L = fe("bento-keyboard-navigation-directive"), m = fe("bento-click-outside-directive");
888
- return H((g(), R("div", {
889
- class: ee(["b-dropdown", e.conditionalClasses])
890
- }, [
891
- e.label ? (g(), M(d, {
892
- key: 0,
893
- id: e.labelId,
894
- condensed: e.condensed,
895
- label: e.label,
896
- "tooltip-text": e.tooltipText,
897
- optional: e.optional,
898
- required: e.required
899
- }, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : N("", !0),
900
- H((g(), R("div", I({ ref: "inputContainerRefWrapper" }, x(e.textboxKeyboardNavigationListeners, !0)), [
901
- (g(), M(he(e.size), {
902
- ref: "inputContainerRef",
903
- condensed: e.condensed,
904
- value: e.searchTerm,
905
- "additional-items-selected": e.additionalItemsSelected,
906
- ariaControls: e.dropdownOptionsContainerId,
907
- ariaExpanded: e.isDropdownOpen,
908
- "aria-labelledby": e.label ? e.labelId : null,
909
- "aria-describedby": e.ariaDescribedBy,
910
- "aria-label": e.computedAriaLabel,
911
- "aria-readonly": e.isReadOnly,
912
- readonly: e.isReadOnly,
913
- disabled: e.disabled,
914
- "display-value": e.displayValue,
915
- "dynamic-filtering": e.dynamicFiltering,
916
- "is-invalid": !!e.errorMessage || e.error,
917
- multiple: e.multiple,
918
- open: e.isDropdownOpen,
919
- "selected-value-item": e.idDefaultSize ? e.selectedValueItem : void 0,
920
- "show-slot-content-in-multiple": e.showSlotContentInMultiple,
921
- onInput: o[0] || (o[0] = (b) => e.searchTerm = b),
922
- onOpen: e.toggleDropdown,
923
- onClose: e.toggleDropdown
924
- }, Y({ _: 2 }, [
925
- G(e.slots, (b, y) => ({
926
- name: y,
927
- fn: P((S) => [
928
- U(e.$slots, y, Q(X(S)), void 0, !0)
929
- ])
930
- }))
931
- ]), 1064, ["condensed", "value", "additional-items-selected", "ariaControls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "readonly", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple", "onOpen", "onClose"]))
932
- ], 16)), [
933
- [L]
934
- ]),
935
- e.inputContainerRef ? (g(), M(s, I({
936
- key: 1,
937
- id: e.dropdownOptionsContainerId,
938
- ref: "optionsContainerRef",
939
- "aria-label": e.computedAriaLabel,
940
- "empty-state": e.emptyState,
941
- "debounce-time": (w = e.search) == null ? void 0 : w.debounceTime,
942
- disabled: e.disabled,
943
- "input-size": e.size,
944
- "is-option-disabled": e.isOptionDisabled,
945
- items: e.filteredItems,
946
- multiple: e.multiple,
947
- "static-categories": e.staticCategories,
948
- open: e.isDropdownOpen,
949
- "selected-value": e.value,
950
- searching: e.isSearching,
951
- "target-element": e.inputContainerRefWrapper,
952
- loading: e.loading,
953
- "has-more-items": e.hasMoreItems,
954
- "lazy-load-type": e.lazyLoadType,
955
- "virtual-scroll": e.virtualScroll
956
- }, x(e.listboxListeners)), Y({ _: 2 }, [
957
- G(e.slots, (b, y) => ({
958
- name: y,
959
- fn: P((S) => [
960
- U(e.$slots, y, Q(X(S)), void 0, !0)
961
- ])
962
- }))
963
- ]), 1040, ["id", "aria-label", "empty-state", "debounce-time", "disabled", "input-size", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])) : N("", !0),
964
- e.errorMessage ? (g(), M(a, {
965
- key: 2,
966
- id: e.errorId,
967
- "error-message": e.errorMessage,
968
- class: "b-dropdown__error-message"
969
- }, null, 8, ["id", "error-message"])) : N("", !0),
970
- e.description || e.hasSlot("description") ? (g(), M(p, {
971
- key: 3,
972
- id: e.descriptionId,
973
- class: ee(["b-dropdown__description", e.descriptionConditionalClasses]),
974
- el: "span"
975
- }, {
976
- default: P(() => [
977
- U(e.$slots, "description", {}, () => [
978
- Ke(ae(e.description), 1)
979
- ], !0)
980
- ]),
981
- _: 3
982
- }, 8, ["id", "class"])) : N("", !0)
983
- ], 2)), [
984
- [m, e.clickOutsideDropdown]
985
- ]);
986
- }
987
- const Kt = /* @__PURE__ */ F(St, [["render", $t], ["__scopeId", "data-v-fbd05464"]]);
988
- export {
989
- Kt as B,
990
- B as a,
991
- wt as u
992
- };
993
- //# sourceMappingURL=dropdown.96431c25.js.map