x-next 1.10.0 → 1.10.1
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/AI_USAGE.md +4 -2
- package/CHANGELOG.md +13 -1
- package/dist/components/_components/select-view/select-view.d.ts +9 -0
- package/dist/components/form-select/Select.d.ts +18 -5
- package/dist/components/form-select/SelectOptionGroup.vue.d.ts +1 -0
- package/dist/components/form-select/hooks/use-options.d.ts +1 -1
- package/dist/components/form-select/hooks/use-select.d.ts +1 -1
- package/dist/components/form-select/index.d.ts +42 -11
- package/dist/components/form-select/interface.d.ts +8 -0
- package/dist/components/pagination/page-options.vue.d.ts +60 -32
- package/dist/components/trigger/interface.d.ts +2 -0
- package/dist/es/components/_components/select-view/select-view.js +89 -78
- package/dist/es/components/button/Button.js +1 -1
- package/dist/es/components/form-input-tag/InputTag.js +1 -1
- package/dist/es/components/form-select/Select.js +348 -300
- package/dist/es/components/form-select/SelectOption.vue.js +5 -3
- package/dist/es/components/form-select/SelectOption.vue2.js +54 -49
- package/dist/es/components/form-select/SelectOptionGroup.vue.js +17 -13
- package/dist/es/components/form-select/SelectOptionGroup.vue2.js +8 -5
- package/dist/es/components/form-select/hooks/use-options.js +40 -40
- package/dist/es/components/form-select/hooks/use-select.js +76 -71
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/form-select.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import c from "./SelectOption.vue2.js";
|
|
2
|
-
import { resolveComponent as u, withDirectives as f, openBlock as s, createBlock as n, resolveDynamicComponent as p, normalizeClass as o, withCtx as i, createElementBlock as a, renderSlot as l, createCommentVNode as t, createTextVNode as
|
|
2
|
+
import { resolveComponent as u, withDirectives as f, openBlock as s, createBlock as n, resolveDynamicComponent as p, normalizeClass as o, withCtx as i, createElementBlock as a, renderSlot as l, createCommentVNode as t, createTextVNode as d, toDisplayString as r, vShow as k } from "vue";
|
|
3
3
|
import b from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
4
|
function h(e, $, v, C, N, y) {
|
|
5
5
|
const m = u("checkbox");
|
|
@@ -26,11 +26,13 @@ function h(e, $, v, C, N, y) {
|
|
|
26
26
|
class: o(e.className.element("checkbox")),
|
|
27
27
|
"model-value": e.isSelected,
|
|
28
28
|
disabled: e.disabled,
|
|
29
|
+
tabindex: -1,
|
|
30
|
+
"aria-hidden": "true",
|
|
29
31
|
"uninject-group-context": ""
|
|
30
32
|
}, {
|
|
31
33
|
default: i(() => [
|
|
32
34
|
l(e.$slots, "default", {}, () => [
|
|
33
|
-
r(
|
|
35
|
+
d(r(e.label), 1)
|
|
34
36
|
])
|
|
35
37
|
]),
|
|
36
38
|
_: 3
|
|
@@ -39,7 +41,7 @@ function h(e, $, v, C, N, y) {
|
|
|
39
41
|
class: o(e.className.element("content"))
|
|
40
42
|
}, [
|
|
41
43
|
l(e.$slots, "default", {}, () => [
|
|
42
|
-
r(
|
|
44
|
+
d(r(e.label), 1)
|
|
43
45
|
])
|
|
44
46
|
], 2)),
|
|
45
47
|
e.$slots.suffix ? (s(), a("span", {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as B, toRefs as M, inject as N,
|
|
1
|
+
import { defineComponent as B, toRefs as M, inject as N, provide as P, getCurrentInstance as A, ref as f, watch as _, computed as i, onMounted as q, onUpdated as w, reactive as E, onBeforeUnmount as R } from "vue";
|
|
2
2
|
import U from "../form-checkbox/Checkbox.js";
|
|
3
|
-
import { selectInjectionKey as
|
|
4
|
-
import { getKeyFromValue as
|
|
5
|
-
import { isEqual as
|
|
6
|
-
import { getClassNameMixin as
|
|
7
|
-
|
|
3
|
+
import { selectInjectionKey as F } from "./context.js";
|
|
4
|
+
import { getKeyFromValue as L, isValidOption as T } from "./utils.js";
|
|
5
|
+
import { isEqual as z } from "../../_utils/is-equal.js";
|
|
6
|
+
import { getClassNameMixin as D } from "../../_utils/config.js";
|
|
7
|
+
import { formItemInjectionKey as G } from "../form/context.js";
|
|
8
|
+
const $ = B({
|
|
8
9
|
name: "Option",
|
|
9
10
|
components: {
|
|
10
11
|
Checkbox: U
|
|
@@ -55,76 +56,80 @@ const X = B({
|
|
|
55
56
|
// private
|
|
56
57
|
internal: Boolean
|
|
57
58
|
},
|
|
58
|
-
setup(
|
|
59
|
-
const { disabled: v, tagProps: s, index:
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
setup(n) {
|
|
60
|
+
const { disabled: v, tagProps: s, index: O } = M(n), t = D("select--option"), e = N(F, void 0);
|
|
61
|
+
e && P(G, {});
|
|
62
|
+
const l = A(), u = f(), m = f(s.value);
|
|
63
|
+
_(s, (o, r) => {
|
|
64
|
+
z(o, r) || (m.value = o);
|
|
62
65
|
});
|
|
63
|
-
const d =
|
|
64
|
-
if (!
|
|
65
|
-
const
|
|
66
|
-
|
|
66
|
+
const d = f(""), c = i(() => n.value ?? n.label ?? d.value), p = i(() => n.label ?? d.value), a = i(() => L(c.value, e == null ? void 0 : e.valueKey)), I = i(() => (e == null ? void 0 : e.component) ?? "li"), K = i(() => e == null ? void 0 : e.getOptionId(a.value)), b = () => {
|
|
67
|
+
if (!n.label && u.value) {
|
|
68
|
+
const o = u.value.querySelector(
|
|
69
|
+
".x-select--option--content, .x-checkbox--label"
|
|
70
|
+
), r = (o == null ? void 0 : o.textContent) ?? "";
|
|
71
|
+
d.value !== r && (d.value = r);
|
|
67
72
|
}
|
|
68
73
|
};
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
if (!
|
|
73
|
-
const
|
|
74
|
+
q(() => b()), w(() => b());
|
|
75
|
+
const y = i(() => (e == null ? void 0 : e.valueKeys.includes(a.value)) ?? !1), S = i(() => (e == null ? void 0 : e.activeKey) === a.value);
|
|
76
|
+
let g = f(!0);
|
|
77
|
+
if (!n.internal) {
|
|
78
|
+
const o = E({
|
|
74
79
|
raw: {
|
|
75
|
-
value:
|
|
76
|
-
label:
|
|
80
|
+
value: c,
|
|
81
|
+
label: p,
|
|
77
82
|
disabled: v,
|
|
78
|
-
tagProps:
|
|
83
|
+
tagProps: m
|
|
79
84
|
},
|
|
80
85
|
ref: u,
|
|
81
|
-
index:
|
|
82
|
-
key:
|
|
86
|
+
index: O,
|
|
87
|
+
key: a,
|
|
83
88
|
origin: "slot",
|
|
84
|
-
value:
|
|
85
|
-
label:
|
|
89
|
+
value: c,
|
|
90
|
+
label: p,
|
|
86
91
|
disabled: v,
|
|
87
|
-
tagProps:
|
|
92
|
+
tagProps: m
|
|
88
93
|
});
|
|
89
|
-
|
|
90
|
-
() =>
|
|
94
|
+
g = i(
|
|
95
|
+
() => T(o, {
|
|
91
96
|
inputValue: e == null ? void 0 : e.inputValue,
|
|
92
97
|
filterOption: e == null ? void 0 : e.filterOption
|
|
93
98
|
})
|
|
94
|
-
), l && (e == null || e.addSlotOptionInfo(l.uid,
|
|
99
|
+
), l && (e == null || e.addSlotOptionInfo(l.uid, o)), R(() => {
|
|
95
100
|
l && (e == null || e.removeSlotOptionInfo(l.uid));
|
|
96
101
|
});
|
|
97
102
|
}
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
}, h = () => {
|
|
101
|
-
o.disabled || e == null || e.setActiveKey(t.value);
|
|
103
|
+
const h = (o) => {
|
|
104
|
+
n.disabled || e == null || e.onSelect(a.value, o);
|
|
102
105
|
}, j = () => {
|
|
103
|
-
|
|
106
|
+
n.disabled || e == null || e.setActiveKey(a.value);
|
|
107
|
+
}, k = () => {
|
|
108
|
+
n.disabled || e == null || e.setActiveKey();
|
|
104
109
|
}, V = i(() => [
|
|
105
|
-
|
|
110
|
+
t.block,
|
|
106
111
|
{
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
112
|
+
[t.modifier("disabled")]: n.disabled,
|
|
113
|
+
[t.modifier("selected")]: y.value,
|
|
114
|
+
[t.modifier("active")]: S.value,
|
|
115
|
+
[t.modifier("multiple")]: e == null ? void 0 : e.multiple
|
|
111
116
|
}
|
|
112
117
|
]);
|
|
113
118
|
return {
|
|
114
|
-
className:
|
|
119
|
+
className: t,
|
|
115
120
|
cls: V,
|
|
116
121
|
selectCtx: e,
|
|
117
122
|
itemRef: u,
|
|
118
|
-
component:
|
|
119
|
-
optionId:
|
|
120
|
-
isSelected:
|
|
121
|
-
isValid:
|
|
122
|
-
handleClick:
|
|
123
|
-
handleMouseEnter:
|
|
124
|
-
handleMouseLeave:
|
|
123
|
+
component: I,
|
|
124
|
+
optionId: K,
|
|
125
|
+
isSelected: y,
|
|
126
|
+
isValid: g,
|
|
127
|
+
handleClick: h,
|
|
128
|
+
handleMouseEnter: j,
|
|
129
|
+
handleMouseLeave: k
|
|
125
130
|
};
|
|
126
131
|
}
|
|
127
132
|
});
|
|
128
133
|
export {
|
|
129
|
-
|
|
134
|
+
$ as default
|
|
130
135
|
};
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
return
|
|
6
|
-
s(
|
|
7
|
-
class:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import l from "./SelectOptionGroup.vue2.js";
|
|
2
|
+
import { openBlock as o, createElementBlock as r, Fragment as n, createBlock as a, resolveDynamicComponent as s, normalizeClass as p, withCtx as c, renderSlot as t, createTextVNode as m, toDisplayString as i } from "vue";
|
|
3
|
+
import f from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
function d(e, u, $, _, k, B) {
|
|
5
|
+
return o(), r(n, null, [
|
|
6
|
+
(o(), a(s(e.component), {
|
|
7
|
+
class: p(e.className.element("title")),
|
|
8
|
+
role: "presentation"
|
|
9
|
+
}, {
|
|
10
|
+
default: c(() => [
|
|
11
|
+
t(e.$slots, "label", {}, () => [
|
|
12
|
+
m(i(e.label), 1)
|
|
13
|
+
])
|
|
14
|
+
]),
|
|
15
|
+
_: 3
|
|
16
|
+
}, 8, ["class"])),
|
|
13
17
|
t(e.$slots, "default")
|
|
14
18
|
], 64);
|
|
15
19
|
}
|
|
16
|
-
const g = /* @__PURE__ */
|
|
20
|
+
const g = /* @__PURE__ */ f(l, [["render", d]]);
|
|
17
21
|
export {
|
|
18
22
|
g as default
|
|
19
23
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
|
|
1
|
+
import { defineComponent as n, inject as p, computed as i } from "vue";
|
|
2
|
+
import { getClassNameMixin as m } from "../../_utils/config.js";
|
|
3
|
+
import { selectInjectionKey as c } from "./context.js";
|
|
4
|
+
const l = n({
|
|
4
5
|
name: "SelectOptionGroup",
|
|
5
6
|
props: {
|
|
6
7
|
/**
|
|
@@ -18,11 +19,13 @@ const p = e({
|
|
|
18
19
|
* @version 2.10.0
|
|
19
20
|
*/
|
|
20
21
|
setup() {
|
|
22
|
+
const e = m("select--option--group"), o = p(c, void 0), t = i(() => (o == null ? void 0 : o.component) ?? "li");
|
|
21
23
|
return {
|
|
22
|
-
className:
|
|
24
|
+
className: e,
|
|
25
|
+
component: t
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
28
|
});
|
|
26
29
|
export {
|
|
27
|
-
|
|
30
|
+
l as default
|
|
28
31
|
};
|
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import { getOptionInfos as
|
|
3
|
-
import { isNumber as
|
|
4
|
-
const
|
|
1
|
+
import { computed as r, reactive as u, watch as D } from "vue";
|
|
2
|
+
import { getOptionInfos as g, getValidOptions as S, isValidOption as z } from "../utils.js";
|
|
3
|
+
import { isNumber as b } from "../../../_utils/is.js";
|
|
4
|
+
const F = {
|
|
5
5
|
value: "value",
|
|
6
6
|
label: "label",
|
|
7
7
|
disabled: "disabled",
|
|
8
8
|
tagProps: "tagProps",
|
|
9
9
|
render: "render"
|
|
10
|
-
},
|
|
11
|
-
options:
|
|
12
|
-
extraOptions:
|
|
10
|
+
}, T = ({
|
|
11
|
+
options: v,
|
|
12
|
+
extraOptions: I,
|
|
13
13
|
inputValue: n,
|
|
14
14
|
filterOption: a,
|
|
15
|
-
showExtraOptions:
|
|
16
|
-
valueKey:
|
|
15
|
+
showExtraOptions: s,
|
|
16
|
+
valueKey: d,
|
|
17
17
|
fieldNames: l
|
|
18
18
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
...
|
|
19
|
+
const m = r(() => ({
|
|
20
|
+
...F,
|
|
21
21
|
...l == null ? void 0 : l.value
|
|
22
|
-
})),
|
|
23
|
-
() => Array.from(
|
|
24
|
-
),
|
|
22
|
+
})), c = u(/* @__PURE__ */ new Map()), M = r(
|
|
23
|
+
() => Array.from(c.values()).sort((o, t) => b(o.index) && b(t.index) ? o.index - t.index : 0)
|
|
24
|
+
), p = r(() => {
|
|
25
25
|
const o = /* @__PURE__ */ new Map();
|
|
26
26
|
return {
|
|
27
|
-
optionInfos:
|
|
28
|
-
valueKey: (
|
|
29
|
-
fieldNames:
|
|
27
|
+
optionInfos: g((v == null ? void 0 : v.value) ?? [], {
|
|
28
|
+
valueKey: (d == null ? void 0 : d.value) ?? "value",
|
|
29
|
+
fieldNames: m.value,
|
|
30
30
|
origin: "options",
|
|
31
31
|
optionInfoMap: o
|
|
32
32
|
}),
|
|
33
33
|
optionInfoMap: o
|
|
34
34
|
};
|
|
35
|
-
}),
|
|
35
|
+
}), f = r(() => {
|
|
36
36
|
const o = /* @__PURE__ */ new Map();
|
|
37
37
|
return {
|
|
38
|
-
optionInfos:
|
|
39
|
-
valueKey: (
|
|
40
|
-
fieldNames:
|
|
38
|
+
optionInfos: g((I == null ? void 0 : I.value) ?? [], {
|
|
39
|
+
valueKey: (d == null ? void 0 : d.value) ?? "value",
|
|
40
|
+
fieldNames: m.value,
|
|
41
41
|
origin: "extraOptions",
|
|
42
42
|
optionInfoMap: o
|
|
43
43
|
}),
|
|
44
44
|
optionInfoMap: o
|
|
45
45
|
};
|
|
46
|
-
}), e =
|
|
47
|
-
|
|
48
|
-
[
|
|
46
|
+
}), e = u(/* @__PURE__ */ new Map());
|
|
47
|
+
D(
|
|
48
|
+
[M, p, f],
|
|
49
49
|
() => {
|
|
50
|
-
e.clear(),
|
|
50
|
+
e.clear(), M.value.forEach((o, t) => {
|
|
51
51
|
e.set(o.key, { ...o, index: t });
|
|
52
|
-
}),
|
|
52
|
+
}), p.value.optionInfoMap.forEach((o) => {
|
|
53
53
|
e.has(o.key) || (o.index = e.size, e.set(o.key, o));
|
|
54
|
-
}),
|
|
54
|
+
}), f.value.optionInfoMap.forEach((o) => {
|
|
55
55
|
e.has(o.key) || (o.index = e.size, e.set(o.key, o));
|
|
56
56
|
});
|
|
57
57
|
},
|
|
58
58
|
{ immediate: !0, deep: !0 }
|
|
59
59
|
);
|
|
60
|
-
const
|
|
61
|
-
const o =
|
|
60
|
+
const k = r(() => {
|
|
61
|
+
const o = S(p.value.optionInfos, {
|
|
62
62
|
inputValue: n == null ? void 0 : n.value,
|
|
63
63
|
filterOption: a == null ? void 0 : a.value
|
|
64
64
|
});
|
|
65
|
-
return ((
|
|
66
|
-
...
|
|
65
|
+
return ((s == null ? void 0 : s.value) ?? !0) && o.push(
|
|
66
|
+
...S(f.value.optionInfos, {
|
|
67
67
|
inputValue: n == null ? void 0 : n.value,
|
|
68
68
|
filterOption: a == null ? void 0 : a.value
|
|
69
69
|
})
|
|
70
70
|
), o;
|
|
71
|
-
}), i =
|
|
72
|
-
() => Array.from(e.values()).filter((o) => o.origin === "extraOptions" && (
|
|
71
|
+
}), i = r(
|
|
72
|
+
() => Array.from(e.values()).filter((o) => o.origin === "extraOptions" && (s == null ? void 0 : s.value) === !1 ? !1 : z(o, {
|
|
73
73
|
inputValue: n == null ? void 0 : n.value,
|
|
74
74
|
filterOption: a == null ? void 0 : a.value
|
|
75
75
|
}))
|
|
76
|
-
),
|
|
76
|
+
), A = r(
|
|
77
77
|
() => i.value.filter((o) => !o.disabled).map((o) => o.key)
|
|
78
78
|
);
|
|
79
79
|
return {
|
|
80
|
-
validOptions:
|
|
80
|
+
validOptions: k,
|
|
81
81
|
optionInfoMap: e,
|
|
82
82
|
validOptionInfos: i,
|
|
83
|
-
enabledOptionKeys:
|
|
84
|
-
getNextSlotOptionIndex: () =>
|
|
83
|
+
enabledOptionKeys: A,
|
|
84
|
+
getNextSlotOptionIndex: () => c.size,
|
|
85
85
|
addSlotOptionInfo: (o, t) => {
|
|
86
|
-
|
|
86
|
+
c.set(o, t);
|
|
87
87
|
},
|
|
88
88
|
removeSlotOptionInfo: (o) => {
|
|
89
|
-
|
|
89
|
+
c.delete(o);
|
|
90
90
|
}
|
|
91
91
|
};
|
|
92
92
|
};
|
|
93
93
|
export {
|
|
94
|
-
|
|
94
|
+
T as useOptions
|
|
95
95
|
};
|
|
@@ -1,130 +1,135 @@
|
|
|
1
|
-
import { ref as X, watch as
|
|
2
|
-
import { getRelativeRect as
|
|
3
|
-
import { useOptions as
|
|
1
|
+
import { ref as X, watch as W, nextTick as Z, provide as $, reactive as R } from "vue";
|
|
2
|
+
import { getRelativeRect as F } from "../../../_utils/dom.js";
|
|
3
|
+
import { useOptions as L } from "./use-options.js";
|
|
4
4
|
import { KEYBOARD_KEY as a } from "../../../_utils/keyboard.js";
|
|
5
|
-
import { selectInjectionKey as
|
|
5
|
+
import { selectInjectionKey as p } from "../context.js";
|
|
6
6
|
import { isUndefined as f } from "../../../_utils/is.js";
|
|
7
7
|
const le = ({
|
|
8
|
-
multiple:
|
|
9
|
-
options:
|
|
8
|
+
multiple: U,
|
|
9
|
+
options: B,
|
|
10
10
|
extraOptions: Y,
|
|
11
|
-
inputValue:
|
|
12
|
-
filterOption:
|
|
11
|
+
inputValue: v,
|
|
12
|
+
filterOption: T,
|
|
13
13
|
showExtraOptions: j,
|
|
14
14
|
component: M,
|
|
15
15
|
valueKey: h,
|
|
16
16
|
fieldNames: q,
|
|
17
|
-
loading:
|
|
18
|
-
disabled:
|
|
19
|
-
popupVisible:
|
|
17
|
+
loading: k,
|
|
18
|
+
disabled: K,
|
|
19
|
+
popupVisible: u,
|
|
20
20
|
valueKeys: x,
|
|
21
|
-
dropdownRef:
|
|
21
|
+
dropdownRef: g,
|
|
22
22
|
optionRefs: O,
|
|
23
|
-
virtualListRef:
|
|
24
|
-
onSelect:
|
|
23
|
+
virtualListRef: s,
|
|
24
|
+
onSelect: d,
|
|
25
25
|
onPopupVisibleChange: i,
|
|
26
26
|
getOptionId: z,
|
|
27
27
|
enterToOpen: C = !0,
|
|
28
|
-
defaultActiveFirstOption:
|
|
28
|
+
defaultActiveFirstOption: E
|
|
29
29
|
}) => {
|
|
30
30
|
const {
|
|
31
31
|
validOptions: G,
|
|
32
32
|
optionInfoMap: D,
|
|
33
33
|
validOptionInfos: J,
|
|
34
|
-
enabledOptionKeys:
|
|
34
|
+
enabledOptionKeys: c,
|
|
35
35
|
getNextSlotOptionIndex: P,
|
|
36
36
|
addSlotOptionInfo: S,
|
|
37
37
|
removeSlotOptionInfo: _
|
|
38
|
-
} =
|
|
39
|
-
options:
|
|
38
|
+
} = L({
|
|
39
|
+
options: B,
|
|
40
40
|
extraOptions: Y,
|
|
41
|
-
inputValue:
|
|
42
|
-
filterOption:
|
|
41
|
+
inputValue: v,
|
|
42
|
+
filterOption: T,
|
|
43
43
|
showExtraOptions: j,
|
|
44
44
|
valueKey: h,
|
|
45
45
|
fieldNames: q
|
|
46
|
-
}),
|
|
47
|
-
let
|
|
48
|
-
const
|
|
49
|
-
const e =
|
|
50
|
-
return e.includes(
|
|
46
|
+
}), r = X();
|
|
47
|
+
let n;
|
|
48
|
+
const I = () => {
|
|
49
|
+
const e = c.value, t = x.value[x.value.length - 1];
|
|
50
|
+
return e.includes(t) ? t : n ? n === "up" ? e[e.length - 1] : e[0] : (E == null ? void 0 : E.value) ?? !0 ? e[0] : void 0;
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
W(c, (e) => {
|
|
53
|
+
(u.value && n || f(r.value) || !e.includes(r.value)) && (r.value = I());
|
|
54
54
|
});
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
},
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
55
|
+
const w = (e) => {
|
|
56
|
+
r.value = e;
|
|
57
|
+
}, A = (e) => {
|
|
58
|
+
const t = c.value.length;
|
|
59
|
+
if (t === 0)
|
|
60
60
|
return;
|
|
61
|
-
if (f(
|
|
62
|
-
return e === "down" ?
|
|
63
|
-
const o =
|
|
64
|
-
return
|
|
65
|
-
},
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
if (!o || !
|
|
61
|
+
if (f(r.value))
|
|
62
|
+
return e === "down" ? c.value[0] : c.value[t - 1];
|
|
63
|
+
const o = c.value.indexOf(r.value), l = (t + o + (e === "up" ? -1 : 1)) % t;
|
|
64
|
+
return c.value[l];
|
|
65
|
+
}, m = (e) => {
|
|
66
|
+
var N;
|
|
67
|
+
s != null && s.value && s.value.scrollTo({ key: e });
|
|
68
|
+
const t = D.get(e), o = (N = g == null ? void 0 : g.value) == null ? void 0 : N.wrapperRef, l = (O == null ? void 0 : O.value[e]) ?? (t == null ? void 0 : t.ref);
|
|
69
|
+
if (!o || !l || o.scrollHeight === o.offsetHeight)
|
|
70
70
|
return;
|
|
71
|
-
const
|
|
72
|
-
|
|
71
|
+
const y = F(l, o), H = o.scrollTop;
|
|
72
|
+
y.top < 0 ? o.scrollTo(0, H + y.top) : y.bottom < 0 && o.scrollTo(0, H - y.bottom);
|
|
73
73
|
};
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
W(
|
|
75
|
+
u,
|
|
76
76
|
(e) => {
|
|
77
|
-
e ? (
|
|
78
|
-
|
|
79
|
-
})) :
|
|
77
|
+
e ? (r.value = I(), Z(() => {
|
|
78
|
+
n = void 0, u.value && !f(r.value) && m(r.value);
|
|
79
|
+
})) : n = void 0;
|
|
80
80
|
},
|
|
81
81
|
{ immediate: !0 }
|
|
82
82
|
);
|
|
83
83
|
const Q = (e) => {
|
|
84
|
-
if (
|
|
84
|
+
if (K != null && K.value || e.isComposing || e.keyCode === 229 || e.ctrlKey || e.altKey || e.metaKey)
|
|
85
85
|
return;
|
|
86
86
|
if (e.key === a.TAB) {
|
|
87
|
-
|
|
87
|
+
n = void 0, u.value && i(!1);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
if (e.shiftKey)
|
|
91
91
|
return;
|
|
92
|
-
const
|
|
92
|
+
const t = () => {
|
|
93
93
|
e.stopPropagation(), e.preventDefault();
|
|
94
94
|
};
|
|
95
95
|
if (e.key === a.ESC) {
|
|
96
|
-
|
|
96
|
+
n = void 0, u.value && (t(), i(!1));
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
|
-
if (!(
|
|
99
|
+
if (!(k != null && k.value)) {
|
|
100
|
+
if (u.value && !(v != null && v.value) && (e.key === "Home" || e.key === "End")) {
|
|
101
|
+
const o = c.value, l = e.key === "Home" ? o[0] : o[o.length - 1];
|
|
102
|
+
f(l) || (t(), r.value = l, m(l));
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
100
105
|
if (e.key === a.ENTER) {
|
|
101
|
-
|
|
106
|
+
u.value ? !f(r.value) && c.value.includes(r.value) && (t(), d(r.value, e)) : C && (n = void 0, t(), i(!0));
|
|
102
107
|
return;
|
|
103
108
|
}
|
|
104
109
|
if (e.key === a.ARROW_DOWN || e.key === a.ARROW_UP) {
|
|
105
110
|
const o = e.key === a.ARROW_UP ? "up" : "down";
|
|
106
|
-
if (
|
|
107
|
-
|
|
111
|
+
if (t(), !u.value)
|
|
112
|
+
n = o, i(!0);
|
|
108
113
|
else {
|
|
109
|
-
const
|
|
110
|
-
f(
|
|
114
|
+
const l = A(o);
|
|
115
|
+
f(l) || (r.value = l, m(l));
|
|
111
116
|
}
|
|
112
117
|
}
|
|
113
118
|
}
|
|
114
119
|
};
|
|
115
120
|
return $(
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
multiple:
|
|
121
|
+
p,
|
|
122
|
+
R({
|
|
123
|
+
multiple: U,
|
|
119
124
|
valueKey: h,
|
|
120
|
-
inputValue:
|
|
121
|
-
filterOption:
|
|
125
|
+
inputValue: v,
|
|
126
|
+
filterOption: T,
|
|
122
127
|
component: M,
|
|
123
128
|
valueKeys: x,
|
|
124
|
-
activeKey:
|
|
129
|
+
activeKey: r,
|
|
125
130
|
getOptionId: z,
|
|
126
|
-
setActiveKey:
|
|
127
|
-
onSelect:
|
|
131
|
+
setActiveKey: w,
|
|
132
|
+
onSelect: d,
|
|
128
133
|
getNextSlotOptionIndex: P,
|
|
129
134
|
addSlotOptionInfo: S,
|
|
130
135
|
removeSlotOptionInfo: _
|
|
@@ -133,13 +138,13 @@ const le = ({
|
|
|
133
138
|
validOptions: G,
|
|
134
139
|
optionInfoMap: D,
|
|
135
140
|
validOptionInfos: J,
|
|
136
|
-
enabledOptionKeys:
|
|
137
|
-
activeKey:
|
|
138
|
-
setActiveKey:
|
|
141
|
+
enabledOptionKeys: c,
|
|
142
|
+
activeKey: r,
|
|
143
|
+
setActiveKey: w,
|
|
139
144
|
addSlotOptionInfo: S,
|
|
140
145
|
removeSlotOptionInfo: _,
|
|
141
|
-
getNextActiveKey:
|
|
142
|
-
scrollIntoView:
|
|
146
|
+
getNextActiveKey: A,
|
|
147
|
+
scrollIntoView: m,
|
|
143
148
|
handleKeyDown: Q
|
|
144
149
|
};
|
|
145
150
|
};
|