@ironsource/shared-ui 2.1.11-rc.2 → 2.1.11-rc.21
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/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_1aa6df01_lang.css +1 -0
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_ba28c717_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_93545ce0_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_309e5351_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_b1bde483_lang.css +1 -0
- package/InlineCopy.vue_vue_type_style_index_0_scoped_ad48b61e_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_df830bf5_lang.css +1 -0
- package/PopoverV4.vue_vue_type_style_index_0_scoped_c7e688b1_lang.css +1 -0
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_9b6cd9d9_lang.css +1 -0
- package/TextField.vue_vue_type_style_index_0_scoped_2e327aa1_lang.css +1 -0
- package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_c81a7d3e_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_0_scoped_82b46d6d_lang.css +1 -0
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_bdfb0aef_lang.css +1 -0
- package/components/autocomplete/Autocomplete.vue2.js +3 -2
- package/components/button/v4/ToggleButtonGroupAB.vue.d.ts +3 -1
- package/components/button/v4/ToggleButtonGroupAB.vue.js +2 -2
- package/components/button/v4/ToggleButtonGroupAB.vue2.js +44 -39
- package/components/button/v4/index.d.ts +9 -3
- package/components/chart/SettingsHeader.vue.js +3 -3
- package/components/chart/SettingsHeader.vue2.js +34 -26
- package/components/datePicker/v4/DatePickerV4.vue2.js +8 -7
- package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
- package/components/dateRange/v4/DateRangeV4.vue2.js +9 -9
- package/components/dropdown/common/Dropdown.common.js +174 -171
- package/components/dropdown/v3/Dropdown.vue.d.ts +2 -2
- package/components/dropdown/v3/index.d.ts +39 -39
- package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +1 -1
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +7 -7
- package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +66 -44
- package/components/dropdown/v4/ConditionalDropdown.vue.d.ts +75 -0
- package/components/dropdown/v4/ConditionalDropdown.vue.js +7 -0
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +159 -0
- package/components/dropdown/v4/DropdownV4.vue.d.ts +20 -6
- package/components/dropdown/v4/DropdownV4.vue.js +4 -4
- package/components/dropdown/v4/DropdownV4.vue2.js +211 -187
- package/components/dropdown/v4/OptionV4.vue.d.ts +10 -0
- package/components/dropdown/v4/OptionV4.vue.js +2 -2
- package/components/dropdown/v4/OptionV4.vue2.js +135 -98
- package/components/dropdown/v4/TreeDropdown.vue.d.ts +6 -1
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +161 -116
- package/components/dropdown/v4/index.d.ts +313 -86
- package/components/dropdown/v4/index.js +6 -3
- package/components/inlineCopy/InlineCopy.vue.d.ts +5 -0
- package/components/inlineCopy/InlineCopy.vue.js +2 -2
- package/components/inlineCopy/InlineCopy.vue2.js +24 -22
- package/components/inlineCopy/index.d.ts +9 -0
- package/components/input/v4/TextField.vue.js +3 -3
- package/components/input/v4/TextField.vue2.js +12 -12
- package/components/multibar/MultiBarMenu.vue2.js +3 -2
- package/components/popover/v4/PopoverV4.vue.d.ts +14 -2
- package/components/popover/v4/PopoverV4.vue.js +4 -3
- package/components/popover/v4/PopoverV4.vue2.js +40 -24
- package/components/popover/v4/index.d.ts +55 -11
- package/components/sortableList/SortableList.vue.d.ts +1 -1
- package/components/sortableList/index.d.ts +4 -4
- package/components/table/common/Table.common.js +26 -28
- package/components/table/v4/DataGridMenu.vue2.js +3 -2
- package/components/table/v4/index.d.ts +2 -2
- package/components/tooltip/v4/TooltipV4.vue.d.ts +10 -0
- package/components/tooltip/v4/TooltipV4.vue.js +2 -2
- package/components/tooltip/v4/TooltipV4.vue2.js +24 -21
- package/components/tooltip/v4/index.d.ts +39 -1
- package/index.d.ts +860 -213
- package/index.js +1 -1
- package/mocks/options.d.ts +48 -2
- package/package.json +3 -2
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_7f750550_lang.css +0 -1
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_49bd7193_lang.css +0 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_f81413ec_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_991a7aad_lang.css +0 -1
- package/InlineCopy.vue_vue_type_style_index_0_scoped_893a203c_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_4070942a_lang.css +0 -1
- package/PopoverV4.vue_vue_type_style_index_0_scoped_74bbce13_lang.css +0 -1
- package/SettingsHeader.vue_vue_type_style_index_0_scoped_1791e4fe_lang.css +0 -1
- package/TextField.vue_vue_type_style_index_0_scoped_4d9bf5b2_lang.css +0 -1
- package/ToggleButtonGroupAB.vue_vue_type_style_index_0_scoped_9d9e51c0_lang.css +0 -1
- package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_6ac5f602_lang.css +0 -1
|
@@ -1,235 +1,235 @@
|
|
|
1
1
|
import { useToggle as Ve } from "../../../composables/useToggle.js";
|
|
2
|
-
import { inject as ke, ref as i, computed as
|
|
3
|
-
import { isObjectInArray as
|
|
2
|
+
import { inject as ke, ref as i, computed as c, watch as b, useSlots as _e, toRaw as P, nextTick as N, provide as Ge, onMounted as He } from "vue";
|
|
3
|
+
import { isObjectInArray as ae } from "../../../utils/array.js";
|
|
4
4
|
import { objectsEqual as Be } from "../../../utils/object.js";
|
|
5
|
-
import { useClamp as Le, useVirtualList as Ue, onClickOutside as
|
|
6
|
-
import { Mode as T, Type as
|
|
5
|
+
import { useClamp as Le, useVirtualList as Ue, onClickOutside as ne } from "@vueuse/core";
|
|
6
|
+
import { Mode as T, Type as G, 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
|
|
12
|
-
sortOutGroups:
|
|
13
|
-
flattenAndMarkGroupOptions:
|
|
14
|
-
isGroup:
|
|
15
|
-
selectAllWithGroups:
|
|
16
|
-
isIndeterminateGrouped:
|
|
17
|
-
allSelectedGrouped:
|
|
18
|
-
areAllPreviousSelected:
|
|
19
|
-
} = Xe(l),
|
|
10
|
+
const ll = (l, A, O) => {
|
|
11
|
+
const H = ke("isTreeDropdown", !1), {
|
|
12
|
+
sortOutGroups: B,
|
|
13
|
+
flattenAndMarkGroupOptions: ue,
|
|
14
|
+
isGroup: L,
|
|
15
|
+
selectAllWithGroups: ie,
|
|
16
|
+
isIndeterminateGrouped: re,
|
|
17
|
+
allSelectedGrouped: U,
|
|
18
|
+
areAllPreviousSelected: oe
|
|
19
|
+
} = Xe(l), ce = (e, t) => l.multi && Array.isArray(e) ? l.comparingKey ? e?.findIndex(
|
|
20
20
|
(u) => u[l.comparingKey] === t[l.comparingKey]
|
|
21
|
-
) > -1 :
|
|
22
|
-
let
|
|
21
|
+
) > -1 : ae(e, t) : l.comparingKey ? e?.[l.comparingKey] === t[l.comparingKey] : e === t;
|
|
22
|
+
let q;
|
|
23
23
|
((e) => {
|
|
24
24
|
e[e.None = 0] = "None", e[e.Next = 1] = "Next", e[e.Previous = -1] = "Previous", e[e.NextPage = 10] = "NextPage", e[e.PrevPage = -10] = "PrevPage";
|
|
25
|
-
})(
|
|
25
|
+
})(q || (q = {}));
|
|
26
26
|
const a = i(
|
|
27
27
|
l.selected
|
|
28
|
-
),
|
|
28
|
+
), R = je(), n = c({
|
|
29
29
|
get() {
|
|
30
|
-
return
|
|
30
|
+
return R?.value?.value ?? a.value;
|
|
31
31
|
},
|
|
32
32
|
set(e) {
|
|
33
|
-
|
|
33
|
+
R.onChange?.(e), R.onClose?.(), A("update:selected", e);
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
|
|
36
|
+
b(
|
|
37
37
|
() => l.selected,
|
|
38
38
|
() => {
|
|
39
39
|
a.value = l.selected, d.value = l.selected;
|
|
40
40
|
}
|
|
41
41
|
);
|
|
42
|
-
const
|
|
42
|
+
const se = _e(), w = i(null), m = i(null), $ = i(null), E = i(null), j = i(null), I = i(null), de = i(), X = i(null), z = i(null), W = i(null), ve = 8, fe = c(() => I.value ? I.value.getBoundingClientRect().height + ve + l.distance : 0), D = i(!1), f = i([]), x = i(-1), g = i(""), d = i(l.selected || []), J = () => I.value?.focus(), [y, ge, ye] = Ve({
|
|
43
43
|
disabled: l.disabled,
|
|
44
44
|
initialValue: l.defaultOpen
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
b(
|
|
47
47
|
() => l.disabled,
|
|
48
48
|
(e) => {
|
|
49
|
-
e !== void 0 &&
|
|
49
|
+
e !== void 0 && ye(e);
|
|
50
50
|
}
|
|
51
51
|
);
|
|
52
|
-
const
|
|
53
|
-
|
|
54
|
-
},
|
|
52
|
+
const Q = (e) => {
|
|
53
|
+
he.value = ge(e);
|
|
54
|
+
}, he = c({
|
|
55
55
|
get() {
|
|
56
56
|
return l.isOpen;
|
|
57
57
|
},
|
|
58
58
|
set(e) {
|
|
59
|
-
|
|
59
|
+
A("update:isOpen", e);
|
|
60
60
|
}
|
|
61
|
-
}),
|
|
61
|
+
}), Oe = c(() => r.value.length - 1), v = Le(0, 0, Oe), Y = c(() => n.value ? l.displayValue(n.value) : ""), me = (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
|
+
}, Se = c(() => {
|
|
67
67
|
if (!l.multi)
|
|
68
68
|
return n.value ? l.displayValue(n.value) : l.placeholder;
|
|
69
69
|
if (Array.isArray(a.value))
|
|
70
|
-
return
|
|
71
|
-
}),
|
|
70
|
+
return me(a);
|
|
71
|
+
}), M = c(() => {
|
|
72
72
|
if (Array.isArray(a.value))
|
|
73
|
-
return l.groupedOptions ?
|
|
74
|
-
}),
|
|
75
|
-
|
|
73
|
+
return l.groupedOptions ? U(r, a) : a.value.length === r.value.length;
|
|
74
|
+
}), Ae = c(() => !l.multi || !Array.isArray(a.value) ? !1 : l.groupedOptions ? re(
|
|
75
|
+
r,
|
|
76
76
|
a
|
|
77
|
-
) : a.value.length > 0 && a.value.length <
|
|
78
|
-
|
|
79
|
-
},
|
|
80
|
-
if (
|
|
81
|
-
|
|
77
|
+
) : a.value.length > 0 && a.value.length < r.value.length), V = (e) => {
|
|
78
|
+
g.value = e;
|
|
79
|
+
}, K = c(() => l.groupedOptions ? ue(l.options) : l.options), be = c(() => {
|
|
80
|
+
if (oe(
|
|
81
|
+
K,
|
|
82
82
|
d
|
|
83
83
|
))
|
|
84
|
-
return
|
|
84
|
+
return K.value;
|
|
85
85
|
const e = {
|
|
86
86
|
selected: [],
|
|
87
87
|
notSelected: []
|
|
88
88
|
};
|
|
89
|
-
P(
|
|
90
|
-
const
|
|
91
|
-
(
|
|
89
|
+
P(K).value.forEach((u) => {
|
|
90
|
+
const o = (l.comparingKey ? d.value.findIndex(
|
|
91
|
+
(_) => _[l.comparingKey] === u[l.comparingKey]
|
|
92
92
|
) > -1 : d.value.includes(u)) ? "selected" : "notSelected";
|
|
93
|
-
e[
|
|
93
|
+
e[o].push(u);
|
|
94
94
|
});
|
|
95
|
-
const t = l.groupedOptions ?
|
|
95
|
+
const t = l.groupedOptions ? B(e.notSelected) : e.notSelected;
|
|
96
96
|
return [].concat(e.selected, t);
|
|
97
|
-
}),
|
|
98
|
-
const e = Array.isArray(d.value) && l.multi &&
|
|
97
|
+
}), r = c(() => {
|
|
98
|
+
const e = Array.isArray(d.value) && l.multi && O.VERSION === 4 && !H ? be.value : K.value;
|
|
99
99
|
if (l.onSearch) {
|
|
100
|
-
const t = e.filter((u) => l.groupedOptions &&
|
|
101
|
-
return l.groupedOptions ?
|
|
100
|
+
const t = e.filter((u) => l.groupedOptions && L(u) ? u : l.onSearch(u, g.value));
|
|
101
|
+
return l.groupedOptions ? B(t) : t;
|
|
102
102
|
} else
|
|
103
103
|
return e;
|
|
104
|
-
}),
|
|
105
|
-
() =>
|
|
104
|
+
}), Pe = c(() => f.value[0]?.hasSubtitle), Z = c(() => s.mode === T.Multi), F = c(
|
|
105
|
+
() => Pe.value ? O.MULTILINE_LIST_HEIGHT : O.LIST_HEIGHT
|
|
106
106
|
), {
|
|
107
|
-
list:
|
|
108
|
-
containerProps:
|
|
109
|
-
wrapperProps:
|
|
110
|
-
scrollTo:
|
|
111
|
-
} = Ue(
|
|
112
|
-
itemHeight:
|
|
107
|
+
list: p,
|
|
108
|
+
containerProps: ee,
|
|
109
|
+
wrapperProps: Te,
|
|
110
|
+
scrollTo: C
|
|
111
|
+
} = Ue(r, {
|
|
112
|
+
itemHeight: F.value,
|
|
113
113
|
overscan: l.disableVirtualScroll ? 1 / 0 : 2
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
b(
|
|
116
116
|
() => l.isOpen,
|
|
117
117
|
(e) => {
|
|
118
|
-
|
|
118
|
+
Q(e);
|
|
119
119
|
}
|
|
120
|
-
),
|
|
120
|
+
), b([x], async () => {
|
|
121
121
|
await N();
|
|
122
|
-
}),
|
|
123
|
-
[
|
|
122
|
+
}), b(
|
|
123
|
+
[y, v, x],
|
|
124
124
|
async ([e], [t]) => {
|
|
125
|
-
|
|
126
|
-
l.multi &&
|
|
125
|
+
y.value && (await N(), x.value !== -1 && e !== t && setTimeout(() => {
|
|
126
|
+
l.multi && O.VERSION === 4 || C(x.value);
|
|
127
127
|
}), v.value && setTimeout(() => {
|
|
128
|
-
|
|
128
|
+
C(v.value);
|
|
129
129
|
}));
|
|
130
130
|
}
|
|
131
|
-
),
|
|
132
|
-
|
|
131
|
+
), b(g, () => {
|
|
132
|
+
A("onsearch", g.value), C(0);
|
|
133
133
|
});
|
|
134
134
|
const S = (e, t = !1) => {
|
|
135
|
-
l.disabled || (
|
|
136
|
-
|
|
135
|
+
l.disabled || (Q(e), N(() => {
|
|
136
|
+
y.value && A("opened"), y.value || A("closed"), w.value && t && w.value.focus();
|
|
137
137
|
}));
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
b(y, (e) => {
|
|
140
140
|
if (e) {
|
|
141
|
-
|
|
141
|
+
g.value = "", Z.value && Array.isArray(n.value) && (d.value = P(n.value).slice());
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
|
-
|
|
144
|
+
J();
|
|
145
145
|
});
|
|
146
|
-
const
|
|
147
|
-
if (
|
|
146
|
+
const we = () => {
|
|
147
|
+
if (M.value) {
|
|
148
148
|
a.value = [];
|
|
149
149
|
return;
|
|
150
150
|
}
|
|
151
151
|
if (Array.isArray(a.value)) {
|
|
152
152
|
if (l.groupedOptions)
|
|
153
|
-
|
|
153
|
+
ie(r, a);
|
|
154
154
|
else {
|
|
155
|
-
if (a.value.length ===
|
|
155
|
+
if (a.value.length === r.value.length) {
|
|
156
156
|
a.value = [];
|
|
157
157
|
return;
|
|
158
158
|
}
|
|
159
|
-
a.value =
|
|
159
|
+
a.value = r.value;
|
|
160
160
|
}
|
|
161
|
-
|
|
161
|
+
A("selectAll");
|
|
162
162
|
}
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
a.value = [], e && (n.value = [], d.value = []),
|
|
167
|
-
},
|
|
168
|
-
if (e = P(e),
|
|
163
|
+
}, Ie = () => {
|
|
164
|
+
we(), O.VERSION !== 4 && (n.value = a.value);
|
|
165
|
+
}, xe = (e = !0) => {
|
|
166
|
+
a.value = [], e && (n.value = [], d.value = []), A("clear");
|
|
167
|
+
}, k = (e, t) => {
|
|
168
|
+
if (e = P(e), O.VERSION === 4 ? e[l.disabledOptionKey] : f.value[t]?.disabled)
|
|
169
169
|
return;
|
|
170
|
-
if (x.value = t,
|
|
171
|
-
l.keepOpen || S(!1),
|
|
170
|
+
if (x.value = t, !l.multi) {
|
|
171
|
+
l.keepOpen || S(!1), s.goToOption(
|
|
172
172
|
0
|
|
173
173
|
/* None */
|
|
174
|
-
), n.value = e,
|
|
174
|
+
), n.value = e, V(""), J(), s.type === G.Search && m.value && (m.value.value = l.displayValue(e)), le();
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
177
|
if (!Array.isArray(a.value))
|
|
178
178
|
return;
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
(
|
|
179
|
+
m.value?.focus();
|
|
180
|
+
const h = P(a.value);
|
|
181
|
+
if (ae(h, e) || l.comparingKey && h.findIndex(
|
|
182
|
+
(o) => o[l.comparingKey] === e[l.comparingKey]
|
|
183
183
|
) > -1) {
|
|
184
|
-
a.value =
|
|
184
|
+
a.value = h.filter((o) => l.comparingKey ? o[l.comparingKey] !== e[l.comparingKey] : !Be(o, e));
|
|
185
185
|
return;
|
|
186
186
|
} else {
|
|
187
|
-
a.value = [...
|
|
187
|
+
a.value = [...h, e];
|
|
188
188
|
return;
|
|
189
189
|
}
|
|
190
|
-
},
|
|
190
|
+
}, De = (e) => f.value[e]?.disabled, s = {
|
|
191
191
|
activeIndex: v,
|
|
192
192
|
options: f,
|
|
193
193
|
selectedOption: n,
|
|
194
|
-
labelRef:
|
|
195
|
-
activeOption:
|
|
194
|
+
labelRef: j,
|
|
195
|
+
activeOption: E,
|
|
196
196
|
listRef: w,
|
|
197
197
|
clearable: l.clearable,
|
|
198
|
-
type:
|
|
198
|
+
type: se.input ? G.Search : G.Dropdown,
|
|
199
199
|
mode: l.multi ? T.Multi : T.Single,
|
|
200
|
-
query:
|
|
201
|
-
selectedValue:
|
|
200
|
+
query: g,
|
|
201
|
+
selectedValue: Y,
|
|
202
202
|
toggle: S,
|
|
203
203
|
disabled: l.disabled,
|
|
204
|
-
open:
|
|
204
|
+
open: y,
|
|
205
205
|
mandatory: l.mandatory,
|
|
206
206
|
size: l.size,
|
|
207
207
|
placeholder: l.placeholder,
|
|
208
|
-
select:
|
|
208
|
+
select: k,
|
|
209
209
|
clearSelection: () => {
|
|
210
|
-
|
|
210
|
+
V(""), n.value = s.mode === T.Single ? null : [], d.value = s.mode === T.Single ? null : [], m.value && (m.value.value = "");
|
|
211
211
|
},
|
|
212
|
-
search:
|
|
212
|
+
search: V,
|
|
213
213
|
goToOption: async (e) => {
|
|
214
|
-
if (!
|
|
214
|
+
if (!y.value)
|
|
215
215
|
return;
|
|
216
216
|
let t = v.value + e;
|
|
217
217
|
const u = f.value.filter(
|
|
218
|
-
(
|
|
219
|
-
).length,
|
|
220
|
-
for (t >
|
|
218
|
+
(o) => o.disabled
|
|
219
|
+
).length, h = r.value.length - u;
|
|
220
|
+
for (t > h && (t = h + 1); ; ) {
|
|
221
221
|
if (!f.value[t]?.disabled) {
|
|
222
|
-
|
|
222
|
+
E.value = r.value[t], v.value = t;
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!
|
|
226
|
-
|
|
225
|
+
if ((e === 1 || e === 10) && (t = t + 1), (e === -1 || e === -10) && (t = t + -1), !!De(v.value)) {
|
|
226
|
+
E.value = r.value[t], v.value = t;
|
|
227
227
|
return;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
},
|
|
231
231
|
registerInput: (e) => {
|
|
232
|
-
|
|
232
|
+
m.value = e.value;
|
|
233
233
|
},
|
|
234
234
|
registerOption: (e, t, u) => {
|
|
235
235
|
f.value = [...f.value, { id: e, disabled: t, hasSubtitle: u }];
|
|
@@ -238,35 +238,38 @@ const ll = (l, b, h) => {
|
|
|
238
238
|
f.value = f.value.filter((t) => t.id !== e);
|
|
239
239
|
}
|
|
240
240
|
};
|
|
241
|
-
Ge(qe,
|
|
241
|
+
Ge(qe, s), ne(
|
|
242
242
|
w,
|
|
243
243
|
() => {
|
|
244
|
-
|
|
244
|
+
y.value && te();
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
ignore: [
|
|
248
248
|
I,
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
249
|
+
X,
|
|
250
|
+
z,
|
|
251
|
+
W,
|
|
252
|
+
m,
|
|
253
|
+
ee.ref
|
|
254
254
|
]
|
|
255
255
|
}
|
|
256
256
|
);
|
|
257
|
-
const
|
|
258
|
-
|
|
257
|
+
const Ke = () => {
|
|
258
|
+
m.value && (m.value.value = s.query.value = "");
|
|
259
259
|
};
|
|
260
260
|
He(async () => {
|
|
261
261
|
l.autoFocus && (await N(), setTimeout(() => {
|
|
262
|
-
|
|
263
|
-
})),
|
|
262
|
+
$.value.focus();
|
|
263
|
+
})), s.goToOption(0), l.multi && !H && (l.groupedOptions ? D.value = U(
|
|
264
|
+
r,
|
|
265
|
+
a
|
|
266
|
+
) : D.value = l.options.length === l.selected.length);
|
|
264
267
|
});
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
},
|
|
268
|
+
const le = () => {
|
|
269
|
+
l.multi && (D.value = M.value, n.value = a.value, Array.isArray(n.value) && (d.value = P(n.value).slice())), A("apply", n.value), S(!1), Ke();
|
|
270
|
+
}, te = () => {
|
|
271
|
+
Z.value && Array.isArray(d.value) && (n.value = P(d.value).slice()), g.value = "", S(!1);
|
|
272
|
+
}, Ce = (e) => {
|
|
270
273
|
if (!l.disableKeyboardEvents)
|
|
271
274
|
switch (e.key) {
|
|
272
275
|
case "Space":
|
|
@@ -275,18 +278,18 @@ const ll = (l, b, h) => {
|
|
|
275
278
|
case "ArrowDown":
|
|
276
279
|
S(!0), e.preventDefault();
|
|
277
280
|
}
|
|
278
|
-
},
|
|
281
|
+
}, Ne = (e) => {
|
|
279
282
|
if (!l.disableKeyboardEvents)
|
|
280
283
|
switch (e.key) {
|
|
281
284
|
case "ArrowUp": {
|
|
282
|
-
|
|
285
|
+
s.goToOption(
|
|
283
286
|
-1
|
|
284
287
|
/* Previous */
|
|
285
288
|
), e.preventDefault(), e.stopPropagation();
|
|
286
289
|
break;
|
|
287
290
|
}
|
|
288
291
|
case "ArrowDown": {
|
|
289
|
-
|
|
292
|
+
s.goToOption(
|
|
290
293
|
1
|
|
291
294
|
/* Next */
|
|
292
295
|
), e.preventDefault(), e.stopPropagation();
|
|
@@ -297,77 +300,77 @@ const ll = (l, b, h) => {
|
|
|
297
300
|
break;
|
|
298
301
|
}
|
|
299
302
|
case "PageUp": {
|
|
300
|
-
|
|
303
|
+
s.goToOption(
|
|
301
304
|
10
|
|
302
305
|
/* NextPage */
|
|
303
306
|
), e.preventDefault();
|
|
304
307
|
break;
|
|
305
308
|
}
|
|
306
309
|
case "PageDown": {
|
|
307
|
-
|
|
310
|
+
s.goToOption(
|
|
308
311
|
-10
|
|
309
312
|
/* PrevPage */
|
|
310
313
|
), e.preventDefault();
|
|
311
314
|
break;
|
|
312
315
|
}
|
|
313
316
|
case "Enter": {
|
|
314
|
-
if (!
|
|
317
|
+
if (!y.value) {
|
|
315
318
|
S(!0);
|
|
316
319
|
return;
|
|
317
320
|
}
|
|
318
|
-
|
|
321
|
+
k(r.value[v.value], v.value), s.mode === T.Single && !l.keepOpen && S(!1), e.preventDefault();
|
|
319
322
|
break;
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
|
-
}, Re =
|
|
325
|
+
}, Re = c(() => {
|
|
323
326
|
if (l.loading)
|
|
324
327
|
return 8.5;
|
|
325
|
-
const e = l.customNumberOfDisplayedOptions ||
|
|
328
|
+
const e = l.customNumberOfDisplayedOptions || p.value.reduce((_, Ee) => {
|
|
326
329
|
const Me = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Ee.data) : 1;
|
|
327
|
-
return
|
|
328
|
-
}, 0), t = l.multi && l.showSelectAll && !
|
|
329
|
-
let
|
|
330
|
-
return l.noResultsText &&
|
|
331
|
-
|
|
330
|
+
return _ + Me;
|
|
331
|
+
}, 0), t = l.multi && l.showSelectAll && !g.value ? 1 : 0, u = e > O.MAX_NUMBER_OF_OPTIONS, h = e + t;
|
|
332
|
+
let o = u ? O.MAX_NUMBER_OF_OPTIONS + 0.1 : h;
|
|
333
|
+
return l.noResultsText && o === 0 && (o = o + 1), l.withConditions && g.value && (o = o + 1), $e(
|
|
334
|
+
o * F.value + O.PADDING_PX
|
|
332
335
|
);
|
|
333
336
|
});
|
|
334
337
|
return {
|
|
335
|
-
onKeydown:
|
|
336
|
-
location:
|
|
337
|
-
open:
|
|
338
|
+
onKeydown: Ne,
|
|
339
|
+
location: fe,
|
|
340
|
+
open: y,
|
|
338
341
|
toggleMenu: S,
|
|
339
|
-
onButtonKeydown:
|
|
340
|
-
displayedValue:
|
|
341
|
-
labelRef:
|
|
342
|
-
query:
|
|
343
|
-
containerProps:
|
|
342
|
+
onButtonKeydown: Ce,
|
|
343
|
+
displayedValue: Se,
|
|
344
|
+
labelRef: j,
|
|
345
|
+
query: g,
|
|
346
|
+
containerProps: ee,
|
|
344
347
|
calculateTableHeight: Re,
|
|
345
|
-
wrapperProps:
|
|
346
|
-
filteredOptions:
|
|
347
|
-
allSelected:
|
|
348
|
-
allSelectedApplied:
|
|
349
|
-
isIndeterminate:
|
|
350
|
-
onSelectAll:
|
|
351
|
-
virtualOptions:
|
|
352
|
-
isSelected:
|
|
348
|
+
wrapperProps: Te,
|
|
349
|
+
filteredOptions: r,
|
|
350
|
+
allSelected: M,
|
|
351
|
+
allSelectedApplied: D,
|
|
352
|
+
isIndeterminate: Ae,
|
|
353
|
+
onSelectAll: Ie,
|
|
354
|
+
virtualOptions: p,
|
|
355
|
+
isSelected: ce,
|
|
353
356
|
selectedOption: n,
|
|
354
357
|
selectedOptionPrevious: d,
|
|
355
|
-
selectedValue:
|
|
356
|
-
onSelect:
|
|
358
|
+
selectedValue: Y,
|
|
359
|
+
onSelect: k,
|
|
357
360
|
activeIndex: v,
|
|
358
|
-
onCancel:
|
|
359
|
-
onApply:
|
|
360
|
-
scrollTo:
|
|
361
|
-
onClickOutside:
|
|
361
|
+
onCancel: te,
|
|
362
|
+
onApply: le,
|
|
363
|
+
scrollTo: C,
|
|
364
|
+
onClickOutside: ne,
|
|
362
365
|
listRef: w,
|
|
363
366
|
buttonRef: I,
|
|
364
|
-
apply:
|
|
365
|
-
cancel:
|
|
366
|
-
el:
|
|
367
|
-
triggerRef:
|
|
368
|
-
clearAll:
|
|
369
|
-
onClearAllSelections:
|
|
370
|
-
isGroup:
|
|
367
|
+
apply: X,
|
|
368
|
+
cancel: z,
|
|
369
|
+
el: $,
|
|
370
|
+
triggerRef: de,
|
|
371
|
+
clearAll: W,
|
|
372
|
+
onClearAllSelections: xe,
|
|
373
|
+
isGroup: L
|
|
371
374
|
};
|
|
372
375
|
};
|
|
373
376
|
export {
|
|
@@ -186,6 +186,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
186
186
|
skidding: number;
|
|
187
187
|
modelValue: any;
|
|
188
188
|
selected: any;
|
|
189
|
+
valueToCopy: string;
|
|
189
190
|
placeholder: string;
|
|
190
191
|
autoFocus: boolean;
|
|
191
192
|
multi: boolean;
|
|
@@ -197,9 +198,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
197
198
|
inlineSearch: boolean;
|
|
198
199
|
onSearch: (option: any, term: string) => boolean;
|
|
199
200
|
noResultsText: string;
|
|
200
|
-
valueToCopy: string;
|
|
201
|
-
helperText: string;
|
|
202
201
|
searchPlaceholder: string;
|
|
202
|
+
helperText: string;
|
|
203
203
|
showButtonOnOpen: boolean;
|
|
204
204
|
clearable: boolean;
|
|
205
205
|
multiOptionsPlaceholderPrefix: string;
|