x-next 1.17.0 → 1.18.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/catalog.md +1 -1
- package/AI_USAGE/components/alert-api.md +1 -1
- package/AI_USAGE/components/alert.md +33 -1
- package/AI_USAGE/components/bar-chart-api.md +1 -1
- package/AI_USAGE/components/bar-chart.md +1 -1
- package/AI_USAGE/components/boxicons.md +1 -1
- package/AI_USAGE/components/button-api.md +13 -16
- package/AI_USAGE/components/button.md +245 -34
- package/AI_USAGE/components/charts.md +1 -1
- package/AI_USAGE/components/checkbox-api.md +1 -1
- package/AI_USAGE/components/checkbox.md +1 -1
- package/AI_USAGE/components/color-picker-api.md +1 -1
- package/AI_USAGE/components/color-picker.md +1 -1
- package/AI_USAGE/components/config-provider-api.md +1 -1
- package/AI_USAGE/components/config-provider.md +1 -1
- package/AI_USAGE/components/date-picker-api.md +44 -26
- package/AI_USAGE/components/date-picker.md +78 -3
- package/AI_USAGE/components/dialog-api.md +2 -2
- package/AI_USAGE/components/dialog.md +5 -1
- package/AI_USAGE/components/draggable-api.md +1 -1
- package/AI_USAGE/components/draggable.md +1 -1
- package/AI_USAGE/components/drawer-api.md +3 -3
- package/AI_USAGE/components/drawer.md +1 -1
- package/AI_USAGE/components/dropdown-api.md +8 -3
- package/AI_USAGE/components/dropdown.md +2 -2
- package/AI_USAGE/components/empty-api.md +1 -1
- package/AI_USAGE/components/empty.md +1 -1
- package/AI_USAGE/components/finicon.md +1 -1
- package/AI_USAGE/components/form-api.md +1 -1
- package/AI_USAGE/components/form.md +1 -1
- package/AI_USAGE/components/grid-api.md +1 -1
- package/AI_USAGE/components/grid.md +1 -1
- package/AI_USAGE/components/heatmap-api.md +1 -1
- package/AI_USAGE/components/heatmap.md +1 -1
- package/AI_USAGE/components/icon-api.md +1 -1
- package/AI_USAGE/components/icon.md +1 -1
- package/AI_USAGE/components/image-api.md +1 -1
- package/AI_USAGE/components/image.md +1 -1
- package/AI_USAGE/components/input-api.md +2 -2
- package/AI_USAGE/components/input-number-api.md +1 -1
- package/AI_USAGE/components/input-number.md +1 -1
- package/AI_USAGE/components/input-tag-api.md +1 -1
- package/AI_USAGE/components/input-tag.md +1 -1
- package/AI_USAGE/components/input.md +1 -1
- package/AI_USAGE/components/layout-api.md +1 -1
- package/AI_USAGE/components/layout.md +1 -1
- package/AI_USAGE/components/line-chart-api.md +1 -1
- package/AI_USAGE/components/line-chart.md +1 -1
- package/AI_USAGE/components/link-api.md +1 -1
- package/AI_USAGE/components/link.md +1 -1
- package/AI_USAGE/components/menu-api.md +1 -1
- package/AI_USAGE/components/menu.md +1 -1
- package/AI_USAGE/components/message-api.md +1 -1
- package/AI_USAGE/components/message-box-api.md +1 -1
- package/AI_USAGE/components/message-box.md +1 -1
- package/AI_USAGE/components/message.md +1 -1
- package/AI_USAGE/components/network-api.md +1 -1
- package/AI_USAGE/components/network.md +1 -1
- package/AI_USAGE/components/notification-api.md +1 -1
- package/AI_USAGE/components/notification.md +1 -1
- package/AI_USAGE/components/pagination-api.md +1 -1
- package/AI_USAGE/components/pagination.md +1 -1
- package/AI_USAGE/components/pie-chart-api.md +1 -1
- package/AI_USAGE/components/pie-chart.md +1 -1
- package/AI_USAGE/components/popconfirm-api.md +3 -3
- package/AI_USAGE/components/popconfirm.md +1 -1
- package/AI_USAGE/components/popover-api.md +1 -1
- package/AI_USAGE/components/popover.md +3 -1
- package/AI_USAGE/components/popup-api.md +1 -1
- package/AI_USAGE/components/popup.md +1 -1
- package/AI_USAGE/components/progress-api.md +1 -1
- package/AI_USAGE/components/progress.md +1 -1
- package/AI_USAGE/components/radio-api.md +1 -1
- package/AI_USAGE/components/radio.md +1 -1
- package/AI_USAGE/components/rate-api.md +1 -1
- package/AI_USAGE/components/rate.md +1 -1
- package/AI_USAGE/components/resize-box-api.md +1 -1
- package/AI_USAGE/components/resize-box.md +1 -1
- package/AI_USAGE/components/scrollbar-api.md +1 -1
- package/AI_USAGE/components/scrollbar.md +1 -1
- package/AI_USAGE/components/select-api.md +1 -1
- package/AI_USAGE/components/select.md +1 -1
- package/AI_USAGE/components/skeleton-api.md +1 -1
- package/AI_USAGE/components/skeleton.md +1 -1
- package/AI_USAGE/components/slider-api.md +1 -1
- package/AI_USAGE/components/slider.md +1 -1
- package/AI_USAGE/components/space-api.md +1 -1
- package/AI_USAGE/components/space.md +1 -1
- package/AI_USAGE/components/spin-api.md +1 -1
- package/AI_USAGE/components/spin.md +1 -1
- package/AI_USAGE/components/steps-api.md +1 -1
- package/AI_USAGE/components/steps.md +1 -1
- package/AI_USAGE/components/switch-api.md +1 -1
- package/AI_USAGE/components/switch.md +1 -1
- package/AI_USAGE/components/table-api.md +1 -1
- package/AI_USAGE/components/table.md +1 -1
- package/AI_USAGE/components/tabs-api.md +1 -1
- package/AI_USAGE/components/tabs.md +1 -1
- package/AI_USAGE/components/tag-api.md +1 -1
- package/AI_USAGE/components/tag.md +1 -1
- package/AI_USAGE/components/textarea-api.md +1 -1
- package/AI_USAGE/components/textarea.md +1 -1
- package/AI_USAGE/components/time-picker-api.md +1 -1
- package/AI_USAGE/components/time-picker.md +1 -1
- package/AI_USAGE/components/time-range-selector-api.md +1 -1
- package/AI_USAGE/components/time-range-selector.md +1 -1
- package/AI_USAGE/components/timeline-api.md +3 -3
- package/AI_USAGE/components/timeline.md +1 -1
- package/AI_USAGE/components/tooltip-api.md +1 -1
- package/AI_USAGE/components/tooltip.md +1 -1
- package/AI_USAGE/components/transfer-api.md +1 -1
- package/AI_USAGE/components/transfer.md +1 -1
- package/AI_USAGE/components/tree-select-api.md +1 -1
- package/AI_USAGE/components/tree-select.md +1 -1
- package/AI_USAGE/components/trend-chart-api.md +1 -1
- package/AI_USAGE/components/trend-chart.md +1 -1
- package/AI_USAGE/components/trigger-api.md +1 -1
- package/AI_USAGE/components/trigger.md +1 -1
- package/AI_USAGE/components/upload-api.md +1 -1
- package/AI_USAGE/components/upload.md +1 -1
- package/AI_USAGE/components/watermark-api.md +1 -1
- package/AI_USAGE/components/watermark.md +1 -1
- package/AI_USAGE/core.md +1 -1
- package/AI_USAGE/index.md +1 -1
- package/AI_USAGE/recipes/form-on-demand.md +1 -1
- package/AI_USAGE.md +432 -88
- package/CHANGELOG.md +36 -0
- package/dist/_container/render-function.d.ts +2 -2
- package/dist/_styles/palette-aliases.d.ts +1 -0
- package/dist/components/_components/picker/input-range.vue.d.ts +1 -1
- package/dist/components/button/Button.d.ts +0 -9
- package/dist/components/button/appearance.d.ts +7 -0
- package/dist/components/button/index.d.ts +0 -16
- package/dist/components/button/props.d.ts +2 -6
- package/dist/components/color-picker/panel.d.ts +0 -9
- package/dist/components/date-picker/DatePanel.vue.d.ts +10 -1
- package/dist/components/date-picker/DatePicker.vue.d.ts +22 -25
- package/dist/components/date-picker/index.d.ts +156 -84
- package/dist/components/date-picker/utils.d.ts +4 -4
- package/dist/components/drawer/index.d.ts +0 -30
- package/dist/components/drawer/src/Drawer.vue.d.ts +0 -15
- package/dist/components/dropdown/Dropdown.vue.d.ts +1 -0
- package/dist/components/dropdown/DropdownButton.vue.d.ts +1 -15
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +1 -0
- package/dist/components/dropdown/context.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +8 -30
- package/dist/components/dropdown/use-keyboard.d.ts +1 -0
- package/dist/components/menu/MenuItem.d.ts +2 -2
- package/dist/components/menu/context.d.ts +3 -3
- package/dist/components/menu/index.d.ts +6 -6
- package/dist/components/menu/sub-menu-pop.vue.d.ts +2 -2
- package/dist/components/popconfirm/src/popup.vue.d.ts +0 -15
- package/dist/components/time-picker/TimePanel.vue.d.ts +0 -15
- package/dist/components/time-picker/TimePicker.vue.d.ts +1 -16
- package/dist/components/time-picker/index.d.ts +2 -32
- package/dist/es/_styles/palette-aliases.js +102 -17
- package/dist/es/_utils/palette.js +54 -54
- package/dist/es/components/_components/picker/input-range.vue.js +12 -12
- package/dist/es/components/_components/picker/input-range.vue2.js +45 -45
- package/dist/es/components/_components/picker/input.vue2.js +24 -24
- package/dist/es/components/button/Button.js +77 -49
- package/dist/es/components/button/appearance.js +7 -0
- package/dist/es/components/button/props.js +0 -4
- package/dist/es/components/date-picker/DatePanel.vue.js +47 -47
- package/dist/es/components/date-picker/DatePanel.vue2.js +68 -59
- package/dist/es/components/date-picker/DatePicker.vue.js +65 -59
- package/dist/es/components/date-picker/DatePicker.vue2.js +387 -284
- package/dist/es/components/date-picker/index.js +57 -36
- package/dist/es/components/date-picker/utils.js +132 -122
- package/dist/es/components/dialog/Dialog.js +43 -40
- package/dist/es/components/dialog/props.js +1 -1
- package/dist/es/components/dropdown/Dropdown.vue2.js +66 -50
- package/dist/es/components/dropdown/dropdown-panel.vue2.js +48 -43
- package/dist/es/components/dropdown/use-keyboard.js +36 -28
- package/dist/es/components/popover/Popover.js +72 -32
- package/dist/es/directives/wave.js +14 -8
- package/dist/es/style.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.umd.js +3 -3
- package/dist/style/alert.css +1 -1
- package/dist/style/base.css +1 -1
- package/dist/style/button.css +1 -1
- package/dist/style/color-picker.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/dialog.css +1 -1
- package/dist/style/link.css +1 -1
- package/dist/style/message-box.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import v from "./input-range.vue2.js";
|
|
2
|
-
import { resolveComponent as a, openBlock as r, createElementBlock as
|
|
2
|
+
import { resolveComponent as a, openBlock as r, createElementBlock as u, mergeProps as d, normalizeClass as l, renderSlot as p, createCommentVNode as i, createElementVNode as s, withKeys as t, createTextVNode as k, createBlock as m, withCtx as I, createVNode as b } from "vue";
|
|
3
3
|
import g from "../../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const N = ["disabled", "placeholder", "value", "readonly"],
|
|
5
|
-
function
|
|
4
|
+
const N = ["disabled", "placeholder", "value", "readonly"], B = ["disabled", "placeholder", "value", "readonly"];
|
|
5
|
+
function F(e, o, $, w, E, V) {
|
|
6
6
|
const f = a("IconClose"), C = a("IconHover"), y = a("FeedbackIcon");
|
|
7
|
-
return r(),
|
|
8
|
-
e.$slots.prefix ? (r(),
|
|
7
|
+
return r(), u("div", d(e.wrapperAttrs, { class: e.classNames }), [
|
|
8
|
+
e.$slots.prefix ? (r(), u("div", {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: l(e.className.element("prefix"))
|
|
11
11
|
}, [
|
|
12
12
|
p(e.$slots, "prefix")
|
|
13
|
-
], 2)) :
|
|
13
|
+
], 2)) : i("", !0),
|
|
14
14
|
s("div", {
|
|
15
15
|
class: l(e.getInputWrapClassName(0))
|
|
16
16
|
}, [
|
|
@@ -20,7 +20,7 @@ function B(e, o, $, w, E, V) {
|
|
|
20
20
|
value: e.displayValue0,
|
|
21
21
|
readonly: e.readonly || void 0,
|
|
22
22
|
onInput: o[0] || (o[0] = (...n) => e.onChange && e.onChange(...n)),
|
|
23
|
-
onFocus: o[1] || (o[1] = (
|
|
23
|
+
onFocus: o[1] || (o[1] = (n) => e.onFocus(n, 0)),
|
|
24
24
|
onBlur: o[2] || (o[2] = (...n) => e.onBlur && e.onBlur(...n)),
|
|
25
25
|
onKeydown: o[3] || (o[3] = t((...n) => e.onPressEnter && e.onPressEnter(...n), ["enter"])),
|
|
26
26
|
onClick: o[4] || (o[4] = () => e.changeFocusedInput(0))
|
|
@@ -42,11 +42,11 @@ function B(e, o, $, w, E, V) {
|
|
|
42
42
|
value: e.displayValue1,
|
|
43
43
|
readonly: e.readonly || void 0,
|
|
44
44
|
onInput: o[5] || (o[5] = (...n) => e.onChange && e.onChange(...n)),
|
|
45
|
-
onFocus: o[6] || (o[6] = (
|
|
45
|
+
onFocus: o[6] || (o[6] = (n) => e.onFocus(n, 1)),
|
|
46
46
|
onBlur: o[7] || (o[7] = (...n) => e.onBlur && e.onBlur(...n)),
|
|
47
47
|
onKeydown: o[8] || (o[8] = t((...n) => e.onPressEnter && e.onPressEnter(...n), ["enter"])),
|
|
48
48
|
onClick: o[9] || (o[9] = () => e.changeFocusedInput(1))
|
|
49
|
-
}), null, 16,
|
|
49
|
+
}), null, 16, B)
|
|
50
50
|
], 2),
|
|
51
51
|
s("div", {
|
|
52
52
|
class: l(e.className.element("suffix"))
|
|
@@ -63,7 +63,7 @@ function B(e, o, $, w, E, V) {
|
|
|
63
63
|
b(f)
|
|
64
64
|
]),
|
|
65
65
|
_: 1
|
|
66
|
-
}, 8, ["aria-label", "class", "onClick"])) :
|
|
66
|
+
}, 8, ["aria-label", "class", "onClick"])) : i("", !0),
|
|
67
67
|
s("span", {
|
|
68
68
|
class: l(e.className.element("suffix-icon"))
|
|
69
69
|
}, [
|
|
@@ -72,11 +72,11 @@ function B(e, o, $, w, E, V) {
|
|
|
72
72
|
e.feedback ? (r(), m(y, {
|
|
73
73
|
key: 1,
|
|
74
74
|
type: e.feedback
|
|
75
|
-
}, null, 8, ["type"])) :
|
|
75
|
+
}, null, 8, ["type"])) : i("", !0)
|
|
76
76
|
], 2)
|
|
77
77
|
], 16);
|
|
78
78
|
}
|
|
79
|
-
const T = /* @__PURE__ */ g(v, [["render",
|
|
79
|
+
const T = /* @__PURE__ */ g(v, [["render", F]]);
|
|
80
80
|
export {
|
|
81
81
|
T as default
|
|
82
82
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as J, toRefs as Q, computed as
|
|
1
|
+
import { defineComponent as J, toRefs as Q, computed as s, ref as N } from "vue";
|
|
2
2
|
import X from "../feedback-icon/index.vue.js";
|
|
3
3
|
import { isNumber as Y, isUndefined as Z, isArray as ee, isDayjs as re, isFunction as oe } from "../../../_utils/is.js";
|
|
4
4
|
import te from "../../../icons/default/close.js";
|
|
5
5
|
import ae from "../icon-hover/index.vue.js";
|
|
6
|
-
import { useFormItem as ne, useFormItemControl as
|
|
6
|
+
import { useFormItem as ne, useFormItemControl as S } from "../../../_hooks/use-form-item.js";
|
|
7
7
|
import { useLocale as ie } from "../../../locale/index.js";
|
|
8
8
|
import { useSize as se } from "../../../_hooks/use-size.js";
|
|
9
|
-
import { INPUT_EVENTS as
|
|
9
|
+
import { INPUT_EVENTS as z } from "../../../_utils/constant.js";
|
|
10
10
|
import le from "../../../_utils/pick.js";
|
|
11
11
|
import { omit as ue } from "../../../_utils/omit.js";
|
|
12
12
|
import { getClassNameMixin as ce } from "../../../_utils/config.js";
|
|
@@ -73,12 +73,12 @@ const xe = J({
|
|
|
73
73
|
"focus",
|
|
74
74
|
"blur"
|
|
75
75
|
],
|
|
76
|
-
setup(a, { emit: r, slots:
|
|
77
|
-
const { t:
|
|
78
|
-
error:
|
|
79
|
-
focused:
|
|
76
|
+
setup(a, { emit: r, slots: l, attrs: o }) {
|
|
77
|
+
const { t: E } = ie(), {
|
|
78
|
+
error: F,
|
|
79
|
+
focused: B,
|
|
80
80
|
disabled: u,
|
|
81
|
-
size:
|
|
81
|
+
size: D,
|
|
82
82
|
value: c,
|
|
83
83
|
format: f,
|
|
84
84
|
focusedIndex: d,
|
|
@@ -86,43 +86,43 @@ const xe = J({
|
|
|
86
86
|
placeholder: g
|
|
87
87
|
} = Q(a), {
|
|
88
88
|
formItemCtx: b,
|
|
89
|
-
mergedSize:
|
|
89
|
+
mergedSize: $,
|
|
90
90
|
mergedDisabled: m,
|
|
91
|
-
mergedError:
|
|
92
|
-
feedback:
|
|
93
|
-
} = ne({ size:
|
|
94
|
-
...
|
|
91
|
+
mergedError: j,
|
|
92
|
+
feedback: k
|
|
93
|
+
} = ne({ size: D, error: F }), { mergedSize: _ } = se($), O = s(() => ue(o, [
|
|
94
|
+
...z,
|
|
95
95
|
...Object.keys(o).filter((e) => e.startsWith("aria-") || e === "role")
|
|
96
96
|
])), v = () => ({
|
|
97
|
-
...le(o,
|
|
97
|
+
...le(o, z),
|
|
98
98
|
...Object.fromEntries(
|
|
99
99
|
Object.entries(o).filter(([e]) => e.startsWith("aria-") || e === "role")
|
|
100
100
|
)
|
|
101
|
-
}),
|
|
101
|
+
}), P = S(b, () => {
|
|
102
102
|
var e;
|
|
103
103
|
return {
|
|
104
104
|
...v(),
|
|
105
105
|
"aria-label": o["aria-label"] ? `${o["aria-label"]} ${((e = g.value) == null ? void 0 : e[0]) ?? ""}` : void 0
|
|
106
106
|
};
|
|
107
|
-
}),
|
|
107
|
+
}), R = S(b, () => {
|
|
108
108
|
var e;
|
|
109
109
|
return {
|
|
110
110
|
...v(),
|
|
111
111
|
id: o.id ? `${o.id}-end` : void 0,
|
|
112
112
|
"aria-label": o["aria-label"] ? `${o["aria-label"]} ${((e = g.value) == null ? void 0 : e[1]) ?? ""}` : void 0
|
|
113
113
|
};
|
|
114
|
-
}),
|
|
114
|
+
}), T = N(), V = N(), p = (e) => m.value ? m.value : ee(u.value) ? u.value[e] : u.value, y = s(() => p(0)), I = s(() => p(1)), t = ce("picker"), W = s(() => [
|
|
115
115
|
t.block,
|
|
116
116
|
t.modifier("range"),
|
|
117
|
-
t.modifier(`size-${
|
|
117
|
+
t.modifier(`size-${_.value}`),
|
|
118
118
|
{
|
|
119
|
-
[t.modifier("focused")]:
|
|
119
|
+
[t.modifier("focused")]: B.value,
|
|
120
120
|
[t.modifier("disabled")]: y.value && I.value,
|
|
121
|
-
[t.modifier("error")]:
|
|
122
|
-
[t.modifier("has-prefix")]:
|
|
121
|
+
[t.modifier("error")]: j.value,
|
|
122
|
+
[t.modifier("has-prefix")]: l.prefix
|
|
123
123
|
}
|
|
124
124
|
]);
|
|
125
|
-
function
|
|
125
|
+
function w(e) {
|
|
126
126
|
return [
|
|
127
127
|
t.element("input"),
|
|
128
128
|
{
|
|
@@ -131,15 +131,15 @@ const xe = J({
|
|
|
131
131
|
];
|
|
132
132
|
}
|
|
133
133
|
function h(e) {
|
|
134
|
-
var
|
|
134
|
+
var A, x;
|
|
135
135
|
if (n != null && n.value)
|
|
136
|
-
return (
|
|
137
|
-
const
|
|
138
|
-
if (
|
|
139
|
-
return oe(f.value) ? f.value(
|
|
136
|
+
return (A = n == null ? void 0 : n.value) == null ? void 0 : A[e];
|
|
137
|
+
const i = (x = c == null ? void 0 : c.value) == null ? void 0 : x[e];
|
|
138
|
+
if (i && re(i))
|
|
139
|
+
return oe(f.value) ? f.value(i) : i.format(f.value);
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
function
|
|
141
|
+
const U = s(() => h(0)), q = s(() => h(1));
|
|
142
|
+
function C(e) {
|
|
143
143
|
r("focused-index-change", e), r("update:focusedIndex", e);
|
|
144
144
|
}
|
|
145
145
|
function H(e) {
|
|
@@ -148,8 +148,8 @@ const xe = J({
|
|
|
148
148
|
function K() {
|
|
149
149
|
r("press-enter");
|
|
150
150
|
}
|
|
151
|
-
function L(e) {
|
|
152
|
-
r("focus", e);
|
|
151
|
+
function L(e, i) {
|
|
152
|
+
C(i), r("focus", e);
|
|
153
153
|
}
|
|
154
154
|
function M(e) {
|
|
155
155
|
r("blur", e);
|
|
@@ -158,34 +158,34 @@ const xe = J({
|
|
|
158
158
|
r("clear", e);
|
|
159
159
|
}
|
|
160
160
|
return {
|
|
161
|
-
wrapperAttrs:
|
|
162
|
-
formControlAttrs0:
|
|
163
|
-
formControlAttrs1:
|
|
164
|
-
t:
|
|
161
|
+
wrapperAttrs: O,
|
|
162
|
+
formControlAttrs0: P,
|
|
163
|
+
formControlAttrs1: R,
|
|
164
|
+
t: E,
|
|
165
165
|
className: t,
|
|
166
|
-
classNames:
|
|
167
|
-
refInput0:
|
|
168
|
-
refInput1:
|
|
166
|
+
classNames: W,
|
|
167
|
+
refInput0: T,
|
|
168
|
+
refInput1: V,
|
|
169
169
|
disabled0: y,
|
|
170
170
|
disabled1: I,
|
|
171
171
|
mergedDisabled: m,
|
|
172
172
|
getDisabled: p,
|
|
173
|
-
getInputWrapClassName:
|
|
174
|
-
displayValue0:
|
|
175
|
-
displayValue1:
|
|
176
|
-
changeFocusedInput:
|
|
173
|
+
getInputWrapClassName: w,
|
|
174
|
+
displayValue0: U,
|
|
175
|
+
displayValue1: q,
|
|
176
|
+
changeFocusedInput: C,
|
|
177
177
|
onChange: H,
|
|
178
178
|
onFocus: L,
|
|
179
179
|
onBlur: M,
|
|
180
180
|
onPressEnter: K,
|
|
181
181
|
onClear: G,
|
|
182
|
-
feedback:
|
|
182
|
+
feedback: k
|
|
183
183
|
};
|
|
184
184
|
},
|
|
185
185
|
methods: {
|
|
186
186
|
focus(a) {
|
|
187
|
-
const r = Y(a) ? a : this.focusedIndex,
|
|
188
|
-
!Z(r) && !this.getDisabled(r) &&
|
|
187
|
+
const r = Y(a) ? a : this.focusedIndex, l = r === 0 ? this.refInput0 : this.refInput1;
|
|
188
|
+
!Z(r) && !this.getDisabled(r) && l && l.focus && l.focus();
|
|
189
189
|
},
|
|
190
190
|
blur() {
|
|
191
191
|
const a = this.focusedIndex === 0 ? this.refInput0 : this.refInput1;
|
|
@@ -5,18 +5,18 @@ import _ from "../icon-hover/index.vue.js";
|
|
|
5
5
|
import { useFormItem as D, useFormItemControl as T } from "../../../_hooks/use-form-item.js";
|
|
6
6
|
import { useLocale as w } from "../../../locale/index.js";
|
|
7
7
|
import { useSize as P } from "../../../_hooks/use-size.js";
|
|
8
|
-
import { INPUT_EVENTS as
|
|
9
|
-
import
|
|
10
|
-
import { omit as
|
|
11
|
-
import
|
|
12
|
-
import { getClassNameMixin as
|
|
8
|
+
import { INPUT_EVENTS as m } from "../../../_utils/constant.js";
|
|
9
|
+
import V from "../../../_utils/pick.js";
|
|
10
|
+
import { omit as W } from "../../../_utils/omit.js";
|
|
11
|
+
import q from "../feedback-icon/index.vue.js";
|
|
12
|
+
import { getClassNameMixin as H } from "../../../_utils/config.js";
|
|
13
13
|
const re = j({
|
|
14
14
|
name: "DateInput",
|
|
15
15
|
inheritAttrs: !1,
|
|
16
16
|
components: {
|
|
17
17
|
IconHover: _,
|
|
18
18
|
IconClose: O,
|
|
19
|
-
FeedbackIcon:
|
|
19
|
+
FeedbackIcon: q
|
|
20
20
|
},
|
|
21
21
|
props: {
|
|
22
22
|
size: {
|
|
@@ -59,32 +59,32 @@ const re = j({
|
|
|
59
59
|
}
|
|
60
60
|
},
|
|
61
61
|
emits: ["clear", "press-enter", "change", "focus", "blur"],
|
|
62
|
-
setup(
|
|
63
|
-
const { t: c } = w(), { error: p, focused: d, disabled:
|
|
62
|
+
setup(u, { emit: t, slots: f, attrs: s }) {
|
|
63
|
+
const { t: c } = w(), { error: p, focused: d, disabled: v, size: g, value: o, format: n, inputValue: i } = x(u), {
|
|
64
64
|
formItemCtx: b,
|
|
65
65
|
mergedSize: h,
|
|
66
|
-
mergedDisabled:
|
|
66
|
+
mergedDisabled: l,
|
|
67
67
|
mergedError: I,
|
|
68
68
|
feedback: y
|
|
69
|
-
} = D({ size:
|
|
70
|
-
...
|
|
71
|
-
...Object.keys(
|
|
69
|
+
} = D({ size: g, disabled: v, error: p }), { mergedSize: S } = P(h), C = a(() => W(s, [
|
|
70
|
+
...m,
|
|
71
|
+
...Object.keys(s).filter((e) => e.startsWith("aria-") || e === "role")
|
|
72
72
|
])), z = T(b, () => ({
|
|
73
|
-
...
|
|
73
|
+
...V(s, m),
|
|
74
74
|
...Object.fromEntries(
|
|
75
|
-
Object.entries(
|
|
75
|
+
Object.entries(s).filter(([e]) => e.startsWith("aria-") || e === "role")
|
|
76
76
|
)
|
|
77
|
-
})), r =
|
|
77
|
+
})), r = H("picker"), N = a(() => [
|
|
78
78
|
r.block,
|
|
79
79
|
r.modifier(`size-${S.value}`),
|
|
80
80
|
{
|
|
81
81
|
[r.modifier("focused")]: d.value,
|
|
82
|
-
[r.modifier("disabled")]:
|
|
82
|
+
[r.modifier("disabled")]: l.value,
|
|
83
83
|
[r.modifier("error")]: I.value,
|
|
84
|
-
[r.modifier("has-prefix")]:
|
|
84
|
+
[r.modifier("has-prefix")]: f.prefix
|
|
85
85
|
}
|
|
86
86
|
]), B = a(() => {
|
|
87
|
-
if (
|
|
87
|
+
if ((i == null ? void 0 : i.value) !== void 0) return i.value;
|
|
88
88
|
if (o != null && o.value && E(o.value))
|
|
89
89
|
return k(n.value) ? n.value(o.value) : o.value.format(n.value);
|
|
90
90
|
}), F = A();
|
|
@@ -96,22 +96,22 @@ const re = j({
|
|
|
96
96
|
className: r,
|
|
97
97
|
classNames: N,
|
|
98
98
|
displayValue: B,
|
|
99
|
-
mergedDisabled:
|
|
99
|
+
mergedDisabled: l,
|
|
100
100
|
refInput: F,
|
|
101
101
|
onPressEnter() {
|
|
102
|
-
|
|
102
|
+
t("press-enter");
|
|
103
103
|
},
|
|
104
104
|
onChange(e) {
|
|
105
|
-
|
|
105
|
+
t("change", e);
|
|
106
106
|
},
|
|
107
107
|
onFocus(e) {
|
|
108
|
-
|
|
108
|
+
t("focus", e);
|
|
109
109
|
},
|
|
110
110
|
onClear(e) {
|
|
111
|
-
|
|
111
|
+
t("clear", e);
|
|
112
112
|
},
|
|
113
113
|
onBlur(e) {
|
|
114
|
-
|
|
114
|
+
t("blur", e);
|
|
115
115
|
}
|
|
116
116
|
};
|
|
117
117
|
},
|
|
@@ -1,84 +1,112 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { getClassNameMixin as
|
|
3
|
-
import { buttonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { buttonGroupInjectionKey as
|
|
7
|
-
import { useSize as
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { defineComponent as M, getCurrentInstance as R, inject as U, reactive as Z, computed as c, onBeforeUnmount as q, withDirectives as H, createVNode as u, resolveDirective as J, isVNode as Q, Comment as W, Fragment as X, Text as Y } from "vue";
|
|
2
|
+
import { getClassNameMixin as _ } from "../../_utils/config.js";
|
|
3
|
+
import { buttonProps as G } from "./props.js";
|
|
4
|
+
import ee from "../../icons/animation/animation-loading.js";
|
|
5
|
+
import ie from "../../directives/wave.js";
|
|
6
|
+
import { buttonGroupInjectionKey as ae } from "./context.js";
|
|
7
|
+
import { useSize as te } from "../../_hooks/use-size.js";
|
|
8
|
+
import { resolveButtonAppearance as ne } from "./appearance.js";
|
|
9
|
+
const d = (e) => {
|
|
10
|
+
if (Array.isArray(e)) return e.some(d);
|
|
10
11
|
if (e == null || typeof e == "boolean") return !1;
|
|
11
12
|
if (typeof e == "string") return e.trim().length > 0;
|
|
12
|
-
if (
|
|
13
|
-
if (e.type ===
|
|
14
|
-
if (e.type ===
|
|
15
|
-
return
|
|
13
|
+
if (Q(e)) {
|
|
14
|
+
if (e.type === W) return !1;
|
|
15
|
+
if (e.type === X || e.type === Y)
|
|
16
|
+
return d(e.children);
|
|
16
17
|
}
|
|
17
18
|
return !0;
|
|
18
|
-
},
|
|
19
|
+
}, se = /* @__PURE__ */ M({
|
|
19
20
|
name: "Button",
|
|
20
|
-
props:
|
|
21
|
+
props: G,
|
|
21
22
|
// 显式导入插槽
|
|
22
23
|
slots: Object,
|
|
23
24
|
directives: {
|
|
24
|
-
wave:
|
|
25
|
+
wave: ie
|
|
25
26
|
},
|
|
26
27
|
emits: ["click"],
|
|
27
28
|
setup(e, {
|
|
28
|
-
slots:
|
|
29
|
-
emit:
|
|
29
|
+
slots: t,
|
|
30
|
+
emit: F
|
|
30
31
|
}) {
|
|
31
|
-
const
|
|
32
|
-
mergedSize:
|
|
33
|
-
} =
|
|
32
|
+
const b = R(), a = U(ae, void 0), {
|
|
33
|
+
mergedSize: L
|
|
34
|
+
} = te(void 0, {
|
|
34
35
|
defaultValue: "medium"
|
|
35
|
-
}),
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}), i =
|
|
39
|
-
const
|
|
40
|
-
return Object.prototype.hasOwnProperty.call(
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
|
|
36
|
+
}), o = Z({
|
|
37
|
+
isDebounce: !1,
|
|
38
|
+
nativeActivation: !1
|
|
39
|
+
}), i = _("button"), N = (n) => n.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`), f = (n) => {
|
|
40
|
+
const r = (b == null ? void 0 : b.vnode.props) ?? {};
|
|
41
|
+
return Object.prototype.hasOwnProperty.call(r, n) || Object.prototype.hasOwnProperty.call(r, N(n));
|
|
42
|
+
}, m = c(() => f("type") ? e.type : (a == null ? void 0 : a.type) ?? e.type), S = c(() => f("size") ? e.size : (a == null ? void 0 : a.size) ?? L.value), y = c(() => f("status") ? e.status : (a == null ? void 0 : a.status) ?? e.status), h = c(() => f("shape") ? e.shape : (a == null ? void 0 : a.shape) ?? e.shape), s = c(() => f("disabled") ? e.disabled : (a == null ? void 0 : a.disabled) ?? e.disabled), v = c(() => ne(m.value, y.value, e.plain)), V = c(() => [
|
|
43
|
+
i.block,
|
|
44
|
+
m.value && m.value !== "default" && i.modifier(m.value),
|
|
45
|
+
S.value && i.modifier(S.value),
|
|
46
|
+
// Keep legacy semantic classes, but use separate namespaces for style decisions.
|
|
47
|
+
y.value !== "primary" && i.modifier(y.value),
|
|
48
|
+
i.modifier(`appearance-${v.value.appearance}`),
|
|
49
|
+
i.modifier(`color-${v.value.color}`),
|
|
50
|
+
s.value && i.is("disabled"),
|
|
51
|
+
e.block && i.modifier("block"),
|
|
52
|
+
e.plain && i.modifier("plain"),
|
|
53
|
+
h.value && i.modifier(h.value),
|
|
54
|
+
e.border && ["default", "solid", "outline", "dashed"].includes(v.value.appearance) && i.modifier("has-border"),
|
|
55
|
+
!e.border && i.modifier("hide-border"),
|
|
56
|
+
l.value && i.modifier("loading"),
|
|
57
|
+
e.narrow && i.modifier("narrow")
|
|
58
|
+
]);
|
|
59
|
+
let k, p;
|
|
60
|
+
q(() => {
|
|
61
|
+
clearTimeout(k), clearTimeout(p);
|
|
62
|
+
});
|
|
63
|
+
const $ = () => {
|
|
64
|
+
e.debounce > 0 && !o.isDebounce && (o.isDebounce = !0, k = setTimeout(() => {
|
|
65
|
+
o.isDebounce = !1;
|
|
44
66
|
}, e.debounce));
|
|
45
|
-
}, l =
|
|
46
|
-
var
|
|
47
|
-
|
|
67
|
+
}, l = c(() => e.loading || o.isDebounce), K = c(() => s.value || l.value || v.value.appearance === "text"), C = (n) => {
|
|
68
|
+
var r;
|
|
69
|
+
if (n.detail > 0 && ((r = n.currentTarget) == null || r.blur()), s.value || l.value) {
|
|
70
|
+
n.preventDefault();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
e.htmlType !== "button" && (o.nativeActivation = !0, clearTimeout(p), p = setTimeout(() => {
|
|
74
|
+
o.nativeActivation = !1;
|
|
75
|
+
}, 0)), $(), F("click", n);
|
|
48
76
|
};
|
|
49
77
|
return () => {
|
|
50
|
-
var
|
|
51
|
-
const
|
|
52
|
-
return
|
|
53
|
-
class: [
|
|
78
|
+
var j, I, O, B;
|
|
79
|
+
const n = (j = t.default) == null ? void 0 : j.call(t), r = (I = t.prefix) == null ? void 0 : I.call(t), x = (O = t.icon) == null ? void 0 : O.call(t), z = (B = t.suffix) == null ? void 0 : B.call(t), g = d(n), w = d(r), T = d(x), D = d(z), P = !g && !w && T && !D, A = e.loadingFill || l.value && (h.value === "circle" || P), E = l.value && !A && (g || w || T || D);
|
|
80
|
+
return H(u("button", {
|
|
81
|
+
class: [V.value, !g && i.modifier("empty-content"), P && i.modifier("only-icon"), A && i.modifier("loading-fill")],
|
|
54
82
|
type: e.htmlType,
|
|
55
|
-
disabled:
|
|
83
|
+
disabled: s.value || l.value && !o.nativeActivation,
|
|
56
84
|
"aria-busy": l.value || void 0,
|
|
57
|
-
onClick:
|
|
58
|
-
}, [
|
|
85
|
+
onClick: C
|
|
86
|
+
}, [u("span", {
|
|
59
87
|
class: i.element("loading"),
|
|
60
88
|
"aria-hidden": "true",
|
|
61
89
|
style: {
|
|
62
90
|
display: "flex",
|
|
63
91
|
opacity: l.value ? 1 : 0,
|
|
64
|
-
width:
|
|
65
|
-
marginRight:
|
|
92
|
+
width: A ? void 0 : l.value ? "1em" : 0,
|
|
93
|
+
marginRight: E ? "4px" : "0",
|
|
66
94
|
overflow: "hidden"
|
|
67
95
|
}
|
|
68
|
-
}, [l.value &&
|
|
96
|
+
}, [l.value && u(ee, null, null)]), w && u("span", {
|
|
69
97
|
class: i.element("prefix")
|
|
70
|
-
}, [
|
|
98
|
+
}, [r]), T && u("span", {
|
|
71
99
|
class: i.element("prefix")
|
|
72
|
-
}, [
|
|
100
|
+
}, [x]), u("span", {
|
|
73
101
|
class: i.element("content")
|
|
74
|
-
}, [
|
|
102
|
+
}, [n]), D && u("span", {
|
|
75
103
|
class: i.element("suffix")
|
|
76
|
-
}, [
|
|
77
|
-
disabled:
|
|
104
|
+
}, [z])]), [[J("wave"), {
|
|
105
|
+
disabled: K.value
|
|
78
106
|
}]]);
|
|
79
107
|
};
|
|
80
108
|
}
|
|
81
109
|
});
|
|
82
110
|
export {
|
|
83
|
-
|
|
111
|
+
se as default
|
|
84
112
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
function c(r, e, o) {
|
|
2
|
+
const a = r === "primary" && e === "default" ? "primary" : e, n = r === "primary" ? "solid" : r;
|
|
3
|
+
return o && ["default", "solid"].includes(n) ? { appearance: "subtle", color: a } : { appearance: n, color: a };
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
c as resolveButtonAppearance
|
|
7
|
+
};
|