@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/base.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
:root{--el-disabled-text-color:#606266}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { n as e, o as t, r as n, t as r } from "./C-lymD_X.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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e, i as t, r as n } from "./C-lymD_X.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 "./C-lymD_X.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 "./C-lymD_X.mjs";
|
|
2
2
|
import { ElOption as r, ElSelect as i } from "element-plus/es";
|
|
3
3
|
import { createVNode as a } from "vue";
|
|
4
4
|
//#endregion
|
|
@@ -7,7 +7,7 @@ var o = {
|
|
|
7
7
|
name: "FormSelect",
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
props: {
|
|
10
|
-
...
|
|
10
|
+
...n,
|
|
11
11
|
modelValue: String,
|
|
12
12
|
options: [
|
|
13
13
|
String,
|
|
@@ -17,14 +17,15 @@ var o = {
|
|
|
17
17
|
Array
|
|
18
18
|
]
|
|
19
19
|
},
|
|
20
|
-
emits:
|
|
21
|
-
setup(
|
|
22
|
-
let { emitInput: s, render: c, placeholder: l, disabled: u } = e
|
|
20
|
+
emits: { ...e },
|
|
21
|
+
setup(e, { emit: n, slots: o }) {
|
|
22
|
+
let { emitInput: s, render: c, placeholder: l, disabled: u } = t(e, {
|
|
23
23
|
emit: n,
|
|
24
|
-
slots: o
|
|
24
|
+
slots: o,
|
|
25
|
+
messagePrefix: "请选择"
|
|
25
26
|
});
|
|
26
27
|
return () => c({ vNodes: a(i, {
|
|
27
|
-
modelValue:
|
|
28
|
+
modelValue: e.modelValue,
|
|
28
29
|
clearable: !0,
|
|
29
30
|
disabled: u.value,
|
|
30
31
|
"onUpdate:modelValue": s,
|
|
@@ -32,8 +33,8 @@ var o = {
|
|
|
32
33
|
}, {
|
|
33
34
|
...o,
|
|
34
35
|
default: o.default || (() => {
|
|
35
|
-
var
|
|
36
|
-
return (
|
|
36
|
+
var t;
|
|
37
|
+
return (t = e.options) == null ? void 0 : t.map(({ value: e, label: t }) => a(r, {
|
|
37
38
|
key: e,
|
|
38
39
|
label: t,
|
|
39
40
|
value: e
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { t as e } from "./EReAG82c.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 "./C-lymD_X.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] }));
|