@adyen/bento-vue3 1.76.2 → 1.77.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 (145) hide show
  1. package/dist/@types/index.d.ts +216 -33
  2. package/dist/assets/accordion-item.css +1 -1
  3. package/dist/assets/action-bar.css +1 -1
  4. package/dist/assets/base-modal.css +1 -1
  5. package/dist/assets/button-actions.css +1 -1
  6. package/dist/assets/card.css +1 -1
  7. package/dist/assets/data-grid.css +1 -1
  8. package/dist/assets/date-picker.css +1 -1
  9. package/dist/assets/date-range-picker.css +1 -1
  10. package/dist/assets/dialog-page.css +1 -1
  11. package/dist/assets/dropdown-default-textbox.css +1 -1
  12. package/dist/assets/dropdown-tag.css +1 -1
  13. package/dist/assets/dropdown.css +1 -1
  14. package/dist/assets/file-uploader.css +1 -1
  15. package/dist/assets/filter-bar.css +1 -1
  16. package/dist/assets/input-field-phone-number.css +1 -1
  17. package/dist/assets/input-field.css +1 -1
  18. package/dist/assets/inspector.css +1 -1
  19. package/dist/assets/modal-fullscreen.css +1 -1
  20. package/dist/assets/pagination.css +1 -1
  21. package/dist/assets/payment-method.css +1 -1
  22. package/dist/assets/secondary-nav.css +1 -1
  23. package/dist/assets/sidepanel.css +1 -1
  24. package/dist/assets/tag.css +1 -1
  25. package/dist/assets/textarea.css +1 -1
  26. package/dist/assets/timeline-item.css +1 -1
  27. package/dist/checkbox.js +2 -2
  28. package/dist/chunks/{checkbox-group.8ebmaHsA.js → checkbox-group.COUx8Ne8.js} +2 -2
  29. package/dist/chunks/{checkbox-group.8ebmaHsA.js.map → checkbox-group.COUx8Ne8.js.map} +1 -1
  30. package/dist/chunks/{checkbox.BI0dqARY.js → checkbox.SffuKyNj.js} +3 -3
  31. package/dist/chunks/{checkbox.BI0dqARY.js.map → checkbox.SffuKyNj.js.map} +1 -1
  32. package/dist/chunks/{code-snippet.Bjf1ma1L.js → code-snippet.ByoBEM00.js} +2 -2
  33. package/dist/chunks/{code-snippet.Bjf1ma1L.js.map → code-snippet.ByoBEM00.js.map} +1 -1
  34. package/dist/chunks/{currency.CBZMwm21.js → currency.WmvQjX7l.js} +2 -2
  35. package/dist/chunks/{currency.CBZMwm21.js.map → currency.WmvQjX7l.js.map} +1 -1
  36. package/dist/chunks/{data-grid.VBEJO94f.js → data-grid.CMIG82Xt.js} +7 -7
  37. package/dist/chunks/{data-grid.VBEJO94f.js.map → data-grid.CMIG82Xt.js.map} +1 -1
  38. package/dist/chunks/date-picker.CsGq3iSK.js +244 -0
  39. package/dist/chunks/date-picker.CsGq3iSK.js.map +1 -0
  40. package/dist/chunks/date-picker.types.Ckt7zxGy.js +5 -0
  41. package/dist/chunks/date-picker.types.Ckt7zxGy.js.map +1 -0
  42. package/dist/chunks/date-range-picker.C19CWG27.js +1149 -0
  43. package/dist/chunks/date-range-picker.C19CWG27.js.map +1 -0
  44. package/dist/chunks/{dropdown-default-textbox.MkU0tMf1.js → dropdown-default-textbox._KEBXjKT.js} +88 -86
  45. package/dist/chunks/dropdown-default-textbox._KEBXjKT.js.map +1 -0
  46. package/dist/chunks/dropdown-tag.B90dpg8J.js +301 -0
  47. package/dist/chunks/dropdown-tag.B90dpg8J.js.map +1 -0
  48. package/dist/chunks/dropdown.DYDHM__3.js +833 -0
  49. package/dist/chunks/{dropdown.KStrJVoP.js.map → dropdown.DYDHM__3.js.map} +1 -1
  50. package/dist/chunks/es6.MoTTyETW.js.map +1 -1
  51. package/dist/chunks/{file-uploader.By0MTfKk.js → file-uploader.BDXQ7Ccv.js} +416 -415
  52. package/dist/chunks/{file-uploader.By0MTfKk.js.map → file-uploader.BDXQ7Ccv.js.map} +1 -1
  53. package/dist/chunks/{filter-bar.JXmlFnHV.js → filter-bar.CmF92iAr.js} +303 -303
  54. package/dist/chunks/filter-bar.CmF92iAr.js.map +1 -0
  55. package/dist/chunks/form-field.BBqLu-vs.js +10 -0
  56. package/dist/chunks/form-field.BBqLu-vs.js.map +1 -0
  57. package/dist/chunks/get-slot-text.CQRAP2_q.js +12 -0
  58. package/dist/chunks/get-slot-text.CQRAP2_q.js.map +1 -0
  59. package/dist/chunks/{header-with-views.Dg2usaMY.js → header-with-views.xPfeOz0Y.js} +3 -3
  60. package/dist/chunks/{header-with-views.Dg2usaMY.js.map → header-with-views.xPfeOz0Y.js.map} +1 -1
  61. package/dist/chunks/{input-field-password.B6nJ7ygZ.js → input-field-password.BZBYVyAb.js} +3 -3
  62. package/dist/chunks/{input-field-password.B6nJ7ygZ.js.map → input-field-password.BZBYVyAb.js.map} +1 -1
  63. package/dist/chunks/{input-field-phone-number.D_UBAN2s.js → input-field-phone-number.a8Mw5PAW.js} +5 -5
  64. package/dist/chunks/{input-field-phone-number.D_UBAN2s.js.map → input-field-phone-number.a8Mw5PAW.js.map} +1 -1
  65. package/dist/chunks/{input-field.C29FCI4j.js → input-field.CYGGIK48.js} +48 -48
  66. package/dist/chunks/input-field.CYGGIK48.js.map +1 -0
  67. package/dist/chunks/{listbox-option-tag.uHSB7MO6.js → listbox-option-tag.Cwe9Bn-R.js} +2 -2
  68. package/dist/chunks/{listbox-option-tag.uHSB7MO6.js.map → listbox-option-tag.Cwe9Bn-R.js.map} +1 -1
  69. package/dist/chunks/{pagination.BaBWNlIF.js → pagination.CYdGcyMA.js} +49 -49
  70. package/dist/chunks/pagination.CYdGcyMA.js.map +1 -0
  71. package/dist/chunks/{payment-method.CDnn1bjo.js → payment-method.D6PeTYWq.js} +45 -42
  72. package/dist/chunks/payment-method.D6PeTYWq.js.map +1 -0
  73. package/dist/chunks/payment-method.types.BqtH7RM2.js.map +1 -1
  74. package/dist/chunks/{radio-group.DWNqrkZ3.js → radio-group.B_8R6vGx.js} +3 -3
  75. package/dist/chunks/{radio-group.DWNqrkZ3.js.map → radio-group.B_8R6vGx.js.map} +1 -1
  76. package/dist/chunks/{rich-text-editor.Bh7KS617.js → rich-text-editor.B6Ftqv55.js} +2 -2
  77. package/dist/chunks/{rich-text-editor.Bh7KS617.js.map → rich-text-editor.B6Ftqv55.js.map} +1 -1
  78. package/dist/chunks/{search-bar.RS02IcLc.js → search-bar.D3Ri_RUK.js} +3 -3
  79. package/dist/chunks/{search-bar.RS02IcLc.js.map → search-bar.D3Ri_RUK.js.map} +1 -1
  80. package/dist/chunks/{secondary-nav.DXsgUTqk.js → secondary-nav.CAb20jWW.js} +24 -24
  81. package/dist/chunks/secondary-nav.CAb20jWW.js.map +1 -0
  82. package/dist/chunks/{summary-grid.types.ByQ4u19J.js → summary-grid.types.cE1fyLvC.js} +2 -2
  83. package/dist/chunks/{summary-grid.types.ByQ4u19J.js.map → summary-grid.types.cE1fyLvC.js.map} +1 -1
  84. package/dist/chunks/tag.CjaB9DxL.js +57 -0
  85. package/dist/chunks/tag.CjaB9DxL.js.map +1 -0
  86. package/dist/chunks/textarea.C_gnXj6b.js +254 -0
  87. package/dist/chunks/textarea.C_gnXj6b.js.map +1 -0
  88. package/dist/chunks/{timeline-item.DNjubXL2.js → timeline-item.rSY0Xce3.js} +48 -48
  89. package/dist/chunks/timeline-item.rSY0Xce3.js.map +1 -0
  90. package/dist/chunks/{toggle.Dd_NA8eH.js → toggle.BHCUjMpp.js} +2 -2
  91. package/dist/chunks/{toggle.Dd_NA8eH.js.map → toggle.BHCUjMpp.js.map} +1 -1
  92. package/dist/code-snippet.js +1 -1
  93. package/dist/currency.js +1 -1
  94. package/dist/data-grid.js +1 -1
  95. package/dist/date-picker.js +7 -6
  96. package/dist/date-picker.js.map +1 -1
  97. package/dist/date-range-picker.js +1 -1
  98. package/dist/dropdown.js +3 -3
  99. package/dist/file-uploader.js +1 -1
  100. package/dist/filter-bar.js +1 -1
  101. package/dist/header-with-views.js +1 -1
  102. package/dist/index.js +246 -245
  103. package/dist/index.js.map +1 -1
  104. package/dist/input-field-password.js +1 -1
  105. package/dist/input-field-phone-number.js +1 -1
  106. package/dist/input-field.js +1 -1
  107. package/dist/internal.js +1 -1
  108. package/dist/pagination.js +1 -1
  109. package/dist/payment-method.js +1 -1
  110. package/dist/radio-group.js +1 -1
  111. package/dist/rich-text-editor.js +1 -1
  112. package/dist/search-bar.js +2 -2
  113. package/dist/secondary-nav.js +1 -1
  114. package/dist/styles/bento-dark.css +4 -0
  115. package/dist/styles/bento-light.css +4 -0
  116. package/dist/styles/bento.css +4 -0
  117. package/dist/styles/legacy.css +4 -0
  118. package/dist/styles/styleguide.css +4 -0
  119. package/dist/summary-grid.js +1 -1
  120. package/dist/tag.js +1 -1
  121. package/dist/textarea.js +1 -1
  122. package/dist/timeline.js +1 -1
  123. package/dist/toggle.js +1 -1
  124. package/dist/web-types.json +1 -1
  125. package/package.json +5 -5
  126. package/dist/chunks/date-picker.OI-sQ232.js +0 -234
  127. package/dist/chunks/date-picker.OI-sQ232.js.map +0 -1
  128. package/dist/chunks/date-range-picker.D7IwIR5V.js +0 -1114
  129. package/dist/chunks/date-range-picker.D7IwIR5V.js.map +0 -1
  130. package/dist/chunks/dropdown-default-textbox.MkU0tMf1.js.map +0 -1
  131. package/dist/chunks/dropdown-tag.DFeoXIgH.js +0 -242
  132. package/dist/chunks/dropdown-tag.DFeoXIgH.js.map +0 -1
  133. package/dist/chunks/dropdown.KStrJVoP.js +0 -825
  134. package/dist/chunks/filter-bar.JXmlFnHV.js.map +0 -1
  135. package/dist/chunks/get-slot-text.DQlZEsId.js +0 -12
  136. package/dist/chunks/get-slot-text.DQlZEsId.js.map +0 -1
  137. package/dist/chunks/input-field.C29FCI4j.js.map +0 -1
  138. package/dist/chunks/pagination.BaBWNlIF.js.map +0 -1
  139. package/dist/chunks/payment-method.CDnn1bjo.js.map +0 -1
  140. package/dist/chunks/secondary-nav.DXsgUTqk.js.map +0 -1
  141. package/dist/chunks/tag.CEmpyuYX.js +0 -50
  142. package/dist/chunks/tag.CEmpyuYX.js.map +0 -1
  143. package/dist/chunks/textarea.C1jkfowf.js +0 -246
  144. package/dist/chunks/textarea.C1jkfowf.js.map +0 -1
  145. package/dist/chunks/timeline-item.DNjubXL2.js.map +0 -1
