@web-utils/form-ui 1.0.0-beta0
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 -0
- package/chunks/B4M_TFeR.mjs +152 -0
- package/chunks/B5BIQCcK.mjs +149 -0
- package/chunks/BHNKrW1j.mjs +61 -0
- package/chunks/BO9jWhBl.mjs +46 -0
- package/chunks/BZ8aOa78.mjs +35 -0
- package/chunks/Bsz7y4Xp.mjs +73 -0
- package/chunks/Bxj372sF.mjs +53 -0
- package/chunks/C33EmJN8.mjs +32 -0
- package/chunks/C6Li3-l7.mjs +28 -0
- package/chunks/CBcdalMX.mjs +35 -0
- package/chunks/CdRsyF0n.mjs +43 -0
- package/chunks/ClNahmiU.mjs +23 -0
- package/chunks/CstztYMu.mjs +28 -0
- package/chunks/D61GMx8I.mjs +8 -0
- package/chunks/DC9b53M6.mjs +32 -0
- package/chunks/DDVAgRED.mjs +36 -0
- package/chunks/DpJQABVD.mjs +91 -0
- package/chunks/ZsLNWI9x.mjs +46 -0
- package/chunks/jn_iQrVZ.mjs +28 -0
- package/constants.mjs +4 -0
- package/element-dialog/index.mjs +77 -0
- package/element-dialog/style.css +1 -0
- package/empty-view/index.mjs +46 -0
- package/empty-view/style.css +1 -0
- package/flex-scroll-area/index.mjs +32 -0
- package/flex-scroll-area/style.css +1 -0
- package/form-advice/index.mjs +28 -0
- package/form-cell/index.mjs +23 -0
- package/form-cell/style.css +1 -0
- package/form-check-box-group/index.mjs +2 -0
- package/form-checkbox/index.mjs +2 -0
- package/form-date-picker/index.mjs +2 -0
- package/form-holder/index.mjs +2 -0
- package/form-holder/style.css +1 -0
- package/form-image/index.mjs +2 -0
- package/form-input/index.mjs +2 -0
- package/form-input-email/index.mjs +2 -0
- package/form-input-id-card/index.mjs +2 -0
- package/form-input-number/index.mjs +2 -0
- package/form-input-phone-number/index.mjs +2 -0
- package/form-input-tag/index.mjs +4 -0
- package/form-input-time/index.mjs +4 -0
- package/form-item-group/index.mjs +78 -0
- package/form-item-group/style.css +1 -0
- package/form-item-x/index.mjs +2 -0
- package/form-radio-group/index.mjs +2 -0
- package/form-rate/index.mjs +2 -0
- package/form-red-table/index.mjs +64 -0
- package/form-red-table/style.css +1 -0
- package/form-row/index.mjs +2 -0
- package/form-row/style.css +1 -0
- package/form-select/index.mjs +2 -0
- package/form-slider/index.mjs +2 -0
- package/form-switch/index.mjs +2 -0
- package/form-text/index.mjs +2 -0
- package/form-view/index.mjs +9 -0
- package/index.mjs +38 -0
- package/input/style.css +1 -0
- package/package.json +32 -0
- package/table-view/index.mjs +9 -0
- package/toolbar/index.mjs +9 -0
- package/toolbar-button/index.mjs +9 -0
- package/web-types.json +1 -0
package/base.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,152 @@
|
|
|
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 };
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import e from "../form-advice/index.mjs";
|
|
2
|
+
import t from "../form-red-table/index.mjs";
|
|
3
|
+
import { ElForm as n, ElRow as r } from "element-plus/es";
|
|
4
|
+
import { computed as i, createVNode as a, inject as o, nextTick as s, provide as c, reactive as l, useTemplateRef as u, watch as d } from "vue";
|
|
5
|
+
import { animate as f } from "@web-utils/core";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/components/form/FormHolder.vue
|
|
8
|
+
var p = {
|
|
9
|
+
name: "FormHolder",
|
|
10
|
+
inheritAttrs: !1,
|
|
11
|
+
props: {
|
|
12
|
+
model: Object,
|
|
13
|
+
size: String,
|
|
14
|
+
disabled: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
labelPosition: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: "right"
|
|
21
|
+
},
|
|
22
|
+
labelWidth: {
|
|
23
|
+
type: [String, Number],
|
|
24
|
+
default: "auto"
|
|
25
|
+
},
|
|
26
|
+
required: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
requiredFields: Array,
|
|
31
|
+
disabledFields: Array,
|
|
32
|
+
enabledFields: Array,
|
|
33
|
+
showAdvice: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !0
|
|
36
|
+
},
|
|
37
|
+
columns: [Array, Object],
|
|
38
|
+
colCount: Number,
|
|
39
|
+
notTableForm: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
commentValueColspan: Number,
|
|
44
|
+
commentLabelColspan: Number,
|
|
45
|
+
showMessage: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !0
|
|
48
|
+
},
|
|
49
|
+
wrapRow: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !0
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
setup(p, { slots: m, expose: h }) {
|
|
55
|
+
let g = o("formView", null), _ = u("form"), v = i(() => p.notTableForm === void 0 ? (g == null ? void 0 : g.tableForm) === void 0 ? !1 : g == null ? void 0 : g.tableForm : !p.notTableForm), y = i(() => v.value ? !1 : p.showMessage), b = i(() => {
|
|
56
|
+
let e = {};
|
|
57
|
+
return p.disabledFields && p.disabledFields.forEach((t) => {
|
|
58
|
+
e[t] = !0;
|
|
59
|
+
}), e;
|
|
60
|
+
}), x = i(() => {
|
|
61
|
+
let e = {};
|
|
62
|
+
return p.enabledFields && p.enabledFields.length && p.enabledFields.forEach((t) => {
|
|
63
|
+
e[t] = !0;
|
|
64
|
+
}), e;
|
|
65
|
+
}), S = i(() => {
|
|
66
|
+
let e = {};
|
|
67
|
+
return p.requiredFields && p.requiredFields.length && p.requiredFields.forEach((t) => {
|
|
68
|
+
e[t] = !0;
|
|
69
|
+
}), e;
|
|
70
|
+
}), C = i(() => p.disabled === !0 ? !0 : p.disabled), w = i(() => p.enabledFields), T = i(() => p.requiredFields), E = i(() => p.disabledFields), D = async () => {
|
|
71
|
+
await s();
|
|
72
|
+
let e = _.value.$el.querySelector(".el-form-item.is-error");
|
|
73
|
+
e && e.scrollIntoView({
|
|
74
|
+
block: "center",
|
|
75
|
+
inline: "center",
|
|
76
|
+
behavior: "smooth"
|
|
77
|
+
});
|
|
78
|
+
}, O = async () => {
|
|
79
|
+
try {
|
|
80
|
+
return await _.value.validate();
|
|
81
|
+
} catch {
|
|
82
|
+
throw await D(), _.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
|
|
83
|
+
f(e, "breathe-animation");
|
|
84
|
+
}), Error("表单验证不通过!");
|
|
85
|
+
}
|
|
86
|
+
}, k = (e) => _.value.validateField(e), A = (e) => _.value.resetFields(e), j = (e) => _.value.scrollToField(e), M = (e) => _.value.clearValidate(e), N = () => _.value.getField(), P = (e) => _.value.setInitialValues(e), F = () => _.value.fields;
|
|
87
|
+
d(() => p.required, () => {
|
|
88
|
+
M();
|
|
89
|
+
});
|
|
90
|
+
let I = l({
|
|
91
|
+
tableForm: v,
|
|
92
|
+
disabled: C,
|
|
93
|
+
enabledFields: w,
|
|
94
|
+
requiredFields: T,
|
|
95
|
+
enabledFieldsMap: x,
|
|
96
|
+
disabledFieldsMap: b,
|
|
97
|
+
requiredFieldsMap: S,
|
|
98
|
+
disabledFields: E,
|
|
99
|
+
scrollIntoRequiredField: D,
|
|
100
|
+
formRef: _,
|
|
101
|
+
validate: O,
|
|
102
|
+
validateField: k,
|
|
103
|
+
resetFields: A,
|
|
104
|
+
scrollToField: j,
|
|
105
|
+
clearValidate: M,
|
|
106
|
+
getField: N,
|
|
107
|
+
setInitialValues: P,
|
|
108
|
+
getFields: F
|
|
109
|
+
});
|
|
110
|
+
return c("formHolder", I), h(I), () => a(n, {
|
|
111
|
+
ref: "form",
|
|
112
|
+
class: "form-holder",
|
|
113
|
+
model: p.model,
|
|
114
|
+
size: p.size,
|
|
115
|
+
"show-message": y.value,
|
|
116
|
+
disabled: p.disabled,
|
|
117
|
+
"label-width": p.labelWidth,
|
|
118
|
+
"label-position": p.labelPosition
|
|
119
|
+
}, { default: () => {
|
|
120
|
+
if (v.value) {
|
|
121
|
+
var n, i, o;
|
|
122
|
+
return [
|
|
123
|
+
(n = m.top) == null ? void 0 : n.call(m),
|
|
124
|
+
a(t, {
|
|
125
|
+
class: { "hide-error-message": v },
|
|
126
|
+
columns: p.columns,
|
|
127
|
+
"col-count": p.colCount
|
|
128
|
+
}, { default: () => {
|
|
129
|
+
var t;
|
|
130
|
+
return [(t = m.default) == null ? void 0 : t.call(m), p.showAdvice ? a(e, {
|
|
131
|
+
"label-colspan": p.commentLabelColspan,
|
|
132
|
+
"value-colspan": p.commentValueColspan
|
|
133
|
+
}, null) : null];
|
|
134
|
+
} }),
|
|
135
|
+
(i = m.bottom) == null ? void 0 : i.call(m),
|
|
136
|
+
a("div", { class: "red-form-footer" }, [(o = m.footer) == null ? void 0 : o.call(m)])
|
|
137
|
+
];
|
|
138
|
+
} else {
|
|
139
|
+
var s;
|
|
140
|
+
return p.wrapRow ? a(r, null, { default: () => {
|
|
141
|
+
var e;
|
|
142
|
+
return [(e = m.default) == null ? void 0 : e.call(m)];
|
|
143
|
+
} }) : (s = m.default) == null ? void 0 : s.call(m);
|
|
144
|
+
}
|
|
145
|
+
} });
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
//#endregion
|
|
149
|
+
export { p as t };
|
|
@@ -0,0 +1,61 @@
|
|
|
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 };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElRadio as r, ElRadioGroup as i } from "element-plus/es";
|
|
3
|
+
import { createVNode as a, isVNode as o } from "vue";
|
|
4
|
+
//#region src/components/form/FormRadioGroup.vue?vue&type=script&lang.jsx
|
|
5
|
+
function s(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !o(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormRadioGroup.vue
|
|
10
|
+
var c = {
|
|
11
|
+
name: "FormRadioGroup",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: {
|
|
14
|
+
...t,
|
|
15
|
+
modelValue: [
|
|
16
|
+
String,
|
|
17
|
+
Number,
|
|
18
|
+
Boolean
|
|
19
|
+
],
|
|
20
|
+
options: Array
|
|
21
|
+
},
|
|
22
|
+
emits: [...n],
|
|
23
|
+
setup(t, { emit: n, slots: o }) {
|
|
24
|
+
let { emitInput: c, render: l, placeholder: u, disabled: d } = e(t, {
|
|
25
|
+
emit: n,
|
|
26
|
+
slots: o
|
|
27
|
+
});
|
|
28
|
+
return () => l({ vNodes: a(i, {
|
|
29
|
+
modelValue: t.modelValue,
|
|
30
|
+
disabled: d.value,
|
|
31
|
+
"onUpdate:modelValue": c,
|
|
32
|
+
placeholder: u.value
|
|
33
|
+
}, {
|
|
34
|
+
...o,
|
|
35
|
+
default: o.default || (() => {
|
|
36
|
+
var e;
|
|
37
|
+
return (e = t.options) == null ? void 0 : e.map(({ value: e, label: t }) => a(r, {
|
|
38
|
+
key: e,
|
|
39
|
+
value: e
|
|
40
|
+
}, s(t) ? t : { default: () => [t] }));
|
|
41
|
+
})
|
|
42
|
+
}) });
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { c as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { n as e, r as t, s as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElImage as r } from "element-plus/es";
|
|
3
|
+
import { createVNode as i, isVNode as a } from "vue";
|
|
4
|
+
//#region src/components/form/FormImage.vue?vue&type=script&lang.jsx
|
|
5
|
+
function o(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormImage.vue
|
|
10
|
+
var s = {
|
|
11
|
+
name: "FormImage",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: {
|
|
14
|
+
...e,
|
|
15
|
+
src: String,
|
|
16
|
+
fit: String,
|
|
17
|
+
hideOnClickModal: Boolean
|
|
18
|
+
},
|
|
19
|
+
setup(e, { slots: a, attrs: s }) {
|
|
20
|
+
let c = n(e);
|
|
21
|
+
return () => t(e, {
|
|
22
|
+
vNodes: i(r, {
|
|
23
|
+
src: e.src,
|
|
24
|
+
fit: e.fit,
|
|
25
|
+
"preview-src-list": [e.src],
|
|
26
|
+
"hide-on-click-modal": e.hideOnClickModal,
|
|
27
|
+
style: s.style
|
|
28
|
+
}, o(a) ? a : { default: () => [a] }),
|
|
29
|
+
formItemProps: c,
|
|
30
|
+
slots: a
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { s as t };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElDatePicker as r } from "element-plus/es";
|
|
3
|
+
import { computed as i, createVNode as a } from "vue";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/components/form/FormDatePicker.vue
|
|
6
|
+
var o = {
|
|
7
|
+
name: "FormDatePicker",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
props: {
|
|
10
|
+
...t,
|
|
11
|
+
modelValue: [
|
|
12
|
+
String,
|
|
13
|
+
Number,
|
|
14
|
+
Date,
|
|
15
|
+
Array
|
|
16
|
+
],
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: "date"
|
|
20
|
+
},
|
|
21
|
+
unlinkPanels: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !0
|
|
24
|
+
},
|
|
25
|
+
split: Boolean,
|
|
26
|
+
startDate: String,
|
|
27
|
+
endDate: String
|
|
28
|
+
},
|
|
29
|
+
emits: [
|
|
30
|
+
...n,
|
|
31
|
+
"update:startDate",
|
|
32
|
+
"update:endDate"
|
|
33
|
+
],
|
|
34
|
+
setup(t, { emit: n, slots: o }) {
|
|
35
|
+
let { emitInput: s, render: c, placeholder: l, disabled: u } = e(t, {
|
|
36
|
+
emit: n,
|
|
37
|
+
slots: o
|
|
38
|
+
}), d = i(() => {
|
|
39
|
+
switch (t.type) {
|
|
40
|
+
case "date":
|
|
41
|
+
case "daterange": return "YYYY-MM-DD";
|
|
42
|
+
case "datetime":
|
|
43
|
+
case "datetimerange": return "YYYY-MM-DD HH:mm:ss";
|
|
44
|
+
default: return "";
|
|
45
|
+
}
|
|
46
|
+
}), f = i(() => t.split && t.type.indexOf("range") > -1), p = (e, t) => {
|
|
47
|
+
n("update:startDate", e), n("update:endDate", t);
|
|
48
|
+
}, m = (e) => {
|
|
49
|
+
f.value ? e ? p(e[0], e[1]) : p(null, null) : s(e);
|
|
50
|
+
}, h = i(() => f.value ? [t.startDate, t.endDate] : t.modelValue);
|
|
51
|
+
return () => c({ vNodes: a(r, {
|
|
52
|
+
style: "width: 100%",
|
|
53
|
+
clearable: !0,
|
|
54
|
+
modelValue: h.value,
|
|
55
|
+
type: t.type,
|
|
56
|
+
unlinkPanels: t.unlinkPanels,
|
|
57
|
+
disabled: u.value,
|
|
58
|
+
"onUpdate:modelValue": m,
|
|
59
|
+
format: d.value,
|
|
60
|
+
"value-format": d.value,
|
|
61
|
+
placeholder: l.value
|
|
62
|
+
}, {
|
|
63
|
+
default: o.default,
|
|
64
|
+
"range-separator": o["range-separator"],
|
|
65
|
+
"pre-month": o["pre-month"],
|
|
66
|
+
"next-month": o["next-month"],
|
|
67
|
+
"pre-year": o["pre-year"],
|
|
68
|
+
"next-year": o["next-year"]
|
|
69
|
+
}) });
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { o as t };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElCheckbox as r, ElCheckboxGroup as i } from "element-plus/es";
|
|
3
|
+
import { computed as a, createVNode as o, isVNode as s } from "vue";
|
|
4
|
+
//#region src/components/form/FormCheckBoxGroup.vue?vue&type=script&lang.jsx
|
|
5
|
+
function c(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !s(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormCheckBoxGroup.vue
|
|
10
|
+
var l = {
|
|
11
|
+
name: "FormCheckBoxGroup",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: {
|
|
14
|
+
...t,
|
|
15
|
+
modelValue: [Array, String],
|
|
16
|
+
options: Array,
|
|
17
|
+
stringMode: Boolean,
|
|
18
|
+
delimiter: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ","
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
emits: [...n],
|
|
24
|
+
setup(t, { emit: n, slots: s }) {
|
|
25
|
+
let { emitInput: l, render: u, placeholder: d, disabled: f } = e(t, {
|
|
26
|
+
emit: n,
|
|
27
|
+
slots: s
|
|
28
|
+
}), p = (e) => l(t.stringMode ? e.join(t.delimiter) : e), m = a(() => {
|
|
29
|
+
if (t.stringMode) {
|
|
30
|
+
var e;
|
|
31
|
+
return Array.isArray(t.modelValue) ? t.modelValue.filter((e) => e) : ((e = t.modelValue) == null ? void 0 : e.split(t.delimiter).filter((e) => e)) ?? [];
|
|
32
|
+
}
|
|
33
|
+
return t.modelValue || [];
|
|
34
|
+
});
|
|
35
|
+
return () => u({ vNodes: o(i, {
|
|
36
|
+
modelValue: m.value,
|
|
37
|
+
disabled: f.value,
|
|
38
|
+
"onUpdate:modelValue": p,
|
|
39
|
+
placeholder: d.value
|
|
40
|
+
}, {
|
|
41
|
+
...s,
|
|
42
|
+
default: s.default || (() => {
|
|
43
|
+
var e;
|
|
44
|
+
return (e = t.options) == null ? void 0 : e.map(({ value: e, label: t }) => o(r, {
|
|
45
|
+
key: e,
|
|
46
|
+
value: e
|
|
47
|
+
}, c(t) ? t : { default: () => [t] }));
|
|
48
|
+
})
|
|
49
|
+
}) });
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
export { l as t };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElSlider as r } from "element-plus/es";
|
|
3
|
+
import { createVNode as i, isVNode as a } from "vue";
|
|
4
|
+
//#region src/components/form/FormSlider.vue?vue&type=script&lang.jsx
|
|
5
|
+
function o(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormSlider.vue
|
|
10
|
+
var s = {
|
|
11
|
+
name: "FormSlider",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: {
|
|
14
|
+
...t,
|
|
15
|
+
modelValue: [Number, Array]
|
|
16
|
+
},
|
|
17
|
+
emits: [...n],
|
|
18
|
+
setup(t, { emit: n, slots: a }) {
|
|
19
|
+
let { emitInput: s, render: c, disabled: l } = e(t, {
|
|
20
|
+
emit: n,
|
|
21
|
+
slots: a
|
|
22
|
+
});
|
|
23
|
+
return () => c({ vNodes: i(r, {
|
|
24
|
+
modelValue: t.modelValue,
|
|
25
|
+
clearable: !0,
|
|
26
|
+
disabled: l.value,
|
|
27
|
+
"onUpdate:modelValue": s
|
|
28
|
+
}, o(a) ? a : { default: () => [a] }) });
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { s as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { i as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { t as r } from "./BHNKrW1j.mjs";
|
|
3
|
+
import { createVNode as i, isVNode as a, mergeProps as o } from "vue";
|
|
4
|
+
//#region src/components/form/FormInputEmail.vue?vue&type=script&lang.jsx
|
|
5
|
+
function s(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !a(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormInputEmail.vue
|
|
10
|
+
var c = {
|
|
11
|
+
name: "FormInputEmail",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: {
|
|
14
|
+
...t,
|
|
15
|
+
modelValue: String
|
|
16
|
+
},
|
|
17
|
+
emits: [...n],
|
|
18
|
+
setup(t, { emit: n, slots: a }) {
|
|
19
|
+
let c = (t) => e(n, t);
|
|
20
|
+
return () => i(r, o(t, {
|
|
21
|
+
modelValue: t.modelValue,
|
|
22
|
+
type: "email",
|
|
23
|
+
"onUpdate:modelValue": c
|
|
24
|
+
}), s(a) ? a : { default: () => [a] });
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { c as t };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { a as e, n as t, t as n } from "./B4M_TFeR.mjs";
|
|
2
|
+
import { ElCheckbox as r } from "element-plus/es";
|
|
3
|
+
import { createVNode as i } from "vue";
|
|
4
|
+
//#endregion
|
|
5
|
+
//#region src/components/form/FormCheckbox.vue
|
|
6
|
+
var a = {
|
|
7
|
+
name: "FormCheckbox",
|
|
8
|
+
inheritAttrs: !1,
|
|
9
|
+
props: {
|
|
10
|
+
...t,
|
|
11
|
+
modelValue: [
|
|
12
|
+
String,
|
|
13
|
+
Number,
|
|
14
|
+
Boolean
|
|
15
|
+
],
|
|
16
|
+
value: String,
|
|
17
|
+
label: String
|
|
18
|
+
},
|
|
19
|
+
emits: [...n],
|
|
20
|
+
setup(t, { emit: n, slots: a }) {
|
|
21
|
+
let { emitInput: o, render: s, disabled: c } = e(t, {
|
|
22
|
+
emit: n,
|
|
23
|
+
slots: a
|
|
24
|
+
});
|
|
25
|
+
return () => s({ vNodes: i(r, {
|
|
26
|
+
modelValue: t.modelValue,
|
|
27
|
+
value: t.value,
|
|
28
|
+
label: t.label,
|
|
29
|
+
disabled: c.value,
|
|
30
|
+
"onUpdate:modelValue": o
|
|
31
|
+
}, { default: a.default }) });
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { a as t };
|