@ironsource/shared-ui 2.1.7-test.9 → 2.1.8-rc.0

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-ffd0b476]{padding-left:1rem}
@@ -1,7 +1,7 @@
1
- import e from "./TreeDropdown.vue2.js";
2
- /* empty css */import o from "../../../_virtual/_plugin-vue_export-helper.js";
3
- // import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_5efe563d_lang.css"; //*');
4
- const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-5efe563d"]]);
1
+ import o from "./TreeDropdown.vue2.js";
2
+ /* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
3
+ // import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_ffd0b476_lang.css"; //*');
4
+ const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-ffd0b476"]]);
5
5
  export {
6
6
  s as default
7
7
  };
@@ -1,19 +1,19 @@
1
- import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_5efe563d_lang.css"; import { defineComponent as $, provide as j, ref as r, onMounted as F, watch as C, openBlock as v, createBlock as T, unref as a, withCtx as m, createVNode as k, normalizeProps as R, guardReactiveProps as G, renderSlot as H, withModifiers as U, createElementBlock as q, withDirectives as J, createElementVNode as Q, Fragment as W, renderList as X, vShow as Y, createCommentVNode as Z } from "vue";
2
- import _ from "./DropdownV4.vue.js";
3
- import ee from "./DefaultDropdownTrigger.vue.js";
1
+ import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_ffd0b476_lang.css"; import { defineComponent as j, provide as F, ref as s, onMounted as R, watch as v, openBlock as m, createBlock as U, unref as a, withCtx as K, createVNode as k, normalizeProps as G, guardReactiveProps as H, renderSlot as J, withModifiers as q, createElementBlock as N, withDirectives as Q, createElementVNode as W, Fragment as X, renderList as Y, vShow as Z, createCommentVNode as _ } from "vue";
2
+ import ee from "./DropdownV4.vue.js";
3
+ import ne 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 N from "./OptionV4.vue.js";
11
- import { useChildOptions as ne } from "../composables/useChildOptions.js";
12
- import le from "../../search/v4/SearchV4.vue.js";
13
- const oe = {
10
+ import z from "./OptionV4.vue.js";
11
+ import { useChildOptions as le } from "../composables/useChildOptions.js";
12
+ import oe from "../../search/v4/SearchV4.vue.js";
13
+ const te = {
14
14
  key: 0,
15
15
  class: "child-options"
16
- }, ve = /* @__PURE__ */ $({
16
+ }, me = /* @__PURE__ */ j({
17
17
  __name: "TreeDropdown",
18
18
  props: {
19
19
  options: null,
@@ -39,23 +39,30 @@ const oe = {
39
39
  emits: ["update:selected", "update:isOpen"],
40
40
  setup(o, { emit: I }) {
41
41
  const l = o;
42
- j("isTreeDropdown", !0);
43
- const f = r([]), h = r([]), w = r({}), O = r(!1), i = r(l.selected), u = r("");
44
- F(() => {
45
- O.value || (l.options.forEach((n) => {
42
+ F("isTreeDropdown", !0);
43
+ const f = s([]), h = s([]), w = s({}), O = s(!1), i = s([...l.selected]), u = s(""), S = () => {
44
+ l.options.forEach((n) => {
46
45
  n[l.optionChildrenKey] && n[l.optionChildrenKey].length && (w.value[n[l.optionUniqueIdKey]] = [
47
46
  ...n[l.optionChildrenKey]
48
47
  ]);
49
- }), f.value = [...l.options], h.value = [...l.options], O.value = !0);
50
- }), C(
48
+ }), f.value = [...l.options], h.value = [...l.options];
49
+ };
50
+ R(() => {
51
+ O.value || (S(), O.value = !0);
52
+ }), v(
53
+ () => l.options,
54
+ () => {
55
+ S();
56
+ }
57
+ ), v(
51
58
  () => l.selected,
52
59
  () => {
53
60
  i.value = [...l.selected];
54
61
  }
55
62
  );
56
- const { hasChildren: p, getChildren: y, allChildrenSelected: K, someChildrenSelected: V } = ne(i, l.optionChildrenKey), S = (n) => {
63
+ const { hasChildren: p, getChildren: y, allChildrenSelected: g, someChildrenSelected: V } = le(i, l.optionChildrenKey), b = (n) => {
57
64
  if (p(n)) {
58
- K(n) ? i.value = i.value.filter(
65
+ g(n) ? i.value = i.value.filter(
59
66
  (t) => !y(n).includes(t)
60
67
  ) : i.value = [
61
68
  ...i.value.filter((t) => !y(n).includes(t)),
@@ -66,18 +73,18 @@ const oe = {
66
73
  i.value.includes(n) ? i.value = i.value.filter(
67
74
  (t) => t !== n
68
75
  ) : i.value = [...i.value, n];
69
- }, b = (n) => i.value.includes(n), z = (n) => 1 + (p(n) ? y(n).length : 0), D = () => {
76
+ }, E = (n) => i.value.includes(n), D = (n) => 1 + (p(n) ? y(n).length : 0), x = () => {
70
77
  I("update:selected", i.value);
71
- }, x = () => {
72
- i.value = [];
73
78
  }, B = () => {
79
+ i.value = [];
80
+ }, M = () => {
74
81
  const n = /* @__PURE__ */ new Set([]);
75
82
  h.value.forEach((e) => {
76
83
  if (l.selected?.includes(e))
77
84
  n.add(e);
78
85
  else if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length) {
79
- for (const s of e[l.optionChildrenKey])
80
- if (l.selected?.includes(s)) {
86
+ for (const r of e[l.optionChildrenKey])
87
+ if (l.selected?.includes(r)) {
81
88
  n.add(e);
82
89
  break;
83
90
  }
@@ -88,38 +95,38 @@ const oe = {
88
95
  !l.selected.includes(e) && !n.has(e) && t.push(e);
89
96
  }), t;
90
97
  };
91
- C(
98
+ v(
92
99
  () => l.isOpen,
93
100
  () => {
94
- l.isOpen ? f.value = B() : (i.value = [...l.selected], u.value = "");
101
+ l.isOpen ? f.value = M() : (i.value = [...l.selected], u.value = "");
95
102
  }
96
103
  );
97
- const d = r({}), M = (n) => {
104
+ const d = s({}), P = (n) => {
98
105
  d.value[n[l.optionUniqueIdKey]] ? delete d.value[n[l.optionUniqueIdKey]] : d.value[n[l.optionUniqueIdKey]] = 1;
99
106
  };
100
- function P(n, t) {
101
- const e = n.toLowerCase(), s = [];
107
+ function A(n, t) {
108
+ const e = n.toLowerCase(), r = [];
102
109
  return t.value.forEach((c) => {
103
- const g = c[l.optionNameKey].toLowerCase().includes(e), E = w.value[c[l.optionUniqueIdKey]]?.filter(
104
- (L) => L[l.optionNameKey].toLowerCase().includes(e)
110
+ const C = c[l.optionNameKey].toLowerCase().includes(e), T = w.value[c[l.optionUniqueIdKey]]?.filter(
111
+ ($) => $[l.optionNameKey].toLowerCase().includes(e)
105
112
  ) || [];
106
- (g || E.length > 0) && (c[l.optionChildrenKey] = E, s.push(c));
107
- }), s;
113
+ (C || T.length > 0) && (c[l.optionChildrenKey] = T, r.push(c));
114
+ }), r;
108
115
  }
109
- const A = (n) => {
110
- const t = P(n, h);
116
+ const L = (n) => {
117
+ const t = A(n, h);
111
118
  n && (Object.keys(d.value).forEach((e) => {
112
119
  delete d.value[e];
113
120
  }), t.forEach((e) => {
114
121
  Array.isArray(e[l.optionChildrenKey]) && e[l.optionChildrenKey].length && (d.value[e[l.optionUniqueIdKey]] = 1);
115
122
  })), f.value = t;
116
123
  };
117
- return C(
124
+ return v(
118
125
  () => u.value,
119
126
  () => {
120
- A(u.value);
127
+ L(u.value);
121
128
  }
122
- ), (n, t) => (v(), T(a(_), {
129
+ ), (n, t) => (m(), U(a(ee), {
123
130
  multi: "",
124
131
  class: "tree-dropdown",
125
132
  "show-select-all": !1,
@@ -135,23 +142,23 @@ const oe = {
135
142
  "test-id": o.testId,
136
143
  disabled: o.disabled,
137
144
  "disable-virtual-scroll": "",
138
- "override-option-count-calculation": z,
145
+ "override-option-count-calculation": D,
139
146
  "trigger-show-all-selected-text": !1,
140
147
  "predefined-trigger": "default",
141
148
  "onUpdate:isOpen": t[1] || (t[1] = (e) => I("update:isOpen", e)),
142
- onApply: D,
143
- onClear: x
149
+ onApply: x,
150
+ onClear: B
144
151
  }, {
145
- "dropdown-trigger": m(({ defaultTriggerProps: e }) => [
146
- k(a(ee), R(G(e)), {
147
- "end-icon": m(() => [
148
- H(n.$slots, "trigger-end-icon", {}, void 0, !0)
152
+ "dropdown-trigger": K(({ defaultTriggerProps: e }) => [
153
+ k(a(ne), G(H(e)), {
154
+ "end-icon": K(() => [
155
+ J(n.$slots, "trigger-end-icon", {}, void 0, !0)
149
156
  ]),
150
157
  _: 2
151
158
  }, 1040)
152
159
  ]),
153
- "inline-search": m(() => [
154
- k(a(le), {
160
+ "inline-search": K(() => [
161
+ k(a(oe), {
155
162
  modelValue: u.value,
156
163
  "onUpdate:modelValue": t[0] || (t[0] = (e) => u.value = e),
157
164
  placeholder: o.inlineSearchPlaceholder,
@@ -161,11 +168,11 @@ const oe = {
161
168
  "test-id": o.testId
162
169
  }, null, 8, ["modelValue", "placeholder", "test-id"])
163
170
  ]),
164
- default: m(({ option: e, index: s }) => [
165
- k(a(N), {
171
+ default: K(({ option: e, index: r }) => [
172
+ k(a(z), {
166
173
  option: e,
167
- "selected-prop": a(p)(e) ? a(K)(e) : b(e),
168
- "is-indeterminate": !a(K)(e) && a(V)(e),
174
+ "selected-prop": a(p)(e) ? a(g)(e) : E(e),
175
+ "is-indeterminate": !a(g)(e) && a(V)(e),
169
176
  disabled: e[o.disabledOptionKey],
170
177
  "name-key": o.optionNameKey,
171
178
  "image-key": o.optionImageKey,
@@ -176,15 +183,15 @@ const oe = {
176
183
  "tree-main-option": a(p)(e),
177
184
  "tree-main-option-expanded": d.value[e[o.optionUniqueIdKey]],
178
185
  "stop-option-click-event-propagation": "",
179
- onClick: U(() => S(e), ["stop"]),
180
- onToggleTreeCollapse: M
186
+ onClick: q(() => b(e), ["stop"]),
187
+ onToggleTreeCollapse: P
181
188
  }, 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"]),
182
- a(p)(e) ? (v(), q("div", oe, [
183
- J(Q("div", null, [
184
- (v(!0), q(W, null, X(a(y)(e), (c, g) => (v(), T(a(N), {
185
- key: `${s}-${g}`,
189
+ a(p)(e) ? (m(), N("div", te, [
190
+ Q(W("div", null, [
191
+ (m(!0), N(X, null, Y(a(y)(e), (c, C) => (m(), U(a(z), {
192
+ key: `${r}-${C}`,
186
193
  option: c,
187
- "selected-prop": b(c),
194
+ "selected-prop": E(c),
188
195
  disabled: c[o.disabledOptionKey],
189
196
  "name-key": o.optionNameKey,
190
197
  "image-key": o.optionImageKey,
@@ -194,17 +201,17 @@ const oe = {
194
201
  "end-icon-type": o.optionEndIconType,
195
202
  "tree-child-shown": d.value[e[o.optionUniqueIdKey]],
196
203
  "stop-option-click-event-propagation": "",
197
- onClick: U(() => S(c), ["stop"])
204
+ onClick: q(() => b(c), ["stop"])
198
205
  }, 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))
199
206
  ], 512), [
200
- [Y, d.value[e[o.optionUniqueIdKey]]]
207
+ [Z, d.value[e[o.optionUniqueIdKey]]]
201
208
  ])
202
- ])) : Z("", !0)
209
+ ])) : _("", !0)
203
210
  ]),
204
211
  _: 3
205
212
  }, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled"]));
206
213
  }
207
214
  });
208
215
  export {
209
- ve as default
216
+ me as default
210
217
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ironsource/shared-ui",
3
- "version": "2.1.7-test.9",
3
+ "version": "2.1.8-rc.0",
4
4
  "engines": {
5
5
  "npm": ">=7.0.0",
6
6
  "node": ">=16.0.0"
@@ -1 +0,0 @@
1
- .child-options[data-v-5efe563d]{padding-left:1rem}