x-next 1.9.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 +69 -7
- package/CHANGELOG.md +36 -0
- package/dist/_utils/chart/scale.d.ts +1 -1
- package/dist/components/_components/chart/axis-labels.d.ts +8 -0
- 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/link/Link.vue.d.ts +1 -1
- package/dist/components/link/index.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +60 -32
- package/dist/components/trigger/interface.d.ts +2 -0
- package/dist/components/virtual-list-v2/interface.d.ts +3 -0
- package/dist/components/virtual-list-v2/virtual-list.vue.d.ts +336 -1
- package/dist/es/_hooks/use-component-ref.js +9 -9
- package/dist/es/_utils/chart/scale.js +44 -39
- package/dist/es/components/_components/chart/ChartAxis.js +61 -36
- package/dist/es/components/_components/chart/axis-labels.js +26 -0
- package/dist/es/components/_components/select-view/select-view.js +89 -78
- package/dist/es/components/button/Button.js +23 -23
- package/dist/es/components/form-input-tag/InputTag.js +1 -1
- package/dist/es/components/form-select/Select.js +367 -318
- 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/components/trigger/Trigger.js +174 -183
- package/dist/es/components/virtual-list-v2/virtual-list.vue.js +22 -23
- package/dist/es/components/virtual-list-v2/virtual-list.vue2.js +67 -53
- package/dist/es/icons/icon.js +37 -36
- package/dist/es/icons/index.js +6 -8
- package/dist/es/icons/public/lucide-names.js +167 -0
- package/dist/es/icons/public/lucide.js +75 -188
- package/dist/es/index.js +152 -148
- package/dist/es/style.css +1 -1
- package/dist/icons/index.d.ts +3 -3
- package/dist/icons/names.d.ts +2 -2
- package/dist/icons/public/lucide-names.d.ts +32 -0
- package/dist/icons/public/lucide.d.ts +2 -2
- package/dist/index.cjs +3 -62
- package/dist/index.umd.js +3 -62
- 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 +3 -2
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as E, toRefs as H, ref as
|
|
2
|
-
import { isArray as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { InputTag as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { useFormItem as
|
|
12
|
-
import { useLocale as
|
|
13
|
-
import { useSize as
|
|
14
|
-
import { getClassNameMixin as
|
|
1
|
+
import { defineComponent as E, toRefs as H, ref as S, computed as i, createVNode as o, Fragment as M, nextTick as P } from "vue";
|
|
2
|
+
import { isArray as q } from "../../../_utils/is.js";
|
|
3
|
+
import O from "../feedback-icon/index.vue.js";
|
|
4
|
+
import _ from "../input-label/input-label.js";
|
|
5
|
+
import { InputTag as $ } from "../../form-input-tag/index.js";
|
|
6
|
+
import G from "../icon-hover/index.vue.js";
|
|
7
|
+
import J from "../../../icons/default/down.js";
|
|
8
|
+
import Q from "../../../icons/animation/animation-loading.js";
|
|
9
|
+
import U from "../../../icons/default/close.js";
|
|
10
|
+
import W from "../../../icons/default/search.js";
|
|
11
|
+
import { useFormItem as X, useFormItemControl as Y } from "../../../_hooks/use-form-item.js";
|
|
12
|
+
import { useLocale as Z } from "../../../locale/index.js";
|
|
13
|
+
import { useSize as ee } from "../../../_hooks/use-size.js";
|
|
14
|
+
import { getClassNameMixin as le } from "../../../_utils/config.js";
|
|
15
15
|
const be = /* @__PURE__ */ E({
|
|
16
16
|
name: "SelectView",
|
|
17
17
|
props: {
|
|
@@ -52,13 +52,18 @@ const be = /* @__PURE__ */ E({
|
|
|
52
52
|
type: Boolean,
|
|
53
53
|
default: !1
|
|
54
54
|
},
|
|
55
|
+
// private: 缺失选项可不回显标签,但原始选中值仍可清空。
|
|
56
|
+
clearable: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: void 0
|
|
59
|
+
},
|
|
55
60
|
allowCreate: {
|
|
56
61
|
type: Boolean,
|
|
57
62
|
default: !1
|
|
58
63
|
},
|
|
59
64
|
allowSearch: {
|
|
60
65
|
type: Boolean,
|
|
61
|
-
default: (e) =>
|
|
66
|
+
default: (e) => q(e.modelValue)
|
|
62
67
|
},
|
|
63
68
|
maxTagCount: {
|
|
64
69
|
type: Number,
|
|
@@ -87,120 +92,126 @@ const be = /* @__PURE__ */ E({
|
|
|
87
92
|
slots: n
|
|
88
93
|
}) {
|
|
89
94
|
const {
|
|
90
|
-
size:
|
|
91
|
-
disabled:
|
|
92
|
-
error:
|
|
93
|
-
} = H(e), u =
|
|
94
|
-
formItemCtx:
|
|
95
|
-
feedback:
|
|
95
|
+
size: F,
|
|
96
|
+
disabled: R,
|
|
97
|
+
error: k
|
|
98
|
+
} = H(e), u = le("select--view"), {
|
|
99
|
+
formItemCtx: z,
|
|
100
|
+
feedback: g,
|
|
96
101
|
eventHandlers: c,
|
|
97
|
-
mergedDisabled:
|
|
98
|
-
mergedSize:
|
|
99
|
-
mergedError:
|
|
100
|
-
} =
|
|
101
|
-
size:
|
|
102
|
-
disabled:
|
|
103
|
-
error:
|
|
104
|
-
}),
|
|
105
|
-
t:
|
|
106
|
-
} =
|
|
102
|
+
mergedDisabled: f,
|
|
103
|
+
mergedSize: A,
|
|
104
|
+
mergedError: v
|
|
105
|
+
} = X({
|
|
106
|
+
size: F,
|
|
107
|
+
disabled: R,
|
|
108
|
+
error: k
|
|
109
|
+
}), b = Y(z, () => e.inputAttrs ?? {}), {
|
|
110
|
+
t: N
|
|
111
|
+
} = Z(), {
|
|
107
112
|
mergedSize: h
|
|
108
|
-
} =
|
|
113
|
+
} = ee(A), d = S(!1), m = S(), w = i(
|
|
109
114
|
// @ts-ignore
|
|
110
115
|
() => {
|
|
111
116
|
var l;
|
|
112
|
-
return (l =
|
|
117
|
+
return (l = m.value) == null ? void 0 : l.inputRef;
|
|
113
118
|
}
|
|
114
|
-
),
|
|
119
|
+
), T = i(() => e.modelValue.length === 0), D = i(() => e.allowSearch || e.allowCreate), C = i(() => e.allowClear && !f.value && !e.loading && (e.clearable ?? (!T.value && e.modelValue.some((l) => l.closable !== !1)))), s = (l) => {
|
|
115
120
|
var a, t;
|
|
116
121
|
d.value = !0, r("focus", l), (t = (a = c.value) == null ? void 0 : a.onFocus) == null || t.call(a, l);
|
|
117
|
-
},
|
|
122
|
+
}, p = (l) => {
|
|
118
123
|
var a, t;
|
|
119
124
|
d.value = !1, r("blur", l), (t = (a = c.value) == null ? void 0 : a.onBlur) == null || t.call(a, l);
|
|
120
|
-
},
|
|
125
|
+
}, j = (l) => {
|
|
121
126
|
r("remove", String(l));
|
|
122
127
|
}, K = (l) => {
|
|
123
|
-
l.stopPropagation(), r("clear", l)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
},
|
|
128
|
+
l.stopPropagation(), C.value && (r("clear", l), P(() => {
|
|
129
|
+
var a;
|
|
130
|
+
return (a = w.value) == null ? void 0 : a.focus();
|
|
131
|
+
}));
|
|
132
|
+
}, V = (l, a) => {
|
|
133
|
+
var t, x;
|
|
134
|
+
r("inputValueChange", l, a), (x = (t = c.value) == null ? void 0 : t.onInput) == null || x.call(t, a);
|
|
135
|
+
}, y = (l) => {
|
|
128
136
|
r("keydown", l);
|
|
129
137
|
}, L = () => {
|
|
130
138
|
var l, a;
|
|
131
|
-
return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(
|
|
139
|
+
return e.loading ? ((l = n["loading-icon"]) == null ? void 0 : l.call(n)) ?? o(Q, null, null) : e.allowSearch && e.opened ? ((a = n["search-icon"]) == null ? void 0 : a.call(n)) ?? o(W, null, null) : n["arrow-icon"] ? n["arrow-icon"]() : o(J, {
|
|
132
140
|
class: u.element("arrow-icon")
|
|
133
141
|
}, null);
|
|
134
|
-
},
|
|
142
|
+
}, I = () => o(M, null, [C.value ? o(G, {
|
|
135
143
|
as: "button",
|
|
136
|
-
"aria-label":
|
|
144
|
+
"aria-label": N("common.clearTarget", {
|
|
137
145
|
target: "选择"
|
|
138
146
|
}),
|
|
139
147
|
class: u.element("clear-btn"),
|
|
140
148
|
onClick: K,
|
|
141
|
-
onMousedown: (l) =>
|
|
149
|
+
onMousedown: (l) => {
|
|
150
|
+
l.preventDefault(), l.stopPropagation();
|
|
151
|
+
}
|
|
142
152
|
}, {
|
|
143
|
-
default: () => [o(
|
|
144
|
-
})
|
|
145
|
-
class: u.element("icon")
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
153
|
+
default: () => [o(U, null, null)]
|
|
154
|
+
}) : o("span", {
|
|
155
|
+
class: u.element("icon"),
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
}, [L()]), !!g.value && o(O, {
|
|
158
|
+
type: g.value
|
|
159
|
+
}, null)]), B = i(() => [u.modifier(`${e.multiple ? "multiple" : "single"}`), {
|
|
149
160
|
[u.modifier("opened")]: e.opened,
|
|
150
161
|
[u.modifier("borderless")]: !e.bordered
|
|
151
162
|
}]);
|
|
152
163
|
return {
|
|
153
|
-
inputRef:
|
|
154
|
-
handleFocus:
|
|
155
|
-
handleBlur:
|
|
156
|
-
render: () => e.multiple ? o(
|
|
157
|
-
ref:
|
|
164
|
+
inputRef: w,
|
|
165
|
+
handleFocus: s,
|
|
166
|
+
handleBlur: p,
|
|
167
|
+
render: () => e.multiple ? o($, {
|
|
168
|
+
ref: m,
|
|
158
169
|
baseCls: u.block,
|
|
159
|
-
class:
|
|
170
|
+
class: B.value,
|
|
160
171
|
modelValue: e.modelValue,
|
|
161
172
|
inputValue: e.inputValue,
|
|
162
173
|
focused: e.opened || d.value,
|
|
163
174
|
placeholder: e.placeholder,
|
|
164
|
-
disabled:
|
|
175
|
+
disabled: f.value,
|
|
165
176
|
size: h.value,
|
|
166
|
-
error:
|
|
177
|
+
error: v.value,
|
|
167
178
|
maxTagCount: e.maxTagCount,
|
|
168
179
|
disabledInput: !e.allowSearch && !e.allowCreate,
|
|
169
180
|
tagNowrap: e.tagNowrap,
|
|
170
181
|
retainInputValue: !0,
|
|
171
|
-
inputAttrs:
|
|
182
|
+
inputAttrs: b.value,
|
|
172
183
|
uninjectFormItemContext: !0,
|
|
173
|
-
onRemove:
|
|
174
|
-
onInputValueChange:
|
|
175
|
-
onKeydown:
|
|
176
|
-
onFocus:
|
|
177
|
-
onBlur:
|
|
184
|
+
onRemove: j,
|
|
185
|
+
onInputValueChange: V,
|
|
186
|
+
onKeydown: y,
|
|
187
|
+
onFocus: s,
|
|
188
|
+
onBlur: p
|
|
178
189
|
}, {
|
|
179
190
|
prefix: n.prefix,
|
|
180
|
-
suffix:
|
|
191
|
+
suffix: I,
|
|
181
192
|
tag: n.label
|
|
182
|
-
}) : o(
|
|
183
|
-
ref:
|
|
193
|
+
}) : o(_, {
|
|
194
|
+
ref: m,
|
|
184
195
|
baseCls: u.block,
|
|
185
|
-
class:
|
|
196
|
+
class: B.value,
|
|
186
197
|
modelValue: e.modelValue[0],
|
|
187
198
|
inputValue: e.inputValue,
|
|
188
199
|
focused: e.opened || d.value,
|
|
189
200
|
placeholder: e.placeholder,
|
|
190
|
-
disabled:
|
|
201
|
+
disabled: f.value,
|
|
191
202
|
size: h.value,
|
|
192
|
-
error:
|
|
193
|
-
enabledInput:
|
|
194
|
-
inputAttrs:
|
|
203
|
+
error: v.value,
|
|
204
|
+
enabledInput: D.value,
|
|
205
|
+
inputAttrs: b.value,
|
|
195
206
|
uninjectFormItemContext: !0,
|
|
196
|
-
onInputValueChange:
|
|
197
|
-
onKeydown:
|
|
198
|
-
onFocus:
|
|
199
|
-
onBlur:
|
|
207
|
+
onInputValueChange: V,
|
|
208
|
+
onKeydown: y,
|
|
209
|
+
onFocus: s,
|
|
210
|
+
onBlur: p
|
|
200
211
|
}, {
|
|
201
212
|
default: n.label,
|
|
202
213
|
prefix: n.prefix,
|
|
203
|
-
suffix:
|
|
214
|
+
suffix: I
|
|
204
215
|
})
|
|
205
216
|
};
|
|
206
217
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as O, getCurrentInstance as P, inject as
|
|
2
|
-
import { getClassNameMixin as
|
|
1
|
+
import { defineComponent as O, getCurrentInstance as P, inject as x, reactive as F, computed as t, withDirectives as T, createVNode as u, resolveDirective as L } from "vue";
|
|
2
|
+
import { getClassNameMixin as p } from "../../_utils/config.js";
|
|
3
3
|
import { buttonProps as A } from "./props.js";
|
|
4
4
|
import B from "../../icons/animation/animation-loading.js";
|
|
5
5
|
import I from "../../directives/wave.js";
|
|
@@ -18,51 +18,51 @@ const H = /* @__PURE__ */ O({
|
|
|
18
18
|
slots: l,
|
|
19
19
|
emit: h
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
21
|
+
const s = P(), a = x(K, void 0), {
|
|
22
22
|
mergedSize: k
|
|
23
23
|
} = N(void 0, {
|
|
24
24
|
defaultValue: "medium"
|
|
25
|
-
}), r =
|
|
25
|
+
}), r = F({
|
|
26
26
|
clicked: !1,
|
|
27
27
|
isDebounce: !1
|
|
28
|
-
}), i =
|
|
29
|
-
const d = (
|
|
28
|
+
}), i = p("button"), w = (n) => n.replace(/[A-Z]/g, (d) => `-${d.toLowerCase()}`), o = (n) => {
|
|
29
|
+
const d = (s == null ? void 0 : s.vnode.props) ?? {};
|
|
30
30
|
return Object.prototype.hasOwnProperty.call(d, n) || Object.prototype.hasOwnProperty.call(d, w(n));
|
|
31
|
-
},
|
|
31
|
+
}, m = t(() => o("type") ? e.type : (a == null ? void 0 : a.type) ?? e.type), v = t(() => o("size") ? e.size : (a == null ? void 0 : a.size) ?? k.value), b = t(() => o("status") ? e.status : (a == null ? void 0 : a.status) ?? e.status), g = t(() => o("shape") ? e.shape : (a == null ? void 0 : a.shape) ?? e.shape), f = t(() => o("disabled") ? e.disabled : (a == null ? void 0 : a.disabled) ?? e.disabled), D = t(() => [i.block, m.value && m.value !== "default" && i.modifier(m.value), v.value && i.modifier(v.value), b.value && i.modifier(b.value), f.value && i.is("disabled"), e.block && i.modifier("block"), e.plain && i.modifier("plain"), g.value && i.modifier(g.value), e.link && i.modifier("link"), !e.border && i.modifier("hide-border"), c.value && i.modifier("loading"), e.loadingFill && i.modifier("loading-fill"), e.narrow && i.modifier("narrow")]), z = () => {
|
|
32
32
|
e.debounce > 0 && !r.isDebounce && (r.isDebounce = !0, setTimeout(() => {
|
|
33
33
|
r.isDebounce = !1;
|
|
34
34
|
}, e.debounce));
|
|
35
|
-
},
|
|
35
|
+
}, c = t(() => e.loading || r.clicked || r.isDebounce), S = t(() => f.value || c.value || e.link || m.value === "text"), j = (n) => {
|
|
36
36
|
var d;
|
|
37
|
-
n.detail > 0 && ((d = n.currentTarget) == null || d.blur()), !(
|
|
37
|
+
n.detail > 0 && ((d = n.currentTarget) == null || d.blur()), !(f.value || c.value) && (z(), h("click", n));
|
|
38
38
|
};
|
|
39
39
|
return () => {
|
|
40
40
|
var n, d, y;
|
|
41
|
-
return T(
|
|
41
|
+
return T(u("button", {
|
|
42
42
|
class: D.value,
|
|
43
43
|
type: e.htmlType,
|
|
44
|
-
disabled:
|
|
45
|
-
"aria-busy":
|
|
44
|
+
disabled: f.value || c.value,
|
|
45
|
+
"aria-busy": c.value || void 0,
|
|
46
46
|
onClick: j
|
|
47
|
-
}, [
|
|
47
|
+
}, [u("span", {
|
|
48
48
|
class: i.element("loading"),
|
|
49
|
+
"aria-hidden": "true",
|
|
49
50
|
style: {
|
|
50
51
|
display: "flex",
|
|
51
|
-
opacity:
|
|
52
|
-
width:
|
|
53
|
-
marginRight:
|
|
54
|
-
overflow: "hidden"
|
|
55
|
-
transition: "all 0.3s ease"
|
|
52
|
+
opacity: c.value ? 1 : 0,
|
|
53
|
+
width: e.loadingFill ? void 0 : c.value ? "1em" : 0,
|
|
54
|
+
marginRight: c.value && !e.loadingFill ? "4px" : "0",
|
|
55
|
+
overflow: "hidden"
|
|
56
56
|
}
|
|
57
|
-
}, [
|
|
57
|
+
}, [c.value && u(B, null, null)]), !!l.prefix && u("span", {
|
|
58
58
|
class: i.element("prefix")
|
|
59
|
-
}, [(n = l.prefix) == null ? void 0 : n.call(l)]), l.icon &&
|
|
59
|
+
}, [(n = l.prefix) == null ? void 0 : n.call(l)]), l.icon && u("span", {
|
|
60
60
|
class: i.element("prefix")
|
|
61
|
-
}, [(d = l.icon) == null ? void 0 : d.call(l)]),
|
|
61
|
+
}, [(d = l.icon) == null ? void 0 : d.call(l)]), u("span", {
|
|
62
62
|
class: i.element("content")
|
|
63
|
-
}, [(y = l.default) == null ? void 0 : y.call(l)]), l.suffix &&
|
|
63
|
+
}, [(y = l.default) == null ? void 0 : y.call(l)]), l.suffix && u("span", {
|
|
64
64
|
class: i.element("suffix")
|
|
65
|
-
}, [l.suffix()])]), [[
|
|
65
|
+
}, [l.suffix()])]), [[L("wave"), {
|
|
66
66
|
disabled: S.value
|
|
67
67
|
}]]);
|
|
68
68
|
};
|
|
@@ -343,7 +343,7 @@ const Pe = {
|
|
|
343
343
|
return e;
|
|
344
344
|
return -1;
|
|
345
345
|
}, se = (e) => {
|
|
346
|
-
if (b.value || a.readonly)
|
|
346
|
+
if (b.value || a.readonly || e.isComposing || e.keyCode === 229)
|
|
347
347
|
return;
|
|
348
348
|
const t = e.key || e.code;
|
|
349
349
|
if (!p.value && o.value && t === Ve.key && ne(e), !p.value && I.value.length > 0 && !o.value && t === Ie.key) {
|