@ironsource/shared-ui 2.1.6-rc.4 → 2.1.6-rc.40
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/Alert.vue_vue_type_style_index_0_scoped_a9f0dfcc_lang.css +1 -0
- package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_858cefbf_lang.css +1 -0
- package/AppHeader.vue_vue_type_style_index_0_scoped_538ccdc6_lang.css +1 -0
- package/Autocomplete.vue_vue_type_style_index_0_scoped_a7bfd237_lang.css +1 -0
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_a8fdae89_lang.css +1 -0
- package/ChipV4.vue_vue_type_style_index_0_scoped_12c0f396_lang.css +1 -0
- package/DataGrid.vue_vue_type_style_index_0_scoped_057abdf5_lang.css +1 -0
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_0345d6b1_lang.css +1 -0
- package/DialogV4.vue_vue_type_style_index_0_scoped_09c488cf_lang.css +1 -0
- package/Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css +1 -0
- package/DropdownV4.vue_vue_type_style_index_0_scoped_7af4f288_lang.css +1 -0
- package/FieldLabel.vue_vue_type_style_index_0_scoped_96ee1c98_lang.css +1 -0
- package/FoldableSection.vue_vue_type_style_index_0_scoped_1a5f0e2e_lang.css +1 -0
- package/{FormCard.vue_vue_type_style_index_0_scoped_ef8b4e81_lang.css → FormCard.vue_vue_type_style_index_0_scoped_52ade67c_lang.css} +1 -1
- package/HelpIcon.vue_vue_type_style_index_0_scoped_06fce2e3_lang.css +1 -0
- package/IconV4.vue_vue_type_style_index_0_scoped_9d3c9cda_lang.css +1 -0
- package/InlineCopy.vue_vue_type_style_index_0_scoped_893a203c_lang.css +1 -0
- package/OptionV4.vue_vue_type_style_index_0_scoped_9db0f796_lang.css +1 -0
- package/TextAreaV4.vue_vue_type_style_index_0_scoped_f3b2c01d_lang.css +1 -0
- package/TextField.vue_vue_type_style_index_0_scoped_a6457440_lang.css +1 -0
- package/ToggleV4.vue_vue_type_style_index_0_scoped_a4aa32fb_lang.css +1 -0
- package/TooltipV4.vue_vue_type_style_index_0_scoped_fcdb9d02_lang.css +1 -0
- package/TreeDropdown.vue_vue_type_style_index_0_scoped_142eab98_lang.css +1 -0
- package/components/alert/Alert.vue.d.ts +7 -0
- package/components/alert/Alert.vue.js +3 -3
- package/components/alert/Alert.vue2.js +44 -40
- package/components/alert/index.d.ts +27 -2
- package/components/appHeader/AppHeader.vue.d.ts +6 -2
- package/components/appHeader/AppHeader.vue.js +2 -2
- package/components/appHeader/AppHeader.vue2.js +30 -28
- package/components/appHeader/index.d.ts +6 -2
- package/components/autocomplete/Autocomplete.vue.d.ts +6 -0
- package/components/autocomplete/Autocomplete.vue.js +2 -2
- package/components/autocomplete/Autocomplete.vue2.js +45 -37
- package/components/autocomplete/index.d.ts +21 -1
- package/components/button/v4/ButtonV4.vue.d.ts +7 -7
- package/components/button/v4/IconButtonV4.vue.d.ts +4 -4
- package/components/button/v4/index.d.ts +61 -61
- package/components/chip/v4/Chip.types.d.ts +6 -0
- package/components/chip/v4/ChipV4.vue.d.ts +28 -35
- package/components/chip/v4/ChipV4.vue.js +3 -3
- package/components/chip/v4/ChipV4.vue2.js +28 -59
- package/components/chip/v4/index.d.ts +45 -148
- package/components/dialog/v3/Dialog.vue.d.ts +1 -1
- package/components/dialog/v3/index.d.ts +20 -20
- package/components/dialog/v4/DialogV4.vue.js +3 -3
- package/components/dialog/v4/DialogV4.vue2.js +67 -62
- package/components/dropdown/common/Dropdown.common.js +74 -69
- package/components/dropdown/common/Option.common.d.ts +1 -1
- package/components/dropdown/common/Option.common.js +9 -9
- package/components/dropdown/composables/useChildOptions.d.ts +7 -0
- package/components/dropdown/composables/useChildOptions.js +14 -0
- package/components/dropdown/v3/Dropdown.vue.d.ts +4 -0
- package/components/dropdown/v3/Dropdown.vue.js +4 -4
- package/components/dropdown/v3/Dropdown.vue2.js +32 -32
- package/components/dropdown/v3/index.d.ts +13 -1
- package/components/dropdown/v4/AppDropdownTrigger.vue.d.ts +16 -3
- package/components/dropdown/v4/AppDropdownTrigger.vue.js +3 -3
- package/components/dropdown/v4/AppDropdownTrigger.vue2.js +102 -61
- package/components/dropdown/v4/ChipDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/ChipDropdownTrigger.vue2.js +1 -1
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.d.ts +8 -3
- package/components/dropdown/v4/DefaultDropdownTrigger.vue.js +2 -2
- package/components/dropdown/v4/DefaultDropdownTrigger.vue2.js +22 -21
- package/components/dropdown/v4/DropdownV4.vue.d.ts +35 -3
- package/components/dropdown/v4/DropdownV4.vue.js +2 -2
- package/components/dropdown/v4/DropdownV4.vue2.js +127 -114
- package/components/dropdown/v4/OptionV4.vue.d.ts +14 -3
- package/components/dropdown/v4/OptionV4.vue.js +2 -2
- package/components/dropdown/v4/OptionV4.vue2.js +79 -56
- package/components/dropdown/v4/TreeDropdown.vue.d.ts +112 -0
- package/components/dropdown/v4/TreeDropdown.vue.js +7 -0
- package/components/dropdown/v4/TreeDropdown.vue2.js +122 -0
- package/components/dropdown/v4/dropdownStoryArgs.d.ts +1 -1
- package/components/dropdown/v4/index.d.ts +422 -38
- package/components/dropdown/v4/index.js +7 -4
- package/components/emptyState/v3/EmptyState.vue.d.ts +2 -2
- package/components/emptyState/v3/index.d.ts +47 -47
- package/components/emptyState/v4/EmptyStateV4.vue.d.ts +3 -3
- package/components/emptyState/v4/index.d.ts +7 -7
- package/components/forms/FormCard.vue.js +2 -2
- package/components/forms/FormCard.vue2.js +9 -9
- package/components/icon/v4/Icon.types.d.ts +1 -1
- package/components/icon/v4/IconV4.vue.d.ts +16 -6
- package/components/icon/v4/IconV4.vue.js +4 -4
- package/components/icon/v4/IconV4.vue2.js +36 -33
- package/components/icon/v4/index.d.ts +53 -15
- package/components/inlineCopy/InlineCopy.vue.d.ts +6 -2
- package/components/inlineCopy/InlineCopy.vue.js +3 -3
- package/components/inlineCopy/InlineCopy.vue2.js +23 -22
- package/components/inlineCopy/index.d.ts +6 -2
- package/components/input/v4/TextField.vue.d.ts +5 -0
- package/components/input/v4/TextField.vue.js +3 -3
- package/components/input/v4/TextField.vue2.js +24 -21
- package/components/input/v4/index.d.ts +20 -1
- package/components/layout/FoldableSection.vue.js +5 -5
- package/components/layout/FoldableSection.vue2.js +1 -1
- package/components/multibar/MultiBarMenu.vue2.js +12 -11
- package/components/shared/FieldLabel.vue.js +3 -3
- package/components/shared/FieldLabel.vue2.js +9 -9
- package/components/snackbar/v4/SnackbarV4.vue.d.ts +20 -20
- package/components/table/common/Table.common.d.ts +1 -0
- package/components/table/common/Table.common.js +65 -61
- package/components/table/v4/DataGrid.vue.d.ts +9 -1
- package/components/table/v4/DataGrid.vue.js +3 -3
- package/components/table/v4/DataGrid.vue2.js +180 -176
- package/components/table/v4/DataGridMenu.vue2.js +3 -2
- package/components/table/v4/HelpIcon.vue.js +5 -5
- package/components/table/v4/HelpIcon.vue2.js +5 -5
- package/components/table/v4/index.d.ts +29 -5
- package/components/textArea/v4/TextAreaV4.vue.js +3 -3
- package/components/textArea/v4/TextAreaV4.vue2.js +1 -1
- package/components/toggle/v4/ToggleV4.vue.d.ts +1 -1
- package/components/toggle/v4/ToggleV4.vue.js +3 -3
- package/components/toggle/v4/ToggleV4.vue2.js +12 -12
- package/components/toggle/v4/index.d.ts +20 -20
- package/components/tooltip/v4/TooltipV4.vue.d.ts +6 -2
- package/components/tooltip/v4/TooltipV4.vue.js +2 -2
- package/components/tooltip/v4/TooltipV4.vue2.js +21 -19
- package/components/tooltip/v4/index.d.ts +17 -5
- package/composables/useFormValidation.js +19 -13
- package/design-foundation.stories/icons/iconsData.d.ts +5 -1
- package/index.d.ts +1451 -688
- package/mocks/apps.d.ts +1 -0
- package/mocks/options.d.ts +12 -0
- package/package.json +1 -1
- package/utils/text.d.ts +1 -0
- package/utils/text.js +9 -0
- package/Alert.vue_vue_type_style_index_0_scoped_d6680a72_lang.css +0 -1
- package/AppDropdownTrigger.vue_vue_type_style_index_0_scoped_0267d003_lang.css +0 -1
- package/AppHeader.vue_vue_type_style_index_0_scoped_c148fc7a_lang.css +0 -1
- package/Autocomplete.vue_vue_type_style_index_0_scoped_62faa8e0_lang.css +0 -1
- package/ChipDropdownTrigger.vue_vue_type_style_index_0_scoped_889042cf_lang.css +0 -1
- package/ChipV4.vue_vue_type_style_index_0_scoped_78d7c9c0_lang.css +0 -1
- package/DataGrid.vue_vue_type_style_index_0_scoped_c96fba2c_lang.css +0 -1
- package/DefaultDropdownTrigger.vue_vue_type_style_index_0_scoped_c9783327_lang.css +0 -1
- package/DialogV4.vue_vue_type_style_index_0_scoped_c3004ba3_lang.css +0 -1
- package/Dropdown.vue_vue_type_style_index_0_scoped_d4f8e790_lang.css +0 -1
- package/DropdownV4.vue_vue_type_style_index_0_scoped_0968078f_lang.css +0 -1
- package/FieldLabel.vue_vue_type_style_index_0_scoped_72ab1f25_lang.css +0 -1
- package/FoldableSection.vue_vue_type_style_index_0_scoped_8d0fd203_lang.css +0 -1
- package/HelpIcon.vue_vue_type_style_index_0_scoped_7a611779_lang.css +0 -1
- package/IconV4.vue_vue_type_style_index_0_scoped_a78f8a3e_lang.css +0 -1
- package/InlineCopy.vue_vue_type_style_index_0_scoped_ff9f4a0f_lang.css +0 -1
- package/OptionV4.vue_vue_type_style_index_0_scoped_b8375219_lang.css +0 -1
- package/TextAreaV4.vue_vue_type_style_index_0_scoped_8199b662_lang.css +0 -1
- package/TextField.vue_vue_type_style_index_0_scoped_07687bcc_lang.css +0 -1
- package/ToggleV4.vue_vue_type_style_index_0_scoped_ad231e8c_lang.css +0 -1
- package/TooltipV4.vue_vue_type_style_index_0_scoped_25809092_lang.css +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useToggle as
|
|
2
|
-
import { ref as n, computed as r, watch as m, useSlots as
|
|
1
|
+
import { useToggle as we } from "../../../composables/useToggle.js";
|
|
2
|
+
import { ref as n, computed as r, watch as m, useSlots as Ie, toRaw as O, nextTick as C, provide as xe, onMounted as De } from "vue";
|
|
3
3
|
import { isObjectInArray as W } 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
|
-
const
|
|
10
|
-
const Z = (e, t) => l.multi ? W(e, t) :
|
|
11
|
-
let
|
|
4
|
+
import { objectsEqual as Ce } from "../../../utils/object.js";
|
|
5
|
+
import { useClamp as Ne, useVirtualList as Re, onClickOutside as Y } from "@vueuse/core";
|
|
6
|
+
import { Mode as P, Type as V, DropdownContext as Ee } from "./DropdownContext.js";
|
|
7
|
+
import { pxToRem as Me } from "../../../utils/style.js";
|
|
8
|
+
import { useEditableContext as Ve } from "../../table-cells/common/EditableContext.js";
|
|
9
|
+
const Ke = (l, A, b) => {
|
|
10
|
+
const Z = (e, t) => l.multi ? W(e, t) : O(e) === t;
|
|
11
|
+
let _;
|
|
12
12
|
((e) => {
|
|
13
13
|
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";
|
|
14
|
-
})(
|
|
14
|
+
})(_ || (_ = {}));
|
|
15
15
|
const a = n(
|
|
16
16
|
l.selected
|
|
17
|
-
), N =
|
|
17
|
+
), N = Ve(), u = r({
|
|
18
18
|
get() {
|
|
19
19
|
return N?.value?.value ?? a.value;
|
|
20
20
|
},
|
|
21
21
|
set(e) {
|
|
22
|
-
N.onChange?.(e), N.onClose?.(),
|
|
22
|
+
N.onChange?.(e), N.onClose?.(), A("update:selected", e);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
m(
|
|
@@ -28,7 +28,7 @@ const Ue = (l, P, b) => {
|
|
|
28
28
|
a.value = l.selected, v.value = l.selected;
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
|
-
const
|
|
31
|
+
const F = Ie(), w = n(null), g = n(null), k = n(null), R = n(null), H = n(null), I = n(null), p = n(), B = n(null), L = n(null), U = n(null), ee = 8, le = r(() => I.value ? I.value.getBoundingClientRect().height + ee + l.distance : 0), c = n([]), x = n(-1), T = n(""), v = n(l.selected || []), q = () => I.value?.focus(), [d, te, ae] = we({
|
|
32
32
|
disabled: l.disabled,
|
|
33
33
|
initialValue: l.defaultOpen
|
|
34
34
|
});
|
|
@@ -45,9 +45,9 @@ const Ue = (l, P, b) => {
|
|
|
45
45
|
return l.isOpen;
|
|
46
46
|
},
|
|
47
47
|
set(e) {
|
|
48
|
-
|
|
48
|
+
A("update:isOpen", e);
|
|
49
49
|
}
|
|
50
|
-
}), ne = r(() => s.value.length - 1), o =
|
|
50
|
+
}), ne = r(() => s.value.length - 1), o = Ne(0, 0, ne), K = r(() => u.value ? l.displayValue(u.value) : ""), ie = (e) => {
|
|
51
51
|
if (!e.value.length && !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix)
|
|
52
52
|
return l.placeholder;
|
|
53
53
|
const t = !l.multiOptionsPlaceholderPrefix && !l.multiOptionsPlaceholderSuffix ? `${e.value.length} selected` : `${l.multiOptionsPlaceholderPrefix ?? ""}${e.value.length ?? "0"}${l.multiOptionsPlaceholderSuffix ?? ""}`;
|
|
@@ -61,29 +61,29 @@ const Ue = (l, P, b) => {
|
|
|
61
61
|
if (Array.isArray(a.value))
|
|
62
62
|
return a.value.length === s.value.length;
|
|
63
63
|
}), oe = r(() => !l.multi || !Array.isArray(a.value) ? !1 : a.value.length > 0 && a.value.length < s.value.length), E = (e) => {
|
|
64
|
-
|
|
64
|
+
T.value = e;
|
|
65
65
|
}, se = r(() => {
|
|
66
|
-
const e =
|
|
66
|
+
const e = O(v.value), t = {
|
|
67
67
|
selected: [],
|
|
68
68
|
notSelected: []
|
|
69
69
|
};
|
|
70
|
-
return
|
|
70
|
+
return O(l.options).forEach((y) => {
|
|
71
71
|
const f = e.includes(y) ? "selected" : "notSelected";
|
|
72
72
|
t[f].push(y);
|
|
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:
|
|
84
|
-
} =
|
|
83
|
+
scrollTo: D
|
|
84
|
+
} = Re(s, {
|
|
85
85
|
itemHeight: j.value,
|
|
86
|
-
overscan: 2
|
|
86
|
+
overscan: l.disableVirtualScroll ? 1 / 0 : 2
|
|
87
87
|
});
|
|
88
88
|
m(
|
|
89
89
|
() => l.isOpen,
|
|
@@ -91,25 +91,27 @@ const Ue = (l, P, b) => {
|
|
|
91
91
|
G(e);
|
|
92
92
|
}
|
|
93
93
|
), m([x], async () => {
|
|
94
|
-
await
|
|
94
|
+
await C();
|
|
95
95
|
}), m(
|
|
96
96
|
[d, o, x],
|
|
97
97
|
async ([e], [t]) => {
|
|
98
|
-
d.value && (await
|
|
99
|
-
l.multi && b.VERSION === 4 ||
|
|
98
|
+
d.value && (await C(), x.value !== -1 && e !== t && setTimeout(() => {
|
|
99
|
+
l.multi && b.VERSION === 4 || D(x.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 &&
|
|
108
|
+
l.disabled || (G(e), C(() => {
|
|
109
|
+
d.value && A("opened"), d.value || A("closed"), w.value && t && w.value.focus();
|
|
108
110
|
}));
|
|
109
111
|
};
|
|
110
112
|
m(d, (e) => {
|
|
111
113
|
if (e) {
|
|
112
|
-
X.value && Array.isArray(u.value) && (v.value =
|
|
114
|
+
X.value && Array.isArray(u.value) && (v.value = O(u.value).slice());
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
q();
|
|
@@ -124,29 +126,29 @@ const Ue = (l, P, b) => {
|
|
|
124
126
|
a.value = [];
|
|
125
127
|
return;
|
|
126
128
|
}
|
|
127
|
-
a.value = s.value;
|
|
129
|
+
a.value = s.value, A("selectAll");
|
|
128
130
|
}
|
|
129
131
|
}, fe = () => {
|
|
130
132
|
de(), b.VERSION !== 4 && (u.value = a.value);
|
|
131
133
|
}, ge = (e = !0) => {
|
|
132
|
-
a.value = [], e && (u.value = [], v.value = []);
|
|
133
|
-
},
|
|
134
|
-
if (e =
|
|
134
|
+
a.value = [], e && (u.value = [], v.value = []), A("clear");
|
|
135
|
+
}, M = (e, t) => {
|
|
136
|
+
if (e = O(e), c.value[t]?.disabled)
|
|
135
137
|
return;
|
|
136
|
-
if (x.value = t, i.mode !==
|
|
138
|
+
if (x.value = t, i.mode !== P.Multi) {
|
|
137
139
|
l.keepOpen || h(!1), i.goToOption(
|
|
138
140
|
0
|
|
139
141
|
/* None */
|
|
140
|
-
), u.value = e, E(""), q(), i.type ===
|
|
142
|
+
), u.value = e, E(""), q(), i.type === V.Search && g.value && (g.value.value = l.displayValue(e));
|
|
141
143
|
return;
|
|
142
144
|
}
|
|
143
145
|
if (!Array.isArray(a.value))
|
|
144
146
|
return;
|
|
145
147
|
g.value?.focus();
|
|
146
|
-
const S =
|
|
148
|
+
const S = O(a.value);
|
|
147
149
|
if (W(S, e)) {
|
|
148
150
|
a.value = S.filter(
|
|
149
|
-
(f) => !
|
|
151
|
+
(f) => !Ce(f, e)
|
|
150
152
|
);
|
|
151
153
|
return;
|
|
152
154
|
} else {
|
|
@@ -159,11 +161,11 @@ const Ue = (l, P, b) => {
|
|
|
159
161
|
selectedOption: u,
|
|
160
162
|
labelRef: H,
|
|
161
163
|
activeOption: R,
|
|
162
|
-
listRef:
|
|
164
|
+
listRef: w,
|
|
163
165
|
clearable: l.clearable,
|
|
164
|
-
type:
|
|
165
|
-
mode: l.multi ?
|
|
166
|
-
query:
|
|
166
|
+
type: F.input ? V.Search : V.Dropdown,
|
|
167
|
+
mode: l.multi ? P.Multi : P.Single,
|
|
168
|
+
query: T,
|
|
167
169
|
selectedValue: K,
|
|
168
170
|
toggle: h,
|
|
169
171
|
disabled: l.disabled,
|
|
@@ -171,9 +173,9 @@ const Ue = (l, P, b) => {
|
|
|
171
173
|
mandatory: l.mandatory,
|
|
172
174
|
size: l.size,
|
|
173
175
|
placeholder: l.placeholder,
|
|
174
|
-
select:
|
|
176
|
+
select: M,
|
|
175
177
|
clearSelection: () => {
|
|
176
|
-
E(""), u.value = i.mode ===
|
|
178
|
+
E(""), u.value = i.mode === P.Single ? null : [], v.value = i.mode === P.Single ? null : [], g.value && (g.value.value = "");
|
|
177
179
|
},
|
|
178
180
|
search: E,
|
|
179
181
|
goToOption: async (e) => {
|
|
@@ -204,14 +206,14 @@ const Ue = (l, P, b) => {
|
|
|
204
206
|
c.value = c.value.filter((t) => t.id !== e);
|
|
205
207
|
}
|
|
206
208
|
};
|
|
207
|
-
|
|
208
|
-
|
|
209
|
+
xe(Ee, i), Y(
|
|
210
|
+
w,
|
|
209
211
|
() => {
|
|
210
212
|
d.value && Q();
|
|
211
213
|
},
|
|
212
214
|
{
|
|
213
215
|
ignore: [
|
|
214
|
-
|
|
216
|
+
I,
|
|
215
217
|
B,
|
|
216
218
|
L,
|
|
217
219
|
U,
|
|
@@ -223,15 +225,15 @@ const Ue = (l, P, b) => {
|
|
|
223
225
|
const ye = () => {
|
|
224
226
|
g.value && (g.value.value = i.query.value = "");
|
|
225
227
|
};
|
|
226
|
-
|
|
227
|
-
l.autoFocus && (await
|
|
228
|
-
|
|
228
|
+
De(async () => {
|
|
229
|
+
l.autoFocus && (await C(), setTimeout(() => {
|
|
230
|
+
k.value.focus();
|
|
229
231
|
})), i.goToOption(0);
|
|
230
232
|
});
|
|
231
233
|
const Se = () => {
|
|
232
|
-
u.value = a.value, Array.isArray(u.value) && (v.value =
|
|
234
|
+
u.value = a.value, Array.isArray(u.value) && (v.value = O(u.value).slice()), A("apply", u.value), h(!1), ye();
|
|
233
235
|
}, Q = () => {
|
|
234
|
-
X.value && Array.isArray(v.value) && (u.value =
|
|
236
|
+
X.value && Array.isArray(v.value) && (u.value = O(v.value).slice()), T.value = "", h(!1);
|
|
235
237
|
}, be = (e) => {
|
|
236
238
|
if (!l.disableKeyboardEvents)
|
|
237
239
|
switch (e.key) {
|
|
@@ -241,7 +243,7 @@ const Ue = (l, P, b) => {
|
|
|
241
243
|
case "ArrowDown":
|
|
242
244
|
h(!0), e.preventDefault();
|
|
243
245
|
}
|
|
244
|
-
},
|
|
246
|
+
}, Oe = (e) => {
|
|
245
247
|
if (!l.disableKeyboardEvents)
|
|
246
248
|
switch (e.key) {
|
|
247
249
|
case "ArrowUp": {
|
|
@@ -281,28 +283,31 @@ const Ue = (l, P, b) => {
|
|
|
281
283
|
h(!0);
|
|
282
284
|
return;
|
|
283
285
|
}
|
|
284
|
-
|
|
286
|
+
M(s.value[o.value], o.value), i.mode === P.Single && !l.keepOpen && h(!1), e.preventDefault();
|
|
285
287
|
break;
|
|
286
288
|
}
|
|
287
289
|
}
|
|
288
|
-
},
|
|
289
|
-
const e = z.value.
|
|
290
|
+
}, Ae = r(() => {
|
|
291
|
+
const e = z.value.reduce((me, Pe) => {
|
|
292
|
+
const Te = l.overrideOptionCountCalculation ? l.overrideOptionCountCalculation(Pe.data) : 1;
|
|
293
|
+
return me + Te;
|
|
294
|
+
}, 0), t = l.multi && l.showSelectAll ? 1 : 0, y = e > b.MAX_NUMBER_OF_OPTIONS, S = e + t;
|
|
290
295
|
let f = y ? b.MAX_NUMBER_OF_OPTIONS + 0.1 : S;
|
|
291
|
-
return l.noResultsText && f === 0 && (f = f + 1),
|
|
296
|
+
return l.noResultsText && f === 0 && (f = f + 1), Me(
|
|
292
297
|
f * j.value + b.PADDING_PX
|
|
293
298
|
);
|
|
294
299
|
});
|
|
295
300
|
return {
|
|
296
|
-
onKeydown:
|
|
301
|
+
onKeydown: Oe,
|
|
297
302
|
location: le,
|
|
298
303
|
open: d,
|
|
299
304
|
toggleMenu: h,
|
|
300
305
|
onButtonKeydown: be,
|
|
301
306
|
displayedValue: re,
|
|
302
307
|
labelRef: H,
|
|
303
|
-
query:
|
|
308
|
+
query: T,
|
|
304
309
|
containerProps: J,
|
|
305
|
-
calculateTableHeight:
|
|
310
|
+
calculateTableHeight: Ae,
|
|
306
311
|
wrapperProps: ve,
|
|
307
312
|
filteredOptions: s,
|
|
308
313
|
allSelected: $,
|
|
@@ -313,22 +318,22 @@ const Ue = (l, P, b) => {
|
|
|
313
318
|
selectedOption: u,
|
|
314
319
|
selectedOptionPrevious: v,
|
|
315
320
|
selectedValue: K,
|
|
316
|
-
onSelect:
|
|
321
|
+
onSelect: M,
|
|
317
322
|
activeIndex: o,
|
|
318
323
|
onCancel: Q,
|
|
319
324
|
onApply: Se,
|
|
320
|
-
scrollTo:
|
|
325
|
+
scrollTo: D,
|
|
321
326
|
onClickOutside: Y,
|
|
322
|
-
listRef:
|
|
323
|
-
buttonRef:
|
|
327
|
+
listRef: w,
|
|
328
|
+
buttonRef: I,
|
|
324
329
|
apply: B,
|
|
325
330
|
cancel: L,
|
|
326
|
-
el:
|
|
327
|
-
triggerRef:
|
|
331
|
+
el: k,
|
|
332
|
+
triggerRef: p,
|
|
328
333
|
clearAll: U,
|
|
329
334
|
onClearAllSelections: ge
|
|
330
335
|
};
|
|
331
336
|
};
|
|
332
337
|
export {
|
|
333
|
-
|
|
338
|
+
Ke as dropdownCommon
|
|
334
339
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { ref as s, onMounted as m, onUnmounted as v, computed as o, toRaw as i } from "vue";
|
|
2
2
|
import { useId as f } from "../../../composables/useId.js";
|
|
3
3
|
import { useDropdownContext as O, Mode as l } from "./DropdownContext.js";
|
|
4
|
-
const A = (
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const A = (e) => {
|
|
5
|
+
const t = O("Option"), n = f().value, u = s(null), c = (a) => {
|
|
6
|
+
e.selectAllOption ? a.stopPropagation() : t.select(e.option);
|
|
7
7
|
};
|
|
8
|
-
m(() =>
|
|
9
|
-
|
|
8
|
+
m(() => t.registerOption(n, e.disabled, !!e.subtitle)), v(() => {
|
|
9
|
+
t.unRegisterOption(n);
|
|
10
10
|
});
|
|
11
|
-
const r = o(() =>
|
|
11
|
+
const r = o(() => t.mode === l.Multi), d = o(() => e.active !== null ? e.active : t.activeIndex.value !== null ? t.activeOption.value === e.option : !1);
|
|
12
12
|
return {
|
|
13
|
-
selected: o(() =>
|
|
13
|
+
selected: o(() => e.selectedProp !== null ? e.selectedProp : t.mode === l.Multi && Array.isArray(t.selectedOption.value) ? i(t.selectedOption.value.includes(e.option)) : i(t.selectedOption.value) === i(e.option)),
|
|
14
14
|
isMulti: r,
|
|
15
15
|
id: n,
|
|
16
16
|
onClick: c,
|
|
17
|
-
api:
|
|
17
|
+
api: t,
|
|
18
18
|
el: u,
|
|
19
|
-
active:
|
|
19
|
+
active: d
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
export {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare const useChildOptions: (selection: Ref<unknown[]>, childrenKey: string) => {
|
|
3
|
+
hasChildren: (option: unknown) => boolean;
|
|
4
|
+
getChildren: (option: unknown) => unknown[];
|
|
5
|
+
someChildrenSelected: (option: any) => boolean;
|
|
6
|
+
allChildrenSelected: (option: unknown) => boolean;
|
|
7
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const c = (s, t) => {
|
|
2
|
+
const l = (e) => e && e[t] ? e[t] : [], r = (e) => l(e)?.length > 0;
|
|
3
|
+
return {
|
|
4
|
+
hasChildren: r,
|
|
5
|
+
getChildren: l,
|
|
6
|
+
someChildrenSelected: (e) => r(e) ? l(e).some((n) => s.value.includes(n)) : !1,
|
|
7
|
+
allChildrenSelected: (e) => r(e) ? l(e).every(
|
|
8
|
+
(n) => s.value.includes(n)
|
|
9
|
+
) : !1
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
c as useChildOptions
|
|
14
|
+
};
|
|
@@ -84,6 +84,8 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
84
84
|
closed: () => void;
|
|
85
85
|
opened: () => void;
|
|
86
86
|
apply: (value: unknown) => void;
|
|
87
|
+
selectAll: () => void;
|
|
88
|
+
clear: () => void;
|
|
87
89
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
88
90
|
modelValue?: unknown;
|
|
89
91
|
placeholder?: string;
|
|
@@ -161,7 +163,9 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<__
|
|
|
161
163
|
darkTheme: boolean;
|
|
162
164
|
valueToCopy: string;
|
|
163
165
|
}>>> & {
|
|
166
|
+
onClear?: () => any;
|
|
164
167
|
onApply?: (value: unknown) => any;
|
|
168
|
+
onSelectAll?: () => any;
|
|
165
169
|
"onUpdate:selected"?: (value: unknown) => any;
|
|
166
170
|
"onUpdate:isOpen"?: (value: unknown) => any;
|
|
167
171
|
onOpened?: () => any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import o from "./Dropdown.vue2.js";
|
|
2
|
-
/* empty css *//* empty css */import
|
|
3
|
-
// import "../../../Dropdown.
|
|
2
|
+
/* empty css *//* empty css */import _ from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
3
|
+
// import "../../../Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css"; //*');
|
|
4
4
|
// import "../../../Dropdown.vue_vue_type_style_index_1_lang.css"; //');
|
|
5
|
-
const
|
|
5
|
+
const a = /* @__PURE__ */ _(o, [["__scopeId", "data-v-aaa8c4bb"]]);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import "../../../Dropdown.
|
|
2
|
-
import
|
|
1
|
+
import "../../../Dropdown.vue_vue_type_style_index_0_scoped_aaa8c4bb_lang.css"; import "../../../Dropdown.vue_vue_type_style_index_1_lang.css"; import { defineComponent as le, openBlock as a, createElementBlock as i, normalizeClass as T, unref as e, renderSlot as b, createVNode as s, withCtx as n, Transition as ae, createTextVNode as r, toDisplayString as h, createCommentVNode as o, createBlock as I, isRef as de, createElementVNode as m, mergeProps as P, withModifiers as A, Fragment as oe, renderList as ie, toRaw as $, pushScopeId as ne, popScopeId as se } from "vue";
|
|
2
|
+
import N from "../../button/v3/Button.vue.js";
|
|
3
3
|
import "../../button/v3/IconButton.vue.js";
|
|
4
4
|
import "../../button/v3/ScrollButton.vue.js";
|
|
5
5
|
import re from "./Option.vue.js";
|
|
6
|
-
import
|
|
6
|
+
import x from "../../icon/v3/Icon.vue.js";
|
|
7
7
|
import ue from "../../search/v3/Search.vue.js";
|
|
8
8
|
import "../../typography/Heading.vue.js";
|
|
9
9
|
import y from "../../typography/Text.vue.js";
|
|
10
|
-
import { Dropdown as
|
|
10
|
+
import { Dropdown as ce } from "floating-vue";
|
|
11
11
|
import { DropdownTestIdModifiers as u } from "../../../testids/index.js";
|
|
12
|
-
import { dropdownCommon as
|
|
13
|
-
const me = (t) => (ne("data-v-
|
|
12
|
+
import { dropdownCommon as fe } from "../common/Dropdown.common.js";
|
|
13
|
+
const me = (t) => (ne("data-v-aaa8c4bb"), t = t(), se(), t), ye = ["tabindex", "data-testid"], pe = ["disabled", "aria-expanded", "aria-labelledby", "aria-disabled"], be = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "image-slot"
|
|
16
16
|
}, he = { class: "angle-down" }, ke = {
|
|
@@ -91,7 +91,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
91
91
|
darkTheme: { type: Boolean, default: !0 },
|
|
92
92
|
valueToCopy: { default: "" }
|
|
93
93
|
},
|
|
94
|
-
emits: ["update:selected", "update:isOpen", "closed", "opened", "apply"],
|
|
94
|
+
emits: ["update:selected", "update:isOpen", "closed", "opened", "apply", "selectAll", "clear"],
|
|
95
95
|
setup(t, { expose: L, emit: V }) {
|
|
96
96
|
const K = t, H = {
|
|
97
97
|
MULTILINE_LIST_HEIGHT: 48,
|
|
@@ -101,7 +101,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
101
101
|
}, {
|
|
102
102
|
onKeydown: p,
|
|
103
103
|
location: D,
|
|
104
|
-
open:
|
|
104
|
+
open: c,
|
|
105
105
|
toggleMenu: g,
|
|
106
106
|
onButtonKeydown: k,
|
|
107
107
|
displayedValue: C,
|
|
@@ -127,11 +127,11 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
127
127
|
cancel: ee,
|
|
128
128
|
el: te,
|
|
129
129
|
buttonRef: z
|
|
130
|
-
} =
|
|
130
|
+
} = fe(K, V, H);
|
|
131
131
|
return L({
|
|
132
132
|
selectItem: E,
|
|
133
133
|
scrollTo: Q
|
|
134
|
-
}), (
|
|
134
|
+
}), (f, d) => (a(), i("div", {
|
|
135
135
|
ref_key: "el",
|
|
136
136
|
ref: te,
|
|
137
137
|
class: T(["dropdown", { "dropdown--disabled": t.disabled }]),
|
|
@@ -140,8 +140,8 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
140
140
|
onKeydown: d[7] || (d[7] = //@ts-ignore
|
|
141
141
|
(...l) => e(p) && e(p)(...l))
|
|
142
142
|
}, [
|
|
143
|
-
b(
|
|
144
|
-
s(e(
|
|
143
|
+
b(f.$slots, "label", {}, void 0, !0),
|
|
144
|
+
s(e(ce), {
|
|
145
145
|
theme: t.theme,
|
|
146
146
|
"popper-class": [
|
|
147
147
|
t.popperClass,
|
|
@@ -152,7 +152,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
152
152
|
distance: t.isOnTop ? -e(D) : t.distance,
|
|
153
153
|
flip: t.flip,
|
|
154
154
|
triggers: [],
|
|
155
|
-
shown: !!e(
|
|
155
|
+
shown: !!e(c),
|
|
156
156
|
"auto-hide": !1,
|
|
157
157
|
container: t.container,
|
|
158
158
|
"auto-size": t.autoSize,
|
|
@@ -161,7 +161,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
161
161
|
popper: n(() => [
|
|
162
162
|
s(ae, null, {
|
|
163
163
|
default: n(() => [
|
|
164
|
-
e(
|
|
164
|
+
e(c) ? (a(), i("div", {
|
|
165
165
|
key: 0,
|
|
166
166
|
ref_key: "listRef",
|
|
167
167
|
ref: Z,
|
|
@@ -192,13 +192,13 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
192
192
|
onKeydown: e(p)
|
|
193
193
|
}, null, 8, ["modelValue", "placeholder", "test-id", "onKeydown"])) : o("", !0)
|
|
194
194
|
])) : o("", !0),
|
|
195
|
-
e(
|
|
195
|
+
e(c) ? (a(), i("div", {
|
|
196
196
|
key: 1,
|
|
197
197
|
class: "dropdown",
|
|
198
198
|
onKeydown: d[6] || (d[6] = //@ts-ignore
|
|
199
199
|
(...l) => e(p) && e(p)(...l))
|
|
200
200
|
}, [
|
|
201
|
-
b(
|
|
201
|
+
b(f.$slots, "input-list", { open: e(c) }, void 0, !0),
|
|
202
202
|
m("div", P(e(G), {
|
|
203
203
|
class: ["list-container", { "list-container--multi": t.multi }],
|
|
204
204
|
style: { height: `${e(F)}rem` },
|
|
@@ -220,7 +220,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
220
220
|
})
|
|
221
221
|
])) : o("", !0),
|
|
222
222
|
t.loading ? (a(), i("li", Ie, [
|
|
223
|
-
s(e(
|
|
223
|
+
s(e(x), {
|
|
224
224
|
"font-size": "md",
|
|
225
225
|
class: "loader-icon"
|
|
226
226
|
}, {
|
|
@@ -243,7 +243,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
243
243
|
"selected-prop": e(S),
|
|
244
244
|
"is-indeterminate": e(q),
|
|
245
245
|
"select-all-option": "",
|
|
246
|
-
onClick: d[5] || (d[5] =
|
|
246
|
+
onClick: d[5] || (d[5] = A((l) => e(W)(), ["stop"]))
|
|
247
247
|
}, {
|
|
248
248
|
default: n(() => [
|
|
249
249
|
r("Select all ")
|
|
@@ -255,9 +255,9 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
255
255
|
key: w,
|
|
256
256
|
"aria-selected": e(O)($(e(R)), l),
|
|
257
257
|
"aria-disabled": !!t.disabled,
|
|
258
|
-
onClick:
|
|
258
|
+
onClick: A(() => e(E)(l, w), ["stop"])
|
|
259
259
|
}, [
|
|
260
|
-
b(
|
|
260
|
+
b(f.$slots, "default", {
|
|
261
261
|
option: l,
|
|
262
262
|
selected: e(O)($(e(R)), l),
|
|
263
263
|
active: $(e(Y)) === w
|
|
@@ -266,7 +266,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
266
266
|
], 16)
|
|
267
267
|
], 16, we),
|
|
268
268
|
t.multi ? (a(), i("div", Se, [
|
|
269
|
-
s(e(
|
|
269
|
+
s(e(N), {
|
|
270
270
|
ref_key: "cancel",
|
|
271
271
|
ref: ee,
|
|
272
272
|
size: "sm",
|
|
@@ -280,7 +280,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
280
280
|
]),
|
|
281
281
|
_: 1
|
|
282
282
|
}, 8, ["test-id", "onClick"]),
|
|
283
|
-
s(e(
|
|
283
|
+
s(e(N), {
|
|
284
284
|
ref_key: "apply",
|
|
285
285
|
ref: _,
|
|
286
286
|
"data-testid": "mutli-apply",
|
|
@@ -304,12 +304,12 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
304
304
|
default: n(() => [
|
|
305
305
|
m("div", {
|
|
306
306
|
class: T(["button__container", {
|
|
307
|
-
"button__container--open": !!e(
|
|
307
|
+
"button__container--open": !!e(c),
|
|
308
308
|
[`button__container--${t.size}`]: !0,
|
|
309
309
|
"button__container--disabled": t.disabled
|
|
310
310
|
}])
|
|
311
311
|
}, [
|
|
312
|
-
|
|
312
|
+
f.$slots.input ? (a(), i("div", {
|
|
313
313
|
key: 0,
|
|
314
314
|
ref_key: "buttonRef",
|
|
315
315
|
ref: z,
|
|
@@ -317,23 +317,23 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
317
317
|
onKeydown: d[1] || (d[1] = //@ts-ignore
|
|
318
318
|
(...l) => e(k) && e(k)(...l))
|
|
319
319
|
}, [
|
|
320
|
-
b(
|
|
321
|
-
open: e(
|
|
320
|
+
b(f.$slots, "input", {
|
|
321
|
+
open: e(c),
|
|
322
322
|
value: e(C),
|
|
323
323
|
disabled: t.disabled
|
|
324
324
|
}, void 0, !0)
|
|
325
325
|
], 544)) : o("", !0),
|
|
326
|
-
|
|
326
|
+
f.$slots.input ? o("", !0) : (a(), i("button", {
|
|
327
327
|
key: 1,
|
|
328
328
|
ref_key: "buttonRef",
|
|
329
329
|
ref: z,
|
|
330
330
|
disabled: t.disabled,
|
|
331
331
|
"aria-haspopup": !0,
|
|
332
|
-
"aria-expanded": !!e(
|
|
332
|
+
"aria-expanded": !!e(c),
|
|
333
333
|
"aria-labelledby": e(M)?.id,
|
|
334
334
|
"aria-disabled": t.disabled,
|
|
335
335
|
class: T([{
|
|
336
|
-
"button--open": !!e(
|
|
336
|
+
"button--open": !!e(c),
|
|
337
337
|
[`button--${t.size}`]: !0,
|
|
338
338
|
"button--disabled": t.disabled
|
|
339
339
|
}, "button"]),
|
|
@@ -341,8 +341,8 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
341
341
|
(...l) => e(k) && e(k)(...l)),
|
|
342
342
|
onClick: d[3] || (d[3] = (l) => e(g)())
|
|
343
343
|
}, [
|
|
344
|
-
|
|
345
|
-
b(
|
|
344
|
+
f.$slots.image ? (a(), i("div", be, [
|
|
345
|
+
b(f.$slots, "image", {}, void 0, !0)
|
|
346
346
|
])) : o("", !0),
|
|
347
347
|
s(e(y), {
|
|
348
348
|
size: "sm",
|
|
@@ -354,7 +354,7 @@ const me = (t) => (ne("data-v-d4f8e790"), t = t(), se(), t), ye = ["tabindex", "
|
|
|
354
354
|
_: 1
|
|
355
355
|
}),
|
|
356
356
|
m("div", he, [
|
|
357
|
-
s(e(
|
|
357
|
+
s(e(x), {
|
|
358
358
|
name: "angle-down",
|
|
359
359
|
"font-size": "sm"
|
|
360
360
|
})
|