x-next 1.2.0 → 1.3.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 +647 -0
- package/CHANGELOG.md +22 -0
- package/README.md +8 -0
- package/dist/components/dropdown/Dropdown.vue.d.ts +27 -1
- package/dist/components/dropdown/DropdownButton.vue.d.ts +27 -1
- package/dist/components/dropdown/DropdownOption.vue.d.ts +2 -0
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +158 -1
- package/dist/components/dropdown/context.d.ts +14 -1
- package/dist/components/dropdown/dropdown-panel.vue.d.ts +7 -1
- package/dist/components/dropdown/index.d.ts +588 -6
- package/dist/components/dropdown/use-keyboard.d.ts +10 -0
- package/dist/components/form-select/hooks/use-select.d.ts +2 -1
- package/dist/es/_hooks/use-overflow.js +45 -40
- package/dist/es/components/_components/select-view/select-view.js +49 -55
- package/dist/es/components/dialog/Dialog.js +106 -97
- package/dist/es/components/dropdown/Dropdown.vue.js +18 -15
- package/dist/es/components/dropdown/Dropdown.vue2.js +52 -31
- package/dist/es/components/dropdown/DropdownOption.vue.js +22 -21
- package/dist/es/components/dropdown/DropdownOption.vue2.js +23 -19
- package/dist/es/components/dropdown/DropdownSubmenu.vue.js +49 -36
- package/dist/es/components/dropdown/DropdownSubmenu.vue2.js +45 -24
- package/dist/es/components/dropdown/context.js +3 -2
- package/dist/es/components/dropdown/dropdown-panel.vue.js +24 -21
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +83 -31
- package/dist/es/components/dropdown/use-keyboard.js +45 -0
- package/dist/es/components/form-checkbox/Checkbox.js +49 -49
- package/dist/es/components/form-select/Select.js +25 -24
- package/dist/es/components/form-select/hooks/use-select.js +128 -128
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/style/base.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -3
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Empty as
|
|
3
|
-
import { dropdownInjectionKey as
|
|
4
|
-
import { isNumber as
|
|
5
|
-
import { Scrollbar as
|
|
6
|
-
import { Spin as
|
|
7
|
-
import { getClassNameMixin as
|
|
8
|
-
import { useLocale as
|
|
9
|
-
const
|
|
1
|
+
import { defineComponent as A, inject as D, ref as d, shallowRef as h, provide as H, watchPostEffect as P, computed as v } from "vue";
|
|
2
|
+
import { Empty as k } from "../empty/index.js";
|
|
3
|
+
import { dropdownInjectionKey as B, dropdownMenuInjectionKey as C } from "./context.js";
|
|
4
|
+
import { isNumber as M } from "../../_utils/is.js";
|
|
5
|
+
import { Scrollbar as L } from "../scrollbar-v2/index.js";
|
|
6
|
+
import { Spin as S } from "../spin/index.js";
|
|
7
|
+
import { getClassNameMixin as _ } from "../../_utils/config.js";
|
|
8
|
+
import { useLocale as T } from "../../locale/index.js";
|
|
9
|
+
const q = A({
|
|
10
10
|
name: "DropdownPanel",
|
|
11
11
|
components: {
|
|
12
|
-
Scrollbar:
|
|
13
|
-
Empty:
|
|
14
|
-
Spin:
|
|
12
|
+
Scrollbar: L,
|
|
13
|
+
Empty: k,
|
|
14
|
+
Spin: S
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
|
+
// private: only submenu panels return to their parent on ArrowLeft.
|
|
18
|
+
closeOnArrowLeft: Boolean,
|
|
17
19
|
loading: {
|
|
18
20
|
type: Boolean,
|
|
19
21
|
default: !1
|
|
@@ -33,37 +35,87 @@ const _ = h({
|
|
|
33
35
|
type: [Function, Array]
|
|
34
36
|
}
|
|
35
37
|
},
|
|
36
|
-
emits: ["scroll", "reachBottom"],
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
|
|
38
|
+
emits: ["scroll", "reachBottom", "close"],
|
|
39
|
+
setup(m, { emit: c, slots: g, expose: y }) {
|
|
40
|
+
const u = _("dropdown"), { t: w } = T(), i = D(B, {}), b = d(), f = d(), r = h([]), n = h(), p = () => r.value.filter((e) => {
|
|
41
|
+
var o;
|
|
42
|
+
return !e.disabled.value && ((o = e.element.value) == null ? void 0 : o.isConnected);
|
|
43
|
+
}).sort((e, o) => {
|
|
44
|
+
const t = e.element.value.compareDocumentPosition(o.element.value);
|
|
45
|
+
return t & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : t & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
|
|
46
|
+
}), I = (e) => {
|
|
47
|
+
e.disabled.value || (n.value = e);
|
|
48
|
+
}, a = (e) => {
|
|
49
|
+
n.value = e;
|
|
50
|
+
const o = (e == null ? void 0 : e.element.value) ?? f.value;
|
|
51
|
+
return o == null || o.focus(), !!(o && document.activeElement === o);
|
|
52
|
+
};
|
|
53
|
+
y({ focus: (e = "first") => {
|
|
54
|
+
const o = p();
|
|
55
|
+
return a(e === "last" ? o.at(-1) : o[0]);
|
|
56
|
+
} }), H(C, {
|
|
57
|
+
activeItem: n,
|
|
58
|
+
setActiveItem: I,
|
|
59
|
+
registerItem: (e) => (r.value = [...r.value, e], () => {
|
|
60
|
+
r.value = r.value.filter((o) => o !== e);
|
|
61
|
+
})
|
|
62
|
+
}), P(() => {
|
|
63
|
+
var o;
|
|
64
|
+
const e = p();
|
|
65
|
+
if (!n.value || !e.includes(n.value)) {
|
|
66
|
+
const t = ((o = n.value) == null ? void 0 : o.element.value) === document.activeElement;
|
|
67
|
+
n.value = e[0], t && a(n.value);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
const E = (e) => {
|
|
71
|
+
if (e.defaultPrevented || e.isComposing) return;
|
|
72
|
+
if (e.key === "Escape" || m.closeOnArrowLeft && e.key === "ArrowLeft") {
|
|
73
|
+
e.preventDefault(), e.stopPropagation(), c("close");
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(e.key)) return;
|
|
77
|
+
const o = p(), t = e.target;
|
|
78
|
+
if (t !== f.value && !r.value.some((l) => l.element.value === t))
|
|
79
|
+
return;
|
|
80
|
+
e.preventDefault(), e.stopPropagation();
|
|
81
|
+
const s = o.findIndex((l) => l.element.value === t);
|
|
82
|
+
if (e.key === "Home") a(o[0]);
|
|
83
|
+
else if (e.key === "End") a(o.at(-1));
|
|
84
|
+
else if (o.length) {
|
|
85
|
+
const l = s < 0 ? e.key === "ArrowUp" ? o.length - 1 : 0 : (s + (e.key === "ArrowDown" ? 1 : -1) + o.length) % o.length;
|
|
86
|
+
a(o[l]);
|
|
87
|
+
}
|
|
88
|
+
}, x = (e) => {
|
|
89
|
+
const { scrollTop: o, scrollHeight: t, offsetHeight: s } = e.target;
|
|
90
|
+
t - (o + s) <= m.bottomOffset && c("reachBottom", e), c("scroll", e);
|
|
91
|
+
}, N = v(() => {
|
|
92
|
+
if (M(i.popupMaxHeight))
|
|
43
93
|
return {
|
|
44
|
-
maxHeight: `${
|
|
94
|
+
maxHeight: `${i.popupMaxHeight}px`
|
|
45
95
|
};
|
|
46
|
-
if (!
|
|
96
|
+
if (!i.popupMaxHeight)
|
|
47
97
|
return {
|
|
48
98
|
maxHeight: "none",
|
|
49
99
|
overflowY: "hidden"
|
|
50
100
|
};
|
|
51
|
-
}),
|
|
52
|
-
|
|
101
|
+
}), O = v(() => [
|
|
102
|
+
u.block,
|
|
53
103
|
{
|
|
54
|
-
[
|
|
104
|
+
[u.modifier("has-footer")]: !!g.footer
|
|
55
105
|
}
|
|
56
106
|
]);
|
|
57
107
|
return {
|
|
58
|
-
className:
|
|
59
|
-
cls:
|
|
60
|
-
style:
|
|
61
|
-
wrapperRef:
|
|
62
|
-
|
|
63
|
-
|
|
108
|
+
className: u,
|
|
109
|
+
cls: O,
|
|
110
|
+
style: N,
|
|
111
|
+
wrapperRef: b,
|
|
112
|
+
panelElement: f,
|
|
113
|
+
handleKeydown: E,
|
|
114
|
+
handleScroll: x,
|
|
115
|
+
t: w
|
|
64
116
|
};
|
|
65
117
|
}
|
|
66
118
|
});
|
|
67
119
|
export {
|
|
68
|
-
|
|
120
|
+
q as default
|
|
69
121
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ref as h, watch as y, nextTick as u } from "vue";
|
|
2
|
+
const v = (n, f, i, c = () => !1) => {
|
|
3
|
+
const s = h();
|
|
4
|
+
let t, r = !1, o = !1;
|
|
5
|
+
const l = () => {
|
|
6
|
+
!n.value || !t || !s.value || (o = !0, s.value.focus(t) && (t = void 0), o = !1);
|
|
7
|
+
}, p = () => {
|
|
8
|
+
l(), t = void 0;
|
|
9
|
+
}, m = (e) => {
|
|
10
|
+
if (c() || e.defaultPrevented || e.isComposing) return;
|
|
11
|
+
const a = e.currentTarget;
|
|
12
|
+
if (!a.matches(':disabled, [aria-disabled="true"]')) {
|
|
13
|
+
if (e.key === "Escape" && n.value)
|
|
14
|
+
d();
|
|
15
|
+
else if (["Enter", " ", "ArrowDown", "ArrowUp", "ArrowRight"].includes(e.key)) {
|
|
16
|
+
if (e.preventDefault(), e.repeat) return;
|
|
17
|
+
i.value = a, r = !1, t = e.key === "ArrowUp" ? "last" : "first", f(!0), u(l);
|
|
18
|
+
} else
|
|
19
|
+
return;
|
|
20
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
21
|
+
}
|
|
22
|
+
}, d = () => {
|
|
23
|
+
t = void 0, r = !0, f(!1);
|
|
24
|
+
}, g = (e) => {
|
|
25
|
+
e instanceof KeyboardEvent && (r = !0);
|
|
26
|
+
}, w = (e) => {
|
|
27
|
+
o && e.stopImmediatePropagation();
|
|
28
|
+
};
|
|
29
|
+
return y(n, (e) => {
|
|
30
|
+
e ? u(l) : (t = void 0, r && (r = !1, u(() => {
|
|
31
|
+
var a;
|
|
32
|
+
o = !0, (a = i.value) == null || a.focus(), o = !1;
|
|
33
|
+
})));
|
|
34
|
+
}), {
|
|
35
|
+
panelRef: s,
|
|
36
|
+
handleShow: p,
|
|
37
|
+
handleTriggerKeydown: m,
|
|
38
|
+
handleTriggerFocus: w,
|
|
39
|
+
handleClose: d,
|
|
40
|
+
handleKeyboardSelect: g
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
v as useDropdownKeyboard
|
|
45
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { isArray as h, isUndefined as
|
|
5
|
-
import { checkboxGroupKey as
|
|
6
|
-
import { useFormItem as
|
|
1
|
+
import { defineComponent as W, toRefs as X, ref as A, inject as _, computed as s, watch as C, watchEffect as $, createVNode as c, mergeProps as I, nextTick as J } from "vue";
|
|
2
|
+
import j from "../_components/icon-hover/index.vue.js";
|
|
3
|
+
import p from "./icon-check.js";
|
|
4
|
+
import { isArray as h, isUndefined as L, isNull as Q } from "../../_utils/is.js";
|
|
5
|
+
import { checkboxGroupKey as Y } from "./context.js";
|
|
6
|
+
import { useFormItem as Z, useFormItemControl as x } from "../../_hooks/use-form-item.js";
|
|
7
7
|
import { getClassNameMixin as G } from "../../_utils/config.js";
|
|
8
|
-
import { useSize as
|
|
9
|
-
const
|
|
8
|
+
import { useSize as ee } from "../../_hooks/use-size.js";
|
|
9
|
+
const ae = /* @__PURE__ */ new Set(["id", "name", "required", "form", "tabindex", "tabIndex", "autofocus", "autoFocus", "autocomplete", "autoComplete"]), F = (t) => ae.has(t) || t.startsWith("aria-"), ce = /* @__PURE__ */ W({
|
|
10
10
|
name: "Checkbox",
|
|
11
11
|
inheritAttrs: !1,
|
|
12
12
|
components: {
|
|
13
|
-
IconCheck:
|
|
14
|
-
IconHover:
|
|
13
|
+
IconCheck: p,
|
|
14
|
+
IconHover: j
|
|
15
15
|
},
|
|
16
16
|
props: {
|
|
17
17
|
/**
|
|
@@ -95,78 +95,78 @@ const oe = /* @__PURE__ */ U({
|
|
|
95
95
|
disabled: N,
|
|
96
96
|
modelValue: w,
|
|
97
97
|
size: O
|
|
98
|
-
} = X(t), i = G("checkbox"),
|
|
99
|
-
formItemCtx:
|
|
100
|
-
mergedDisabled:
|
|
101
|
-
mergedSize:
|
|
102
|
-
eventHandlers:
|
|
103
|
-
} =
|
|
98
|
+
} = X(t), i = G("checkbox"), u = A(), l = t.uninjectGroupContext ? void 0 : _(Y, void 0), k = (l == null ? void 0 : l.name) === "XCheckboxGroup", {
|
|
99
|
+
formItemCtx: E,
|
|
100
|
+
mergedDisabled: y,
|
|
101
|
+
mergedSize: M,
|
|
102
|
+
eventHandlers: z
|
|
103
|
+
} = Z({
|
|
104
104
|
disabled: N,
|
|
105
105
|
size: O
|
|
106
|
-
}),
|
|
107
|
-
mergedSize:
|
|
108
|
-
} =
|
|
106
|
+
}), H = x(k ? {} : E, () => Object.fromEntries(Object.entries(f).filter(([e]) => F(e)))), P = s(() => Object.fromEntries(Object.entries(f).filter(([e]) => e !== "class" && e !== "style" && !F(e)))), {
|
|
107
|
+
mergedSize: R
|
|
108
|
+
} = ee(M), r = A(t.defaultChecked), o = s(() => k ? l == null ? void 0 : l.computedValue : t.modelValue ?? r.value), d = s(() => h(o.value) ? o.value.includes(t.value ?? !0) : o.value), m = s(() => (l == null ? void 0 : l.disabled) || (y == null ? void 0 : y.value) || !d.value && (l == null ? void 0 : l.isMaxed)), B = s(() => (l == null ? void 0 : l.size) ?? R.value), q = (e) => {
|
|
109
109
|
e.stopPropagation();
|
|
110
|
-
},
|
|
110
|
+
}, D = (e) => {
|
|
111
111
|
var v, V;
|
|
112
112
|
const {
|
|
113
113
|
checked: a
|
|
114
114
|
} = e.target;
|
|
115
115
|
let n = a;
|
|
116
116
|
if (h(o.value)) {
|
|
117
|
-
const
|
|
118
|
-
a ?
|
|
117
|
+
const S = new Set(o.value);
|
|
118
|
+
a ? S.add(t.value ?? !0) : S.delete(t.value ?? !0), n = Array.from(S);
|
|
119
119
|
}
|
|
120
|
-
r.value = a,
|
|
121
|
-
|
|
120
|
+
r.value = a, k && h(n) ? l == null || l.handleChange(n, e) : (g("update:modelValue", n), g("change", n, e), (V = (v = z.value) == null ? void 0 : v.onChange) == null || V.call(v, e)), J(() => {
|
|
121
|
+
u.value && u.value.checked !== d.value && (u.value.checked = d.value);
|
|
122
122
|
});
|
|
123
|
-
},
|
|
124
|
-
[i.modifier("checked")]:
|
|
123
|
+
}, K = s(() => [i.block, i.modifier(`size-${B.value}`), {
|
|
124
|
+
[i.modifier("checked")]: d.value,
|
|
125
125
|
[i.modifier("indeterminate")]: t.indeterminate,
|
|
126
126
|
[i.modifier("disabled")]: m.value
|
|
127
|
-
}]),
|
|
127
|
+
}]), T = (e) => {
|
|
128
128
|
var a, n;
|
|
129
|
-
(n = (a =
|
|
130
|
-
},
|
|
129
|
+
(n = (a = z.value) == null ? void 0 : a.onFocus) == null || n.call(a, e);
|
|
130
|
+
}, U = (e) => {
|
|
131
131
|
var a, n;
|
|
132
|
-
(n = (a =
|
|
132
|
+
(n = (a = z.value) == null ? void 0 : a.onBlur) == null || n.call(a, e);
|
|
133
133
|
};
|
|
134
134
|
return C(w, (e) => {
|
|
135
|
-
(
|
|
135
|
+
(L(e) || Q(e)) && (r.value = !1);
|
|
136
136
|
}), C(o, (e) => {
|
|
137
137
|
let a;
|
|
138
|
-
h(e) ? a = e.includes(t.value ?? !0) : a = e, r.value !== a && (r.value = a),
|
|
138
|
+
h(e) ? a = e.includes(t.value ?? !0) : a = e, r.value !== a && (r.value = a), u.value && u.value.checked !== a && (u.value.checked = a);
|
|
139
139
|
}), $(() => {
|
|
140
|
-
|
|
140
|
+
u.value && (u.value.indeterminate = t.indeterminate);
|
|
141
141
|
}), () => {
|
|
142
142
|
var e, a;
|
|
143
|
-
return c("label",
|
|
143
|
+
return c("label", I(P.value, {
|
|
144
144
|
"aria-disabled": m.value,
|
|
145
|
-
class: [
|
|
145
|
+
class: [K.value, f.class],
|
|
146
146
|
style: f.style
|
|
147
|
-
}), [c("input",
|
|
148
|
-
ref:
|
|
147
|
+
}), [c("input", I(H.value, {
|
|
148
|
+
ref: u,
|
|
149
149
|
type: "checkbox",
|
|
150
|
-
checked:
|
|
151
|
-
"aria-checked": t.indeterminate ? "mixed" :
|
|
150
|
+
checked: d.value,
|
|
151
|
+
"aria-checked": t.indeterminate ? "mixed" : d.value,
|
|
152
152
|
value: t.value,
|
|
153
153
|
class: i.modifier("target"),
|
|
154
154
|
disabled: m.value,
|
|
155
|
-
onClick:
|
|
156
|
-
onChange:
|
|
157
|
-
onFocus:
|
|
158
|
-
onBlur:
|
|
155
|
+
onClick: q,
|
|
156
|
+
onChange: D,
|
|
157
|
+
onFocus: T,
|
|
158
|
+
onBlur: U
|
|
159
159
|
}), null), ((a = b.checkbox ?? ((e = l == null ? void 0 : l.slots) == null ? void 0 : e.checkbox)) == null ? void 0 : a({
|
|
160
|
-
checked:
|
|
160
|
+
checked: d.value,
|
|
161
161
|
disabled: m.value
|
|
162
|
-
})) ?? c(
|
|
162
|
+
})) ?? c(j, {
|
|
163
163
|
class: i.modifier("icon-hover"),
|
|
164
|
-
size:
|
|
165
|
-
disabled: m.value ||
|
|
164
|
+
size: B.value,
|
|
165
|
+
disabled: m.value || d.value
|
|
166
166
|
}, {
|
|
167
167
|
default: () => [c("div", {
|
|
168
168
|
class: i.modifier("icon")
|
|
169
|
-
}, [
|
|
169
|
+
}, [d.value && c(p, {
|
|
170
170
|
class: i.modifier("icon-check")
|
|
171
171
|
}, null)])]
|
|
172
172
|
}), b.default && c("span", {
|
|
@@ -176,5 +176,5 @@ const oe = /* @__PURE__ */ U({
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
export {
|
|
179
|
-
|
|
179
|
+
ce as default
|
|
180
180
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as Ne, toRefs as je, useId as De, computed as i, ref as p, watch as H, nextTick as Re, watchEffect as Te, createVNode as m, mergeProps as A, isVNode as _e } from "vue";
|
|
2
|
-
import { isObject as N, isFunction as y, isArray as Ie, isNumber as Ke, isString as $e, isBoolean as ze, isUndefined as
|
|
2
|
+
import { isObject as N, isFunction as y, isArray as Ie, isNumber as Ke, isString as $e, isBoolean as ze, isUndefined as C, isNull as He, isEmptyObject as Me } from "../../_utils/is.js";
|
|
3
3
|
import { getKeyFromValue as M, isGroupOptionInfo as Ue, isValidOption as Ge, hasEmptyStringKey as We } from "./utils.js";
|
|
4
4
|
import { Trigger as U } from "../trigger/index.js";
|
|
5
5
|
import G from "../_components/select-view/select-view.js";
|
|
@@ -439,7 +439,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
439
439
|
setup(t, {
|
|
440
440
|
slots: o,
|
|
441
441
|
emit: r,
|
|
442
|
-
attrs:
|
|
442
|
+
attrs: B
|
|
443
443
|
}) {
|
|
444
444
|
const {
|
|
445
445
|
size: Y,
|
|
@@ -456,10 +456,10 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
456
456
|
fieldNames: V,
|
|
457
457
|
loading: ae,
|
|
458
458
|
defaultActiveFirstOption: le
|
|
459
|
-
} = je(t), ne = lt("select"), D = De(),
|
|
459
|
+
} = je(t), ne = lt("select"), D = De(), x = `${D}-listbox`, F = (e) => `${D}-option-${encodeURIComponent(e)}`, {
|
|
460
460
|
formItemCtx: oe,
|
|
461
461
|
mergedSize: ue,
|
|
462
|
-
mergedDisabled:
|
|
462
|
+
mergedDisabled: w,
|
|
463
463
|
mergedError: re,
|
|
464
464
|
eventHandlers: ie
|
|
465
465
|
} = et({
|
|
@@ -478,7 +478,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
478
478
|
});
|
|
479
479
|
const R = p(), T = p({}), _ = p(), {
|
|
480
480
|
computedPopupVisible: c,
|
|
481
|
-
handlePopupVisibleChange:
|
|
481
|
+
handlePopupVisibleChange: O
|
|
482
482
|
} = Ze({
|
|
483
483
|
popupVisible: X,
|
|
484
484
|
defaultPopupVisible: Z,
|
|
@@ -491,7 +491,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
491
491
|
}));
|
|
492
492
|
});
|
|
493
493
|
H(te, (e) => {
|
|
494
|
-
(
|
|
494
|
+
(C(e) || He(e)) && (k.value = j.value ? [] : e);
|
|
495
495
|
});
|
|
496
496
|
const d = i(() => E.value.map((e) => e.key)), I = i(() => ({
|
|
497
497
|
...rt,
|
|
@@ -530,7 +530,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
530
530
|
var n;
|
|
531
531
|
let l = pe(e.value);
|
|
532
532
|
const a = (n = K.value) == null ? void 0 : n[e.key];
|
|
533
|
-
return !
|
|
533
|
+
return !C(a) && !Me(a) && (l = {
|
|
534
534
|
...l,
|
|
535
535
|
...a
|
|
536
536
|
}), l;
|
|
@@ -585,12 +585,12 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
585
585
|
const a = u.get(e);
|
|
586
586
|
a && g(a.label);
|
|
587
587
|
}
|
|
588
|
-
|
|
588
|
+
O(!1);
|
|
589
589
|
}
|
|
590
590
|
}, ye = at((e) => {
|
|
591
591
|
r("search", e);
|
|
592
592
|
}, t.searchDelay), he = (e) => {
|
|
593
|
-
e !== s.value && (c.value ||
|
|
593
|
+
e !== s.value && (c.value || O(!0), g(e), t.allowSearch && ye(e));
|
|
594
594
|
}, Ve = (e) => {
|
|
595
595
|
const l = u.get(e), a = d.value.filter((n) => n !== e);
|
|
596
596
|
b(a), r("remove", l == null ? void 0 : l.value);
|
|
@@ -610,7 +610,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
610
610
|
optionInfoMap: u,
|
|
611
611
|
validOptionInfos: Ce,
|
|
612
612
|
enabledOptionKeys: Be,
|
|
613
|
-
activeKey:
|
|
613
|
+
activeKey: S,
|
|
614
614
|
handleKeyDown: xe
|
|
615
615
|
} = Xe({
|
|
616
616
|
multiple: j,
|
|
@@ -623,6 +623,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
623
623
|
valueKey: f,
|
|
624
624
|
fieldNames: V,
|
|
625
625
|
loading: ae,
|
|
626
|
+
disabled: w,
|
|
626
627
|
popupVisible: c,
|
|
627
628
|
valueKeys: d,
|
|
628
629
|
dropdownRef: R,
|
|
@@ -630,17 +631,17 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
630
631
|
virtualListRef: _,
|
|
631
632
|
defaultActiveFirstOption: le,
|
|
632
633
|
onSelect: ge,
|
|
633
|
-
onPopupVisibleChange:
|
|
634
|
-
getOptionId:
|
|
635
|
-
}), Fe = i(() => nt(
|
|
636
|
-
...ot(
|
|
634
|
+
onPopupVisibleChange: O,
|
|
635
|
+
getOptionId: F
|
|
636
|
+
}), Fe = i(() => nt(B, [...W])), Pe = i(() => ({
|
|
637
|
+
...ot(B, [...W]),
|
|
637
638
|
role: "combobox",
|
|
638
639
|
"aria-haspopup": "listbox",
|
|
639
640
|
"aria-expanded": String(c.value),
|
|
640
|
-
"aria-controls":
|
|
641
|
-
"aria-activedescendant": c.value && !S
|
|
641
|
+
"aria-controls": x,
|
|
642
|
+
"aria-activedescendant": c.value && !C(S.value) ? F(S.value) : void 0,
|
|
642
643
|
"aria-autocomplete": t.allowSearch || t.allowCreate ? "list" : "none",
|
|
643
|
-
"aria-label":
|
|
644
|
+
"aria-label": B["aria-label"] ?? (oe.labelId ? void 0 : t.placeholder ?? ce("common.select"))
|
|
644
645
|
})), ke = i(() => {
|
|
645
646
|
const e = [];
|
|
646
647
|
for (const l of E.value) {
|
|
@@ -689,7 +690,7 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
689
690
|
}) : null;
|
|
690
691
|
}, Le = () => m(Ye, {
|
|
691
692
|
ref: R,
|
|
692
|
-
id:
|
|
693
|
+
id: x,
|
|
693
694
|
multiple: t.multiple,
|
|
694
695
|
loading: t.loading,
|
|
695
696
|
empty: Ce.value.length === 0,
|
|
@@ -748,26 +749,26 @@ const W = ["id", "aria-label", "aria-labelledby", "aria-describedby"], rt = {
|
|
|
748
749
|
preventFocus: !0,
|
|
749
750
|
autoFitPopupWidth: !0,
|
|
750
751
|
autoFitTransformOrigin: !0,
|
|
751
|
-
disabled:
|
|
752
|
+
disabled: w.value,
|
|
752
753
|
popupVisible: c.value,
|
|
753
754
|
unmountOnClose: t.unmountOnClose,
|
|
754
755
|
clickToClose: !(t.allowSearch || t.allowCreate),
|
|
755
756
|
popupContainer: t.popupContainer,
|
|
756
|
-
onPopupVisibleChange:
|
|
757
|
+
onPopupVisibleChange: O
|
|
757
758
|
}, t.triggerProps), {
|
|
758
759
|
default: () => {
|
|
759
760
|
var e;
|
|
760
761
|
return [((e = o.trigger) == null ? void 0 : e.call(o, {
|
|
761
762
|
popupVisible: c.value,
|
|
762
|
-
disabled:
|
|
763
|
-
listboxId:
|
|
764
|
-
activeDescendant: c.value && !S
|
|
763
|
+
disabled: w.value,
|
|
764
|
+
listboxId: x,
|
|
765
|
+
activeDescendant: c.value && !C(S.value) ? F(S.value) : void 0
|
|
765
766
|
})) ?? m(G, A({
|
|
766
767
|
class: ne.block,
|
|
767
768
|
modelValue: ke.value,
|
|
768
769
|
inputValue: s.value,
|
|
769
770
|
multiple: t.multiple,
|
|
770
|
-
disabled:
|
|
771
|
+
disabled: w.value,
|
|
771
772
|
error: re.value,
|
|
772
773
|
loading: t.loading,
|
|
773
774
|
allowClear: t.allowClear,
|