@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.v-enter-active[data-v-991a7aad],.v-leave-active[data-v-991a7aad]{transition:opacity .25s ease}ol[data-v-991a7aad],ul[data-v-991a7aad],menu[data-v-991a7aad]{list-style:none;margin:0;padding:0}.dropdown.full-width[data-v-991a7aad],.dropdown.full-width .button__container[data-v-991a7aad]{width:100%}.dropdown-list-wrapper[data-v-991a7aad]{display:flex;flex-direction:column;padding:.5rem .5rem .25rem}.dropdown-list-wrapper--multi[data-v-991a7aad]{padding:.5rem}.list-container--multi[data-v-991a7aad]{margin-bottom:0}.inline-search .inline-search-wrapper[data-v-991a7aad]{padding-bottom:.25rem}.inline-search .list-container[data-v-991a7aad]{padding-top:0}.no-result-container[data-v-991a7aad]{height:100%;display:flex;align-items:center;padding:.375rem .5rem;color:var(--text-disabled)}.no-result[data-v-991a7aad]{color:var(--text-disabled);padding-left:.5rem}.list[data-v-991a7aad]{outline:none;display:flex;flex-direction:column;width:100%;min-height:2rem}.list--multi[data-v-991a7aad]{margin-bottom:.5rem;border-bottom-left-radius:0;border-bottom-right-radius:0}.image-slot[data-v-991a7aad]{margin-right:.5rem}.actions-wrapper[data-v-991a7aad]{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-991a7aad]{margin-left:.5rem}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.label[data-v-4070942a]{color:#41454d}.item-container[data-v-4070942a]{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-4070942a]{cursor:initial;color:var(--text-disabled)}.item-container[data-v-4070942a]:hover:not(.item-container--disabled){background-color:var(--action-hover)}.item-container--active[data-v-4070942a],.item-container[data-v-4070942a]:active{background-color:var(--action-selected)}.item-container:not(.item-container--multi).item-container--selected[data-v-4070942a]{background-color:var(--action-selected)}.subtitle[data-v-4070942a]{color:#7b838c;line-height:1rem}.clear-button[data-v-4070942a]{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-4070942a]:hover{color:#3083ff}.item[data-v-4070942a]{width:100%;display:flex;gap:.5rem;align-items:center}.item--with-icon[data-v-4070942a],.item--multi[data-v-4070942a]{display:flex;flex-direction:row;align-items:center;justify-content:start}.item .image[data-v-4070942a]{width:20px;height:20px;flex:none}.item .image img[data-v-4070942a]{width:20px;height:20px;border-radius:4px}.item .flag[data-v-4070942a]{width:16px;height:16px}.item .flag img[data-v-4070942a]{width:16px;height:16px;border-radius:50%}.item .start-icon[data-v-4070942a],.item .end-icon[data-v-4070942a]{display:flex;color:var(--action-active)}.item .option-text[data-v-4070942a]{line-height:1.1875rem}.text-container[data-v-4070942a]{width:100%;text-overflow:ellipsis;overflow:hidden}.tooltip-option[data-v-4070942a]{display:block}.tooltip-option[data-v-4070942a] .container{width:100%}.app-trigger--icon[data-v-4070942a]{color:var(--action-active);transform:rotate(-90deg);transition:transform .2s}.app-trigger--icon.expanded[data-v-4070942a]{transform:rotate(0)}.option-content-horizontal[data-v-4070942a]{display:flex;justify-content:space-between;gap:.5rem}.option-content-vertical[data-v-4070942a]{display:flex;flex-direction:column}.option-text .main-text[data-v-4070942a]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;text-align:left}.option-text .caption-text[data-v-4070942a]{color:var(--text-secondary)}.multiline-tooltip[data-v-4070942a]{display:flex;flex-direction:column}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.child-options[data-v-6ac5f602]{padding-left:1rem}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { useToggle as
|
|
2
|
-
import { inject as
|
|
1
|
+
import { useToggle as ke } from "../../../composables/useToggle.js";
|
|
2
|
+
import { inject as Ve, ref as i, computed as r, watch as b, useSlots as _e, toRaw as P, nextTick as N, provide as Ge, onMounted as He } from "vue";
|
|
3
3
|
import { isObjectInArray as ee } from "../../../utils/array.js";
|
|
4
4
|
import { objectsEqual as Be } from "../../../utils/object.js";
|
|
5
5
|
import { useClamp as Le, useVirtualList as Ue, onClickOutside as le } from "@vueuse/core";
|
|
6
|
-
import { Mode as T, Type as
|
|
6
|
+
import { Mode as T, Type as _, DropdownContext as qe } from "./DropdownContext.js";
|
|
7
7
|
import { pxToRem as $e } from "../../../utils/style.js";
|
|
8
8
|
import { useEditableContext as je } from "../../table-cells/common/EditableContext.js";
|
|
9
9
|
import { useGroupedOptions as Xe } from "./useGroupedOptions.js";
|
|
10
|
-
const ll = (l,
|
|
11
|
-
const te =
|
|
10
|
+
const ll = (l, S, A) => {
|
|
11
|
+
const te = Ve("isTreeDropdown", !1), {
|
|
12
12
|
sortOutGroups: G,
|
|
13
13
|
flattenAndMarkGroupOptions: ae,
|
|
14
14
|
isGroup: H,
|
|
15
|
-
selectAllWithGroups:
|
|
16
|
-
isIndeterminateGrouped:
|
|
15
|
+
selectAllWithGroups: ne,
|
|
16
|
+
isIndeterminateGrouped: ue,
|
|
17
17
|
allSelectedGrouped: ie,
|
|
18
18
|
areAllPreviousSelected: re
|
|
19
19
|
} = Xe(l), oe = (e, t) => l.multi ? l.comparingKey ? e.findIndex(
|
|
20
|
-
(
|
|
20
|
+
(u) => u[l.comparingKey] === t[l.comparingKey]
|
|
21
21
|
) > -1 : ee(e, t) : l.comparingKey ? e[l.comparingKey] === t[l.comparingKey] : P(e) === t;
|
|
22
22
|
let B;
|
|
23
23
|
((e) => {
|
|
@@ -25,21 +25,21 @@ const ll = (l, m, A) => {
|
|
|
25
25
|
})(B || (B = {}));
|
|
26
26
|
const a = i(
|
|
27
27
|
l.selected
|
|
28
|
-
), R = je(),
|
|
28
|
+
), R = je(), n = r({
|
|
29
29
|
get() {
|
|
30
30
|
return R?.value?.value ?? a.value;
|
|
31
31
|
},
|
|
32
32
|
set(e) {
|
|
33
|
-
R.onChange?.(e), R.onClose?.(),
|
|
33
|
+
R.onChange?.(e), R.onClose?.(), S("update:selected", e);
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
b(
|
|
37
37
|
() => l.selected,
|
|
38
38
|
() => {
|
|
39
|
-
a.value = l.selected,
|
|
39
|
+
a.value = l.selected, s.value = l.selected;
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
const
|
|
42
|
+
const ce = _e(), w = i(null), h = i(null), L = i(null), E = i(null), U = i(null), I = i(null), se = i(), q = i(null), $ = i(null), j = i(null), ve = 8, de = r(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), X = i(!1), f = i([]), x = i(-1), O = i(""), s = i(l.selected || []), z = () => I.value?.focus(), [g, fe, ge] = ke({
|
|
43
43
|
disabled: l.disabled,
|
|
44
44
|
initialValue: l.defaultOpen
|
|
45
45
|
});
|
|
@@ -56,52 +56,52 @@ const ll = (l, m, A) => {
|
|
|
56
56
|
return l.isOpen;
|
|
57
57
|
},
|
|
58
58
|
set(e) {
|
|
59
|
-
|
|
59
|
+
S("update:isOpen", e);
|
|
60
60
|
}
|
|
61
|
-
}), he = r(() => o.value.length - 1),
|
|
61
|
+
}), he = r(() => o.value.length - 1), d = Le(0, 0, he), J = r(() => n.value ? l.displayValue(n.value) : ""), Oe = (e) => {
|
|
62
62
|
if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
|
|
63
63
|
return l.placeholder;
|
|
64
64
|
const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
|
|
65
65
|
return e.value.length == 1 && l.displayValue ? l.displayValue(e.value[0]) : t;
|
|
66
|
-
},
|
|
66
|
+
}, me = r(() => {
|
|
67
67
|
if (!l.multi)
|
|
68
|
-
return
|
|
68
|
+
return n.value ? l.displayValue(n.value) : l.placeholder;
|
|
69
69
|
if (Array.isArray(a.value))
|
|
70
70
|
return Oe(a);
|
|
71
|
-
}),
|
|
71
|
+
}), K = r(() => {
|
|
72
72
|
if (Array.isArray(a.value))
|
|
73
73
|
return l.groupedOptions ? ie(o, a) : a.value.length === o.value.length;
|
|
74
|
-
}),
|
|
74
|
+
}), Se = r(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? ue(
|
|
75
75
|
o,
|
|
76
76
|
a
|
|
77
|
-
) : a.value.length > 0 && a.value.length < o.value.length),
|
|
78
|
-
|
|
77
|
+
) : a.value.length > 0 && a.value.length < o.value.length), M = (e) => {
|
|
78
|
+
O.value = e;
|
|
79
79
|
}, D = r(() => l.groupedOptions ? ae(l.options) : l.options), Ae = r(() => {
|
|
80
80
|
if (re(
|
|
81
81
|
D,
|
|
82
|
-
|
|
82
|
+
s
|
|
83
83
|
))
|
|
84
84
|
return D.value;
|
|
85
85
|
const e = {
|
|
86
86
|
selected: [],
|
|
87
87
|
notSelected: []
|
|
88
88
|
};
|
|
89
|
-
P(D).value.forEach((
|
|
90
|
-
const
|
|
91
|
-
(
|
|
92
|
-
) > -1 :
|
|
93
|
-
e[
|
|
89
|
+
P(D).value.forEach((u) => {
|
|
90
|
+
const v = (l.comparingKey ? s.value.findIndex(
|
|
91
|
+
(V) => V[l.comparingKey] === u[l.comparingKey]
|
|
92
|
+
) > -1 : s.value.includes(u)) ? "selected" : "notSelected";
|
|
93
|
+
e[v].push(u);
|
|
94
94
|
});
|
|
95
95
|
const t = l.groupedOptions ? G(e.notSelected) : e.notSelected;
|
|
96
96
|
return [].concat(e.selected, t);
|
|
97
97
|
}), o = r(() => {
|
|
98
|
-
const e = Array.isArray(
|
|
98
|
+
const e = Array.isArray(s.value) && l.multi && A.VERSION === 4 && !te ? Ae.value : D.value;
|
|
99
99
|
if (l.onSearch) {
|
|
100
|
-
const t = e.filter((
|
|
100
|
+
const t = e.filter((u) => l.groupedOptions && H(u) ? u : l.onSearch(u, O.value));
|
|
101
101
|
return l.groupedOptions ? G(t) : t;
|
|
102
102
|
} else
|
|
103
103
|
return e;
|
|
104
|
-
}), be = r(() =>
|
|
104
|
+
}), be = r(() => f.value[0]?.hasSubtitle), Q = r(() => c.mode === T.Multi), Y = r(
|
|
105
105
|
() => be.value ? A.MULTILINE_LIST_HEIGHT : A.LIST_HEIGHT
|
|
106
106
|
), {
|
|
107
107
|
list: Z,
|
|
@@ -120,37 +120,37 @@ const ll = (l, m, A) => {
|
|
|
120
120
|
), b([x], async () => {
|
|
121
121
|
await N();
|
|
122
122
|
}), b(
|
|
123
|
-
[
|
|
123
|
+
[g, d, x],
|
|
124
124
|
async ([e], [t]) => {
|
|
125
|
-
|
|
125
|
+
g.value && (await N(), x.value !== -1 && e !== t && setTimeout(() => {
|
|
126
126
|
l.multi && A.VERSION === 4 || C(x.value);
|
|
127
|
-
}),
|
|
128
|
-
C(
|
|
127
|
+
}), d.value && setTimeout(() => {
|
|
128
|
+
C(d.value);
|
|
129
129
|
}));
|
|
130
130
|
}
|
|
131
|
-
), b(
|
|
132
|
-
|
|
131
|
+
), b(O, () => {
|
|
132
|
+
S("onsearch", O.value), C(0);
|
|
133
133
|
});
|
|
134
|
-
const
|
|
134
|
+
const m = (e, t = !1) => {
|
|
135
135
|
l.disabled || (W(e), N(() => {
|
|
136
|
-
|
|
136
|
+
g.value && S("opened"), g.value || S("closed"), w.value && t && w.value.focus();
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
|
-
b(
|
|
139
|
+
b(g, (e) => {
|
|
140
140
|
if (e) {
|
|
141
|
-
|
|
141
|
+
O.value = "", Q.value && Array.isArray(n.value) && (s.value = P(n.value).slice());
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
z();
|
|
145
145
|
});
|
|
146
146
|
const Te = () => {
|
|
147
|
-
if (
|
|
147
|
+
if (K.value) {
|
|
148
148
|
a.value = [];
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
if (Array.isArray(a.value)) {
|
|
152
152
|
if (l.groupedOptions)
|
|
153
|
-
|
|
153
|
+
ne(o, a);
|
|
154
154
|
else {
|
|
155
155
|
if (a.value.length === o.value.length) {
|
|
156
156
|
a.value = [];
|
|
@@ -158,90 +158,92 @@ const ll = (l, m, A) => {
|
|
|
158
158
|
}
|
|
159
159
|
a.value = o.value;
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
S("selectAll");
|
|
162
162
|
}
|
|
163
163
|
}, we = () => {
|
|
164
|
-
Te(), A.VERSION !== 4 && (
|
|
164
|
+
Te(), A.VERSION !== 4 && (n.value = a.value);
|
|
165
165
|
}, Ie = (e = !0) => {
|
|
166
|
-
a.value = [], e && (
|
|
167
|
-
},
|
|
168
|
-
if (e = P(e),
|
|
166
|
+
a.value = [], e && (n.value = [], s.value = []), S("clear");
|
|
167
|
+
}, k = (e, t) => {
|
|
168
|
+
if (e = P(e), f.value[t]?.disabled)
|
|
169
169
|
return;
|
|
170
|
-
if (x.value = t,
|
|
171
|
-
l.keepOpen ||
|
|
170
|
+
if (x.value = t, c.mode !== T.Multi) {
|
|
171
|
+
l.keepOpen || m(!1), c.goToOption(
|
|
172
172
|
0
|
|
173
173
|
/* None */
|
|
174
|
-
),
|
|
174
|
+
), n.value = e, M(""), z(), c.type === _.Search && h.value && (h.value.value = l.displayValue(e));
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
if (!Array.isArray(a.value))
|
|
178
178
|
return;
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
if (ee(
|
|
182
|
-
|
|
183
|
-
|
|
179
|
+
h.value?.focus();
|
|
180
|
+
const y = P(a.value);
|
|
181
|
+
if (ee(y, e) || l.comparingKey && y.findIndex(
|
|
182
|
+
(v) => v[l.comparingKey] === e[l.comparingKey]
|
|
183
|
+
) > -1) {
|
|
184
|
+
a.value = y.filter(
|
|
185
|
+
(v) => !Be(v, e)
|
|
184
186
|
);
|
|
185
187
|
return;
|
|
186
188
|
} else {
|
|
187
|
-
a.value = [...
|
|
189
|
+
a.value = [...y, e];
|
|
188
190
|
return;
|
|
189
191
|
}
|
|
190
|
-
}, xe = (e) =>
|
|
191
|
-
activeIndex:
|
|
192
|
-
options:
|
|
193
|
-
selectedOption:
|
|
192
|
+
}, xe = (e) => f.value[e]?.disabled, c = {
|
|
193
|
+
activeIndex: d,
|
|
194
|
+
options: f,
|
|
195
|
+
selectedOption: n,
|
|
194
196
|
labelRef: U,
|
|
195
197
|
activeOption: E,
|
|
196
198
|
listRef: w,
|
|
197
199
|
clearable: l.clearable,
|
|
198
|
-
type:
|
|
200
|
+
type: ce.input ? _.Search : _.Dropdown,
|
|
199
201
|
mode: l.multi ? T.Multi : T.Single,
|
|
200
|
-
query:
|
|
202
|
+
query: O,
|
|
201
203
|
selectedValue: J,
|
|
202
|
-
toggle:
|
|
204
|
+
toggle: m,
|
|
203
205
|
disabled: l.disabled,
|
|
204
|
-
open:
|
|
206
|
+
open: g,
|
|
205
207
|
mandatory: l.mandatory,
|
|
206
208
|
size: l.size,
|
|
207
209
|
placeholder: l.placeholder,
|
|
208
|
-
select:
|
|
210
|
+
select: k,
|
|
209
211
|
clearSelection: () => {
|
|
210
|
-
|
|
212
|
+
M(""), n.value = c.mode === T.Single ? null : [], s.value = c.mode === T.Single ? null : [], h.value && (h.value.value = "");
|
|
211
213
|
},
|
|
212
|
-
search:
|
|
214
|
+
search: M,
|
|
213
215
|
goToOption: async (e) => {
|
|
214
|
-
if (!
|
|
216
|
+
if (!g.value)
|
|
215
217
|
return;
|
|
216
|
-
let t =
|
|
217
|
-
const
|
|
218
|
-
(
|
|
219
|
-
).length,
|
|
220
|
-
for (t >
|
|
221
|
-
if (!
|
|
222
|
-
E.value = o.value[t],
|
|
218
|
+
let t = d.value + e;
|
|
219
|
+
const u = f.value.filter(
|
|
220
|
+
(v) => v.disabled
|
|
221
|
+
).length, y = o.value.length - u;
|
|
222
|
+
for (t > y && (t = y + 1); ; ) {
|
|
223
|
+
if (!f.value[t]?.disabled) {
|
|
224
|
+
E.value = o.value[t], d.value = t;
|
|
223
225
|
return;
|
|
224
226
|
}
|
|
225
|
-
if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!xe(
|
|
226
|
-
E.value = o.value[t],
|
|
227
|
+
if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!xe(d.value)) {
|
|
228
|
+
E.value = o.value[t], d.value = t;
|
|
227
229
|
return;
|
|
228
230
|
}
|
|
229
231
|
}
|
|
230
232
|
},
|
|
231
233
|
registerInput: (e) => {
|
|
232
|
-
|
|
234
|
+
h.value = e.value;
|
|
233
235
|
},
|
|
234
|
-
registerOption: (e, t,
|
|
235
|
-
|
|
236
|
+
registerOption: (e, t, u) => {
|
|
237
|
+
f.value = [...f.value, { id: e, disabled: t, hasSubtitle: u }];
|
|
236
238
|
},
|
|
237
239
|
unRegisterOption(e) {
|
|
238
|
-
|
|
240
|
+
f.value = f.value.filter((t) => t.id !== e);
|
|
239
241
|
}
|
|
240
242
|
};
|
|
241
|
-
Ge(qe,
|
|
243
|
+
Ge(qe, c), le(
|
|
242
244
|
w,
|
|
243
245
|
() => {
|
|
244
|
-
|
|
246
|
+
g.value && p();
|
|
245
247
|
},
|
|
246
248
|
{
|
|
247
249
|
ignore: [
|
|
@@ -249,23 +251,23 @@ const ll = (l, m, A) => {
|
|
|
249
251
|
q,
|
|
250
252
|
$,
|
|
251
253
|
j,
|
|
252
|
-
|
|
254
|
+
h,
|
|
253
255
|
F.ref
|
|
254
256
|
]
|
|
255
257
|
}
|
|
256
258
|
);
|
|
257
259
|
const De = () => {
|
|
258
|
-
|
|
260
|
+
h.value && (h.value.value = c.query.value = "");
|
|
259
261
|
};
|
|
260
262
|
He(async () => {
|
|
261
263
|
l.autoFocus && (await N(), setTimeout(() => {
|
|
262
264
|
L.value.focus();
|
|
263
|
-
})),
|
|
265
|
+
})), c.goToOption(0);
|
|
264
266
|
});
|
|
265
267
|
const Ce = () => {
|
|
266
|
-
X.value =
|
|
268
|
+
X.value = K.value, n.value = a.value, Array.isArray(n.value) && (s.value = P(n.value).slice()), S("apply", n.value), m(!1), De();
|
|
267
269
|
}, p = () => {
|
|
268
|
-
Q.value && Array.isArray(
|
|
270
|
+
Q.value && Array.isArray(s.value) && (n.value = P(s.value).slice()), O.value = "", m(!1);
|
|
269
271
|
}, Ne = (e) => {
|
|
270
272
|
if (!l.disableKeyboardEvents)
|
|
271
273
|
switch (e.key) {
|
|
@@ -273,88 +275,88 @@ const ll = (l, m, A) => {
|
|
|
273
275
|
case "Enter":
|
|
274
276
|
case "ArrowUp":
|
|
275
277
|
case "ArrowDown":
|
|
276
|
-
|
|
278
|
+
m(!0), e.preventDefault();
|
|
277
279
|
}
|
|
278
280
|
}, Re = (e) => {
|
|
279
281
|
if (!l.disableKeyboardEvents)
|
|
280
282
|
switch (e.key) {
|
|
281
283
|
case "ArrowUp": {
|
|
282
|
-
|
|
284
|
+
c.goToOption(
|
|
283
285
|
-1
|
|
284
286
|
/* Previous */
|
|
285
287
|
), e.preventDefault(), e.stopPropagation();
|
|
286
288
|
break;
|
|
287
289
|
}
|
|
288
290
|
case "ArrowDown": {
|
|
289
|
-
|
|
291
|
+
c.goToOption(
|
|
290
292
|
1
|
|
291
293
|
/* Next */
|
|
292
294
|
), e.preventDefault(), e.stopPropagation();
|
|
293
295
|
break;
|
|
294
296
|
}
|
|
295
297
|
case "Escape": {
|
|
296
|
-
|
|
298
|
+
m(!1), e.preventDefault();
|
|
297
299
|
break;
|
|
298
300
|
}
|
|
299
301
|
case "PageUp": {
|
|
300
|
-
|
|
302
|
+
c.goToOption(
|
|
301
303
|
10
|
|
302
304
|
/* NextPage */
|
|
303
305
|
), e.preventDefault();
|
|
304
306
|
break;
|
|
305
307
|
}
|
|
306
308
|
case "PageDown": {
|
|
307
|
-
|
|
309
|
+
c.goToOption(
|
|
308
310
|
-10
|
|
309
311
|
/* PrevPage */
|
|
310
312
|
), e.preventDefault();
|
|
311
313
|
break;
|
|
312
314
|
}
|
|
313
315
|
case "Enter": {
|
|
314
|
-
if (!
|
|
315
|
-
|
|
316
|
+
if (!g.value) {
|
|
317
|
+
m(!0);
|
|
316
318
|
return;
|
|
317
319
|
}
|
|
318
|
-
|
|
320
|
+
k(o.value[d.value], d.value), c.mode === T.Single && !l.keepOpen && m(!1), e.preventDefault();
|
|
319
321
|
break;
|
|
320
322
|
}
|
|
321
323
|
}
|
|
322
324
|
}, Ee = r(() => {
|
|
323
325
|
if (l.loading)
|
|
324
326
|
return 8.5;
|
|
325
|
-
const e = Z.value.reduce((
|
|
326
|
-
const
|
|
327
|
-
return
|
|
328
|
-
}, 0), t = l.multi && l.showSelectAll && !
|
|
329
|
-
let
|
|
330
|
-
return l.noResultsText &&
|
|
331
|
-
|
|
327
|
+
const e = l.customNumberOfDisplayedOptions || Z.value.reduce((V, Ke) => {
|
|
328
|
+
const Me = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Ke.data) : 1;
|
|
329
|
+
return V + Me;
|
|
330
|
+
}, 0), t = l.multi && l.showSelectAll && !O.value ? 1 : 0, u = e > A.MAX_NUMBER_OF_OPTIONS, y = e + t;
|
|
331
|
+
let v = u ? A.MAX_NUMBER_OF_OPTIONS + 0.1 : y;
|
|
332
|
+
return l.noResultsText && v === 0 && (v = v + 1), $e(
|
|
333
|
+
v * Y.value + A.PADDING_PX
|
|
332
334
|
);
|
|
333
335
|
});
|
|
334
336
|
return {
|
|
335
337
|
onKeydown: Re,
|
|
336
338
|
location: de,
|
|
337
|
-
open:
|
|
338
|
-
toggleMenu:
|
|
339
|
+
open: g,
|
|
340
|
+
toggleMenu: m,
|
|
339
341
|
onButtonKeydown: Ne,
|
|
340
|
-
displayedValue:
|
|
342
|
+
displayedValue: me,
|
|
341
343
|
labelRef: U,
|
|
342
|
-
query:
|
|
344
|
+
query: O,
|
|
343
345
|
containerProps: F,
|
|
344
346
|
calculateTableHeight: Ee,
|
|
345
347
|
wrapperProps: Pe,
|
|
346
348
|
filteredOptions: o,
|
|
347
|
-
allSelected:
|
|
349
|
+
allSelected: K,
|
|
348
350
|
allSelectedApplied: X,
|
|
349
|
-
isIndeterminate:
|
|
351
|
+
isIndeterminate: Se,
|
|
350
352
|
onSelectAll: we,
|
|
351
353
|
virtualOptions: Z,
|
|
352
354
|
isSelected: oe,
|
|
353
|
-
selectedOption:
|
|
354
|
-
selectedOptionPrevious:
|
|
355
|
+
selectedOption: n,
|
|
356
|
+
selectedOptionPrevious: s,
|
|
355
357
|
selectedValue: J,
|
|
356
|
-
onSelect:
|
|
357
|
-
activeIndex:
|
|
358
|
+
onSelect: k,
|
|
359
|
+
activeIndex: d,
|
|
358
360
|
onCancel: p,
|
|
359
361
|
onApply: Ce,
|
|
360
362
|
scrollTo: C,
|
|
@@ -364,7 +366,7 @@ const ll = (l, m, A) => {
|
|
|
364
366
|
apply: q,
|
|
365
367
|
cancel: $,
|
|
366
368
|
el: L,
|
|
367
|
-
triggerRef:
|
|
369
|
+
triggerRef: se,
|
|
368
370
|
clearAll: j,
|
|
369
371
|
onClearAllSelections: Ie,
|
|
370
372
|
isGroup: H
|
|
@@ -50,6 +50,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
50
50
|
optionTwoLinesKey?: string;
|
|
51
51
|
groupedOptions?: boolean;
|
|
52
52
|
comparingKey?: string;
|
|
53
|
+
customNumberOfDisplayedOptions?: number;
|
|
53
54
|
theme?: string;
|
|
54
55
|
fullWidth?: boolean;
|
|
55
56
|
optionsListWidth?: string;
|
|
@@ -105,6 +106,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
105
106
|
optionTwoLinesKey: any;
|
|
106
107
|
groupedOptions: boolean;
|
|
107
108
|
comparingKey: any;
|
|
109
|
+
customNumberOfDisplayedOptions: any;
|
|
108
110
|
fullWidth: boolean;
|
|
109
111
|
optionsListWidth: any;
|
|
110
112
|
statusType: any;
|
|
@@ -174,6 +176,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
174
176
|
optionTwoLinesKey?: string;
|
|
175
177
|
groupedOptions?: boolean;
|
|
176
178
|
comparingKey?: string;
|
|
179
|
+
customNumberOfDisplayedOptions?: number;
|
|
177
180
|
theme?: string;
|
|
178
181
|
fullWidth?: boolean;
|
|
179
182
|
optionsListWidth?: string;
|
|
@@ -229,6 +232,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
229
232
|
optionTwoLinesKey: any;
|
|
230
233
|
groupedOptions: boolean;
|
|
231
234
|
comparingKey: any;
|
|
235
|
+
customNumberOfDisplayedOptions: any;
|
|
232
236
|
fullWidth: boolean;
|
|
233
237
|
optionsListWidth: any;
|
|
234
238
|
statusType: any;
|
|
@@ -292,6 +296,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
292
296
|
optionTwoLinesKey: string;
|
|
293
297
|
groupedOptions: boolean;
|
|
294
298
|
comparingKey: string;
|
|
299
|
+
customNumberOfDisplayedOptions: number;
|
|
295
300
|
fullWidth: boolean;
|
|
296
301
|
optionsListWidth: string;
|
|
297
302
|
statusType: "default" | "disabled" | "success" | "warning" | "error" | "archive";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "./DropdownV4.vue2.js";
|
|
2
2
|
/* empty css *//* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../DropdownV4.
|
|
3
|
+
// import "../../../DropdownV4.vue_vue_type_style_index_0_scoped_991a7aad_lang.css"; //*');
|
|
4
4
|
// import "../../../DropdownV4.vue_vue_type_style_index_1_lang.css"; //');
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-991a7aad"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../DropdownV4.
|
|
1
|
+
import "../../../DropdownV4.vue_vue_type_style_index_0_scoped_991a7aad_lang.css"; import "../../../DropdownV4.vue_vue_type_style_index_1_lang.css"; import { defineComponent as ye, computed as U, openBlock as n, createElementBlock as a, mergeProps as s, unref as t, renderSlot as k, createElementVNode as m, createVNode as i, withCtx as c, Transition as fe, normalizeClass as L, normalizeStyle as me, isRef as pe, createCommentVNode as r, createTextVNode as b, toDisplayString as W, withModifiers as M, Fragment as ge, renderList as Te, toRaw as w, createBlock as X, resolveDynamicComponent as ke } from "vue";
|
|
2
2
|
import E from "../../button/v4/ButtonV4.vue.js";
|
|
3
3
|
import "../../button/v4/IconButtonV4.vue.js";
|
|
4
4
|
import "../../button/v4/ButtonGroup.vue.js";
|
|
@@ -23,7 +23,7 @@ import { TRIGGERS as p } from "./Dropdown.types.js";
|
|
|
23
23
|
import { useElementSize as Oe } from "@vueuse/core";
|
|
24
24
|
import Le from "../../shared/FieldHelpText.vue.js";
|
|
25
25
|
import Ee from "./GroupOption.vue.js";
|
|
26
|
-
const Fe = ["tabindex"],
|
|
26
|
+
const Fe = ["tabindex"], Ne = { style: { width: "100%" } }, Be = { key: 0 }, Ve = { key: 1 }, De = { key: 2 }, Pe = {
|
|
27
27
|
key: 0,
|
|
28
28
|
class: "inline-search-wrapper"
|
|
29
29
|
}, Re = {
|
|
@@ -88,6 +88,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
88
88
|
optionTwoLinesKey: { default: void 0 },
|
|
89
89
|
groupedOptions: { type: Boolean, default: !1 },
|
|
90
90
|
comparingKey: { default: null },
|
|
91
|
+
customNumberOfDisplayedOptions: { default: null },
|
|
91
92
|
theme: { default: "light-theme-v4" },
|
|
92
93
|
fullWidth: { type: Boolean, default: !0 },
|
|
93
94
|
optionsListWidth: { default: null },
|
|
@@ -97,7 +98,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
97
98
|
},
|
|
98
99
|
emits: ["update:selected", "update:isOpen", "closed", "opened", "apply", "selectAll", "clear", "copyToClipboard", "onsearch"],
|
|
99
100
|
setup(e, { expose: Y, emit: F }) {
|
|
100
|
-
const d = e,
|
|
101
|
+
const d = e, N = {
|
|
101
102
|
MULTILINE_LIST_HEIGHT: 48,
|
|
102
103
|
LIST_HEIGHT: 32 + 4,
|
|
103
104
|
MAX_NUMBER_OF_OPTIONS: 7.5,
|
|
@@ -108,7 +109,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
108
109
|
onKeydown: h,
|
|
109
110
|
open: u,
|
|
110
111
|
toggleMenu: v,
|
|
111
|
-
onButtonKeydown:
|
|
112
|
+
onButtonKeydown: B,
|
|
112
113
|
query: C,
|
|
113
114
|
containerProps: j,
|
|
114
115
|
calculateTableHeight: J,
|
|
@@ -136,7 +137,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
136
137
|
onClearAllSelections: x,
|
|
137
138
|
clearAll: ue,
|
|
138
139
|
isGroup: se
|
|
139
|
-
} = Ke(d, F,
|
|
140
|
+
} = Ke(d, F, N), f = Ae(d.testId, y), $ = U(() => !d.predefinedTrigger || d.predefinedTrigger === p.DEFAULT ? be : d.predefinedTrigger === p.APP ? we : null), { width: H } = Oe(z), ce = U(() => d.optionsListWidth ? d.optionsListWidth : !d.predefinedTrigger || d.predefinedTrigger === p.DEFAULT || d.predefinedTrigger === p.APP ? H.value - 2 > 240 ? `${H.value - 2}px` : `${N.DROPLIST_MIN_WIDTH}px` : "auto"), G = () => {
|
|
140
141
|
v();
|
|
141
142
|
};
|
|
142
143
|
return Y({
|
|
@@ -152,7 +153,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
152
153
|
(...l) => t(h) && t(h)(...l))
|
|
153
154
|
}), [
|
|
154
155
|
k(T.$slots, "label", {}, void 0, !0),
|
|
155
|
-
m("div",
|
|
156
|
+
m("div", Ne, [
|
|
156
157
|
i(t(Se), s({
|
|
157
158
|
theme: e.theme,
|
|
158
159
|
"popper-class": [
|
|
@@ -395,11 +396,11 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
395
396
|
size: e.size,
|
|
396
397
|
showAllSelectedText: e.triggerShowAllSelectedText,
|
|
397
398
|
allSelected: t(K),
|
|
398
|
-
onKeydown: t(
|
|
399
|
+
onKeydown: t(B),
|
|
399
400
|
onClick: G
|
|
400
401
|
}
|
|
401
402
|
}, () => [
|
|
402
|
-
t($) ? (n(), a("div",
|
|
403
|
+
t($) ? (n(), a("div", Be, [
|
|
403
404
|
(n(), X(ke(t($)), {
|
|
404
405
|
placeholder: e.placeholder,
|
|
405
406
|
open: t(u),
|
|
@@ -425,7 +426,7 @@ const Fe = ["tabindex"], Be = { style: { width: "100%" } }, Ne = { key: 0 }, Ve
|
|
|
425
426
|
size: e.size,
|
|
426
427
|
"show-all-selected-text": e.triggerShowAllSelectedText,
|
|
427
428
|
"all-selected": t(K),
|
|
428
|
-
onKeydown: t(
|
|
429
|
+
onKeydown: t(B),
|
|
429
430
|
onClick: G,
|
|
430
431
|
onCopyToClipboard: o[0] || (o[0] = (l) => F("copyToClipboard"))
|
|
431
432
|
}, 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", "option-flag-key", "feedback-variant", "value-to-copy", "status-dot-type", "size", "show-all-selected-text", "all-selected", "onKeydown"]))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./OptionV4.vue2.js";
|
|
2
|
-
/* empty css */import
|
|
3
|
-
// import "../../../OptionV4.
|
|
4
|
-
const s = /* @__PURE__ */
|
|
2
|
+
/* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ _(o, [["__scopeId", "data-v-4070942a"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|