@ironsource/shared-ui 2.1.7-test.7 → 2.1.7-test.9
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/DataGrid.vue_vue_type_style_index_0_scoped_706b324e_lang.css +1 -0
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_0ce71f73_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_98819e5a_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_00ccab6b_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_77509f61_lang.css +1 -0
- package/README.md +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_5efe563d_lang.css +1 -0
- package/components/dropdown/common/Dropdown.common.js +89 -89
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +1 -0
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +32 -29
- package/components/dropdown/v4/DropdownV4.vue.d.ts +29 -0
- package/components/dropdown/v4/DropdownV4.vue.js +4 -4
- package/components/dropdown/v4/DropdownV4.vue2.js +186 -158
- package/components/dropdown/v4/OptionV4.vue.d.ts +26 -2
- package/components/dropdown/v4/OptionV4.vue.js +2 -2
- package/components/dropdown/v4/OptionV4.vue2.js +94 -71
- package/components/dropdown/v4/TreeDropdown.vue.d.ts +21 -16
- package/components/dropdown/v4/TreeDropdown.vue.js +4 -4
- package/components/dropdown/v4/TreeDropdown.vue2.js +162 -74
- package/components/dropdown/v4/index.d.ts +451 -82
- package/components/table/common/Table.common.js +68 -71
- package/components/table/v4/DataGrid.vue.d.ts +4 -10
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +134 -128
- package/components/table/v4/DataGridRowsCounter.vue.js +2 -2
- package/components/table/v4/DataGridRowsCounter.vue2.js +13 -14
- package/components/table/v4/MultipleDataGrid.vue.d.ts +2 -2
- package/components/table/v4/index.d.ts +7 -41
- package/components/table/v4/storyUtils.d.ts +0 -4
- package/index.d.ts +1203 -533
- package/mocks/options.d.ts +12 -0
- package/package.json +1 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_5273976b_lang.css +0 -1
- package/DataGridRowsCounter.vue_vue_type_style_index_0_scoped_ef699ec5_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_938772ee_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_b6a06f00_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +0 -1
- package/utils/formatNumbers.d.ts +0 -4
- package/utils/formatNumbers.js +0 -11
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import "../../../OptionV4.
|
|
1
|
+
import "../../../OptionV4.vue_vue_type_style_index_0_scoped_77509f61_lang.css"; import { defineComponent as V, ref as x, watch as M, openBlock as i, createBlock as g, unref as o, withCtx as u, createElementVNode as s, normalizeClass as m, createCommentVNode as n, createElementBlock as l, renderSlot as f, createVNode as c, toDisplayString as k, createTextVNode as b, withModifiers as K } from "vue";
|
|
2
2
|
import "../../typography/Heading.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import S from "../../typography/Text.vue.js";
|
|
4
|
+
import L from "../../checkbox/v4/CheckboxV4.vue.js";
|
|
5
|
+
import y from "../../icon/v4/IconV4.vue.js";
|
|
6
6
|
import "../../icon/v4/IconFlag.vue.js";
|
|
7
|
-
import { NOOP as
|
|
8
|
-
import { optionCommon as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { isElementTruncated as
|
|
12
|
-
|
|
7
|
+
import { NOOP as N } from "@vue/shared";
|
|
8
|
+
import { optionCommon as j } from "../common/Option.common.js";
|
|
9
|
+
import w from "../../typography/v4/Typography.vue.js";
|
|
10
|
+
import R from "../../tooltip/v4/TooltipV4.vue.js";
|
|
11
|
+
import { isElementTruncated as A } from "../../../utils/text.js";
|
|
12
|
+
import { promiseTimeout as D } from "@vueuse/core";
|
|
13
|
+
const q = {
|
|
13
14
|
key: 1,
|
|
14
15
|
class: "image"
|
|
15
|
-
},
|
|
16
|
+
}, F = ["src"], G = {
|
|
16
17
|
key: 2,
|
|
17
18
|
class: "start-icon"
|
|
18
|
-
},
|
|
19
|
+
}, H = { class: "main-text" }, J = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "caption-text"
|
|
21
|
-
},
|
|
22
|
+
}, Q = {
|
|
22
23
|
key: 3,
|
|
23
24
|
class: "end-icon"
|
|
24
|
-
},
|
|
25
|
+
}, U = ["onClick"], W = { key: 0 }, ce = /* @__PURE__ */ V({
|
|
25
26
|
__name: "OptionV4",
|
|
26
27
|
props: {
|
|
27
28
|
option: { default: null },
|
|
@@ -38,122 +39,144 @@ const M = {
|
|
|
38
39
|
endIconKey: { default: null },
|
|
39
40
|
endIconType: { default: "regular" },
|
|
40
41
|
toolTipPlacement: { default: "right" },
|
|
42
|
+
treeMainOption: { type: Boolean, default: !1 },
|
|
43
|
+
treeMainOptionExpanded: { type: Boolean, default: !1 },
|
|
44
|
+
stopOptionClickEventPropagation: { type: Boolean, default: !1 },
|
|
41
45
|
optionTwoLinesVariant: { default: void 0 },
|
|
42
|
-
optionTwoLinesKey: { default: void 0 }
|
|
46
|
+
optionTwoLinesKey: { default: void 0 },
|
|
47
|
+
treeChildShown: { type: Boolean, default: !1 }
|
|
43
48
|
},
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
emits: ["toggleTreeCollapse"],
|
|
50
|
+
setup(e, { emit: I }) {
|
|
51
|
+
const a = e, { selected: p, isMulti: T, id: B, onClick: O, api: v } = j(a), $ = (t) => {
|
|
52
|
+
a.stopOptionClickEventPropagation && t.stopPropagation(), a.disabled ? N() : O(t);
|
|
53
|
+
}, d = x(null), h = x(!1);
|
|
54
|
+
M([() => a.treeChildShown, d], async () => {
|
|
55
|
+
await D(100), h.value = d.value && A(d.value);
|
|
56
|
+
});
|
|
57
|
+
const z = (t) => t && typeof t == "object" && "optionTooltipText" in t ? t.optionTooltipText : h.value ? t[a.nameKey] : "", E = (t) => t && typeof t == "object" && "optionTooltipTestId" in t ? t.optionTooltipTestId : null, P = () => {
|
|
58
|
+
I("toggleTreeCollapse", a.option);
|
|
59
|
+
};
|
|
60
|
+
return (t, r) => (i(), g(o(R), {
|
|
61
|
+
text: z(e.option),
|
|
62
|
+
"test-id": E(e.option),
|
|
51
63
|
placement: e.toolTipPlacement,
|
|
52
64
|
class: "tooltip-option"
|
|
53
65
|
}, {
|
|
54
|
-
default:
|
|
55
|
-
|
|
66
|
+
default: u(() => [
|
|
67
|
+
s("div", {
|
|
56
68
|
ref: "el",
|
|
57
|
-
class:
|
|
69
|
+
class: m(["item-container", {
|
|
58
70
|
"item-container--disabled": e.disabled,
|
|
59
71
|
"item-container--active": e.nameKey ? !1 : e.active,
|
|
60
|
-
"item-container--selected":
|
|
61
|
-
"item-container--multi":
|
|
72
|
+
"item-container--selected": o(p),
|
|
73
|
+
"item-container--multi": o(T)
|
|
62
74
|
}])
|
|
63
75
|
}, [
|
|
64
|
-
|
|
65
|
-
class:
|
|
66
|
-
"item--multi":
|
|
76
|
+
s("div", {
|
|
77
|
+
class: m(["item", {
|
|
78
|
+
"item--multi": o(T),
|
|
67
79
|
"item--with-icon": t.$slots["icon-start"] || t.$slots.image
|
|
68
80
|
}])
|
|
69
81
|
}, [
|
|
70
|
-
|
|
82
|
+
o(T) ? (i(), g(o(L), {
|
|
71
83
|
key: 0,
|
|
72
|
-
id:
|
|
84
|
+
id: o(B).toString(),
|
|
73
85
|
tabindex: "-1",
|
|
74
86
|
class: "checkbox",
|
|
75
|
-
"is-checked":
|
|
87
|
+
"is-checked": o(p),
|
|
76
88
|
"is-indeterminate": e.isIndeterminate,
|
|
77
|
-
onClick:
|
|
78
|
-
}, null, 8, ["id", "is-checked", "is-indeterminate"])) :
|
|
79
|
-
t.$slots.image || e.imageKey ? (
|
|
80
|
-
|
|
81
|
-
e.imageKey ? (
|
|
89
|
+
onClick: r[0] || (r[0] = (C) => $(C))
|
|
90
|
+
}, null, 8, ["id", "is-checked", "is-indeterminate"])) : n("", !0),
|
|
91
|
+
t.$slots.image || e.imageKey ? (i(), l("div", q, [
|
|
92
|
+
f(t.$slots, "image", {}, () => [
|
|
93
|
+
e.imageKey ? (i(), l("img", {
|
|
82
94
|
key: 0,
|
|
83
95
|
src: e.option[e.imageKey]
|
|
84
|
-
}, null, 8,
|
|
96
|
+
}, null, 8, F)) : n("", !0)
|
|
85
97
|
], !0)
|
|
86
|
-
])) :
|
|
87
|
-
t.$slots["icon-start"] || e.iconKey ? (
|
|
88
|
-
|
|
89
|
-
|
|
98
|
+
])) : n("", !0),
|
|
99
|
+
t.$slots["icon-start"] || e.iconKey ? (i(), l("div", G, [
|
|
100
|
+
f(t.$slots, "icon-start", {}, () => [
|
|
101
|
+
c(o(y), {
|
|
90
102
|
type: e.iconType,
|
|
91
103
|
name: e.option[e.iconKey],
|
|
92
104
|
size: e.iconType === "regular" ? "20px" : "16px"
|
|
93
105
|
}, null, 8, ["type", "name", "size"])
|
|
94
106
|
], !0)
|
|
95
|
-
])) :
|
|
96
|
-
|
|
107
|
+
])) : n("", !0),
|
|
108
|
+
s("div", {
|
|
97
109
|
ref_key: "textContainerRef",
|
|
98
|
-
ref:
|
|
110
|
+
ref: d,
|
|
99
111
|
class: "text-container"
|
|
100
112
|
}, [
|
|
101
|
-
|
|
113
|
+
c(o(w), {
|
|
102
114
|
class: "option-text",
|
|
103
115
|
variant: "body2"
|
|
104
116
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class:
|
|
117
|
+
default: u(() => [
|
|
118
|
+
f(t.$slots, "default", {}, () => [
|
|
119
|
+
s("div", {
|
|
120
|
+
class: m(`option-content-${e.optionTwoLinesVariant || "horizontal"}`)
|
|
109
121
|
}, [
|
|
110
|
-
|
|
111
|
-
e.optionTwoLinesKey ? (
|
|
112
|
-
|
|
113
|
-
default:
|
|
114
|
-
|
|
122
|
+
s("div", H, k(e.option[e.nameKey]), 1),
|
|
123
|
+
e.optionTwoLinesKey ? (i(), l("div", J, [
|
|
124
|
+
c(o(w), { variant: "caption" }, {
|
|
125
|
+
default: u(() => [
|
|
126
|
+
b(k(e.option[e.optionTwoLinesKey]), 1)
|
|
115
127
|
]),
|
|
116
128
|
_: 1
|
|
117
129
|
})
|
|
118
|
-
])) :
|
|
130
|
+
])) : n("", !0)
|
|
119
131
|
], 2)
|
|
120
132
|
], !0)
|
|
121
133
|
]),
|
|
122
134
|
_: 3
|
|
123
135
|
}),
|
|
124
|
-
e.subtitle ? (
|
|
136
|
+
e.subtitle ? (i(), g(o(S), {
|
|
125
137
|
key: 0,
|
|
126
138
|
class: "subtitle",
|
|
127
139
|
size: "xs"
|
|
128
140
|
}, {
|
|
129
|
-
default:
|
|
130
|
-
|
|
141
|
+
default: u(() => [
|
|
142
|
+
b(k(e.subtitle), 1)
|
|
131
143
|
]),
|
|
132
144
|
_: 1
|
|
133
|
-
})) :
|
|
145
|
+
})) : n("", !0)
|
|
134
146
|
], 512),
|
|
135
|
-
t.$slots["icon-end"] || e.endIconKey && e.option[e.endIconKey] ? (
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
t.$slots["icon-end"] || e.endIconKey && e.option[e.endIconKey] ? (i(), l("div", Q, [
|
|
148
|
+
f(t.$slots, "icon-end", {}, () => [
|
|
149
|
+
c(o(y), {
|
|
138
150
|
type: e.endIconType,
|
|
139
151
|
name: e.option[e.endIconKey],
|
|
140
152
|
size: e.endIconType === "regular" || e.endIconType === "ab-test" ? "20px" : "16px"
|
|
141
153
|
}, null, 8, ["type", "name", "size"])
|
|
142
154
|
], !0)
|
|
143
|
-
])) :
|
|
155
|
+
])) : n("", !0),
|
|
156
|
+
e.treeMainOption ? (i(), l("div", {
|
|
157
|
+
key: 4,
|
|
158
|
+
class: "tree-main-arrow-wrapper",
|
|
159
|
+
onClick: K(P, ["stop"])
|
|
160
|
+
}, [
|
|
161
|
+
c(o(y), {
|
|
162
|
+
name: "caret-down",
|
|
163
|
+
size: "16px",
|
|
164
|
+
class: m(`app-trigger--icon ${e.treeMainOptionExpanded && "expanded"}`)
|
|
165
|
+
}, null, 8, ["class"])
|
|
166
|
+
], 8, U)) : n("", !0)
|
|
144
167
|
], 2),
|
|
145
|
-
|
|
146
|
-
|
|
168
|
+
o(v).clearable && o(p) ? (i(), l("div", W, [
|
|
169
|
+
s("button", {
|
|
147
170
|
class: "clear-button",
|
|
148
|
-
onClick:
|
|
171
|
+
onClick: r[1] || (r[1] = K((C) => o(v).clearSelection(), ["prevent", "stop"]))
|
|
149
172
|
}, [
|
|
150
|
-
|
|
173
|
+
c(o(y), {
|
|
151
174
|
name: "close",
|
|
152
175
|
width: "8",
|
|
153
176
|
height: "8"
|
|
154
177
|
})
|
|
155
178
|
])
|
|
156
|
-
])) :
|
|
179
|
+
])) : n("", !0)
|
|
157
180
|
], 2)
|
|
158
181
|
]),
|
|
159
182
|
_: 3
|
|
@@ -161,5 +184,5 @@ const M = {
|
|
|
161
184
|
}
|
|
162
185
|
});
|
|
163
186
|
export {
|
|
164
|
-
|
|
187
|
+
ce as default
|
|
165
188
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
1
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
2
|
options: unknown[];
|
|
4
3
|
selected?: unknown[];
|
|
5
4
|
isOpen?: boolean;
|
|
6
5
|
placeholder?: string;
|
|
7
6
|
inlineSearchPlaceholder?: string;
|
|
8
|
-
size?:
|
|
7
|
+
size?: "small" | "medium" | "large";
|
|
9
8
|
disabled?: boolean;
|
|
10
9
|
testId?: string;
|
|
11
10
|
displayValue: (option: unknown) => string;
|
|
12
11
|
optionNameKey?: string;
|
|
13
12
|
optionIconKey?: string;
|
|
14
13
|
optionImageKey?: string;
|
|
15
|
-
optionIconType?:
|
|
14
|
+
optionIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
16
15
|
optionEndIconKey?: string;
|
|
17
|
-
optionEndIconType?:
|
|
16
|
+
optionEndIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
18
17
|
valueToCopy?: string;
|
|
19
18
|
disabledOptionKey?: string;
|
|
20
|
-
optionChildrenKey
|
|
19
|
+
optionChildrenKey: string;
|
|
20
|
+
optionUniqueIdKey: string;
|
|
21
21
|
}>, {
|
|
22
22
|
selected: any;
|
|
23
23
|
placeholder: string;
|
|
@@ -33,7 +33,6 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
33
33
|
optionEndIconType: any;
|
|
34
34
|
valueToCopy: any;
|
|
35
35
|
disabledOptionKey: string;
|
|
36
|
-
optionChildrenKey: string;
|
|
37
36
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
38
37
|
"update:selected": (value: unknown) => void;
|
|
39
38
|
"update:isOpen": (value: unknown) => void;
|
|
@@ -43,19 +42,20 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
43
42
|
isOpen?: boolean;
|
|
44
43
|
placeholder?: string;
|
|
45
44
|
inlineSearchPlaceholder?: string;
|
|
46
|
-
size?:
|
|
45
|
+
size?: "small" | "medium" | "large";
|
|
47
46
|
disabled?: boolean;
|
|
48
47
|
testId?: string;
|
|
49
48
|
displayValue: (option: unknown) => string;
|
|
50
49
|
optionNameKey?: string;
|
|
51
50
|
optionIconKey?: string;
|
|
52
51
|
optionImageKey?: string;
|
|
53
|
-
optionIconType?:
|
|
52
|
+
optionIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
54
53
|
optionEndIconKey?: string;
|
|
55
|
-
optionEndIconType?:
|
|
54
|
+
optionEndIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
56
55
|
valueToCopy?: string;
|
|
57
56
|
disabledOptionKey?: string;
|
|
58
|
-
optionChildrenKey
|
|
57
|
+
optionChildrenKey: string;
|
|
58
|
+
optionUniqueIdKey: string;
|
|
59
59
|
}>, {
|
|
60
60
|
selected: any;
|
|
61
61
|
placeholder: string;
|
|
@@ -71,13 +71,12 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
71
71
|
optionEndIconType: any;
|
|
72
72
|
valueToCopy: any;
|
|
73
73
|
disabledOptionKey: string;
|
|
74
|
-
optionChildrenKey: string;
|
|
75
74
|
}>>> & {
|
|
76
75
|
"onUpdate:selected"?: (value: unknown) => any;
|
|
77
76
|
"onUpdate:isOpen"?: (value: unknown) => any;
|
|
78
77
|
}, {
|
|
79
78
|
disabled: boolean;
|
|
80
|
-
size:
|
|
79
|
+
size: "small" | "medium" | "large";
|
|
81
80
|
testId: string;
|
|
82
81
|
selected: unknown[];
|
|
83
82
|
placeholder: string;
|
|
@@ -85,12 +84,13 @@ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_T
|
|
|
85
84
|
optionNameKey: string;
|
|
86
85
|
optionIconKey: string;
|
|
87
86
|
optionImageKey: string;
|
|
88
|
-
optionIconType:
|
|
87
|
+
optionIconType: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
89
88
|
optionEndIconKey: string;
|
|
90
|
-
optionEndIconType:
|
|
89
|
+
optionEndIconType: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test" | "ad-networks" | "ad-networks/flat" | "content-rate";
|
|
91
90
|
valueToCopy: string;
|
|
92
91
|
disabledOptionKey: string;
|
|
93
|
-
|
|
92
|
+
}>, {
|
|
93
|
+
"trigger-end-icon"?(_: {}): any;
|
|
94
94
|
}>;
|
|
95
95
|
export default _default;
|
|
96
96
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -110,3 +110,8 @@ type __VLS_WithDefaults<P, D> = {
|
|
|
110
110
|
type __VLS_Prettify<T> = {
|
|
111
111
|
[K in keyof T]: T[K];
|
|
112
112
|
} & {};
|
|
113
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
114
|
+
new (): {
|
|
115
|
+
$slots: S;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../../TreeDropdown.
|
|
4
|
-
const s = /* @__PURE__ */ e
|
|
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"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import "../../../TreeDropdown.
|
|
2
|
-
import
|
|
3
|
-
import "./DefaultDropdownTrigger.vue.js";
|
|
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";
|
|
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
|
-
|
|
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 = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "child-options"
|
|
15
|
-
},
|
|
16
|
+
}, ve = /* @__PURE__ */ $({
|
|
16
17
|
__name: "TreeDropdown",
|
|
17
18
|
props: {
|
|
18
19
|
options: null,
|
|
@@ -32,91 +33,178 @@ const P = {
|
|
|
32
33
|
optionEndIconType: { default: null },
|
|
33
34
|
valueToCopy: { default: null },
|
|
34
35
|
disabledOptionKey: { default: "disabled" },
|
|
35
|
-
optionChildrenKey:
|
|
36
|
+
optionChildrenKey: null,
|
|
37
|
+
optionUniqueIdKey: null
|
|
36
38
|
},
|
|
37
39
|
emits: ["update:selected", "update:isOpen"],
|
|
38
|
-
setup(
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
setup(o, { emit: I }) {
|
|
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) => {
|
|
46
|
+
n[l.optionChildrenKey] && n[l.optionChildrenKey].length && (w.value[n[l.optionUniqueIdKey]] = [
|
|
47
|
+
...n[l.optionChildrenKey]
|
|
48
|
+
]);
|
|
49
|
+
}), f.value = [...l.options], h.value = [...l.options], O.value = !0);
|
|
50
|
+
}), C(
|
|
51
|
+
() => l.selected,
|
|
42
52
|
() => {
|
|
43
|
-
|
|
53
|
+
i.value = [...l.selected];
|
|
44
54
|
}
|
|
45
55
|
);
|
|
46
|
-
const { hasChildren:
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
(
|
|
50
|
-
) :
|
|
51
|
-
...
|
|
52
|
-
...
|
|
56
|
+
const { hasChildren: p, getChildren: y, allChildrenSelected: K, someChildrenSelected: V } = ne(i, l.optionChildrenKey), S = (n) => {
|
|
57
|
+
if (p(n)) {
|
|
58
|
+
K(n) ? i.value = i.value.filter(
|
|
59
|
+
(t) => !y(n).includes(t)
|
|
60
|
+
) : i.value = [
|
|
61
|
+
...i.value.filter((t) => !y(n).includes(t)),
|
|
62
|
+
...y(n)
|
|
53
63
|
];
|
|
54
64
|
return;
|
|
55
65
|
}
|
|
56
|
-
|
|
57
|
-
(
|
|
58
|
-
) :
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
},
|
|
62
|
-
|
|
66
|
+
i.value.includes(n) ? i.value = i.value.filter(
|
|
67
|
+
(t) => t !== n
|
|
68
|
+
) : i.value = [...i.value, n];
|
|
69
|
+
}, b = (n) => i.value.includes(n), z = (n) => 1 + (p(n) ? y(n).length : 0), D = () => {
|
|
70
|
+
I("update:selected", i.value);
|
|
71
|
+
}, x = () => {
|
|
72
|
+
i.value = [];
|
|
73
|
+
}, B = () => {
|
|
74
|
+
const n = /* @__PURE__ */ new Set([]);
|
|
75
|
+
h.value.forEach((e) => {
|
|
76
|
+
if (l.selected?.includes(e))
|
|
77
|
+
n.add(e);
|
|
78
|
+
else if (e[l.optionChildrenKey] && e[l.optionChildrenKey].length) {
|
|
79
|
+
for (const s of e[l.optionChildrenKey])
|
|
80
|
+
if (l.selected?.includes(s)) {
|
|
81
|
+
n.add(e);
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const t = Array.from(n);
|
|
87
|
+
return h.value.forEach((e) => {
|
|
88
|
+
!l.selected.includes(e) && !n.has(e) && t.push(e);
|
|
89
|
+
}), t;
|
|
63
90
|
};
|
|
64
|
-
|
|
91
|
+
C(
|
|
92
|
+
() => l.isOpen,
|
|
93
|
+
() => {
|
|
94
|
+
l.isOpen ? f.value = B() : (i.value = [...l.selected], u.value = "");
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
const d = r({}), M = (n) => {
|
|
98
|
+
d.value[n[l.optionUniqueIdKey]] ? delete d.value[n[l.optionUniqueIdKey]] : d.value[n[l.optionUniqueIdKey]] = 1;
|
|
99
|
+
};
|
|
100
|
+
function P(n, t) {
|
|
101
|
+
const e = n.toLowerCase(), s = [];
|
|
102
|
+
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)
|
|
105
|
+
) || [];
|
|
106
|
+
(g || E.length > 0) && (c[l.optionChildrenKey] = E, s.push(c));
|
|
107
|
+
}), s;
|
|
108
|
+
}
|
|
109
|
+
const A = (n) => {
|
|
110
|
+
const t = P(n, h);
|
|
111
|
+
n && (Object.keys(d.value).forEach((e) => {
|
|
112
|
+
delete d.value[e];
|
|
113
|
+
}), t.forEach((e) => {
|
|
114
|
+
Array.isArray(e[l.optionChildrenKey]) && e[l.optionChildrenKey].length && (d.value[e[l.optionUniqueIdKey]] = 1);
|
|
115
|
+
})), f.value = t;
|
|
116
|
+
};
|
|
117
|
+
return C(
|
|
118
|
+
() => u.value,
|
|
119
|
+
() => {
|
|
120
|
+
A(u.value);
|
|
121
|
+
}
|
|
122
|
+
), (n, t) => (v(), T(a(_), {
|
|
65
123
|
multi: "",
|
|
66
124
|
class: "tree-dropdown",
|
|
67
125
|
"show-select-all": !1,
|
|
68
|
-
"is-open":
|
|
69
|
-
options:
|
|
70
|
-
selected:
|
|
71
|
-
"display-value":
|
|
72
|
-
placeholder:
|
|
73
|
-
"inline-search
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
126
|
+
"is-open": o.isOpen,
|
|
127
|
+
options: f.value,
|
|
128
|
+
selected: o.selected,
|
|
129
|
+
"display-value": o.displayValue,
|
|
130
|
+
placeholder: o.placeholder,
|
|
131
|
+
"inline-search": "",
|
|
132
|
+
"inline-search-placeholder": o.inlineSearchPlaceholder,
|
|
133
|
+
"option-name-key": o.optionNameKey,
|
|
134
|
+
size: o.size,
|
|
135
|
+
"test-id": o.testId,
|
|
136
|
+
disabled: o.disabled,
|
|
78
137
|
"disable-virtual-scroll": "",
|
|
79
|
-
"override-option-count-calculation":
|
|
138
|
+
"override-option-count-calculation": z,
|
|
80
139
|
"trigger-show-all-selected-text": !1,
|
|
81
|
-
"
|
|
82
|
-
"onUpdate:isOpen":
|
|
83
|
-
onApply:
|
|
84
|
-
onClear:
|
|
140
|
+
"predefined-trigger": "default",
|
|
141
|
+
"onUpdate:isOpen": t[1] || (t[1] = (e) => I("update:isOpen", e)),
|
|
142
|
+
onApply: D,
|
|
143
|
+
onClear: x
|
|
85
144
|
}, {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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)
|
|
149
|
+
]),
|
|
150
|
+
_: 2
|
|
151
|
+
}, 1040)
|
|
152
|
+
]),
|
|
153
|
+
"inline-search": m(() => [
|
|
154
|
+
k(a(le), {
|
|
155
|
+
modelValue: u.value,
|
|
156
|
+
"onUpdate:modelValue": t[0] || (t[0] = (e) => u.value = e),
|
|
157
|
+
placeholder: o.inlineSearchPlaceholder,
|
|
158
|
+
variant: "transparent",
|
|
159
|
+
size: "md",
|
|
160
|
+
"auto-focus": "",
|
|
161
|
+
"test-id": o.testId
|
|
162
|
+
}, null, 8, ["modelValue", "placeholder", "test-id"])
|
|
163
|
+
]),
|
|
164
|
+
default: m(({ option: e, index: s }) => [
|
|
165
|
+
k(a(N), {
|
|
166
|
+
option: e,
|
|
167
|
+
"selected-prop": a(p)(e) ? a(K)(e) : b(e),
|
|
168
|
+
"is-indeterminate": !a(K)(e) && a(V)(e),
|
|
169
|
+
disabled: e[o.disabledOptionKey],
|
|
170
|
+
"name-key": o.optionNameKey,
|
|
171
|
+
"image-key": o.optionImageKey,
|
|
172
|
+
"icon-key": o.optionIconKey,
|
|
173
|
+
"icon-type": o.optionIconType,
|
|
174
|
+
"end-icon-key": o.optionEndIconKey,
|
|
175
|
+
"end-icon-type": o.optionEndIconType,
|
|
176
|
+
"tree-main-option": a(p)(e),
|
|
177
|
+
"tree-main-option-expanded": d.value[e[o.optionUniqueIdKey]],
|
|
178
|
+
"stop-option-click-event-propagation": "",
|
|
179
|
+
onClick: U(() => S(e), ["stop"]),
|
|
180
|
+
onToggleTreeCollapse: M
|
|
181
|
+
}, 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}`,
|
|
186
|
+
option: c,
|
|
187
|
+
"selected-prop": b(c),
|
|
188
|
+
disabled: c[o.disabledOptionKey],
|
|
189
|
+
"name-key": o.optionNameKey,
|
|
190
|
+
"image-key": o.optionImageKey,
|
|
191
|
+
"icon-key": o.optionIconKey,
|
|
192
|
+
"icon-type": o.optionIconType,
|
|
193
|
+
"end-icon-key": o.optionEndIconKey,
|
|
194
|
+
"end-icon-type": o.optionEndIconType,
|
|
195
|
+
"tree-child-shown": d.value[e[o.optionUniqueIdKey]],
|
|
196
|
+
"stop-option-click-event-propagation": "",
|
|
197
|
+
onClick: U(() => S(c), ["stop"])
|
|
198
|
+
}, 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
|
+
], 512), [
|
|
200
|
+
[Y, d.value[e[o.optionUniqueIdKey]]]
|
|
201
|
+
])
|
|
202
|
+
])) : Z("", !0)
|
|
115
203
|
]),
|
|
116
|
-
_:
|
|
204
|
+
_: 3
|
|
117
205
|
}, 8, ["is-open", "options", "selected", "display-value", "placeholder", "inline-search-placeholder", "option-name-key", "size", "test-id", "disabled"]));
|
|
118
206
|
}
|
|
119
207
|
});
|
|
120
208
|
export {
|
|
121
|
-
|
|
209
|
+
ve as default
|
|
122
210
|
};
|