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

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