@ironsource/shared-ui 2.1.7 → 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.
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_ffd0b476_lang.css +1 -0
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +66 -59
- package/package.json +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_78ce1bbd_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.child-options[data-v-ffd0b476]{padding-left:1rem}
|
|
@@ -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.
|
|
4
|
-
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-
|
|
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.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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
|
|
11
|
-
import { useChildOptions as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
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
|
-
},
|
|
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
|
-
|
|
43
|
-
const f =
|
|
44
|
-
|
|
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]
|
|
50
|
-
}
|
|
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:
|
|
63
|
+
const { hasChildren: p, getChildren: y, allChildrenSelected: g, someChildrenSelected: V } = le(i, l.optionChildrenKey), b = (n) => {
|
|
57
64
|
if (p(n)) {
|
|
58
|
-
|
|
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
|
-
},
|
|
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
|
|
80
|
-
if (l.selected?.includes(
|
|
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
|
-
|
|
98
|
+
v(
|
|
92
99
|
() => l.isOpen,
|
|
93
100
|
() => {
|
|
94
|
-
l.isOpen ? f.value =
|
|
101
|
+
l.isOpen ? f.value = M() : (i.value = [...l.selected], u.value = "");
|
|
95
102
|
}
|
|
96
103
|
);
|
|
97
|
-
const d =
|
|
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
|
|
101
|
-
const e = n.toLowerCase(),
|
|
107
|
+
function A(n, t) {
|
|
108
|
+
const e = n.toLowerCase(), r = [];
|
|
102
109
|
return t.value.forEach((c) => {
|
|
103
|
-
const
|
|
104
|
-
(
|
|
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
|
-
(
|
|
107
|
-
}),
|
|
113
|
+
(C || T.length > 0) && (c[l.optionChildrenKey] = T, r.push(c));
|
|
114
|
+
}), r;
|
|
108
115
|
}
|
|
109
|
-
const
|
|
110
|
-
const t =
|
|
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
|
|
124
|
+
return v(
|
|
118
125
|
() => u.value,
|
|
119
126
|
() => {
|
|
120
|
-
|
|
127
|
+
L(u.value);
|
|
121
128
|
}
|
|
122
|
-
), (n, t) => (
|
|
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":
|
|
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:
|
|
143
|
-
onClear:
|
|
149
|
+
onApply: x,
|
|
150
|
+
onClear: B
|
|
144
151
|
}, {
|
|
145
|
-
"dropdown-trigger":
|
|
146
|
-
k(a(
|
|
147
|
-
"end-icon":
|
|
148
|
-
|
|
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":
|
|
154
|
-
k(a(
|
|
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:
|
|
165
|
-
k(a(
|
|
171
|
+
default: K(({ option: e, index: r }) => [
|
|
172
|
+
k(a(z), {
|
|
166
173
|
option: e,
|
|
167
|
-
"selected-prop": a(p)(e) ? a(
|
|
168
|
-
"is-indeterminate": !a(
|
|
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:
|
|
180
|
-
onToggleTreeCollapse:
|
|
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) ? (
|
|
183
|
-
|
|
184
|
-
(
|
|
185
|
-
key: `${
|
|
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":
|
|
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:
|
|
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
|
-
[
|
|
207
|
+
[Z, d.value[e[o.optionUniqueIdKey]]]
|
|
201
208
|
])
|
|
202
|
-
])) :
|
|
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
|
-
|
|
216
|
+
me as default
|
|
210
217
|
};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.child-options[data-v-78ce1bbd]{padding-left:1rem}
|