@web-utils/form-ui 1.0.0-beta36 → 1.0.0-beta37
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/chunks/{iWQD3xvX.mjs → B17LMtNG.mjs} +11 -16
- package/chunks/{DFsI7Y6h.mjs → B2HO8aAj.mjs} +11 -11
- package/chunks/{axr9InkL.mjs → BC0gfvsl.mjs} +9 -13
- package/chunks/{DQxPzCsy.mjs → BMAsNnWL.mjs} +11 -15
- package/chunks/{DQJyNm1V.mjs → Bd1UFJic.mjs} +135 -131
- package/chunks/{D5_ctQqL.mjs → BeBtvo7Q.mjs} +1 -1
- package/chunks/{Cr1vBYne.mjs → BeyC-b9n.mjs} +12 -15
- package/chunks/{A3sHIRQ_.mjs → BiIR7j9T.mjs} +15 -42
- package/chunks/{_dm2lLNL.mjs → BrXlRZbl.mjs} +2 -2
- package/chunks/{BTS_zTkz.mjs → BufIRDd0.mjs} +35 -39
- package/chunks/{Buc52aVh.mjs → Byr79NWq.mjs} +11 -29
- package/chunks/{BLWwTutr.mjs → C81uwgZb.mjs} +14 -33
- package/chunks/{CNskrN5I.mjs → C95McWbI.mjs} +2 -2
- package/chunks/CE8bze--.mjs +231 -0
- package/chunks/{DcbnHU8K.mjs → CGmMqCP6.mjs} +19 -23
- package/chunks/{D7hD-ppq.mjs → CRrdgtwT.mjs} +1 -1
- package/chunks/{DistOy_O.mjs → CUvhHVXq.mjs} +27 -19
- package/chunks/{DJKE5P39.mjs → CZ6kuiWf.mjs} +2 -2
- package/chunks/{Dgyjc3LT.mjs → Cab-ZjRx.mjs} +29 -45
- package/chunks/{ZXCLnZFa.mjs → Ce5K-XbN.mjs} +111 -144
- package/chunks/{CLn0r4lV.mjs → CszLlvRH.mjs} +15 -17
- package/chunks/{CGJkMYZ4.mjs → D0M61zlJ.mjs} +11 -20
- package/chunks/DjX-fB-E.mjs +35 -0
- package/chunks/{BwdWZEjT.mjs → DkXSvAFI.mjs} +12 -18
- package/chunks/{DQKi5eEl.mjs → XqRTtFfp.mjs} +2 -2
- package/chunks/{BX-cVxlK.mjs → cmuHpsX6.mjs} +21 -14
- package/chunks/{1cDNhlSV.mjs → h0Y7oZ-O.mjs} +2 -2
- package/editable-tree/index.d.ts +1 -1
- package/editable-tree/index.mjs +1 -1
- package/element-dialog/index.d.ts +1 -1
- package/element-dialog/index.mjs +1 -1
- package/form-cascader/index.d.ts +0 -14
- package/form-cascader/index.mjs +1 -1
- package/form-check-box-group/index.d.ts +0 -2
- package/form-check-box-group/index.mjs +1 -1
- package/form-checkbox/index.d.ts +36 -10
- package/form-checkbox/index.mjs +1 -1
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +2 -6
- package/form-holder/index.mjs +1 -1
- package/form-image/index.d.ts +2 -14
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +0 -24
- package/form-input/index.mjs +1 -1
- package/form-input-cron-expression/index.mjs +1 -1
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +0 -6
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.mjs +1 -1
- package/form-item-x/index.mjs +1 -1
- package/form-radio-group/index.d.ts +0 -2
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +0 -2
- package/form-rate/index.mjs +1 -1
- package/form-select/index.d.ts +0 -14
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +0 -4
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +0 -2
- package/form-switch/index.mjs +1 -1
- package/form-text/index.mjs +1 -1
- package/helper/dictionary.mjs +1 -1
- package/iframe-window/index.mjs +1 -1
- package/index.mjs +25 -25
- package/package.json +1 -1
- package/pageable-table/index.d.ts +0 -38
- package/pageable-table/index.mjs +1 -1
- package/table-column/index.mjs +1 -1
- package/table-view/index.mjs +6 -6
- package/toolbar/index.mjs +1 -1
- package/toolbar-button/index.mjs +1 -1
- package/web-types.json +1 -1
- package/chunks/BLRY0zkF.mjs +0 -51
- package/chunks/BvsmTC3G.mjs +0 -229
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t, t as n } from "./
|
|
2
|
-
import { n as r, t as i } from "./
|
|
1
|
+
import { i as e, n as t, t as n } from "./CE8bze--.mjs";
|
|
2
|
+
import { n as r, t as i } from "./CRrdgtwT.mjs";
|
|
3
3
|
import { validatePhoneNum as a } from "@web-utils/core";
|
|
4
4
|
import { computed as o, createVNode as s, mergeProps as c, useModel as l } from "vue";
|
|
5
5
|
import { ElInput as u } from "element-plus/es";
|
|
@@ -97,47 +97,20 @@ var p = {
|
|
|
97
97
|
prefix: !0,
|
|
98
98
|
suffix: !0,
|
|
99
99
|
prepend: !0
|
|
100
|
-
}, h = [
|
|
101
|
-
"click",
|
|
102
|
-
"blur",
|
|
103
|
-
"focus",
|
|
104
|
-
"change",
|
|
105
|
-
"input",
|
|
106
|
-
"clear",
|
|
107
|
-
"keydown",
|
|
108
|
-
"mouseleave",
|
|
109
|
-
"mouseenter",
|
|
110
|
-
"compositionstart",
|
|
111
|
-
"compositionupdate",
|
|
112
|
-
"compositionend"
|
|
113
|
-
], g = (e) => r[e] === void 0 && m[e] !== !0, _ = {
|
|
100
|
+
}, h = (e) => r[e] === void 0 && m[e] !== !0, g = {
|
|
114
101
|
name: "FormInput",
|
|
115
102
|
inheritAttrs: !1,
|
|
116
103
|
props: { ...p },
|
|
117
|
-
emits: {
|
|
118
|
-
...t,
|
|
119
|
-
click: null,
|
|
120
|
-
blur: null,
|
|
121
|
-
focus: null,
|
|
122
|
-
change: null,
|
|
123
|
-
input: null,
|
|
124
|
-
clear: null,
|
|
125
|
-
keydown: null,
|
|
126
|
-
mouseleave: null,
|
|
127
|
-
mouseenter: null,
|
|
128
|
-
compositionstart: null,
|
|
129
|
-
compositionupdate: null,
|
|
130
|
-
compositionend: null
|
|
131
|
-
},
|
|
104
|
+
emits: { ...t },
|
|
132
105
|
setup(t, { emit: r, slots: i, attrs: p }) {
|
|
133
|
-
let m = l(t, "modelValue"),
|
|
106
|
+
let m = l(t, "modelValue"), g = `请输入正确的${t.label}!`, { render: _, placeholder: v, disabled: y, listeners: b, inputProps: x } = e(t, {
|
|
134
107
|
emit: r,
|
|
135
108
|
slots: i,
|
|
136
109
|
attrs: p,
|
|
137
110
|
rules: o(() => {
|
|
138
111
|
if (!t.type || t.type === "textarea") return null;
|
|
139
112
|
let e = {
|
|
140
|
-
message:
|
|
113
|
+
message: g,
|
|
141
114
|
trigger: "blur"
|
|
142
115
|
};
|
|
143
116
|
if (t.type === "email") e.validator = d;
|
|
@@ -146,17 +119,17 @@ var p = {
|
|
|
146
119
|
else return null;
|
|
147
120
|
return [e];
|
|
148
121
|
}),
|
|
149
|
-
|
|
150
|
-
predicate: g
|
|
122
|
+
predicate: h
|
|
151
123
|
});
|
|
152
|
-
return () =>
|
|
153
|
-
"
|
|
154
|
-
|
|
155
|
-
|
|
124
|
+
return () => _({ vNodes: s(u, c(b.value, x.value, {
|
|
125
|
+
class: ["form-input", {
|
|
126
|
+
"is-readonly": t.readonlyGrey && t.readonly && !t.picker,
|
|
127
|
+
"el-input-cursor-pointer": t.picker && !y.value
|
|
128
|
+
}],
|
|
156
129
|
modelValue: m.value,
|
|
157
130
|
"onUpdate:modelValue": (e) => m.value = e,
|
|
158
|
-
disabled:
|
|
159
|
-
placeholder:
|
|
131
|
+
disabled: y.value,
|
|
132
|
+
placeholder: v.value,
|
|
160
133
|
readonly: t.readonly || t.picker,
|
|
161
134
|
"prefix-icon": n({ icon: t.picker ? "el-icon-search" : t.prefixIcon }),
|
|
162
135
|
"suffix-icon": n({ icon: t.suffixIcon })
|
|
@@ -170,4 +143,4 @@ var p = {
|
|
|
170
143
|
}
|
|
171
144
|
};
|
|
172
145
|
//#endregion
|
|
173
|
-
export { p as n,
|
|
146
|
+
export { p as n, g as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import { n as t, t as n } from "./
|
|
1
|
+
import { n as e } from "./CE8bze--.mjs";
|
|
2
|
+
import { n as t, t as n } from "./BiIR7j9T.mjs";
|
|
3
3
|
import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
4
4
|
//#region src/components/form/FormInputPhoneNumber.vue?vue&type=script&lang.jsx
|
|
5
5
|
function s(e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as e } from "./
|
|
1
|
+
import { u as e } from "./cmuHpsX6.mjs";
|
|
2
2
|
import { formHolderContextKey as t, formViewContextKey as n } from "../constants/index.mjs";
|
|
3
3
|
import r from "../form-advice/index.mjs";
|
|
4
4
|
import i from "../form-red-table/index.mjs";
|
|
@@ -91,78 +91,74 @@ var _ = {
|
|
|
91
91
|
commentValueColspan: !0,
|
|
92
92
|
commentLabelColspan: !0,
|
|
93
93
|
wrapRow: !0
|
|
94
|
-
}, y =
|
|
94
|
+
}, y = (e) => v[e] !== !0, b = {
|
|
95
95
|
name: "FormHolder",
|
|
96
96
|
inheritAttrs: !1,
|
|
97
97
|
props: { ..._ },
|
|
98
|
-
emits: {
|
|
99
|
-
setup(_, { slots: v, expose:
|
|
100
|
-
let
|
|
101
|
-
emit: S,
|
|
102
|
-
events: y,
|
|
103
|
-
predicate: b
|
|
104
|
-
}), w = c(n, null), T = m("form"), E = o(() => _.notTableForm === void 0 ? (w == null ? void 0 : w.tableForm) === void 0 ? !1 : w == null ? void 0 : w.tableForm : !_.notTableForm), D = o(() => E.value ? !1 : _.showMessage), O = o(() => {
|
|
98
|
+
emits: {},
|
|
99
|
+
setup(_, { slots: v, expose: b }) {
|
|
100
|
+
let { autoBindProps: x, listeners: S } = e(_, { predicate: y }), C = c(n, null), w = m("form"), T = o(() => _.notTableForm === void 0 ? (C == null ? void 0 : C.tableForm) === void 0 ? !1 : C == null ? void 0 : C.tableForm : !_.notTableForm), E = o(() => T.value ? !1 : _.showMessage), D = o(() => {
|
|
105
101
|
let e = {};
|
|
106
102
|
return _.disabledFields && _.disabledFields.forEach((t) => {
|
|
107
103
|
e[t] = !0;
|
|
108
104
|
}), e;
|
|
109
|
-
}),
|
|
105
|
+
}), O = o(() => {
|
|
110
106
|
let e = {};
|
|
111
107
|
return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
|
|
112
108
|
e[t] = !0;
|
|
113
109
|
}), e;
|
|
114
|
-
}),
|
|
110
|
+
}), k = o(() => {
|
|
115
111
|
let e = {};
|
|
116
112
|
return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
|
|
117
113
|
e[t] = !0;
|
|
118
114
|
}), e;
|
|
119
|
-
}),
|
|
115
|
+
}), A = o(() => _.disabled === !0 ? !0 : _.disabled), j = p(() => _.enabledFields), M = p(() => _.requiredFields), N = p(() => _.disabledFields), P = async () => {
|
|
120
116
|
await u();
|
|
121
|
-
let e =
|
|
117
|
+
let e = w.value.$el.querySelector(".el-form-item.is-error");
|
|
122
118
|
e && e.scrollIntoView({
|
|
123
119
|
block: "center",
|
|
124
120
|
inline: "center",
|
|
125
121
|
behavior: "smooth"
|
|
126
122
|
});
|
|
127
|
-
},
|
|
128
|
-
tableForm:
|
|
129
|
-
disabled:
|
|
130
|
-
enabledFields:
|
|
131
|
-
requiredFields:
|
|
132
|
-
enabledFieldsMap:
|
|
133
|
-
disabledFieldsMap:
|
|
134
|
-
requiredFieldsMap:
|
|
135
|
-
disabledFields:
|
|
136
|
-
scrollIntoRequiredField:
|
|
137
|
-
formRef:
|
|
123
|
+
}, F = f({
|
|
124
|
+
tableForm: T,
|
|
125
|
+
disabled: A,
|
|
126
|
+
enabledFields: j,
|
|
127
|
+
requiredFields: M,
|
|
128
|
+
enabledFieldsMap: O,
|
|
129
|
+
disabledFieldsMap: D,
|
|
130
|
+
requiredFieldsMap: k,
|
|
131
|
+
disabledFields: N,
|
|
132
|
+
scrollIntoRequiredField: P,
|
|
133
|
+
formRef: w,
|
|
138
134
|
validate: async () => {
|
|
139
135
|
try {
|
|
140
|
-
return await
|
|
136
|
+
return await w.value.validate();
|
|
141
137
|
} catch {
|
|
142
|
-
throw await
|
|
138
|
+
throw await P(), w.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
|
|
143
139
|
a(e, "breathe-animation");
|
|
144
140
|
}), Error("表单验证不通过!");
|
|
145
141
|
}
|
|
146
142
|
},
|
|
147
|
-
validateField: (e) =>
|
|
148
|
-
resetFields: (e) =>
|
|
149
|
-
scrollToField: (e) =>
|
|
150
|
-
clearValidate: (e) =>
|
|
151
|
-
getField: () =>
|
|
152
|
-
setInitialValues: (e) =>
|
|
153
|
-
getFields: () =>
|
|
143
|
+
validateField: (e) => w.value.validateField(e),
|
|
144
|
+
resetFields: (e) => w.value.resetFields(e),
|
|
145
|
+
scrollToField: (e) => w.value.scrollToField(e),
|
|
146
|
+
clearValidate: (e) => w.value.clearValidate(e),
|
|
147
|
+
getField: () => w.value.getField(),
|
|
148
|
+
setInitialValues: (e) => w.value.setInitialValues(e),
|
|
149
|
+
getFields: () => w.value.fields
|
|
154
150
|
});
|
|
155
|
-
return d(t,
|
|
151
|
+
return d(t, F), b(F), () => s(h, l(S.value, x.value, {
|
|
156
152
|
ref: "form",
|
|
157
153
|
class: "form-holder",
|
|
158
|
-
"show-message":
|
|
159
|
-
}
|
|
160
|
-
if (
|
|
154
|
+
"show-message": E.value
|
|
155
|
+
}), { default: () => {
|
|
156
|
+
if (T.value) {
|
|
161
157
|
var e, t, n;
|
|
162
158
|
return [
|
|
163
159
|
(e = v.top) == null ? void 0 : e.call(v),
|
|
164
160
|
s(i, {
|
|
165
|
-
class: { "hide-error-message":
|
|
161
|
+
class: { "hide-error-message": T.value },
|
|
166
162
|
columns: _.columns,
|
|
167
163
|
"col-count": _.colCount
|
|
168
164
|
}, { default: () => {
|
|
@@ -186,4 +182,4 @@ var _ = {
|
|
|
186
182
|
}
|
|
187
183
|
};
|
|
188
184
|
//#endregion
|
|
189
|
-
export {
|
|
185
|
+
export { b as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n } from "./
|
|
1
|
+
import { i as e, n as t } from "./CE8bze--.mjs";
|
|
2
|
+
import { n } from "./CRrdgtwT.mjs";
|
|
3
3
|
import { useDictionary as r } from "../hook/useDictionary.mjs";
|
|
4
4
|
import { isNumber as i, isPlainObject as a, isString as o } from "@web-utils/core";
|
|
5
5
|
import { computed as s, createVNode as c, mergeProps as l, ref as u, watchEffect as d } from "vue";
|
|
@@ -217,35 +217,17 @@ var m = {
|
|
|
217
217
|
typing: !0,
|
|
218
218
|
multipleStringMode: !0,
|
|
219
219
|
multipleStringSeparator: !0
|
|
220
|
-
}, g = [
|
|
221
|
-
"change",
|
|
222
|
-
"visible-change",
|
|
223
|
-
"remove-tag",
|
|
224
|
-
"clear",
|
|
225
|
-
"blur",
|
|
226
|
-
"focus",
|
|
227
|
-
"popup-scroll"
|
|
228
|
-
], _ = (e) => n[e] === void 0 && h[e] !== !0, v = {
|
|
220
|
+
}, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
|
|
229
221
|
name: "FormSelect",
|
|
230
222
|
inheritAttrs: !1,
|
|
231
223
|
props: { ...m },
|
|
232
|
-
emits: {
|
|
233
|
-
...t,
|
|
234
|
-
change: null,
|
|
235
|
-
"visible-change": null,
|
|
236
|
-
"remove-tag": null,
|
|
237
|
-
clear: null,
|
|
238
|
-
blur: null,
|
|
239
|
-
focus: null,
|
|
240
|
-
"popup-scroll": null
|
|
241
|
-
},
|
|
224
|
+
emits: { ...t },
|
|
242
225
|
setup(t, { emit: n, slots: m, attrs: h }) {
|
|
243
|
-
let { emitInput:
|
|
226
|
+
let { emitInput: _, render: v, placeholder: y, disabled: b, listeners: x, inputProps: S } = e(t, {
|
|
244
227
|
emit: n,
|
|
245
228
|
slots: m,
|
|
246
229
|
attrs: h,
|
|
247
|
-
|
|
248
|
-
predicate: _,
|
|
230
|
+
predicate: g,
|
|
249
231
|
messagePrefix: "请选择"
|
|
250
232
|
}), C = u(null), w = u(!1);
|
|
251
233
|
d(() => {
|
|
@@ -255,7 +237,7 @@ var m = {
|
|
|
255
237
|
} else C.value = t.modelValue;
|
|
256
238
|
});
|
|
257
239
|
let T = (e) => {
|
|
258
|
-
if (t.multiple && t.multipleStringMode ?
|
|
240
|
+
if (t.multiple && t.multipleStringMode ? _(e.join(t.multipleStringSeparator)) : _(e), t.emitLabel) {
|
|
259
241
|
let r = O.value.find((n) => n[t.props.value] === e), i = r == null ? void 0 : r[t.props.label];
|
|
260
242
|
i !== t.optionLabel && n("update:optionLabel", i);
|
|
261
243
|
}
|
|
@@ -311,12 +293,12 @@ var m = {
|
|
|
311
293
|
};
|
|
312
294
|
return d(() => {
|
|
313
295
|
t.remote && k();
|
|
314
|
-
}), () =>
|
|
296
|
+
}), () => v({ vNodes: c(p, l(x.value, S.value, {
|
|
315
297
|
offset: t.dropDownOffset,
|
|
316
298
|
"model-value": C.value,
|
|
317
299
|
"onUpdate:modelValue": T,
|
|
318
|
-
disabled:
|
|
319
|
-
placeholder:
|
|
300
|
+
disabled: b.value,
|
|
301
|
+
placeholder: y.value
|
|
320
302
|
}), {
|
|
321
303
|
...m,
|
|
322
304
|
default: m.default || (() => {
|
|
@@ -331,4 +313,4 @@ var m = {
|
|
|
331
313
|
}
|
|
332
314
|
};
|
|
333
315
|
//#endregion
|
|
334
|
-
export {
|
|
316
|
+
export { _ as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, n as t } from "./
|
|
2
|
-
import { n, t as r } from "./
|
|
1
|
+
import { i as e, n as t } from "./CE8bze--.mjs";
|
|
2
|
+
import { n, t as r } from "./CRrdgtwT.mjs";
|
|
3
3
|
import { useDictionary as i } from "../hook/useDictionary.mjs";
|
|
4
4
|
import { findTreeChildren as a, isArray as o, isString as s, setParent as c } from "@web-utils/core";
|
|
5
5
|
import { computed as l, createVNode as u, mergeProps as d } from "vue";
|
|
@@ -148,34 +148,16 @@ var m = {
|
|
|
148
148
|
modelValue: !0,
|
|
149
149
|
readonly: !0,
|
|
150
150
|
props: !0
|
|
151
|
-
}, g = [
|
|
152
|
-
"change",
|
|
153
|
-
"expand-change",
|
|
154
|
-
"blur",
|
|
155
|
-
"focus",
|
|
156
|
-
"clear",
|
|
157
|
-
"visible-change",
|
|
158
|
-
"remove-tag"
|
|
159
|
-
], _ = (e) => n[e] === void 0 && h[e] !== !0, v = {
|
|
151
|
+
}, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
|
|
160
152
|
name: "FormCascader",
|
|
161
153
|
props: { ...m },
|
|
162
|
-
emits: {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
focus: null,
|
|
168
|
-
clear: null,
|
|
169
|
-
"visible-change": null,
|
|
170
|
-
"remove-tag": null
|
|
171
|
-
},
|
|
172
|
-
setup(t, { slots: n, emit: r, attrs: m }) {
|
|
173
|
-
let { emitInput: h, render: v, placeholder: y, disabled: b, autoBind: x } = e(t, {
|
|
174
|
-
emit: r,
|
|
175
|
-
slots: n,
|
|
154
|
+
emits: { ...t },
|
|
155
|
+
setup(t, { emit: n, slots: r, attrs: m }) {
|
|
156
|
+
let { emitInput: h, render: _, placeholder: v, disabled: y, listeners: b, inputProps: x } = e(t, {
|
|
157
|
+
emit: n,
|
|
158
|
+
slots: r,
|
|
176
159
|
attrs: m,
|
|
177
|
-
|
|
178
|
-
predicate: _
|
|
160
|
+
predicate: g
|
|
179
161
|
}), { dictItems: S } = i(t), C = l(() => {
|
|
180
162
|
if (t.dictType) return S.value;
|
|
181
163
|
if (t.options) {
|
|
@@ -193,10 +175,9 @@ var m = {
|
|
|
193
175
|
}), T = (e) => {
|
|
194
176
|
t.join && o(e) ? h(e.join(t.separator)) : h(t.last ? e[e.length - 1] : e);
|
|
195
177
|
};
|
|
196
|
-
return () =>
|
|
178
|
+
return () => _({ vNodes: u(p, d(b.value, x.value, {
|
|
197
179
|
style: "width: 100%",
|
|
198
|
-
class: { "is-readonly": t.readonly }
|
|
199
|
-
}, x.value, {
|
|
180
|
+
class: { "is-readonly": t.readonly },
|
|
200
181
|
"model-value": w.value,
|
|
201
182
|
options: C.value,
|
|
202
183
|
props: {
|
|
@@ -206,11 +187,11 @@ var m = {
|
|
|
206
187
|
emitPath: t.emitPath,
|
|
207
188
|
expandTrigger: "hover"
|
|
208
189
|
},
|
|
209
|
-
disabled:
|
|
210
|
-
placeholder:
|
|
190
|
+
disabled: y.value,
|
|
191
|
+
placeholder: v.value,
|
|
211
192
|
"onUpdate:modelValue": T
|
|
212
193
|
}), null) });
|
|
213
194
|
}
|
|
214
195
|
};
|
|
215
196
|
//#endregion
|
|
216
|
-
export {
|
|
197
|
+
export { _ as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./
|
|
2
|
-
import { n as t, t as n } from "./
|
|
1
|
+
import { n as e } from "./CE8bze--.mjs";
|
|
2
|
+
import { n as t, t as n } from "./BiIR7j9T.mjs";
|
|
3
3
|
import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
4
4
|
//#region src/components/form/FormInputIdCard.vue?vue&type=script&lang.jsx
|
|
5
5
|
function s(e) {
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { a as e, d as t, f as n } from "./cmuHpsX6.mjs";
|
|
2
|
+
import { formHolderContextKey as r, formItemConfigProviderContextKey as i, formItemGroupContextKey as a } from "../constants/index.mjs";
|
|
3
|
+
import { isArray as o, isPlainObject as s, isString as c } from "@web-utils/core";
|
|
4
|
+
import { computed as l, createVNode as u, h as d, inject as f, mergeProps as p, nextTick as m, unref as h, useTemplateRef as g } from "vue";
|
|
5
|
+
import { ElCol as _, rowContextKey as v } from "element-plus";
|
|
6
|
+
import { ElCol as y, ElFormItem as b, ElTooltip as x } from "element-plus/es";
|
|
7
|
+
//#region src/components/form/props/form-item.ts
|
|
8
|
+
var S = {
|
|
9
|
+
prop: [String, Array],
|
|
10
|
+
label: String,
|
|
11
|
+
labelPosition: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
},
|
|
15
|
+
labelWidth: [String, Number],
|
|
16
|
+
required: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: !1
|
|
19
|
+
},
|
|
20
|
+
rules: Object,
|
|
21
|
+
error: String,
|
|
22
|
+
showMessage: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: !0
|
|
25
|
+
},
|
|
26
|
+
inlineMessage: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
size: String,
|
|
31
|
+
for: String,
|
|
32
|
+
validateStatus: String,
|
|
33
|
+
messagePrefix: String,
|
|
34
|
+
message: String,
|
|
35
|
+
wrapCol: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: !0
|
|
38
|
+
},
|
|
39
|
+
fixedSpan: Number,
|
|
40
|
+
block: Boolean,
|
|
41
|
+
unwrap: Boolean,
|
|
42
|
+
half: Boolean,
|
|
43
|
+
formItemClass: String,
|
|
44
|
+
hideLabel: Boolean,
|
|
45
|
+
tips: { type: String },
|
|
46
|
+
tipsAfterLabel: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: !1
|
|
49
|
+
},
|
|
50
|
+
labelColspan: [Number, String],
|
|
51
|
+
inputColspan: [Number, String],
|
|
52
|
+
labelRowspan: [Number, String],
|
|
53
|
+
inputRowspan: [Number, String]
|
|
54
|
+
}, C = {
|
|
55
|
+
required: !0,
|
|
56
|
+
rules: !0,
|
|
57
|
+
messagePrefix: !0,
|
|
58
|
+
message: !0,
|
|
59
|
+
wrapCol: !0,
|
|
60
|
+
fixedSpan: !0,
|
|
61
|
+
block: !0,
|
|
62
|
+
unwrap: !0,
|
|
63
|
+
half: !0,
|
|
64
|
+
formItemClass: !0,
|
|
65
|
+
hideLabel: !0,
|
|
66
|
+
tips: !0,
|
|
67
|
+
tipsAfterLabel: !0,
|
|
68
|
+
labelColspan: !0,
|
|
69
|
+
inputColspan: !0,
|
|
70
|
+
labelRowspan: !0,
|
|
71
|
+
inputRowspan: !0
|
|
72
|
+
}, w = (e) => S[e] !== void 0 && C[e] !== !0, T = (t, { emit: n, events: r, predicate: i }) => l(() => e(t, i, r, n)), E = {
|
|
73
|
+
span: {
|
|
74
|
+
type: Number,
|
|
75
|
+
default: 12
|
|
76
|
+
},
|
|
77
|
+
offset: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 0
|
|
80
|
+
},
|
|
81
|
+
push: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 0
|
|
84
|
+
},
|
|
85
|
+
pull: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: 0
|
|
88
|
+
},
|
|
89
|
+
xs: { type: [Number, Object] },
|
|
90
|
+
sm: { type: [Number, Object] },
|
|
91
|
+
md: { type: [Number, Object] },
|
|
92
|
+
lg: { type: [Number, Object] },
|
|
93
|
+
xl: { type: [Number, Object] },
|
|
94
|
+
tag: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "div"
|
|
97
|
+
}
|
|
98
|
+
}, D = { span: !0 }, O = (e) => E[e] !== void 0 && D[e] !== !0, k = (t, { emit: n, events: r, predicate: i }) => l(() => e(t, i, r, n)), A = (e) => {
|
|
99
|
+
let t = f(r, null);
|
|
100
|
+
return l(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
101
|
+
}, j = (e, t) => {
|
|
102
|
+
let n = h(t);
|
|
103
|
+
c(n) ? e.push(n) : o(n) ? e.push(...n) : s(n) && e.push(n);
|
|
104
|
+
}, M = (e, { rules: t, attrs: n, messagePrefix: r, message: i, ...a } = {}) => {
|
|
105
|
+
let o = A(e);
|
|
106
|
+
return l(() => {
|
|
107
|
+
let s = { message: i }, c = h(t);
|
|
108
|
+
Object.keys({
|
|
109
|
+
...S,
|
|
110
|
+
...E
|
|
111
|
+
}).forEach((t) => {
|
|
112
|
+
t === "rules" ? e[t] && c ? s[t] = [...e[t], ...c] : e[t] ? s[t] = e[t] : c && (s[t] = c) : t === "messagePrefix" ? s[t] = e.messagePrefix || r : s[t] = e[t];
|
|
113
|
+
});
|
|
114
|
+
let l = [];
|
|
115
|
+
return j(l, n == null ? void 0 : n.class), j(l, a == null ? void 0 : a.class), s.required = o.value, s.class = l, s.style = n == null ? void 0 : n.style, s;
|
|
116
|
+
});
|
|
117
|
+
}, N = {
|
|
118
|
+
name: "FormItemX",
|
|
119
|
+
inheritAttrs: !1,
|
|
120
|
+
props: {
|
|
121
|
+
...S,
|
|
122
|
+
...E
|
|
123
|
+
},
|
|
124
|
+
setup(e, { attrs: t, slots: n, expose: a }) {
|
|
125
|
+
let o = f(v, null), s = f(i, null), c = f(r, null), d = t.embed ? l(() => t.disabled) : F(e), h = T(e, { predicate: w }), _ = k(e, { predicate: O }), S = l(() => (s == null ? void 0 : s.reactive) === !0 && s.block === !1 && e.fixedSpan === void 0 && !e.half), C = A(e), E = g("formItem"), D = l(() => (s == null ? void 0 : s.wrapCol) === !1 ? !1 : !!o && e.wrapCol), j = l(() => c != null && c.tableForm ? "" : s != null && s.block ? "100%" : e.half && D.value ? `calc(50% - ${o.gutter.value / 2}px)` : ""), M = l(() => (s == null ? void 0 : s.block) === !0 || e.block || e.half ? 24 : e.span), N = l(() => {
|
|
126
|
+
if (d.value) return [];
|
|
127
|
+
if (C.value) {
|
|
128
|
+
let t = {
|
|
129
|
+
required: !0,
|
|
130
|
+
message: e.message || `${e.messagePrefix || "请输入"}${e.label}`
|
|
131
|
+
};
|
|
132
|
+
return e.rules ? [...e.rules, t] : [t];
|
|
133
|
+
}
|
|
134
|
+
return e.rules;
|
|
135
|
+
});
|
|
136
|
+
return a({
|
|
137
|
+
clearValidate: async () => {
|
|
138
|
+
var e;
|
|
139
|
+
await m(), (e = E.value) == null || e.clearValidate();
|
|
140
|
+
},
|
|
141
|
+
validate: async () => {
|
|
142
|
+
var e;
|
|
143
|
+
await m(), (e = E.value) == null || e.validate();
|
|
144
|
+
}
|
|
145
|
+
}), () => {
|
|
146
|
+
var r;
|
|
147
|
+
let i = n.tips || e.tips, a = i ? u(x, {
|
|
148
|
+
effect: "light",
|
|
149
|
+
content: e.tips,
|
|
150
|
+
offset: 4
|
|
151
|
+
}, {
|
|
152
|
+
default: () => u("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
153
|
+
content: n.tips ? n.tips : null
|
|
154
|
+
}) : null, o = u(b, p(h.value, t, {
|
|
155
|
+
ref: "formItem",
|
|
156
|
+
style: { width: j.value },
|
|
157
|
+
class: [
|
|
158
|
+
"form-item",
|
|
159
|
+
e.formItemClass,
|
|
160
|
+
{
|
|
161
|
+
"form-item-hide-label": e.hideLabel,
|
|
162
|
+
"with-tips": !e.tipsAfterLabel && i,
|
|
163
|
+
required: d.value === !1 && C.value
|
|
164
|
+
}
|
|
165
|
+
],
|
|
166
|
+
rules: N.value
|
|
167
|
+
}), {
|
|
168
|
+
...n,
|
|
169
|
+
default: () => {
|
|
170
|
+
var t;
|
|
171
|
+
return [(t = n.default) == null ? void 0 : t.call(n, {
|
|
172
|
+
disabled: d.value,
|
|
173
|
+
required: C.value
|
|
174
|
+
}), i && !e.tipsAfterLabel ? a : null];
|
|
175
|
+
},
|
|
176
|
+
label: () => [n.label ? n.label() : e.label, e.tipsAfterLabel ? a : null]
|
|
177
|
+
}), s = [o, (r = n.below) == null ? void 0 : r.call(n)];
|
|
178
|
+
return e.unwrap ? s : D.value ? u(y, p(_.value, S.value ? {
|
|
179
|
+
xs: 24,
|
|
180
|
+
sm: 12,
|
|
181
|
+
md: 12,
|
|
182
|
+
lg: 8,
|
|
183
|
+
xl: 6
|
|
184
|
+
} : {}, { span: M.value }), { default: () => s }) : o;
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}, P = "update:modelValue", F = (e) => {
|
|
188
|
+
let t = f(r, null), n = f(a, null);
|
|
189
|
+
return l(() => {
|
|
190
|
+
if (e.disabled !== void 0) return e.disabled;
|
|
191
|
+
if (t) {
|
|
192
|
+
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
193
|
+
if (t.disabledFieldsMap[e.prop] === !0) return !0;
|
|
194
|
+
}
|
|
195
|
+
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
196
|
+
});
|
|
197
|
+
}, I = { [P]: null }, L = (e, t) => e(P, t), R = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? d(N, {
|
|
198
|
+
...n.value,
|
|
199
|
+
embed: !0,
|
|
200
|
+
disabled: i == null ? void 0 : i.value
|
|
201
|
+
}, {
|
|
202
|
+
default: () => t,
|
|
203
|
+
label: r.label,
|
|
204
|
+
error: r.error,
|
|
205
|
+
tips: r.tips,
|
|
206
|
+
below: r.below
|
|
207
|
+
}) : t, z = (r, { emit: i, slots: a, attrs: o, rules: s, events: c, predicate: u, messagePrefix: f = "请输入", removeOn: p = !1, ...m }) => {
|
|
208
|
+
let h = F(r), g = l(() => h.value ? "" : `${f}${r.label}`), v = M(r, {
|
|
209
|
+
rules: s,
|
|
210
|
+
attrs: o,
|
|
211
|
+
message: g.value,
|
|
212
|
+
...m
|
|
213
|
+
}), y = (e) => L(i, e), b = (e) => r.col ? d(_, { span: r.block ? 24 : r.span }, { default: () => e }) : e, x = ({ vNodes: e }) => R(r, {
|
|
214
|
+
vNodes: b(e),
|
|
215
|
+
formItemProps: v,
|
|
216
|
+
slots: a,
|
|
217
|
+
disabled: h
|
|
218
|
+
}), S = l(() => e(r, u, c, i)), C = n({ removeOn: p });
|
|
219
|
+
return {
|
|
220
|
+
emitInput: y,
|
|
221
|
+
render: x,
|
|
222
|
+
placeholder: g,
|
|
223
|
+
disabled: h,
|
|
224
|
+
formItemProps: v,
|
|
225
|
+
autoBind: S,
|
|
226
|
+
inputProps: t(r, u),
|
|
227
|
+
listeners: C
|
|
228
|
+
};
|
|
229
|
+
}, B = (e) => e.icon ? d("i", { class: e.icon }) : null;
|
|
230
|
+
//#endregion
|
|
231
|
+
export { N as a, S as c, z as i, I as n, M as o, R as r, E as s, B as t };
|