@ironsource/shared-ui 2.1.11-rc.12 → 2.1.11-rc.13

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-bdfb0aef]{padding-left:1rem}.tree-search[data-v-bdfb0aef]{width:100%}
@@ -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_4209192c_lang.css"; //*');
4
- const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-4209192c"]]);
3
+ // import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-bdfb0aef"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,6 +1,6 @@
1
- import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_4209192c_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 se, renderList as re, 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";
@@ -9,14 +9,14 @@ import "./ButtonFilterDropdownTrigger.vue.js";
9
9
  import "./TreeDropdown.vue.js";
10
10
  import S from "./OptionV4.vue.js";
11
11
  import "./ConditionalDroprown.vue.js";
12
- import { useChildOptions as he } from "../composables/useChildOptions.js";
13
- import fe from "../../search/v4/SearchV4.vue.js";
14
- import { useTestIdAttrs as ve } from "../../../utils/testIds.js";
15
- import { DropdownTestIdModifiers as M } from "../../../testids/index.js";
16
- const me = {
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 = {
17
17
  key: 0,
18
18
  class: "child-options"
19
- }, Ae = /* @__PURE__ */ Z({
19
+ }, qe = /* @__PURE__ */ ee({
20
20
  __name: "TreeDropdown",
21
21
  props: {
22
22
  options: null,
@@ -44,18 +44,18 @@ const me = {
44
44
  emits: ["update:selected", "update:isOpen"],
45
45
  setup(t, { emit: b }) {
46
46
  const l = t;
47
- _("isTreeDropdown", !0);
48
- 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(() => {
49
49
  e = e + 1;
50
- }), e), 0)), P = E(() => !u.value && i.value.length > 0), U = () => {
50
+ }), o[l.optionChildrenKey] || (e = e + 1), e), 0)), U = () => {
51
51
  l.options.forEach((e) => {
52
52
  e[l.optionChildrenKey] && e[l.optionChildrenKey].length && (T.value[e[l.optionUniqueIdKey]] = [
53
53
  ...e[l.optionChildrenKey]
54
54
  ]);
55
- }), K.value = [...l.options], p.value = [...l.options];
56
- }, { 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) => {
57
57
  if (f(e)) {
58
- I(e) ? i.value = i.value.filter(
58
+ k(e) ? i.value = i.value.filter(
59
59
  (o) => !v(e).includes(o)
60
60
  ) : i.value = [
61
61
  ...i.value.filter((o) => !v(e).includes(o)),
@@ -66,13 +66,13 @@ const me = {
66
66
  i.value.includes(e) ? i.value = i.value.filter(
67
67
  (o) => o !== e
68
68
  ) : i.value = [...i.value, e];
69
- }, A = (e) => i.value.includes(e), $ = (e) => 1 + (f(e) ? v(e).length : 0), j = () => {
70
- b("update:selected", i.value);
71
- }, 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 = () => {
72
72
  i.value = [];
73
- }, R = () => {
73
+ }, H = () => {
74
74
  const e = /* @__PURE__ */ new Set([]);
75
- p.value.forEach((n) => {
75
+ u.value.forEach((n) => {
76
76
  if (l.selected?.includes(n))
77
77
  e.add(n);
78
78
  else if (n[l.optionChildrenKey] && n[l.optionChildrenKey].length) {
@@ -84,79 +84,79 @@ const me = {
84
84
  }
85
85
  });
86
86
  const o = Array.from(e);
87
- return p.value.forEach((n) => {
87
+ return u.value.forEach((n) => {
88
88
  !l.selected.includes(n) && !e.has(n) && o.push(n);
89
89
  }), o;
90
90
  };
91
- ee(() => {
92
- O.value || (U(), O.value = !0, l.preExpandedOptions && l.preExpandedOptions.forEach((e) => {
93
- d.value[e] = 1;
91
+ ne(() => {
92
+ x.value || (U(), x.value = !0, l.preExpandedOptions && l.preExpandedOptions.forEach((e) => {
93
+ a.value[e] = 1;
94
94
  }));
95
- }), m(
95
+ }), g(
96
96
  () => l.options,
97
97
  () => {
98
98
  U();
99
99
  }
100
- ), m(
100
+ ), g(
101
101
  () => l.selected,
102
102
  () => {
103
103
  i.value = [...l.selected];
104
104
  }
105
- ), m(i, () => {
106
- i.value.length < N.value ? u.value = !1 : i.value.length === N.value && (u.value = !0);
107
- }), 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(
108
108
  () => l.isOpen,
109
109
  () => {
110
- l.isOpen ? K.value = R() : (i.value = [...l.selected], y.value = "");
110
+ l.isOpen ? m.value = H() : (i.value = [...l.selected], p.value = "");
111
111
  }
112
112
  );
113
- const d = c({}), G = (e) => {
114
- 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;
115
115
  };
116
- function H(e, o) {
116
+ function R(e, o) {
117
117
  const n = e.toLowerCase(), s = [];
118
118
  return o.value.forEach((r) => {
119
- const k = r[l.optionNameKey].toLowerCase().includes(n), L = T.value[r[l.optionUniqueIdKey]]?.filter(
120
- (Y) => Y[l.optionNameKey].toLowerCase().includes(n)
119
+ const E = r[l.optionNameKey].toLowerCase().includes(n), V = T.value[r[l.optionUniqueIdKey]]?.filter(
120
+ (_) => _[l.optionNameKey].toLowerCase().includes(n)
121
121
  ) || [];
122
- (k || L.length > 0) && (r[l.optionChildrenKey] = L, s.push(r));
122
+ (E || V.length > 0) && (r[l.optionChildrenKey] = V, s.push(r));
123
123
  }), s;
124
124
  }
125
- const J = (e) => {
126
- const o = H(e, p);
127
- e && (Object.keys(d.value).forEach((n) => {
128
- 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];
129
129
  }), o.forEach((n) => {
130
- Array.isArray(n[l.optionChildrenKey]) && n[l.optionChildrenKey].length && (d.value[n[l.optionUniqueIdKey]] = 1);
131
- })), K.value = o;
132
- }, 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(() => {
133
133
  const e = l.options.length, o = l.options.reduce(
134
- (n, s) => (d.value[s[l.optionUniqueIdKey]] && (n = n + s[l.optionChildrenKey].length), n),
134
+ (n, s) => (a.value[s[l.optionUniqueIdKey]] && (n = n + s[l.optionChildrenKey].length), n),
135
135
  0
136
136
  );
137
137
  return e + o;
138
138
  });
139
- m(
140
- () => y.value,
139
+ g(
140
+ () => p.value,
141
141
  () => {
142
- J(y.value), x.value = !y.value;
142
+ W(p.value), O.value = !p.value;
143
143
  }
144
144
  );
145
- const W = () => {
146
- u.value ? i.value = [] : (i.value = [], p.value.forEach((e) => {
145
+ const Y = () => {
146
+ y.value ? i.value = [] : (i.value = [], u.value.forEach((e) => {
147
147
  if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length)
148
148
  for (const o of e[l.optionChildrenKey])
149
149
  i.value = [o, ...i.value];
150
150
  else
151
151
  i.value = [e, ...i.value];
152
- })), u.value = !u.value;
153
- }, X = ve(l.testId, M);
154
- return (e, o) => (g(), V(a(pe), {
152
+ }));
153
+ }, Z = fe(l.testId, $);
154
+ return (e, o) => (C(), D(d(ue), {
155
155
  multi: "",
156
156
  class: "tree-dropdown",
157
- "show-select-all": x.value,
157
+ "show-select-all": O.value,
158
158
  "is-open": t.isOpen,
159
- options: K.value,
159
+ options: m.value,
160
160
  selected: t.selected,
161
161
  "display-value": t.displayValue,
162
162
  placeholder: t.placeholder,
@@ -167,16 +167,19 @@ const me = {
167
167
  "test-id": t.testId,
168
168
  disabled: t.disabled,
169
169
  "disable-virtual-scroll": "",
170
- "override-option-count-calculation": $,
170
+ "override-option-count-calculation": j,
171
171
  "trigger-show-all-selected-text": !1,
172
172
  "predefined-trigger": "default",
173
- "custom-number-of-displayed-options": a(Q),
173
+ "custom-number-of-displayed-options": d(X),
174
174
  "onUpdate:isOpen": o[2] || (o[2] = (n) => b("update:isOpen", n)),
175
- onApply: j,
176
- onClear: F
175
+ onApply: F,
176
+ onClear: G
177
177
  }, {
178
178
  "dropdown-trigger": h(({ defaultTriggerProps: n }) => [
179
- 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 }, [
180
183
  e.$slots["trigger-end-icon"] ? {
181
184
  name: "end-icon",
182
185
  fn: h(() => [
@@ -184,12 +187,12 @@ const me = {
184
187
  ]),
185
188
  key: "0"
186
189
  } : void 0
187
- ]), 1040)
190
+ ]), 1040, ["all-selected"])
188
191
  ]),
189
192
  "inline-search": h(() => [
190
- C(a(fe), {
191
- modelValue: y.value,
192
- "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),
193
196
  class: "tree-search",
194
197
  placeholder: t.inlineSearchPlaceholder,
195
198
  variant: "transparent",
@@ -199,29 +202,29 @@ const me = {
199
202
  }, null, 8, ["modelValue", "placeholder", "test-id"])
200
203
  ]),
201
204
  "select-all": h(() => [
202
- z("li", null, [
203
- C(a(S), ie({
204
- "aria-selected": u.value,
205
+ M("li", null, [
206
+ I(d(S), z({
207
+ "aria-selected": d(y),
205
208
  "aria-disabled": !!t.disabled,
206
- "selected-prop": u.value,
207
- "is-indeterminate": a(P),
209
+ "selected-prop": d(y),
210
+ "is-indeterminate": d(J),
208
211
  "is-multi": "",
209
212
  "select-all-option": ""
210
- }, a(X)[a(M).SELECT_ALL], {
211
- 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"]))
212
215
  }), {
213
216
  default: h(() => [
214
- ae(" Select all ")
217
+ ie(" Select all ")
215
218
  ]),
216
219
  _: 1
217
220
  }, 16, ["aria-selected", "aria-disabled", "selected-prop", "is-indeterminate"])
218
221
  ])
219
222
  ]),
220
223
  default: h(({ option: n, index: s }) => [
221
- C(a(S), {
224
+ I(d(S), {
222
225
  option: n,
223
- "selected-prop": a(f)(n) ? a(I)(n) : A(n),
224
- "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),
225
228
  disabled: n[t.disabledOptionKey],
226
229
  "name-key": t.optionNameKey,
227
230
  "image-key": t.optionImageKey,
@@ -230,17 +233,17 @@ const me = {
230
233
  "end-icon-key": t.optionEndIconKey,
231
234
  "end-icon-type": t.optionEndIconType,
232
235
  "end-text-icon-key": t.optionEndTextIconKey,
233
- "tree-main-option": a(f)(n),
234
- "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]],
235
238
  "stop-option-click-event-propagation": "",
236
239
  "is-multi": "",
237
240
  onClick: w(() => q(n), ["stop"]),
238
- onToggleTreeCollapse: G
241
+ onToggleTreeCollapse: Q
239
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"]),
240
- a(f)(n) ? (g(), D("div", me, [
241
- de(z("div", null, [
242
- (g(!0), D(se, null, re(a(v)(n), (r, k) => (g(), V(a(S), {
243
- key: `${s}-${k}`,
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}`,
244
247
  option: r,
245
248
  "selected-prop": A(r),
246
249
  disabled: r[t.disabledOptionKey],
@@ -251,20 +254,20 @@ const me = {
251
254
  "end-icon-key": t.optionEndIconKey,
252
255
  "end-icon-type": t.optionEndIconType,
253
256
  "end-text-icon-key": t.optionEndTextIconKey,
254
- "tree-child-shown": d.value[n[t.optionUniqueIdKey]],
257
+ "tree-child-shown": a.value[n[t.optionUniqueIdKey]],
255
258
  "stop-option-click-event-propagation": "",
256
259
  "is-multi": "",
257
260
  onClick: w(() => q(r), ["stop"])
258
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))
259
262
  ], 512), [
260
- [ce, d.value[n[t.optionUniqueIdKey]]]
263
+ [re, a.value[n[t.optionUniqueIdKey]]]
261
264
  ])
262
- ])) : ue("", !0)
265
+ ])) : ce("", !0)
263
266
  ]),
264
267
  _: 3
265
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"]));
266
269
  }
267
270
  });
268
271
  export {
269
- Ae as default
272
+ qe as default
270
273
  };
@@ -1,4 +1,23 @@
1
1
  import { Country } from '@is-ssp/includeExclude/includeExcludeMocks';
2
+ export declare const SHORT_NESTED_OPTIONS: ({
3
+ text: string;
4
+ id: number;
5
+ endIcon: string;
6
+ children?: undefined;
7
+ } | {
8
+ text: string;
9
+ id: number;
10
+ endIcon: string;
11
+ children: ({
12
+ text: string;
13
+ endIcon: string;
14
+ id: number;
15
+ } | {
16
+ text: string;
17
+ id: number;
18
+ endIcon?: undefined;
19
+ })[];
20
+ })[];
2
21
  export declare const NESTED_OPTIONS: ({
3
22
  text: string;
4
23
  id: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.1.11-rc.12",
3
+ "version": "2.1.11-rc.13",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -1 +0,0 @@
1
- .child-options[data-v-4209192c]{padding-left:1rem}.tree-search[data-v-4209192c]{width:100%}