@ironsource/shared-ui 2.1.6-rc.21 → 2.1.6-rc.23
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/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_454709fb_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_2e7a89bc_lang.css +1 -0
- package/HelpIcon.vue_vue_type_style_index_0_scoped_06fce2e3_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_89b98201_lang.css +1 -0
- package/components/dropdown/common/Dropdown.common.js +46 -44
- package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +11 -0
- package/components/dropdown/v4/AppDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/AppDropdownTrigger.vue2.js +72 -58
- package/components/dropdown/v4/DropdownV4.vue.js +3 -3
- package/components/dropdown/v4/DropdownV4.vue2.js +44 -42
- package/components/dropdown/v4/OptionV4.vue.js +3 -3
- package/components/dropdown/v4/OptionV4.vue2.js +12 -12
- package/components/dropdown/v4/index.d.ts +40 -1
- package/components/table/v4/HelpIcon.vue.js +5 -5
- package/components/table/v4/HelpIcon.vue2.js +5 -5
- package/index.d.ts +80 -2
- package/mocks/apps.d.ts +1 -0
- package/package.json +1 -1
- package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_39c47ad1_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_0363db63_lang.css +0 -1
- package/HelpIcon.vue_vue_type_style_index_0_scoped_7a611779_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_e0c24b6a_lang.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.app-trigger-wrapper[data-v-454709fb]{display:flex}.app-trigger-wrapper.with-copy .app-trigger[data-v-454709fb]{border-radius:var(--border-radius-lg) 0 0 var(--border-radius-lg);width:calc(100% - 41px)}.app-trigger-key[data-v-454709fb]{flex:none}.app-trigger-key--content[data-v-454709fb]{padding:10px;background:var(--default-main);cursor:pointer;border-radius:0 var(--border-radius-lg) var(--border-radius-lg) 0;border-left:1px solid var(--common-divider);color:var(--action-active)}.app-trigger-key--content[data-v-454709fb]:hover{background:var(--action-selected);color:var(--action-primary)}.app-trigger[data-v-454709fb]{width:100%;padding:0 12px;border-radius:var(--border-radius-lg);cursor:pointer;user-select:none;display:inline-flex;background:var(--default-main);height:40px;align-items:center}.app-trigger[data-v-454709fb]:hover,.app-trigger.active[data-v-454709fb]{background:var(--action-selected)}.app-trigger.disabled[data-v-454709fb]{cursor:auto}.app-trigger--content[data-v-454709fb]{color:var(--text-primary);display:flex;column-gap:4px;width:calc(100% - 20px);align-items:center}.app-trigger--content .x-circle-wrapper[data-v-454709fb]{color:var(--primary-dark)}.app-trigger--content .x-circle-wrapper[data-v-454709fb]:hover{color:var(--primary-main)}.app-trigger--icon[data-v-454709fb]{display:flex;align-items:center;color:var(--action-active)}.app-trigger .displayed-value[data-v-454709fb]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.app-trigger .image[data-v-454709fb]{width:28px;height:28px;flex:none}.app-trigger .image img[data-v-454709fb]{border-radius:4px;width:100%;height:100%}.app-trigger .start-icon[data-v-454709fb],.app-trigger .end-icon[data-v-454709fb]{display:flex;color:var(--action-active)}.app-trigger .end-icon[data-v-454709fb]{margin-right:var(--spacing-100)}.app-trigger .label-text[data-v-454709fb]{display:flex;align-items:center;gap:8px}.app-trigger .label-text .text-content[data-v-454709fb]{display:flex;align-items:center;gap:4px;width:100%}.app-trigger .label-text .text-content .text-content-value[data-v-454709fb]{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.app-trigger .label-text .is-mandatory[data-v-454709fb]{padding-top:5px;color:var(--error-main)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.v-enter-active[data-v-2e7a89bc],.v-leave-active[data-v-2e7a89bc]{transition:opacity .25s ease}ol[data-v-2e7a89bc],ul[data-v-2e7a89bc],menu[data-v-2e7a89bc]{list-style:none;margin:0;padding:0}.dropdown.full-width[data-v-2e7a89bc],.dropdown.full-width .button__container[data-v-2e7a89bc]{width:100%}.dropdown-list-wrapper[data-v-2e7a89bc]{display:flex;flex-direction:column;padding:.5rem .5rem .25rem}.dropdown-list-wrapper--multi[data-v-2e7a89bc]{padding:.5rem}.list-container--multi[data-v-2e7a89bc]{margin-bottom:0}.inline-search .inline-search-wrapper[data-v-2e7a89bc]{padding-bottom:.25rem}.inline-search .list-container[data-v-2e7a89bc]{padding-top:0}.no-result-container[data-v-2e7a89bc]{height:100%;display:flex;align-items:center;padding:.375rem .5rem;color:var(--text-disabled)}.no-result[data-v-2e7a89bc]{color:var(--text-disabled);padding-left:.5rem}.list[data-v-2e7a89bc]{outline:none;display:flex;flex-direction:column;width:100%;min-height:2rem}.list--multi[data-v-2e7a89bc]{margin-bottom:.5rem;border-bottom-left-radius:0;border-bottom-right-radius:0}.image-slot[data-v-2e7a89bc]{margin-right:.5rem}.actions-wrapper[data-v-2e7a89bc]{display:flex;width:100%;padding:.5rem .5rem .5rem .125rem;padding-bottom:0;border-top:1px solid var(--common-divider);justify-content:space-between;margin-top:.25rem}.apply-button[data-v-2e7a89bc]{margin-left:.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.table-help-icon[data-v-06fce2e3]{margin-left:var(--spacing-50);color:var(--action-active);margin-right:calc(var(--spacing-50) * -1)}.info-icon[data-v-06fce2e3]{color:var(--action-active)}.info-icon[data-v-06fce2e3]:hover{color:var(--action-primary)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.label[data-v-89b98201]{color:#41454d}.item-container[data-v-89b98201]{width:100%;display:flex;align-items:center;cursor:pointer;border-radius:var(--border-radius-lg);margin-bottom:.25rem;color:var(--text-primary);padding:6px 8px}.item-container--disabled[data-v-89b98201]{cursor:initial;color:var(--text-disabled)}.item-container[data-v-89b98201]:hover:not(.item-container--disabled){background-color:var(--action-hover)}.item-container--active[data-v-89b98201],.item-container[data-v-89b98201]:active{background-color:var(--action-selected)}.item-container:not(.item-container--multi).item-container--selected[data-v-89b98201]{background-color:var(--action-selected)}.subtitle[data-v-89b98201]{color:#7b838c;line-height:1rem}.clear-button[data-v-89b98201]{display:flex;padding:0 4px;color:#7b838c;align-items:center;height:auto;background-image:none;min-width:auto;border:none;background-color:transparent}.clear-button[data-v-89b98201]:hover{color:#3083ff}.item[data-v-89b98201]{width:100%;display:flex;gap:.5rem;align-items:center}.item--with-icon[data-v-89b98201],.item--multi[data-v-89b98201]{display:flex;flex-direction:row;align-items:center;justify-content:start}.item .image[data-v-89b98201]{width:20px;height:20px;flex:none}.item .image img[data-v-89b98201]{width:20px;height:20px;border-radius:4px}.item .start-icon[data-v-89b98201],.item .end-icon[data-v-89b98201]{display:flex;color:var(--action-active)}.item .option-text[data-v-89b98201]{line-height:1.1875rem}.text-container[data-v-89b98201]{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.tooltip-option[data-v-89b98201]{display:block}.tooltip-option[data-v-89b98201] .container{width:100%}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useToggle as me } from "../../../composables/useToggle.js";
|
|
2
|
-
import { ref as n, computed as r, watch as
|
|
2
|
+
import { ref as n, computed as r, watch as m, useSlots as Pe, toRaw as A, nextTick as N, provide as Te, onMounted as we } from "vue";
|
|
3
3
|
import { isObjectInArray as W } from "../../../utils/array.js";
|
|
4
4
|
import { objectsEqual as xe } from "../../../utils/object.js";
|
|
5
5
|
import { useClamp as Ie, useVirtualList as De, onClickOutside as Y } from "@vueuse/core";
|
|
6
|
-
import { Mode as
|
|
6
|
+
import { Mode as P, Type as _, DropdownContext as Ne } from "./DropdownContext.js";
|
|
7
7
|
import { pxToRem as Re } from "../../../utils/style.js";
|
|
8
8
|
import { useEditableContext as Ee } from "../../table-cells/common/EditableContext.js";
|
|
9
9
|
const Ue = (l, O, b) => {
|
|
@@ -14,25 +14,25 @@ const Ue = (l, O, b) => {
|
|
|
14
14
|
})(k || (k = {}));
|
|
15
15
|
const a = n(
|
|
16
16
|
l.selected
|
|
17
|
-
),
|
|
17
|
+
), R = Ee(), u = r({
|
|
18
18
|
get() {
|
|
19
|
-
return
|
|
19
|
+
return R?.value?.value ?? a.value;
|
|
20
20
|
},
|
|
21
21
|
set(e) {
|
|
22
|
-
|
|
22
|
+
R.onChange?.(e), R.onClose?.(), O("update:selected", e);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
|
-
|
|
25
|
+
m(
|
|
26
26
|
() => l.selected,
|
|
27
27
|
() => {
|
|
28
28
|
a.value = l.selected, v.value = l.selected;
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
|
-
const p = Pe(),
|
|
31
|
+
const p = Pe(), w = n(null), g = n(null), V = n(null), E = n(null), H = n(null), x = n(null), F = n(), B = n(null), L = n(null), U = n(null), ee = 8, le = r(() => x.value ? x.value.getBoundingClientRect().height + ee + l.distance : 0), c = n([]), I = n(-1), T = n(""), v = n(l.selected || []), q = () => x.value?.focus(), [d, te, ae] = me({
|
|
32
32
|
disabled: l.disabled,
|
|
33
33
|
initialValue: l.defaultOpen
|
|
34
34
|
});
|
|
35
|
-
|
|
35
|
+
m(
|
|
36
36
|
() => l.disabled,
|
|
37
37
|
(e) => {
|
|
38
38
|
e !== void 0 && ae(e);
|
|
@@ -60,8 +60,8 @@ const Ue = (l, O, b) => {
|
|
|
60
60
|
}), $ = r(() => {
|
|
61
61
|
if (Array.isArray(a.value))
|
|
62
62
|
return a.value.length === s.value.length;
|
|
63
|
-
}), oe = r(() => !l.multi || !Array.isArray(a.value) ? !1 : a.value.length > 0 && a.value.length < s.value.length),
|
|
64
|
-
|
|
63
|
+
}), oe = r(() => !l.multi || !Array.isArray(a.value) ? !1 : a.value.length > 0 && a.value.length < s.value.length), M = (e) => {
|
|
64
|
+
T.value = e;
|
|
65
65
|
}, se = r(() => {
|
|
66
66
|
const e = A(v.value), t = {
|
|
67
67
|
selected: [],
|
|
@@ -73,41 +73,43 @@ const Ue = (l, O, b) => {
|
|
|
73
73
|
}), [].concat(t.selected, t.notSelected);
|
|
74
74
|
}), s = r(() => {
|
|
75
75
|
const e = Array.isArray(v.value) && l.multi && b.VERSION === 4 ? se.value : l.options;
|
|
76
|
-
return l.onSearch ? e.filter((t) => l.onSearch(t,
|
|
77
|
-
}), ce = r(() => c.value[0]?.hasSubtitle), X = r(() => i.mode ===
|
|
76
|
+
return l.onSearch ? e.filter((t) => l.onSearch(t, T.value)) : e;
|
|
77
|
+
}), ce = r(() => c.value[0]?.hasSubtitle), X = r(() => i.mode === P.Multi), j = r(
|
|
78
78
|
() => ce.value ? b.MULTILINE_LIST_HEIGHT : b.LIST_HEIGHT
|
|
79
79
|
), {
|
|
80
80
|
list: z,
|
|
81
81
|
containerProps: J,
|
|
82
82
|
wrapperProps: ve,
|
|
83
|
-
scrollTo:
|
|
83
|
+
scrollTo: D
|
|
84
84
|
} = De(s, {
|
|
85
85
|
itemHeight: j.value,
|
|
86
86
|
overscan: 2
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
m(
|
|
89
89
|
() => l.isOpen,
|
|
90
90
|
(e) => {
|
|
91
91
|
G(e);
|
|
92
92
|
}
|
|
93
|
-
),
|
|
94
|
-
await
|
|
95
|
-
}),
|
|
96
|
-
[d, o,
|
|
93
|
+
), m([I], async () => {
|
|
94
|
+
await N();
|
|
95
|
+
}), m(
|
|
96
|
+
[d, o, I],
|
|
97
97
|
async ([e], [t]) => {
|
|
98
|
-
d.value && (await
|
|
99
|
-
l.multi && b.VERSION === 4 ||
|
|
98
|
+
d.value && (await N(), I.value !== -1 && e !== t && setTimeout(() => {
|
|
99
|
+
l.multi && b.VERSION === 4 || D(I.value);
|
|
100
100
|
}), o.value && setTimeout(() => {
|
|
101
|
-
|
|
101
|
+
D(o.value);
|
|
102
102
|
}));
|
|
103
103
|
}
|
|
104
|
-
)
|
|
104
|
+
), m(T, () => {
|
|
105
|
+
D(0);
|
|
106
|
+
});
|
|
105
107
|
const h = (e, t = !1) => {
|
|
106
|
-
l.disabled || (G(e),
|
|
107
|
-
d.value && O("opened"), d.value || O("closed"),
|
|
108
|
+
l.disabled || (G(e), N(() => {
|
|
109
|
+
d.value && O("opened"), d.value || O("closed"), w.value && t && w.value.focus();
|
|
108
110
|
}));
|
|
109
111
|
};
|
|
110
|
-
|
|
112
|
+
m(d, (e) => {
|
|
111
113
|
if (e) {
|
|
112
114
|
X.value && Array.isArray(u.value) && (v.value = A(u.value).slice());
|
|
113
115
|
return;
|
|
@@ -133,11 +135,11 @@ const Ue = (l, O, b) => {
|
|
|
133
135
|
}, C = (e, t) => {
|
|
134
136
|
if (e = A(e), c.value[t]?.disabled)
|
|
135
137
|
return;
|
|
136
|
-
if (
|
|
138
|
+
if (I.value = t, i.mode !== P.Multi) {
|
|
137
139
|
l.keepOpen || h(!1), i.goToOption(
|
|
138
140
|
0
|
|
139
141
|
/* None */
|
|
140
|
-
), u.value = e,
|
|
142
|
+
), u.value = e, M(""), q(), i.type === _.Search && g.value && (g.value.value = l.displayValue(e));
|
|
141
143
|
return;
|
|
142
144
|
}
|
|
143
145
|
if (!Array.isArray(a.value))
|
|
@@ -158,12 +160,12 @@ const Ue = (l, O, b) => {
|
|
|
158
160
|
options: c,
|
|
159
161
|
selectedOption: u,
|
|
160
162
|
labelRef: H,
|
|
161
|
-
activeOption:
|
|
162
|
-
listRef:
|
|
163
|
+
activeOption: E,
|
|
164
|
+
listRef: w,
|
|
163
165
|
clearable: l.clearable,
|
|
164
166
|
type: p.input ? _.Search : _.Dropdown,
|
|
165
|
-
mode: l.multi ?
|
|
166
|
-
query:
|
|
167
|
+
mode: l.multi ? P.Multi : P.Single,
|
|
168
|
+
query: T,
|
|
167
169
|
selectedValue: K,
|
|
168
170
|
toggle: h,
|
|
169
171
|
disabled: l.disabled,
|
|
@@ -173,9 +175,9 @@ const Ue = (l, O, b) => {
|
|
|
173
175
|
placeholder: l.placeholder,
|
|
174
176
|
select: C,
|
|
175
177
|
clearSelection: () => {
|
|
176
|
-
|
|
178
|
+
M(""), u.value = i.mode === P.Single ? null : [], v.value = i.mode === P.Single ? null : [], g.value && (g.value.value = "");
|
|
177
179
|
},
|
|
178
|
-
search:
|
|
180
|
+
search: M,
|
|
179
181
|
goToOption: async (e) => {
|
|
180
182
|
if (!d.value)
|
|
181
183
|
return;
|
|
@@ -185,11 +187,11 @@ const Ue = (l, O, b) => {
|
|
|
185
187
|
).length, S = s.value.length - y;
|
|
186
188
|
for (t > S && (t = S + 1); ; ) {
|
|
187
189
|
if (!c.value[t]?.disabled) {
|
|
188
|
-
|
|
190
|
+
E.value = s.value[t], o.value = t;
|
|
189
191
|
return;
|
|
190
192
|
}
|
|
191
193
|
if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!he(o.value)) {
|
|
192
|
-
|
|
194
|
+
E.value = s.value[t], o.value = t;
|
|
193
195
|
return;
|
|
194
196
|
}
|
|
195
197
|
}
|
|
@@ -205,13 +207,13 @@ const Ue = (l, O, b) => {
|
|
|
205
207
|
}
|
|
206
208
|
};
|
|
207
209
|
Te(Ne, i), Y(
|
|
208
|
-
|
|
210
|
+
w,
|
|
209
211
|
() => {
|
|
210
212
|
d.value && Q();
|
|
211
213
|
},
|
|
212
214
|
{
|
|
213
215
|
ignore: [
|
|
214
|
-
|
|
216
|
+
x,
|
|
215
217
|
B,
|
|
216
218
|
L,
|
|
217
219
|
U,
|
|
@@ -224,14 +226,14 @@ const Ue = (l, O, b) => {
|
|
|
224
226
|
g.value && (g.value.value = i.query.value = "");
|
|
225
227
|
};
|
|
226
228
|
we(async () => {
|
|
227
|
-
l.autoFocus && (await
|
|
229
|
+
l.autoFocus && (await N(), setTimeout(() => {
|
|
228
230
|
V.value.focus();
|
|
229
231
|
})), i.goToOption(0);
|
|
230
232
|
});
|
|
231
233
|
const Se = () => {
|
|
232
234
|
u.value = a.value, Array.isArray(u.value) && (v.value = A(u.value).slice()), O("apply", u.value), h(!1), ye();
|
|
233
235
|
}, Q = () => {
|
|
234
|
-
X.value && Array.isArray(v.value) && (u.value = A(v.value).slice()),
|
|
236
|
+
X.value && Array.isArray(v.value) && (u.value = A(v.value).slice()), T.value = "", h(!1);
|
|
235
237
|
}, be = (e) => {
|
|
236
238
|
if (!l.disableKeyboardEvents)
|
|
237
239
|
switch (e.key) {
|
|
@@ -281,7 +283,7 @@ const Ue = (l, O, b) => {
|
|
|
281
283
|
h(!0);
|
|
282
284
|
return;
|
|
283
285
|
}
|
|
284
|
-
C(s.value[o.value], o.value), i.mode ===
|
|
286
|
+
C(s.value[o.value], o.value), i.mode === P.Single && !l.keepOpen && h(!1), e.preventDefault();
|
|
285
287
|
break;
|
|
286
288
|
}
|
|
287
289
|
}
|
|
@@ -300,7 +302,7 @@ const Ue = (l, O, b) => {
|
|
|
300
302
|
onButtonKeydown: be,
|
|
301
303
|
displayedValue: re,
|
|
302
304
|
labelRef: H,
|
|
303
|
-
query:
|
|
305
|
+
query: T,
|
|
304
306
|
containerProps: J,
|
|
305
307
|
calculateTableHeight: Oe,
|
|
306
308
|
wrapperProps: ve,
|
|
@@ -317,10 +319,10 @@ const Ue = (l, O, b) => {
|
|
|
317
319
|
activeIndex: o,
|
|
318
320
|
onCancel: Q,
|
|
319
321
|
onApply: Se,
|
|
320
|
-
scrollTo:
|
|
322
|
+
scrollTo: D,
|
|
321
323
|
onClickOutside: Y,
|
|
322
|
-
listRef:
|
|
323
|
-
buttonRef:
|
|
324
|
+
listRef: w,
|
|
325
|
+
buttonRef: x,
|
|
324
326
|
apply: B,
|
|
325
327
|
cancel: L,
|
|
326
328
|
el: V,
|
|
@@ -18,6 +18,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
18
18
|
optionImageKey?: string;
|
|
19
19
|
optionIconKey?: string;
|
|
20
20
|
optionIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
21
|
+
optionEndIconKey?: string;
|
|
22
|
+
optionEndIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
21
23
|
}>, {
|
|
22
24
|
placeholder: string;
|
|
23
25
|
selectedOption: any;
|
|
@@ -41,6 +43,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
41
43
|
optionImageKey: any;
|
|
42
44
|
optionIconKey: any;
|
|
43
45
|
optionIconType: any;
|
|
46
|
+
optionEndIconKey: any;
|
|
47
|
+
optionEndIconType: any;
|
|
44
48
|
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
45
49
|
click: () => void;
|
|
46
50
|
copyToClipboard: () => void;
|
|
@@ -64,6 +68,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
64
68
|
optionImageKey?: string;
|
|
65
69
|
optionIconKey?: string;
|
|
66
70
|
optionIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
71
|
+
optionEndIconKey?: string;
|
|
72
|
+
optionEndIconType?: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
67
73
|
}>, {
|
|
68
74
|
placeholder: string;
|
|
69
75
|
selectedOption: any;
|
|
@@ -87,6 +93,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
87
93
|
optionImageKey: any;
|
|
88
94
|
optionIconKey: any;
|
|
89
95
|
optionIconType: any;
|
|
96
|
+
optionEndIconKey: any;
|
|
97
|
+
optionEndIconType: any;
|
|
90
98
|
}>>> & {
|
|
91
99
|
onClick?: () => any;
|
|
92
100
|
onCopyToClipboard?: () => any;
|
|
@@ -106,12 +114,15 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
106
114
|
optionIconKey: string;
|
|
107
115
|
optionImageKey: string;
|
|
108
116
|
optionIconType: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
117
|
+
optionEndIconKey: string;
|
|
118
|
+
optionEndIconType: "fill" | "bold" | "regular" | "branded" | "ad-unit" | "ab-test";
|
|
109
119
|
valueToCopy: string;
|
|
110
120
|
selectedOption: any;
|
|
111
121
|
brandIconType: "android" | "ios";
|
|
112
122
|
}>, {
|
|
113
123
|
image?(_: {}): any;
|
|
114
124
|
"icon-start"?(_: {}): any;
|
|
125
|
+
"icon-end"?(_: {}): any;
|
|
115
126
|
}>;
|
|
116
127
|
export default _default;
|
|
117
128
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./AppDropdownTrigger.vue2.js";
|
|
2
2
|
/* empty css */import p from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../AppDropdownTrigger.
|
|
4
|
-
const s = /* @__PURE__ */ p(o, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../../AppDropdownTrigger.vue_vue_type_style_index_0_scoped_454709fb_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ p(o, [["__scopeId", "data-v-454709fb"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import "../../../AppDropdownTrigger.
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { DropdownTestIdModifiers as
|
|
5
|
-
import { useTestIdAttrs as
|
|
6
|
-
import
|
|
7
|
-
import { useClipboard as
|
|
8
|
-
import { Snackbar as
|
|
9
|
-
const
|
|
1
|
+
import "../../../AppDropdownTrigger.vue_vue_type_style_index_0_scoped_454709fb_lang.css"; import { defineComponent as A, computed as r, openBlock as n, createElementBlock as a, normalizeClass as $, createElementVNode as s, mergeProps as v, unref as o, renderSlot as u, createCommentVNode as d, createVNode as c, withCtx as I, toDisplayString as V } from "vue";
|
|
2
|
+
import p from "../../icon/v4/IconV4.vue.js";
|
|
3
|
+
import B from "../../typography/v4/Typography.vue.js";
|
|
4
|
+
import { DropdownTestIdModifiers as y } from "../../../testids/index.js";
|
|
5
|
+
import { useTestIdAttrs as E } from "../../../utils/testIds.js";
|
|
6
|
+
import x from "../../tooltip/v4/TooltipV4.vue.js";
|
|
7
|
+
import { useClipboard as z } from "@vueuse/core";
|
|
8
|
+
import { Snackbar as N } from "../../snackbar/v4/index.js";
|
|
9
|
+
const w = { class: "app-trigger--content" }, S = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "image"
|
|
12
|
-
},
|
|
12
|
+
}, D = ["src"], P = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "start-icon"
|
|
15
15
|
}, R = { class: "label-text" }, U = { key: 0 }, L = { class: "text-content" }, M = { class: "text-content-value" }, W = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "is-mandatory"
|
|
18
|
-
}, j = {
|
|
18
|
+
}, j = {
|
|
19
|
+
key: 2,
|
|
20
|
+
class: "end-icon"
|
|
21
|
+
}, q = { class: "app-trigger-key--content" }, ee = /* @__PURE__ */ A({
|
|
19
22
|
__name: "AppDropdownTrigger",
|
|
20
23
|
props: {
|
|
21
24
|
placeholder: { default: "Select app" },
|
|
@@ -36,97 +39,108 @@ const S = { class: "app-trigger--content" }, D = {
|
|
|
36
39
|
optionNameKey: { default: null },
|
|
37
40
|
optionImageKey: { default: null },
|
|
38
41
|
optionIconKey: { default: null },
|
|
39
|
-
optionIconType: { default: null }
|
|
42
|
+
optionIconType: { default: null },
|
|
43
|
+
optionEndIconKey: { default: null },
|
|
44
|
+
optionEndIconType: { default: null }
|
|
40
45
|
},
|
|
41
46
|
emits: ["click", "copyToClipboard"],
|
|
42
|
-
setup(t, { emit:
|
|
43
|
-
const e = t, { copy:
|
|
47
|
+
setup(t, { emit: f }) {
|
|
48
|
+
const e = t, { copy: O, copied: k } = z({}), C = r(
|
|
44
49
|
() => e.feedbackVariant ? `state-${e.feedbackVariant}` : ""
|
|
45
50
|
), b = () => {
|
|
46
|
-
|
|
47
|
-
},
|
|
51
|
+
f("click");
|
|
52
|
+
}, m = E(e.testId, y), g = "All apps selected", h = r(() => e.multi ? !Array.isArray(e.selectedOption) || !e.selectedOption?.length ? e.placeholder : e.options?.length === e.selectedOption.length ? `${g} (${e.selectedOption.length})` : e.selectedOption?.length === 1 && e.displayValue ? e.displayValue(e.selectedOption[0]) : `${e.selectedOption.length} selected` : e.selectedOption ? e.displayValue(e.selectedOption) : e.placeholder), l = r(() => {
|
|
48
53
|
if (!e.selectedOption)
|
|
49
54
|
return null;
|
|
50
55
|
if (!e.multi)
|
|
51
56
|
return e.selectedOption;
|
|
52
57
|
if (Array.isArray(e.selectedOption))
|
|
53
58
|
return e.selectedOption.length === 1 ? e.selectedOption[0] : null;
|
|
54
|
-
}),
|
|
55
|
-
await
|
|
59
|
+
}), K = async () => {
|
|
60
|
+
await O(e.valueToCopy), k.value && (N({
|
|
56
61
|
title: "Copied successfully",
|
|
57
62
|
type: "success",
|
|
58
63
|
duration: 2e3
|
|
59
|
-
}),
|
|
64
|
+
}), f("copyToClipboard"));
|
|
60
65
|
};
|
|
61
|
-
return (
|
|
62
|
-
class:
|
|
66
|
+
return (i, T) => (n(), a("div", {
|
|
67
|
+
class: $(["app-trigger-wrapper", { "with-copy": !!t.valueToCopy }])
|
|
63
68
|
}, [
|
|
64
|
-
|
|
65
|
-
class: ["app-trigger", [t.size,
|
|
69
|
+
s("div", v({
|
|
70
|
+
class: ["app-trigger", [t.size, o(C), { open: t.open, disabled: t.disabled }]],
|
|
66
71
|
style: {
|
|
67
|
-
paddingLeft:
|
|
72
|
+
paddingLeft: i.$slots.image || o(l) && t.optionImageKey ? "8px" : "12px"
|
|
68
73
|
}
|
|
69
|
-
},
|
|
70
|
-
onClick:
|
|
74
|
+
}, o(m)[o(y).BUTTON_WRAPPER], {
|
|
75
|
+
onClick: T[0] || (T[0] = (F) => b())
|
|
71
76
|
}), [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
t.optionImageKey ? (
|
|
77
|
+
s("div", w, [
|
|
78
|
+
i.$slots.image || o(l) && t.optionImageKey ? (n(), a("div", S, [
|
|
79
|
+
u(i.$slots, "image", {}, () => [
|
|
80
|
+
t.optionImageKey ? (n(), a("img", {
|
|
76
81
|
key: 0,
|
|
77
|
-
src: l
|
|
78
|
-
}, null, 8,
|
|
82
|
+
src: o(l)[t.optionImageKey]
|
|
83
|
+
}, null, 8, D)) : d("", !0)
|
|
79
84
|
], !0)
|
|
80
|
-
])) :
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
])) : d("", !0),
|
|
86
|
+
i.$slots["icon-start"] || o(l) && t.optionIconKey ? (n(), a("div", P, [
|
|
87
|
+
u(i.$slots, "icon-start", {}, () => [
|
|
88
|
+
c(o(p), {
|
|
84
89
|
type: t.optionIconType,
|
|
85
|
-
name: l
|
|
90
|
+
name: o(l)[t.optionIconKey],
|
|
86
91
|
size: "20px"
|
|
87
92
|
}, null, 8, ["type", "name"])
|
|
88
93
|
], !0)
|
|
89
|
-
])) :
|
|
90
|
-
|
|
91
|
-
default:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
])) : d("", !0),
|
|
95
|
+
c(o(B), v({ variant: "button" }, o(m)[o(y).BUTTON_CONTENT], { class: "displayed-value" }), {
|
|
96
|
+
default: I(() => [
|
|
97
|
+
s("div", R, [
|
|
98
|
+
o(h) === g ? (n(), a("span", U, [
|
|
99
|
+
c(o(p), {
|
|
95
100
|
name: "cube",
|
|
96
101
|
size: "20px",
|
|
97
102
|
type: "fill"
|
|
98
103
|
})
|
|
99
|
-
])) :
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
t.mandatory && (Array.isArray(t.selectedOption) ? !t.selectedOption.length : !t.selectedOption) ? (
|
|
104
|
+
])) : d("", !0),
|
|
105
|
+
s("div", L, [
|
|
106
|
+
s("div", M, V(o(h)), 1),
|
|
107
|
+
t.mandatory && (Array.isArray(t.selectedOption) ? !t.selectedOption.length : !t.selectedOption) ? (n(), a("span", W, "*")) : d("", !0)
|
|
103
108
|
])
|
|
104
109
|
])
|
|
105
110
|
]),
|
|
106
111
|
_: 1
|
|
107
|
-
}, 16)
|
|
112
|
+
}, 16),
|
|
113
|
+
i.$slots["icon-end"] || o(l) && t.optionEndIconKey && o(l)[t.optionEndIconKey] ? (n(), a("div", j, [
|
|
114
|
+
u(i.$slots, "icon-end", {}, () => [
|
|
115
|
+
c(o(p), {
|
|
116
|
+
type: t.optionEndIconType,
|
|
117
|
+
name: o(l)[t.optionEndIconKey],
|
|
118
|
+
size: "24px"
|
|
119
|
+
}, null, 8, ["type", "name"])
|
|
120
|
+
], !0)
|
|
121
|
+
])) : d("", !0)
|
|
108
122
|
]),
|
|
109
|
-
|
|
110
|
-
|
|
123
|
+
s("div", null, [
|
|
124
|
+
c(o(p), {
|
|
111
125
|
name: "caret-down",
|
|
112
126
|
size: "20px",
|
|
113
127
|
class: "app-trigger--icon"
|
|
114
128
|
})
|
|
115
129
|
])
|
|
116
130
|
], 16),
|
|
117
|
-
t.valueToCopy ? (
|
|
131
|
+
t.valueToCopy ? (n(), a("div", {
|
|
118
132
|
key: 0,
|
|
119
133
|
class: "app-trigger-key",
|
|
120
|
-
onClick:
|
|
134
|
+
onClick: K
|
|
121
135
|
}, [
|
|
122
|
-
|
|
136
|
+
c(o(x), {
|
|
123
137
|
text: t.valueToCopy,
|
|
124
138
|
header: "Copy app key",
|
|
125
139
|
placement: "bottom"
|
|
126
140
|
}, {
|
|
127
|
-
default:
|
|
128
|
-
|
|
129
|
-
|
|
141
|
+
default: I(() => [
|
|
142
|
+
s("div", q, [
|
|
143
|
+
c(o(p), {
|
|
130
144
|
name: "copy",
|
|
131
145
|
size: "20px"
|
|
132
146
|
})
|
|
@@ -134,10 +148,10 @@ const S = { class: "app-trigger--content" }, D = {
|
|
|
134
148
|
]),
|
|
135
149
|
_: 1
|
|
136
150
|
}, 8, ["text"])
|
|
137
|
-
])) :
|
|
151
|
+
])) : d("", !0)
|
|
138
152
|
], 2));
|
|
139
153
|
}
|
|
140
154
|
});
|
|
141
155
|
export {
|
|
142
|
-
|
|
156
|
+
ee as default
|
|
143
157
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "./DropdownV4.vue2.js";
|
|
2
|
-
/* empty css *//* empty css */import
|
|
3
|
-
// import "../../../DropdownV4.
|
|
2
|
+
/* empty css *//* empty css */import e from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../DropdownV4.vue_vue_type_style_index_0_scoped_2e7a89bc_lang.css"; //*');
|
|
4
4
|
// import "../../../DropdownV4.vue_vue_type_style_index_1_lang.css"; //');
|
|
5
|
-
const r = /* @__PURE__ */
|
|
5
|
+
const r = /* @__PURE__ */ e(o, [["__scopeId", "data-v-2e7a89bc"]]);
|
|
6
6
|
export {
|
|
7
7
|
r as default
|
|
8
8
|
};
|