@ironsource/shared-ui 2.1.11-test.7 → 2.1.11-test.9

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 (40) hide show
  1. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_ba28c717_lang.css +1 -0
  2. package/ConditionalDroprown.vue_vue_type_style_index_0_scoped_546e19a9_lang.css +1 -0
  3. package/DropdownV4.vue_vue_type_style_index_0_scoped_f88a132e_lang.css +1 -0
  4. package/OptionV4.vue_vue_type_style_index_0_scoped_df830bf5_lang.css +1 -0
  5. package/TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css +1 -0
  6. package/components/autocomplete/Autocomplete.vue2.js +3 -2
  7. package/components/chart/SettingsHeader.vue2.js +3 -2
  8. package/components/datePicker/v4/DatePickerV4.vue2.js +8 -7
  9. package/components/dateRange/v4/DateRangeV4.vue2.js +21 -20
  10. package/components/dropdown/common/Dropdown.common.js +127 -127
  11. package/components/dropdown/v3/Dropdown.vue.d.ts +1 -1
  12. package/components/dropdown/v3/index.d.ts +12 -12
  13. package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
  14. package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +66 -44
  15. package/components/dropdown/v4/ConditionalDroprown.vue.d.ts +68 -0
  16. package/components/dropdown/v4/ConditionalDroprown.vue.js +7 -0
  17. package/components/dropdown/v4/ConditionalDroprown.vue2.js +157 -0
  18. package/components/dropdown/v4/DropdownV4.vue.d.ts +6 -5
  19. package/components/dropdown/v4/DropdownV4.vue.js +3 -3
  20. package/components/dropdown/v4/DropdownV4.vue2.js +85 -78
  21. package/components/dropdown/v4/OptionV4.vue.d.ts +5 -0
  22. package/components/dropdown/v4/OptionV4.vue.js +2 -2
  23. package/components/dropdown/v4/OptionV4.vue2.js +119 -93
  24. package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
  25. package/components/dropdown/v4/TreeDropdown.vue2.js +105 -95
  26. package/components/dropdown/v4/index.d.ts +160 -27
  27. package/components/dropdown/v4/index.js +6 -3
  28. package/components/multibar/MultiBarMenu.vue2.js +3 -2
  29. package/components/popover/v4/PopoverV4.vue.js +3 -2
  30. package/components/popover/v4/PopoverV4.vue2.js +1 -1
  31. package/components/table/common/Table.common.js +26 -28
  32. package/components/table/v4/DataGridMenu.vue2.js +3 -2
  33. package/index.d.ts +316 -51
  34. package/index.js +1 -1
  35. package/mocks/options.d.ts +19 -4
  36. package/package.json +2 -1
  37. package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_49bd7193_lang.css +0 -1
  38. package/DropdownV4.vue_vue_type_style_index_0_scoped_562f0b72_lang.css +0 -1
  39. package/OptionV4.vue_vue_type_style_index_0_scoped_da829544_lang.css +0 -1
  40. package/TreeDropdown.vue_vue_type_style_index_0_scoped_985779f7_lang.css +0 -1
@@ -1,6 +1,6 @@
1
- import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_985779f7_lang.css"; import { defineComponent as Z, provide as _, ref as c, computed as E, onMounted as ee, watch as m, openBlock as g, createBlock as V, unref as a, withCtx as h, createVNode as C, normalizeProps as ne, guardReactiveProps as le, createSlots as te, renderSlot as oe, createElementVNode as z, mergeProps as ie, withModifiers as w, createTextVNode as ae, createElementBlock as D, withDirectives as de, Fragment as re, renderList as se, vShow as ce, createCommentVNode as ue } from "vue";
2
- import pe from "./DropdownV4.vue.js";
3
- import ye from "./DefaultDropdownTrigger.vue.js";
1
+ import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css"; import { defineComponent as ee, provide as le, ref as c, computed as K, onMounted as ne, watch as g, openBlock as C, createBlock as D, unref as d, withCtx as h, createVNode as I, mergeProps as z, createSlots as te, renderSlot as oe, createElementVNode as M, withModifiers as w, createTextVNode as ie, createElementBlock as B, withDirectives as de, Fragment as ae, renderList as se, vShow as re, createCommentVNode as ce } from "vue";
2
+ import ue from "./DropdownV4.vue.js";
3
+ import pe from "./DefaultDropdownTrigger.vue.js";
4
4
  import "./IconButtonDropdownTrigger.vue.js";
