@ironsource/shared-ui 2.1.12-rc.0 → 2.1.12-rc.10
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_0198fee8_lang.css +1 -0
- package/Chart.vue_vue_type_style_index_0_scoped_78d3f5a8_lang.css +1 -0
- package/ChartHeader.vue_vue_type_style_index_0_scoped_32001725_lang.css +1 -0
- package/ChartHeaderTrend.vue_vue_type_style_index_0_scoped_e4c673e7_lang.css +1 -0
- package/ChartLegend.vue_vue_type_style_index_0_scoped_532f23bc_lang.css +1 -0
- package/ChartPlane.vue_vue_type_style_index_0_scoped_4396faf6_lang.css +1 -0
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_25d0e129_lang.css +1 -0
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8d5521da_lang.css +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_86ea5d2a_lang.css +1 -0
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_64ae80dd_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_d154c5da_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_1_lang.css +1 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_4ba9e4bd_lang.css +1 -0
- package/components/chart/Chart.vue.d.ts +57 -39
- package/components/chart/Chart.vue.js +3 -3
- package/components/chart/Chart.vue2.js +98 -297
- package/components/chart/ChartHeader.vue.d.ts +20 -10
- package/components/chart/ChartHeader.vue.js +2 -2
- package/components/chart/ChartHeader.vue2.js +74 -52
- package/components/chart/ChartHeaderTrend.vue.d.ts +34 -0
- package/components/chart/ChartHeaderTrend.vue.js +7 -0
- package/components/chart/ChartHeaderTrend.vue2.js +32 -0
- package/components/chart/ChartLegend.vue.js +2 -2
- package/components/chart/ChartLegend.vue2.js +36 -35
- package/components/chart/ChartPlane.vue.d.ts +143 -0
- package/components/chart/ChartPlane.vue.js +7 -0
- package/components/chart/ChartPlane.vue2.js +306 -0
- package/components/chart/ChartStoryArgs.d.ts +135 -0
- package/components/chart/ChartTooltip.vue.js +2 -2
- package/components/chart/ChartTooltip.vue2.js +36 -35
- package/components/chart/composables/useChartHeight.d.ts +5 -0
- package/components/chart/composables/useChartHeight.js +22 -0
- package/components/chart/composables/useColorsMap.d.ts +10 -0
- package/components/chart/composables/useColorsMap.js +17 -0
- package/components/chart/composables/useTooltipPosition.d.ts +1 -1
- package/components/chart/composables/useTooltipPosition.js +11 -15
- package/components/chart/consts.d.ts +5 -0
- package/components/chart/consts.js +20 -15
- package/components/chart/index.d.ts +189 -113
- package/components/chart/mockData.d.ts +27 -1
- package/components/chart/types.d.ts +4 -0
- package/components/chart/utils/formatNumber.d.ts +0 -1
- package/components/chart/utils/utils.js +5 -5
- package/components/dateRange/v4/DateRangeV4.vue.js +2 -2
- package/components/dateRange/v4/DateRangeV4.vue2.js +1 -1
- package/components/dropdown/common/Dropdown.common.js +208 -200
- package/components/dropdown/common/useGroupedOptions.d.ts +1 -0
- package/components/dropdown/common/useGroupedOptions.js +40 -39
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue.js +3 -3
- package/components/dropdown/v4/ButtonFilterDropdownTrigger.vue2.js +10 -7
- package/components/dropdown/v4/ConditionalDropdown.vue.js +4 -4
- package/components/dropdown/v4/ConditionalDropdown.vue2.js +80 -80
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +3 -3
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +3 -3
- 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 +97 -86
- package/components/dropdown/v4/TreeDropdown.vue.js +2 -2
- package/components/dropdown/v4/TreeDropdown.vue2.js +68 -73
- package/components/dropdown/v4/dropdownStoryArgs.d.ts +30 -0
- package/components/dropdown/v4/index.d.ts +20 -1
- package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
- package/components/emptyState/v4/index.d.ts +7 -7
- package/components/table/v4/DataGrid.vue.d.ts +4 -3
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +152 -142
- package/components/table/v4/MultipleDataGrid.vue.d.ts +3 -3
- package/components/table/v4/index.d.ts +15 -14
- package/composables/useFullPageHeight.d.ts +10 -0
- package/composables/useFullPageHeight.js +15 -0
- package/index.d.ts +88 -44
- package/index.js +102 -100
- package/package.json +1 -1
- package/testids/index.d.ts +2 -1
- package/testids/index.js +10 -10
- package/utils/formatNumbers.d.ts +1 -1
- package/utils/formatNumbers.js +18 -5
- package/utils/index.js +7 -0
- package/ButtonFilterDropdownTrigger.vue_vue_type_style_index_0_scoped_1aa6df01_lang.css +0 -1
- package/Chart.vue_vue_type_style_index_0_scoped_026d82c5_lang.css +0 -1
- package/ChartHeader.vue_vue_type_style_index_0_scoped_b8213498_lang.css +0 -1
- package/ChartLegend.vue_vue_type_style_index_0_scoped_4fe1c7d1_lang.css +0 -1
- package/ChartTooltip.vue_vue_type_style_index_0_scoped_6744325c_lang.css +0 -1
- package/ConditionalDropdown.vue_vue_type_style_index_0_scoped_8e026669_lang.css +0 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_26488faf_lang.css +0 -1
- package/DateRangeV4.vue_vue_type_style_index_0_scoped_8a2714eb_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_73bf9b5b_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_75002075_lang.css +0 -1
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_b883d1fa_lang.css +0 -1
- package/components/chart/utils/formatNumber.js +0 -11
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { format as n } from "date-fns";
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
2
|
+
import { nFormatter as d } from "../../../utils/formatNumbers.js";
|
|
3
|
+
const M = (r, t, e) => {
|
|
4
4
|
if (e === 0)
|
|
5
5
|
return 0;
|
|
6
6
|
const f = t - r, o = f / e * 0.4;
|
|
7
7
|
return (f + o) / e;
|
|
8
|
-
},
|
|
8
|
+
}, c = (r, t) => t === "day" ? n(new Date(r), "EEEE") : t === "number" ? d(r) : t === "date" ? n(new Date(r), "MMM dd") : t === "dateLong" ? n(new Date(r), "MMM dd, yyyy") : String(r);
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
M as calcStepSize,
|
|
11
|
+
c as formatValue
|
|
12
12
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import e from "./DateRangeV4.vue2.js";
|
|
2
2
|
/* empty css */import o from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
-
// import "../../../DateRangeV4.
|
|
4
|
-
const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-
|
|
3
|
+
// import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css"; //*');
|
|
4
|
+
const s = /* @__PURE__ */ o(e, [["__scopeId", "data-v-a849128a"]]);
|
|
5
5
|
export {
|
|
6
6
|
s as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../../../DateRangeV4.
|
|
1
|
+
import "../../../DateRangeV4.vue_vue_type_style_index_0_scoped_a849128a_lang.css"; import { defineComponent as J, watch as Q, openBlock as n, createElementBlock as s, unref as e, normalizeClass as r, createElementVNode as d, renderSlot as x, createVNode as i, withDirectives as v, Fragment as k, renderList as C, withCtx as l, createTextVNode as m, toDisplayString as g, createCommentVNode as E, vShow as $, normalizeStyle as X, setBlockTracking as R } from "vue";
|
|
2
2
|
import Z from "./CalendarMonthV4.vue.js";
|
|
3
3
|
import { typeToName as _, messagePerType as ee } from "../common/consts.common.js";
|
|
4
4
|
import A from "../../button/v4/ButtonV4.vue.js";
|
|
@@ -1,155 +1,163 @@
|
|
|
1
|
-
import { useToggle as
|
|
2
|
-
import { inject as
|
|
1
|
+
import { useToggle as Ve } from "../../../composables/useToggle.js";
|
|
2
|
+
import { inject as ke, ref as r, computed as c, watch as b, useSlots as Ge, toRaw as I, nextTick as N, provide as Le, onMounted as Ue } from "vue";
|
|
3
3
|
import { isObjectInArray as ae } from "../../../utils/array.js";
|
|
4
|
-
import { objectsEqual as
|
|
5
|
-
import { useClamp as
|
|
6
|
-
import { Mode as
|
|
7
|
-
import { pxToRem as
|
|
8
|
-
import { useEditableContext as
|
|
9
|
-
import { useGroupedOptions as
|
|
10
|
-
const
|
|
11
|
-
const B =
|
|
4
|
+
import { objectsEqual as Be } from "../../../utils/object.js";
|
|
5
|
+
import { useClamp as He, useVirtualList as qe, onClickOutside as ne, useInfiniteScroll as Xe } from "@vueuse/core";
|
|
6
|
+
import { Mode as w, Type as U, DropdownContext as $e } from "./DropdownContext.js";
|
|
7
|
+
import { pxToRem as je } from "../../../utils/style.js";
|
|
8
|
+
import { useEditableContext as ze } from "../../table-cells/common/EditableContext.js";
|
|
9
|
+
import { useGroupedOptions as We } from "./useGroupedOptions.js";
|
|
10
|
+
const al = (e, d, y) => {
|
|
11
|
+
const B = ke("isTreeDropdown", !1), {
|
|
12
12
|
sortOutGroups: H,
|
|
13
13
|
flattenAndMarkGroupOptions: ue,
|
|
14
14
|
isGroup: q,
|
|
15
15
|
selectAllWithGroups: ie,
|
|
16
16
|
isIndeterminateGrouped: re,
|
|
17
17
|
allSelectedGrouped: X,
|
|
18
|
-
areAllPreviousSelected: oe
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
areAllPreviousSelected: oe,
|
|
19
|
+
groupedChildOptionsLength: ce
|
|
20
|
+
} = We(e), se = (l, t) => e.multi && Array.isArray(l) ? e.comparingKey ? l?.findIndex(
|
|
21
|
+
(i) => i[e.comparingKey] === t[e.comparingKey]
|
|
22
|
+
) > -1 : ae(l, t) : e.comparingKey ? l?.[e.comparingKey] === t[e.comparingKey] : l === t;
|
|
22
23
|
let $;
|
|
23
|
-
((
|
|
24
|
-
|
|
24
|
+
((l) => {
|
|
25
|
+
l[l.None = 0] = "None", l[l.Next = 1] = "Next", l[l.Previous = -1] = "Previous", l[l.NextPage = 10] = "NextPage", l[l.PrevPage = -10] = "PrevPage";
|
|
25
26
|
})($ || ($ = {}));
|
|
26
27
|
const a = r(
|
|
27
|
-
|
|
28
|
-
),
|
|
28
|
+
e.selected
|
|
29
|
+
), K = ze(), n = c({
|
|
29
30
|
get() {
|
|
30
|
-
return
|
|
31
|
+
return K?.value?.value ?? a.value;
|
|
31
32
|
},
|
|
32
|
-
set(
|
|
33
|
-
|
|
33
|
+
set(l) {
|
|
34
|
+
K.onChange?.(l), K.onClose?.(), d("update:selected", l);
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
b(
|
|
37
|
-
() =>
|
|
38
|
+
() => e.selected,
|
|
38
39
|
() => {
|
|
39
|
-
a.value =
|
|
40
|
+
a.value = e.selected, v.value = e.selected;
|
|
40
41
|
}
|
|
41
42
|
);
|
|
42
|
-
const
|
|
43
|
-
disabled:
|
|
44
|
-
initialValue:
|
|
43
|
+
const de = Ge(), x = r(null), m = r(null), j = r(null), R = r(null), z = r(null), D = r(null), ve = r(), W = r(null), J = r(null), Q = r(null), fe = 8, ge = c(() => D.value ? D.value.getBoundingClientRect().height + fe + e.distance : 0), C = r(!1), h = r([]), T = r(-1), O = r(""), v = r(e.selected || []), Y = () => D.value?.focus(), [S, ye, he] = Ve({
|
|
44
|
+
disabled: e.disabled,
|
|
45
|
+
initialValue: e.defaultOpen
|
|
45
46
|
});
|
|
46
47
|
b(
|
|
47
|
-
() =>
|
|
48
|
-
(
|
|
49
|
-
|
|
48
|
+
() => e.disabled,
|
|
49
|
+
(l) => {
|
|
50
|
+
l !== void 0 && he(l);
|
|
50
51
|
}
|
|
51
52
|
);
|
|
52
|
-
const Z = (
|
|
53
|
-
|
|
54
|
-
},
|
|
53
|
+
const Z = (l) => {
|
|
54
|
+
Oe.value = ye(l);
|
|
55
|
+
}, Oe = c({
|
|
55
56
|
get() {
|
|
56
|
-
return
|
|
57
|
+
return e.isOpen;
|
|
57
58
|
},
|
|
58
|
-
set(
|
|
59
|
-
|
|
59
|
+
set(l) {
|
|
60
|
+
d("update:isOpen", l);
|
|
60
61
|
}
|
|
61
|
-
}),
|
|
62
|
-
if (!
|
|
63
|
-
return
|
|
64
|
-
const t = !
|
|
65
|
-
return
|
|
66
|
-
},
|
|
67
|
-
if (!
|
|
68
|
-
return
|
|
62
|
+
}), Se = c(() => o.value.length - 1), g = He(0, 0, Se), F = c(() => n.value ? e.displayValue(n.value) : ""), me = (l) => {
|
|
63
|
+
if (!l.value.length && !e.multiOptionsPlaceholderPrefix && !e.multiOptionsPlaceholderSuffix)
|
|
64
|
+
return e.placeholder;
|
|
65
|
+
const t = !e.multiOptionsPlaceholderPrefix && !e.multiOptionsPlaceholderSuffix ? `${l.value.length} selected` : `${e.multiOptionsPlaceholderPrefix ?? ""}${l.value.length ?? "0"}${e.multiOptionsPlaceholderSuffix ?? ""}`;
|
|
66
|
+
return l.value.length == 1 && e.displayValue ? e.displayValue(l.value[0]) : t;
|
|
67
|
+
}, Ae = c(() => {
|
|
68
|
+
if (!e.multi)
|
|
69
|
+
return n.value ? e.displayValue(n.value) : e.placeholder;
|
|
69
70
|
if (Array.isArray(a.value))
|
|
70
|
-
return
|
|
71
|
-
}),
|
|
71
|
+
return me(a);
|
|
72
|
+
}), E = c(() => {
|
|
72
73
|
if (Array.isArray(a.value))
|
|
73
|
-
return
|
|
74
|
-
}),
|
|
74
|
+
return e.groupedOptions ? X(o, a) : a.value.length === o.value.length;
|
|
75
|
+
}), be = c(() => !e.multi || !Array.isArray(a.value) ? !1 : e.groupedOptions ? re(
|
|
75
76
|
o,
|
|
76
77
|
a
|
|
77
|
-
) : a.value.length > 0 && a.value.length < o.value.length), _ = (
|
|
78
|
-
|
|
79
|
-
},
|
|
78
|
+
) : a.value.length > 0 && a.value.length < o.value.length), _ = (l) => {
|
|
79
|
+
O.value = l;
|
|
80
|
+
}, M = c(() => e.groupedOptions ? ue(e.options) : e.options), Te = c(() => {
|
|
80
81
|
if (oe(
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
M,
|
|
83
|
+
v
|
|
83
84
|
))
|
|
84
|
-
return
|
|
85
|
-
const
|
|
85
|
+
return M.value;
|
|
86
|
+
const l = {
|
|
86
87
|
selected: [],
|
|
87
88
|
notSelected: []
|
|
88
89
|
};
|
|
89
|
-
|
|
90
|
-
const
|
|
91
|
-
(L) => L[
|
|
92
|
-
) > -1 :
|
|
93
|
-
|
|
90
|
+
I(M).value.forEach((i) => {
|
|
91
|
+
const u = (e.comparingKey ? v.value.findIndex(
|
|
92
|
+
(L) => L[e.comparingKey] === i[e.comparingKey]
|
|
93
|
+
) > -1 : v.value.includes(i)) ? "selected" : "notSelected";
|
|
94
|
+
l[u].push(i);
|
|
94
95
|
});
|
|
95
|
-
const t =
|
|
96
|
-
return [].concat(
|
|
96
|
+
const t = e.groupedOptions ? H(l.notSelected) : l.notSelected;
|
|
97
|
+
return [].concat(l.selected, t);
|
|
97
98
|
}), o = c(() => {
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
const t =
|
|
101
|
-
return
|
|
99
|
+
const l = Array.isArray(v.value) && e.multi && y.VERSION === 4 && !B ? Te.value : M.value;
|
|
100
|
+
if (e.onSearch) {
|
|
101
|
+
const t = l.filter((i) => e.groupedOptions && q(i) ? i : e.onSearch(i, O.value));
|
|
102
|
+
return e.groupedOptions ? H(t) : t;
|
|
102
103
|
} else
|
|
103
|
-
return
|
|
104
|
-
}), Pe = c(() =>
|
|
105
|
-
() => Pe.value ?
|
|
104
|
+
return l;
|
|
105
|
+
}), Pe = c(() => h.value[0]?.hasSubtitle), p = c(() => s.mode === w.Multi), ee = c(
|
|
106
|
+
() => Pe.value ? y.MULTILINE_LIST_HEIGHT : y.LIST_HEIGHT
|
|
106
107
|
), {
|
|
107
108
|
list: V,
|
|
108
109
|
containerProps: k,
|
|
109
|
-
wrapperProps:
|
|
110
|
-
scrollTo:
|
|
111
|
-
} =
|
|
110
|
+
wrapperProps: Ie,
|
|
111
|
+
scrollTo: P
|
|
112
|
+
} = qe(o, {
|
|
112
113
|
itemHeight: ee.value,
|
|
113
|
-
overscan:
|
|
114
|
+
overscan: e.disableVirtualScroll ? 1 / 0 : 2
|
|
114
115
|
});
|
|
115
116
|
b(
|
|
116
|
-
() =>
|
|
117
|
-
(
|
|
118
|
-
Z(
|
|
117
|
+
() => e.isOpen,
|
|
118
|
+
(l) => {
|
|
119
|
+
Z(l);
|
|
119
120
|
}
|
|
120
|
-
), b([
|
|
121
|
-
await
|
|
121
|
+
), b([T], async () => {
|
|
122
|
+
await N();
|
|
122
123
|
}), b(
|
|
123
|
-
[
|
|
124
|
-
async ([
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
124
|
+
[S, g, T],
|
|
125
|
+
async ([l], [t]) => {
|
|
126
|
+
S.value && (await N(), T.value !== -1 && l !== t && setTimeout(() => {
|
|
127
|
+
if (!(e.multi && y.VERSION === 4))
|
|
128
|
+
if (P(T.value), e.groupedOptions) {
|
|
129
|
+
const i = M.value.findIndex(
|
|
130
|
+
(f) => f === n.value
|
|
131
|
+
);
|
|
132
|
+
P(i);
|
|
133
|
+
} else
|
|
134
|
+
P(T.value);
|
|
135
|
+
}), g.value && setTimeout(() => {
|
|
136
|
+
P(g.value);
|
|
129
137
|
}));
|
|
130
138
|
}
|
|
131
|
-
), b(
|
|
132
|
-
|
|
139
|
+
), b(O, () => {
|
|
140
|
+
d("onsearch", O.value), P(0);
|
|
133
141
|
});
|
|
134
|
-
const A = (
|
|
135
|
-
|
|
136
|
-
|
|
142
|
+
const A = (l, t = !1) => {
|
|
143
|
+
e.disabled || (Z(l), N(() => {
|
|
144
|
+
S.value && d("opened"), S.value || d("closed"), x.value && t && x.value.focus();
|
|
137
145
|
}));
|
|
138
146
|
};
|
|
139
|
-
b(
|
|
140
|
-
if (
|
|
141
|
-
|
|
147
|
+
b(S, (l) => {
|
|
148
|
+
if (l) {
|
|
149
|
+
O.value = "", p.value && Array.isArray(n.value) && (v.value = I(n.value).slice());
|
|
142
150
|
return;
|
|
143
151
|
}
|
|
144
152
|
Y();
|
|
145
153
|
});
|
|
146
154
|
const we = () => {
|
|
147
|
-
if (
|
|
155
|
+
if (E.value) {
|
|
148
156
|
a.value = [];
|
|
149
157
|
return;
|
|
150
158
|
}
|
|
151
159
|
if (Array.isArray(a.value)) {
|
|
152
|
-
if (
|
|
160
|
+
if (e.groupedOptions)
|
|
153
161
|
ie(o, a);
|
|
154
162
|
else {
|
|
155
163
|
if (a.value.length === o.value.length) {
|
|
@@ -158,94 +166,94 @@ const tl = (l, v, g) => {
|
|
|
158
166
|
}
|
|
159
167
|
a.value = o.value;
|
|
160
168
|
}
|
|
161
|
-
|
|
169
|
+
d("selectAll");
|
|
162
170
|
}
|
|
163
|
-
},
|
|
164
|
-
we(),
|
|
165
|
-
},
|
|
166
|
-
a.value = [],
|
|
167
|
-
}, G = (
|
|
168
|
-
if (
|
|
171
|
+
}, xe = () => {
|
|
172
|
+
we(), y.VERSION !== 4 && (n.value = a.value);
|
|
173
|
+
}, De = (l = !0) => {
|
|
174
|
+
a.value = [], l ? (n.value = [], v.value = [], d("clear")) : e.dynamicFilterMode || d("clear");
|
|
175
|
+
}, G = (l, t) => {
|
|
176
|
+
if (l = I(l), y.VERSION === 4 ? l[e.disabledOptionKey] : h.value[t]?.disabled)
|
|
169
177
|
return;
|
|
170
|
-
if (
|
|
171
|
-
|
|
178
|
+
if (T.value = t, !e.multi) {
|
|
179
|
+
e.keepOpen || A(!1), s.goToOption(
|
|
172
180
|
0
|
|
173
181
|
/* None */
|
|
174
|
-
),
|
|
182
|
+
), n.value = l, _(""), Y(), s.type === U.Search && m.value && (m.value.value = e.displayValue(l)), le();
|
|
175
183
|
return;
|
|
176
184
|
}
|
|
177
185
|
if (!Array.isArray(a.value))
|
|
178
186
|
return;
|
|
179
187
|
m.value?.focus();
|
|
180
|
-
const
|
|
181
|
-
if (ae(
|
|
182
|
-
(
|
|
188
|
+
const f = I(a.value);
|
|
189
|
+
if (ae(f, l) || e.comparingKey && f.findIndex(
|
|
190
|
+
(u) => u[e.comparingKey] === l[e.comparingKey]
|
|
183
191
|
) > -1) {
|
|
184
|
-
a.value =
|
|
192
|
+
a.value = f.filter((u) => e.comparingKey ? u[e.comparingKey] !== l[e.comparingKey] : !Be(u, l));
|
|
185
193
|
return;
|
|
186
194
|
} else {
|
|
187
|
-
a.value = [...
|
|
195
|
+
a.value = [...f, l];
|
|
188
196
|
return;
|
|
189
197
|
}
|
|
190
|
-
},
|
|
191
|
-
activeIndex:
|
|
192
|
-
options:
|
|
193
|
-
selectedOption:
|
|
198
|
+
}, Me = (l) => h.value[l]?.disabled, s = {
|
|
199
|
+
activeIndex: g,
|
|
200
|
+
options: h,
|
|
201
|
+
selectedOption: n,
|
|
194
202
|
labelRef: z,
|
|
195
|
-
activeOption:
|
|
196
|
-
listRef:
|
|
197
|
-
clearable:
|
|
198
|
-
type:
|
|
199
|
-
mode:
|
|
200
|
-
query:
|
|
203
|
+
activeOption: R,
|
|
204
|
+
listRef: x,
|
|
205
|
+
clearable: e.clearable,
|
|
206
|
+
type: de.input ? U.Search : U.Dropdown,
|
|
207
|
+
mode: e.multi ? w.Multi : w.Single,
|
|
208
|
+
query: O,
|
|
201
209
|
selectedValue: F,
|
|
202
210
|
toggle: A,
|
|
203
|
-
disabled:
|
|
204
|
-
open:
|
|
205
|
-
mandatory:
|
|
206
|
-
size:
|
|
207
|
-
placeholder:
|
|
211
|
+
disabled: e.disabled,
|
|
212
|
+
open: S,
|
|
213
|
+
mandatory: e.mandatory,
|
|
214
|
+
size: e.size,
|
|
215
|
+
placeholder: e.placeholder,
|
|
208
216
|
select: G,
|
|
209
217
|
clearSelection: () => {
|
|
210
|
-
_(""),
|
|
218
|
+
_(""), n.value = s.mode === w.Single ? null : [], v.value = s.mode === w.Single ? null : [], m.value && (m.value.value = "");
|
|
211
219
|
},
|
|
212
220
|
search: _,
|
|
213
|
-
goToOption: async (
|
|
214
|
-
if (!
|
|
221
|
+
goToOption: async (l) => {
|
|
222
|
+
if (!S.value)
|
|
215
223
|
return;
|
|
216
|
-
let t =
|
|
217
|
-
const i =
|
|
218
|
-
(
|
|
219
|
-
).length,
|
|
220
|
-
for (t >
|
|
221
|
-
if (!
|
|
222
|
-
|
|
224
|
+
let t = g.value + l;
|
|
225
|
+
const i = h.value.filter(
|
|
226
|
+
(u) => u.disabled
|
|
227
|
+
).length, f = o.value.length - i;
|
|
228
|
+
for (t > f && (t = f + 1); ; ) {
|
|
229
|
+
if (!h.value[t]?.disabled) {
|
|
230
|
+
R.value = o.value[t], g.value = t;
|
|
223
231
|
return;
|
|
224
232
|
}
|
|
225
|
-
if ((
|
|
226
|
-
|
|
233
|
+
if ((l === 1 || l === 10) && (t = t + 1), (l === -1 || l === -10) && (t = t + -1), !!Me(g.value)) {
|
|
234
|
+
R.value = o.value[t], g.value = t;
|
|
227
235
|
return;
|
|
228
236
|
}
|
|
229
237
|
}
|
|
230
238
|
},
|
|
231
|
-
registerInput: (
|
|
232
|
-
m.value =
|
|
239
|
+
registerInput: (l) => {
|
|
240
|
+
m.value = l.value;
|
|
233
241
|
},
|
|
234
|
-
registerOption: (
|
|
235
|
-
|
|
242
|
+
registerOption: (l, t, i) => {
|
|
243
|
+
h.value = [...h.value, { id: l, disabled: t, hasSubtitle: i }];
|
|
236
244
|
},
|
|
237
|
-
unRegisterOption(
|
|
238
|
-
|
|
245
|
+
unRegisterOption(l) {
|
|
246
|
+
h.value = h.value.filter((t) => t.id !== l);
|
|
239
247
|
}
|
|
240
248
|
};
|
|
241
|
-
|
|
242
|
-
|
|
249
|
+
Le($e, s), ne(
|
|
250
|
+
x,
|
|
243
251
|
() => {
|
|
244
|
-
|
|
252
|
+
S.value && te();
|
|
245
253
|
},
|
|
246
254
|
{
|
|
247
255
|
ignore: [
|
|
248
|
-
|
|
256
|
+
D,
|
|
249
257
|
W,
|
|
250
258
|
J,
|
|
251
259
|
Q,
|
|
@@ -254,133 +262,133 @@ const tl = (l, v, g) => {
|
|
|
254
262
|
]
|
|
255
263
|
}
|
|
256
264
|
);
|
|
257
|
-
const
|
|
265
|
+
const Ce = () => {
|
|
258
266
|
m.value && (m.value.value = s.query.value = "");
|
|
259
267
|
};
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
Ue(async () => {
|
|
269
|
+
e.autoFocus && (await N(), setTimeout(() => {
|
|
262
270
|
j.value.focus();
|
|
263
|
-
})), s.goToOption(0),
|
|
271
|
+
})), s.goToOption(0), e.multi && !B && (e.groupedOptions ? C.value = X(
|
|
264
272
|
o,
|
|
265
273
|
a
|
|
266
|
-
) :
|
|
274
|
+
) : C.value = e.options.length === e.selected.length);
|
|
267
275
|
});
|
|
268
276
|
const le = () => {
|
|
269
|
-
|
|
277
|
+
e.multi && (n.value = a.value, Array.isArray(n.value) && (v.value = I(n.value).slice(), C.value = e.groupedOptions ? ce(e.options) === n.value.length : e.options.length === n.value.length)), d("apply", n.value), d("allSelectedChanged", E.value), A(!1), Ce();
|
|
270
278
|
}, te = () => {
|
|
271
|
-
p.value && Array.isArray(
|
|
272
|
-
}, Ne = (
|
|
273
|
-
if (!
|
|
274
|
-
switch (
|
|
279
|
+
p.value && Array.isArray(v.value) && (n.value = I(v.value).slice()), O.value = "", A(!1);
|
|
280
|
+
}, Ne = (l) => {
|
|
281
|
+
if (!e.disableKeyboardEvents)
|
|
282
|
+
switch (l.key) {
|
|
275
283
|
case "Space":
|
|
276
284
|
case "Enter":
|
|
277
285
|
case "ArrowUp":
|
|
278
286
|
case "ArrowDown":
|
|
279
|
-
A(!0),
|
|
287
|
+
A(!0), l.preventDefault();
|
|
280
288
|
}
|
|
281
|
-
},
|
|
282
|
-
if (!
|
|
283
|
-
switch (
|
|
289
|
+
}, Ke = (l) => {
|
|
290
|
+
if (!e.disableKeyboardEvents)
|
|
291
|
+
switch (l.key) {
|
|
284
292
|
case "ArrowUp": {
|
|
285
293
|
s.goToOption(
|
|
286
294
|
-1
|
|
287
295
|
/* Previous */
|
|
288
|
-
),
|
|
296
|
+
), l.preventDefault(), l.stopPropagation();
|
|
289
297
|
break;
|
|
290
298
|
}
|
|
291
299
|
case "ArrowDown": {
|
|
292
300
|
s.goToOption(
|
|
293
301
|
1
|
|
294
302
|
/* Next */
|
|
295
|
-
),
|
|
303
|
+
), l.preventDefault(), l.stopPropagation();
|
|
296
304
|
break;
|
|
297
305
|
}
|
|
298
306
|
case "Escape": {
|
|
299
|
-
A(!1),
|
|
307
|
+
A(!1), l.preventDefault();
|
|
300
308
|
break;
|
|
301
309
|
}
|
|
302
310
|
case "PageUp": {
|
|
303
311
|
s.goToOption(
|
|
304
312
|
10
|
|
305
313
|
/* NextPage */
|
|
306
|
-
),
|
|
314
|
+
), l.preventDefault();
|
|
307
315
|
break;
|
|
308
316
|
}
|
|
309
317
|
case "PageDown": {
|
|
310
318
|
s.goToOption(
|
|
311
319
|
-10
|
|
312
320
|
/* PrevPage */
|
|
313
|
-
),
|
|
321
|
+
), l.preventDefault();
|
|
314
322
|
break;
|
|
315
323
|
}
|
|
316
324
|
case "Enter": {
|
|
317
|
-
if (!
|
|
325
|
+
if (!S.value) {
|
|
318
326
|
A(!0);
|
|
319
327
|
return;
|
|
320
328
|
}
|
|
321
|
-
G(o.value[
|
|
329
|
+
G(o.value[g.value], g.value), s.mode === w.Single && !e.keepOpen && A(!1), l.preventDefault();
|
|
322
330
|
break;
|
|
323
331
|
}
|
|
324
332
|
}
|
|
325
|
-
},
|
|
326
|
-
if (
|
|
333
|
+
}, Re = c(() => {
|
|
334
|
+
if (e.loading)
|
|
327
335
|
return 8.5;
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
return L +
|
|
331
|
-
}, 0), t =
|
|
332
|
-
let
|
|
333
|
-
return
|
|
334
|
-
|
|
336
|
+
const l = e.loadMoreLoading && y.MAX_NUMBER_OF_OPTIONS || e.customNumberOfDisplayedOptions || V.value.reduce((L, Ee) => {
|
|
337
|
+
const _e = e.overrideOptionCountCalculation ? e.overrideOptionCountCalculation(Ee.data) : 1;
|
|
338
|
+
return L + _e;
|
|
339
|
+
}, 0), t = e.multi && e.showSelectAll && !O.value ? 1 : 0, i = l > y.MAX_NUMBER_OF_OPTIONS, f = l + t;
|
|
340
|
+
let u = i ? y.MAX_NUMBER_OF_OPTIONS + 0.1 : f;
|
|
341
|
+
return e.loadMoreLoading && e.multi && (V.value.length ? u = u + 0.1 : u = u - 0.9), e.noResultsText && u === 0 && (u = u + 1), e.withConditions && O.value && (u = u + 1), je(
|
|
342
|
+
u * ee.value + y.PADDING_PX
|
|
335
343
|
);
|
|
336
344
|
});
|
|
337
|
-
return
|
|
345
|
+
return Xe(
|
|
338
346
|
k.ref,
|
|
339
347
|
() => {
|
|
340
|
-
!
|
|
348
|
+
!e.loadMoreLoading && e.infiniteLoading && d("loadMore");
|
|
341
349
|
},
|
|
342
|
-
{ distance:
|
|
350
|
+
{ distance: e.infiniteScrollThreshold }
|
|
343
351
|
), b(a, () => {
|
|
344
|
-
|
|
352
|
+
d("unsavedSelectionUpdate", a.value);
|
|
345
353
|
}), {
|
|
346
|
-
onKeydown:
|
|
347
|
-
location:
|
|
348
|
-
open:
|
|
354
|
+
onKeydown: Ke,
|
|
355
|
+
location: ge,
|
|
356
|
+
open: S,
|
|
349
357
|
toggleMenu: A,
|
|
350
358
|
onButtonKeydown: Ne,
|
|
351
|
-
displayedValue:
|
|
359
|
+
displayedValue: Ae,
|
|
352
360
|
labelRef: z,
|
|
353
|
-
query:
|
|
361
|
+
query: O,
|
|
354
362
|
containerProps: k,
|
|
355
|
-
calculateTableHeight:
|
|
356
|
-
wrapperProps:
|
|
363
|
+
calculateTableHeight: Re,
|
|
364
|
+
wrapperProps: Ie,
|
|
357
365
|
filteredOptions: o,
|
|
358
|
-
allSelected:
|
|
359
|
-
allSelectedApplied:
|
|
360
|
-
isIndeterminate:
|
|
361
|
-
onSelectAll:
|
|
366
|
+
allSelected: E,
|
|
367
|
+
allSelectedApplied: C,
|
|
368
|
+
isIndeterminate: be,
|
|
369
|
+
onSelectAll: xe,
|
|
362
370
|
virtualOptions: V,
|
|
363
|
-
isSelected:
|
|
364
|
-
selectedOption:
|
|
365
|
-
selectedOptionPrevious:
|
|
371
|
+
isSelected: se,
|
|
372
|
+
selectedOption: n,
|
|
373
|
+
selectedOptionPrevious: v,
|
|
366
374
|
selectedValue: F,
|
|
367
375
|
onSelect: G,
|
|
368
|
-
activeIndex:
|
|
376
|
+
activeIndex: g,
|
|
369
377
|
onCancel: te,
|
|
370
378
|
onApply: le,
|
|
371
|
-
scrollTo:
|
|
379
|
+
scrollTo: P,
|
|
372
380
|
onClickOutside: ne,
|
|
373
|
-
listRef:
|
|
374
|
-
buttonRef:
|
|
381
|
+
listRef: x,
|
|
382
|
+
buttonRef: D,
|
|
375
383
|
apply: W,
|
|
376
384
|
cancel: J,
|
|
377
385
|
el: j,
|
|
378
|
-
triggerRef:
|
|
386
|
+
triggerRef: ve,
|
|
379
387
|
clearAll: Q,
|
|
380
|
-
onClearAllSelections:
|
|
388
|
+
onClearAllSelections: De,
|
|
381
389
|
isGroup: q
|
|
382
390
|
};
|
|
383
391
|
};
|
|
384
392
|
export {
|
|
385
|
-
|
|
393
|
+
al as dropdownCommon
|
|
386
394
|
};
|
|
@@ -7,4 +7,5 @@ export declare const useGroupedOptions: (props: any) => {
|
|
|
7
7
|
isIndeterminateGrouped: (filteredOptions: any, selectedOptionRef: Ref<unknown[]>) => boolean;
|
|
8
8
|
allSelectedGrouped: (filteredOptions: any, selectedOptionRef: Ref<unknown[]>) => boolean;
|
|
9
9
|
areAllPreviousSelected: (flatOptions: Ref<unknown[]>, selectedOptionPrevious: Ref<unknown[]>) => boolean;
|
|
10
|
+
groupedChildOptionsLength: (options: any) => number;
|
|
10
11
|
};
|