@web-utils/form-ui 1.0.0-beta1 → 1.0.0-beta11
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/8R_Eq-Q1.mjs +94 -0
- package/chunks/{ClNahmiU.mjs → 9r0_sTqG.mjs} +6 -6
- package/chunks/{CdRsyF0n.mjs → B0sH1q9x.mjs} +10 -10
- package/chunks/{ZsLNWI9x.mjs → B7c_xqYl.mjs} +10 -9
- package/chunks/C-lymD_X.mjs +167 -0
- package/chunks/{Bxj372sF.mjs → CBsIU5Nz.mjs} +14 -13
- package/chunks/CItjaxJe.mjs +28622 -0
- package/chunks/{CBcdalMX.mjs → CnmwUrOm.mjs} +8 -8
- package/chunks/{CstztYMu.mjs → CoU4aVFm.mjs} +4 -4
- package/chunks/{jn_iQrVZ.mjs → D6lrfzE7.mjs} +4 -4
- package/chunks/{DpJQABVD.mjs → DDKk9iwV.mjs} +24 -23
- package/chunks/{C33EmJN8.mjs → DF-zPBqJ.mjs} +6 -6
- package/chunks/{C6Li3-l7.mjs → DPkBzek6.mjs} +4 -4
- package/chunks/{Bsz7y4Xp.mjs → DQS-CovH.mjs} +16 -15
- package/chunks/{BO9jWhBl.mjs → DuPXiRRS.mjs} +10 -9
- package/chunks/EReAG82c.mjs +4 -0
- package/chunks/{DC9b53M6.mjs → MyHLh1cw.mjs} +6 -6
- package/chunks/{BZ8aOa78.mjs → TVsbSR1G.mjs} +9 -9
- package/chunks/{DDVAgRED.mjs → nNDPU9_n.mjs} +6 -6
- package/constants.d.ts +7 -0
- package/constants.mjs +3 -3
- package/element-dialog/index.d.ts +53 -0
- package/element-dialog/index.mjs +46 -32
- 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-cell/index.d.ts +25 -0
- package/form-check-box-group/index.d.ts +119 -0
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +107 -0
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.d.ts +134 -0
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +95 -0
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +106 -0
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +146 -0
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-email/index.d.ts +105 -0
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +105 -0
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +121 -0
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +105 -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 +20 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +18 -0
- package/form-item-x/index.d.ts +75 -0
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +107 -0
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +105 -0
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.d.ts +21 -0
- package/form-row/index.d.ts +11 -0
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +107 -0
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +105 -0
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +105 -0
- package/form-switch/index.mjs +1 -1
- package/form-text/index.d.ts +101 -0
- package/form-text/index.mjs +1 -1
- package/form-view/index.d.ts +2 -0
- package/index.d.ts +38 -0
- package/index.mjs +64 -37
- 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 +7 -7
- package/resolver.d.ts +9 -0
- package/resolver.mjs +81 -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/web-types.json +1 -1
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/BHNKrW1j.mjs +0 -61
- /package/chunks/{B5BIQCcK.mjs → 5J-OUxoQ.mjs} +0 -0
package/chunks/B4M_TFeR.mjs
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import { ElCol as e, ElFormItem as t, ElTooltip as n } from "element-plus/es";
|
|
2
|
-
import { computed as r, createVNode as i, h as a, inject as o, isVNode as s, nextTick as c, unref as l, useTemplateRef as u } from "vue";
|
|
3
|
-
import { ElCol as d, rowContextKey as f } from "element-plus";
|
|
4
|
-
//#region src/components/form/form-item.js
|
|
5
|
-
var p = {
|
|
6
|
-
label: String,
|
|
7
|
-
prop: String,
|
|
8
|
-
required: Boolean,
|
|
9
|
-
rules: Array,
|
|
10
|
-
span: {
|
|
11
|
-
type: Number,
|
|
12
|
-
default: 12
|
|
13
|
-
},
|
|
14
|
-
block: Boolean,
|
|
15
|
-
formItemClass: String,
|
|
16
|
-
hideLabel: Boolean,
|
|
17
|
-
tips: { type: String },
|
|
18
|
-
tipsAfterLabel: {
|
|
19
|
-
type: Boolean,
|
|
20
|
-
default: !1
|
|
21
|
-
},
|
|
22
|
-
labelColspan: [Number, String],
|
|
23
|
-
inputColspan: [Number, String],
|
|
24
|
-
labelRowspan: [Number, String],
|
|
25
|
-
inputRowspan: [Number, String]
|
|
26
|
-
}, m = (e) => {
|
|
27
|
-
let t = o("formHolder", null);
|
|
28
|
-
return r(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
29
|
-
}, h = (e, { rules: t } = {}) => {
|
|
30
|
-
let n = m(e);
|
|
31
|
-
return r(() => {
|
|
32
|
-
let r = {}, i = l(t);
|
|
33
|
-
return Object.keys(p).forEach((t) => {
|
|
34
|
-
t === "rules" ? e[t] && i ? r[t] = [...e[t], ...i] : e[t] ? r[t] = e[t] : i && (r[t] = i) : r[t] = e[t];
|
|
35
|
-
}), r.required = n.value, r;
|
|
36
|
-
});
|
|
37
|
-
};
|
|
38
|
-
//#endregion
|
|
39
|
-
//#region src/components/form/FormItemX.vue?vue&type=script&lang.jsx
|
|
40
|
-
function g(e) {
|
|
41
|
-
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
|
|
42
|
-
}
|
|
43
|
-
//#endregion
|
|
44
|
-
//#region src/components/form/FormItemX.vue
|
|
45
|
-
var _ = {
|
|
46
|
-
name: "FormItemX",
|
|
47
|
-
inheritAttrs: !1,
|
|
48
|
-
props: { ...p },
|
|
49
|
-
setup(a, { attrs: s, slots: l, expose: d }) {
|
|
50
|
-
let p = o(f, null), h = s.embed ? r(() => s.disabled) : b(a), _ = m(a), v = u("formItem"), y = r(() => !!p), x = r(() => {
|
|
51
|
-
if (h.value) return [];
|
|
52
|
-
if (_.value) {
|
|
53
|
-
let e = {
|
|
54
|
-
required: !0,
|
|
55
|
-
message: `请输入${a.label}`
|
|
56
|
-
};
|
|
57
|
-
return a.rules ? [...a.rules, e] : [e];
|
|
58
|
-
}
|
|
59
|
-
return a.rules;
|
|
60
|
-
});
|
|
61
|
-
return d({
|
|
62
|
-
clearValidate: async () => {
|
|
63
|
-
var e;
|
|
64
|
-
await c(), (e = v.value) == null || e.clearValidate();
|
|
65
|
-
},
|
|
66
|
-
validate: async () => {
|
|
67
|
-
var e;
|
|
68
|
-
await c(), (e = v.value) == null || e.validate();
|
|
69
|
-
}
|
|
70
|
-
}), () => {
|
|
71
|
-
let r = l.tips || a.tips, o = r ? i(n, {
|
|
72
|
-
effect: "light",
|
|
73
|
-
content: a.tips,
|
|
74
|
-
offset: 4
|
|
75
|
-
}, {
|
|
76
|
-
default: () => i("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
77
|
-
content: l.tips ? l.tips : null
|
|
78
|
-
}) : null, s = i(t, {
|
|
79
|
-
ref: "formItem",
|
|
80
|
-
label: a.label,
|
|
81
|
-
class: [
|
|
82
|
-
"form-item",
|
|
83
|
-
a.formItemClass,
|
|
84
|
-
{
|
|
85
|
-
"form-item-hide-label": a.hideLabel,
|
|
86
|
-
"with-tips": !a.tipsAfterLabel && r,
|
|
87
|
-
required: h.value === !1 && _.value
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
prop: a.prop,
|
|
91
|
-
rules: x.value
|
|
92
|
-
}, {
|
|
93
|
-
...l,
|
|
94
|
-
default: () => {
|
|
95
|
-
var e;
|
|
96
|
-
return [(e = l.default) == null ? void 0 : e.call(l, {
|
|
97
|
-
disabled: h.value,
|
|
98
|
-
required: _.value
|
|
99
|
-
}), r && !a.tipsAfterLabel ? o : null];
|
|
100
|
-
},
|
|
101
|
-
label: () => [l.label ? l.label() : a.label, a.tipsAfterLabel ? o : null]
|
|
102
|
-
});
|
|
103
|
-
return y.value ? i(e, { span: a.block ? 24 : a.span }, g(s) ? s : { default: () => [s] }) : s;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
}, v = "update:modelValue", y = {
|
|
107
|
-
...p,
|
|
108
|
-
wrapFormItem: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
default: !0
|
|
111
|
-
},
|
|
112
|
-
disabled: {
|
|
113
|
-
type: Boolean,
|
|
114
|
-
default: void 0
|
|
115
|
-
},
|
|
116
|
-
col: Boolean
|
|
117
|
-
}, b = (e) => {
|
|
118
|
-
let t = o("formHolder", null), n = o("formItemGroup", null);
|
|
119
|
-
return r(() => {
|
|
120
|
-
if (e.disabled !== void 0) return e.disabled;
|
|
121
|
-
if (t) {
|
|
122
|
-
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
123
|
-
if (t.disabledFieldsMap[e.prop] === !0) return !0;
|
|
124
|
-
}
|
|
125
|
-
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
126
|
-
});
|
|
127
|
-
}, x = [v], S = (e, t) => e(v, t), C = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? a(_, {
|
|
128
|
-
...n.value,
|
|
129
|
-
embed: !0,
|
|
130
|
-
disabled: i == null ? void 0 : i.value
|
|
131
|
-
}, {
|
|
132
|
-
default: () => t,
|
|
133
|
-
label: r.label,
|
|
134
|
-
error: r.error,
|
|
135
|
-
tips: r.tips
|
|
136
|
-
}) : t, w = (e, { emit: t, slots: n, rules: i }) => {
|
|
137
|
-
let o = h(e, { rules: i }), s = b(e), c = (e) => S(t, e), l = (t) => e.col ? a(d, { span: e.block ? 24 : e.span }, { default: () => t }) : t;
|
|
138
|
-
return {
|
|
139
|
-
emitInput: c,
|
|
140
|
-
render: ({ vNodes: t }) => C(e, {
|
|
141
|
-
vNodes: l(t),
|
|
142
|
-
formItemProps: o,
|
|
143
|
-
slots: n,
|
|
144
|
-
disabled: s
|
|
145
|
-
}),
|
|
146
|
-
placeholder: r(() => s.value ? "" : `请输入${e.label}`),
|
|
147
|
-
disabled: s,
|
|
148
|
-
formItemProps: o
|
|
149
|
-
};
|
|
150
|
-
};
|
|
151
|
-
//#endregion
|
|
152
|
-
export { w as a, S as i, y as n, _ as o, C as r, h as s, x as t };
|
package/chunks/BHNKrW1j.mjs
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
-
import { ElInput as r } from "element-plus/es";
|
|
3
|
-
import { computed as i, createVNode as a } from "vue";
|
|
4
|
-
import { validatePhoneNum as o } from "@web-utils/core";
|
|
5
|
-
//#region src/util/form-validate.js
|
|
6
|
-
var s = (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 c(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
|
|
12
|
-
var l = {
|
|
13
|
-
name: "FormInput",
|
|
14
|
-
inheritAttrs: !1,
|
|
15
|
-
props: {
|
|
16
|
-
...t,
|
|
17
|
-
modelValue: String,
|
|
18
|
-
type: String,
|
|
19
|
-
rows: Number,
|
|
20
|
-
prepend: String,
|
|
21
|
-
append: String,
|
|
22
|
-
prefix: String,
|
|
23
|
-
suffix: String
|
|
24
|
-
},
|
|
25
|
-
emits: [...n],
|
|
26
|
-
setup(t, { emit: n, slots: l }) {
|
|
27
|
-
let u = `请输入正确的${t.label}!`, { emitInput: d, render: f, placeholder: p, disabled: m } = e(t, {
|
|
28
|
-
emit: n,
|
|
29
|
-
slots: l,
|
|
30
|
-
rules: i(() => {
|
|
31
|
-
if (!t.type || t.type === "textarea") return null;
|
|
32
|
-
let e = {
|
|
33
|
-
message: u,
|
|
34
|
-
trigger: "blur"
|
|
35
|
-
};
|
|
36
|
-
if (t.type === "email") e.validator = s;
|
|
37
|
-
else if (t.type === "idcard") e.validator = c;
|
|
38
|
-
else if (t.type === "phone") e.validator = o;
|
|
39
|
-
else return null;
|
|
40
|
-
return [e];
|
|
41
|
-
})
|
|
42
|
-
});
|
|
43
|
-
return () => f({ vNodes: a(r, {
|
|
44
|
-
modelValue: t.modelValue,
|
|
45
|
-
type: t.type,
|
|
46
|
-
clearable: !0,
|
|
47
|
-
rows: t.rows,
|
|
48
|
-
disabled: m.value,
|
|
49
|
-
"onUpdate:modelValue": d,
|
|
50
|
-
placeholder: p.value
|
|
51
|
-
}, {
|
|
52
|
-
prefix: l.prefix || t.prefix ? () => t.prefix : null,
|
|
53
|
-
suffix: l.suffix || t.suffix ? () => t.suffix : null,
|
|
54
|
-
"password-icon": l["password-icon"],
|
|
55
|
-
prepend: l.prepend || t.prepend ? () => t.prepend : null,
|
|
56
|
-
append: l.append || t.append ? () => t.append : null
|
|
57
|
-
}) });
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
//#endregion
|
|
61
|
-
export { l as t };
|
|
File without changes
|