@web-utils/form-ui 1.0.0-beta6 → 1.0.0-beta8
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/base.css +1 -1
- package/chunks/{ClNahmiU.mjs → 1glrRdhD.mjs} +6 -6
- package/chunks/{CdRsyF0n.mjs → 78hGOZc9.mjs} +10 -10
- package/chunks/{DC9b53M6.mjs → BID1Rr2O.mjs} +6 -6
- package/chunks/{jn_iQrVZ.mjs → BMkPC2kt.mjs} +4 -4
- package/chunks/BPJNSq9M.mjs +4 -0
- package/chunks/{C33EmJN8.mjs → BaExlbMY.mjs} +6 -6
- package/chunks/BeIZhqg_.mjs +167 -0
- package/chunks/{Bxj372sF.mjs → BmQGmui_.mjs} +14 -13
- package/chunks/{Bsz7y4Xp.mjs → BnycM8aG.mjs} +16 -15
- package/chunks/{DDVAgRED.mjs → BooKKkk0.mjs} +6 -6
- package/chunks/{DpJQABVD.mjs → Bpox2cVQ.mjs} +24 -23
- package/chunks/Bs_IYr3X.mjs +94 -0
- package/chunks/{C6Li3-l7.mjs → BuZDN2DV.mjs} +4 -4
- package/chunks/{CBcdalMX.mjs → C4JpDEWP.mjs} +8 -8
- package/chunks/{CstztYMu.mjs → DAjuA2O6.mjs} +4 -4
- package/chunks/{ZsLNWI9x.mjs → Dywq0t6V.mjs} +10 -9
- package/chunks/{BZ8aOa78.mjs → GlsJxLiF.mjs} +9 -9
- package/chunks/{BO9jWhBl.mjs → pFgf4c4i.mjs} +10 -9
- package/chunks/zb_1Xy1W.mjs +74 -0
- package/constants.d.ts +7 -1
- package/constants.mjs +2 -2
- package/form-check-box-group/index.d.ts +28 -2
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +28 -2
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +32 -2
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +24 -0
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +57 -2
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-email/index.d.ts +28 -2
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +28 -2
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +28 -2
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +28 -2
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-config-provider/index.d.ts +20 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-x/index.d.ts +21 -0
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +28 -2
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +28 -2
- package/form-rate/index.mjs +1 -1
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +28 -2
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +28 -2
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +28 -2
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +24 -0
- package/form-text/index.mjs +1 -1
- package/index.d.ts +35 -36
- package/index.mjs +31 -29
- package/input/style.css +1 -1
- package/json-editor/index.d.ts +32 -0
- package/json-editor/index.mjs +2 -0
- package/json-editor/style.css +1 -0
- package/package.json +5 -4
- package/resolver.mjs +22 -20
- package/web-types.json +1 -1
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/BHNKrW1j.mjs +0 -61
- /package/chunks/{B5BIQCcK.mjs → 6Ukll2os.mjs} +0 -0
package/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
:root{--el-disabled-text-color:#606266}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e, i as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElText as r } from "element-plus/es";
|
|
3
3
|
import { createVNode as i } from "vue";
|
|
4
4
|
//#endregion
|
|
@@ -7,13 +7,13 @@ var a = {
|
|
|
7
7
|
name: "FormText",
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
props: {
|
|
10
|
-
...
|
|
10
|
+
...n,
|
|
11
11
|
text: String
|
|
12
12
|
},
|
|
13
|
-
setup(
|
|
14
|
-
let o = n
|
|
15
|
-
return () => t(
|
|
16
|
-
vNodes: i(r, null, { default: a.default || (() =>
|
|
13
|
+
setup(n, { slots: a }) {
|
|
14
|
+
let o = e(n);
|
|
15
|
+
return () => t(n, {
|
|
16
|
+
vNodes: i(r, null, { default: a.default || (() => n.text) }),
|
|
17
17
|
formItemProps: o,
|
|
18
18
|
slots: a
|
|
19
19
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElInputNumber as r } from "element-plus/es";
|
|
3
3
|
import { createVNode as i } from "vue";
|
|
4
4
|
//#endregion
|
|
@@ -7,7 +7,7 @@ var a = {
|
|
|
7
7
|
name: "FormInputNumber",
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
props: {
|
|
10
|
-
...
|
|
10
|
+
...n,
|
|
11
11
|
modelValue: Number,
|
|
12
12
|
controls: Boolean,
|
|
13
13
|
align: {
|
|
@@ -17,23 +17,23 @@ var a = {
|
|
|
17
17
|
prefix: String,
|
|
18
18
|
suffix: String
|
|
19
19
|
},
|
|
20
|
-
emits:
|
|
21
|
-
setup(
|
|
22
|
-
let { emitInput: o, render: s, placeholder: c, disabled: l } = e
|
|
20
|
+
emits: { ...e },
|
|
21
|
+
setup(e, { emit: n, slots: a }) {
|
|
22
|
+
let { emitInput: o, render: s, placeholder: c, disabled: l } = t(e, {
|
|
23
23
|
emit: n,
|
|
24
24
|
slots: a
|
|
25
25
|
});
|
|
26
26
|
return () => s({ vNodes: i(r, {
|
|
27
27
|
style: "width: 100%",
|
|
28
|
-
align:
|
|
29
|
-
modelValue:
|
|
28
|
+
align: e.align,
|
|
29
|
+
modelValue: e.modelValue,
|
|
30
30
|
disabled: l.value,
|
|
31
|
-
controls:
|
|
31
|
+
controls: e.controls,
|
|
32
32
|
"onUpdate:modelValue": o,
|
|
33
33
|
placeholder: c.value
|
|
34
34
|
}, {
|
|
35
|
-
prefix: a.prefix ||
|
|
36
|
-
suffix: a.suffix ||
|
|
35
|
+
prefix: a.prefix || e.prefix ? () => e.prefix : null,
|
|
36
|
+
suffix: a.suffix || e.suffix ? () => e.suffix : null,
|
|
37
37
|
"decrease-icon": a["decrease-icon"],
|
|
38
38
|
"increase-icon": a["increase-icon"]
|
|
39
39
|
}) });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElRate as r } from "element-plus/es";
|
|
3
3
|
import { createVNode as i, isVNode as a } from "vue";
|
|
4
4
|
//#region src/components/form/FormRate.vue?vue&type=script&lang.jsx
|
|
@@ -11,17 +11,17 @@ var s = {
|
|
|
11
11
|
name: "FormRate",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: Number
|
|
16
16
|
},
|
|
17
|
-
emits:
|
|
18
|
-
setup(
|
|
19
|
-
let { emitInput: s, render: c, disabled: l } = e
|
|
17
|
+
emits: { ...e },
|
|
18
|
+
setup(e, { emit: n, slots: a }) {
|
|
19
|
+
let { emitInput: s, render: c, disabled: l } = t(e, {
|
|
20
20
|
emit: n,
|
|
21
21
|
slots: a
|
|
22
22
|
});
|
|
23
23
|
return () => c({ vNodes: i(r, {
|
|
24
|
-
modelValue:
|
|
24
|
+
modelValue: e.modelValue,
|
|
25
25
|
clearable: !0,
|
|
26
26
|
disabled: l.value,
|
|
27
27
|
"onUpdate:modelValue": s
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as r } from "./
|
|
1
|
+
import { a as e, n as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
|
+
import { t as r } from "./Bs_IYr3X.mjs";
|
|
3
3
|
import { createVNode as i, isVNode as a, mergeProps as o } from "vue";
|
|
4
4
|
//#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
|
|
5
5
|
function s(e) {
|
|
@@ -11,10 +11,10 @@ var c = {
|
|
|
11
11
|
name: "FormInputPhoneNumber",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: String
|
|
16
16
|
},
|
|
17
|
-
emits:
|
|
17
|
+
emits: { ...t },
|
|
18
18
|
setup(t, { emit: n, slots: a }) {
|
|
19
19
|
let c = (t) => e(n, t);
|
|
20
20
|
return () => i(r, o(t, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElSlider as r } from "element-plus/es";
|
|
3
3
|
import { createVNode as i, isVNode as a } from "vue";
|
|
4
4
|
//#region src/components/form/FormSlider.vue?vue&type=script&lang.jsx
|
|
@@ -11,17 +11,17 @@ var s = {
|
|
|
11
11
|
name: "FormSlider",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: [Number, Array]
|
|
16
16
|
},
|
|
17
|
-
emits:
|
|
18
|
-
setup(
|
|
19
|
-
let { emitInput: s, render: c, disabled: l } = e
|
|
17
|
+
emits: { ...e },
|
|
18
|
+
setup(e, { emit: n, slots: a }) {
|
|
19
|
+
let { emitInput: s, render: c, disabled: l } = t(e, {
|
|
20
20
|
emit: n,
|
|
21
21
|
slots: a
|
|
22
22
|
});
|
|
23
23
|
return () => c({ vNodes: i(r, {
|
|
24
|
-
modelValue:
|
|
24
|
+
modelValue: e.modelValue,
|
|
25
25
|
clearable: !0,
|
|
26
26
|
disabled: l.value,
|
|
27
27
|
"onUpdate:modelValue": s
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { t as e } from "./BPJNSq9M.mjs";
|
|
2
|
+
import { ElCol as t, ElFormItem as n, ElTooltip as r } from "element-plus/es";
|
|
3
|
+
import { computed as i, createVNode as a, h as o, inject as s, mergeProps as c, nextTick as l, unref as u, useTemplateRef as d } from "vue";
|
|
4
|
+
import { ElCol as f, rowContextKey as p } from "element-plus";
|
|
5
|
+
//#region src/components/form/form-item.js
|
|
6
|
+
var m = {
|
|
7
|
+
label: String,
|
|
8
|
+
prop: String,
|
|
9
|
+
required: Boolean,
|
|
10
|
+
rules: Array,
|
|
11
|
+
messagePrefix: String,
|
|
12
|
+
message: String,
|
|
13
|
+
wrapCol: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !0
|
|
16
|
+
},
|
|
17
|
+
fixedSpan: Number,
|
|
18
|
+
span: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 12
|
|
21
|
+
},
|
|
22
|
+
block: Boolean,
|
|
23
|
+
unwrap: Boolean,
|
|
24
|
+
half: Boolean,
|
|
25
|
+
formItemClass: String,
|
|
26
|
+
hideLabel: Boolean,
|
|
27
|
+
tips: { type: String },
|
|
28
|
+
tipsAfterLabel: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
labelColspan: [Number, String],
|
|
33
|
+
inputColspan: [Number, String],
|
|
34
|
+
labelRowspan: [Number, String],
|
|
35
|
+
inputRowspan: [Number, String]
|
|
36
|
+
}, h = (e) => {
|
|
37
|
+
let t = s("formHolder", null);
|
|
38
|
+
return i(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
39
|
+
}, g = (e, { rules: t, messagePrefix: n } = {}) => {
|
|
40
|
+
let r = h(e);
|
|
41
|
+
return i(() => {
|
|
42
|
+
let i = {}, a = u(t);
|
|
43
|
+
return Object.keys(m).forEach((t) => {
|
|
44
|
+
t === "rules" ? e[t] && a ? i[t] = [...e[t], ...a] : e[t] ? i[t] = e[t] : a && (i[t] = a) : t === "messagePrefix" ? i[t] = e.messagePrefix || n : i[t] = e[t];
|
|
45
|
+
}), i.required = r.value, i;
|
|
46
|
+
});
|
|
47
|
+
}, _ = {
|
|
48
|
+
name: "FormItemX",
|
|
49
|
+
inheritAttrs: !1,
|
|
50
|
+
props: { ...m },
|
|
51
|
+
setup(o, { attrs: u, slots: f, expose: m }) {
|
|
52
|
+
let g = s(p, null), _ = s(e, null), v = s("formHolder", null), y = u.embed ? i(() => u.disabled) : b(o), x = i(() => (_ == null ? void 0 : _.reactive) === !0 && _.block === !1 && o.fixedSpan === void 0 && !o.half), S = h(o), C = d("formItem"), w = i(() => (_ == null ? void 0 : _.wrapCol) === !1 ? !1 : !!g && o.wrapCol), T = i(() => v != null && v.tableForm ? "" : _ != null && _.block ? "100%" : o.half && w.value ? `calc(50% - ${g.gutter.value / 2}px)` : ""), E = i(() => (_ == null ? void 0 : _.block) === !0 || o.block || o.half ? 24 : o.span), D = i(() => {
|
|
53
|
+
if (y.value) return [];
|
|
54
|
+
if (S.value) {
|
|
55
|
+
let e = {
|
|
56
|
+
required: !0,
|
|
57
|
+
message: o.message || `${o.messagePrefix || "请输入"}${o.label}`
|
|
58
|
+
};
|
|
59
|
+
return o.rules ? [...o.rules, e] : [e];
|
|
60
|
+
}
|
|
61
|
+
return o.rules;
|
|
62
|
+
});
|
|
63
|
+
return m({
|
|
64
|
+
clearValidate: async () => {
|
|
65
|
+
var e;
|
|
66
|
+
await l(), (e = C.value) == null || e.clearValidate();
|
|
67
|
+
},
|
|
68
|
+
validate: async () => {
|
|
69
|
+
var e;
|
|
70
|
+
await l(), (e = C.value) == null || e.validate();
|
|
71
|
+
}
|
|
72
|
+
}), () => {
|
|
73
|
+
var e;
|
|
74
|
+
let i = f.tips || o.tips, s = i ? a(r, {
|
|
75
|
+
effect: "light",
|
|
76
|
+
content: o.tips,
|
|
77
|
+
offset: 4
|
|
78
|
+
}, {
|
|
79
|
+
default: () => a("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
80
|
+
content: f.tips ? f.tips : null
|
|
81
|
+
}) : null, l = a(n, {
|
|
82
|
+
ref: "formItem",
|
|
83
|
+
style: { width: T.value },
|
|
84
|
+
label: o.label,
|
|
85
|
+
class: [
|
|
86
|
+
"form-item",
|
|
87
|
+
o.formItemClass,
|
|
88
|
+
{
|
|
89
|
+
"form-item-hide-label": o.hideLabel,
|
|
90
|
+
"with-tips": !o.tipsAfterLabel && i,
|
|
91
|
+
required: y.value === !1 && S.value
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
prop: o.prop,
|
|
95
|
+
rules: D.value
|
|
96
|
+
}, {
|
|
97
|
+
...f,
|
|
98
|
+
default: () => {
|
|
99
|
+
var e;
|
|
100
|
+
return [(e = f.default) == null ? void 0 : e.call(f, {
|
|
101
|
+
disabled: y.value,
|
|
102
|
+
required: S.value
|
|
103
|
+
}), i && !o.tipsAfterLabel ? s : null];
|
|
104
|
+
},
|
|
105
|
+
label: () => [f.label ? f.label() : o.label, o.tipsAfterLabel ? s : null]
|
|
106
|
+
}), u = [l, (e = f.below) == null ? void 0 : e.call(f)];
|
|
107
|
+
return o.unwrap ? u : w.value ? a(t, c({ span: E.value }, x.value ? {
|
|
108
|
+
xs: 24,
|
|
109
|
+
sm: 12,
|
|
110
|
+
md: 12,
|
|
111
|
+
lg: 8,
|
|
112
|
+
xl: 6
|
|
113
|
+
} : {}), { default: () => u }) : l;
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}, v = "update:modelValue", y = {
|
|
117
|
+
...m,
|
|
118
|
+
wrapFormItem: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: !0
|
|
121
|
+
},
|
|
122
|
+
disabled: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: void 0
|
|
125
|
+
},
|
|
126
|
+
col: Boolean,
|
|
127
|
+
readonly: Boolean
|
|
128
|
+
}, b = (e) => {
|
|
129
|
+
let t = s("formHolder", null), n = s("formItemGroup", null);
|
|
130
|
+
return i(() => {
|
|
131
|
+
if (e.disabled !== void 0) return e.disabled;
|
|
132
|
+
if (t) {
|
|
133
|
+
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
134
|
+
if (t.disabledFieldsMap[e.prop] === !0) return !0;
|
|
135
|
+
}
|
|
136
|
+
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
137
|
+
});
|
|
138
|
+
}, x = { [v]: null }, S = (e, t) => e(v, t), C = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? o(_, {
|
|
139
|
+
...n.value,
|
|
140
|
+
embed: !0,
|
|
141
|
+
disabled: i == null ? void 0 : i.value
|
|
142
|
+
}, {
|
|
143
|
+
default: () => t,
|
|
144
|
+
label: r.label,
|
|
145
|
+
error: r.error,
|
|
146
|
+
tips: r.tips,
|
|
147
|
+
below: r.below
|
|
148
|
+
}) : t, w = (e, { emit: t, slots: n, rules: r, messagePrefix: a = "请输入" }) => {
|
|
149
|
+
let s = g(e, {
|
|
150
|
+
rules: r,
|
|
151
|
+
messagePrefix: a
|
|
152
|
+
}), c = b(e), l = (e) => S(t, e), u = (t) => e.col ? o(f, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
|
|
153
|
+
return {
|
|
154
|
+
emitInput: l,
|
|
155
|
+
render: ({ vNodes: t }) => C(e, {
|
|
156
|
+
vNodes: u(t),
|
|
157
|
+
formItemProps: s,
|
|
158
|
+
slots: n,
|
|
159
|
+
disabled: c
|
|
160
|
+
}),
|
|
161
|
+
placeholder: i(() => c.value ? "" : `${a}${e.label}`),
|
|
162
|
+
disabled: c,
|
|
163
|
+
formItemProps: s
|
|
164
|
+
};
|
|
165
|
+
}, T = (e) => e.icon ? o("i", { class: e.icon }) : null;
|
|
166
|
+
//#endregion
|
|
167
|
+
export { S as a, g as c, C as i, x as n, w as o, y as r, _ as s, T as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElCheckbox as r, ElCheckboxGroup as i } from "element-plus/es";
|
|
3
3
|
import { computed as a, createVNode as o, isVNode as s } from "vue";
|
|
4
4
|
//#region src/components/form/FormCheckBoxGroup.vue?vue&type=script&lang.jsx
|
|
@@ -11,7 +11,7 @@ var l = {
|
|
|
11
11
|
name: "FormCheckBoxGroup",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: [Array, String],
|
|
16
16
|
options: Array,
|
|
17
17
|
stringMode: Boolean,
|
|
@@ -20,17 +20,18 @@ var l = {
|
|
|
20
20
|
default: ","
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
|
-
emits:
|
|
24
|
-
setup(
|
|
25
|
-
let { emitInput: l, render: u, placeholder: d, disabled: f } = e
|
|
23
|
+
emits: { ...e },
|
|
24
|
+
setup(e, { emit: n, slots: s }) {
|
|
25
|
+
let { emitInput: l, render: u, placeholder: d, disabled: f } = t(e, {
|
|
26
26
|
emit: n,
|
|
27
|
-
slots: s
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
slots: s,
|
|
28
|
+
messagePrefix: "请选择"
|
|
29
|
+
}), p = (t) => l(e.stringMode ? t.join(e.delimiter) : t), m = a(() => {
|
|
30
|
+
if (e.stringMode) {
|
|
31
|
+
var t;
|
|
32
|
+
return Array.isArray(e.modelValue) ? e.modelValue.filter((e) => e) : ((t = e.modelValue) == null ? void 0 : t.split(e.delimiter).filter((e) => e)) ?? [];
|
|
32
33
|
}
|
|
33
|
-
return
|
|
34
|
+
return e.modelValue || [];
|
|
34
35
|
});
|
|
35
36
|
return () => u({ vNodes: o(i, {
|
|
36
37
|
modelValue: m.value,
|
|
@@ -40,8 +41,8 @@ var l = {
|
|
|
40
41
|
}, {
|
|
41
42
|
...s,
|
|
42
43
|
default: s.default || (() => {
|
|
43
|
-
var
|
|
44
|
-
return (
|
|
44
|
+
var t;
|
|
45
|
+
return (t = e.options) == null ? void 0 : t.map(({ value: e, label: t }) => o(r, {
|
|
45
46
|
key: e,
|
|
46
47
|
value: e
|
|
47
48
|
}, c(t) ? t : { default: () => [t] }));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElDatePicker as r } from "element-plus/es";
|
|
3
3
|
import { computed as i, createVNode as a } from "vue";
|
|
4
4
|
//#endregion
|
|
@@ -7,7 +7,7 @@ var o = {
|
|
|
7
7
|
name: "FormDatePicker",
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
props: {
|
|
10
|
-
...
|
|
10
|
+
...n,
|
|
11
11
|
modelValue: [
|
|
12
12
|
String,
|
|
13
13
|
Number,
|
|
@@ -26,34 +26,35 @@ var o = {
|
|
|
26
26
|
startDate: String,
|
|
27
27
|
endDate: String
|
|
28
28
|
},
|
|
29
|
-
emits:
|
|
30
|
-
...
|
|
31
|
-
"update:startDate",
|
|
32
|
-
"update:endDate"
|
|
33
|
-
|
|
34
|
-
setup(
|
|
35
|
-
let { emitInput: s, render: c, placeholder: l, disabled: u } = e
|
|
29
|
+
emits: {
|
|
30
|
+
...e,
|
|
31
|
+
"update:startDate": null,
|
|
32
|
+
"update:endDate": null
|
|
33
|
+
},
|
|
34
|
+
setup(e, { emit: n, slots: o }) {
|
|
35
|
+
let { emitInput: s, render: c, placeholder: l, disabled: u } = t(e, {
|
|
36
36
|
emit: n,
|
|
37
|
-
slots: o
|
|
37
|
+
slots: o,
|
|
38
|
+
messagePrefix: "请选择"
|
|
38
39
|
}), d = i(() => {
|
|
39
|
-
switch (
|
|
40
|
+
switch (e.type) {
|
|
40
41
|
case "date":
|
|
41
42
|
case "daterange": return "YYYY-MM-DD";
|
|
42
43
|
case "datetime":
|
|
43
44
|
case "datetimerange": return "YYYY-MM-DD HH:mm:ss";
|
|
44
45
|
default: return "";
|
|
45
46
|
}
|
|
46
|
-
}), f = i(() =>
|
|
47
|
+
}), f = i(() => e.split && e.type.indexOf("range") > -1), p = (e, t) => {
|
|
47
48
|
n("update:startDate", e), n("update:endDate", t);
|
|
48
49
|
}, m = (e) => {
|
|
49
50
|
f.value ? e ? p(e[0], e[1]) : p(null, null) : s(e);
|
|
50
|
-
}, h = i(() => f.value ? [
|
|
51
|
+
}, h = i(() => f.value ? [e.startDate, e.endDate] : e.modelValue);
|
|
51
52
|
return () => c({ vNodes: a(r, {
|
|
52
53
|
style: "width: 100%",
|
|
53
54
|
clearable: !0,
|
|
54
55
|
modelValue: h.value,
|
|
55
|
-
type:
|
|
56
|
-
unlinkPanels:
|
|
56
|
+
type: e.type,
|
|
57
|
+
unlinkPanels: e.unlinkPanels,
|
|
57
58
|
disabled: u.value,
|
|
58
59
|
"onUpdate:modelValue": m,
|
|
59
60
|
format: d.value,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as e, o as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
2
|
import { ElSwitch as r } from "element-plus/es";
|
|
3
3
|
import { createVNode as i, isVNode as a } from "vue";
|
|
4
4
|
//#region src/components/form/FormSwitch.vue?vue&type=script&lang.jsx
|
|
@@ -11,21 +11,21 @@ var s = {
|
|
|
11
11
|
name: "FormSwitch",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: [
|
|
16
16
|
Boolean,
|
|
17
17
|
String,
|
|
18
18
|
Number
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
|
-
emits:
|
|
22
|
-
setup(
|
|
23
|
-
let { emitInput: s, render: c, disabled: l } = e
|
|
21
|
+
emits: { ...e },
|
|
22
|
+
setup(e, { emit: n, slots: a }) {
|
|
23
|
+
let { emitInput: s, render: c, disabled: l } = t(e, {
|
|
24
24
|
emit: n,
|
|
25
25
|
slots: a
|
|
26
26
|
});
|
|
27
27
|
return () => c({ vNodes: i(r, {
|
|
28
|
-
modelValue:
|
|
28
|
+
modelValue: e.modelValue,
|
|
29
29
|
clearable: !0,
|
|
30
30
|
disabled: l.value,
|
|
31
31
|
"onUpdate:modelValue": s
|
|
@@ -15,51 +15,52 @@ var f = (e) => {
|
|
|
15
15
|
e = e.filter((e) => e.type !== n);
|
|
16
16
|
let s = [], c = e.length === 1;
|
|
17
17
|
for (let n = 0; n < e.length; n++) {
|
|
18
|
-
let
|
|
19
|
-
if (
|
|
20
|
-
tag:
|
|
18
|
+
let v = e[n], { name: y } = v.type;
|
|
19
|
+
if (v.type === i) s.push({
|
|
20
|
+
tag: y,
|
|
21
21
|
type: "text",
|
|
22
|
-
content:
|
|
22
|
+
content: v,
|
|
23
23
|
colspan: c ? o : 0
|
|
24
24
|
});
|
|
25
|
-
else if (
|
|
26
|
-
else if (u(
|
|
27
|
-
tag:
|
|
25
|
+
else if (v.type === r) s.push(...p(v.children, { columnSize: o }));
|
|
26
|
+
else if (u(v.type) && v.type === "td") s.push({
|
|
27
|
+
tag: v.type,
|
|
28
28
|
type: "td",
|
|
29
|
-
content:
|
|
29
|
+
content: v
|
|
30
30
|
});
|
|
31
|
-
else if (
|
|
32
|
-
tag:
|
|
31
|
+
else if (y === "FormCell") s.push({
|
|
32
|
+
tag: y,
|
|
33
33
|
type: "FormCell",
|
|
34
|
-
content:
|
|
34
|
+
content: v
|
|
35
35
|
});
|
|
36
|
-
else if (typeof
|
|
37
|
-
|
|
36
|
+
else if (typeof v.type == "object") {
|
|
37
|
+
var d, m;
|
|
38
|
+
let { label: e, hideLabel: n, labelColspan: r, inputColspan: i, labelRowspan: u, inputRowspan: p, tipsAfterLabel: b, tips: x } = f(v.props);
|
|
38
39
|
if (!l(n)) {
|
|
39
|
-
var
|
|
40
|
-
let n = (
|
|
40
|
+
var h, g, _;
|
|
41
|
+
let n = (h = v.children) == null ? void 0 : h.tips, i = n || x ? a(t, {
|
|
41
42
|
effect: "light",
|
|
42
|
-
content:
|
|
43
|
+
content: x,
|
|
43
44
|
offset: 4
|
|
44
45
|
}, {
|
|
45
46
|
default: () => a("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
46
47
|
content: n || null
|
|
47
48
|
}) : null;
|
|
48
49
|
s.push({
|
|
49
|
-
tag:
|
|
50
|
+
tag: y,
|
|
50
51
|
type: "label",
|
|
51
52
|
colspan: r,
|
|
52
53
|
rowspan: u,
|
|
53
|
-
content: [((
|
|
54
|
+
content: [((g = v.children) == null || (_ = g.label) == null ? void 0 : _.call(g)) || e, b === "" ? i : null]
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
tag:
|
|
57
|
+
let S;
|
|
58
|
+
S = c && l(n) ? o : l(i) ? i : c ? o - 1 : 0, s.push({
|
|
59
|
+
tag: y,
|
|
59
60
|
type: "input",
|
|
60
|
-
colspan:
|
|
61
|
+
colspan: S,
|
|
61
62
|
rowspan: p,
|
|
62
|
-
content:
|
|
63
|
+
content: [v, (d = v.children) == null || (m = d.below) == null ? void 0 : m.call(d)]
|
|
63
64
|
});
|
|
64
65
|
} else console.error("未知节点");
|
|
65
66
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { n as e, o as t, r as n, t as r } from "./BeIZhqg_.mjs";
|
|
2
|
+
import { computed as i, createVNode as a } from "vue";
|
|
3
|
+
import { ElInput as o } from "element-plus";
|
|
4
|
+
import { validatePhoneNum as s } from "@web-utils/core";
|
|
5
|
+
//#region src/util/form-validate.js
|
|
6
|
+
var c = (e, t, n) => t && !/^[A-Za-z0-9\u4e00-\u9fa5_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
|
|
7
|
+
function l(e, t, n) {
|
|
8
|
+
t && !/^[1-9][0-9]{5}(18|19|(2[0-9]))[0-9]{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)[0-9]{3}[0-9Xx]$/.test(t) ? n(/* @__PURE__ */ Error("invalid")) : n();
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/components/form/FormInput.vue?vue&type=script&lang.jsx
|
|
12
|
+
console.log(o.props.inputStyle.type);
|
|
13
|
+
for (let e = 0; e < o.props.inputStyle.type.length; e++) console.log(o.props.inputStyle.type[e].name);
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/components/form/FormInput.vue
|
|
16
|
+
var u = {
|
|
17
|
+
name: "FormInput",
|
|
18
|
+
inheritAttrs: !1,
|
|
19
|
+
props: {
|
|
20
|
+
...n,
|
|
21
|
+
modelValue: String,
|
|
22
|
+
type: String,
|
|
23
|
+
rows: Number,
|
|
24
|
+
prepend: String,
|
|
25
|
+
append: String,
|
|
26
|
+
prefix: String,
|
|
27
|
+
suffix: String,
|
|
28
|
+
readonlyGrey: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !0
|
|
31
|
+
},
|
|
32
|
+
maxLength: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "255"
|
|
35
|
+
},
|
|
36
|
+
picker: Boolean,
|
|
37
|
+
suffixIcon: String,
|
|
38
|
+
prefixIcon: String
|
|
39
|
+
},
|
|
40
|
+
emits: {
|
|
41
|
+
...e,
|
|
42
|
+
click: null,
|
|
43
|
+
clear: null
|
|
44
|
+
},
|
|
45
|
+
setup(e, { emit: n, slots: u }) {
|
|
46
|
+
let d = `请输入正确的${e.label}!`, { emitInput: f, render: p, placeholder: m, disabled: h } = t(e, {
|
|
47
|
+
emit: n,
|
|
48
|
+
slots: u,
|
|
49
|
+
rules: i(() => {
|
|
50
|
+
if (!e.type || e.type === "textarea") return null;
|
|
51
|
+
let t = {
|
|
52
|
+
message: d,
|
|
53
|
+
trigger: "blur"
|
|
54
|
+
};
|
|
55
|
+
if (e.type === "email") t.validator = c;
|
|
56
|
+
else if (e.type === "idcard") t.validator = l;
|
|
57
|
+
else if (e.type === "phone") t.validator = s;
|
|
58
|
+
else return null;
|
|
59
|
+
return [t];
|
|
60
|
+
})
|
|
61
|
+
}), g = (e) => {
|
|
62
|
+
n("click", e);
|
|
63
|
+
}, _ = () => {
|
|
64
|
+
n("clear");
|
|
65
|
+
};
|
|
66
|
+
return () => p({ vNodes: a(o, {
|
|
67
|
+
class: ["form-input", {
|
|
68
|
+
"is-readonly": e.readonlyGrey && e.readonly && !e.picker,
|
|
69
|
+
"el-input-cursor-pointer": e.picker && !h.value
|
|
70
|
+
}],
|
|
71
|
+
modelValue: e.modelValue,
|
|
72
|
+
type: e.type,
|
|
73
|
+
clearable: !0,
|
|
74
|
+
rows: e.rows,
|
|
75
|
+
readonly: e.readonly || e.picker,
|
|
76
|
+
maxLength: e.maxLength,
|
|
77
|
+
onClick: g,
|
|
78
|
+
onClear: _,
|
|
79
|
+
"prefix-icon": r({ icon: e.picker ? "el-icon-search" : e.prefixIcon }),
|
|
80
|
+
"suffix-icon": r({ icon: e.suffixIcon }),
|
|
81
|
+
disabled: h.value,
|
|
82
|
+
"onUpdate:modelValue": f,
|
|
83
|
+
placeholder: m.value
|
|
84
|
+
}, {
|
|
85
|
+
prefix: u.prefix || e.prefix ? () => e.prefix : null,
|
|
86
|
+
suffix: u.suffix || e.suffix ? () => e.suffix : null,
|
|
87
|
+
"password-icon": u["password-icon"],
|
|
88
|
+
prepend: u.prepend || e.prepend ? () => e.prepend : null,
|
|
89
|
+
append: u.append || e.append ? () => e.append : null
|
|
90
|
+
}) });
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
//#endregion
|
|
94
|
+
export { u as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as r } from "./
|
|
1
|
+
import { a as e, n as t, r as n } from "./BeIZhqg_.mjs";
|
|
2
|
+
import { t as r } from "./Bs_IYr3X.mjs";
|
|
3
3
|
import { createVNode as i, isVNode as a, mergeProps as o } from "vue";
|
|
4
4
|
//#region src/components/form/FormInputEmail.vue?vue&type=script&lang.jsx
|
|
5
5
|
function s(e) {
|
|
@@ -11,10 +11,10 @@ var c = {
|
|
|
11
11
|
name: "FormInputEmail",
|
|
12
12
|
inheritAttrs: !1,
|
|
13
13
|
props: {
|
|
14
|
-
...
|
|
14
|
+
...n,
|
|
15
15
|
modelValue: String
|
|
16
16
|
},
|
|
17
|
-
emits:
|
|
17
|
+
emits: { ...t },
|
|
18
18
|
setup(t, { emit: n, slots: a }) {
|
|
19
19
|
let c = (t) => e(n, t);
|
|
20
20
|
return () => i(r, o(t, {
|