5
5
  import "./ChipDropdownTrigger.vue.js";
6
6
  import "./AppDropdownTrigger.vue.js";
@@ -8,14 +8,15 @@ import "./ButtonDropdownTrigger.vue.js";
8
8
  import "./ButtonFilterDropdownTrigger.vue.js";
9
9
  import "./TreeDropdown.vue.js";
10
10
  import S from "./OptionV4.vue.js";
11
- import { useChildOptions as he } from "../composables/useChildOptions.js";
12
- import fe from "../../search/v4/SearchV4.vue.js";
13
- import { useTestIdAttrs as ve } from "../../../utils/testIds.js";
14
- import { DropdownTestIdModifiers as M } from "../../../testids/index.js";
15
- const me = {
11
+ import "./ConditionalDroprown.vue.js";
12
+ import { useChildOptions as ye } from "../composables/useChildOptions.js";
13
+ import he from "../../search/v4/SearchV4.vue.js";
14
+ import { useTestIdAttrs as fe } from "../../../utils/testIds.js";
15
+ import { DropdownTestIdModifiers as $ } from "../../../testids/index.js";
16
+ const ve = {
16
17
  key: 0,
17
18
  class: "child-options"
18
- }, qe = /* @__PURE__ */ Z({
19
+ }, qe = /* @__PURE__ */ ee({
19
20
  __name: "TreeDropdown",
20
21
  props: {
21
22
  options: null,
@@ -43,18 +44,18 @@ const me = {
43
44
  emits: ["update:selected", "update:isOpen"],
44
45
  setup(t, { emit: b }) {
45
46
  const l = t;
46
- _("isTreeDropdown", !0);
47
- const K = c([]), p = c([]), T = c({}), O = c(!1), i = c([...l.selected]), y = c(""), x = c(!0), u = c(!1), N = E(() => p.value.reduce((e, o) => (e = e + 1, o[l.optionChildrenKey] && o[l.optionChildrenKey].length && o[l.optionChildrenKey].forEach(() => {
47
+ le("isTreeDropdown", !0);
48
+ const m = c([]), u = c([]), T = c({}), x = c(!1), i = c([...l.selected]), p = c(""), O = c(!0), N = K(() => u.value.reduce((e, o) => (o[l.optionChildrenKey] && o[l.optionChildrenKey].length && o[l.optionChildrenKey].forEach(() => {
48
49
  e = e + 1;
49
- }), e), 0)), P = E(() => !u.value && i.value.length > 0), U = () => {
50
+ }), o[l.optionChildrenKey] || (e = e + 1), e), 0)), U = () => {
50
51
  l.options.forEach((e) => {
51
52
  e[l.optionChildrenKey] && e[l.optionChildrenKey].length && (T.value[e[l.optionUniqueIdKey]] = [
52
53
  ...e[l.optionChildrenKey]
53
54
  ]);
54
- }), K.value = [...l.options], p.value = [...l.options];
55
- }, { hasChildren: f, getChildren: v, allChildrenSelected: I, someChildrenSelected: B } = he(i, l.optionChildrenKey), q = (e) => {
55
+ }), m.value = [...l.options], u.value = [...l.options];
56
+ }, { hasChildren: f, getChildren: v, allChildrenSelected: k, someChildrenSelected: P } = ye(i, l.optionChildrenKey), q = (e) => {
56
57
  if (f(e)) {
57
- I(e) ? i.value = i.value.filter(
58
+ k(e) ? i.value = i.value.filter(
58
59
  (o) => !v(e).includes(o)
59
60
  ) : i.value = [
60
61
  ...i.value.filter((o) => !v(e).includes(o)),
@@ -65,95 +66,97 @@ const me = {
65
66
  i.value.includes(e) ? i.value = i.value.filter(
66
67
  (o) => o !== e
67
68
  ) : i.value = [...i.value, e];
68
- }, A = (e) => i.value.includes(e), $ = (e) => 1 + (f(e) ? v(e).length : 0), j = () => {
69
- b("update:selected", i.value);
70
- }, F = () => {
69
+ }, A = (e) => i.value.includes(e), j = (e) => 1 + (f(e) ? v(e).length : 0), F = () => {
70
+ b("update:selected", i.value), L.value = y.value;
71
+ }, G = () => {
71
72
  i.value = [];
72
- }, R = () => {
73
+ }, H = () => {
73
74
  const e = /* @__PURE__ */ new Set([]);
74
- p.value.forEach((n) => {
75
+ u.value.forEach((n) => {
75
76
  if (l.selected?.includes(n))
76
77
  e.add(n);
77
78
  else if (n[l.optionChildrenKey] && n[l.optionChildrenKey].length) {
78
- for (const r of n[l.optionChildrenKey])
79
- if (l.selected?.includes(r)) {
79
+ for (const s of n[l.optionChildrenKey])
80
+ if (l.selected?.includes(s)) {
80
81
  e.add(n);
81
82
  break;
82
83
  }
83
84
  }
84
85
  });
85
86
  const o = Array.from(e);
86
- return p.value.forEach((n) => {
87
+ return u.value.forEach((n) => {
87
88
  !l.selected.includes(n) && !e.has(n) && o.push(n);
88
89
  }), o;
89
90
  };
90
- ee(() => {
91
- O.value || (U(), O.value = !0, l.preExpandedOptions && l.preExpandedOptions.forEach((e) => {
92
- d.value[e] = 1;
91
+ ne(() => {
92
+ x.value || (U(), x.value = !0, l.preExpandedOptions && l.preExpandedOptions.forEach((e) => {
93
+ a.value[e] = 1;
93
94
  }));
94
- }), m(
95
+ }), g(
95
96
  () => l.options,
96
97
  () => {
97
98
  U();
98
99
  }
99
- ), m(
100
+ ), g(
100
101
  () => l.selected,
101
102
  () => {
102
103
  i.value = [...l.selected];
103
104
  }
104
- ), m(i, () => {
105
- i.value.length < N.value ? u.value = !1 : i.value.length === N.value && (u.value = !0);
106
- }), m(
105
+ );
106
+ const y = K(() => i.value.length < N.value ? !1 : i.value.length === N.value), J = K(() => !y.value && i.value.length > 0), L = c(y.value);
107
+ g(
107
108
  () => l.isOpen,
108
109
  () => {
109
- l.isOpen ? K.value = R() : (i.value = [...l.selected], y.value = "");
110
+ l.isOpen ? m.value = H() : (i.value = [...l.selected], p.value = "");
110
111
  }
111
112
  );
112
- const d = c({}), G = (e) => {
113
- d.value[e[l.optionUniqueIdKey]] ? delete d.value[e[l.optionUniqueIdKey]] : d.value[e[l.optionUniqueIdKey]] = 1;
113
+ const a = c({}), Q = (e) => {
114
+ a.value[e[l.optionUniqueIdKey]] ? delete a.value[e[l.optionUniqueIdKey]] : a.value[e[l.optionUniqueIdKey]] = 1;
114
115
  };
115
- function H(e, o) {
116
- const n = e.toLowerCase(), r = [];
117
- return o.value.forEach((s) => {
118
- const k = s[l.optionNameKey].toLowerCase().includes(n), L = T.value[s[l.optionUniqueIdKey]]?.filter(
119
- (Y) => Y[l.optionNameKey].toLowerCase().includes(n)
116
+ function R(e, o) {
117
+ const n = e.toLowerCase(), s = [];
118
+ return o.value.forEach((r) => {
119
+ const E = r[l.optionNameKey].toLowerCase().includes(n), V = T.value[r[l.optionUniqueIdKey]]?.filter(
120
+ (_) => _[l.optionNameKey].toLowerCase().includes(n)
120
121
  ) || [];
121
- (k || L.length > 0) && (s[l.optionChildrenKey] = L, r.push(s));
122
- }), r;
122
+ (E || V.length > 0) && (r[l.optionChildrenKey] = V, s.push(r));
123
+ }), s;
123
124
  }
124
- const J = (e) => {
125
- const o = H(e, p);
126
- e && (Object.keys(d.value).forEach((n) => {
127
- delete d.value[n];
125
+ const W = (e) => {
126
+ const o = R(e, u);
127
+ e && (Object.keys(a.value).forEach((n) => {
128
+ delete a.value[n];
128
129
  }), o.forEach((n) => {
129
- Array.isArray(n[l.optionChildrenKey]) && n[l.optionChildrenKey].length && (d.value[n[l.optionUniqueIdKey]] = 1);
130
- })), K.value = o;
131
- }, Q = E(() => {
130
+ Array.isArray(n[l.optionChildrenKey]) && n[l.optionChildrenKey].length && (a.value[n[l.optionUniqueIdKey]] = 1);
131
+ })), m.value = o;
132
+ }, X = K(() => {
132
133
  const e = l.options.length, o = l.options.reduce(
133
- (n, r) => (d.value[r[l.optionUniqueIdKey]] && (n = n + r[l.optionChildrenKey].length), n),
134
+ (n, s) => (a.value[s[l.optionUniqueIdKey]] && (n = n + s[l.optionChildrenKey].length), n),
134
135
  0
135
136
  );
136
137
  return e + o;
137
138
  });
138
- m(
139
- () => y.value,
139
+ g(
140
+ () => p.value,
140
141
  () => {
141
- J(y.value), x.value = !y.value;
142
+ W(p.value), O.value = !p.value;
142
143
  }
143
144
  );
144
- const W = () => {
145
- u.value ? i.value = [] : (i.value = [], p.value.forEach((e) => {
146
- if (i.value = [e, ...i.value], e[l.optionChildrenKey] && e[l.optionChildrenKey].length)
145
+ const Y = () => {
146
+ y.value ? i.value = [] : (i.value = [], u.value.forEach((e) => {
147
+ if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length)
147
148
  for (const o of e[l.optionChildrenKey])
148
149
  i.value = [o, ...i.value];
149
- })), u.value = !u.value;
150
- }, X = ve(l.testId, M);
151
- return (e, o) => (g(), V(a(pe), {
150
+ else
151
+ i.value = [e, ...i.value];
152
+ }));
153
+ }, Z = fe(l.testId, $);
154
+ return (e, o) => (C(), D(d(ue), {
152
155
  multi: "",
153
156
  class: "tree-dropdown",
154
- "show-select-all": x.value,
157
+ "show-select-all": O.value,
155
158
  "is-open": t.isOpen,
156
- options: K.value,
159
+ options: m.value,
157
160
  selected: t.selected,
158
161
  "display-value": t.displayValue,
159
162
  placeholder: t.placeholder,
@@ -164,16 +167,19 @@ const me = {
164
167
  "test-id": t.testId,
165
168
  disabled: t.disabled,
166
169
  "disable-virtual-scroll": "",
167
- "override-option-count-calculation": $,
170
+ "override-option-count-calculation": j,
168
171
  "trigger-show-all-selected-text": !1,
169
172
  "predefined-trigger": "default",
170
- "custom-number-of-displayed-options": a(Q),
173
+ "custom-number-of-displayed-options": d(X),
171
174
  "onUpdate:isOpen": o[2] || (o[2] = (n) => b("update:isOpen", n)),
172
- onApply: j,
173
- onClear: F
175
+ onApply: F,
176
+ onClear: G
174
177
  }, {
175
178
  "dropdown-trigger": h(({ defaultTriggerProps: n }) => [
176
- C(a(ye), ne(le(n)), te({ _: 2 }, [
179
+ I(d(pe), z(n, {
180
+ "all-selected": L.value,
181
+ "show-all-selected-text": ""
182
+ }), te({ _: 2 }, [
177
183
  e.$slots["trigger-end-icon"] ? {
178
184
  name: "end-icon",
179
185
  fn: h(() => [
@@ -181,12 +187,13 @@ const me = {
181
187
  ]),
182
188
  key: "0"
183
189
  } : void 0
184
- ]), 1040)
190
+ ]), 1040, ["all-selected"])
185
191
  ]),
186
192
  "inline-search": h(() => [
187
- C(a(fe), {
188
- modelValue: y.value,
189
- "onUpdate:modelValue": o[0] || (o[0] = (n) => y.value = n),
193
+ I(d(he), {
194
+ modelValue: p.value,
195
+ "onUpdate:modelValue": o[0] || (o[0] = (n) => p.value = n),
196
+ class: "tree-search",
190
197
  placeholder: t.inlineSearchPlaceholder,
191
198
  variant: "transparent",
192
199
  size: "md",
@@ -195,28 +202,29 @@ const me = {
195
202
  }, null, 8, ["modelValue", "placeholder", "test-id"])
196
203
  ]),
197
204
  "select-all": h(() => [
198
- z("li", null, [
199
- C(a(S), ie({
200
- "aria-selected": u.value,
205
+ M("li", null, [
206
+ I(d(S), z({
207
+ "aria-selected": d(y),
201
208
  "aria-disabled": !!t.disabled,
202
- "selected-prop": u.value,
203
- "is-indeterminate": a(P),
209
+ "selected-prop": d(y),
210
+ "is-indeterminate": d(J),
211
+ "is-multi": "",
204
212
  "select-all-option": ""
205
- }, a(X)[a(M).SELECT_ALL], {
206
- onClick: o[1] || (o[1] = w((n) => W(), ["stop"]))
213
+ }, d(Z)[d($).SELECT_ALL], {
214
+ onClick: o[1] || (o[1] = w((n) => Y(), ["stop"]))
207
215
  }), {
208
216
  default: h(() => [
209
- ae(" Select all ")
217
+ ie(" Select all ")
210
218
  ]),
211
219
  _: 1
212
220
  }, 16, ["aria-selected", "aria-disabled", "selected-prop", "is-indeterminate"])
213
221
  ])
214
222
  ]),
215
- default: h(({ option: n, index: r }) => [
216
- C(a(S), {
223
+ default: h(({ option: n, index: s }) => [
224
+ I(d(S), {
217
225
  option: n,
218
- "selected-prop": a(f)(n) ? a(I)(n) : A(n),
219
- "is-indeterminate": !a(I)(n) && a(B)(n),
226
+ "selected-prop": d(f)(n) ? d(k)(n) : A(n),
227
+ "is-indeterminate": !d(k)(n) && d(P)(n),
220
228
  disabled: n[t.disabledOptionKey],
221
229
  "name-key": t.optionNameKey,
222
230
  "image-key": t.optionImageKey,
@@ -225,19 +233,20 @@ const me = {
225
233
  "end-icon-key": t.optionEndIconKey,
226
234
  "end-icon-type": t.optionEndIconType,
227
235
  "end-text-icon-key": t.optionEndTextIconKey,
228
- "tree-main-option": a(f)(n),
229
- "tree-main-option-expanded": d.value[n[t.optionUniqueIdKey]],
236
+ "tree-main-option": d(f)(n),
237
+ "tree-main-option-expanded": a.value[n[t.optionUniqueIdKey]],
230
238
  "stop-option-click-event-propagation": "",
239
+ "is-multi": "",
231
240
  onClick: w(() => q(n), ["stop"]),
232
- onToggleTreeCollapse: G
241
+ onToggleTreeCollapse: Q
233
242
  }, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "end-text-icon-key", "tree-main-option", "tree-main-option-expanded", "onClick"]),
234
- a(f)(n) ? (g(), D("div", me, [
235
- de(z("div", null, [
236
- (g(!0), D(re, null, se(a(v)(n), (s, k) => (g(), V(a(S), {
237
- key: `${r}-${k}`,
238
- option: s,
239
- "selected-prop": A(s),
240
- disabled: s[t.disabledOptionKey],
243
+ d(f)(n) ? (C(), B("div", ve, [
244
+ de(M("div", null, [
245
+ (C(!0), B(ae, null, se(d(v)(n), (r, E) => (C(), D(d(S), {
246
+ key: `${s}-${E}`,
247
+ option: r,
248
+ "selected-prop": A(r),
249
+ disabled: r[t.disabledOptionKey],
241
250
  "name-key": t.optionNameKey,
242
251
  "image-key": t.optionImageKey,
243
252
  "icon-key": t.optionIconKey,
@@ -245,14 +254,15 @@ const me = {
245
254
  "end-icon-key": t.optionEndIconKey,
246
255
  "end-icon-type": t.optionEndIconType,
247
256
  "end-text-icon-key": t.optionEndTextIconKey,
248
- "tree-child-shown": d.value[n[t.optionUniqueIdKey]],
257
+ "tree-child-shown": a.value[n[t.optionUniqueIdKey]],
249
258
  "stop-option-click-event-propagation": "",
250
- onClick: w(() => q(s), ["stop"])
259
+ "is-multi": "",
260
+ onClick: w(() => q(r), ["stop"])
251
261
  }, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "end-text-icon-key", "tree-child-shown", "onClick"]))), 128))
252
262
  ], 512), [
253
- [ce, d.value[n[t.optionUniqueIdKey]]]
263
+ [re, a.value[n[t.optionUniqueIdKey]]]
254
264
  ])
255
- ])) : ue("", !0)
265
+ ])) : ce("", !0)
256
266
  ]),
257
267
  _: 3
258
268
  }, 8, ["show-select-all", "is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled", "custom-number-of-displayed-options"]));