@ironsource/shared-ui 2.1.6-rc.37 → 2.1.6-rc.39
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/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_7af4f288_lang.css +1 -0
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +1 -0
- package/components/dropdown/common/Dropdown.common.js +54 -51
- package/components/dropdown/composables/useChildOptions.js +5 -5
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +5 -0
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +22 -21
- package/components/dropdown/v4/DropdownV4.vue.d.ts +10 -0
- package/components/dropdown/v4/DropdownV4.vue.js +2 -2
- package/components/dropdown/v4/DropdownV4.vue2.js +45 -42
- package/components/dropdown/v4/TreeDropdown.vue.d.ts +15 -0
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +53 -46
- package/components/dropdown/v4/index.d.ts +86 -2
- package/index.d.ts +172 -4
- package/package.json +1 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_ad524750_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_b484da34_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_4492426c_lang.css +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import "../../../DropdownV4.
|
|
2
|
-
import
|
|
1
|
+
import "../../../DropdownV4.vue_vue_type_style_index_0_scoped_7af4f288_lang.css"; import "../../../DropdownV4.vue_vue_type_style_index_1_lang.css"; import { defineComponent as se, computed as x, openBlock as i, createElementBlock as n, mergeProps as u, unref as e, renderSlot as v, createElementVNode as p, createVNode as a, withCtx as c, Transition as ue, normalizeClass as A, normalizeStyle as ce, isRef as fe, createCommentVNode as r, createTextVNode as g, toDisplayString as ye, withModifiers as $, Fragment as pe, renderList as me, toRaw as h, createBlock as H, resolveDynamicComponent as ge } from "vue";
|
|
2
|
+
import O from "../../button/v4/ButtonV4.vue.js";
|
|
3
3
|
import "../../button/v4/IconButtonV4.vue.js";
|
|
4
4
|
import "./DropdownV4.vue.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import Te from "./DefaultDropdownTrigger.vue.js";
|
|
6
|
+
import ke from "./IconButtonDropdownTrigger.vue.js";
|
|
7
7
|
import be from "./ChipDropdownTrigger.vue.js";
|
|
8
8
|
import he from "./AppDropdownTrigger.vue.js";
|
|
9
9
|
import "./ButtonDropdownTrigger.vue.js";
|
|
10
10
|
import "./ButtonFilterDropdownTrigger.vue.js";
|
|
11
11
|
import "./TreeDropdown.vue.js";
|
|
12
12
|
import U from "./OptionV4.vue.js";
|
|
13
|
-
import
|
|
13
|
+
import we from "../../search/v4/SearchV4.vue.js";
|
|
14
14
|
import W from "../../typography/v4/Typography.vue.js";
|
|
15
|
-
import { Dropdown as
|
|
15
|
+
import { Dropdown as Ie } from "floating-vue";
|
|
16
16
|
import { DropdownTestIdModifiers as f } from "../../../testids/index.js";
|
|
17
|
-
import { dropdownCommon as
|
|
17
|
+
import { dropdownCommon as ve } from "../common/Dropdown.common.js";
|
|
18
18
|
import Ce from "../../loader/v4/Loader.vue.js";
|
|
19
19
|
import { useTestIdAttrs as Se } from "../../../utils/testIds.js";
|
|
20
20
|
import { TRIGGERS as m } from "./Dropdown.types.js";
|
|
21
21
|
import { useElementSize as Ae } from "@vueuse/core";
|
|
22
|
-
import
|
|
23
|
-
const
|
|
22
|
+
import Oe from "../../shared/FieldHelpText.vue.js";
|
|
23
|
+
const Le = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke = { key: 1 }, Ne = { key: 2 }, De = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "inline-search-wrapper"
|
|
26
26
|
}, Pe = {
|
|
@@ -61,6 +61,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
61
61
|
triggerFeedbackText: { default: "" },
|
|
62
62
|
triggerFeedbackVariant: { default: null },
|
|
63
63
|
triggerFeedbackShowIcon: { type: Boolean, default: !1 },
|
|
64
|
+
triggerShowAllSelectedText: { type: Boolean, default: !0 },
|
|
64
65
|
size: { default: "medium" },
|
|
65
66
|
mandatory: { type: Boolean, default: !1 },
|
|
66
67
|
predefinedTrigger: { default: m.DEFAULT },
|
|
@@ -83,10 +84,11 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
83
84
|
fullWidth: { type: Boolean, default: !0 },
|
|
84
85
|
optionsListWidth: { default: null },
|
|
85
86
|
statusType: { default: null },
|
|
86
|
-
disableVirtualScroll: { type: Boolean, default: !1 }
|
|
87
|
+
disableVirtualScroll: { type: Boolean, default: !1 },
|
|
88
|
+
overrideOptionCountCalculation: { type: Function, default: null }
|
|
87
89
|
},
|
|
88
90
|
emits: ["update:selected", "update:isOpen", "closed", "opened", "apply", "selectAll", "clear", "copyToClipboard"],
|
|
89
|
-
setup(t, { expose: M, emit:
|
|
91
|
+
setup(t, { expose: M, emit: L }) {
|
|
90
92
|
const d = t, E = {
|
|
91
93
|
MULTILINE_LIST_HEIGHT: 48,
|
|
92
94
|
LIST_HEIGHT: 32 + 4,
|
|
@@ -95,9 +97,9 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
95
97
|
DROPLIST_MIN_WIDTH: 240,
|
|
96
98
|
VERSION: 4
|
|
97
99
|
}, {
|
|
98
|
-
onKeydown:
|
|
100
|
+
onKeydown: T,
|
|
99
101
|
open: s,
|
|
100
|
-
toggleMenu:
|
|
102
|
+
toggleMenu: w,
|
|
101
103
|
onButtonKeydown: G,
|
|
102
104
|
query: C,
|
|
103
105
|
containerProps: X,
|
|
@@ -109,7 +111,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
109
111
|
onSelectAll: Q,
|
|
110
112
|
virtualOptions: K,
|
|
111
113
|
isSelected: S,
|
|
112
|
-
selectedOption:
|
|
114
|
+
selectedOption: k,
|
|
113
115
|
selectedOptionPrevious: N,
|
|
114
116
|
selectedValue: Z,
|
|
115
117
|
onSelect: D,
|
|
@@ -124,24 +126,24 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
124
126
|
el: ne,
|
|
125
127
|
onClearAllSelections: F,
|
|
126
128
|
clearAll: ae
|
|
127
|
-
} =
|
|
128
|
-
|
|
129
|
+
} = ve(d, L, E), y = Se(d.testId, f), V = x(() => !d.predefinedTrigger || d.predefinedTrigger === m.DEFAULT ? Te : d.predefinedTrigger === m.APP ? he : null), { width: z } = Ae(R), de = x(() => d.optionsListWidth ? d.optionsListWidth : !d.predefinedTrigger || d.predefinedTrigger === m.DEFAULT || d.predefinedTrigger === m.APP ? z.value - 2 > 240 ? `${z.value - 2}px` : `${E.DROPLIST_MIN_WIDTH}px` : "auto"), re = () => {
|
|
130
|
+
w();
|
|
129
131
|
};
|
|
130
132
|
return M({
|
|
131
133
|
selectItem: D,
|
|
132
134
|
scrollTo: te
|
|
133
|
-
}), (
|
|
135
|
+
}), (I, o) => (i(), n("div", u({
|
|
134
136
|
ref_key: "el",
|
|
135
137
|
ref: ne,
|
|
136
138
|
class: ["dropdown dropdown--main-wrapper", [{ "dropdown--disabled": t.disabled, "full-width": t.fullWidth }]],
|
|
137
139
|
tabindex: t.disabled ? -1 : 0
|
|
138
140
|
}, e(y)[e(f).WRAPPER], {
|
|
139
141
|
onKeydown: o[8] || (o[8] = //@ts-ignore
|
|
140
|
-
(...l) => e(
|
|
142
|
+
(...l) => e(T) && e(T)(...l))
|
|
141
143
|
}), [
|
|
142
|
-
|
|
144
|
+
v(I.$slots, "label", {}, void 0, !0),
|
|
143
145
|
p("div", Ee, [
|
|
144
|
-
a(e(
|
|
146
|
+
a(e(Ie), u({
|
|
145
147
|
theme: t.theme,
|
|
146
148
|
"popper-class": [
|
|
147
149
|
t.popperClass,
|
|
@@ -176,10 +178,10 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
176
178
|
key: 0,
|
|
177
179
|
class: A(["dropdown-list-wrapper", { "dropdown-list-wrapper--multi": t.multi }]),
|
|
178
180
|
onKeydown: o[7] || (o[7] = //@ts-ignore
|
|
179
|
-
(...l) => e(
|
|
181
|
+
(...l) => e(T) && e(T)(...l))
|
|
180
182
|
}, [
|
|
181
183
|
e(s) && t.inlineSearch ? (i(), n("div", De, [
|
|
182
|
-
a(e(
|
|
184
|
+
a(e(we), {
|
|
183
185
|
modelValue: e(C),
|
|
184
186
|
"onUpdate:modelValue": [
|
|
185
187
|
o[4] || (o[4] = (l) => fe(C) ? C.value = l : null),
|
|
@@ -190,10 +192,10 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
190
192
|
size: "md",
|
|
191
193
|
"auto-focus": t.searchAutoFocus,
|
|
192
194
|
"test-id": t.testId,
|
|
193
|
-
onKeydown: e(
|
|
195
|
+
onKeydown: e(T)
|
|
194
196
|
}, null, 8, ["modelValue", "placeholder", "auto-focus", "test-id", "onUpdate:modelValue", "onKeydown"])
|
|
195
197
|
])) : r("", !0),
|
|
196
|
-
|
|
198
|
+
v(I.$slots, "input-list", { open: e(s) }, void 0, !0),
|
|
197
199
|
p("div", u({
|
|
198
200
|
class: ["list-container", { "list-container--multi": t.multi }],
|
|
199
201
|
style: { height: `${e(q)}rem` }
|
|
@@ -244,20 +246,20 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
244
246
|
])) : r("", !0),
|
|
245
247
|
e(K).length && !t.loading ? (i(!0), n(pe, { key: 3 }, me(e(K), ({ data: l, index: b }) => (i(), n("li", {
|
|
246
248
|
key: b,
|
|
247
|
-
"aria-selected": e(S)(h(e(
|
|
249
|
+
"aria-selected": e(S)(h(e(k)), l),
|
|
248
250
|
"aria-disabled": !!t.disabled,
|
|
249
251
|
onClick: $(() => e(D)(l, b), ["stop"])
|
|
250
252
|
}, [
|
|
251
|
-
|
|
253
|
+
v(I.$slots, "default", {
|
|
252
254
|
option: l,
|
|
253
255
|
index: b,
|
|
254
|
-
selected: e(S)(h(e(
|
|
256
|
+
selected: e(S)(h(e(k)), l),
|
|
255
257
|
active: h(e(P)) === b,
|
|
256
258
|
disabled: l[d.disabledOptionKey]
|
|
257
259
|
}, () => [
|
|
258
260
|
a(e(U), {
|
|
259
261
|
option: l,
|
|
260
|
-
"selected-prop": e(S)(h(e(
|
|
262
|
+
"selected-prop": e(S)(h(e(k)), l),
|
|
261
263
|
active: h(e(P)) === b,
|
|
262
264
|
disabled: l[d.disabledOptionKey],
|
|
263
265
|
"name-key": t.optionNameKey,
|
|
@@ -273,7 +275,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
273
275
|
], 16),
|
|
274
276
|
t.multi ? (i(), n("div", ze, [
|
|
275
277
|
p("div", xe, [
|
|
276
|
-
a(e(
|
|
278
|
+
a(e(O), u(
|
|
277
279
|
{
|
|
278
280
|
ref_key: "clearAll",
|
|
279
281
|
ref: ae,
|
|
@@ -293,7 +295,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
293
295
|
}, 16)
|
|
294
296
|
]),
|
|
295
297
|
p("div", $e, [
|
|
296
|
-
a(e(
|
|
298
|
+
a(e(O), u(
|
|
297
299
|
{
|
|
298
300
|
ref_key: "cancel",
|
|
299
301
|
ref: ie,
|
|
@@ -309,7 +311,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
309
311
|
]),
|
|
310
312
|
_: 1
|
|
311
313
|
}, 16, ["onClick"]),
|
|
312
|
-
a(e(
|
|
314
|
+
a(e(O), u({
|
|
313
315
|
ref_key: "apply",
|
|
314
316
|
ref: oe,
|
|
315
317
|
"data-testid": "mutli-apply",
|
|
@@ -337,12 +339,12 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
337
339
|
"button__container--disabled": t.disabled
|
|
338
340
|
}])
|
|
339
341
|
}, [
|
|
340
|
-
|
|
342
|
+
v(I.$slots, "dropdown-trigger", {
|
|
341
343
|
buttonTriggerProps: {
|
|
342
344
|
open: e(s),
|
|
343
345
|
disabled: t.disabled,
|
|
344
346
|
label: e(Z) || t.placeholder,
|
|
345
|
-
onClick: () => e(
|
|
347
|
+
onClick: () => e(w)()
|
|
346
348
|
}
|
|
347
349
|
}, () => [
|
|
348
350
|
p("div", {
|
|
@@ -359,7 +361,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
359
361
|
"test-id": t.testId,
|
|
360
362
|
multi: t.multi,
|
|
361
363
|
disabled: t.disabled,
|
|
362
|
-
"selected-option": t.multi ? e(N) : e(
|
|
364
|
+
"selected-option": t.multi ? e(N) : e(k),
|
|
363
365
|
"display-value": t.displayValue,
|
|
364
366
|
options: t.options,
|
|
365
367
|
"option-name-key": t.optionNameKey,
|
|
@@ -372,14 +374,15 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
372
374
|
"value-to-copy": t.valueToCopy,
|
|
373
375
|
"status-dot-type": t.statusType,
|
|
374
376
|
size: t.size,
|
|
377
|
+
"show-all-selected-text": t.triggerShowAllSelectedText,
|
|
375
378
|
onKeydown: e(G),
|
|
376
379
|
onClick: re,
|
|
377
|
-
onCopyToClipboard: o[0] || (o[0] = (l) =>
|
|
378
|
-
}, null, 40, ["placeholder", "open", "label", "show-feedback-icon", "mandatory", "test-id", "multi", "disabled", "selected-option", "display-value", "options", "option-name-key", "option-image-key", "option-icon-key", "option-icon-type", "option-end-icon-key", "option-end-icon-type", "feedback-variant", "value-to-copy", "status-dot-type", "size", "onKeydown"]))
|
|
380
|
+
onCopyToClipboard: o[0] || (o[0] = (l) => L("copyToClipboard"))
|
|
381
|
+
}, null, 40, ["placeholder", "open", "label", "show-feedback-icon", "mandatory", "test-id", "multi", "disabled", "selected-option", "display-value", "options", "option-name-key", "option-image-key", "option-icon-key", "option-icon-type", "option-end-icon-key", "option-end-icon-type", "feedback-variant", "value-to-copy", "status-dot-type", "size", "show-all-selected-text", "onKeydown"]))
|
|
379
382
|
])) : r("", !0),
|
|
380
383
|
t.predefinedTrigger === e(m).ICON_BUTTON ? (i(), n("div", Ke, [
|
|
381
|
-
a(e(
|
|
382
|
-
onClick: o[1] || (o[1] = (l) => e(
|
|
384
|
+
a(e(ke), {
|
|
385
|
+
onClick: o[1] || (o[1] = (l) => e(w)())
|
|
383
386
|
})
|
|
384
387
|
])) : r("", !0),
|
|
385
388
|
t.predefinedTrigger === e(m).CHIP ? (i(), n("div", Ne, [
|
|
@@ -388,10 +391,10 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
388
391
|
label: t.placeholder,
|
|
389
392
|
"test-id": t.testId,
|
|
390
393
|
options: t.options,
|
|
391
|
-
"selected-option": t.multi ? e(N) : e(
|
|
394
|
+
"selected-option": t.multi ? e(N) : e(k),
|
|
392
395
|
"display-value": t.displayValue,
|
|
393
396
|
multi: t.multi,
|
|
394
|
-
onClick: o[2] || (o[2] = (l) => e(
|
|
397
|
+
onClick: o[2] || (o[2] = (l) => e(w)()),
|
|
395
398
|
onClear: o[3] || (o[3] = (l) => e(F)())
|
|
396
399
|
}, null, 8, ["open", "label", "test-id", "options", "selected-option", "display-value", "multi"])
|
|
397
400
|
])) : r("", !0)
|
|
@@ -401,7 +404,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
401
404
|
]),
|
|
402
405
|
_: 3
|
|
403
406
|
}, 16, ["theme", "popper-class", "placement", "skidding", "distance", "flip", "shown", "container", "auto-size"]),
|
|
404
|
-
t.triggerFeedbackText ? (i(), H(
|
|
407
|
+
t.triggerFeedbackText ? (i(), H(Oe, {
|
|
405
408
|
key: 0,
|
|
406
409
|
text: t.triggerFeedbackText,
|
|
407
410
|
variant: t.triggerFeedbackVariant,
|
|
@@ -410,7 +413,7 @@ const Oe = ["tabindex"], Ee = { style: { width: "100%" } }, Be = { key: 0 }, Ke
|
|
|
410
413
|
class: "dropdown-field-help-text"
|
|
411
414
|
}, null, 8, ["text", "variant", "show-icon", "test-id"])) : r("", !0)
|
|
412
415
|
])
|
|
413
|
-
], 16,
|
|
416
|
+
], 16, Le));
|
|
414
417
|
}
|
|
415
418
|
});
|
|
416
419
|
export {
|
|
@@ -5,6 +5,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
5
5
|
isOpen?: boolean;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
inlineSearchPlaceholder?: string;
|
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
testId?: string;
|
|
8
11
|
displayValue: (option: unknown) => string;
|
|
9
12
|
optionNameKey?: string;
|
|
10
13
|
optionIconKey?: string;
|
|
@@ -19,6 +22,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
19
22
|
selected: any;
|
|
20
23
|
placeholder: string;
|
|
21
24
|
inlineSearchPlaceholder: string;
|
|
25
|
+
size: string;
|
|
26
|
+
disabled: boolean;
|
|
27
|
+
testId: string;
|
|
22
28
|
optionNameKey: string;
|
|
23
29
|
optionIconKey: string;
|
|
24
30
|
optionImageKey: string;
|
|
@@ -37,6 +43,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
37
43
|
isOpen?: boolean;
|
|
38
44
|
placeholder?: string;
|
|
39
45
|
inlineSearchPlaceholder?: string;
|
|
46
|
+
size?: 'small' | 'medium' | 'large';
|
|
47
|
+
disabled?: boolean;
|
|
48
|
+
testId?: string;
|
|
40
49
|
displayValue: (option: unknown) => string;
|
|
41
50
|
optionNameKey?: string;
|
|
42
51
|
optionIconKey?: string;
|
|
@@ -51,6 +60,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
51
60
|
selected: any;
|
|
52
61
|
placeholder: string;
|
|
53
62
|
inlineSearchPlaceholder: string;
|
|
63
|
+
size: string;
|
|
64
|
+
disabled: boolean;
|
|
65
|
+
testId: string;
|
|
54
66
|
optionNameKey: string;
|
|
55
67
|
optionIconKey: string;
|
|
56
68
|
optionImageKey: string;
|
|
@@ -64,6 +76,9 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
64
76
|
"onUpdate:selected"?: (value: unknown) => any;
|
|
65
77
|
"onUpdate:isOpen"?: (value: unknown) => any;
|
|
66
78
|
}, {
|
|
79
|
+
disabled: boolean;
|
|
80
|
+
size: 'small' | 'medium' | 'large';
|
|
81
|
+
testId: string;
|
|
67
82
|
selected: unknown[];
|
|
68
83
|
placeholder: string;
|
|
69
84
|
inlineSearchPlaceholder: string;
|
|
@@ -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_142eab98_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-142eab98"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "../../../TreeDropdown.
|
|
2
|
-
import
|
|
1
|
+
import "../../../TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css"; import { defineComponent as w, ref as S, watch as T, openBlock as u, createBlock as f, unref as o, withCtx as E, createVNode as N, withModifiers as k, createElementBlock as h, Fragment as B, renderList as x, createCommentVNode as z } from "vue";
|
|
2
|
+
import V from "./DropdownV4.vue.js";
|
|
3
3
|
import "./DefaultDropdownTrigger.vue.js";
|
|
4
4
|
import "./IconButtonDropdownTrigger.vue.js";
|
|
5
5
|
import "./ChipDropdownTrigger.vue.js";
|
|
@@ -8,11 +8,11 @@ import "./ButtonDropdownTrigger.vue.js";
|
|
|
8
8
|
import "./ButtonFilterDropdownTrigger.vue.js";
|
|
9
9
|
import "./TreeDropdown.vue.js";
|
|
10
10
|
import v from "./OptionV4.vue.js";
|
|
11
|
-
import { useChildOptions as
|
|
12
|
-
const
|
|
11
|
+
import { useChildOptions as D } from "../composables/useChildOptions.js";
|
|
12
|
+
const P = {
|
|
13
13
|
key: 0,
|
|
14
14
|
class: "child-options"
|
|
15
|
-
},
|
|
15
|
+
}, Q = /* @__PURE__ */ w({
|
|
16
16
|
__name: "TreeDropdown",
|
|
17
17
|
props: {
|
|
18
18
|
options: null,
|
|
@@ -20,6 +20,9 @@ const U = {
|
|
|
20
20
|
isOpen: { type: Boolean },
|
|
21
21
|
placeholder: { default: "Select" },
|
|
22
22
|
inlineSearchPlaceholder: { default: "Search" },
|
|
23
|
+
size: { default: "medium" },
|
|
24
|
+
disabled: { type: Boolean, default: !1 },
|
|
25
|
+
testId: { default: "" },
|
|
23
26
|
displayValue: null,
|
|
24
27
|
optionNameKey: { default: "" },
|
|
25
28
|
optionIconKey: { default: "" },
|
|
@@ -32,33 +35,33 @@ const U = {
|
|
|
32
35
|
optionChildrenKey: { default: "" }
|
|
33
36
|
},
|
|
34
37
|
emits: ["update:selected", "update:isOpen"],
|
|
35
|
-
setup(e, { emit:
|
|
36
|
-
const a = e,
|
|
38
|
+
setup(e, { emit: y }) {
|
|
39
|
+
const a = e, l = S(a.selected);
|
|
37
40
|
T(
|
|
38
41
|
() => a.selected,
|
|
39
42
|
() => {
|
|
40
|
-
|
|
43
|
+
l.value = [...a.selected];
|
|
41
44
|
}
|
|
42
45
|
);
|
|
43
|
-
const { hasChildren:
|
|
44
|
-
if (
|
|
45
|
-
|
|
46
|
-
(
|
|
47
|
-
) :
|
|
48
|
-
...
|
|
49
|
-
...d(
|
|
46
|
+
const { hasChildren: c, getChildren: d, allChildrenSelected: r, someChildrenSelected: K } = D(l, a.optionChildrenKey), p = (n) => {
|
|
47
|
+
if (c(n)) {
|
|
48
|
+
r(n) ? l.value = l.value.filter(
|
|
49
|
+
(i) => !d(n).includes(i)
|
|
50
|
+
) : l.value = [
|
|
51
|
+
...l.value.filter((i) => !d(n).includes(i)),
|
|
52
|
+
...d(n)
|
|
50
53
|
];
|
|
51
54
|
return;
|
|
52
55
|
}
|
|
53
|
-
|
|
54
|
-
(
|
|
55
|
-
) :
|
|
56
|
-
}, m = (
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
return (
|
|
56
|
+
l.value.includes(n) ? l.value = l.value.filter(
|
|
57
|
+
(i) => i !== n
|
|
58
|
+
) : l.value = [...l.value, n];
|
|
59
|
+
}, m = (n) => l.value.includes(n), C = (n) => 1 + (c(n) ? d(n).length : 0), I = () => {
|
|
60
|
+
y("update:selected", l.value);
|
|
61
|
+
}, g = () => {
|
|
62
|
+
l.value = [];
|
|
63
|
+
};
|
|
64
|
+
return (n, i) => (u(), f(o(V), {
|
|
62
65
|
multi: "",
|
|
63
66
|
class: "tree-dropdown",
|
|
64
67
|
"show-select-all": !1,
|
|
@@ -68,48 +71,52 @@ const U = {
|
|
|
68
71
|
"display-value": e.displayValue,
|
|
69
72
|
placeholder: e.placeholder,
|
|
70
73
|
"inline-search-placeholder": e.inlineSearchPlaceholder,
|
|
71
|
-
"on-search": i(g),
|
|
72
74
|
"option-name-key": e.optionNameKey,
|
|
75
|
+
size: e.size,
|
|
76
|
+
"test-id": e.testId,
|
|
77
|
+
disabled: e.disabled,
|
|
73
78
|
"disable-virtual-scroll": "",
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
|
|
77
|
-
|
|
79
|
+
"override-option-count-calculation": C,
|
|
80
|
+
"trigger-show-all-selected-text": !1,
|
|
81
|
+
"onUpdate:selected": i[0] || (i[0] = (t) => y("update:selected", t)),
|
|
82
|
+
"onUpdate:isOpen": i[1] || (i[1] = (t) => y("update:isOpen", t)),
|
|
83
|
+
onApply: I,
|
|
84
|
+
onClear: g
|
|
78
85
|
}, {
|
|
79
|
-
default:
|
|
80
|
-
|
|
81
|
-
option:
|
|
82
|
-
"selected-prop":
|
|
83
|
-
"is-indeterminate": !
|
|
84
|
-
disabled:
|
|
86
|
+
default: E(({ option: t, index: b }) => [
|
|
87
|
+
N(o(v), {
|
|
88
|
+
option: t,
|
|
89
|
+
"selected-prop": o(c)(t) ? o(r)(t) : m(t),
|
|
90
|
+
"is-indeterminate": !o(r)(t) && o(K)(t),
|
|
91
|
+
disabled: t[e.disabledOptionKey],
|
|
85
92
|
"name-key": e.optionNameKey,
|
|
86
93
|
"image-key": e.optionImageKey,
|
|
87
94
|
"icon-key": e.optionIconKey,
|
|
88
95
|
"icon-type": e.optionIconType,
|
|
89
96
|
"end-icon-key": e.optionEndIconKey,
|
|
90
97
|
"end-icon-type": e.optionEndIconType,
|
|
91
|
-
onClick: k(() => p(
|
|
98
|
+
onClick: k(() => p(t), ["stop"])
|
|
92
99
|
}, null, 8, ["option", "selected-prop", "is-indeterminate", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "onClick"]),
|
|
93
|
-
|
|
94
|
-
(
|
|
95
|
-
key: `${
|
|
96
|
-
option:
|
|
97
|
-
"selected-prop": m(
|
|
98
|
-
disabled:
|
|
100
|
+
o(c)(t) ? (u(), h("div", P, [
|
|
101
|
+
(u(!0), h(B, null, x(o(d)(t), (s, O) => (u(), f(o(v), {
|
|
102
|
+
key: `${b}-${O}`,
|
|
103
|
+
option: s,
|
|
104
|
+
"selected-prop": m(s),
|
|
105
|
+
disabled: s[e.disabledOptionKey],
|
|
99
106
|
"name-key": e.optionNameKey,
|
|
100
107
|
"image-key": e.optionImageKey,
|
|
101
108
|
"icon-key": e.optionIconKey,
|
|
102
109
|
"icon-type": e.optionIconType,
|
|
103
110
|
"end-icon-key": e.optionEndIconKey,
|
|
104
111
|
"end-icon-type": e.optionEndIconType,
|
|
105
|
-
onClick: k(() => p(
|
|
112
|
+
onClick: k(() => p(s), ["stop"])
|
|
106
113
|
}, null, 8, ["option", "selected-prop", "disabled", "name-key", "image-key", "icon-key", "icon-type", "end-icon-key", "end-icon-type", "onClick"]))), 128))
|
|
107
|
-
])) :
|
|
114
|
+
])) : z("", !0)
|
|
108
115
|
]),
|
|
109
116
|
_: 1
|
|
110
|
-
}, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "
|
|
117
|
+
}, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled"]));
|
|
111
118
|
}
|
|
112
119
|
});
|
|
113
120
|
export {
|
|
114
|
-
|
|
121
|
+
Q as default
|
|
115
122
|
};
|