@web-utils/form-ui 1.0.0-beta2 → 1.0.0-beta20
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/8ORg8rrN.mjs +108 -0
- package/chunks/B3DY36vM.mjs +106 -0
- package/chunks/B5B9au3z.mjs +180 -0
- package/chunks/B7fKv2-x.mjs +88 -0
- package/chunks/B9-9iYg8.mjs +42 -0
- package/chunks/BAm_wcwz.mjs +226 -0
- package/chunks/BJObhbQz.mjs +95 -0
- package/chunks/BLpnMrum.mjs +189 -0
- package/chunks/BSriw1Qr.mjs +53 -0
- package/chunks/BVzpe2oN.mjs +76 -0
- package/chunks/Bb43eI1f.mjs +93 -0
- package/chunks/Be_E_4G0.mjs +106 -0
- package/chunks/Bh_CMUlo.mjs +12 -0
- package/chunks/Bk3PtIYo.mjs +171 -0
- package/chunks/C1DlzLpD.mjs +222 -0
- package/chunks/CJeq96R0.mjs +73 -0
- package/chunks/CPE8fqJc.mjs +26 -0
- package/chunks/D7hrSVVl.mjs +98 -0
- package/chunks/D9GcEl6r.mjs +8 -0
- package/chunks/DAS1h_Ei.mjs +26 -0
- package/chunks/D_Xobj10.mjs +26 -0
- package/chunks/DgCwGit4.mjs +108 -0
- package/chunks/DgbDpRQg.mjs +51 -0
- package/chunks/DynLjTwi.mjs +17 -0
- package/chunks/lTFu0zgR.mjs +106 -0
- package/chunks/wfL1FAwc.mjs +1360 -0
- package/constants.d.ts +42 -0
- package/constants.mjs +3 -3
- package/element-dialog/index.d.ts +96 -0
- package/element-dialog/index.mjs +2 -92
- package/element-dialog/style.css +1 -1
- package/empty-view/index.d.ts +29 -0
- package/flex-scroll-area/index.d.ts +22 -0
- package/form-advice/index.d.ts +9 -0
- package/form-advice/index.mjs +13 -12
- package/form-cascader/index.d.ts +2 -0
- package/form-cascader/index.mjs +10 -0
- package/form-cell/index.d.ts +25 -0
- package/form-check-box-group/index.d.ts +293 -0
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +271 -0
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +421 -0
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +166 -0
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +224 -0
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +387 -0
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +215 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +363 -0
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +363 -0
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +325 -0
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +363 -0
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +2 -0
- package/form-input-time/index.d.ts +2 -0
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +92 -0
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +184 -0
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +281 -0
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +319 -0
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.d.ts +21 -0
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +11 -0
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +540 -0
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +348 -0
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +337 -0
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +227 -0
- package/form-text/index.mjs +1 -1
- package/form-view/index.d.ts +2 -0
- package/index.d.ts +42 -0
- package/index.mjs +39 -34
- package/input/style.css +1 -1
- package/month-calendar/index.d.ts +80 -0
- package/month-calendar/index.mjs +312 -0
- package/month-calendar/style.css +1 -0
- package/package.json +10 -7
- package/resolver.d.ts +9 -0
- package/resolver.mjs +29 -0
- package/table-view/index.d.ts +2 -0
- package/toolbar/index.d.ts +2 -0
- package/toolbar-button/index.d.ts +2 -0
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +174 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { columnSizeContextKey as e, setColumnSizeContextKey as t } from "../constants.mjs";
|
|
2
|
+
import n from "../form-cell/index.mjs";
|
|
3
|
+
import { ElTooltip as r } from "element-plus/es";
|
|
4
|
+
import { Comment as i, Fragment as a, Text as o, createVNode as s, inject as c, isVNode as l } from "vue";
|
|
5
|
+
import { camelize as u, isDef as d, isString as f } from "@web-utils/core";
|
|
6
|
+
//#region src/components/red-form/FormRow.vue?vue&type=script&lang.jsx
|
|
7
|
+
function p(e) {
|
|
8
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !l(e);
|
|
9
|
+
}
|
|
10
|
+
var m = (e) => {
|
|
11
|
+
let t = Object.keys({});
|
|
12
|
+
for (let n in e) t[u(n)] = e[n];
|
|
13
|
+
return t;
|
|
14
|
+
}, h = (e, { columnSize: t }) => {
|
|
15
|
+
if (!e || !e.length) return null;
|
|
16
|
+
e = e.filter((e) => e.type !== i);
|
|
17
|
+
let n = [], c = e.length === 1;
|
|
18
|
+
for (let i = 0; i < e.length; i++) {
|
|
19
|
+
let v = e[i], { name: y } = v.type;
|
|
20
|
+
if (v.type === o) n.push({
|
|
21
|
+
tag: y,
|
|
22
|
+
type: "text",
|
|
23
|
+
content: v,
|
|
24
|
+
colspan: c ? t : 0
|
|
25
|
+
});
|
|
26
|
+
else if (v.type === a) n.push(...h(v.children, { columnSize: t }));
|
|
27
|
+
else if (f(v.type) && v.type === "td") n.push({
|
|
28
|
+
tag: v.type,
|
|
29
|
+
type: "td",
|
|
30
|
+
content: v
|
|
31
|
+
});
|
|
32
|
+
else if (y === "FormCell") n.push({
|
|
33
|
+
tag: y,
|
|
34
|
+
type: "FormCell",
|
|
35
|
+
content: v
|
|
36
|
+
});
|
|
37
|
+
else if (typeof v.type == "object") {
|
|
38
|
+
var l, u;
|
|
39
|
+
let { label: e, hideLabel: i, labelColspan: a, inputColspan: o, labelRowspan: f, inputRowspan: h, tipsAfterLabel: b, tips: x } = m(v.props);
|
|
40
|
+
if (!d(i)) {
|
|
41
|
+
var p, g, _;
|
|
42
|
+
let t = (p = v.children) == null ? void 0 : p.tips, i = t || x ? s(r, {
|
|
43
|
+
effect: "light",
|
|
44
|
+
content: x,
|
|
45
|
+
offset: 4
|
|
46
|
+
}, {
|
|
47
|
+
default: () => s("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
48
|
+
content: t || null
|
|
49
|
+
}) : null;
|
|
50
|
+
n.push({
|
|
51
|
+
tag: y,
|
|
52
|
+
type: "label",
|
|
53
|
+
colspan: a,
|
|
54
|
+
rowspan: f,
|
|
55
|
+
content: [((g = v.children) == null || (_ = g.label) == null ? void 0 : _.call(g)) || e, b === "" ? i : null]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
let S;
|
|
59
|
+
S = c && d(i) ? t : d(o) ? o : c ? t - 1 : 0, n.push({
|
|
60
|
+
tag: y,
|
|
61
|
+
type: "input",
|
|
62
|
+
colspan: S,
|
|
63
|
+
rowspan: h,
|
|
64
|
+
content: [v, (l = v.children) == null || (u = l.below) == null ? void 0 : u.call(l)]
|
|
65
|
+
});
|
|
66
|
+
} else console.error("未知节点");
|
|
67
|
+
}
|
|
68
|
+
return n;
|
|
69
|
+
}, g = {
|
|
70
|
+
name: "FormRow",
|
|
71
|
+
props: {
|
|
72
|
+
isLabel: Boolean,
|
|
73
|
+
alignCenter: Boolean
|
|
74
|
+
},
|
|
75
|
+
setup(r, { slots: i }) {
|
|
76
|
+
let a = c(t, null), o = c(e, null);
|
|
77
|
+
return () => {
|
|
78
|
+
var e;
|
|
79
|
+
let t = (e = i.default) == null ? void 0 : e.call(i), c = [];
|
|
80
|
+
return c.push(...h(t, { columnSize: (o == null ? void 0 : o.value) ?? 0 })), ((o == null ? void 0 : o.value) ?? 0) < c.length && (a == null || a(c.length)), s("tr", null, [c.map(({ tag: e, type: t, colspan: i, rowspan: a, content: o }) => e === "td" || t === "FormCell" ? o : t === "text" ? s(n, {
|
|
81
|
+
isLabel: r.isLabel,
|
|
82
|
+
alignCenter: r.alignCenter,
|
|
83
|
+
colspan: i
|
|
84
|
+
}, p(o) ? o : { default: () => [o] }) : s("td", {
|
|
85
|
+
class: t,
|
|
86
|
+
colspan: i,
|
|
87
|
+
rowspan: a
|
|
88
|
+
}, [o]))]);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
//#endregion
|
|
93
|
+
export { g as t };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { i as e, n as t } from "./C1DlzLpD.mjs";
|
|
2
|
+
import { n } from "./DynLjTwi.mjs";
|
|
3
|
+
import { ElSwitch as r } from "element-plus/es";
|
|
4
|
+
import { createVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
5
|
+
//#region src/components/form/props/switch.js
|
|
6
|
+
var s = {
|
|
7
|
+
...n,
|
|
8
|
+
modelValue: [
|
|
9
|
+
Boolean,
|
|
10
|
+
String,
|
|
11
|
+
Number
|
|
12
|
+
],
|
|
13
|
+
loading: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
size: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
width: [Number, String],
|
|
22
|
+
inlinePrompt: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !1
|
|
25
|
+
},
|
|
26
|
+
activeIcon: [String, Object],
|
|
27
|
+
inactiveIcon: [String, Object],
|
|
28
|
+
activeActionIcon: [String, Object],
|
|
29
|
+
inactiveActionIcon: [String, Object],
|
|
30
|
+
activeText: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
},
|
|
34
|
+
inactiveText: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ""
|
|
37
|
+
},
|
|
38
|
+
activeValue: {
|
|
39
|
+
type: [
|
|
40
|
+
Boolean,
|
|
41
|
+
String,
|
|
42
|
+
Number
|
|
43
|
+
],
|
|
44
|
+
default: !0
|
|
45
|
+
},
|
|
46
|
+
inactiveValue: {
|
|
47
|
+
type: [
|
|
48
|
+
Boolean,
|
|
49
|
+
String,
|
|
50
|
+
Number
|
|
51
|
+
],
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
name: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: ""
|
|
57
|
+
},
|
|
58
|
+
validateEvent: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !0
|
|
61
|
+
},
|
|
62
|
+
beforeChange: Function,
|
|
63
|
+
id: String,
|
|
64
|
+
tabindex: [String, Number],
|
|
65
|
+
ariaLabel: String,
|
|
66
|
+
activeColor: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: ""
|
|
69
|
+
},
|
|
70
|
+
inactiveColor: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: ""
|
|
73
|
+
},
|
|
74
|
+
borderColor: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: ""
|
|
77
|
+
}
|
|
78
|
+
}, c = { modelValue: !0 }, l = ["change"], u = (e) => n[e] === void 0 && c[e] !== !0, d = {
|
|
79
|
+
name: "FormSwitch",
|
|
80
|
+
inheritAttrs: !1,
|
|
81
|
+
props: { ...s },
|
|
82
|
+
emits: {
|
|
83
|
+
...t,
|
|
84
|
+
change: null
|
|
85
|
+
},
|
|
86
|
+
setup(t, { emit: n, slots: s, attrs: c }) {
|
|
87
|
+
let d = o(t, "modelValue"), { render: f, disabled: p, autoBind: m } = e(t, {
|
|
88
|
+
emit: n,
|
|
89
|
+
slots: s,
|
|
90
|
+
events: l,
|
|
91
|
+
predicate: u
|
|
92
|
+
});
|
|
93
|
+
return () => f({ vNodes: i(r, a(m.value, c, {
|
|
94
|
+
modelValue: d.value,
|
|
95
|
+
"onUpdate:modelValue": (e) => d.value = e,
|
|
96
|
+
disabled: p.value
|
|
97
|
+
}), {
|
|
98
|
+
"active-action": s["active-action"],
|
|
99
|
+
"inactive-action": s["inactive-action"],
|
|
100
|
+
active: s.active,
|
|
101
|
+
inactive: s.inactive
|
|
102
|
+
}) });
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
//#endregion
|
|
106
|
+
export { d as t };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { computed as e } from "vue";
|
|
2
|
+
import { capitalize as t } from "@web-utils/core";
|
|
3
|
+
//#region src/util/index.js
|
|
4
|
+
var n = (e, n, r, i) => {
|
|
5
|
+
let a = {};
|
|
6
|
+
if (n) for (let t in e) n(t) && (a[t] = e[t]);
|
|
7
|
+
return r && r.forEach((e) => {
|
|
8
|
+
a[`on${t(e)}`] = (...t) => i(e, ...t);
|
|
9
|
+
}), a;
|
|
10
|
+
}, r = (t, { emit: r, events: i, predicate: a }) => e(() => n(t, a, i, r));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { r as n, n as t };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { i as e, n as t } from "./C1DlzLpD.mjs";
|
|
2
|
+
import { n } from "./DynLjTwi.mjs";
|
|
3
|
+
import { ElDatePicker as r } from "element-plus/es";
|
|
4
|
+
import { computed as i, createVNode as a, mergeProps as o } from "vue";
|
|
5
|
+
//#region src/components/form/props/date.js
|
|
6
|
+
var s = {
|
|
7
|
+
...n,
|
|
8
|
+
modelValue: [
|
|
9
|
+
Number,
|
|
10
|
+
String,
|
|
11
|
+
Date,
|
|
12
|
+
Array
|
|
13
|
+
],
|
|
14
|
+
readonly: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
size: String,
|
|
19
|
+
editable: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: !0
|
|
22
|
+
},
|
|
23
|
+
clearable: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !0
|
|
26
|
+
},
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
startPlaceholder: String,
|
|
32
|
+
endPlaceholder: String,
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: "date"
|
|
36
|
+
},
|
|
37
|
+
format: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "YYYY-MM-DD"
|
|
40
|
+
},
|
|
41
|
+
popperClass: String,
|
|
42
|
+
popperStyle: [String, Object],
|
|
43
|
+
popperOptions: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({})
|
|
46
|
+
},
|
|
47
|
+
rangeSeparator: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "-"
|
|
50
|
+
},
|
|
51
|
+
defaultValue: Object,
|
|
52
|
+
defaultTime: Object,
|
|
53
|
+
valueFormat: String,
|
|
54
|
+
id: [String, Array],
|
|
55
|
+
name: {
|
|
56
|
+
type: [String, Array],
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
unlinkPanels: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: !1
|
|
62
|
+
},
|
|
63
|
+
prefixIcon: [String, Object],
|
|
64
|
+
clearIcon: [String, Object],
|
|
65
|
+
validateEvent: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
},
|
|
69
|
+
disabledDate: Function,
|
|
70
|
+
shortcuts: {
|
|
71
|
+
type: Array,
|
|
72
|
+
default: () => []
|
|
73
|
+
},
|
|
74
|
+
cellClassName: Function,
|
|
75
|
+
teleported: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: !0
|
|
78
|
+
},
|
|
79
|
+
emptyValues: Array,
|
|
80
|
+
valueOnClear: [
|
|
81
|
+
String,
|
|
82
|
+
Number,
|
|
83
|
+
Boolean,
|
|
84
|
+
Function
|
|
85
|
+
],
|
|
86
|
+
fallbackPlacements: {
|
|
87
|
+
type: Array,
|
|
88
|
+
default: () => [
|
|
89
|
+
"bottom",
|
|
90
|
+
"top",
|
|
91
|
+
"right",
|
|
92
|
+
"left"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
placement: {
|
|
96
|
+
type: String,
|
|
97
|
+
default: "bottom"
|
|
98
|
+
},
|
|
99
|
+
showFooter: {
|
|
100
|
+
type: Boolean,
|
|
101
|
+
default: !0
|
|
102
|
+
},
|
|
103
|
+
showConfirm: {
|
|
104
|
+
type: Boolean,
|
|
105
|
+
default: !0
|
|
106
|
+
},
|
|
107
|
+
showWeekNumber: {
|
|
108
|
+
type: Boolean,
|
|
109
|
+
default: !1
|
|
110
|
+
},
|
|
111
|
+
automaticDropdown: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
default: !0
|
|
114
|
+
},
|
|
115
|
+
split: Boolean,
|
|
116
|
+
startDate: String,
|
|
117
|
+
endDate: String
|
|
118
|
+
}, c = {
|
|
119
|
+
modelValue: !0,
|
|
120
|
+
name: !0,
|
|
121
|
+
emptyValues: !0,
|
|
122
|
+
valueOnClear: !0
|
|
123
|
+
}, l = ["change"], u = (e) => n[e] === void 0 && c[e] !== !0, d = {
|
|
124
|
+
name: "FormDatePicker",
|
|
125
|
+
inheritAttrs: !1,
|
|
126
|
+
props: { ...s },
|
|
127
|
+
emits: {
|
|
128
|
+
...t,
|
|
129
|
+
"update:startDate": null,
|
|
130
|
+
"update:endDate": null
|
|
131
|
+
},
|
|
132
|
+
setup(t, { emit: n, slots: s, attrs: c }) {
|
|
133
|
+
let { emitInput: d, render: f, placeholder: p, disabled: m, autoBind: h } = e(t, {
|
|
134
|
+
emit: n,
|
|
135
|
+
slots: s,
|
|
136
|
+
attrs: c,
|
|
137
|
+
events: l,
|
|
138
|
+
predicate: u,
|
|
139
|
+
messagePrefix: "请选择"
|
|
140
|
+
}), g = i(() => {
|
|
141
|
+
switch (t.type) {
|
|
142
|
+
case "date":
|
|
143
|
+
case "daterange": return "YYYY-MM-DD";
|
|
144
|
+
case "datetime":
|
|
145
|
+
case "datetimerange": return "YYYY-MM-DD HH:mm:ss";
|
|
146
|
+
default: return "";
|
|
147
|
+
}
|
|
148
|
+
}), _ = i(() => t.split && t.type.indexOf("range") > -1), v = (e, t) => {
|
|
149
|
+
n("update:startDate", e), n("update:endDate", t);
|
|
150
|
+
}, y = (e) => {
|
|
151
|
+
_.value ? e ? v(e[0], e[1]) : v(null, null) : d(e);
|
|
152
|
+
}, b = i(() => _.value ? [t.startDate, t.endDate] : t.modelValue);
|
|
153
|
+
return () => f({ vNodes: a(r, o({ style: "width: 100%" }, h.value, {
|
|
154
|
+
modelValue: b.value,
|
|
155
|
+
disabled: m.value,
|
|
156
|
+
placeholder: p.value,
|
|
157
|
+
format: g.value,
|
|
158
|
+
"value-format": g.value,
|
|
159
|
+
"onUpdate:modelValue": y
|
|
160
|
+
}), {
|
|
161
|
+
default: s.default,
|
|
162
|
+
"range-separator": s["range-separator"],
|
|
163
|
+
"pre-month": s["pre-month"],
|
|
164
|
+
"next-month": s["next-month"],
|
|
165
|
+
"pre-year": s["pre-year"],
|
|
166
|
+
"next-year": s["next-year"]
|
|
167
|
+
}) });
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
//#endregion
|
|
171
|
+
export { d as t };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { formHolderContextKey as e, formItemConfigProviderContextKey as t, formItemGroupContextKey as n } from "../constants.mjs";
|
|
2
|
+
import { t as r } from "./Bh_CMUlo.mjs";
|
|
3
|
+
import { ElCol as i, ElFormItem as a, ElTooltip as o } from "element-plus/es";
|
|
4
|
+
import { computed as s, createVNode as c, h as l, inject as u, mergeProps as d, nextTick as f, unref as p, useTemplateRef as m } from "vue";
|
|
5
|
+
import { ElCol as h, rowContextKey as g } from "element-plus";
|
|
6
|
+
//#region src/components/form/props/form-item.js
|
|
7
|
+
var _ = {
|
|
8
|
+
prop: [String, Array],
|
|
9
|
+
label: String,
|
|
10
|
+
labelPosition: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
labelWidth: [String, Number],
|
|
15
|
+
required: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: !1
|
|
18
|
+
},
|
|
19
|
+
rules: Object,
|
|
20
|
+
error: String,
|
|
21
|
+
showMessage: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
inlineMessage: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
size: String,
|
|
30
|
+
for: String,
|
|
31
|
+
validateStatus: String,
|
|
32
|
+
messagePrefix: String,
|
|
33
|
+
message: String,
|
|
34
|
+
wrapCol: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !0
|
|
37
|
+
},
|
|
38
|
+
fixedSpan: Number,
|
|
39
|
+
block: Boolean,
|
|
40
|
+
unwrap: Boolean,
|
|
41
|
+
half: Boolean,
|
|
42
|
+
formItemClass: String,
|
|
43
|
+
hideLabel: Boolean,
|
|
44
|
+
tips: { type: String },
|
|
45
|
+
tipsAfterLabel: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
labelColspan: [Number, String],
|
|
50
|
+
inputColspan: [Number, String],
|
|
51
|
+
labelRowspan: [Number, String],
|
|
52
|
+
inputRowspan: [Number, String]
|
|
53
|
+
}, v = {
|
|
54
|
+
required: !0,
|
|
55
|
+
rules: !0,
|
|
56
|
+
messagePrefix: !0,
|
|
57
|
+
message: !0,
|
|
58
|
+
wrapCol: !0,
|
|
59
|
+
fixedSpan: !0,
|
|
60
|
+
block: !0,
|
|
61
|
+
unwrap: !0,
|
|
62
|
+
half: !0,
|
|
63
|
+
formItemClass: !0,
|
|
64
|
+
hideLabel: !0,
|
|
65
|
+
tips: !0,
|
|
66
|
+
tipsAfterLabel: !0,
|
|
67
|
+
labelColspan: !0,
|
|
68
|
+
inputColspan: !0,
|
|
69
|
+
labelRowspan: !0,
|
|
70
|
+
inputRowspan: !0
|
|
71
|
+
}, y = (e) => _[e] !== void 0 && v[e] !== !0, b = (e, { emit: t, events: n, predicate: i }) => s(() => r(e, i, n, t)), x = {
|
|
72
|
+
span: {
|
|
73
|
+
type: Number,
|
|
74
|
+
default: 12
|
|
75
|
+
},
|
|
76
|
+
offset: {
|
|
77
|
+
type: Number,
|
|
78
|
+
default: 0
|
|
79
|
+
},
|
|
80
|
+
push: {
|
|
81
|
+
type: Number,
|
|
82
|
+
default: 0
|
|
83
|
+
},
|
|
84
|
+
pull: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: 0
|
|
87
|
+
},
|
|
88
|
+
xs: { type: [Number, Object] },
|
|
89
|
+
sm: { type: [Number, Object] },
|
|
90
|
+
md: { type: [Number, Object] },
|
|
91
|
+
lg: { type: [Number, Object] },
|
|
92
|
+
xl: { type: [Number, Object] },
|
|
93
|
+
tag: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: "div"
|
|
96
|
+
}
|
|
97
|
+
}, S = { span: !0 }, C = (e) => x[e] !== void 0 && S[e] !== !0, w = (e, { emit: t, events: n, predicate: i }) => s(() => r(e, i, n, t)), T = (t) => {
|
|
98
|
+
let n = u(e, null);
|
|
99
|
+
return s(() => t.required === !0 ? !0 : (n == null ? void 0 : n.requiredFieldsMap[t.prop]) === !0);
|
|
100
|
+
}, E = (e, { rules: t, attrs: n, messagePrefix: r, message: i } = {}) => {
|
|
101
|
+
let a = T(e);
|
|
102
|
+
return s(() => {
|
|
103
|
+
let o = { message: i }, s = p(t);
|
|
104
|
+
return Object.keys({
|
|
105
|
+
..._,
|
|
106
|
+
...x
|
|
107
|
+
}).forEach((t) => {
|
|
108
|
+
t === "rules" ? e[t] && s ? o[t] = [...e[t], ...s] : e[t] ? o[t] = e[t] : s && (o[t] = s) : t === "messagePrefix" ? o[t] = e.messagePrefix || r : o[t] = e[t];
|
|
109
|
+
}), o.required = a.value, o.class = n == null ? void 0 : n.class, o.style = n == null ? void 0 : n.style, o;
|
|
110
|
+
});
|
|
111
|
+
}, D = {
|
|
112
|
+
name: "FormItemX",
|
|
113
|
+
inheritAttrs: !1,
|
|
114
|
+
props: {
|
|
115
|
+
..._,
|
|
116
|
+
...x
|
|
117
|
+
},
|
|
118
|
+
setup(n, { attrs: r, slots: l, expose: p }) {
|
|
119
|
+
let h = u(g, null), _ = u(t, null), v = u(e, null), x = r.embed ? s(() => r.disabled) : k(n), S = b(n, { predicate: y }), E = w(n, { predicate: C }), D = s(() => (_ == null ? void 0 : _.reactive) === !0 && _.block === !1 && n.fixedSpan === void 0 && !n.half), O = T(n), A = m("formItem"), j = s(() => (_ == null ? void 0 : _.wrapCol) === !1 ? !1 : !!h && n.wrapCol), M = s(() => v != null && v.tableForm ? "" : _ != null && _.block ? "100%" : n.half && j.value ? `calc(50% - ${h.gutter.value / 2}px)` : ""), N = s(() => (_ == null ? void 0 : _.block) === !0 || n.block || n.half ? 24 : n.span), P = s(() => {
|
|
120
|
+
if (x.value) return [];
|
|
121
|
+
if (O.value) {
|
|
122
|
+
let e = {
|
|
123
|
+
required: !0,
|
|
124
|
+
message: n.message || `${n.messagePrefix || "请输入"}${n.label}`
|
|
125
|
+
};
|
|
126
|
+
return n.rules ? [...n.rules, e] : [e];
|
|
127
|
+
}
|
|
128
|
+
return n.rules;
|
|
129
|
+
});
|
|
130
|
+
return p({
|
|
131
|
+
clearValidate: async () => {
|
|
132
|
+
var e;
|
|
133
|
+
await f(), (e = A.value) == null || e.clearValidate();
|
|
134
|
+
},
|
|
135
|
+
validate: async () => {
|
|
136
|
+
var e;
|
|
137
|
+
await f(), (e = A.value) == null || e.validate();
|
|
138
|
+
}
|
|
139
|
+
}), () => {
|
|
140
|
+
var e;
|
|
141
|
+
let t = l.tips || n.tips, r = t ? c(o, {
|
|
142
|
+
effect: "light",
|
|
143
|
+
content: n.tips,
|
|
144
|
+
offset: 4
|
|
145
|
+
}, {
|
|
146
|
+
default: () => c("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
147
|
+
content: l.tips ? l.tips : null
|
|
148
|
+
}) : null, s = c(a, d(S.value, {
|
|
149
|
+
ref: "formItem",
|
|
150
|
+
style: { width: M.value },
|
|
151
|
+
class: [
|
|
152
|
+
"form-item",
|
|
153
|
+
n.formItemClass,
|
|
154
|
+
{
|
|
155
|
+
"form-item-hide-label": n.hideLabel,
|
|
156
|
+
"with-tips": !n.tipsAfterLabel && t,
|
|
157
|
+
required: x.value === !1 && O.value
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
rules: P.value
|
|
161
|
+
}), {
|
|
162
|
+
...l,
|
|
163
|
+
default: () => {
|
|
164
|
+
var e;
|
|
165
|
+
return [(e = l.default) == null ? void 0 : e.call(l, {
|
|
166
|
+
disabled: x.value,
|
|
167
|
+
required: O.value
|
|
168
|
+
}), t && !n.tipsAfterLabel ? r : null];
|
|
169
|
+
},
|
|
170
|
+
label: () => [l.label ? l.label() : n.label, n.tipsAfterLabel ? r : null]
|
|
171
|
+
}), u = [s, (e = l.below) == null ? void 0 : e.call(l)];
|
|
172
|
+
return n.unwrap ? u : j.value ? c(i, d(E.value, D.value ? {
|
|
173
|
+
xs: 24,
|
|
174
|
+
sm: 12,
|
|
175
|
+
md: 12,
|
|
176
|
+
lg: 8,
|
|
177
|
+
xl: 6
|
|
178
|
+
} : {}, { span: N.value }), { default: () => u }) : s;
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}, O = "update:modelValue", k = (t) => {
|
|
182
|
+
let r = u(e, null), i = u(n, null);
|
|
183
|
+
return s(() => {
|
|
184
|
+
if (t.disabled !== void 0) return t.disabled;
|
|
185
|
+
if (r) {
|
|
186
|
+
if (r.requiredFieldsMap[t.prop] === !0 || r.enabledFieldsMap[t.prop] === !0) return !1;
|
|
187
|
+
if (r.disabledFieldsMap[t.prop] === !0) return !0;
|
|
188
|
+
}
|
|
189
|
+
return (i == null ? void 0 : i.enabled) === !0 ? !1 : (i == null ? void 0 : i.disabled) === !0 ? !0 : (r == null ? void 0 : r.disabled) === !0;
|
|
190
|
+
});
|
|
191
|
+
}, A = { [O]: null }, j = (e, t) => e(O, t), M = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? l(D, {
|
|
192
|
+
...n.value,
|
|
193
|
+
embed: !0,
|
|
194
|
+
disabled: i == null ? void 0 : i.value
|
|
195
|
+
}, {
|
|
196
|
+
default: () => t,
|
|
197
|
+
label: r.label,
|
|
198
|
+
error: r.error,
|
|
199
|
+
tips: r.tips,
|
|
200
|
+
below: r.below
|
|
201
|
+
}) : t, N = (e, { emit: t, slots: n, attrs: i, rules: a, events: o, predicate: c, messagePrefix: u = "请输入" }) => {
|
|
202
|
+
let d = k(e), f = s(() => d.value ? "" : `${u}${e.label}`), p = E(e, {
|
|
203
|
+
rules: a,
|
|
204
|
+
attrs: i,
|
|
205
|
+
message: f.value
|
|
206
|
+
}), m = (e) => j(t, e), g = (t) => e.col ? l(h, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
|
|
207
|
+
return {
|
|
208
|
+
emitInput: m,
|
|
209
|
+
render: ({ vNodes: t }) => M(e, {
|
|
210
|
+
vNodes: g(t),
|
|
211
|
+
formItemProps: p,
|
|
212
|
+
slots: n,
|
|
213
|
+
disabled: d
|
|
214
|
+
}),
|
|
215
|
+
placeholder: f,
|
|
216
|
+
disabled: d,
|
|
217
|
+
formItemProps: p,
|
|
218
|
+
autoBind: s(() => r(e, c, o, t))
|
|
219
|
+
};
|
|
220
|
+
}, P = (e) => e.icon ? l("i", { class: e.icon }) : null;
|
|
221
|
+
//#endregion
|
|
222
|
+
export { D as a, _ as c, N as i, A as n, E as o, M as r, x as s, P as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { i as e, n as t, t as n } from "./C1DlzLpD.mjs";
|
|
2
|
+
import { n as r, r as i, t as a } from "./B3DY36vM.mjs";
|
|
3
|
+
import { ElInput as o } from "element-plus/es";
|
|
4
|
+
import { computed as s, createVNode as c, mergeProps as l, useModel as u } from "vue";
|
|
5
|
+
import { validatePhoneNum as d } from "@web-utils/core";
|
|
6
|
+
//#region src/util/form-validate.js
|
|
7
|
+
var f = (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();
|
|
8
|
+
function p(e, t, n) {
|
|
9
|
+
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();
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/components/form/FormInput.vue
|
|
13
|
+
var m = {
|
|
14
|
+
name: "FormInput",
|
|
15
|
+
inheritAttrs: !1,
|
|
16
|
+
props: { ...a },
|
|
17
|
+
emits: {
|
|
18
|
+
...t,
|
|
19
|
+
click: null,
|
|
20
|
+
blur: null,
|
|
21
|
+
focus: null,
|
|
22
|
+
change: null,
|
|
23
|
+
input: null,
|
|
24
|
+
clear: null,
|
|
25
|
+
keydown: null,
|
|
26
|
+
mouseleave: null,
|
|
27
|
+
mouseenter: null,
|
|
28
|
+
compositionstart: null,
|
|
29
|
+
compositionupdate: null,
|
|
30
|
+
compositionend: null
|
|
31
|
+
},
|
|
32
|
+
setup(t, { emit: a, slots: m, attrs: h }) {
|
|
33
|
+
let g = u(t, "modelValue"), _ = `请输入正确的${t.label}!`, { render: v, placeholder: y, disabled: b, autoBind: x } = e(t, {
|
|
34
|
+
emit: a,
|
|
35
|
+
slots: m,
|
|
36
|
+
attrs: h,
|
|
37
|
+
rules: s(() => {
|
|
38
|
+
if (!t.type || t.type === "textarea") return null;
|
|
39
|
+
let e = {
|
|
40
|
+
message: _,
|
|
41
|
+
trigger: "blur"
|
|
42
|
+
};
|
|
43
|
+
if (t.type === "email") e.validator = f;
|
|
44
|
+
else if (t.type === "idcard") e.validator = p;
|
|
45
|
+
else if (t.type === "phone") e.validator = d;
|
|
46
|
+
else return null;
|
|
47
|
+
return [e];
|
|
48
|
+
}),
|
|
49
|
+
events: r,
|
|
50
|
+
predicate: i
|
|
51
|
+
});
|
|
52
|
+
return () => v({ vNodes: c(o, l({ class: ["form-input", {
|
|
53
|
+
"is-readonly": t.readonlyGrey && t.readonly && !t.picker,
|
|
54
|
+
"el-input-cursor-pointer": t.picker && !b.value
|
|
55
|
+
}] }, x.value, {
|
|
56
|
+
modelValue: g.value,
|
|
57
|
+
"onUpdate:modelValue": (e) => g.value = e,
|
|
58
|
+
disabled: b.value,
|
|
59
|
+
placeholder: y.value,
|
|
60
|
+
readonly: t.readonly || t.picker,
|
|
61
|
+
"prefix-icon": n({ icon: t.picker ? "el-icon-search" : t.prefixIcon }),
|
|
62
|
+
"suffix-icon": n({ icon: t.suffixIcon })
|
|
63
|
+
}), {
|
|
64
|
+
prefix: m.prefix || t.prefix ? () => t.prefix : null,
|
|
65
|
+
suffix: m.suffix || t.suffix ? () => t.suffix : null,
|
|
66
|
+
"password-icon": m["password-icon"],
|
|
67
|
+
prepend: m.prepend || t.prepend ? () => t.prepend : null,
|
|
68
|
+
append: m.append || t.append ? () => t.append : null
|
|
69
|
+
}) });
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { m as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { n as e } from "./C1DlzLpD.mjs";
|
|
2
|
+
import { t } from "./CJeq96R0.mjs";
|
|
3
|
+
import { t as n } from "./B3DY36vM.mjs";
|
|
4
|
+
import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
5
|
+
//#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
|
|
6
|
+
function s(e) {
|
|
7
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !i(e);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/components/form/FormInputPhoneNumber.vue
|
|
11
|
+
var c = {
|
|
12
|
+
name: "FormInputPhoneNumber",
|
|
13
|
+
inheritAttrs: !1,
|
|
14
|
+
props: { ...n },
|
|
15
|
+
emits: { ...e },
|
|
16
|
+
setup(e, { slots: n, attrs: i }) {
|
|
17
|
+
let c = o(e, "modelValue");
|
|
18
|
+
return () => r(t, a(e, i, {
|
|
19
|
+
modelValue: c.value,
|
|
20
|
+
"onUpdate:modelValue": (e) => c.value = e,
|
|
21
|
+
type: "phone"
|
|
22
|
+
}), s(n) ? n : { default: () => [n] });
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { c as t };
|