x-next 1.1.0 → 1.2.0
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/CHANGELOG.md +26 -0
- package/dist/_hooks/use-form-item.d.ts +5 -0
- package/dist/_hooks/use-picker-focus.d.ts +17 -0
- package/dist/components/_components/feedback-icon/index.vue.d.ts +4 -4
- package/dist/components/_components/picker/input-range.vue.d.ts +10 -6
- package/dist/components/_components/picker/input.vue.d.ts +9 -5
- package/dist/components/alert/Alert.vue.d.ts +5 -5
- package/dist/components/alert/index.d.ts +10 -10
- package/dist/components/date-picker/DatePanel.vue.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +36 -16
- package/dist/components/date-picker/index.d.ts +77 -33
- package/dist/components/dialog/Dialog.d.ts +1 -1
- package/dist/components/dialog/index.d.ts +3 -3
- package/dist/components/drawer/index.d.ts +3 -3
- package/dist/components/drawer/src/Drawer.vue.d.ts +1 -1
- package/dist/components/dropdown/Dropdown.vue.d.ts +3 -3
- package/dist/components/dropdown/DropdownButton.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +22 -22
- package/dist/components/form/FormItem.vue.d.ts +12 -4
- package/dist/components/form/context.d.ts +6 -0
- package/dist/components/form/form-item-label.vue.d.ts +4 -4
- package/dist/components/form/form-item-message.vue.d.ts +2 -0
- package/dist/components/form/index.d.ts +30 -8
- package/dist/components/form/interface.d.ts +2 -2
- package/dist/components/form-input/InputPassword.vue.d.ts +20 -2
- package/dist/components/form-input/index.d.ts +22 -4
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +10 -3
- package/dist/components/form-slider/index.d.ts +26 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +4 -3
- package/dist/components/form-switch/Switch.vue.d.ts +2 -1
- package/dist/components/form-switch/index.d.ts +5 -2
- package/dist/components/form-textarea/Textarea.vue.d.ts +2 -2
- package/dist/components/form-textarea/index.d.ts +5 -5
- package/dist/components/image/Image.vue.d.ts +10 -9
- package/dist/components/image/ImagePreview.vue.d.ts +8 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +8 -7
- package/dist/components/image/index.d.ts +59 -52
- package/dist/components/image/preview-arrow.vue.d.ts +2 -2
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/layout/LayoutSidebar.vue.d.ts +2 -2
- package/dist/components/layout/index.d.ts +4 -4
- package/dist/components/link/Link.vue.d.ts +2 -2
- package/dist/components/link/index.d.ts +4 -4
- package/dist/components/menu/Menu.d.ts +2 -2
- package/dist/components/menu/base-menu.vue.d.ts +2 -2
- package/dist/components/menu/index.d.ts +4 -4
- package/dist/components/menu/sub-menu-pop.vue.d.ts +5 -5
- package/dist/components/message/index.d.ts +17 -17
- package/dist/components/message/message.vue.d.ts +8 -8
- package/dist/components/notification/Notification.d.ts +1 -1
- package/dist/components/notification/index.d.ts +3 -3
- package/dist/components/pagination/page-item-ellipsis.vue.d.ts +1 -1
- package/dist/components/pagination/page-item-step.vue.d.ts +2 -2
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/progress/Progress.vue.d.ts +4 -4
- package/dist/components/progress/circle.vue.d.ts +2 -2
- package/dist/components/progress/index.d.ts +8 -8
- package/dist/components/progress/line.vue.d.ts +1 -1
- package/dist/components/progress/steps.vue.d.ts +1 -1
- package/dist/components/steps/Step.vue.d.ts +2 -2
- package/dist/components/steps/index.d.ts +4 -4
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/tabs/tabs-tab.vue.d.ts +1 -1
- package/dist/components/tag/Tag.vue.d.ts +2 -2
- package/dist/components/tag/index.d.ts +4 -4
- package/dist/components/time-picker/TimeColumn.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePanel.vue.d.ts +3 -0
- package/dist/components/time-picker/TimePicker.vue.d.ts +33 -17
- package/dist/components/time-picker/index.d.ts +73 -36
- package/dist/components/time-range-selector/TimeRangeSelector.vue.d.ts +8 -0
- package/dist/components/time-range-selector/index.d.ts +22 -0
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/es/_hooks/use-form-item.js +36 -10
- package/dist/es/_hooks/use-picker-focus.js +57 -0
- package/dist/es/_utils/constant.js +17 -5
- package/dist/es/components/_components/picker/input-range.vue.js +45 -55
- package/dist/es/components/_components/picker/input-range.vue2.js +105 -70
- package/dist/es/components/_components/picker/input.vue.js +22 -25
- package/dist/es/components/_components/picker/input.vue2.js +58 -43
- package/dist/es/components/_components/select-view/select-view.js +67 -66
- package/dist/es/components/date-picker/DatePanel.vue.js +102 -94
- package/dist/es/components/date-picker/DatePanel.vue2.js +97 -44
- package/dist/es/components/date-picker/DatePicker.vue.js +71 -58
- package/dist/es/components/date-picker/DatePicker.vue2.js +285 -231
- package/dist/es/components/dialog/Dialog.js +154 -132
- package/dist/es/components/form/Form.vue2.js +113 -101
- package/dist/es/components/form/FormItem.vue.js +26 -22
- package/dist/es/components/form/FormItem.vue2.js +162 -125
- package/dist/es/components/form/form-item-message.vue.js +31 -24
- package/dist/es/components/form/form-item-message.vue2.js +4 -2
- package/dist/es/components/form-checkbox/Checkbox.js +75 -71
- package/dist/es/components/form-checkbox/CheckboxGroup.js +43 -38
- package/dist/es/components/form-input/Input.js +83 -79
- package/dist/es/components/form-input/InputPassword.vue.js +19 -16
- package/dist/es/components/form-input/InputPassword.vue2.js +39 -29
- package/dist/es/components/form-input/InputSearch.js +47 -37
- package/dist/es/components/form-input-number/InputNumber.js +134 -133
- package/dist/es/components/form-input-tag/InputTag.js +173 -162
- package/dist/es/components/form-radio/Radio.js +74 -71
- package/dist/es/components/form-radio/RadioGroup.js +55 -49
- package/dist/es/components/form-select/Select.js +99 -98
- package/dist/es/components/form-slider/Slider.vue.js +28 -28
- package/dist/es/components/form-slider/Slider.vue2.js +139 -132
- package/dist/es/components/form-slider/slider-button.vue.js +6 -6
- package/dist/es/components/form-slider/slider-button.vue2.js +39 -34
- package/dist/es/components/form-switch/Switch.vue.js +9 -9
- package/dist/es/components/form-switch/Switch.vue2.js +81 -74
- package/dist/es/components/form-textarea/Textarea.vue2.js +123 -108
- package/dist/es/components/image/Image.vue2.js +77 -76
- package/dist/es/components/image/ImagePreview.vue.js +13 -12
- package/dist/es/components/image/ImagePreview.vue2.js +141 -136
- package/dist/es/components/image/ImagePreviewGroup.vue.js +1 -1
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +82 -83
- package/dist/es/components/rate/Rate.js +106 -103
- package/dist/es/components/time-picker/TimeColumn.vue.js +34 -23
- package/dist/es/components/time-picker/TimeColumn.vue2.js +37 -28
- package/dist/es/components/time-picker/TimePicker.vue.js +83 -64
- package/dist/es/components/time-picker/TimePicker.vue2.js +192 -156
- package/dist/es/components/time-range-selector/TimeRangeSelector.vue.js +327 -193
- package/dist/es/locale/en-US.js +6 -0
- package/dist/es/locale/zh-CN.js +6 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/down.d.ts +1 -1
- package/dist/icons/_self/dropdown/more.d.ts +1 -1
- package/dist/icons/_self/empty-better.d.ts +1 -1
- package/dist/icons/_self/empty.d.ts +1 -1
- package/dist/icons/_self/eye-invisible.d.ts +1 -1
- package/dist/icons/_self/eye.d.ts +1 -1
- package/dist/icons/_self/full-screen.d.ts +1 -1
- package/dist/icons/_self/left.d.ts +1 -1
- package/dist/icons/_self/menu/down.d.ts +1 -1
- package/dist/icons/_self/minus.d.ts +1 -1
- package/dist/icons/_self/more-dot.d.ts +1 -1
- package/dist/icons/_self/next.d.ts +1 -1
- package/dist/icons/_self/original-size.d.ts +1 -1
- package/dist/icons/_self/plus.d.ts +1 -1
- package/dist/icons/_self/prev.d.ts +1 -1
- package/dist/icons/_self/question-message.d.ts +1 -1
- package/dist/icons/_self/right.d.ts +1 -1
- package/dist/icons/_self/rotate-left.d.ts +1 -1
- package/dist/icons/_self/rotate-right.d.ts +1 -1
- package/dist/icons/_self/search.d.ts +1 -1
- package/dist/icons/_self/up.d.ts +1 -1
- package/dist/icons/_self/zoom-in.d.ts +1 -1
- package/dist/icons/_self/zoom-out.d.ts +1 -1
- package/dist/icons/_ui/alone-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-left.d.ts +1 -1
- package/dist/icons/_ui/alone-margin-right.d.ts +1 -1
- package/dist/icons/_ui/alone-right.d.ts +1 -1
- package/dist/icons/_ui/calendar.d.ts +1 -1
- package/dist/icons/_ui/time.d.ts +1 -1
- package/dist/icons/animation/animation-loading.d.ts +1 -1
- package/dist/icons/default/check-circle-fill.d.ts +1 -1
- package/dist/icons/default/check.d.ts +1 -1
- package/dist/icons/default/close-circle-fill.d.ts +1 -1
- package/dist/icons/default/close.d.ts +1 -1
- package/dist/icons/default/exclamation-circle-fill.d.ts +1 -1
- package/dist/icons/default/exclamation.d.ts +1 -1
- package/dist/icons/default/filter.d.ts +1 -1
- package/dist/icons/default/info-circle-fill.d.ts +1 -1
- package/dist/icons/default/link.d.ts +1 -1
- package/dist/icons/default/logo-simple.d.ts +1 -1
- package/dist/icons/default/minus-circle-fill.d.ts +1 -1
- package/dist/icons/icon.d.ts +2 -2
- package/dist/icons/index.d.ts +3 -3
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +6 -0
- package/dist/style/base.css +1 -1
- package/dist/style/date-picker.css +1 -1
- package/dist/style/form.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/time-range-selector.css +1 -1
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,35 +1,37 @@
|
|
|
1
1
|
import b from "./FormItem.vue2.js";
|
|
2
|
-
import { resolveComponent as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { resolveComponent as l, renderSlot as o, openBlock as a, createBlock as t, mergeProps as n, withCtx as s, createVNode as p, createTextVNode as d, toDisplayString as h, createCommentVNode as r, createElementVNode as f, normalizeClass as i, createSlots as g, createElementBlock as k } from "vue";
|
|
3
|
+
import $ from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const w = ["id"];
|
|
5
|
+
function N(e, L, v, F, I, S) {
|
|
6
|
+
const u = l("FormItemLabel"), m = l("XCol"), y = l("FormItemMessage"), C = l("XRow");
|
|
6
7
|
return e.noStyle ? o(e.$slots, "default", { key: 0 }) : (a(), t(C, n({
|
|
7
8
|
key: 1,
|
|
8
9
|
class: [
|
|
9
10
|
e.cls,
|
|
10
11
|
{
|
|
11
|
-
[e.className.modifier("has-help")]: !!(e.$slots.help ?? e.help)
|
|
12
|
+
[e.className.modifier("has-help")]: !!(e.$slots.help ?? e.help),
|
|
13
|
+
[e.className.modifier("has-message")]: !!(e.isError && e.finalMessage.length)
|
|
12
14
|
}
|
|
13
15
|
],
|
|
14
16
|
wrap: !(e.labelColFlex || e.autoLabelWidth),
|
|
15
17
|
div: e.layout !== "horizontal" || e.hideLabel
|
|
16
18
|
}, e.rowProps), {
|
|
17
|
-
default:
|
|
19
|
+
default: s(() => [
|
|
18
20
|
e.hideLabel ? r("", !0) : (a(), t(m, n({
|
|
19
21
|
key: 0,
|
|
20
22
|
class: e.labelColCls,
|
|
21
23
|
style: e.mergedLabelStyle
|
|
22
24
|
}, e.mergedLabelCol), {
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
+
default: s(() => [
|
|
26
|
+
p(u, {
|
|
25
27
|
required: e.hideAsterisk ? !1 : e.isRequired,
|
|
26
28
|
"show-colon": e.showColon,
|
|
27
29
|
"asterisk-position": e.asteriskPosition,
|
|
28
30
|
component: e.labelComponent,
|
|
29
|
-
attrs: e.
|
|
31
|
+
attrs: e.mergedLabelAttrs,
|
|
30
32
|
tooltip: e.tooltip
|
|
31
33
|
}, {
|
|
32
|
-
default:
|
|
34
|
+
default: s(() => [
|
|
33
35
|
e.$slots.label || e.label ? o(e.$slots, "label", { key: 0 }, () => [
|
|
34
36
|
d(h(e.label), 1)
|
|
35
37
|
]) : r("", !0)
|
|
@@ -39,16 +41,16 @@ function g(e, N, v, F, L, S) {
|
|
|
39
41
|
]),
|
|
40
42
|
_: 3
|
|
41
43
|
}, 16, ["class", "style"])),
|
|
42
|
-
|
|
44
|
+
p(m, n({
|
|
43
45
|
class: e.wrapperColCls,
|
|
44
46
|
style: e.mergedWrapperStyle
|
|
45
47
|
}, e.mergedWrapperCol), {
|
|
46
|
-
default:
|
|
48
|
+
default: s(() => [
|
|
47
49
|
f("div", {
|
|
48
|
-
class:
|
|
50
|
+
class: i(e.className.element("content-wrapper"))
|
|
49
51
|
}, [
|
|
50
52
|
f("div", {
|
|
51
|
-
class:
|
|
53
|
+
class: i([
|
|
52
54
|
e.className.element("content"),
|
|
53
55
|
{
|
|
54
56
|
[e.className.element("content-flex")]: e.contentFlex
|
|
@@ -61,25 +63,27 @@ function g(e, N, v, F, L, S) {
|
|
|
61
63
|
], 2),
|
|
62
64
|
e.isError || e.$slots.help || e.help ? (a(), t(y, {
|
|
63
65
|
key: 0,
|
|
66
|
+
id: e.messageId,
|
|
64
67
|
error: e.finalMessage,
|
|
65
68
|
help: e.help
|
|
66
|
-
},
|
|
69
|
+
}, g({ _: 2 }, [
|
|
67
70
|
e.$slots.help ? {
|
|
68
71
|
name: "help",
|
|
69
|
-
fn:
|
|
72
|
+
fn: s(() => [
|
|
70
73
|
o(e.$slots, "help")
|
|
71
74
|
]),
|
|
72
75
|
key: "0"
|
|
73
76
|
} : void 0
|
|
74
|
-
]), 1032, ["error", "help"])) : r("", !0),
|
|
75
|
-
e.$slots.extra || e.extra ? (a(),
|
|
77
|
+
]), 1032, ["id", "error", "help"])) : r("", !0),
|
|
78
|
+
e.$slots.extra || e.extra ? (a(), k("div", {
|
|
76
79
|
key: 1,
|
|
77
|
-
|
|
80
|
+
id: e.extraId,
|
|
81
|
+
class: i(e.className.modifier("extra"))
|
|
78
82
|
}, [
|
|
79
83
|
o(e.$slots, "extra", {}, () => [
|
|
80
84
|
d(h(e.extra), 1)
|
|
81
85
|
])
|
|
82
|
-
],
|
|
86
|
+
], 10, w)) : r("", !0)
|
|
83
87
|
]),
|
|
84
88
|
_: 3
|
|
85
89
|
}, 16, ["class", "style"])
|
|
@@ -87,7 +91,7 @@ function g(e, N, v, F, L, S) {
|
|
|
87
91
|
_: 3
|
|
88
92
|
}, 16, ["class", "wrap", "div"]));
|
|
89
93
|
}
|
|
90
|
-
const
|
|
94
|
+
const V = /* @__PURE__ */ $(b, [["render", N]]);
|
|
91
95
|
export {
|
|
92
|
-
|
|
96
|
+
V as default
|
|
93
97
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { Schema as
|
|
3
|
-
import { formInjectionKey as
|
|
4
|
-
import { Col as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { getValueByPath as
|
|
8
|
-
import { getFormElementId as
|
|
9
|
-
import { getClassNameMixin as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import { deepClone as
|
|
12
|
-
const
|
|
1
|
+
import { defineComponent as be, toRefs as H, inject as U, computed as i, ref as R, reactive as F, useId as me, nextTick as q, provide as ye, toRef as Se, onMounted as he, onBeforeUnmount as Fe, watch as pe } from "vue";
|
|
2
|
+
import { Schema as we } from "../../node_modules/.pnpm/b-validate@1.5.3/node_modules/b-validate/es/index.js";
|
|
3
|
+
import { formInjectionKey as Be, formItemInjectionKey as G } from "./context.js";
|
|
4
|
+
import { Col as Pe, Row as je } from "../grid/index.js";
|
|
5
|
+
import Ce from "./form-item-label.vue.js";
|
|
6
|
+
import Le from "./form-item-message.vue.js";
|
|
7
|
+
import { getValueByPath as A, setValueByPath as J } from "../../_utils/get-value-by-path.js";
|
|
8
|
+
import { getFormElementId as Re, getFinalValidateStatus as qe, getFinalValidateMessage as Ae } from "./utils.js";
|
|
9
|
+
import { getClassNameMixin as Ve } from "../../_utils/config.js";
|
|
10
|
+
import { useLocale as Me } from "../../locale/index.js";
|
|
11
|
+
import { deepClone as V } from "../../_utils/helpers.js";
|
|
12
|
+
const He = be({
|
|
13
13
|
name: "FormItem",
|
|
14
14
|
components: {
|
|
15
|
-
XRow:
|
|
16
|
-
XCol:
|
|
17
|
-
FormItemLabel:
|
|
18
|
-
FormItemMessage:
|
|
15
|
+
XRow: je,
|
|
16
|
+
XCol: Pe,
|
|
17
|
+
FormItemLabel: Ce,
|
|
18
|
+
FormItemMessage: Le
|
|
19
19
|
},
|
|
20
20
|
props: {
|
|
21
21
|
/**
|
|
@@ -228,182 +228,219 @@ const Ve = te({
|
|
|
228
228
|
* @en Extra content
|
|
229
229
|
* @slot extra
|
|
230
230
|
*/
|
|
231
|
-
setup(
|
|
232
|
-
const
|
|
233
|
-
const e = { ...
|
|
234
|
-
return
|
|
235
|
-
}),
|
|
231
|
+
setup(a, { slots: B }) {
|
|
232
|
+
const r = Ve("form--item"), { field: s } = H(a), l = U(Be, {}), { autoLabelWidth: Q, layout: Y } = H(l), { locale: Z } = Me(), x = i(() => {
|
|
233
|
+
const e = { ...a.labelColProps ?? l.labelColProps };
|
|
234
|
+
return a.labelColFlex ? e.flex = a.labelColFlex : l.autoLabelWidth && (e.flex = `${l.maxLabelWidth}px`), e;
|
|
235
|
+
}), M = i(() => {
|
|
236
236
|
const e = {
|
|
237
|
-
...
|
|
237
|
+
...a.wrapperColProps ?? l.wrapperColProps
|
|
238
238
|
};
|
|
239
|
-
return s.value && (e.id =
|
|
240
|
-
}),
|
|
239
|
+
return s.value && (e.id = Re(l.id, s.value)), (a.labelColFlex || l.autoLabelWidth) && (e.flex = "auto"), e;
|
|
240
|
+
}), ee = i(() => a.labelColStyle ?? l.labelColStyle), le = i(() => a.wrapperColStyle ?? l.wrapperColStyle), O = R(V(A(l.model, a.field))), W = F({}), $ = F({}), P = i(() => qe(W)), j = i(() => Ae($)), g = R(!1);
|
|
241
|
+
let b = 0, E = !1;
|
|
242
|
+
const ae = i(() => A(l.model, a.field)), k = i(() => !!(a.disabled ?? (l == null ? void 0 : l.disabled))), m = i(() => a.validateStatus ?? P.value), c = i(() => m.value === "error"), T = i(() => {
|
|
241
243
|
var n;
|
|
242
244
|
const e = [].concat(
|
|
243
|
-
|
|
244
|
-
),
|
|
245
|
-
return
|
|
246
|
-
}),
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
245
|
+
a.rules ?? ((n = l == null ? void 0 : l.rules) == null ? void 0 : n[a.field]) ?? []
|
|
246
|
+
), t = e.some((d) => d.required);
|
|
247
|
+
return a.required && !t ? [{ required: !0 }].concat(e) : e;
|
|
248
|
+
}), _ = i(() => T.value.some((e) => e.required)), o = a.noStyle ? U(G, void 0) : void 0, C = `x-form-item-${me()}`, L = `${C}-message`, z = `${C}-extra`, y = F(/* @__PURE__ */ new Map()), te = (e, t, n) => {
|
|
249
|
+
var w;
|
|
250
|
+
const d = y.get(e);
|
|
251
|
+
(!d || d.id !== t || d.labelable !== n) && y.set(e, { id: t, labelable: n }), a.noStyle && ((w = o == null ? void 0 : o.registerControl) == null || w.call(o, e, t, n));
|
|
252
|
+
}, oe = (e) => {
|
|
253
|
+
var t;
|
|
254
|
+
y.delete(e), a.noStyle && ((t = o == null ? void 0 : o.unregisterControl) == null || t.call(o, e));
|
|
255
|
+
}, I = i(
|
|
256
|
+
() => {
|
|
257
|
+
var e;
|
|
258
|
+
return a.noStyle ? o == null ? void 0 : o.labelId : !a.hideLabel && (a.label || B.label) ? String(((e = a.labelAttrs) == null ? void 0 : e.id) ?? `${C}-label`) : void 0;
|
|
259
|
+
}
|
|
260
|
+
), ie = i(
|
|
261
|
+
() => a.noStyle ? o == null ? void 0 : o.describedBy : [
|
|
262
|
+
c.value && j.value.length || a.help || B.help ? L : "",
|
|
263
|
+
a.extra || B.extra ? z : ""
|
|
264
|
+
].filter(Boolean).join(" ") || void 0
|
|
265
|
+
), se = i(() => {
|
|
266
|
+
const e = y.size === 1 ? [...y.values()][0] : void 0;
|
|
267
|
+
return {
|
|
268
|
+
id: I.value,
|
|
269
|
+
for: e != null && e.labelable ? e.id : void 0,
|
|
270
|
+
...a.labelAttrs
|
|
271
|
+
};
|
|
272
|
+
}), v = (e, { status: t, message: n }) => {
|
|
273
|
+
W[e] = t, $[e] = n, a.noStyle && (o == null || o.updateValidateState(e, { status: t, message: n }));
|
|
274
|
+
}, ne = i(
|
|
275
|
+
() => a.feedback && m.value ? m.value : void 0
|
|
276
|
+
), S = () => {
|
|
277
|
+
if (g.value)
|
|
252
278
|
return Promise.resolve();
|
|
253
|
-
const e =
|
|
279
|
+
const e = T.value;
|
|
254
280
|
if (!s.value || e.length === 0)
|
|
255
|
-
return
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
status: "",
|
|
281
|
+
return P.value && h(), Promise.resolve();
|
|
282
|
+
const t = s.value, n = ae.value, d = ++b;
|
|
283
|
+
v(t, {
|
|
284
|
+
status: "validating",
|
|
259
285
|
message: ""
|
|
260
286
|
});
|
|
261
|
-
const
|
|
287
|
+
const w = new we(
|
|
262
288
|
{
|
|
263
|
-
[
|
|
289
|
+
[t]: e.map(({ ...f }) => (!f.type && !f.validator && (f.type = "string"), f))
|
|
264
290
|
},
|
|
265
291
|
{
|
|
266
292
|
ignoreEmptyString: !0,
|
|
267
|
-
validateMessages:
|
|
293
|
+
validateMessages: Z.value.validateMessages
|
|
268
294
|
}
|
|
269
295
|
);
|
|
270
|
-
return new Promise((
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
|
|
274
|
-
status:
|
|
275
|
-
message: (
|
|
296
|
+
return new Promise((f) => {
|
|
297
|
+
w.validate({ [t]: n }, (u) => {
|
|
298
|
+
const X = !!(u != null && u[t]);
|
|
299
|
+
!E && d === b && t === s.value && v(t, {
|
|
300
|
+
status: X ? "error" : "",
|
|
301
|
+
message: (u == null ? void 0 : u[t].message) ?? ""
|
|
276
302
|
});
|
|
277
|
-
const
|
|
278
|
-
label:
|
|
279
|
-
field:
|
|
280
|
-
value:
|
|
281
|
-
type:
|
|
282
|
-
isRequiredError: !!
|
|
283
|
-
message:
|
|
303
|
+
const ge = X ? {
|
|
304
|
+
label: a.label,
|
|
305
|
+
field: t,
|
|
306
|
+
value: u[t].value,
|
|
307
|
+
type: u[t].type,
|
|
308
|
+
isRequiredError: !!u[t].requiredError,
|
|
309
|
+
message: u[t].message
|
|
284
310
|
} : void 0;
|
|
285
|
-
|
|
311
|
+
f(ge);
|
|
286
312
|
});
|
|
287
313
|
});
|
|
288
|
-
},
|
|
289
|
-
() => [].concat(
|
|
290
|
-
),
|
|
291
|
-
() =>
|
|
292
|
-
switch (
|
|
314
|
+
}, re = i(
|
|
315
|
+
() => [].concat(a.validateTrigger)
|
|
316
|
+
), ue = i(
|
|
317
|
+
() => re.value.reduce((e, t) => {
|
|
318
|
+
switch (t) {
|
|
293
319
|
case "change":
|
|
294
320
|
return e.onChange = () => {
|
|
295
|
-
|
|
321
|
+
S();
|
|
296
322
|
}, e;
|
|
297
323
|
case "input":
|
|
298
324
|
return e.onInput = () => {
|
|
299
|
-
|
|
300
|
-
|
|
325
|
+
q(() => {
|
|
326
|
+
S();
|
|
301
327
|
});
|
|
302
328
|
}, e;
|
|
303
329
|
case "focus":
|
|
304
330
|
return e.onFocus = () => {
|
|
305
|
-
|
|
331
|
+
S();
|
|
306
332
|
}, e;
|
|
307
333
|
case "blur":
|
|
308
334
|
return e.onBlur = () => {
|
|
309
|
-
|
|
335
|
+
S();
|
|
310
336
|
}, e;
|
|
311
337
|
default:
|
|
312
338
|
return e;
|
|
313
339
|
}
|
|
314
340
|
}, {})
|
|
315
341
|
);
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
eventHandlers:
|
|
320
|
-
size: l &&
|
|
321
|
-
disabled:
|
|
322
|
-
error:
|
|
323
|
-
feedback:
|
|
324
|
-
|
|
342
|
+
ye(
|
|
343
|
+
G,
|
|
344
|
+
F({
|
|
345
|
+
eventHandlers: ue,
|
|
346
|
+
size: l && Se(l, "size"),
|
|
347
|
+
disabled: k,
|
|
348
|
+
error: c,
|
|
349
|
+
feedback: ne,
|
|
350
|
+
labelId: I,
|
|
351
|
+
describedBy: ie,
|
|
352
|
+
errorId: i(
|
|
353
|
+
() => a.noStyle ? o == null ? void 0 : o.errorId : c.value && j.value.length ? L : void 0
|
|
354
|
+
),
|
|
355
|
+
required: _,
|
|
356
|
+
registerControl: te,
|
|
357
|
+
unregisterControl: oe,
|
|
358
|
+
updateValidateState: v
|
|
325
359
|
})
|
|
326
360
|
);
|
|
327
|
-
const
|
|
328
|
-
s.value &&
|
|
361
|
+
const h = () => {
|
|
362
|
+
b++, s.value && v(s.value, {
|
|
329
363
|
status: "",
|
|
330
364
|
message: ""
|
|
331
365
|
});
|
|
332
|
-
},
|
|
333
|
-
|
|
366
|
+
}, de = (e) => {
|
|
367
|
+
v(e, {
|
|
334
368
|
status: "",
|
|
335
369
|
message: ""
|
|
336
370
|
});
|
|
337
|
-
},
|
|
371
|
+
}, N = F({
|
|
338
372
|
field: s,
|
|
339
|
-
disabled:
|
|
340
|
-
error:
|
|
341
|
-
validate:
|
|
342
|
-
clearValidate:
|
|
373
|
+
disabled: k,
|
|
374
|
+
error: c,
|
|
375
|
+
validate: S,
|
|
376
|
+
clearValidate: h,
|
|
343
377
|
resetField: () => {
|
|
344
|
-
|
|
345
|
-
|
|
378
|
+
h(), g.value = !0, l != null && l.model && s.value && J(l.model, s.value, V(O.value)), q(() => {
|
|
379
|
+
g.value = !1;
|
|
346
380
|
});
|
|
347
381
|
},
|
|
348
382
|
setField: (e) => {
|
|
349
|
-
s.value && (
|
|
383
|
+
s.value && (b++, g.value = !0, "value" in e && (l != null && l.model) && s.value && J(l.model, s.value, e.value), "status" in e || "message" in e ? v(s.value, {
|
|
350
384
|
status: e.status ?? "",
|
|
351
385
|
message: e.message ?? ""
|
|
352
|
-
}),
|
|
353
|
-
|
|
386
|
+
}) : P.value === "validating" && h(), q(() => {
|
|
387
|
+
g.value = !1;
|
|
354
388
|
}));
|
|
355
389
|
}
|
|
356
|
-
}),
|
|
390
|
+
}), p = R(!1), D = () => {
|
|
357
391
|
var e;
|
|
358
|
-
s.value && !
|
|
359
|
-
},
|
|
392
|
+
s.value && !p.value && ((e = l.addField) == null || e.call(l, N), p.value = !0);
|
|
393
|
+
}, K = () => {
|
|
360
394
|
var e;
|
|
361
|
-
|
|
395
|
+
p.value && ((e = l.removeField) == null || e.call(l, N), p.value = !1);
|
|
362
396
|
};
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
}),
|
|
366
|
-
|
|
367
|
-
}),
|
|
368
|
-
e !==
|
|
397
|
+
he(() => {
|
|
398
|
+
D();
|
|
399
|
+
}), Fe(() => {
|
|
400
|
+
E = !0, h(), K();
|
|
401
|
+
}), pe(s, (e, t) => {
|
|
402
|
+
e !== t && (b++, t && de(t), K(), O.value = V(A(l.model, e)), e && D());
|
|
369
403
|
});
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
404
|
+
const ce = i(() => [
|
|
405
|
+
r.block,
|
|
406
|
+
r.modifier(`layout-${l.layout}`),
|
|
373
407
|
{
|
|
374
|
-
[
|
|
375
|
-
[
|
|
408
|
+
[r.modifier("error")]: c.value,
|
|
409
|
+
[r.modifier(`status-${m.value}`)]: !!m.value
|
|
376
410
|
},
|
|
377
|
-
|
|
378
|
-
]),
|
|
379
|
-
|
|
411
|
+
a.rowClass
|
|
412
|
+
]), ve = i(() => [
|
|
413
|
+
r.element("label-col"),
|
|
380
414
|
{
|
|
381
|
-
[
|
|
382
|
-
[
|
|
415
|
+
[r.element("label-col-left")]: l.labelAlign === "left",
|
|
416
|
+
[r.element("label-col-flex")]: l.autoLabelWidth || a.labelColFlex
|
|
383
417
|
}
|
|
384
|
-
]),
|
|
385
|
-
|
|
418
|
+
]), fe = i(() => [
|
|
419
|
+
r.element("wrapper-col"),
|
|
386
420
|
{
|
|
387
|
-
[
|
|
421
|
+
[r.element("wrapper-col-flex")]: !M.value
|
|
388
422
|
}
|
|
389
423
|
]);
|
|
390
424
|
return {
|
|
391
|
-
className:
|
|
392
|
-
cls:
|
|
393
|
-
isRequired:
|
|
394
|
-
isError:
|
|
395
|
-
finalMessage:
|
|
396
|
-
mergedLabelCol:
|
|
397
|
-
mergedWrapperCol:
|
|
398
|
-
labelColCls:
|
|
399
|
-
autoLabelWidth:
|
|
400
|
-
layout:
|
|
401
|
-
mergedLabelStyle:
|
|
402
|
-
wrapperColCls:
|
|
403
|
-
mergedWrapperStyle:
|
|
425
|
+
className: r,
|
|
426
|
+
cls: ce,
|
|
427
|
+
isRequired: _,
|
|
428
|
+
isError: c,
|
|
429
|
+
finalMessage: j,
|
|
430
|
+
mergedLabelCol: x,
|
|
431
|
+
mergedWrapperCol: M,
|
|
432
|
+
labelColCls: ve,
|
|
433
|
+
autoLabelWidth: Q,
|
|
434
|
+
layout: Y,
|
|
435
|
+
mergedLabelStyle: ee,
|
|
436
|
+
wrapperColCls: fe,
|
|
437
|
+
mergedWrapperStyle: le,
|
|
438
|
+
mergedLabelAttrs: se,
|
|
439
|
+
messageId: L,
|
|
440
|
+
extraId: z
|
|
404
441
|
};
|
|
405
442
|
}
|
|
406
443
|
});
|
|
407
444
|
export {
|
|
408
|
-
|
|
445
|
+
He as default
|
|
409
446
|
};
|
|
@@ -1,37 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { openBlock as r, createElementBlock as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import m from "./form-item-message.vue2.js";
|
|
2
|
+
import { openBlock as r, createElementBlock as a, Fragment as p, renderList as c, createBlock as l, Transition as s, withCtx as t, createElementVNode as n, normalizeClass as i, toDisplayString as d, renderSlot as f, createTextVNode as h, createCommentVNode as k } from "vue";
|
|
3
|
+
import u from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const N = ["id"], $ = ["id"];
|
|
5
|
+
function b(e, g, y, v, B, C) {
|
|
6
|
+
return e.error.length > 0 ? (r(), a("div", {
|
|
7
|
+
key: 0,
|
|
8
|
+
id: e.id
|
|
9
|
+
}, [
|
|
10
|
+
(r(!0), a(p, null, c(e.error, (o) => (r(), l(s, {
|
|
11
|
+
key: o,
|
|
12
|
+
name: "form-blink",
|
|
13
|
+
appear: ""
|
|
14
|
+
}, {
|
|
15
|
+
default: t(() => [
|
|
16
|
+
n("div", {
|
|
17
|
+
role: "alert",
|
|
18
|
+
class: i([e.className.block])
|
|
19
|
+
}, d(o), 3)
|
|
20
|
+
]),
|
|
21
|
+
_: 2
|
|
22
|
+
}, 1024))), 128))
|
|
23
|
+
], 8, N)) : e.help || e.$slots.help ? (r(), l(s, {
|
|
18
24
|
key: 1,
|
|
19
25
|
name: "form-blink",
|
|
20
26
|
appear: ""
|
|
21
27
|
}, {
|
|
22
28
|
default: t(() => [
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
n("div", {
|
|
30
|
+
id: e.id,
|
|
31
|
+
class: i([e.className.block, e.className.modifier("help")])
|
|
25
32
|
}, [
|
|
26
33
|
f(e.$slots, "help", {}, () => [
|
|
27
|
-
|
|
34
|
+
h(d(e.help), 1)
|
|
28
35
|
])
|
|
29
|
-
],
|
|
36
|
+
], 10, $)
|
|
30
37
|
]),
|
|
31
38
|
_: 3
|
|
32
|
-
})) :
|
|
39
|
+
})) : k("", !0);
|
|
33
40
|
}
|
|
34
|
-
const
|
|
41
|
+
const F = /* @__PURE__ */ u(m, [["render", b]]);
|
|
35
42
|
export {
|
|
36
|
-
|
|
43
|
+
F as default
|
|
37
44
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defineComponent as e } from "vue";
|
|
2
2
|
import { getClassNameMixin as r } from "../../_utils/config.js";
|
|
3
|
-
const
|
|
3
|
+
const m = e({
|
|
4
4
|
name: "FormItemMessage",
|
|
5
|
+
inheritAttrs: !1,
|
|
5
6
|
props: {
|
|
7
|
+
id: String,
|
|
6
8
|
error: {
|
|
7
9
|
type: Array,
|
|
8
10
|
default: () => []
|
|
@@ -16,5 +18,5 @@ const a = e({
|
|
|
16
18
|
}
|
|
17
19
|
});
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
m as default
|
|
20
22
|
};
|