@ironsource/shared-ui 2.1.11-test.98 → 2.1.11

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 (46) hide show
  1. package/Chart.vue_vue_type_style_index_0_scoped_026d82c5_lang.css +1 -0
  2. package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +1 -0
  3. package/ChartLoader.vue_vue_type_style_index_0_scoped_ffa4cc66_lang.css +1 -0
  4. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css +1 -0
  5. package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +1 -0
  6. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_73bf9b5b_lang.css +1 -0
  7. package/{IconFlag.vue_vue_type_style_index_0_scoped_be9dc7bb_lang.css → IconFlag.vue_vue_type_style_index_0_scoped_6526c390_lang.css} +1 -1
  8. package/OptionV4.vue_vue_type_style_index_0_scoped_1e8837dc_lang.css +1 -0
  9. package/SortableItem.vue_vue_type_style_index_0_scoped_48542664_lang.css +1 -0
  10. package/Typography.vue_vue_type_style_index_0_scoped_07b259bf_lang.css +1 -0
  11. package/components/chart/Chart.vue.js +4 -4
  12. package/components/chart/Chart.vue2.js +110 -105
  13. package/components/chart/ChartLegend.vue.js +3 -3
  14. package/components/chart/ChartLegend.vue2.js +64 -54
  15. package/components/chart/ChartLoader.vue.js +5 -23
  16. package/components/chart/ChartLoader.vue2.js +15 -0
  17. package/components/chart/mockData.d.ts +8 -0
  18. package/components/dateRange/v4/DateRangeV4.vue.js +3 -3
  19. package/components/dateRange/v4/DateRangeV4.vue2.js +86 -81
  20. package/components/dropdown/common/Dropdown.common.js +65 -65
  21. package/components/dropdown/v4/ConditionalDropdown.vue.js +2 -2
  22. package/components/dropdown/v4/ConditionalDropdown.vue2.js +93 -92
  23. package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
  24. package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +45 -46
  25. package/components/dropdown/v4/OptionV4.vue.js +3 -3
  26. package/components/dropdown/v4/OptionV4.vue2.js +97 -98
  27. package/components/icon/v4/IconFlag.vue.js +3 -3
  28. package/components/icon/v4/IconFlag.vue2.js +1 -1
  29. package/components/sortableList/SortableItem.vue.js +3 -3
  30. package/components/sortableList/SortableItem.vue2.js +14 -14
  31. package/components/typography/v4/Typography.vue.js +3 -3
  32. package/components/typography/v4/Typography.vue2.js +1 -1
  33. package/index.js +1 -1
  34. package/mocks/apps.d.ts +1 -0
  35. package/mocks/randomValue.d.ts +1 -0
  36. package/package.json +3 -3
  37. package/Chart.vue_vue_type_style_index_0_scoped_277fde76_lang.css +0 -1
  38. package/ChartLegend.vue_vue_type_style_index_0_scoped_a1c626cd_lang.css +0 -1
  39. package/ChartLoader.vue_vue_type_style_index_0_scoped_142c444a_lang.css +0 -1
  40. package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_07fe5cf8_lang.css +0 -1
  41. package/DateRangeV4.vue_vue_type_style_index_0_scoped_309e5351_lang.css +0 -1
  42. package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_9fa84b26_lang.css +0 -1
  43. package/OptionV4.vue_vue_type_style_index_0_scoped_2c2947b3_lang.css +0 -1
  44. package/SortableItem.vue_vue_type_style_index_0_scoped_2ca7b24c_lang.css +0 -1
  45. package/Typography.vue_vue_type_style_index_0_scoped_5714d43e_lang.css +0 -1
  46. package/consts/configs.js +0 -4