@@ -1,825 +0,0 @@
1
- import { ref as w, watch as be, computed as d, defineComponent as F, useSlots as Ne, toRefs as Ae, createBlock as k, openBlock as L, resolveDynamicComponent as $e, mergeProps as M, withCtx as K, createElementVNode as oe, withKeys as ot, unref as s, createVNode as X, toHandlers as te, createSlots as ce, renderList as pe, renderSlot as G, normalizeProps as fe, guardReactiveProps as me, createElementBlock as R, createCommentVNode as _, toDisplayString as ge, normalizeClass as ve, withDirectives as ae, vShow as Oe, nextTick as x, useAttrs as lt, toRef as B, inject as nt, createTextVNode as st } from "vue";
2
- import { d as Be, B as it } from "./typography.yBEME_Gu.js";
3
- import { a as de, b as J, c as rt, B as ee, D as dt } from "./dropdown-default-textbox.MkU0tMf1.js";
4
- /* empty css */
5
- import { _ as Z } from "./_plugin-vue_export-helper.CHgC5LLL.js";
6
- import { s as ue } from "./events.CMzGybJJ.js";
7
- import { g as Y } from "./generate-uid.NJ8tVoha.js";
8
- import { u as ut } from "./aria-label.CaUURpnB.js";
9
- import { u as he } from "./index.pdBj0KQU.js";
10
- import { a as m, b as ye, B as De, c as ct, u as pt, d as ft } from "./use-cached-selected-values.8MdrR9wt.js";
11
- import { u as mt } from "./use-form-layout-loading.D3lALhtC.js";
12
- import { B as vt } from "./directive.Cbdox5VL.js";
13
- import { B as A, a as yt } from "./keyboard-navigation.pB8weElW.js";
14
- import { u as bt } from "./use-has-slot.B7eQSabc.js";
15
- import { F as gt, E as ht } from "./field-label.C97CrBI_.js";
16
- import { P as Te } from "./popper-container.Uod3yjsR.js";
17
- import { h as Lt } from "./button-actions.BQ3AFQqt.js";
18
- import "../assets/dropdown.css";
19
- const Le = {
20
- "en-US": {
21
- apply: "Apply",
22
- cancel: "Cancel",
23
- noOptionsMatchThisSearch: "No options match this search"
24
- },
25
- "ja-JP": {
26
- apply: "適用",
27
- cancel: "キャンセル"
28
- },
29
- "pt-BR": {
30
- apply: "Aplicar",
31
- cancel: "Cancelar"
32
- }
33
- }, St = (o, r, i, a) => {
34
- const n = w(o.value), { t: l } = he({ messages: Le });
35
- be(o, () => {
36
- n.value = o.value;
37
- });
38
- const e = d(
39
- () => JSON.stringify(n.value) === JSON.stringify(o.value)
40
- ), u = () => {
41
- a(m.SELECT, n.value), a(m.CLOSE_DROPDOWN);
42
- }, y = () => {
43
- n.value = o.value, a(m.CLOSE_DROPDOWN);
44
- }, b = () => {
45
- i.value && r.value && (n.value = o.value);
46
- }, p = d(() => [
47
- {
48
- title: l("apply"),
49
- event: u,
50
- disabled: e.value
51
- },
52
- {
53
- title: l("cancel"),
54
- event: y
55
- }
56
- ]), g = (h) => {
57
- n.value = h, r.value || a(m.SELECT, h);
58
- }, c = (h) => {
59
- g(h), a(m.TAB);
60
- }, E = (h) => {
61
- g(h), a(m.ENTER);
62
- }, O = (h) => {
63
- g(h), a(m.SPACE);
64
- }, v = () => {
65
- y(), a(m.ESCAPE);
66
- }, D = () => {
67
- a(m.SHOW_MORE);
68
- }, C = {
69
- [m.SELECT]: g,
70
- [m.SHOW_MORE]: D,
71
- [m.TAB]: c,
72
- [m.SPACE]: O,
73
- [m.ENTER]: E
74
- };
75
- return {
76
- // Values
77
- actions: p,
78
- internalSelectedValue: n,
79
- // Methods
80
- listeners: C,
81
- onEscapeKey: v,
82
- onOutsideDropdownClick: b
83
- };
84
- }, wt = F({
85
- i18n: { messages: Le },
86
- name: "bento-dropdown-options-container"
87
- }), Et = /* @__PURE__ */ F({
88
- ...wt,
89
- props: {
90
- /**
91
- * Defines a string value that labels an interactive element.
92
- */
93
- ariaLabel: { type: String, default: null },
94
- /**
95
- * Indicates that dropdown items are loading
96
- */
97
- componentLoading: { type: Boolean, default: !1 },
98
- /**
99
- * Empty state props used with the inner empty state component which is displayed when no search results are found.
100
- */
101
- emptyState: {
102
- type: Object,
103
- default: void 0
104
- },
105
- /**
106
- * Disables dropdown functionality
107
- */
108
- disabled: { type: Boolean, default: !1 },
109
- /**
110
- * Indicates whether there are more items to load
111
- */
112
- hasMoreItems: { type: Boolean, default: !1 },
113
- /**
114
- * Identifies the listbox whose contents are controlled by the the combobox on which the aria-controls attribute is set.
115
- */
116
- id: { type: String, required: !0 },
117
- /**
118
- * Function that allows the options to be disabled
119
- *
120
- * @type {BentoDropdownIsOptionDisabled}
121
- * @param {BentoDropdownOptionItem} option - Dropdown option object
122
- * @param {string} option.label - Option's label text
123
- * @param {string|number} option.value - Option's value
124
- * @param {unknown} option.data - Option's extra data to be passed to the default slot
125
- */
126
- isOptionDisabled: {
127
- type: Function,
128
- default: void 0
129
- },
130
- /**
131
- * The option elements to populate the dropdown with.
132
- * It must be an array of {@see BentoDropdownOptionItem }
133
- * * @property {string} value.label - Text to be displayed in the option
134
- * * @property {string,number} value.value - Value of the option
135
- */
136
- items: {
137
- type: Array,
138
- required: !0
139
- },
140
- /**
141
- * The type of `Lazy Load`.
142
- * Type "automatic" will enable infinite scrolling
143
- * Type "button" will enable lazy loading with "Show more" button
144
- */
145
- lazyLoadType: {
146
- type: String,
147
- default: De.AUTOMATIC,
148
- validator: (o) => Object.values(De).includes(o)
149
- },
150
- /**
151
- * Indicates if new options are lazy loading.
152
- */
153
- loading: { type: Boolean, default: !1 },
154
- /**
155
- * If enabled, the user will be able to select multiple items.
156
- */
157
- multiple: { type: Boolean, default: !1 },
158
- /**
159
- * Indicates if the dropdown is open so that
160
- * the container can be displayed.
161
- */
162
- open: { type: Boolean, required: !0 },
163
- /**
164
- * The `input` value.
165
- * Providing an empty string or empty array will select no options.
166
- * Set to an empty string `''` if you don't want any of the available options to be selected for single select
167
- */
168
- selectedValue: {
169
- type: Array,
170
- default: null
171
- },
172
- /**
173
- * Flag that indicates that an external search it's being made
174
- * to filter out the items inside the the multi-select listbox
175
- *
176
- * If enabled, hides the "Select all" checkbox in "multiple" mode.
177
- */
178
- searching: ye.props.searching,
179
- /**
180
- * If enabled, dropdown will display non-selectable, static categories
181
- */
182
- staticCategories: { type: Boolean, default: !1 },
183
- /**
184
- * Reference to the DOM element or Vue component for positioning
185
- * the Dropdown container.
186
- */
187
- targetElement: { type: Te.props.targetElement.type, required: !0 },
188
- /**
189
- * Enables virtual scrolling if set to true or by providing an object with itemHeight function.
190
- * The itemHeight function is used to calculate the height of rendered item given it's index.
191
- */
192
- virtualScroll: {
193
- type: [Boolean, Object],
194
- default: !1
195
- }
196
- },
197
- setup(o, { expose: r, emit: i }) {
198
- const a = Ne(), n = i, l = o, { selectedValue: e, multiple: u } = Ae(l), y = w(null), { t: b } = he({ messages: Le }), p = d(() => l.open && !l.disabled), g = d(() => b("noOptionsMatchThisSearch")), c = d(() => ({
199
- "b-dropdown-options-container--single": !(l != null && l.multiple)
200
- })), E = d(() => ({
201
- "b-dropdown-options-container__listbox--single": !(l != null && l.multiple)
202
- })), { actions: O, internalSelectedValue: v, listeners: D, onEscapeKey: C, onOutsideDropdownClick: h } = St(e, u, p, n), z = d(() => l != null && l.multiple ? Lt : Te), V = d(() => {
203
- var T;
204
- const N = {
205
- "min-width": `${(T = l == null ? void 0 : l.targetElement) == null ? void 0 : T.clientWidth}px`,
206
- "max-width": "min(500px, 95%)"
207
- };
208
- return l != null && l.multiple ? {
209
- actionsLayout: "space-between",
210
- ariaLabel: l.ariaLabel,
211
- actions: O.value,
212
- divider: !0,
213
- fallbackPosition: ["top-start"],
214
- id: Y(`dropdown-options-${l.id}`),
215
- open: l.open,
216
- position: "bottom-start",
217
- style: {
218
- width: "auto",
219
- ...N
220
- },
221
- targetElement: l.targetElement
222
- } : {
223
- fallbackPosition: ["top-start"],
224
- offset: [0, 8],
225
- position: "bottom-start",
226
- style: {
227
- display: p.value ? "block" : "none",
228
- ...N
229
- },
230
- targetElement: l.targetElement
231
- };
232
- });
233
- return r({
234
- onOutsideDropdownClick: h
235
- }), (N, T) => (L(), k($e(z.value), M({
236
- class: ["b-dropdown-options-container", c.value]
237
- }, V.value), {
238
- default: K(() => [
239
- oe("div", {
240
- onKeydown: T[0] || (T[0] = ot(
241
- //@ts-ignore
242
- (...W) => s(C) && s(C)(...W),
243
- ["esc"]
244
- ))
245
- }, [
246
- X(s(ye), M({
247
- id: o.id,
248
- ref_key: "dropdownOptionsListboxRef",
249
- ref: y,
250
- "aria-label": o.ariaLabel,
251
- class: ["b-dropdown-options-container__listbox", E.value],
252
- "component-loading": o.componentLoading,
253
- "empty-state": o.emptyState,
254
- "is-option-disabled": o.isOptionDisabled,
255
- items: o.items,
256
- "selected-value": s(v),
257
- multiple: s(u),
258
- "static-categories": o.staticCategories,
259
- "no-results-message": g.value,
260
- searching: o.searching,
261
- loading: o.loading,
262
- "lazy-load-type": o.lazyLoadType,
263
- "has-more-items": o.hasMoreItems,
264
- "virtual-scroll": o.virtualScroll
265
- }, te(s(D))), ce({ _: 2 }, [
266
- pe(s(a), (W, f) => ({
267
- name: f,
268
- fn: K((S) => [
269
- G(N.$slots, f, fe(me(S)), void 0, !0)
270
- ])
271
- }))
272
- ]), 1040, ["id", "aria-label", "class", "component-loading", "empty-state", "is-option-disabled", "items", "selected-value", "multiple", "static-categories", "no-results-message", "searching", "loading", "lazy-load-type", "has-more-items", "virtual-scroll"])
273
- ], 32)
274
- ]),
275
- _: 3
276
- }, 16, ["class"]));
277
- }
278
- }), Ct = /* @__PURE__ */ Z(Et, [["__scopeId", "data-v-d87d28cd"]]);
279
- let Ie = 0;
280
- const Ot = {
281
- beforeCreate() {
282
- this.uuid = Ie.toString(), Ie += 1;
283
- }
284
- }, Bt = { key: 0 };
285
- function Dt(o, r, i, a, n, l) {
286
- return L(), R("svg", M({ role: "img" }, o.$attrs, {
287
- class: "ui-assets-icons-16",
288
- xmlns: "http://www.w3.org/2000/svg",
289
- width: "16",
290
- height: "16",
291
- fill: "none"
292
- }), [
293
- o.$attrs["svg-title"] ? (L(), R("title", Bt, ge(o.$attrs["svg-title"]), 1)) : _("", !0),
294
- r[0] || (r[0] = oe("path", {
295
- fill: "#001222",
296
- d: "M5.00011 5.43922L8.00011 8.43922L11.0001 5.43922L12.0608 6.49988L8.00011 10.5605L3.93945 6.49988L5.00011 5.43922Z"
297
- }, null, -1))
298
- ], 16);
299
- }
300
- const Tt = /* @__PURE__ */ Z(Ot, [["render", Dt]]);
301
- let xe = 0;
302
- const It = {
303
- beforeCreate() {
304
- this.uuid = xe.toString(), xe += 1;
305
- }
306
- }, xt = { key: 0 };
307
- function Nt(o, r, i, a, n, l) {
308
- return L(), R("svg", M({ role: "img" }, o.$attrs, {
309
- class: "ui-assets-icons-16",
310
- xmlns: "http://www.w3.org/2000/svg",
311
- width: "16",
312
- height: "16",
313
- fill: "none"
314
- }), [
315
- o.$attrs["svg-title"] ? (L(), R("title", xt, ge(o.$attrs["svg-title"]), 1)) : _("", !0),
316
- r[0] || (r[0] = oe("path", {
317
- fill: "#001222",
318
- d: "M10.9999 10.5608L7.9999 7.56077L4.9999 10.5608L3.93924 9.50011L7.9999 5.43945L12.0606 9.50011L10.9999 10.5608Z"
319
- }, null, -1))
320
- ], 16);
321
- }
322
- const At = /* @__PURE__ */ Z(It, [["render", Nt]]), $t = { class: "b-dropdown-small-textbox__chevron" }, Mt = F({
323
- name: "dropdown-small-textbox",
324
- inheritAttrs: !1
325
- }), Rt = /* @__PURE__ */ F({
326
- ...Mt,
327
- props: {
328
- /**
329
- * The number of additional items that have been selected in the dropdown.
330
- */
331
- additionalItemsSelected: { type: [Number, String], default: 0 },
332
- /**
333
- * Sets the aria-controls attribute on the textbox. This should correspond to the popover's id that the textbox triggers.
334
- */
335
- ariaControls: { type: String, required: !0 },
336
- /**
337
- * 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.
338
- */
339
- ariaExpanded: {
340
- type: [String, Boolean],
341
- required: !0
342
- },
343
- /**
344
- * If no label element is used then the aria-label is be set should be set.
345
- */
346
- ariaLabel: { type: String, default: null },
347
- /**
348
- * Corresponds to the label's id that labels the textbox element.
349
- */
350
- ariaLabelledby: { type: String, default: null },
351
- /**
352
- * Custom debounce time. Default: 300
353
- */
354
- debounceTime: { type: Number, default: 300 },
355
- /**
356
- * Disables any textbox functionality
357
- */
358
- disabled: { type: Boolean, default: !1 },
359
- /**
360
- * Selected option's label
361
- */
362
- displayValue: { type: String, default: null },
363
- /**
364
- * Sets the possibility to type into the textbox
365
- */
366
- dynamicFiltering: { type: Boolean, default: !1 },
367
- /**
368
- * Marks the textbox as invalid, rendering an error state
369
- */
370
- isInvalid: { type: Boolean, default: !1 },
371
- /**
372
- * Indicates if the dropdown is open so that
373
- * the respective event can be emitted
374
- */
375
- open: { type: Boolean, default: !1 },
376
- /**
377
- * Sets the dropdown to readonly state
378
- */
379
- readonly: { type: Boolean, default: !1 },
380
- /**
381
- * The input value
382
- */
383
- value: { type: String, default: "" }
384
- },
385
- emits: ["clear", "close", "input", "keydown", "open"],
386
- setup(o, { expose: r, emit: i }) {
387
- const a = i, n = o, l = w(null), e = d(() => ({
388
- [`b-dropdown-small-textbox--${de.DISABLED}`]: n.disabled,
389
- [`b-dropdown-small-textbox--${de.READONLY}`]: n.readonly,
390
- [`b-dropdown-small-textbox--${de.OPENED}`]: n.open
391
- })), u = d(() => n.open && !n.disabled && !n.readonly), y = (v) => {
392
- a("input", v);
393
- }, b = (v) => {
394
- a("keydown", v);
395
- }, p = (v) => {
396
- ue(v), a("open");
397
- }, g = (v) => {
398
- ue(v), a("close");
399
- }, c = (v) => {
400
- ue(v), a("clear");
401
- }, E = {
402
- [J.INPUT]: y,
403
- [J.OPEN]: p,
404
- [J.CLOSE]: g,
405
- [J.CLEAR]: c,
406
- [J.KEYDOWN]: b
407
- };
408
- return r({
409
- focus: () => {
410
- l.value.focus();
411
- }
412
- }), (v, D) => (L(), R("div", {
413
- class: ve(["b-dropdown-small-textbox", e.value])
414
- }, [
415
- X(rt, M({
416
- ref_key: "baseTextbox",
417
- ref: l
418
- }, { ...v.$attrs, ...v.$props }, {
419
- class: "b-dropdown-small-textbox__textbox",
420
- size: s(ee).SMALL
421
- }, te(E)), {
422
- icon: K(() => [
423
- oe("div", $t, [
424
- ae(X(s(At), { "svg-title": "opened" }, null, 512), [
425
- [Oe, u.value]
426
- ]),
427
- ae(X(s(Tt), { "svg-title": "closed" }, null, 512), [
428
- [Oe, !u.value]
429
- ])
430
- ])
431
- ]),
432
- _: 1
433
- }, 16, ["size"])
434
- ], 2));
435
- }
436
- }), Pt = /* @__PURE__ */ Z(Rt, [["__scopeId", "data-v-890ca00e"]]), kt = (o, r) => r.value.reduce((i, a) => {
437
- if (a.items) {
438
- const n = a.items.filter(
439
- (e) => o.value.find((u) => u.value === e.value)
440
- );
441
- n.length === a.items.length ? i.push(a.displayValue ?? a.label) : n.forEach(({ label: e, displayValue: u }) => i.push(u ?? e));
442
- }
443
- return o.value.find((n) => n.value === a.value) && i.push(a.displayValue ?? a.label), i;
444
- }, []).join(", "), _t = ({ items: o, placeholder: r, selectedValues: i, isMultiSelect: a }) => {
445
- const n = d(
446
- () => a.value && o.value.find((e) => {
447
- var u;
448
- return (u = e.items) == null ? void 0 : u.length;
449
- })
450
- );
451
- return d(() => i.value.length ? n.value ? kt(i, o) : i.value.map(({ label: e, displayValue: u }) => u ?? e).join(", ") : r.value || null);
452
- }, Me = (o) => {
453
- var r;
454
- (r = o.value.$children) == null || r[0].$refs.textbox.focus();
455
- }, Kt = ({
456
- inputContainerRef: o,
457
- optionsContainerRef: r,
458
- selectedValueIndex: i,
459
- isDropdownOpen: a,
460
- isDynamicFltering: n,
461
- items: l,
462
- isMultiple: e
463
- }, u, y, b) => {
464
- const p = async (f) => {
465
- var S;
466
- n.value && await x(), (S = l.value[f]) == null || S.focus();
467
- }, g = async (f) => {
468
- var q, j;
469
- n.value && await x();
470
- const S = (q = r.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : q.$el.querySelectorAll(
471
- "button"
472
- );
473
- S.length ? (j = S[f]) == null || j.focus() : p(f);
474
- }, c = (f) => {
475
- var S;
476
- return (S = r.value.$refs.dropdownOptionsListboxRef.$refs.listboxItemRef) == null ? void 0 : S.setListboxFocusedIndex(
477
- f
478
- );
479
- }, E = () => {
480
- a.value || y(), x(() => {
481
- c(0), p(0);
482
- });
483
- }, O = () => {
484
- a.value || y(), x(() => {
485
- c(l.value.length - 1), p(l.value.length - 1);
486
- });
487
- }, v = ({ detail: f }) => {
488
- f.preventDefault(), E();
489
- }, D = ({ detail: f }) => {
490
- f.preventDefault(), O();
491
- }, C = () => {
492
- E();
493
- }, h = () => {
494
- O();
495
- }, z = ({ detail: f }) => {
496
- f.preventDefault(), u(), a.value && x(() => {
497
- e ? g(0) : (c(i.value), p(i.value));
498
- });
499
- }, V = ({ detail: f }) => {
500
- f.preventDefault(), u(), a.value && x(() => {
501
- e ? g(0) : (c(i.value), p(i.value));
502
- });
503
- }, N = () => {
504
- a.value && b();
505
- }, T = () => {
506
- a.value && (b(), Me(o));
507
- };
508
- return d(() => ({
509
- [A.ARROW_DOWN]: v,
510
- [A.ARROW_UP]: D,
511
- [A.HOME]: C,
512
- [A.END]: h,
513
- ...n.value ? {} : { [A.SPACE]: z },
514
- [A.ENTER]: V,
515
- [A.TAB]: N,
516
- [A.ESCAPE]: T
517
- }));
518
- }, Ft = ({ inputContainerRef: o, isDropdownOpen: r }, i) => {
519
- const a = () => {
520
- r.value && i(), x(() => {
521
- Me(o);
522
- });
523
- };
524
- return {
525
- [m.ENTER]: a,
526
- [m.ESCAPE]: a,
527
- [m.TAB]: a,
528
- [m.SPACE]: a
529
- };
530
- };
531
- function zt(o, r, i, a) {
532
- const n = w(o), l = w(r), e = (y, b = []) => b.flatMap((p) => p.label.toLocaleLowerCase().includes(y) ? a != null && a.value && p.items ? [...e(y, p.items)] : [p, ...e(y, p.items)] : p.items ? [...e(y, p.items)] : []);
533
- return be(n, () => {
534
- i !== void 0 && i(n.value);
535
- }), d(() => {
536
- if (!n.value || i !== void 0)
537
- return l.value;
538
- const y = n.value.toLocaleLowerCase();
539
- return e(y, l.value);
540
- });
541
- }
542
- const Re = {
543
- "en-US": {
544
- all: "All",
545
- ariaLabelFallback: "Dropdown",
546
- clearSearch: "Clear filter"
547
- },
548
- "ja-JP": {
549
- all: "すべて",
550
- clearFilter: "フィルターをクリア"
551
- },
552
- "pt-BR": {
553
- all: "Todos",
554
- clearFilter: "Limpar filtro"
555
- }
556
- }, Vt = Symbol("input field component injection key"), ra = Symbol("input field hint injection key"), da = Symbol("input field parent component injection key"), Wt = F({
557
- i18n: { messages: Re },
558
- name: "b-dropdown",
559
- components: {
560
- DropdownInputDefault: dt,
561
- DropdownInputSmall: Pt
562
- }
563
- }), qt = /* @__PURE__ */ F({
564
- ...Wt,
565
- props: {
566
- ariaLabel: { default: null },
567
- condensed: { type: Boolean, default: !1 },
568
- emptyState: { default: void 0 },
569
- dynamicFiltering: { type: Boolean, default: !1 },
570
- error: { type: Boolean, default: !1 },
571
- hasMoreItems: { type: Boolean, default: !1 },
572
- isOptionDisabled: { type: Function, default: void 0 },
573
- items: { default: () => [] },
574
- loading: { type: Boolean, default: !1 },
575
- componentLoading: { type: Boolean, default: !1 },
576
- lazyLoadType: { default: ye.props.lazyLoadType.default },
577
- multiple: { type: Boolean, default: !1 },
578
- search: { default: void 0 },
579
- showSlotContentInMultiple: { type: Boolean, default: !1 },
580
- size: { default: null },
581
- staticCategories: { type: Boolean, default: !1 },
582
- value: { default: null },
583
- virtualScroll: { type: [Boolean, Object], default: !1 },
584
- enableValueLabelPair: { type: Boolean, default: !1 },
585
- description: { default: null },
586
- disabled: { type: Boolean, default: !1 },
587
- errorMessage: { default: null },
588
- label: { default: null },
589
- optional: { type: Boolean, default: !1 },
590
- placeholder: { default: null },
591
- readonly: { type: Boolean, default: !1 },
592
- required: { type: Boolean, default: !1 },
593
- tooltipText: { default: null }
594
- },
595
- emits: ["input", "show-more", "open"],
596
- setup(o, { expose: r, emit: i }) {
597
- var Ce;
598
- const a = lt(), n = Ne(), l = bt(n), e = o, u = i, { t: y } = he({ messages: Re }), b = w(null), p = w(null), g = w(null), c = w(!1), E = Y("bento-dropdown-options-container"), O = Y("dropdown-label"), v = Y("dropdown-description"), D = Y("dropdown-error"), { isReadOnly: C } = mt(B(e, "readonly")), { cachedSelectedListboxOptions: h, cachedListboxSelectedValues: z, setCachedValues: V } = ct(
599
- B(e, "items"),
600
- B(e, "value"),
601
- B(e, "multiple"),
602
- B(e, "enableValueLabelPair")
603
- ), N = w(a["aria-label"]), T = w(a["aria-describedby"]), { ariaLabel: W, label: f } = Ae(e), S = d(() => y("ariaLabelFallback")), q = ut({
604
- // TODO: take ariaLabel ref away when aria-label prop is removed
605
- ariaLabel: W.value || N,
606
- label: f,
607
- defaultFallback: S
608
- }), j = e.size === ee.SMALL || nt(Vt, !1), Pe = d(() => j ? ee.SMALL : ee.DEFAULT), ke = d(() => ({
609
- "b-dropdown--condensed": e.condensed
610
- })), _e = d(() => ({
611
- "b-dropdown__description--error": !!e.errorMessage
612
- })), $ = w(""), Q = B(e, "items"), Se = B(e, "staticCategories"), le = zt($, Q, (Ce = e == null ? void 0 : e.search) == null ? void 0 : Ce.searchEvent, Se), ne = d(() => e.dynamicFiltering && !!$.value), Ke = _t({
613
- items: Q,
614
- placeholder: B(e, "placeholder"),
615
- isMultiSelect: B(e, "multiple"),
616
- selectedValues: h
617
- }), Fe = d(() => {
618
- if (e != null && e.multiple && Array.isArray(e.value))
619
- return e.items.filter(
620
- ({ value: t }) => (e == null ? void 0 : e.value) && (e == null ? void 0 : e.value).includes(t)
621
- );
622
- if (!e.multiple && e.staticCategories) {
623
- const t = e.items.find(
624
- (P) => P.items.some((U) => U.value === e.value)
625
- );
626
- return t ? t.items.find((P) => P.value === e.value) : null;
627
- }
628
- return e.items.find(({ value: t }) => t === (e == null ? void 0 : e.value));
629
- }), ze = d(() => {
630
- const t = le.value.findIndex(({ value: I }) => e.enableValueLabelPair ? e.value.value === I : e.value === I);
631
- return t > -1 ? t : 0;
632
- }), { isMultiLevelSelect: we, flattenedItemsList: Ve } = pt(Q), We = d(() => we.value && !e.staticCategories), qe = d(() => We.value ? "treeitem" : "option"), je = d(() => {
633
- if (e.multiple) {
634
- const t = Array.isArray(e.value) ? e.value.length : 0, I = we.value ? Ve.value.length : Q.value.length;
635
- return t === 0 ? null : !e.hasMoreItems && I > 0 && I === t ? y("all") : t;
636
- }
637
- return null;
638
- }), Ue = d(
639
- () => [
640
- e.description ? v : null,
641
- T.value,
642
- e.errorMessage ? D : null
643
- ].filter(Boolean).join(" ") || null
644
- ), He = d(() => {
645
- var t;
646
- return (t = g.value) == null ? void 0 : t.$el;
647
- }), { visibleDomOptions: Je, updateVisibleDomOptions: Ee } = ft(
648
- He,
649
- le,
650
- qe
651
- ), Ye = () => {
652
- C.value || (c.value = !0, x(() => {
653
- Ee();
654
- }));
655
- }, se = () => {
656
- c.value = !1;
657
- }, ie = () => {
658
- C.value || (c.value = !c.value, x(() => {
659
- Ee();
660
- }), ne.value && ($.value = ""));
661
- }, Ze = () => {
662
- ne.value && ($.value = ""), c.value && (c.value = !1, g.value.onOutsideDropdownClick());
663
- }, Qe = (t) => {
664
- e.multiple || ($.value = "", c.value = !1), V(t), u("input", z.value);
665
- }, Xe = () => {
666
- u(m.SHOW_MORE);
667
- }, Ge = Kt(
668
- {
669
- inputContainerRef: b,
670
- optionsContainerRef: g,
671
- selectedValueIndex: ze,
672
- isDropdownOpen: c,
673
- isDynamicFltering: B(e, "dynamicFiltering"),
674
- items: Je,
675
- isMultiple: e.multiple
676
- },
677
- ie,
678
- Ye,
679
- se
680
- ), et = Ft(
681
- {
682
- inputContainerRef: b,
683
- isDropdownOpen: c
684
- },
685
- se
686
- ), tt = {
687
- [m.CLOSE_DROPDOWN]: se,
688
- [m.SELECT]: Qe,
689
- [m.SHOW_MORE]: Xe,
690
- ...et
691
- };
692
- e.error && Be(
693
- 'BentoDropdown "error" property',
694
- `Use the BentoDropdown "errorMessage" property instead to indicate that there is a modifier error.
695
- Having the field as "undefined" will hide/remove the error.
696
- <bento-dropdown errorMessage="Error message text" />`,
697
- "2.0.0"
698
- ), e.size && Be('BentoDropdown "size" property', "Do not use. Only 'default' size should be used.", "2.0.0");
699
- const at = () => {
700
- b.value.focus();
701
- };
702
- return be(
703
- () => c.value,
704
- (t) => {
705
- t && u("open");
706
- }
707
- ), r({
708
- focus: at
709
- }), (t, I) => {
710
- var P;
711
- return ae((L(), R("div", {
712
- class: ve(["b-dropdown", ke.value])
713
- }, [
714
- s(f) ? (L(), k(s(gt), {
715
- key: 0,
716
- id: s(O),
717
- condensed: t.condensed,
718
- label: s(f),
719
- "tooltip-text": t.tooltipText,
720
- optional: t.optional,
721
- required: t.required
722
- }, null, 8, ["id", "condensed", "label", "tooltip-text", "optional", "required"])) : _("", !0),
723
- ae((L(), R("div", M({
724
- ref_key: "inputContainerRefWrapper",
725
- ref: p
726
- }, te(s(Ge), !0)), [
727
- (L(), k($e(Pe.value), {
728
- ref_key: "inputContainerRef",
729
- ref: b,
730
- condensed: t.condensed,
731
- value: $.value,
732
- "additional-items-selected": je.value,
733
- "aria-controls": s(E),
734
- ariaExpanded: c.value,
735
- "aria-labelledby": s(f) ? s(O) : null,
736
- "aria-describedby": Ue.value,
737
- "aria-label": s(q),
738
- "aria-readonly": s(C),
739
- readonly: s(C),
740
- required: t.required,
741
- disabled: t.disabled,
742
- "display-value": s(Ke),
743
- "dynamic-filtering": t.dynamicFiltering,
744
- "is-invalid": !!t.errorMessage || t.error,
745
- multiple: t.multiple,
746
- open: c.value,
747
- "selected-value-item": s(j) ? void 0 : Fe.value,
748
- "show-slot-content-in-multiple": t.showSlotContentInMultiple,
749
- onInput: I[0] || (I[0] = (U) => $.value = U),
750
- onOpen: ie,
751
- onClose: ie
752
- }, ce({ _: 2 }, [
753
- pe(s(n), (U, H) => ({
754
- name: H,
755
- fn: K((re) => [
756
- G(t.$slots, H, fe(me(re)), void 0, !0)
757
- ])
758
- }))
759
- ]), 1064, ["condensed", "value", "additional-items-selected", "aria-controls", "ariaExpanded", "aria-labelledby", "aria-describedby", "aria-label", "aria-readonly", "readonly", "required", "disabled", "display-value", "dynamic-filtering", "is-invalid", "multiple", "open", "selected-value-item", "show-slot-content-in-multiple"]))
760
- ], 16)), [
761
- [s(yt)]
762
- ]),
763
- b.value ? (L(), k(s(Ct), M({
764
- key: 1,
765
- id: s(E),
766
- ref_key: "optionsContainerRef",
767
- ref: g,
768
- "aria-label": s(q),
769
- "component-loading": t.componentLoading,
770
- "empty-state": t.emptyState,
771
- "debounce-time": (P = t.search) == null ? void 0 : P.debounceTime,
772
- disabled: t.disabled,
773
- "is-option-disabled": t.isOptionDisabled,
774
- items: s(le),
775
- multiple: t.multiple,
776
- "static-categories": Se.value,
777
- open: c.value,
778
- "selected-value": s(h),
779
- searching: ne.value,
780
- "target-element": p.value,
781
- loading: t.loading,
782
- "has-more-items": t.hasMoreItems,
783
- "lazy-load-type": t.lazyLoadType,
784
- "virtual-scroll": t.virtualScroll
785
- }, te(tt)), ce({ _: 2 }, [
786
- pe(s(n), (U, H) => ({
787
- name: H,
788
- fn: K((re) => [
789
- G(t.$slots, H, fe(me(re)), void 0, !0)
790
- ])
791
- }))
792
- ]), 1040, ["id", "aria-label", "component-loading", "empty-state", "debounce-time", "disabled", "is-option-disabled", "items", "multiple", "static-categories", "open", "selected-value", "searching", "target-element", "loading", "has-more-items", "lazy-load-type", "virtual-scroll"])) : _("", !0),
793
- t.errorMessage ? (L(), k(s(ht), {
794
- key: 2,
795
- id: s(D),
796
- "error-message": t.errorMessage,
797
- class: "b-dropdown__error-message"
798
- }, null, 8, ["id", "error-message"])) : _("", !0),
799
- t.description || s(l)("description") ? (L(), k(s(it), {
800
- key: 3,
801
- id: s(v),
802
- class: ve(["b-dropdown__description", _e.value]),
803
- el: "span"
804
- }, {
805
- default: K(() => [
806
- G(t.$slots, "description", {}, () => [
807
- st(ge(t.description), 1)
808
- ], !0)
809
- ]),
810
- _: 3
811
- }, 8, ["id", "class"])) : _("", !0)
812
- ], 2)), [
813
- [s(vt), Ze]
814
- ]);
815
- };
816
- }
817
- }), ua = /* @__PURE__ */ Z(qt, [["__scopeId", "data-v-3532dd72"]]);
818
- export {
819
- ua as B,
820
- ra as I,
821
- Vt as a,
822
- da as b,
823
- zt as u
824
- };
825
- //# sourceMappingURL=dropdown.KStrJVoP.js.map