@ironsource/shared-ui 2.1.11-test.92 → 2.1.11-test.99
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/Chart.vue_vue_type_style_index_0_scoped_04b9d6b3_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_b2684c5f_lang.css +1 -0
- package/EditableV4.vue_vue_type_style_index_0_scoped_e0c047b4_lang.css +1 -0
- package/IconFlag.vue_vue_type_style_index_0_scoped_7b09cc85_lang.css +1 -0
- package/SortableItem.vue_vue_type_style_index_0_scoped_7cb676f1_lang.css +1 -0
- package/SortableList.vue_vue_type_style_index_0_scoped_156c01ca_lang.css +1 -0
- package/TextField.vue_vue_type_style_index_0_scoped_2e327aa1_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_0_scoped_82b46d6d_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_1_lang.css +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css +1 -0
- package/Typography.vue_vue_type_style_index_0_scoped_a14013a5_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +0 -5
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +66 -69
- package/components/chart/index.d.ts +1 -20
- package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +8 -5
- package/components/dropdown/v4/ConditionalDropdown.vue.js +2 -2
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +89 -88
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +86 -86
- package/components/dropdown/v4/index.d.ts +12 -5
- package/components/icon/v4/IconFlag.vue.js +3 -3
- package/components/icon/v4/IconFlag.vue2.js +1 -1
- package/components/input/v4/TextField.vue.js +3 -3
- package/components/input/v4/TextField.vue2.js +164 -184
- package/components/sortableList/SortableItem.vue.d.ts +0 -5
- package/components/sortableList/SortableItem.vue.js +3 -3
- package/components/sortableList/SortableItem.vue2.js +65 -80
- package/components/sortableList/SortableList.vue.d.ts +0 -16
- package/components/sortableList/SortableList.vue.js +3 -3
- package/components/sortableList/SortableList.vue2.js +87 -100
- package/components/sortableList/index.d.ts +1 -59
- package/components/table/v4/DataGrid.vue.d.ts +1 -1
- package/components/table/v4/MultipleDataGrid.vue.d.ts +1 -1
- package/components/table/v4/index.d.ts +40 -40
- package/components/table-cells/common/Editable.common.js +7 -8
- package/components/table-cells/common/EditableContext.d.ts +0 -1
- package/components/table-cells/v4/EditableV4.vue.d.ts +0 -5
- package/components/table-cells/v4/EditableV4.vue.js +3 -3
- package/components/table-cells/v4/EditableV4.vue2.js +10 -11
- package/components/table-cells/v4/index.d.ts +1 -20
- package/components/tooltip/v4/TooltipV4.vue.js +3 -3
- package/components/tooltip/v4/TooltipV4.vue2.js +1 -1
- package/components/typography/v4/Typography.vue.js +4 -4
- package/components/typography/v4/Typography.vue2.js +1 -1
- package/index.d.ts +108 -248
- package/index.js +1 -1
- package/package.json +1 -1
- package/testids/index.d.ts +0 -1
- package/testids/index.js +13 -13
- package/Chart.vue_vue_type_style_index_0_scoped_277fde76_lang.css +0 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_2ba23450_lang.css +0 -1
- package/EditableV4.vue_vue_type_style_index_0_scoped_1bbe222a_lang.css +0 -1
- package/IconFlag.vue_vue_type_style_index_0_scoped_be9dc7bb_lang.css +0 -1
- package/SortableItem.vue_vue_type_style_index_0_scoped_2ca7b24c_lang.css +0 -1
- package/SortableList.vue_vue_type_style_index_0_scoped_8f267f88_lang.css +0 -1
- package/TextField.vue_vue_type_style_index_0_scoped_fce3948c_lang.css +0 -1
- package/TooltipV4.vue_vue_type_style_index_0_scoped_66eab856_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
- package/Typography.vue_vue_type_style_index_0_scoped_5714d43e_lang.css +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import "../../../ConditionalDropdown.
|
|
1
|
+
import "../../../ConditionalDropdown.vue_vue_type_style_index_0_scoped_b2684c5f_lang.css"; import { defineComponent as $, computed as O, ref as s, watch as C, onMounted as j, openBlock as L, createBlock as W, unref as d, withCtx as f, createVNode as y, mergeProps as q, createElementVNode as G, isRef as H, normalizeProps as J, guardReactiveProps as X, createElementBlock as Y, createTextVNode as Z, toDisplayString as _, createCommentVNode as ee } from "vue";
|
|
2
2
|
import N from "./DropdownV4.vue.js";
|
|
3
3
|
import "./DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "./IconButtonDropdownTrigger.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import le from "./ChipDropdownTrigger.vue.js";
|
|
6
6
|
import "./AppDropdownTrigger.vue.js";
|
|
7
|
-
import
|
|
7
|
+
import oe from "./ButtonDropdownTrigger.vue.js";
|
|
8
8
|
import "./ButtonFilterDropdownTrigger.vue.js";
|
|
9
9
|
import "./TreeDropdown.vue.js";
|
|
10
10
|
import "./OptionV4.vue.js";
|
|
11
11
|
import "./ConditionalDropdown.vue.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { useDebounceFn as
|
|
15
|
-
const
|
|
12
|
+
import ae from "../../search/v4/SearchV4.vue.js";
|
|
13
|
+
import te from "../../typography/v4/Typography.vue.js";
|
|
14
|
+
import { useDebounceFn as ne } from "@vueuse/core";
|
|
15
|
+
const ie = { class: "conditional-container" }, ue = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "custom-list-area"
|
|
18
|
-
},
|
|
18
|
+
}, ke = /* @__PURE__ */ $({
|
|
19
19
|
__name: "ConditionalDropdown",
|
|
20
20
|
props: {
|
|
21
21
|
selectedCondition: null,
|
|
@@ -37,49 +37,50 @@ const ue = { class: "conditional-container" }, re = {
|
|
|
37
37
|
optionFlagKey: { default: "" },
|
|
38
38
|
optionIconKey: { default: "" },
|
|
39
39
|
optionImageKey: { default: "" },
|
|
40
|
-
optionIconType: { default: null }
|
|
40
|
+
optionIconType: { default: null },
|
|
41
|
+
loadingOverride: { type: Boolean, default: !1 }
|
|
41
42
|
},
|
|
42
|
-
emits: ["update:selectedCondition", "update:appliedSelections", "clear"
|
|
43
|
-
setup(
|
|
44
|
-
const e =
|
|
43
|
+
emits: ["update:selectedCondition", "update:appliedSelections", "clear"],
|
|
44
|
+
setup(u, { emit: k }) {
|
|
45
|
+
const e = u, h = O({
|
|
45
46
|
get: () => e.appliedSelections,
|
|
46
47
|
set: (l) => {
|
|
47
|
-
|
|
48
|
+
k("update:appliedSelections", l);
|
|
48
49
|
}
|
|
49
|
-
}), n =
|
|
50
|
+
}), n = O({
|
|
50
51
|
get: () => e.selectedCondition || e.conditionalOptions[0],
|
|
51
52
|
set: (l) => {
|
|
52
|
-
|
|
53
|
+
k("update:selectedCondition", l);
|
|
53
54
|
}
|
|
54
|
-
}), w = s(null), c = s(!0), a = s([]),
|
|
55
|
-
Array.isArray(e.appliedSelections) ? e.appliedSelections : [e.appliedSelections]
|
|
56
|
-
), K = s(!0), p = s(!1),
|
|
55
|
+
}), w = s(null), c = s(!0), a = s([]), r = s(
|
|
56
|
+
Array.isArray(e.appliedSelections) ? e.appliedSelections : e.appliedSelections ? [e.appliedSelections] : []
|
|
57
|
+
), K = s(!0), p = s(!1), S = s(!1), i = s(e.searchQuery), F = s(""), m = s(e.label), T = s([]), B = O(() => (!i.value || i.value?.length < e.minCharsToStart) && !a.value.length ? `Enter at least ${e.minCharsToStart} keywords to begin` : "No results found"), U = O(() => {
|
|
57
58
|
const l = c.value ? 4 : 4.5, t = a.value.length > 4 ? a.value.length : l;
|
|
58
59
|
if (e.groupedOptions) {
|
|
59
60
|
let o = 0;
|
|
60
|
-
return a.value.forEach((
|
|
61
|
-
|
|
61
|
+
return a.value.forEach((g) => {
|
|
62
|
+
g.options && (o = o + g.options.length);
|
|
62
63
|
}), o > 4 ? o : l;
|
|
63
64
|
}
|
|
64
65
|
return t > l ? t : l;
|
|
65
|
-
}),
|
|
66
|
-
if (e.infiniteLoading && n.value.multi && Array.isArray(
|
|
67
|
-
const o = [],
|
|
66
|
+
}), I = (l, t) => {
|
|
67
|
+
if (e.infiniteLoading && n.value.multi && Array.isArray(r.value) && r.value.length && l && t.length) {
|
|
68
|
+
const o = [], g = r.value.filter(
|
|
68
69
|
(v) => v[e.optionNameKey].includes(l)
|
|
69
70
|
);
|
|
70
71
|
return t.forEach((v) => {
|
|
71
|
-
|
|
72
|
-
(
|
|
72
|
+
g.find(
|
|
73
|
+
(z) => z[e.comparingKey] === v[e.comparingKey]
|
|
73
74
|
) && o.push(v[e.comparingKey]);
|
|
74
|
-
}),
|
|
75
|
+
}), g.filter(
|
|
75
76
|
(v) => !o.includes(v[e.comparingKey])
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
79
|
return [];
|
|
79
|
-
},
|
|
80
|
+
}, A = async (l) => {
|
|
80
81
|
try {
|
|
81
82
|
p.value = !0;
|
|
82
|
-
const t = await e.fetchFnCallback(l), o =
|
|
83
|
+
const t = await e.fetchFnCallback(l), o = I(
|
|
83
84
|
l,
|
|
84
85
|
t
|
|
85
86
|
);
|
|
@@ -90,16 +91,16 @@ const ue = { class: "conditional-container" }, re = {
|
|
|
90
91
|
}, M = async () => {
|
|
91
92
|
if (e.infiniteLoading)
|
|
92
93
|
try {
|
|
93
|
-
|
|
94
|
+
S.value = !0;
|
|
94
95
|
const l = await e.loadMoreFn();
|
|
95
|
-
|
|
96
|
+
S.value = !1, Array.isArray(l) && (a.value = [...a.value, ...l]);
|
|
96
97
|
} catch (l) {
|
|
97
|
-
|
|
98
|
+
S.value = !1, console.error("Error fetching data:", l);
|
|
98
99
|
}
|
|
99
|
-
}, E =
|
|
100
|
-
|
|
100
|
+
}, E = ne(
|
|
101
|
+
A,
|
|
101
102
|
e.fetchDataDebounceTime
|
|
102
|
-
),
|
|
103
|
+
), b = (l) => {
|
|
103
104
|
l.length >= e.minCharsToStart ? (E(l), w.value?.scrollTo(0)) : e.infiniteLoading && n.value.multi ? a.value = T.value || [] : a.value = [];
|
|
104
105
|
}, V = () => {
|
|
105
106
|
i.value && a.value.length && !p.value && !n.value.multi ? a.value[0].conditionalOptions ? a.value[0] = {
|
|
@@ -116,124 +117,124 @@ const ue = { class: "conditional-container" }, re = {
|
|
|
116
117
|
},
|
|
117
118
|
...a.value
|
|
118
119
|
] : a.value.length && a.value[0].conditionalOptions && a.value.shift();
|
|
119
|
-
},
|
|
120
|
-
c.value &&
|
|
120
|
+
}, D = () => {
|
|
121
|
+
c.value && r.value.length === 0 ? m.value = e.label : m.value = `${e.label} ${n.value.label.toLowerCase()}`;
|
|
121
122
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}),
|
|
123
|
+
C(i, () => {
|
|
124
|
+
b(i.value);
|
|
125
|
+
}), C([n, a], () => {
|
|
125
126
|
V();
|
|
126
|
-
})
|
|
127
|
+
}), C(
|
|
128
|
+
() => e.loadingOverride,
|
|
129
|
+
(l, t) => {
|
|
130
|
+
!l && t && !e.infiniteLoading && A(e.searchQuery);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
127
133
|
const x = () => {
|
|
128
|
-
c.value &&
|
|
134
|
+
c.value && r.value.length === 0 ? (n.value = null, h.value = [], n.value = null) : (F.value = i.value, h.value = c.value ? [...r.value] : { ...r.value }, K.value = c.value), D();
|
|
129
135
|
};
|
|
130
|
-
|
|
131
|
-
n.value.multi ? (p.value = !0, !t.multi && l.multi && Array.isArray(e.appliedSelections) && (
|
|
136
|
+
C(n, (l, t) => {
|
|
137
|
+
n.value.multi ? (p.value = !0, !t.multi && l.multi && Array.isArray(e.appliedSelections) && (r.value = e.appliedSelections), setTimeout(() => {
|
|
132
138
|
p.value = !1, c.value = !0;
|
|
133
139
|
}, 100)) : setTimeout(() => {
|
|
134
140
|
c.value = !1;
|
|
135
141
|
}, 100);
|
|
136
142
|
});
|
|
137
|
-
const
|
|
143
|
+
const Q = (l) => {
|
|
138
144
|
T.value = l;
|
|
139
|
-
},
|
|
140
|
-
|
|
145
|
+
}, P = () => {
|
|
146
|
+
r.value = [], h.value = [], n.value = null, m.value = e.label, i.value = "", k("clear");
|
|
141
147
|
}, R = (l) => {
|
|
142
|
-
l && n.value.multi && e.infiniteLoading &&
|
|
143
|
-
};
|
|
144
|
-
W(() => {
|
|
145
|
-
(e.searchQuery || !e.infiniteLoading) && C(e.searchQuery), A();
|
|
146
|
-
});
|
|
147
|
-
const z = () => {
|
|
148
|
-
h("closed");
|
|
148
|
+
l && n.value.multi && e.infiniteLoading && r.value && (a.value = r.value, i.value && b(i.value));
|
|
149
149
|
};
|
|
150
|
-
return (
|
|
150
|
+
return j(() => {
|
|
151
|
+
(e.searchQuery || !e.infiniteLoading || e.minCharsToStart === 0) && b(e.searchQuery), D();
|
|
152
|
+
}), (l, t) => (L(), W(d(N), {
|
|
151
153
|
ref_key: "dropdownRef",
|
|
152
154
|
ref: w,
|
|
153
|
-
selected:
|
|
154
|
-
"onUpdate:selected": t[2] || (t[2] = (o) =>
|
|
155
|
+
selected: r.value,
|
|
156
|
+
"onUpdate:selected": t[2] || (t[2] = (o) => r.value = o),
|
|
155
157
|
"predefined-trigger": "chip",
|
|
156
|
-
"display-value": (o) => o?.[
|
|
158
|
+
"display-value": (o) => o?.[u.optionNameKey],
|
|
157
159
|
multi: c.value,
|
|
158
160
|
options: a.value,
|
|
159
161
|
placeholder: m.value,
|
|
160
162
|
"search-placeholder": "Search",
|
|
161
|
-
"option-name-key":
|
|
163
|
+
"option-name-key": u.optionNameKey,
|
|
162
164
|
"with-conditions": "",
|
|
163
165
|
"inline-search": "",
|
|
164
166
|
"custom-number-of-displayed-options": d(U),
|
|
165
167
|
"options-list-width": "330px",
|
|
166
|
-
loading: p.value,
|
|
167
|
-
"load-more-loading":
|
|
168
|
-
"comparing-key":
|
|
169
|
-
"is-open":
|
|
170
|
-
"infinite-loading":
|
|
171
|
-
"show-select-all": !
|
|
172
|
-
"grouped-options":
|
|
173
|
-
"option-flag-key":
|
|
174
|
-
"option-image-key":
|
|
175
|
-
"option-icon-key":
|
|
176
|
-
"option-icon-type":
|
|
168
|
+
loading: p.value || u.loadingOverride,
|
|
169
|
+
"load-more-loading": S.value,
|
|
170
|
+
"comparing-key": u.comparingKey,
|
|
171
|
+
"is-open": u.isOpen,
|
|
172
|
+
"infinite-loading": u.infiniteLoading,
|
|
173
|
+
"show-select-all": !u.infiniteLoading && !i.value,
|
|
174
|
+
"grouped-options": u.groupedOptions,
|
|
175
|
+
"option-flag-key": u.optionFlagKey,
|
|
176
|
+
"option-image-key": u.optionImageKey,
|
|
177
|
+
"option-icon-key": u.optionIconKey,
|
|
178
|
+
"option-icon-type": u.optionIconType,
|
|
177
179
|
"onUpdate:isOpen": R,
|
|
178
|
-
onOnsearch:
|
|
180
|
+
onOnsearch: b,
|
|
179
181
|
onApply: x,
|
|
180
182
|
onLoadMore: M,
|
|
181
|
-
onUnsavedSelectionUpdate:
|
|
182
|
-
onClosed: z
|
|
183
|
+
onUnsavedSelectionUpdate: Q
|
|
183
184
|
}, {
|
|
184
185
|
"dropdown-trigger": f(({ defaultTriggerProps: o }) => [
|
|
185
|
-
|
|
186
|
+
y(d(le), q(o, {
|
|
186
187
|
label: m.value,
|
|
187
|
-
"selected-option": d(
|
|
188
|
+
"selected-option": d(h),
|
|
188
189
|
multi: K.value,
|
|
189
190
|
"cancel-all-selected-display": "",
|
|
190
|
-
"display-value-in-quotes": !Array.isArray(
|
|
191
|
-
onClear:
|
|
191
|
+
"display-value-in-quotes": !Array.isArray(r.value) && r.value.conditionalOptions,
|
|
192
|
+
onClear: P
|
|
192
193
|
}), null, 16, ["label", "selected-option", "multi", "display-value-in-quotes"])
|
|
193
194
|
]),
|
|
194
195
|
"dropdown-conditions": f(() => [
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
G("div", ie, [
|
|
197
|
+
y(d(N), {
|
|
197
198
|
selected: d(n),
|
|
198
|
-
"onUpdate:selected": t[0] || (t[0] = (o) =>
|
|
199
|
-
options:
|
|
199
|
+
"onUpdate:selected": t[0] || (t[0] = (o) => H(n) ? n.value = o : null),
|
|
200
|
+
options: u.conditionalOptions,
|
|
200
201
|
"option-name-key": "label",
|
|
201
202
|
"display-value": (o) => o?.label,
|
|
202
203
|
container: ".conditional-container",
|
|
203
204
|
size: "small"
|
|
204
205
|
}, {
|
|
205
206
|
"dropdown-trigger": f(({ buttonTriggerProps: o }) => [
|
|
206
|
-
|
|
207
|
+
y(d(oe), J(X(o)), null, 16)
|
|
207
208
|
]),
|
|
208
209
|
_: 1
|
|
209
210
|
}, 8, ["selected", "options", "display-value"])
|
|
210
211
|
])
|
|
211
212
|
]),
|
|
212
213
|
"inline-search": f(() => [
|
|
213
|
-
|
|
214
|
+
y(d(ae), {
|
|
214
215
|
modelValue: i.value,
|
|
215
216
|
"onUpdate:modelValue": t[1] || (t[1] = (o) => i.value = o),
|
|
216
217
|
class: "inline-search",
|
|
217
218
|
placeholder: "Search",
|
|
218
219
|
variant: "transparent",
|
|
219
220
|
size: "md",
|
|
220
|
-
"auto-focus":
|
|
221
|
+
"auto-focus": u.autoFocusSearch
|
|
221
222
|
}, null, 8, ["modelValue", "auto-focus"])
|
|
222
223
|
]),
|
|
223
224
|
"custom-list-area": f(() => [
|
|
224
|
-
!a.value.length && !p.value ? (
|
|
225
|
-
|
|
225
|
+
!a.value.length && !p.value ? (L(), Y("div", ue, [
|
|
226
|
+
y(te, { variant: "body1" }, {
|
|
226
227
|
default: f(() => [
|
|
227
|
-
_(
|
|
228
|
+
Z(_(d(B)), 1)
|
|
228
229
|
]),
|
|
229
230
|
_: 1
|
|
230
231
|
})
|
|
231
|
-
])) :
|
|
232
|
+
])) : ee("", !0)
|
|
232
233
|
]),
|
|
233
234
|
_: 1
|
|
234
235
|
}, 8, ["selected", "display-value", "multi", "options", "placeholder", "option-name-key", "custom-number-of-displayed-options", "loading", "load-more-loading", "comparing-key", "is-open", "infinite-loading", "show-select-all", "grouped-options", "option-flag-key", "option-image-key", "option-icon-key", "option-icon-type"]));
|
|
235
236
|
}
|
|
236
237
|
});
|
|
237
238
|
export {
|
|
238
|
-
|
|
239
|
+
ke as default
|
|
239
240
|
};
|
|
@@ -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_bdfb0aef_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-bdfb0aef"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../TreeDropdown.
|
|
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
2
|
import ue from "./DropdownV4.vue.js";
|
|
3
3
|
import pe from "./DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "./IconButtonDropdownTrigger.vue.js";
|
|
@@ -7,11 +7,11 @@ import "./AppDropdownTrigger.vue.js";
|
|
|
7
7
|
import "./ButtonDropdownTrigger.vue.js";
|
|
8
8
|
import "./ButtonFilterDropdownTrigger.vue.js";
|
|
9
9
|
import "./TreeDropdown.vue.js";
|
|
10
|
-
import
|
|
10
|
+
import S from "./OptionV4.vue.js";
|
|
11
11
|
import "./ConditionalDropdown.vue.js";
|
|
12
12
|
import { useChildOptions as ye } from "../composables/useChildOptions.js";
|
|
13
|
-
import
|
|
14
|
-
import { useTestIdAttrs as
|
|
13
|
+
import he from "../../search/v4/SearchV4.vue.js";
|
|
14
|
+
import { useTestIdAttrs as fe } from "../../../utils/testIds.js";
|
|
15
15
|
import { DropdownTestIdModifiers as $ } from "../../../testids/index.js";
|
|
16
16
|
const ve = {
|
|
17
17
|
key: 0,
|
|
@@ -43,18 +43,18 @@ const ve = {
|
|
|
43
43
|
},
|
|
44
44
|
emits: ["update:selected", "update:isOpen"],
|
|
45
45
|
setup(t, { emit: b }) {
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
const m = c([]), u = c([]), T = c({}),
|
|
46
|
+
const l = t;
|
|
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
|
-
}), o[
|
|
51
|
-
|
|
52
|
-
e[
|
|
53
|
-
...e[
|
|
50
|
+
}), o[l.optionChildrenKey] || (e = e + 1), e), 0)), U = () => {
|
|
51
|
+
l.options.forEach((e) => {
|
|
52
|
+
e[l.optionChildrenKey] && e[l.optionChildrenKey].length && (T.value[e[l.optionUniqueIdKey]] = [
|
|
53
|
+
...e[l.optionChildrenKey]
|
|
54
54
|
]);
|
|
55
|
-
}), m.value = [...
|
|
56
|
-
}, { hasChildren:
|
|
57
|
-
if (
|
|
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
|
+
if (f(e)) {
|
|
58
58
|
k(e) ? i.value = i.value.filter(
|
|
59
59
|
(o) => !v(e).includes(o)
|
|
60
60
|
) : i.value = [
|
|
@@ -66,72 +66,72 @@ const ve = {
|
|
|
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),
|
|
69
|
+
}, A = (e) => i.value.includes(e), j = (e) => 1 + (f(e) ? v(e).length : 0), F = () => {
|
|
70
70
|
b("update:selected", i.value), L.value = y.value;
|
|
71
|
-
}, F = () => {
|
|
72
|
-
i.value = [];
|
|
73
71
|
}, G = () => {
|
|
72
|
+
i.value = [];
|
|
73
|
+
}, H = () => {
|
|
74
74
|
const e = /* @__PURE__ */ new Set([]);
|
|
75
|
-
u.value.forEach((
|
|
76
|
-
if (
|
|
77
|
-
e.add(
|
|
78
|
-
else if (l
|
|
79
|
-
for (const
|
|
80
|
-
if (
|
|
81
|
-
e.add(
|
|
75
|
+
u.value.forEach((n) => {
|
|
76
|
+
if (l.selected?.includes(n))
|
|
77
|
+
e.add(n);
|
|
78
|
+
else if (n[l.optionChildrenKey] && n[l.optionChildrenKey].length) {
|
|
79
|
+
for (const s of n[l.optionChildrenKey])
|
|
80
|
+
if (l.selected?.includes(s)) {
|
|
81
|
+
e.add(n);
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
const o = Array.from(e);
|
|
87
|
-
return u.value.forEach((
|
|
88
|
-
!
|
|
87
|
+
return u.value.forEach((n) => {
|
|
88
|
+
!l.selected.includes(n) && !e.has(n) && o.push(n);
|
|
89
89
|
}), o;
|
|
90
90
|
};
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
ne(() => {
|
|
92
|
+
x.value || (U(), x.value = !0, l.preExpandedOptions && l.preExpandedOptions.forEach((e) => {
|
|
93
93
|
a.value[e] = 1;
|
|
94
94
|
}));
|
|
95
95
|
}), g(
|
|
96
|
-
() =>
|
|
96
|
+
() => l.options,
|
|
97
97
|
() => {
|
|
98
98
|
U();
|
|
99
99
|
}
|
|
100
100
|
), g(
|
|
101
|
-
() =>
|
|
102
|
-
(
|
|
103
|
-
|
|
101
|
+
() => l.selected,
|
|
102
|
+
() => {
|
|
103
|
+
i.value = [...l.selected];
|
|
104
104
|
}
|
|
105
105
|
);
|
|
106
|
-
const y = K(() => i.value.length < N.value ? !1 : i.value.length === N.value),
|
|
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
107
|
g(
|
|
108
|
-
() =>
|
|
108
|
+
() => l.isOpen,
|
|
109
109
|
() => {
|
|
110
|
-
|
|
110
|
+
l.isOpen ? m.value = H() : (i.value = [...l.selected], p.value = "");
|
|
111
111
|
}
|
|
112
112
|
);
|
|
113
113
|
const a = c({}), Q = (e) => {
|
|
114
|
-
a.value[e[
|
|
114
|
+
a.value[e[l.optionUniqueIdKey]] ? delete a.value[e[l.optionUniqueIdKey]] : a.value[e[l.optionUniqueIdKey]] = 1;
|
|
115
115
|
};
|
|
116
116
|
function R(e, o) {
|
|
117
|
-
const
|
|
118
|
-
return o.value.forEach((
|
|
119
|
-
const E =
|
|
120
|
-
(_) => _[
|
|
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)
|
|
121
121
|
) || [];
|
|
122
|
-
(E || V.length > 0) && (
|
|
123
|
-
}),
|
|
122
|
+
(E || V.length > 0) && (r[l.optionChildrenKey] = V, s.push(r));
|
|
123
|
+
}), s;
|
|
124
124
|
}
|
|
125
125
|
const W = (e) => {
|
|
126
126
|
const o = R(e, u);
|
|
127
|
-
e && (Object.keys(a.value).forEach((
|
|
128
|
-
delete a.value[
|
|
129
|
-
}), o.forEach((
|
|
130
|
-
Array.isArray(l
|
|
127
|
+
e && (Object.keys(a.value).forEach((n) => {
|
|
128
|
+
delete a.value[n];
|
|
129
|
+
}), o.forEach((n) => {
|
|
130
|
+
Array.isArray(n[l.optionChildrenKey]) && n[l.optionChildrenKey].length && (a.value[n[l.optionUniqueIdKey]] = 1);
|
|
131
131
|
})), m.value = o;
|
|
132
132
|
}, X = K(() => {
|
|
133
|
-
const e =
|
|
134
|
-
(
|
|
133
|
+
const e = l.options.length, o = l.options.reduce(
|
|
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;
|
|
@@ -139,22 +139,22 @@ const ve = {
|
|
|
139
139
|
g(
|
|
140
140
|
() => p.value,
|
|
141
141
|
() => {
|
|
142
|
-
W(p.value),
|
|
142
|
+
W(p.value), O.value = !p.value;
|
|
143
143
|
}
|
|
144
144
|
);
|
|
145
145
|
const Y = () => {
|
|
146
146
|
y.value ? i.value = [] : (i.value = [], u.value.forEach((e) => {
|
|
147
|
-
if (e[
|
|
148
|
-
for (const o of e[
|
|
147
|
+
if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length)
|
|
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
152
|
}));
|
|
153
|
-
}, Z =
|
|
153
|
+
}, Z = fe(l.testId, $);
|
|
154
154
|
return (e, o) => (C(), D(d(ue), {
|
|
155
155
|
multi: "",
|
|
156
156
|
class: "tree-dropdown",
|
|
157
|
-
"show-select-all":
|
|
157
|
+
"show-select-all": O.value,
|
|
158
158
|
"is-open": t.isOpen,
|
|
159
159
|
options: m.value,
|
|
160
160
|
selected: t.selected,
|
|
@@ -167,32 +167,32 @@ const ve = {
|
|
|
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
173
|
"custom-number-of-displayed-options": d(X),
|
|
174
|
-
"onUpdate:isOpen": o[2] || (o[2] = (
|
|
175
|
-
onApply:
|
|
176
|
-
onClear:
|
|
174
|
+
"onUpdate:isOpen": o[2] || (o[2] = (n) => b("update:isOpen", n)),
|
|
175
|
+
onApply: F,
|
|
176
|
+
onClear: G
|
|
177
177
|
}, {
|
|
178
|
-
"dropdown-trigger":
|
|
179
|
-
I(d(pe), z(
|
|
178
|
+
"dropdown-trigger": h(({ defaultTriggerProps: n }) => [
|
|
179
|
+
I(d(pe), z(n, {
|
|
180
180
|
"all-selected": L.value,
|
|
181
181
|
"show-all-selected-text": ""
|
|
182
182
|
}), te({ _: 2 }, [
|
|
183
183
|
e.$slots["trigger-end-icon"] ? {
|
|
184
184
|
name: "end-icon",
|
|
185
|
-
fn:
|
|
185
|
+
fn: h(() => [
|
|
186
186
|
oe(e.$slots, "trigger-end-icon", {}, void 0, !0)
|
|
187
187
|
]),
|
|
188
188
|
key: "0"
|
|
189
189
|
} : void 0
|
|
190
190
|
]), 1040, ["all-selected"])
|
|
191
191
|
]),
|
|
192
|
-
"inline-search":
|
|
193
|
-
I(d(
|
|
192
|
+
"inline-search": h(() => [
|
|
193
|
+
I(d(he), {
|
|
194
194
|
modelValue: p.value,
|
|
195
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
195
|
+
"onUpdate:modelValue": o[0] || (o[0] = (n) => p.value = n),
|
|
196
196
|
class: "tree-search",
|
|
197
197
|
placeholder: t.inlineSearchPlaceholder,
|
|
198
198
|
variant: "transparent",
|
|
@@ -201,31 +201,31 @@ const ve = {
|
|
|
201
201
|
"test-id": t.testId
|
|
202
202
|
}, null, 8, ["modelValue", "placeholder", "test-id"])
|
|
203
203
|
]),
|
|
204
|
-
"select-all":
|
|
204
|
+
"select-all": h(() => [
|
|
205
205
|
M("li", null, [
|
|
206
|
-
I(d(
|
|
206
|
+
I(d(S), z({
|
|
207
207
|
"aria-selected": d(y),
|
|
208
208
|
"aria-disabled": !!t.disabled,
|
|
209
209
|
"selected-prop": d(y),
|
|
210
|
-
"is-indeterminate": d(
|
|
210
|
+
"is-indeterminate": d(J),
|
|
211
211
|
"is-multi": "",
|
|
212
212
|
"select-all-option": ""
|
|
213
213
|
}, d(Z)[d($).SELECT_ALL], {
|
|
214
|
-
onClick: o[1] || (o[1] =
|
|
214
|
+
onClick: o[1] || (o[1] = w((n) => Y(), ["stop"]))
|
|
215
215
|
}), {
|
|
216
|
-
default:
|
|
216
|
+
default: h(() => [
|
|
217
217
|
ie(" Select all ")
|
|
218
218
|
]),
|
|
219
219
|
_: 1
|
|
220
220
|
}, 16, ["aria-selected", "aria-disabled", "selected-prop", "is-indeterminate"])
|
|
221
221
|
])
|
|
222
222
|
]),
|
|
223
|
-
default:
|
|
224
|
-
I(d(
|
|
225
|
-
option:
|
|
226
|
-
"selected-prop": d(
|
|
227
|
-
"is-indeterminate": !d(k)(
|
|
228
|
-
disabled:
|
|
223
|
+
default: h(({ option: n, index: s }) => [
|
|
224
|
+
I(d(S), {
|
|
225
|
+
option: n,
|
|
226
|
+
"selected-prop": d(f)(n) ? d(k)(n) : A(n),
|
|
227
|
+
"is-indeterminate": !d(k)(n) && d(P)(n),
|
|
228
|
+
disabled: n[t.disabledOptionKey],
|
|
229
229
|
"name-key": t.optionNameKey,
|
|
230
230
|
"image-key": t.optionImageKey,
|
|
231
231
|
"icon-key": t.optionIconKey,
|
|
@@ -233,20 +233,20 @@ const ve = {
|
|
|
233
233
|
"end-icon-key": t.optionEndIconKey,
|
|
234
234
|
"end-icon-type": t.optionEndIconType,
|
|
235
235
|
"end-text-icon-key": t.optionEndTextIconKey,
|
|
236
|
-
"tree-main-option": d(
|
|
237
|
-
"tree-main-option-expanded": a.value[
|
|
236
|
+
"tree-main-option": d(f)(n),
|
|
237
|
+
"tree-main-option-expanded": a.value[n[t.optionUniqueIdKey]],
|
|
238
238
|
"stop-option-click-event-propagation": "",
|
|
239
239
|
"is-multi": "",
|
|
240
|
-
onClick:
|
|
240
|
+
onClick: w(() => q(n), ["stop"]),
|
|
241
241
|
onToggleTreeCollapse: Q
|
|
242
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"]),
|
|
243
|
-
d(
|
|
243
|
+
d(f)(n) ? (C(), B("div", ve, [
|
|
244
244
|
de(M("div", null, [
|
|
245
|
-
(C(!0), B(ae, null,
|
|
246
|
-
key: `${
|
|
247
|
-
option:
|
|
248
|
-
"selected-prop": A(
|
|
249
|
-
disabled:
|
|
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],
|
|
250
250
|
"name-key": t.optionNameKey,
|
|
251
251
|
"image-key": t.optionImageKey,
|
|
252
252
|
"icon-key": t.optionIconKey,
|
|
@@ -254,13 +254,13 @@ const ve = {
|
|
|
254
254
|
"end-icon-key": t.optionEndIconKey,
|
|
255
255
|
"end-icon-type": t.optionEndIconType,
|
|
256
256
|
"end-text-icon-key": t.optionEndTextIconKey,
|
|
257
|
-
"tree-child-shown": a.value[
|
|
257
|
+
"tree-child-shown": a.value[n[t.optionUniqueIdKey]],
|
|
258
258
|
"stop-option-click-event-propagation": "",
|
|
259
259
|
"is-multi": "",
|
|
260
|
-
onClick:
|
|
260
|
+
onClick: w(() => q(r), ["stop"])
|
|
261
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))
|
|
262
262
|
], 512), [
|
|
263
|
-
[
|
|
263
|
+
[re, a.value[n[t.optionUniqueIdKey]]]
|
|
264
264
|
])
|
|
265
265
|
])) : ce("", !0)
|
|
266
266
|
]),
|