@@ -3,29 +3,29 @@ import { inject as Ve, ref as r, computed as c, watch as b, useSlots as ke, toRa
3
3
  import { isObjectInArray as ae } from "../../../utils/array.js";
4
4
  import { objectsEqual as Ue } from "../../../utils/object.js";
5
5
  import { useClamp as Be, useVirtualList as He, onClickOutside as ne, useInfiniteScroll as qe } from "@vueuse/core";
6
- import { Mode as T, Type as L, DropdownContext as Xe } from "./DropdownContext.js";
6
+ import { Mode as T, Type as U, DropdownContext as Xe } from "./DropdownContext.js";
7
7
  import { pxToRem as $e } from "../../../utils/style.js";
8
8
  import { useEditableContext as je } from "../../table-cells/common/EditableContext.js";
9
9
  import { useGroupedOptions as ze } from "./useGroupedOptions.js";
10
10
  const tl = (l, v, g) => {
11
- const U = Ve("isTreeDropdown", !1), {
12
- sortOutGroups: B,
11
+ const B = Ve("isTreeDropdown", !1), {
12
+ sortOutGroups: H,
13
13
  flattenAndMarkGroupOptions: ue,
14
- isGroup: H,
14
+ isGroup: q,
15
15
  selectAllWithGroups: ie,
16
16
  isIndeterminateGrouped: re,
17
- allSelectedGrouped: q,
17
+ allSelectedGrouped: X,
18
18
  areAllPreviousSelected: oe
19
19
  } = ze(l), ce = (e, t) => l.multi && Array.isArray(e) ? l.comparingKey ? e?.findIndex(
20
20
  (i) => i[l.comparingKey] === t[l.comparingKey]
21
21
  ) > -1 : ae(e, t) : l.comparingKey ? e?.[l.comparingKey] === t[l.comparingKey] : e === t;
22
- let X;
22
+ let $;
23
23
  ((e) => {
24
24
  e[e.None = 0] = "None", e[e.Next = 1] = "Next", e[e.Previous = -1] = "Previous", e[e.NextPage = 10] = "NextPage", e[e.PrevPage = -10] = "PrevPage";
25
- })(X || (X = {}));
25
+ })($ || ($ = {}));
26
26
  const a = r(
27
27
  l.selected
28
- ), R = je(), n = c({
28
+ ), R = je(), u = c({
29
29
  get() {
30
30
  return R?.value?.value ?? a.value;
31
31
  },
@@ -39,7 +39,7 @@ const tl = (l, v, g) => {
39
39
  a.value = l.selected, d.value = l.selected;
40
40
  }
41
41
  );
42
- const se = ke(), w = r(null), m = r(null), $ = r(null), E = r(null), j = r(null), I = r(null), de = r(), z = r(null), W = r(null), J = r(null), ve = 8, fe = c(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), D = r(!1), y = r([]), x = r(-1), h = r(""), d = r(l.selected || []), Q = () => I.value?.focus(), [O, ge, ye] = _e({
42
+ const se = ke(), w = r(null), m = r(null), j = r(null), E = r(null), z = r(null), I = r(null), de = r(), W = r(null), J = r(null), Q = r(null), ve = 8, fe = c(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), D = r(!1), y = r([]), x = r(-1), h = r(""), d = r(l.selected || []), Y = () => I.value?.focus(), [O, ge, ye] = _e({
43
43
  disabled: l.disabled,
44
44
  initialValue: l.defaultOpen
45
45
  });
@@ -49,7 +49,7 @@ const tl = (l, v, g) => {
49
49
  e !== void 0 && ye(e);
50
50
  }
51
51
  );
52
- const Y = (e) => {
52
+ const Z = (e) => {
53
53
  he.value = ge(e);
54
54
  }, he = c({
55
55
  get() {
@@ -58,19 +58,19 @@ const tl = (l, v, g) => {
58
58
  set(e) {
59
59
  v("update:isOpen", e);
60
60
  }
61
- }), Oe = c(() => o.value.length - 1), f = Be(0, 0, Oe), Z = c(() => n.value ? l.displayValue(n.value) : ""), Se = (e) => {
61
+ }), Oe = c(() => o.value.length - 1), f = Be(0, 0, Oe), F = c(() => u.value ? l.displayValue(u.value) : ""), Se = (e) => {
62
62
  if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
63
63
  return l.placeholder;
64
64
  const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
65
65
  return e.value.length == 1 && l.displayValue ? l.displayValue(e.value[0]) : t;
66
66
  }, me = c(() => {
67
67
  if (!l.multi)
68
- return n.value ? l.displayValue(n.value) : l.placeholder;
68
+ return u.value ? l.displayValue(u.value) : l.placeholder;
69
69
  if (Array.isArray(a.value))
70
70
  return Se(a);
71
71
  }), M = c(() => {
72
72
  if (Array.isArray(a.value))
73
- return l.groupedOptions ? q(o, a) : a.value.length === o.value.length;
73
+ return l.groupedOptions ? X(o, a) : a.value.length === o.value.length;
74
74
  }), Ae = c(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? re(
75
75
  o,
76
76
  a
@@ -87,35 +87,35 @@ const tl = (l, v, g) => {
87
87
  notSelected: []
88
88
  };
89
89
  P(N).value.forEach((i) => {
90
- const u = (l.comparingKey ? d.value.findIndex(
91
- (G) => G[l.comparingKey] === i[l.comparingKey]
90
+ const n = (l.comparingKey ? d.value.findIndex(
91
+ (L) => L[l.comparingKey] === i[l.comparingKey]
92
92
  ) > -1 : d.value.includes(i)) ? "selected" : "notSelected";
93
- e[u].push(i);
93
+ e[n].push(i);
94
94
  });
95
- const t = l.groupedOptions ? B(e.notSelected) : e.notSelected;
95
+ const t = l.groupedOptions ? H(e.notSelected) : e.notSelected;
96
96
  return [].concat(e.selected, t);
97
97
  }), o = c(() => {
98
- const e = Array.isArray(d.value) && l.multi && g.VERSION === 4 && !U ? be.value : N.value;
98
+ const e = Array.isArray(d.value) && l.multi && g.VERSION === 4 && !B ? be.value : N.value;
99
99
  if (l.onSearch) {
100
- const t = e.filter((i) => l.groupedOptions && H(i) ? i : l.onSearch(i, h.value));
101
- return l.groupedOptions ? B(t) : t;
100
+ const t = e.filter((i) => l.groupedOptions && q(i) ? i : l.onSearch(i, h.value));
101
+ return l.groupedOptions ? H(t) : t;
102
102
  } else
103
103
  return e;
104
- }), Pe = c(() => y.value[0]?.hasSubtitle), F = c(() => s.mode === T.Multi), p = c(
104
+ }), Pe = c(() => y.value[0]?.hasSubtitle), p = c(() => s.mode === T.Multi), ee = c(
105
105
  () => Pe.value ? g.MULTILINE_LIST_HEIGHT : g.LIST_HEIGHT
106
106
  ), {
107
- list: ee,
108
- containerProps: V,
107
+ list: V,
108
+ containerProps: k,
109
109
  wrapperProps: Te,
110
110
  scrollTo: C
111
111
  } = He(o, {
112
- itemHeight: p.value,
112
+ itemHeight: ee.value,
113
113
  overscan: l.disableVirtualScroll ? 1 / 0 : 2
114
114
  });
115
115
  b(
116
116
  () => l.isOpen,
117
117
  (e) => {
118
- Y(e);
118
+ Z(e);
119
119
  }
120
120
  ), b([x], async () => {
121
121
  await K();
@@ -132,16 +132,16 @@ const tl = (l, v, g) => {
132
132
  v("onsearch", h.value), C(0);
133
133
  });
134
134
  const A = (e, t = !1) => {
135
- l.disabled || (Y(e), K(() => {
135
+ l.disabled || (Z(e), K(() => {
136
136
  O.value && v("opened"), O.value || v("closed"), w.value && t && w.value.focus();
137
137
  }));
138
138
  };
139
139
  b(O, (e) => {
140
140
  if (e) {
141
- h.value = "", F.value && Array.isArray(n.value) && (d.value = P(n.value).slice());
141
+ h.value = "", p.value && Array.isArray(u.value) && (d.value = P(u.value).slice());
142
142
  return;
143
143
  }
144
- Q();
144
+ Y();
145
145
  });
146
146
  const we = () => {
147
147
  if (M.value) {
@@ -161,17 +161,17 @@ const tl = (l, v, g) => {
161
161
  v("selectAll");
162
162
  }
163
163
  }, Ie = () => {
164
- we(), g.VERSION !== 4 && (n.value = a.value);
164
+ we(), g.VERSION !== 4 && (u.value = a.value);
165
165
  }, xe = (e = !0) => {
166
- a.value = [], e && (n.value = [], d.value = []), v("clear");
167
- }, k = (e, t) => {
166
+ a.value = [], e && (u.value = [], d.value = []), v("clear");
167
+ }, G = (e, t) => {
168
168
  if (e = P(e), g.VERSION === 4 ? e[l.disabledOptionKey] : y.value[t]?.disabled)
169
169
  return;
170
170
  if (x.value = t, !l.multi) {
171
171
  l.keepOpen || A(!1), s.goToOption(
172
172
  0
173
173
  /* None */
174
- ), n.value = e, _(""), Q(), s.type === L.Search && m.value && (m.value.value = l.displayValue(e)), le();
174
+ ), u.value = e, _(""), Y(), s.type === U.Search && m.value && (m.value.value = l.displayValue(e)), le();
175
175
  return;
176
176
  }
177
177
  if (!Array.isArray(a.value))
@@ -179,9 +179,9 @@ const tl = (l, v, g) => {
179
179
  m.value?.focus();
180
180
  const S = P(a.value);
181
181
  if (ae(S, e) || l.comparingKey && S.findIndex(
182
- (u) => u[l.comparingKey] === e[l.comparingKey]
182
+ (n) => n[l.comparingKey] === e[l.comparingKey]
183
183
  ) > -1) {
184
- a.value = S.filter((u) => l.comparingKey ? u[l.comparingKey] !== e[l.comparingKey] : !Ue(u, e));
184
+ a.value = S.filter((n) => l.comparingKey ? n[l.comparingKey] !== e[l.comparingKey] : !Ue(n, e));
185
185
  return;
186
186
  } else {
187
187
  a.value = [...S, e];
@@ -190,24 +190,24 @@ const tl = (l, v, g) => {
190
190
  }, De = (e) => y.value[e]?.disabled, s = {
191
191
  activeIndex: f,
192
192
  options: y,
193
- selectedOption: n,
194
- labelRef: j,
193
+ selectedOption: u,
194
+ labelRef: z,
195
195
  activeOption: E,
196
196
  listRef: w,
197
197
  clearable: l.clearable,
198
- type: se.input ? L.Search : L.Dropdown,
198
+ type: se.input ? U.Search : U.Dropdown,
199
199
  mode: l.multi ? T.Multi : T.Single,
200
200
  query: h,
201
- selectedValue: Z,
201
+ selectedValue: F,
202
202
  toggle: A,
203
203
  disabled: l.disabled,
204
204
  open: O,
205
205
  mandatory: l.mandatory,
206
206
  size: l.size,
207
207
  placeholder: l.placeholder,
208
- select: k,
208
+ select: G,
209
209
  clearSelection: () => {
210
- _(""), n.value = s.mode === T.Single ? null : [], d.value = s.mode === T.Single ? null : [], m.value && (m.value.value = "");
210
+ _(""), u.value = s.mode === T.Single ? null : [], d.value = s.mode === T.Single ? null : [], m.value && (m.value.value = "");
211
211
  },
212
212
  search: _,
213
213
  goToOption: async (e) => {
@@ -215,7 +215,7 @@ const tl = (l, v, g) => {
215
215
  return;
216
216
  let t = f.value + e;
217
217
  const i = y.value.filter(
218
- (u) => u.disabled
218
+ (n) => n.disabled
219
219
  ).length, S = o.value.length - i;
220
220
  for (t > S && (t = S + 1); ; ) {
221
221
  if (!y.value[t]?.disabled) {
@@ -246,11 +246,11 @@ const tl = (l, v, g) => {
246
246
  {
247
247
  ignore: [
248
248
  I,
249
- z,
250
249
  W,
251
250
  J,
251
+ Q,
252
252
  m,
253
- V.ref
253
+ k.ref
254
254
  ]
255
255
  }
256
256
  );
@@ -259,16 +259,16 @@ const tl = (l, v, g) => {
259
259
  };
260
260
  Le(async () => {
261
261
  l.autoFocus && (await K(), setTimeout(() => {
262
- $.value.focus();
263
- })), s.goToOption(0), l.multi && !U && (l.groupedOptions ? D.value = q(
262
+ j.value.focus();
263
+ })), s.goToOption(0), l.multi && !B && (l.groupedOptions ? D.value = X(
264
264
  o,
265
265
  a
266
266
  ) : D.value = l.options.length === l.selected.length);
267
267
  });
268
268
  const le = () => {
269
- l.multi && (D.value = M.value, n.value = a.value, Array.isArray(n.value) && (d.value = P(n.value).slice())), v("apply", n.value), v("allSelectedChanged", M.value), A(!1), Me();
269
+ l.multi && (D.value = M.value, u.value = a.value, Array.isArray(u.value) && (d.value = P(u.value).slice())), v("apply", u.value), v("allSelectedChanged", M.value), A(!1), Me();
270
270
  }, te = () => {
271
- F.value && Array.isArray(d.value) && (n.value = P(d.value).slice()), h.value = "", A(!1);
271
+ p.value && Array.isArray(d.value) && (u.value = P(d.value).slice()), h.value = "", A(!1);
272
272
  }, Ne = (e) => {
273
273
  if (!l.disableKeyboardEvents)
274
274
  switch (e.key) {
@@ -318,24 +318,24 @@ const tl = (l, v, g) => {
318
318
  A(!0);
319
319
  return;
320
320
  }
321
- k(o.value[f.value], f.value), s.mode === T.Single && !l.keepOpen && A(!1), e.preventDefault();
321
+ G(o.value[f.value], f.value), s.mode === T.Single && !l.keepOpen && A(!1), e.preventDefault();
322
322
  break;
323
323
  }
324
324
  }
325
325
  }, Ke = c(() => {
326
326
  if (l.loading)
327
327
  return 8.5;
328
- const e = l.loadMoreLoading && g.MAX_NUMBER_OF_OPTIONS || l.customNumberOfDisplayedOptions || ee.value.reduce((G, Re) => {
328
+ const e = l.loadMoreLoading && g.MAX_NUMBER_OF_OPTIONS || l.customNumberOfDisplayedOptions || V.value.reduce((L, Re) => {
329
329
  const Ee = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Re.data) : 1;
330
- return G + Ee;
330
+ return L + Ee;
331
331
  }, 0), t = l.multi && l.showSelectAll && !h.value ? 1 : 0, i = e > g.MAX_NUMBER_OF_OPTIONS, S = e + t;
332
- let u = i ? g.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
333
- return l.loadMoreLoading && l.multi && (u = u - 0.9), l.noResultsText && u === 0 && (u = u + 1), l.withConditions && h.value && (u = u + 1), $e(
334
- u * p.value + g.PADDING_PX
332
+ let n = i ? g.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
333
+ return l.loadMoreLoading && l.multi && (V.value.length ? n = n + 0.1 : n = n - 0.9), l.noResultsText && n === 0 && (n = n + 1), l.withConditions && h.value && (n = n + 1), $e(
334
+ n * ee.value + g.PADDING_PX
335
335
  );
336
336
  });
337
337
  return qe(
338
- V.ref,
338
+ k.ref,
339
339
  () => {
340
340
  !l.loadMoreLoading && l.infiniteLoading && v("loadMore");
341
341
  },
@@ -349,9 +349,9 @@ const tl = (l, v, g) => {
349
349
  toggleMenu: A,
350
350
  onButtonKeydown: Ne,
351
351
  displayedValue: me,
352
- labelRef: j,
352
+ labelRef: z,
353
353
  query: h,
354
- containerProps: V,
354
+ containerProps: k,
355
355
  calculateTableHeight: Ke,
356
356
  wrapperProps: Te,
357
357
  filteredOptions: o,
@@ -359,12 +359,12 @@ const tl = (l, v, g) => {
359
359
  allSelectedApplied: D,
360
360
  isIndeterminate: Ae,
361
361
  onSelectAll: Ie,
362
- virtualOptions: ee,
362
+ virtualOptions: V,
363
363
  isSelected: ce,
364
- selectedOption: n,
364
+ selectedOption: u,
365
365
  selectedOptionPrevious: d,
366
- selectedValue: Z,
367
- onSelect: k,
366
+ selectedValue: F,
367
+ onSelect: G,
368
368
  activeIndex: f,
369
369
  onCancel: te,
370
370
  onApply: le,
@@ -372,13 +372,13 @@ const tl = (l, v, g) => {
372
372
  onClickOutside: ne,
373
373
  listRef: w,
374
374
  buttonRef: I,
375
- apply: z,
376
- cancel: W,
377
- el: $,
375
+ apply: W,
376
+ cancel: J,
377
+ el: j,
378
378
  triggerRef: de,
379
- clearAll: J,
379
+ clearAll: Q,
380
380
  onClearAllSelections: xe,
381
- isGroup: H
381
+ isGroup: q
382
382
  };
383
383
  };
384
384
  export {
@@ -1,7 +1,7 @@
1
1
  import o from "./ConditionalDropdown.vue2.js";
2
2
  /* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_07fe5cf8_lang.css"; //*');
4
- const n = /* @__PURE__ */ e(o, [["__scopeId", "data-v-07fe5cf8"]]);
3
+ // import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css"; //*');
4
+ const n = /* @__PURE__ */ e(o, [["__scopeId", "data-v-8e026669"]]);
5
5
  export {
6
6
  n as default
7
7
  };
@@ -1,21 +1,21 @@
1
- import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_07fe5cf8_lang.css"; import { defineComponent as j, computed as O, ref as s, watch as k, onMounted as W, openBlock as L, createBlock as q, unref as d, withCtx as f, createVNode as y, mergeProps as G, createElementVNode as H, isRef as J, normalizeProps as X, guardReactiveProps as Y, createElementBlock as Z, createTextVNode as _, toDisplayString as ee, createCommentVNode as le } from "vue";
2
- import N from "./DropdownV4.vue.js";
1
+ import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css"; import { defineComponent as W, computed as O, ref as s, watch as K, onMounted as q, openBlock as D, createBlock as G, unref as d, withCtx as f, createVNode as g, mergeProps as H, createElementVNode as J, isRef as X, normalizeProps as Y, guardReactiveProps as Z, createElementBlock as _, createTextVNode as ee, toDisplayString as le, createCommentVNode as oe } from "vue";
2
+ import L from "./DropdownV4.vue.js";
3
3
  import "./DefaultDropdownTrigger.vue.js";
4
4
  import "./IconButtonDropdownTrigger.vue.js";
5
- import oe from "./ChipDropdownTrigger.vue.js";
5
+ import ae from "./ChipDropdownTrigger.vue.js";
6
6
  import "./AppDropdownTrigger.vue.js";
7
- import ae from "./ButtonDropdownTrigger.vue.js";
7
+ import te from "./ButtonDropdownTrigger.vue.js";
8
8
  import "./ButtonFilterDropdownTrigger.vue.js";
9
9
  import "./TreeDropdown.vue.js";
10
10
  import "./OptionV4.vue.js";
11
11
  import "./ConditionalDropdown.vue.js";
12
- import te from "../../search/v4/SearchV4.vue.js";
13
- import ne from "../../typography/v4/Typography.vue.js";
14
- import { useDebounceFn as ie } from "@vueuse/core";
15
- const ue = { class: "conditional-container" }, re = {
12
+ import ne from "../../search/v4/SearchV4.vue.js";
13
+ import ie from "../../typography/v4/Typography.vue.js";
14
+ import { useDebounceFn as ue } from "@vueuse/core";
15
+ const re = { class: "conditional-container" }, se = {
16
16
  key: 0,
17
17
  class: "custom-list-area"
18
- }, we = /* @__PURE__ */ j({
18
+ }, we = /* @__PURE__ */ W({
19
19
  __name: "ConditionalDropdown",
20
20
  props: {
21
21
  selectedCondition: null,
@@ -41,38 +41,39 @@ const ue = { class: "conditional-container" }, re = {
41
41
  loadingOverride: { type: Boolean, default: !1 }
42
42
  },
43
43
  emits: ["update:selectedCondition", "update:appliedSelections", "clear", "closed"],
44
- setup(u, { emit: h }) {
45
- const e = u, S = O({
44
+ setup(r, { emit: h }) {
45
+ const e = r, S = O({
46
46
  get: () => e.appliedSelections,
47
47
  set: (l) => {
48
48
  h("update:appliedSelections", l);
49
49
  }
50
- }), n = O({
50
+ }), i = O({
51
51
  get: () => e.selectedCondition || e.conditionalOptions[0],
52
52
  set: (l) => {
53
53
  h("update:selectedCondition", l);
54
54
  }
55
- }), w = s(null), c = s(!0), a = s([]), r = s(
56
- Array.isArray(e.appliedSelections) ? e.appliedSelections : e.appliedSelections ? [e.appliedSelections] : []
57
- ), K = s(!0), p = s(!1), C = s(!1), i = s(e.searchQuery), F = s(""), m = s(e.label), T = s([]), B = O(() => (!i.value || i.value?.length < e.minCharsToStart) && !a.value.length ? `Enter at least ${e.minCharsToStart} keywords to begin` : "No results found"), U = O(() => {
55
+ }), F = () => {
56
+ const { appliedSelections: l } = e;
57
+ return l ? Array.isArray(l) ? l : [l] : [];
58
+ }, w = s(null), c = s(!0), a = s([]), n = s(F()), T = s(!0), p = s(!1), C = s(!1), u = s(e.searchQuery), B = s(""), m = s(e.label), k = s([]), U = O(() => (!u.value || u.value?.length < e.minCharsToStart) && !a.value.length ? `Enter at least ${e.minCharsToStart} characters to begin` : "No results found"), I = O(() => {
58
59
  const l = c.value ? 4 : 4.5, t = a.value.length > 4 ? a.value.length : l;
59
60
  if (e.groupedOptions) {
60
61
  let o = 0;
61
- return a.value.forEach((g) => {
62
- g.options && (o = o + g.options.length);
62
+ return a.value.forEach((y) => {
63
+ y.options && (o = o + y.options.length);
63
64
  }), o > 4 ? o : l;
64
65
  }
65
66
  return t > l ? t : l;
66
- }), I = (l, t) => {
67
- if (e.infiniteLoading && n.value.multi && Array.isArray(r.value) && r.value.length && l && t.length) {
68
- const o = [], g = r.value.filter(
67
+ }), M = (l, t) => {
68
+ if (e.infiniteLoading && i.value.multi && Array.isArray(n.value) && n.value.length && l && t.length) {
69
+ const o = [], y = n.value.filter(
69
70
  (v) => v[e.optionNameKey].includes(l)
70
71
  );
71
72
  return t.forEach((v) => {
72
- g.find(
73
- ($) => $[e.comparingKey] === v[e.comparingKey]
73
+ y.find(
74
+ (j) => j[e.comparingKey] === v[e.comparingKey]
74
75
  ) && o.push(v[e.comparingKey]);
75
- }), g.filter(
76
+ }), y.filter(
76
77
  (v) => !o.includes(v[e.comparingKey])
77
78
  );
78
79
  }
@@ -80,7 +81,7 @@ const ue = { class: "conditional-container" }, re = {
80
81
  }, A = async (l) => {
81
82
  try {
82
83
  p.value = !0;
83
- const t = await e.fetchFnCallback(l), o = I(
84
+ const t = await e.fetchFnCallback(l), o = M(
84
85
  l,
85
86
  t
86
87
  );
@@ -88,7 +89,7 @@ const ue = { class: "conditional-container" }, re = {
88
89
  } catch (t) {
89
90
  p.value = !1, console.error("Error fetching data:", t);
90
91
  }
91
- }, M = async () => {
92
+ }, E = async () => {
92
93
  if (e.infiniteLoading)
93
94
  try {
94
95
  C.value = !0;
@@ -97,144 +98,144 @@ const ue = { class: "conditional-container" }, re = {
97
98
  } catch (l) {
98
99
  C.value = !1, console.error("Error fetching data:", l);
99
100
  }
100
- }, E = ie(
101
+ }, V = ue(
101
102
  A,
102
103
  e.fetchDataDebounceTime
103
104
  ), b = (l) => {
104
- l.length >= e.minCharsToStart ? (E(l), w.value?.scrollTo(0)) : e.infiniteLoading && n.value.multi ? a.value = T.value || [] : a.value = [];
105
- }, V = () => {
106
- i.value && a.value.length && !p.value && !n.value.multi ? a.value[0].conditionalOptions ? a.value[0] = {
107
- name: i.value,
105
+ l.length >= e.minCharsToStart ? (V(l), w.value?.scrollTo(0)) : e.infiniteLoading && i.value.multi ? a.value = k.value || [] : a.value = [];
106
+ }, x = () => {
107
+ u.value && a.value.length && !p.value && !i.value.multi ? a.value[0].conditionalOptions ? a.value[0] = {
108
+ [e.optionNameKey]: u.value,
108
109
  conditionalOptions: !0,
109
- conditionalName: n.value.label,
110
- [e.comparingKey]: i.value
110
+ conditionalName: i.value.label,
111
+ [e.comparingKey]: u.value
111
112
  } : a.value = [
112
113
  {
113
- name: i.value,
114
+ [e.optionNameKey]: u.value,
114
115
  conditionalOptions: !0,
115
- conditionalName: n.value.label,
116
- [e.comparingKey]: i.value
116
+ conditionalName: i.value.label,
117
+ [e.comparingKey]: u.value
117
118
  },
118
119
  ...a.value
119
120
  ] : a.value.length && a.value[0].conditionalOptions && a.value.shift();
120
- }, D = () => {
121
- c.value && r.value.length === 0 ? m.value = e.label : m.value = `${e.label} ${n.value.label.toLowerCase()}`;
121
+ }, N = () => {
122
+ c.value && n.value.length === 0 ? m.value = e.label : m.value = `${e.label} ${i.value.label.toLowerCase()}`;
122
123
  };
123
- k(i, () => {
124
- b(i.value);
125
- }), k([n, a], () => {
126
- V();
127
- }), k(
124
+ K(u, () => {
125
+ b(u.value);
126
+ }), K([i, a], () => {
127
+ x();
128
+ }), K(
128
129
  () => e.loadingOverride,
129
130
  (l, t) => {
130
131
  !l && t && !e.infiniteLoading && A(e.searchQuery);
131
132
  }
132
133
  );
133
- const x = () => {
134
- c.value && r.value.length === 0 ? (n.value = null, S.value = [], n.value = null) : (F.value = i.value, S.value = c.value ? [...r.value] : { ...r.value }, K.value = c.value), D();
134
+ const P = () => {
135
+ c.value && n.value.length === 0 ? (i.value = null, S.value = [], i.value = null) : (B.value = u.value, S.value = c.value ? [...n.value] : { ...n.value }, T.value = c.value), N();
135
136
  };
136
- k(n, (l, t) => {
137
- n.value.multi ? (p.value = !0, !t.multi && l.multi && Array.isArray(e.appliedSelections) && (r.value = e.appliedSelections), setTimeout(() => {
137
+ K(i, (l, t) => {
138
+ i.value.multi ? (p.value = !0, !t.multi && l.multi && (Array.isArray(e.appliedSelections) ? n.value = e.appliedSelections : n.value = [e.appliedSelections]), setTimeout(() => {
138
139
  p.value = !1, c.value = !0;
139
140
  }, 100)) : setTimeout(() => {
140
141
  c.value = !1;
141
142
  }, 100);
142
143
  });
143
144
  const Q = (l) => {
144
- T.value = l;
145
- }, P = () => {
146
- r.value = [], S.value = [], n.value = null, m.value = e.label, i.value = "", h("clear");
147
- }, R = (l) => {
148
- l && n.value.multi && e.infiniteLoading && r.value && (a.value = r.value, i.value && b(i.value));
145
+ k.value = l;
146
+ }, R = () => {
147
+ n.value = [], S.value = [], i.value = null, m.value = e.label, u.value = "", h("clear");
148
+ }, z = (l) => {
149
+ l && i.value.multi && e.infiniteLoading && n.value && (a.value = n.value, u.value && b(u.value));
149
150
  };
150
- W(() => {
151
- (e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && b(e.searchQuery), D();
151
+ q(() => {
152
+ (e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && b(e.searchQuery), e.appliedSelections && Array.isArray(e.appliedSelections) && (a.value = e.appliedSelections, n.value = e.appliedSelections, k.value = e.appliedSelections), N();
152
153
  });
153
- const z = () => {
154
+ const $ = () => {
154
155
  h("closed");
155
156
  };
156
- return (l, t) => (L(), q(d(N), {
157
+ return (l, t) => (D(), G(d(L), {
157
158
  ref_key: "dropdownRef",
158
159
  ref: w,
159
- selected: r.value,
160
- "onUpdate:selected": t[2] || (t[2] = (o) => r.value = o),
160
+ selected: n.value,
161
+ "onUpdate:selected": t[2] || (t[2] = (o) => n.value = o),
161
162
  "predefined-trigger": "chip",
162
- "display-value": (o) => o?.[u.optionNameKey],
163
+ "display-value": (o) => o?.[r.optionNameKey],
163
164
  multi: c.value,
164
165
  options: a.value,
165
166
  placeholder: m.value,
166
167
  "search-placeholder": "Search",
167
- "option-name-key": u.optionNameKey,
168
+ "option-name-key": r.optionNameKey,
168
169
  "with-conditions": "",
169
170
  "inline-search": "",
170
- "custom-number-of-displayed-options": d(U),
171
+ "custom-number-of-displayed-options": d(I),
171
172
  "options-list-width": "330px",
172
- loading: p.value || u.loadingOverride,
173
+ loading: p.value || r.loadingOverride,
173
174
  "load-more-loading": C.value,
174
- "comparing-key": u.comparingKey,
175
- "is-open": u.isOpen,
176
- "infinite-loading": u.infiniteLoading,
177
- "show-select-all": !u.infiniteLoading && !i.value,
178
- "grouped-options": u.groupedOptions,
179
- "option-flag-key": u.optionFlagKey,
180
- "option-image-key": u.optionImageKey,
181
- "option-icon-key": u.optionIconKey,
182
- "option-icon-type": u.optionIconType,
183
- "onUpdate:isOpen": R,
175
+ "comparing-key": r.comparingKey,
176
+ "is-open": r.isOpen,
177
+ "infinite-loading": r.infiniteLoading,
178
+ "show-select-all": !r.infiniteLoading && !u.value,
179
+ "grouped-options": r.groupedOptions,
180
+ "option-flag-key": r.optionFlagKey,
181
+ "option-image-key": r.optionImageKey,
182
+ "option-icon-key": r.optionIconKey,
183
+ "option-icon-type": r.optionIconType,
184
+ "onUpdate:isOpen": z,
184
185
  onOnsearch: b,
185
- onApply: x,
186
- onLoadMore: M,
186
+ onApply: P,
187
+ onLoadMore: E,
187
188
  onUnsavedSelectionUpdate: Q,
188
- onClosed: z
189
+ onClosed: $
189
190
  }, {
190
191
  "dropdown-trigger": f(({ defaultTriggerProps: o }) => [
191
- y(d(oe), G(o, {
192
+ g(d(ae), H(o, {
192
193
  label: m.value,
193
194
  "selected-option": d(S),
194
- multi: K.value,
195
+ multi: T.value,
195
196
  "cancel-all-selected-display": "",
196
- "display-value-in-quotes": !Array.isArray(r.value) && r.value.conditionalOptions,
197
- onClear: P
197
+ "display-value-in-quotes": !Array.isArray(n.value) && n.value.conditionalOptions,
198
+ onClear: R
198
199
  }), null, 16, ["label", "selected-option", "multi", "display-value-in-quotes"])
199
200
  ]),
200
201
  "dropdown-conditions": f(() => [
201
- H("div", ue, [
202
- y(d(N), {
203
- selected: d(n),
204
- "onUpdate:selected": t[0] || (t[0] = (o) => J(n) ? n.value = o : null),
205
- options: u.conditionalOptions,
202
+ J("div", re, [
203
+ g(d(L), {
204
+ selected: d(i),
205
+ "onUpdate:selected": t[0] || (t[0] = (o) => X(i) ? i.value = o : null),
206
+ options: r.conditionalOptions,
206
207
  "option-name-key": "label",
207
208
  "display-value": (o) => o?.label,
208
209
  container: ".conditional-container",
209
210
  size: "small"
210
211
  }, {
211
212
  "dropdown-trigger": f(({ buttonTriggerProps: o }) => [
212
- y(d(ae), X(Y(o)), null, 16)
213
+ g(d(te), Y(Z(o)), null, 16)
213
214
  ]),
214
215
  _: 1
215
216
  }, 8, ["selected", "options", "display-value"])
216
217
  ])
217
218
  ]),
218
219
  "inline-search": f(() => [
219
- y(d(te), {
220
- modelValue: i.value,
221
- "onUpdate:modelValue": t[1] || (t[1] = (o) => i.value = o),
220
+ g(d(ne), {
221
+ modelValue: u.value,
222
+ "onUpdate:modelValue": t[1] || (t[1] = (o) => u.value = o),
222
223
  class: "inline-search",
223
224
  placeholder: "Search",
224
225
  variant: "transparent",
225
226
  size: "md",
226
- "auto-focus": u.autoFocusSearch
227
+ "auto-focus": r.autoFocusSearch
227
228
  }, null, 8, ["modelValue", "auto-focus"])
228
229
  ]),
229
230
  "custom-list-area": f(() => [
230
- !a.value.length && !p.value ? (L(), Z("div", re, [
231
- y(ne, { variant: "body1" }, {
231
+ !a.value.length && !p.value ? (D(), _("div", se, [
232
+ g(ie, { variant: "body1" }, {
232
233
  default: f(() => [
233
- _(ee(d(B)), 1)
234
+ ee(le(d(U)), 1)
234
235
  ]),
235
236
  _: 1
236
237
  })
237
- ])) : le("", !0)
238
+ ])) : oe("", !0)
238
239
  ]),
239
240
  _: 1
240
241
  }, 8, ["selected", "display-value", "multi", "options", "placeholder", "option-name-key", "custom-number-of-displayed-options", "loading", "load-more-loading", "comparing-key", "is-open", "infinite-loading", "show-select-all", "grouped-options", "option-flag-key", "option-image-key", "option-icon-key", "option-icon-type"]));