@ironsource/shared-ui 2.1.10 → 2.1.11-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/DropdownV4.vue_vue_type_style_index_0_scoped_991a7aad_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css +1 -0
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css +1 -0
- package/components/dropdown/common/Dropdown.common.js +116 -114
- package/components/dropdown/v4/DropdownV4.vue.d.ts +5 -0
- package/components/dropdown/v4/DropdownV4.vue.js +3 -3
- package/components/dropdown/v4/DropdownV4.vue2.js +10 -9
- package/components/dropdown/v4/OptionV4.vue.js +3 -3
- package/components/dropdown/v4/OptionV4.vue2.js +105 -87
- package/components/dropdown/v4/TreeDropdown.vue.d.ts +4 -2
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +135 -127
- package/components/dropdown/v4/index.d.ts +40 -5
- package/index.d.ts +80 -10
- package/index.js +1 -1
- package/mocks/words.d.ts +1 -0
- package/package.json +1 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_2d635802_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_058de532_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_a51b6929_lang.css +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import "../../../OptionV4.
|
|
1
|
+
import "../../../OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css"; import { defineComponent as N, ref as I, watch as P, computed as $, openBlock as i, createBlock as y, unref as o, createSlots as V, withCtx as r, createElementVNode as s, normalizeClass as p, createCommentVNode as n, createElementBlock as a, renderSlot as u, createVNode as d, toDisplayString as g, createTextVNode as C, withModifiers as O, Fragment as F, renderList as D } from "vue";
|
|
2
2
|
import "../../typography/Heading.vue.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import R from "../../typography/Text.vue.js";
|
|
4
|
+
import j from "../../checkbox/v4/CheckboxV4.vue.js";
|
|
5
|
+
import T 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
|
-
import { promiseTimeout as
|
|
13
|
-
import { SHARED_ASSETS_CDN_DOMAIN as
|
|
14
|
-
const
|
|
7
|
+
import { NOOP as H } from "@vue/shared";
|
|
8
|
+
import { optionCommon as U } from "../common/Option.common.js";
|
|
9
|
+
import K from "../../typography/v4/Typography.vue.js";
|
|
10
|
+
import q from "../../tooltip/v4/TooltipV4.vue.js";
|
|
11
|
+
import { isElementTruncated as G } from "../../../utils/text.js";
|
|
12
|
+
import { promiseTimeout as J } from "@vueuse/core";
|
|
13
|
+
import { SHARED_ASSETS_CDN_DOMAIN as Q } from "../../../consts/configs.js";
|
|
14
|
+
const W = { class: "multiline-tooltip" }, X = {
|
|
15
15
|
key: 1,
|
|
16
16
|
class: "image"
|
|
17
|
-
},
|
|
17
|
+
}, Y = ["src"], Z = {
|
|
18
18
|
key: 2,
|
|
19
19
|
class: "flag"
|
|
20
|
-
},
|
|
20
|
+
}, _ = ["src"], ee = {
|
|
21
21
|
key: 3,
|
|
22
22
|
class: "start-icon"
|
|
23
|
-
},
|
|
23
|
+
}, te = { class: "main-text" }, oe = {
|
|
24
24
|
key: 0,
|
|
25
25
|
class: "caption-text"
|
|
26
|
-
},
|
|
26
|
+
}, ie = {
|
|
27
27
|
key: 4,
|
|
28
28
|
class: "end-icon"
|
|
29
|
-
},
|
|
29
|
+
}, ne = ["onClick"], le = { key: 0 }, ke = /* @__PURE__ */ N({
|
|
30
30
|
__name: "OptionV4",
|
|
31
31
|
props: {
|
|
32
32
|
option: { default: null },
|
|
@@ -52,150 +52,168 @@ const q = {
|
|
|
52
52
|
optionFlagKey: { default: null }
|
|
53
53
|
},
|
|
54
54
|
emits: ["toggleTreeCollapse"],
|
|
55
|
-
setup(e, { emit:
|
|
56
|
-
const l = e, { selected:
|
|
57
|
-
l.stopOptionClickEventPropagation && t.stopPropagation(), l.disabled ?
|
|
58
|
-
},
|
|
59
|
-
P([() => l.treeChildShown,
|
|
60
|
-
await
|
|
55
|
+
setup(e, { emit: B }) {
|
|
56
|
+
const l = e, { selected: v, isMulti: k, id: S, onClick: E, api: x } = U(l), z = (t) => {
|
|
57
|
+
l.stopOptionClickEventPropagation && t.stopPropagation(), l.disabled ? H() : E(t);
|
|
58
|
+
}, m = I(null), b = I(!1);
|
|
59
|
+
P([() => l.treeChildShown, m], async () => {
|
|
60
|
+
await J(100), b.value = m.value && G(m.value);
|
|
61
61
|
});
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
return (t,
|
|
66
|
-
text:
|
|
67
|
-
"test-id":
|
|
62
|
+
const A = (t) => t && typeof t == "object" && "optionTooltipText" in t ? (Array.isArray(t.optionTooltipText), t.optionTooltipText) : b.value ? t[l.nameKey] : "", h = $(() => A(l.option)), L = (t) => t && typeof t == "object" && "optionTooltipTestId" in t ? t.optionTooltipTestId : null, M = () => {
|
|
63
|
+
B("toggleTreeCollapse", l.option);
|
|
64
|
+
}, w = $(() => l.optionFlagKey ? `${Q}/assets/flags/v4/${l.option[l.optionFlagKey]?.toLowerCase()}.svg` : null);
|
|
65
|
+
return (t, f) => (i(), y(o(q), {
|
|
66
|
+
text: o(h),
|
|
67
|
+
"test-id": L(e.option),
|
|
68
68
|
placement: e.toolTipPlacement,
|
|
69
69
|
class: "tooltip-option"
|
|
70
|
-
}, {
|
|
71
|
-
default:
|
|
70
|
+
}, V({
|
|
71
|
+
default: r(() => [
|
|
72
72
|
s("div", {
|
|
73
73
|
ref: "el",
|
|
74
|
-
class:
|
|
74
|
+
class: p(["item-container", {
|
|
75
75
|
"item-container--disabled": e.disabled,
|
|
76
76
|
"item-container--active": e.nameKey ? !1 : e.active,
|
|
77
|
-
"item-container--selected": o(
|
|
78
|
-
"item-container--multi": o(
|
|
77
|
+
"item-container--selected": o(v),
|
|
78
|
+
"item-container--multi": o(k)
|
|
79
79
|
}])
|
|
80
80
|
}, [
|
|
81
81
|
s("div", {
|
|
82
|
-
class:
|
|
83
|
-
"item--multi": o(
|
|
82
|
+
class: p(["item", {
|
|
83
|
+
"item--multi": o(k),
|
|
84
84
|
"item--with-icon": t.$slots["icon-start"] || t.$slots.image
|
|
85
85
|
}])
|
|
86
86
|
}, [
|
|
87
|
-
o(
|
|
87
|
+
o(k) ? (i(), y(o(j), {
|
|
88
88
|
key: 0,
|
|
89
|
-
id: o(
|
|
89
|
+
id: o(S).toString(),
|
|
90
90
|
tabindex: "-1",
|
|
91
91
|
class: "checkbox",
|
|
92
|
-
"is-checked": o(
|
|
92
|
+
"is-checked": o(v),
|
|
93
93
|
"is-indeterminate": e.isIndeterminate,
|
|
94
|
-
onClick:
|
|
95
|
-
}, null, 8, ["id", "is-checked", "is-indeterminate"])) :
|
|
96
|
-
t.$slots.image || e.imageKey ? (
|
|
97
|
-
|
|
98
|
-
e.imageKey ? (
|
|
94
|
+
onClick: f[0] || (f[0] = (c) => z(c))
|
|
95
|
+
}, null, 8, ["id", "is-checked", "is-indeterminate"])) : n("", !0),
|
|
96
|
+
t.$slots.image || e.imageKey ? (i(), a("div", X, [
|
|
97
|
+
u(t.$slots, "image", {}, () => [
|
|
98
|
+
e.imageKey ? (i(), a("img", {
|
|
99
99
|
key: 0,
|
|
100
100
|
src: e.option[e.imageKey]
|
|
101
|
-
}, null, 8,
|
|
101
|
+
}, null, 8, Y)) : n("", !0)
|
|
102
102
|
], !0)
|
|
103
|
-
])) :
|
|
104
|
-
t.$slots.flag || e.optionFlagKey ? (
|
|
105
|
-
|
|
106
|
-
o(
|
|
103
|
+
])) : n("", !0),
|
|
104
|
+
t.$slots.flag || e.optionFlagKey ? (i(), a("div", Z, [
|
|
105
|
+
u(t.$slots, "flag", {}, () => [
|
|
106
|
+
o(w) ? (i(), a("img", {
|
|
107
107
|
key: 0,
|
|
108
|
-
src: o(
|
|
109
|
-
}, null, 8,
|
|
108
|
+
src: o(w)
|
|
109
|
+
}, null, 8, _)) : n("", !0)
|
|
110
110
|
], !0)
|
|
111
|
-
])) :
|
|
112
|
-
t.$slots["icon-start"] || e.iconKey ? (
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
])) : n("", !0),
|
|
112
|
+
t.$slots["icon-start"] || e.iconKey ? (i(), a("div", ee, [
|
|
113
|
+
u(t.$slots, "icon-start", {}, () => [
|
|
114
|
+
d(o(T), {
|
|
115
115
|
type: e.iconType,
|
|
116
116
|
name: e.option[e.iconKey],
|
|
117
117
|
size: e.iconType === "regular" ? "20px" : "16px"
|
|
118
118
|
}, null, 8, ["type", "name", "size"])
|
|
119
119
|
], !0)
|
|
120
|
-
])) :
|
|
120
|
+
])) : n("", !0),
|
|
121
121
|
s("div", {
|
|
122
122
|
ref_key: "textContainerRef",
|
|
123
|
-
ref:
|
|
123
|
+
ref: m,
|
|
124
124
|
class: "text-container"
|
|
125
125
|
}, [
|
|
126
|
-
|
|
126
|
+
d(o(K), {
|
|
127
127
|
class: "option-text",
|
|
128
128
|
variant: "body2"
|
|
129
129
|
}, {
|
|
130
|
-
default:
|
|
131
|
-
|
|
130
|
+
default: r(() => [
|
|
131
|
+
u(t.$slots, "default", {}, () => [
|
|
132
132
|
s("div", {
|
|
133
|
-
class:
|
|
133
|
+
class: p(`option-content-${e.optionTwoLinesVariant || "horizontal"}`)
|
|
134
134
|
}, [
|
|
135
|
-
s("div",
|
|
136
|
-
e.optionTwoLinesKey ? (
|
|
137
|
-
|
|
138
|
-
default:
|
|
139
|
-
|
|
135
|
+
s("div", te, g(e.option[e.nameKey]), 1),
|
|
136
|
+
e.optionTwoLinesKey ? (i(), a("div", oe, [
|
|
137
|
+
d(o(K), { variant: "caption" }, {
|
|
138
|
+
default: r(() => [
|
|
139
|
+
C(g(e.option[e.optionTwoLinesKey]), 1)
|
|
140
140
|
]),
|
|
141
141
|
_: 1
|
|
142
142
|
})
|
|
143
|
-
])) :
|
|
143
|
+
])) : n("", !0)
|
|
144
144
|
], 2)
|
|
145
145
|
], !0)
|
|
146
146
|
]),
|
|
147
147
|
_: 3
|
|
148
148
|
}),
|
|
149
|
-
e.subtitle ? (
|
|
149
|
+
e.subtitle ? (i(), y(o(R), {
|
|
150
150
|
key: 0,
|
|
151
151
|
class: "subtitle",
|
|
152
152
|
size: "xs"
|
|
153
153
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
|
|
154
|
+
default: r(() => [
|
|
155
|
+
C(g(e.subtitle), 1)
|
|
156
156
|
]),
|
|
157
157
|
_: 1
|
|
158
|
-
})) :
|
|
158
|
+
})) : n("", !0)
|
|
159
159
|
], 512),
|
|
160
|
-
t.$slots["icon-end"] || e.endIconKey && e.option[e.endIconKey] ? (
|
|
161
|
-
|
|
162
|
-
|
|
160
|
+
t.$slots["icon-end"] || e.endIconKey && e.option[e.endIconKey] ? (i(), a("div", ie, [
|
|
161
|
+
u(t.$slots, "icon-end", {}, () => [
|
|
162
|
+
d(o(T), {
|
|
163
163
|
type: e.endIconType,
|
|
164
164
|
name: e.option[e.endIconKey],
|
|
165
165
|
size: e.endIconType === "regular" || e.endIconType === "ab-test" ? "20px" : "16px"
|
|
166
166
|
}, null, 8, ["type", "name", "size"])
|
|
167
167
|
], !0)
|
|
168
|
-
])) :
|
|
169
|
-
e.treeMainOption ? (
|
|
168
|
+
])) : n("", !0),
|
|
169
|
+
e.treeMainOption ? (i(), a("div", {
|
|
170
170
|
key: 5,
|
|
171
171
|
class: "tree-main-arrow-wrapper",
|
|
172
|
-
onClick:
|
|
172
|
+
onClick: O(M, ["stop"])
|
|
173
173
|
}, [
|
|
174
|
-
|
|
174
|
+
d(o(T), {
|
|
175
175
|
name: "caret-down",
|
|
176
176
|
size: "16px",
|
|
177
|
-
class:
|
|
177
|
+
class: p(`app-trigger--icon ${e.treeMainOptionExpanded && "expanded"}`)
|
|
178
178
|
}, null, 8, ["class"])
|
|
179
|
-
], 8,
|
|
179
|
+
], 8, ne)) : n("", !0)
|
|
180
180
|
], 2),
|
|
181
|
-
o(
|
|
181
|
+
o(x).clearable && o(v) ? (i(), a("div", le, [
|
|
182
182
|
s("button", {
|
|
183
183
|
class: "clear-button",
|
|
184
|
-
onClick:
|
|
184
|
+
onClick: f[1] || (f[1] = O((c) => o(x).clearSelection(), ["prevent", "stop"]))
|
|
185
185
|
}, [
|
|
186
|
-
|
|
186
|
+
d(o(T), {
|
|
187
187
|
name: "close",
|
|
188
188
|
width: "8",
|
|
189
189
|
height: "8"
|
|
190
190
|
})
|
|
191
191
|
])
|
|
192
|
-
])) :
|
|
192
|
+
])) : n("", !0)
|
|
193
193
|
], 2)
|
|
194
194
|
]),
|
|
195
|
-
_:
|
|
196
|
-
},
|
|
195
|
+
_: 2
|
|
196
|
+
}, [
|
|
197
|
+
Array.isArray(o(h)) ? {
|
|
198
|
+
name: "tooltip",
|
|
199
|
+
fn: r(() => [
|
|
200
|
+
s("div", W, [
|
|
201
|
+
(i(!0), a(F, null, D(o(h), (c) => (i(), y(o(K), {
|
|
202
|
+
key: c,
|
|
203
|
+
variant: "body2"
|
|
204
|
+
}, {
|
|
205
|
+
default: r(() => [
|
|
206
|
+
C(g(c), 1)
|
|
207
|
+
]),
|
|
208
|
+
_: 2
|
|
209
|
+
}, 1024))), 128))
|
|
210
|
+
])
|
|
211
|
+
]),
|
|
212
|
+
key: "0"
|
|
213
|
+
} : void 0
|
|
214
|
+
]), 1032, ["text", "test-id", "placement"]));
|
|
197
215
|
}
|
|
198
216
|
});
|
|
199
217
|
export {
|
|
200
|
-
|
|
218
|
+
ke as default
|
|
201
219
|
};
|
|
@@ -17,7 +17,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
17
17
|
valueToCopy?: string;
|
|
18
18
|
disabledOptionKey?: string;
|
|
19
19
|
optionChildrenKey: string;
|
|
20
|
-
optionUniqueIdKey: string;
|
|
20
|
+
optionUniqueIdKey: string | number;
|
|
21
|
+
preExpandedOptions: string[] | number[];
|
|
21
22
|
}>, {
|
|
22
23
|
selected: any;
|
|
23
24
|
placeholder: string;
|
|
@@ -55,7 +56,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
55
56
|
valueToCopy?: string;
|
|
56
57
|
disabledOptionKey?: string;
|
|
57
58
|
optionChildrenKey: string;
|
|
58
|
-
optionUniqueIdKey: string;
|
|
59
|
+
optionUniqueIdKey: string | number;
|
|
60
|
+
preExpandedOptions: string[] | number[];
|
|
59
61
|
}>, {
|
|
60
62
|
selected: any;
|
|
61
63
|
placeholder: 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_6ac5f602_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ e(o, [["__scopeId", "data-v-6ac5f602"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|