@ironsource/shared-ui 2.1.11-rc.1 → 2.1.11-test.2

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.
@@ -0,0 +1 @@
1
+ .child-options[data-v-c361375a]{padding-left:1rem}
@@ -1,5 +1,5 @@
1
- import { useToggle as Ve } from "../../../composables/useToggle.js";
2
- import { inject as ke, ref as i, computed as r, watch as A, useSlots as _e, toRaw as P, nextTick as C, provide as Ge, onMounted as He } from "vue";
1
+ import { useToggle as ke } from "../../../composables/useToggle.js";
2
+ import { inject as Ve, ref as i, computed as r, watch as b, useSlots as _e, toRaw as P, nextTick as N, provide as Ge, onMounted as He } from "vue";
3
3
  import { isObjectInArray as ee } from "../../../utils/array.js";
4
4
  import { objectsEqual as Be } from "../../../utils/object.js";
5
5
  import { useClamp as Le, useVirtualList as Ue, onClickOutside as le } from "@vueuse/core";
@@ -7,17 +7,17 @@ import { Mode as T, Type as _, DropdownContext as qe } from "./DropdownContext.j
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 Xe } from "./useGroupedOptions.js";
10
- const ll = (l, b, h) => {
11
- const te = ke("isTreeDropdown", !1), {
10
+ const ll = (l, S, A) => {
11
+ const te = Ve("isTreeDropdown", !1), {
12
12
  sortOutGroups: G,
13
13
  flattenAndMarkGroupOptions: ae,
14
14
  isGroup: H,
15
- selectAllWithGroups: ue,
16
- isIndeterminateGrouped: ne,
15
+ selectAllWithGroups: ne,
16
+ isIndeterminateGrouped: ue,
17
17
  allSelectedGrouped: ie,
18
18
  areAllPreviousSelected: re
19
19
  } = Xe(l), oe = (e, t) => l.multi ? l.comparingKey ? e.findIndex(
20
- (n) => n[l.comparingKey] === t[l.comparingKey]
20
+ (u) => u[l.comparingKey] === t[l.comparingKey]
21
21
  ) > -1 : ee(e, t) : l.comparingKey ? e[l.comparingKey] === t[l.comparingKey] : P(e) === t;
22
22
  let B;
23
23
  ((e) => {
@@ -25,25 +25,25 @@ const ll = (l, b, h) => {
25
25
  })(B || (B = {}));
26
26
  const a = i(
27
27
  l.selected
28
- ), R = je(), u = r({
28
+ ), R = je(), n = r({
29
29
  get() {
30
30
  return R?.value?.value ?? a.value;
31
31
  },
32
32
  set(e) {
33
- R.onChange?.(e), R.onClose?.(), b("update:selected", e);
33
+ R.onChange?.(e), R.onClose?.(), S("update:selected", e);
34
34
  }
35
35
  });
36
- A(
36
+ b(
37
37
  () => l.selected,
38
38
  () => {
39
39
  a.value = l.selected, s.value = l.selected;
40
40
  }
41
41
  );
42
- const ce = _e(), w = i(null), O = i(null), L = i(null), E = i(null), U = i(null), I = i(null), se = i(), q = i(null), $ = i(null), j = i(null), de = 8, ve = r(() => I.value ? I.value.getBoundingClientRect().height + de + l.distance : 0), X = i(!1), f = i([]), x = i(-1), S = i(""), s = i(l.selected || []), z = () => I.value?.focus(), [g, fe, ge] = Ve({
42
+ const ce = _e(), w = i(null), h = i(null), L = i(null), E = i(null), U = i(null), I = i(null), se = i(), q = i(null), $ = i(null), j = i(null), ve = 8, de = r(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), X = i(!1), f = i([]), x = i(-1), O = i(""), s = i(l.selected || []), z = () => I.value?.focus(), [g, fe, ge] = ke({
43
43
  disabled: l.disabled,
44
44
  initialValue: l.defaultOpen
45
45
  });
46
- A(
46
+ b(
47
47
  () => l.disabled,
48
48
  (e) => {
49
49
  e !== void 0 && ge(e);
@@ -56,27 +56,27 @@ const ll = (l, b, h) => {
56
56
  return l.isOpen;
57
57
  },
58
58
  set(e) {
59
- b("update:isOpen", e);
59
+ S("update:isOpen", e);
60
60
  }
61
- }), he = r(() => o.value.length - 1), v = Le(0, 0, he), J = r(() => u.value ? l.displayValue(u.value) : ""), Oe = (e) => {
61
+ }), he = r(() => o.value.length - 1), d = Le(0, 0, he), J = r(() => n.value ? l.displayValue(n.value) : ""), Oe = (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
- }, Se = r(() => {
66
+ }, me = r(() => {
67
67
  if (!l.multi)
68
- return u.value ? l.displayValue(u.value) : l.placeholder;
68
+ return n.value ? l.displayValue(n.value) : l.placeholder;
69
69
  if (Array.isArray(a.value))
70
70
  return Oe(a);
71
71
  }), K = r(() => {
72
72
  if (Array.isArray(a.value))
73
73
  return l.groupedOptions ? ie(o, a) : a.value.length === o.value.length;
74
- }), me = r(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? ne(
74
+ }), Se = r(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? ue(
75
75
  o,
76
76
  a
77
77
  ) : a.value.length > 0 && a.value.length < o.value.length), M = (e) => {
78
- S.value = e;
79
- }, D = r(() => l.groupedOptions ? ae(l.options) : l.options), be = r(() => {
78
+ O.value = e;
79
+ }, D = r(() => l.groupedOptions ? ae(l.options) : l.options), Ae = r(() => {
80
80
  if (re(
81
81
  D,
82
82
  s
@@ -86,59 +86,59 @@ const ll = (l, b, h) => {
86
86
  selected: [],
87
87
  notSelected: []
88
88
  };
89
- P(D).value.forEach((n) => {
90
- const d = (l.comparingKey ? s.value.findIndex(
91
- (k) => k[l.comparingKey] === n[l.comparingKey]
92
- ) > -1 : s.value.includes(n)) ? "selected" : "notSelected";
93
- e[d].push(n);
89
+ P(D).value.forEach((u) => {
90
+ const v = (l.comparingKey ? s.value.findIndex(
91
+ (V) => V[l.comparingKey] === u[l.comparingKey]
92
+ ) > -1 : s.value.includes(u)) ? "selected" : "notSelected";
93
+ e[v].push(u);
94
94
  });
95
95
  const t = l.groupedOptions ? G(e.notSelected) : e.notSelected;
96
96
  return [].concat(e.selected, t);
97
97
  }), o = r(() => {
98
- const e = Array.isArray(s.value) && l.multi && h.VERSION === 4 && !te ? be.value : D.value;
98
+ const e = Array.isArray(s.value) && l.multi && A.VERSION === 4 && !te ? Ae.value : D.value;
99
99
  if (l.onSearch) {
100
- const t = e.filter((n) => l.groupedOptions && H(n) ? n : l.onSearch(n, S.value));
100
+ const t = e.filter((u) => l.groupedOptions && H(u) ? u : l.onSearch(u, O.value));
101
101
  return l.groupedOptions ? G(t) : t;
102
102
  } else
103
103
  return e;
104
- }), Ae = r(() => f.value[0]?.hasSubtitle), Q = r(() => c.mode === T.Multi), Y = r(
105
- () => Ae.value ? h.MULTILINE_LIST_HEIGHT : h.LIST_HEIGHT
104
+ }), be = r(() => f.value[0]?.hasSubtitle), Q = r(() => c.mode === T.Multi), Y = r(
105
+ () => be.value ? A.MULTILINE_LIST_HEIGHT : A.LIST_HEIGHT
106
106
  ), {
107
107
  list: Z,
108
108
  containerProps: F,
109
109
  wrapperProps: Pe,
110
- scrollTo: N
110
+ scrollTo: C
111
111
  } = Ue(o, {
112
112
  itemHeight: Y.value,
113
113
  overscan: l.disableVirtualScroll ? 1 / 0 : 2
114
114
  });
115
- A(
115
+ b(
116
116
  () => l.isOpen,
117
117
  (e) => {
118
118
  W(e);
119
119
  }
120
- ), A([x], async () => {
121
- await C();
122
- }), A(
123
- [g, v, x],
120
+ ), b([x], async () => {
121
+ await N();
122
+ }), b(
123
+ [g, d, x],
124
124
  async ([e], [t]) => {
125
- g.value && (await C(), x.value !== -1 && e !== t && setTimeout(() => {
126
- l.multi && h.VERSION === 4 || N(x.value);
127
- }), v.value && setTimeout(() => {
128
- N(v.value);
125
+ g.value && (await N(), x.value !== -1 && e !== t && setTimeout(() => {
126
+ l.multi && A.VERSION === 4 || C(x.value);
127
+ }), d.value && setTimeout(() => {
128
+ C(d.value);
129
129
  }));
130
130
  }
131
- ), A(S, () => {
132
- b("onsearch", S.value), N(0);
131
+ ), b(O, () => {
132
+ S("onsearch", O.value), C(0);
133
133
  });
134
134
  const m = (e, t = !1) => {
135
- l.disabled || (W(e), C(() => {
136
- g.value && b("opened"), g.value || b("closed"), w.value && t && w.value.focus();
135
+ l.disabled || (W(e), N(() => {
136
+ g.value && S("opened"), g.value || S("closed"), w.value && t && w.value.focus();
137
137
  }));
138
138
  };
139
- A(g, (e) => {
139
+ b(g, (e) => {
140
140
  if (e) {
141
- S.value = "", Q.value && Array.isArray(u.value) && (s.value = P(u.value).slice());
141
+ O.value = "", Q.value && Array.isArray(n.value) && (s.value = P(n.value).slice());
142
142
  return;
143
143
  }
144
144
  z();
@@ -150,7 +150,7 @@ const ll = (l, b, h) => {
150
150
  }
151
151
  if (Array.isArray(a.value)) {
152
152
  if (l.groupedOptions)
153
- ue(o, a);
153
+ ne(o, a);
154
154
  else {
155
155
  if (a.value.length === o.value.length) {
156
156
  a.value = [];
@@ -158,31 +158,31 @@ const ll = (l, b, h) => {
158
158
  }
159
159
  a.value = o.value;
160
160
  }
161
- b("selectAll");
161
+ S("selectAll");
162
162
  }
163
163
  }, we = () => {
164
- Te(), h.VERSION !== 4 && (u.value = a.value);
164
+ Te(), A.VERSION !== 4 && (n.value = a.value);
165
165
  }, Ie = (e = !0) => {
166
- a.value = [], e && (u.value = [], s.value = []), b("clear");
167
- }, V = (e, t) => {
168
- if (e = P(e), h.VERSION === 4 ? e[l.disabledOptionKey] : f.value[t]?.disabled)
166
+ a.value = [], e && (n.value = [], s.value = []), S("clear");
167
+ }, k = (e, t) => {
168
+ if (e = P(e), f.value[t]?.disabled)
169
169
  return;
170
170
  if (x.value = t, c.mode !== T.Multi) {
171
171
  l.keepOpen || m(!1), c.goToOption(
172
172
  0
173
173
  /* None */
174
- ), u.value = e, M(""), z(), c.type === _.Search && O.value && (O.value.value = l.displayValue(e));
174
+ ), n.value = e, M(""), z(), c.type === _.Search && h.value && (h.value.value = l.displayValue(e));
175
175
  return;
176
176
  }
177
177
  if (!Array.isArray(a.value))
178
178
  return;
179
- O.value?.focus();
179
+ h.value?.focus();
180
180
  const y = P(a.value);
181
181
  if (ee(y, e) || l.comparingKey && y.findIndex(
182
- (d) => d[l.comparingKey] === e[l.comparingKey]
182
+ (v) => v[l.comparingKey] === e[l.comparingKey]
183
183
  ) > -1) {
184
184
  a.value = y.filter(
185
- (d) => !Be(d, e)
185
+ (v) => !Be(v, e)
186
186
  );
187
187
  return;
188
188
  } else {
@@ -190,16 +190,16 @@ const ll = (l, b, h) => {
190
190
  return;
191
191
  }
192
192
  }, xe = (e) => f.value[e]?.disabled, c = {
193
- activeIndex: v,
193
+ activeIndex: d,
194
194
  options: f,
195
- selectedOption: u,
195
+ selectedOption: n,
196
196
  labelRef: U,
197
197
  activeOption: E,
198
198
  listRef: w,
199
199
  clearable: l.clearable,
200
200
  type: ce.input ? _.Search : _.Dropdown,
201
201
  mode: l.multi ? T.Multi : T.Single,
202
- query: S,
202
+ query: O,
203
203
  selectedValue: J,
204
204
  toggle: m,
205
205
  disabled: l.disabled,
@@ -207,34 +207,34 @@ const ll = (l, b, h) => {
207
207
  mandatory: l.mandatory,
208
208
  size: l.size,
209
209
  placeholder: l.placeholder,
210
- select: V,
210
+ select: k,
211
211
  clearSelection: () => {
212
- M(""), u.value = c.mode === T.Single ? null : [], s.value = c.mode === T.Single ? null : [], O.value && (O.value.value = "");
212
+ M(""), n.value = c.mode === T.Single ? null : [], s.value = c.mode === T.Single ? null : [], h.value && (h.value.value = "");
213
213
  },
214
214
  search: M,
215
215
  goToOption: async (e) => {
216
216
  if (!g.value)
217
217
  return;
218
- let t = v.value + e;
219
- const n = f.value.filter(
220
- (d) => d.disabled
221
- ).length, y = o.value.length - n;
218
+ let t = d.value + e;
219
+ const u = f.value.filter(
220
+ (v) => v.disabled
221
+ ).length, y = o.value.length - u;
222
222
  for (t > y && (t = y + 1); ; ) {
223
223
  if (!f.value[t]?.disabled) {
224
- E.value = o.value[t], v.value = t;
224
+ E.value = o.value[t], d.value = t;
225
225
  return;
226
226
  }
227
- if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!xe(v.value)) {
228
- E.value = o.value[t], v.value = t;
227
+ if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!xe(d.value)) {
228
+ E.value = o.value[t], d.value = t;
229
229
  return;
230
230
  }
231
231
  }
232
232
  },
233
233
  registerInput: (e) => {
234
- O.value = e.value;
234
+ h.value = e.value;
235
235
  },
236
- registerOption: (e, t, n) => {
237
- f.value = [...f.value, { id: e, disabled: t, hasSubtitle: n }];
236
+ registerOption: (e, t, u) => {
237
+ f.value = [...f.value, { id: e, disabled: t, hasSubtitle: u }];
238
238
  },
239
239
  unRegisterOption(e) {
240
240
  f.value = f.value.filter((t) => t.id !== e);
@@ -251,24 +251,24 @@ const ll = (l, b, h) => {
251
251
  q,
252
252
  $,
253
253
  j,
254
- O,
254
+ h,
255
255
  F.ref
256
256
  ]
257
257
  }
258
258
  );
259
259
  const De = () => {
260
- O.value && (O.value.value = c.query.value = "");
260
+ h.value && (h.value.value = c.query.value = "");
261
261
  };
262
262
  He(async () => {
263
- l.autoFocus && (await C(), setTimeout(() => {
263
+ l.autoFocus && (await N(), setTimeout(() => {
264
264
  L.value.focus();
265
265
  })), c.goToOption(0);
266
266
  });
267
- const Ne = () => {
268
- X.value = K.value, u.value = a.value, Array.isArray(u.value) && (s.value = P(u.value).slice()), b("apply", u.value), m(!1), De();
267
+ const Ce = () => {
268
+ X.value = K.value, n.value = a.value, Array.isArray(n.value) && (s.value = P(n.value).slice()), S("apply", n.value), m(!1), De();
269
269
  }, p = () => {
270
- Q.value && Array.isArray(s.value) && (u.value = P(s.value).slice()), S.value = "", m(!1);
271
- }, Ce = (e) => {
270
+ Q.value && Array.isArray(s.value) && (n.value = P(s.value).slice()), O.value = "", m(!1);
271
+ }, Ne = (e) => {
272
272
  if (!l.disableKeyboardEvents)
273
273
  switch (e.key) {
274
274
  case "Space":
@@ -317,49 +317,49 @@ const ll = (l, b, h) => {
317
317
  m(!0);
318
318
  return;
319
319
  }
320
- V(o.value[v.value], v.value), c.mode === T.Single && !l.keepOpen && m(!1), e.preventDefault();
320
+ k(o.value[d.value], d.value), c.mode === T.Single && !l.keepOpen && m(!1), e.preventDefault();
321
321
  break;
322
322
  }
323
323
  }
324
324
  }, Ee = r(() => {
325
325
  if (l.loading)
326
326
  return 8.5;
327
- const e = l.customNumberOfDisplayedOptions || Z.value.reduce((k, Ke) => {
327
+ const e = l.customNumberOfDisplayedOptions || Z.value.reduce((V, Ke) => {
328
328
  const Me = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Ke.data) : 1;
329
- return k + Me;
330
- }, 0), t = l.multi && l.showSelectAll && !S.value ? 1 : 0, n = e > h.MAX_NUMBER_OF_OPTIONS, y = e + t;
331
- let d = n ? h.MAX_NUMBER_OF_OPTIONS + 0.1 : y;
332
- return l.noResultsText && d === 0 && (d = d + 1), $e(
333
- d * Y.value + h.PADDING_PX
329
+ return V + Me;
330
+ }, 0), t = l.multi && l.showSelectAll && !O.value ? 1 : 0, u = e > A.MAX_NUMBER_OF_OPTIONS, y = e + t;
331
+ let v = u ? A.MAX_NUMBER_OF_OPTIONS + 0.1 : y;
332
+ return l.noResultsText && v === 0 && (v = v + 1), $e(
333
+ v * Y.value + A.PADDING_PX
334
334
  );
335
335
  });
336
336
  return {
337
337
  onKeydown: Re,
338
- location: ve,
338
+ location: de,
339
339
  open: g,
340
340
  toggleMenu: m,
341
- onButtonKeydown: Ce,
342
- displayedValue: Se,
341
+ onButtonKeydown: Ne,
342
+ displayedValue: me,
343
343
  labelRef: U,
344
- query: S,
344
+ query: O,
345
345
  containerProps: F,
346
346
  calculateTableHeight: Ee,
347
347
  wrapperProps: Pe,
348
348
  filteredOptions: o,
349
349
  allSelected: K,
350
350
  allSelectedApplied: X,
351
- isIndeterminate: me,
351
+ isIndeterminate: Se,
352
352
  onSelectAll: we,
353
353
  virtualOptions: Z,
354
354
  isSelected: oe,
355
- selectedOption: u,
355
+ selectedOption: n,
356
356
  selectedOptionPrevious: s,
357
357
  selectedValue: J,
358
- onSelect: V,
359
- activeIndex: v,
358
+ onSelect: k,
359
+ activeIndex: d,
360
360
  onCancel: p,
361
- onApply: Ne,
362
- scrollTo: N,
361
+ onApply: Ce,
362
+ scrollTo: C,
363
363
  onClickOutside: le,
364
364
  listRef: w,
365
365
  buttonRef: I,
@@ -1,7 +1,7 @@
1
1
  import o from "./TreeDropdown.vue2.js";
2
2
  /* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css"; //*');
4
- const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-6ac5f602"]]);
3
+ // import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_c361375a_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-c361375a"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,19 +1,19 @@
1
- import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css"; import { defineComponent as F, provide as R, ref as c, onMounted as G, watch as m, computed as H, openBlock as v, createBlock as U, unref as d, withCtx as g, createVNode as k, normalizeProps as J, guardReactiveProps as Q, createSlots as W, renderSlot as X, withModifiers as N, createElementBlock as q, withDirectives as Y, createElementVNode as Z, Fragment as _, renderList as ee, vShow as ne, createCommentVNode as oe } from "vue";
1
+ import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_c361375a_lang.css"; import { defineComponent as R, provide as G, ref as c, onMounted as H, watch as v, computed as J, openBlock as m, createElementBlock as I, Fragment as N, createVNode as g, unref as a, withCtx as K, normalizeProps as Q, guardReactiveProps as W, createSlots as X, renderSlot as Y, withModifiers as q, withDirectives as Z, createElementVNode as x, renderList as _, createBlock as ee, vShow as ne, createCommentVNode as oe, toDisplayString as le } from "vue";
2
2
  import te from "./DropdownV4.vue.js";
3
- import le from "./DefaultDropdownTrigger.vue.js";
3
+ import ie from "./DefaultDropdownTrigger.vue.js";
4
4
  import "./IconButtonDropdownTrigger.vue.js";
5
5
  import "./ChipDropdownTrigger.vue.js";
6
6
  import "./AppDropdownTrigger.vue.js";
7
7
  import "./ButtonDropdownTrigger.vue.js";
8
8
  import "./ButtonFilterDropdownTrigger.vue.js";
9
9
  import "./TreeDropdown.vue.js";
10
- import x from "./OptionV4.vue.js";
11
- import { useChildOptions as ie } from "../composables/useChildOptions.js";
10
+ import z from "./OptionV4.vue.js";
11
+ import { useChildOptions as ae } from "../composables/useChildOptions.js";
12
12
  import de from "../../search/v4/SearchV4.vue.js";
13
- const ae = {
13
+ const se = {
14
14
  key: 0,
15
15
  class: "child-options"
16
- }, Ce = /* @__PURE__ */ F({
16
+ }, re = { style: { position: "absolute", top: "0", right: "0" } }, Ie = /* @__PURE__ */ R({
17
17
  __name: "TreeDropdown",
18
18
  props: {
19
19
  options: null,
@@ -38,191 +38,194 @@ const ae = {
38
38
  preExpandedOptions: null
39
39
  },
40
40
  emits: ["update:selected", "update:isOpen"],
41
- setup(t, { emit: I }) {
42
- const o = t;
43
- R("isTreeDropdown", !0);
44
- const h = c([]), f = c([]), O = c({}), w = c(!1), i = c([...o.selected]), u = c(""), b = () => {
41
+ setup(l, { emit: O }) {
42
+ const o = l;
43
+ G("isTreeDropdown", !0);
44
+ const h = c([]), f = c([]), w = c({}), b = c(!1), i = c([...o.selected]), u = c(""), E = () => {
45
45
  o.options.forEach((n) => {
46
- n[o.optionChildrenKey] && n[o.optionChildrenKey].length && (O.value[n[o.optionUniqueIdKey]] = [
46
+ n[o.optionChildrenKey] && n[o.optionChildrenKey].length && (w.value[n[o.optionUniqueIdKey]] = [
47
47
  ...n[o.optionChildrenKey]
48
48
  ]);
49
49
  }), h.value = [...o.options], f.value = [...o.options];
50
- }, { hasChildren: p, getChildren: y, allChildrenSelected: K, someChildrenSelected: z } = ie(i, o.optionChildrenKey), E = (n) => {
50
+ }, { hasChildren: p, getChildren: y, allChildrenSelected: C, someChildrenSelected: D } = ae(i, o.optionChildrenKey), S = (n) => {
51
51
  if (p(n)) {
52
- K(n) ? i.value = i.value.filter(
53
- (l) => !y(n).includes(l)
52
+ C(n) ? i.value = i.value.filter(
53
+ (t) => !y(n).includes(t)
54
54
  ) : i.value = [
55
- ...i.value.filter((l) => !y(n).includes(l)),
55
+ ...i.value.filter((t) => !y(n).includes(t)),
56
56
  ...y(n)
57
57
  ];
58
58
  return;
59
59
  }
60
60
  i.value.includes(n) ? i.value = i.value.filter(
61
- (l) => l !== n
61
+ (t) => t !== n
62
62
  ) : i.value = [...i.value, n];
63
- }, S = (n) => i.value.includes(n), V = (n) => 1 + (p(n) ? y(n).length : 0), D = () => {
64
- I("update:selected", i.value);
65
- }, B = () => {
66
- i.value = [];
63
+ }, T = (n) => i.value.includes(n), V = (n) => 1 + (p(n) ? y(n).length : 0), B = () => {
64
+ O("update:selected", i.value);
67
65
  }, L = () => {
66
+ i.value = [];
67
+ }, M = () => {
68
68
  const n = /* @__PURE__ */ new Set([]);
69
69
  f.value.forEach((e) => {
70
70
  if (o.selected?.includes(e))
71
71
  n.add(e);
72
72
  else if (e[o.optionChildrenKey] && e[o.optionChildrenKey].length) {
73
- for (const s of e[o.optionChildrenKey])
74
- if (o.selected?.includes(s)) {
73
+ for (const r of e[o.optionChildrenKey])
74
+ if (o.selected?.includes(r)) {
75
75
  n.add(e);
76
76
  break;
77
77
  }
78
78
  }
79
79
  });
80
- const l = Array.from(n);
80
+ const t = Array.from(n);
81
81
  return f.value.forEach((e) => {
82
- !o.selected.includes(e) && !n.has(e) && l.push(e);
83
- }), l;
82
+ !o.selected.includes(e) && !n.has(e) && t.push(e);
83
+ }), t;
84
84
  };
85
- G(() => {
86
- w.value || (b(), w.value = !0, o.preExpandedOptions && o.preExpandedOptions.forEach((n) => {
87
- a.value[n] = 1;
85
+ H(() => {
86
+ b.value || (E(), b.value = !0, o.preExpandedOptions && o.preExpandedOptions.forEach((n) => {
87
+ d.value[n] = 1;
88
88
  }));
89
- }), m(
89
+ }), v(
90
90
  () => o.options,
91
91
  () => {
92
- b();
92
+ E();
93
93
  }
94
- ), m(
94
+ ), v(
95
95
  () => o.selected,
96
96
  () => {
97
97
  i.value = [...o.selected];
98
98
  }
99
- ), m(
99
+ ), v(
100
100
  () => o.isOpen,
101
101
  () => {
102
- o.isOpen ? h.value = L() : (i.value = [...o.selected], u.value = "");
102
+ o.isOpen ? h.value = M() : (i.value = [...o.selected], u.value = "");
103
103
  }
104
104
  );
105
- const a = c({}), M = (n) => {
106
- a.value[n[o.optionUniqueIdKey]] ? delete a.value[n[o.optionUniqueIdKey]] : a.value[n[o.optionUniqueIdKey]] = 1;
105
+ const d = c({}), P = (n) => {
106
+ console.log("toggleTreeCollapse", n), d.value[n[o.optionUniqueIdKey]] ? delete d.value[n[o.optionUniqueIdKey]] : d.value[n[o.optionUniqueIdKey]] = 1;
107
107
  };
108
- function P(n, l) {
109
- const e = n.toLowerCase(), s = [];
110
- return l.value.forEach((r) => {
111
- const C = r[o.optionNameKey].toLowerCase().includes(e), T = O.value[r[o.optionUniqueIdKey]]?.filter(
112
- (j) => j[o.optionNameKey].toLowerCase().includes(e)
108
+ function $(n, t) {
109
+ const e = n.toLowerCase(), r = [];
110
+ return t.value.forEach((s) => {
111
+ const k = s[o.optionNameKey].toLowerCase().includes(e), U = w.value[s[o.optionUniqueIdKey]]?.filter(
112
+ (F) => F[o.optionNameKey].toLowerCase().includes(e)
113
113
  ) || [];
114
- (C || T.length > 0) && (r[o.optionChildrenKey] = T, s.push(r));
115
- }), s;
114
+ (k || U.length > 0) && (s[o.optionChildrenKey] = U, r.push(s));
115
+ }), r;
116
116
  }
117
117
  const A = (n) => {
118
- const l = P(n, f);
119
- n && (Object.keys(a.value).forEach((e) => {
120
- delete a.value[e];
121
- }), l.forEach((e) => {
122
- Array.isArray(e[o.optionChildrenKey]) && e[o.optionChildrenKey].length && (a.value[e[o.optionUniqueIdKey]] = 1);
123
- })), h.value = l;
124
- }, $ = H(() => {
125
- const n = o.options.length, l = o.options.reduce(
126
- (e, s) => (a.value[s[o.optionUniqueIdKey]] && (e = e + s[o.optionChildrenKey].length), e),
118
+ const t = $(n, f);
119
+ n && (Object.keys(d.value).forEach((e) => {
120
+ delete d.value[e];
121
+ }), t.forEach((e) => {
122
+ Array.isArray(e[o.optionChildrenKey]) && e[o.optionChildrenKey].length && (d.value[e[o.optionUniqueIdKey]] = 1);
123
+ })), h.value = t;
124
+ }, j = J(() => {
125
+ const n = o.options.length, t = o.options.reduce(
126
+ (e, r) => (d.value[r[o.optionUniqueIdKey]] && (e = e + r[o.optionChildrenKey].length), e),
127
127
  0
128
128
  );
129
- return n + l;
129
+ return n + t;
130
130
  });
131
- return m(
131
+ return v(
132
132
  () => u.value,
133
133
  () => {
134
134
  A(u.value);
135
135
  }
136
- ), (n, l) => (v(), U(d(te), {
137
- multi: "",
138
- class: "tree-dropdown",
139
- "show-select-all": !1,
140
- "is-open": t.isOpen,
141
- options: h.value,
142
- selected: t.selected,
143
- "display-value": t.displayValue,
144
- placeholder: t.placeholder,
145
- "inline-search": "",
146
- "inline-search-placeholder": t.inlineSearchPlaceholder,
147
- "option-name-key": t.optionNameKey,
148
- size: t.size,
149
- "test-id": t.testId,
150
- disabled: t.disabled,
151
- "disable-virtual-scroll": "",
152
- "override-option-count-calculation": V,
153
- "trigger-show-all-selected-text": !1,
154
- "predefined-trigger": "default",
155
- "custom-number-of-displayed-options": d($),
156
- "onUpdate:isOpen": l[1] || (l[1] = (e) => I("update:isOpen", e)),
157
- onApply: D,
158
- onClear: B
159
- }, {
160
- "dropdown-trigger": g(({ defaultTriggerProps: e }) => [
161
- k(d(le), J(Q(e)), W({ _: 2 }, [
162
- n.$slots["trigger-end-icon"] ? {
163
- name: "end-icon",
164
- fn: g(() => [
165
- X(n.$slots, "trigger-end-icon", {}, void 0, !0)
166
- ]),
167
- key: "0"
168
- } : void 0
169
- ]), 1040)
170
- ]),
171
- "inline-search": g(() => [
172
- k(d(de), {
173
- modelValue: u.value,
174
- "onUpdate:modelValue": l[0] || (l[0] = (e) => u.value = e),
175
- placeholder: t.inlineSearchPlaceholder,
176
- variant: "transparent",
177
- size: "md",
178
- "auto-focus": "",
179
- "test-id": t.testId
180
- }, null, 8, ["modelValue", "placeholder", "test-id"])
181
- ]),
182
- default: g(({ option: e, index: s }) => [
183
- k(d(x), {
184
- option: e,
185
- "selected-prop": d(p)(e) ? d(K)(e) : S(e),
186
- "is-indeterminate": !d(K)(e) && d(z)(e),
187
- disabled: e[t.disabledOptionKey],
188
- "name-key": t.optionNameKey,
189
- "image-key": t.optionImageKey,
190
- "icon-key": t.optionIconKey,
191
- "icon-type": t.optionIconType,
192
- "end-icon-key": t.optionEndIconKey,
193
- "end-icon-type": t.optionEndIconType,
194
- "tree-main-option": d(p)(e),
195
- "tree-main-option-expanded": a.value[e[t.optionUniqueIdKey]],
196
- "stop-option-click-event-propagation": "",
197
- onClick: N(() => E(e), ["stop"]),
198
- onToggleTreeCollapse: M
199
- }, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-main-option", "tree-main-option-expanded", "onClick"]),
200
- d(p)(e) ? (v(), q("div", ae, [
201
- Y(Z("div", null, [
202
- (v(!0), q(_, null, ee(d(y)(e), (r, C) => (v(), U(d(x), {
203
- key: `${s}-${C}`,
204
- option: r,
205
- "selected-prop": S(r),
206
- disabled: r[t.disabledOptionKey],
207
- "name-key": t.optionNameKey,
208
- "image-key": t.optionImageKey,
209
- "icon-key": t.optionIconKey,
210
- "icon-type": t.optionIconType,
211
- "end-icon-key": t.optionEndIconKey,
212
- "end-icon-type": t.optionEndIconType,
213
- "tree-child-shown": a.value[e[t.optionUniqueIdKey]],
214
- "stop-option-click-event-propagation": "",
215
- onClick: N(() => E(r), ["stop"])
216
- }, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-child-shown", "onClick"]))), 128))
217
- ], 512), [
218
- [ne, a.value[e[t.optionUniqueIdKey]]]
219
- ])
220
- ])) : oe("", !0)
221
- ]),
222
- _: 3
223
- }, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled", "custom-number-of-displayed-options"]));
136
+ ), (n, t) => (m(), I(N, null, [
137
+ g(a(te), {
138
+ multi: "",
139
+ class: "tree-dropdown",
140
+ "show-select-all": !1,
141
+ "is-open": l.isOpen,
142
+ options: h.value,
143
+ selected: l.selected,
144
+ "display-value": l.displayValue,
145
+ placeholder: l.placeholder,
146
+ "inline-search": "",
147
+ "inline-search-placeholder": l.inlineSearchPlaceholder,
148
+ "option-name-key": l.optionNameKey,
149
+ size: l.size,
150
+ "test-id": l.testId,
151
+ disabled: l.disabled,
152
+ "disable-virtual-scroll": "",
153
+ "override-option-count-calculation": V,
154
+ "trigger-show-all-selected-text": !1,
155
+ "predefined-trigger": "default",
156
+ "custom-number-of-displayed-options": a(j),
157
+ "onUpdate:isOpen": t[1] || (t[1] = (e) => O("update:isOpen", e)),
158
+ onApply: B,
159
+ onClear: L
160
+ }, {
161
+ "dropdown-trigger": K(({ defaultTriggerProps: e }) => [
162
+ g(a(ie), Q(W(e)), X({ _: 2 }, [
163
+ n.$slots["trigger-end-icon"] ? {
164
+ name: "end-icon",
165
+ fn: K(() => [
166
+ Y(n.$slots, "trigger-end-icon", {}, void 0, !0)
167
+ ]),
168
+ key: "0"
169
+ } : void 0
170
+ ]), 1040)
171
+ ]),
172
+ "inline-search": K(() => [
173
+ g(a(de), {
174
+ modelValue: u.value,
175
+ "onUpdate:modelValue": t[0] || (t[0] = (e) => u.value = e),
176
+ placeholder: l.inlineSearchPlaceholder,
177
+ variant: "transparent",
178
+ size: "md",
179
+ "auto-focus": "",
180
+ "test-id": l.testId
181
+ }, null, 8, ["modelValue", "placeholder", "test-id"])
182
+ ]),
183
+ default: K(({ option: e, index: r }) => [
184
+ g(a(z), {
185
+ option: e,
186
+ "selected-prop": a(p)(e) ? a(C)(e) : T(e),
187
+ "is-indeterminate": !a(C)(e) && a(D)(e),
188
+ disabled: e[l.disabledOptionKey],
189
+ "name-key": l.optionNameKey,
190
+ "image-key": l.optionImageKey,
191
+ "icon-key": l.optionIconKey,
192
+ "icon-type": l.optionIconType,
193
+ "end-icon-key": l.optionEndIconKey,
194
+ "end-icon-type": l.optionEndIconType,
195
+ "tree-main-option": a(p)(e),
196
+ "tree-main-option-expanded": d.value[e[l.optionUniqueIdKey]],
197
+ "stop-option-click-event-propagation": "",
198
+ onClick: q(() => S(e), ["stop"]),
199
+ onToggleTreeCollapse: (s) => P(e)
200
+ }, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-main-option", "tree-main-option-expanded", "onClick", "onToggleTreeCollapse"]),
201
+ a(p)(e) ? (m(), I("div", se, [
202
+ Z(x("div", null, [
203
+ (m(!0), I(N, null, _(a(y)(e), (s, k) => (m(), ee(a(z), {
204
+ key: `${r}-${k}`,
205
+ option: s,
206
+ "selected-prop": T(s),
207
+ disabled: s[l.disabledOptionKey],
208
+ "name-key": l.optionNameKey,
209
+ "image-key": l.optionImageKey,
210
+ "icon-key": l.optionIconKey,
211
+ "icon-type": l.optionIconType,
212
+ "end-icon-key": l.optionEndIconKey,
213
+ "end-icon-type": l.optionEndIconType,
214
+ "tree-child-shown": d.value[e[l.optionUniqueIdKey]],
215
+ "stop-option-click-event-propagation": "",
216
+ onClick: q(() => S(s), ["stop"])
217
+ }, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "tree-child-shown", "onClick"]))), 128))
218
+ ], 512), [
219
+ [ne, d.value[e[l.optionUniqueIdKey]]]
220
+ ])
221
+ ])) : oe("", !0)
222
+ ]),
223
+ _: 3
224
+ }, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled", "custom-number-of-displayed-options"]),
225
+ x("pre", re, le(d.value), 1)
226
+ ], 64));
224
227
  }
225
228
  });
226
229
  export {
227
- Ce as default
230
+ Ie as default
228
231
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import './AppTrigger.vue_vue_type_style_index_0_scoped_121aac8b_lang.css';
1
+ import './AutocompleteDropdown.vue_vue_type_style_index_0_scoped_214ddaf4_lang.css';
2
2
  import { AppTriggerTypes as ro } from "./components/appTrigger/index.js";
3
3
  import { AutocompleteDropdownTypes as mo } from "./components/autocompleteDropdown/index.js";
4
4
  import { MenuItemTypes as po } from "./components/menuItem/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.1.11-rc.1",
3
+ "version": "2.1.11-test.2",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -1 +0,0 @@
1
- .child-options[data-v-6ac5f602]{padding-left:1rem}