vft 0.0.370 → 0.0.372
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/dist/index.css +1 -1
- package/es/components/button/index.d.ts +9 -9
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/form/form-item.vue.d.ts +1 -1
- package/es/components/form/form-item.vue2.js +3 -2
- package/es/components/form/index.d.ts +30 -30
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/defaults.d.ts +7 -2
- package/es/components/select/defaults.js +3 -1
- package/es/components/select/option-item.vue.d.ts +12 -2
- package/es/components/select/select-dropdown.js +6 -6
- package/es/components/skeleton/index.d.ts +12 -0
- package/es/components/skeleton/skeleton-item.vue.d.ts +2 -0
- package/es/components/skeleton/skeleton-item.vue2.js +22 -16
- package/es/components/super-form/index.d.ts +5 -0
- package/es/components/super-form/super-form-action.vue2.js +42 -40
- package/es/components/super-form/super-form-item.vue2.js +312 -188
- package/es/components/super-form/super-form.vue.d.ts +2 -0
- package/es/components/super-form/super-form.vue2.js +64 -63
- package/es/components/super-form/types.d.ts +6 -0
- package/es/components/super-form/use/use-form-context.d.ts +1 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/button/index.d.ts +9 -9
- package/lib/components/form/form-item.vue.d.ts +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/index.d.ts +30 -30
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/defaults.cjs +1 -1
- package/lib/components/select/defaults.d.ts +7 -2
- package/lib/components/select/option-item.vue.d.ts +12 -2
- package/lib/components/select/select-dropdown.cjs +1 -1
- package/lib/components/skeleton/index.d.ts +12 -0
- package/lib/components/skeleton/skeleton-item.vue.d.ts +2 -0
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/super-form/index.d.ts +5 -0
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue.d.ts +2 -0
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +6 -0
- package/lib/components/super-form/use/use-form-context.d.ts +1 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/index.css +1 -1
- package/theme-style/src/common/icon.scss +1 -0
- package/theme-style/src/super-form.scss +15 -0
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,24 +1,122 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Q, computed as v, ref as re, unref as c, useSlots as oe, createVNode as s, mergeProps as L, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as G, resolveComponent as V } from "vue";
|
|
2
|
+
import "../alert/index.js";
|
|
3
|
+
import "../avatar/index.js";
|
|
4
|
+
import "../avatar-stack/index.js";
|
|
5
|
+
import "../backtop/index.js";
|
|
6
|
+
import "../button/index.js";
|
|
7
|
+
import "../card/index.js";
|
|
8
|
+
import "../cascader/index.js";
|
|
9
|
+
import "../cascader-panel/index.js";
|
|
10
|
+
import "../check-tag/index.js";
|
|
11
|
+
import "../checkbox/index.js";
|
|
12
|
+
import "../clamp/index.js";
|
|
13
|
+
import "../clamp-toggle/index.js";
|
|
14
|
+
import "../clamp-tooltip/index.js";
|
|
2
15
|
import { VftCol as X } from "../col/index.js";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
16
|
+
import "../collapse-transition/index.js";
|
|
17
|
+
import "../color-picker/index.js";
|
|
18
|
+
import "../config-provider/index.js";
|
|
19
|
+
import "../container/index.js";
|
|
20
|
+
import { isFunction as b, isBoolean as j, singleAttrToObj as z, cloneDeep as se, isArray as J, isNull as ae, upperFirst as me, isString as ce } from "@vft/utils";
|
|
21
|
+
import "../context-menu/context-menu.vue2.js";
|
|
22
|
+
import { VftIcon as W } from "../icon/index.js";
|
|
23
|
+
import "../date-picker/index.js";
|
|
24
|
+
import "../date-time-select/index.js";
|
|
25
|
+
import "../descriptions/index.js";
|
|
26
|
+
import "../dialog/index.js";
|
|
27
|
+
import { VftDivider as pe } from "../divider/index.js";
|
|
28
|
+
import "../drawer/index.js";
|
|
29
|
+
import "../dropdown/index.js";
|
|
30
|
+
import "../empty/index.js";
|
|
31
|
+
import "../footer-layout/index.js";
|
|
32
|
+
import { VftFormItem as ue } from "../form/index.js";
|
|
33
|
+
import "../full-screen/index.js";
|
|
34
|
+
import "../header-layout/index.js";
|
|
35
|
+
import "../horizontal-menu/index.js";
|
|
36
|
+
import "../icon-text/index.js";
|
|
37
|
+
import "../iframe-layout/index.js";
|
|
38
|
+
import "../image/index.js";
|
|
39
|
+
import "../image-viewer/index.js";
|
|
40
|
+
import "../input/index.js";
|
|
41
|
+
import "../input-number/index.js";
|
|
42
|
+
import "../link/index.js";
|
|
43
|
+
import "../list-cell/index.js";
|
|
44
|
+
import "../logo/index.js";
|
|
45
|
+
import "../menu/index.js";
|
|
46
|
+
import "../multiple-tabs/index.js";
|
|
47
|
+
import "../notification/index.js";
|
|
48
|
+
import "../overlay/index.js";
|
|
49
|
+
import "../page-wrapper/index.js";
|
|
50
|
+
import "../pagination/index.js";
|
|
51
|
+
import "../popconfirm/index.js";
|
|
52
|
+
import "../popover/index.js";
|
|
53
|
+
import "../popper/index.js";
|
|
54
|
+
import "../qrcode/index.js";
|
|
55
|
+
import "../radio/index.js";
|
|
56
|
+
import "../result/index.js";
|
|
57
|
+
import "../router-view-content/index.js";
|
|
58
|
+
import "../row/index.js";
|
|
59
|
+
import "../scrollbar/index.js";
|
|
60
|
+
import "../search/index.js";
|
|
61
|
+
import "../select/index.js";
|
|
62
|
+
import "../side-menu/index.js";
|
|
63
|
+
import "../skeleton/index.js";
|
|
64
|
+
import "../slider/index.js";
|
|
65
|
+
import "../space/index.js";
|
|
66
|
+
import "../steps/index.js";
|
|
67
|
+
import "../switch/index.js";
|
|
68
|
+
import "../table/index.js";
|
|
69
|
+
import "../tabs/index.js";
|
|
70
|
+
import "../tag/index.js";
|
|
71
|
+
import "../time-picker/index.js";
|
|
72
|
+
import { VftTooltip as fe } from "../tooltip/index.js";
|
|
73
|
+
import "../tree/index.js";
|
|
74
|
+
import "../verify-code/index.js";
|
|
75
|
+
import "../virtual-list/components/fixed-size-list.js";
|
|
76
|
+
import "../virtual-list/components/dynamic-size-list.js";
|
|
77
|
+
import "../virtual-list/components/fixed-size-grid.js";
|
|
78
|
+
import "../virtual-list/components/dynamic-size-grid.js";
|
|
79
|
+
import "../virtual-list/props.js";
|
|
80
|
+
import "../autocomplete/index.js";
|
|
81
|
+
import "../breadcrumb/index.js";
|
|
82
|
+
import "../carousel/index.js";
|
|
83
|
+
import "../collapse/index.js";
|
|
84
|
+
import "../countdown/index.js";
|
|
85
|
+
import "../input-tag/index.js";
|
|
86
|
+
import "../modal/index.js";
|
|
87
|
+
import "../progress/index.js";
|
|
88
|
+
import "../segmented/index.js";
|
|
89
|
+
import "../statistic/index.js";
|
|
90
|
+
import "./index.js";
|
|
91
|
+
import "../timeline/index.js";
|
|
92
|
+
import "../transfer/index.js";
|
|
93
|
+
import "../upload/index.js";
|
|
94
|
+
import "../watermark/index.js";
|
|
95
|
+
import "../md-code-demo/index.js";
|
|
96
|
+
import "../md-code-tabs/index.js";
|
|
97
|
+
import "../md-comment/index.js";
|
|
98
|
+
import "../md-container/index.js";
|
|
99
|
+
import "../md-tabs/index.js";
|
|
100
|
+
import "../md-vue-playground/index.js";
|
|
101
|
+
import "../infinite-scroll/index.js";
|
|
5
102
|
import "@vueuse/core";
|
|
6
|
-
import { isFunction as R, isBoolean as j, cloneDeep as ie, isArray as J, isNull as ae, upperFirst as ce, isString as ue } from "@vft/utils";
|
|
7
103
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
104
|
import "lodash-es";
|
|
9
|
-
import { useNamespace as
|
|
105
|
+
import { useNamespace as de } from "../../hooks/use-namespace/index.js";
|
|
10
106
|
import "../../hooks/use-model-toggle/index.js";
|
|
11
107
|
import "@popperjs/core";
|
|
12
108
|
import "../../hooks/use-z-index/index.js";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
109
|
+
import "../message/index.js";
|
|
110
|
+
import "../progress-i/index.js";
|
|
111
|
+
import { FormCompEnum as e, getComponent as $, isInput as he, isDatePicker as Ee, isRangePicker as Pe } from "./component-map.js";
|
|
112
|
+
import { createPlaceholderMessage as Y } from "./use/helper.js";
|
|
113
|
+
function q(o) {
|
|
114
|
+
return typeof o == "function" || Object.prototype.toString.call(o) === "[object Object]" && !le(o);
|
|
17
115
|
}
|
|
18
|
-
const
|
|
116
|
+
const Ce = Q({
|
|
19
117
|
inheritAttrs: !1
|
|
20
|
-
}),
|
|
21
|
-
...
|
|
118
|
+
}), Tr = /* @__PURE__ */ Q({
|
|
119
|
+
...Ce,
|
|
22
120
|
__name: "super-form-item",
|
|
23
121
|
props: {
|
|
24
122
|
schema: {},
|
|
@@ -29,30 +127,30 @@ const pe = $({
|
|
|
29
127
|
updateSchema: {},
|
|
30
128
|
formActionType: {}
|
|
31
129
|
},
|
|
32
|
-
setup(
|
|
33
|
-
const
|
|
130
|
+
setup(o) {
|
|
131
|
+
const S = de("super-form"), I = v(() => {
|
|
34
132
|
const {
|
|
35
133
|
mergeDynamicData: r
|
|
36
|
-
} =
|
|
134
|
+
} = o.formProps;
|
|
37
135
|
return {
|
|
38
|
-
field:
|
|
39
|
-
model:
|
|
136
|
+
field: o.schema.field,
|
|
137
|
+
model: o.formModel,
|
|
40
138
|
values: {
|
|
41
139
|
...r,
|
|
42
|
-
...
|
|
43
|
-
...
|
|
140
|
+
...o.allDefaultValues,
|
|
141
|
+
...o.formModel
|
|
44
142
|
},
|
|
45
|
-
schema:
|
|
46
|
-
elRef:
|
|
143
|
+
schema: o.schema,
|
|
144
|
+
elRef: w
|
|
47
145
|
};
|
|
48
146
|
}), K = v(() => {
|
|
49
147
|
let {
|
|
50
148
|
componentProps: r = {}
|
|
51
|
-
} =
|
|
52
|
-
|
|
53
|
-
schema:
|
|
54
|
-
formModel:
|
|
55
|
-
formActionType:
|
|
149
|
+
} = o.schema;
|
|
150
|
+
b(r) && (r = r({
|
|
151
|
+
schema: o.schema,
|
|
152
|
+
formModel: o.formModel,
|
|
153
|
+
formActionType: o.formActionType
|
|
56
154
|
}) ?? {});
|
|
57
155
|
const t = /* @__PURE__ */ new Map([[e.DIVIDER, {
|
|
58
156
|
type: "horizontal"
|
|
@@ -97,276 +195,302 @@ const pe = $({
|
|
|
97
195
|
"start-placeholder": "开始月份",
|
|
98
196
|
"end-placeholder": "结束月份"
|
|
99
197
|
}]]);
|
|
100
|
-
return t.has(
|
|
101
|
-
}),
|
|
198
|
+
return t.has(o.schema.type) && (r = Object.assign(t.get(o.schema.type) || {}, r)), o.formProps.inputMaxLength && [e.INPUT].includes(o.schema.type) && !r?.maxlength && (r.maxlength = o.formProps.inputMaxLength), r;
|
|
199
|
+
}), Z = v(() => {
|
|
102
200
|
const {
|
|
103
201
|
disabled: r
|
|
104
|
-
} =
|
|
202
|
+
} = o.formProps, {
|
|
105
203
|
dynamicDisabled: t
|
|
106
|
-
} =
|
|
107
|
-
disabled:
|
|
108
|
-
} =
|
|
109
|
-
let
|
|
110
|
-
return j(t) && (
|
|
204
|
+
} = o.schema, {
|
|
205
|
+
disabled: m = !1
|
|
206
|
+
} = c(K);
|
|
207
|
+
let a = !!r || m;
|
|
208
|
+
return j(t) && (a = t), b(t) && (a = t(c(I))), a;
|
|
111
209
|
});
|
|
112
|
-
function
|
|
210
|
+
function k() {
|
|
113
211
|
const {
|
|
114
212
|
show: r,
|
|
115
213
|
ifShow: t
|
|
116
|
-
} =
|
|
117
|
-
let
|
|
118
|
-
return j(r) && (
|
|
119
|
-
isShow:
|
|
120
|
-
isIfShow:
|
|
214
|
+
} = o.schema;
|
|
215
|
+
let m = !0, a = !0;
|
|
216
|
+
return j(r) && (m = r), j(t) && (a = t), b(r) && (m = r(c(I))), b(t) && (a = t(c(I))), {
|
|
217
|
+
isShow: m,
|
|
218
|
+
isIfShow: a
|
|
121
219
|
};
|
|
122
220
|
}
|
|
123
|
-
function
|
|
221
|
+
function _() {
|
|
124
222
|
const {
|
|
125
223
|
rules: r = [],
|
|
126
224
|
type: t = e.INPUT,
|
|
127
|
-
rulesMessageJoinLabel:
|
|
128
|
-
label:
|
|
129
|
-
title:
|
|
130
|
-
dynamicRule:
|
|
131
|
-
required:
|
|
132
|
-
dynamicRuleAdd:
|
|
133
|
-
} =
|
|
134
|
-
if (
|
|
135
|
-
return c(
|
|
136
|
-
let
|
|
225
|
+
rulesMessageJoinLabel: m,
|
|
226
|
+
label: a,
|
|
227
|
+
title: P,
|
|
228
|
+
dynamicRule: u,
|
|
229
|
+
required: h,
|
|
230
|
+
dynamicRuleAdd: f = !0
|
|
231
|
+
} = o.schema, p = a || P;
|
|
232
|
+
if (b(u) && !f)
|
|
233
|
+
return u(c(I));
|
|
234
|
+
let i = se(J(r) ? r : [r]);
|
|
137
235
|
const {
|
|
138
|
-
rulesMessageJoinLabel:
|
|
139
|
-
} =
|
|
140
|
-
function M(
|
|
141
|
-
const D =
|
|
142
|
-
return
|
|
236
|
+
rulesMessageJoinLabel: g
|
|
237
|
+
} = o.formProps, y = Reflect.has(o.schema, "rulesMessageJoinLabel") ? m : g, A = Y(t, `${y ? p : ""}`);
|
|
238
|
+
function M(n, l) {
|
|
239
|
+
const D = n.message || A;
|
|
240
|
+
return l === void 0 || ae(l) || t === e.CHECKBOX_SINGLE && !l || Array.isArray(l) && l.length === 0 || typeof l == "string" && l.trim() === "" || typeof l == "object" && Reflect.has(l, "checked") && Reflect.has(l, "halfChecked") && Array.isArray(l.checked) && Array.isArray(l.halfChecked) && l.checked.length === 0 && l.halfChecked.length === 0 ? Promise.reject(D) : Promise.resolve();
|
|
143
241
|
}
|
|
144
|
-
const d =
|
|
145
|
-
d && (!
|
|
242
|
+
const d = b(h) ? h(c(I)) : h, T = [e.RADIO, e.SELECT, e.RADIO, e.RADIO_SINGLE, e.RADIO_BUTTON, e.CHECKBOX, e.CHECKBOX_SINGLE, e.CHECKBOX_BUTTON, e.AUTOCOMPLETE, e.Cascader, e.ColorPicker, e.Upload, e.Slider].includes(t);
|
|
243
|
+
d && (!i || i.length === 0 ? i = [{
|
|
146
244
|
required: d,
|
|
147
245
|
validator: M,
|
|
148
246
|
trigger: T ? "change" : "blur"
|
|
149
|
-
}] :
|
|
247
|
+
}] : i.findIndex((l) => Reflect.has(l, "required")) === -1 && i.unshift({
|
|
150
248
|
required: d,
|
|
151
249
|
validator: M,
|
|
152
250
|
trigger: T ? "change" : "blur"
|
|
153
251
|
}));
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
const
|
|
157
|
-
isShow:
|
|
158
|
-
} =
|
|
159
|
-
|
|
252
|
+
const x = i.findIndex((n) => Reflect.has(n, "required") && !Reflect.has(n, "validator"));
|
|
253
|
+
if (x !== -1) {
|
|
254
|
+
const n = i[x], {
|
|
255
|
+
isShow: l
|
|
256
|
+
} = k();
|
|
257
|
+
l || (n.required = !1), t && (n.message = n.message || A);
|
|
160
258
|
}
|
|
161
|
-
const
|
|
162
|
-
function
|
|
163
|
-
const O =
|
|
164
|
-
return ["min", "all"].includes(D) && F < O.min ? Promise.reject(
|
|
259
|
+
const E = i.findIndex((n) => n.min), C = i.findIndex((n) => n.max);
|
|
260
|
+
function R(n, l, D = "all") {
|
|
261
|
+
const O = i[l], F = O.isNumber ? isNaN(n) ? n?.length || 0 : Number(n) : n?.length || 0;
|
|
262
|
+
return ["min", "all"].includes(D) && F < O.min ? Promise.reject(p + "至少为" + O.min + "位") : ["max", "all"].includes(D) && F > O.max ? Promise.reject(p + "最多" + O.max + "位") : Promise.resolve();
|
|
165
263
|
}
|
|
166
|
-
(
|
|
167
|
-
const
|
|
168
|
-
if (
|
|
169
|
-
let
|
|
170
|
-
|
|
264
|
+
(E !== -1 || C !== -1) && (E !== -1 && C !== -1 && !i[E].validator && !i[E].message ? i[E].validator = (n, l) => R(l, E) : E !== -1 && !i[E].validator && !i[E].message ? i[E].validator = (n, l) => R(l, E, "min") : C !== -1 && !i[C].validator && !i[C].message && (i[C].validator = (n, l) => R(l, C, "max")));
|
|
265
|
+
const N = i.findIndex((n) => n.len);
|
|
266
|
+
if (N !== -1 && (i[N].validator = (n, l) => l.length !== i[N].len ? Promise.reject(p + "必须是" + i[N].len + "位") : Promise.resolve()), b(u) && f) {
|
|
267
|
+
let n = u(c(I));
|
|
268
|
+
n = J(n) ? n : [n], i = i.concat(n);
|
|
171
269
|
}
|
|
172
|
-
return
|
|
270
|
+
return i;
|
|
173
271
|
}
|
|
174
|
-
const
|
|
272
|
+
const w = re(), ee = () => {
|
|
175
273
|
const {
|
|
176
274
|
renderComponentContent: r,
|
|
177
275
|
type: t = e.INPUT,
|
|
178
|
-
field:
|
|
179
|
-
changeEvent:
|
|
180
|
-
valueField:
|
|
181
|
-
label:
|
|
182
|
-
title:
|
|
183
|
-
placeholderJoinLabel:
|
|
184
|
-
} =
|
|
185
|
-
let
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
[
|
|
189
|
-
const [
|
|
190
|
-
d[
|
|
191
|
-
const
|
|
192
|
-
|
|
276
|
+
field: m,
|
|
277
|
+
changeEvent: a = "change",
|
|
278
|
+
valueField: P,
|
|
279
|
+
label: u,
|
|
280
|
+
title: h,
|
|
281
|
+
placeholderJoinLabel: f = !0
|
|
282
|
+
} = o.schema;
|
|
283
|
+
let p = a;
|
|
284
|
+
he(t) ? p = "input" : Ee(t) || t === e.TIME_PICKER || [e.INPUT_TAG, e.AUTOCOMPLETE, e.Cascader, e.ColorPicker, e.Slider].includes(t) ? p = "update:modelValue" : t === e.Upload && (p = "update:fileList");
|
|
285
|
+
const i = `on${me(p)}`, g = {
|
|
286
|
+
[i]: (...R) => {
|
|
287
|
+
const [N] = R;
|
|
288
|
+
d[i] && d[i](...R);
|
|
289
|
+
const n = N ? N.target : null, l = n ? n.value : N;
|
|
290
|
+
o.setFormModel(m, l, o.schema);
|
|
193
291
|
}
|
|
194
|
-
}, y =
|
|
292
|
+
}, y = $(t), {
|
|
195
293
|
autoSetPlaceHolder: A,
|
|
196
294
|
size: M
|
|
197
|
-
} =
|
|
295
|
+
} = o.formProps, d = {
|
|
198
296
|
clearable: !0,
|
|
199
|
-
...
|
|
297
|
+
...c(K)
|
|
200
298
|
};
|
|
201
|
-
if ([e.SEARCH].includes(t) || (d.size =
|
|
202
|
-
const
|
|
203
|
-
d.placeholder =
|
|
299
|
+
if ([e.SEARCH].includes(t) || (d.size = c(K)?.size || M, d.disabled = c(Z)), !d.disabled && A && !Pe(t) && t) {
|
|
300
|
+
const R = u || h;
|
|
301
|
+
d.placeholder = c(K)?.placeholder || Y(t, f && ce(R) ? R : "");
|
|
204
302
|
}
|
|
205
|
-
const
|
|
206
|
-
[
|
|
207
|
-
},
|
|
208
|
-
...
|
|
303
|
+
const x = {
|
|
304
|
+
[P || "model-value"]: o.formModel[m]
|
|
305
|
+
}, E = {
|
|
306
|
+
...g,
|
|
209
307
|
...d,
|
|
210
|
-
...
|
|
308
|
+
...x
|
|
211
309
|
};
|
|
212
310
|
if (!r && t !== e.Upload)
|
|
213
|
-
return
|
|
214
|
-
ref:
|
|
215
|
-
},
|
|
216
|
-
let
|
|
217
|
-
if (
|
|
311
|
+
return s(y, L({
|
|
312
|
+
ref: w
|
|
313
|
+
}, E), null);
|
|
314
|
+
let C;
|
|
315
|
+
if (C = b(r) ? {
|
|
218
316
|
...r({
|
|
219
|
-
...
|
|
220
|
-
elRef:
|
|
317
|
+
...c(I),
|
|
318
|
+
elRef: w
|
|
221
319
|
})
|
|
222
320
|
} : {
|
|
223
321
|
default: () => r
|
|
224
322
|
}, t === e.Upload && !r) {
|
|
225
323
|
const {
|
|
226
|
-
drag:
|
|
227
|
-
} =
|
|
228
|
-
|
|
229
|
-
default: () =>
|
|
324
|
+
drag: R
|
|
325
|
+
} = c(K);
|
|
326
|
+
C = R ? {
|
|
327
|
+
default: () => s(V("vft-icon"), {
|
|
230
328
|
icon: "icon-arrow-upload"
|
|
231
329
|
}, null)
|
|
232
330
|
} : {
|
|
233
|
-
default: () =>
|
|
331
|
+
default: () => s(V("vft-button"), {
|
|
234
332
|
type: "primary"
|
|
235
333
|
}, {
|
|
236
|
-
default: () => [
|
|
334
|
+
default: () => [s(V("vft-icon"), {
|
|
237
335
|
icon: "icon-arrow-upload"
|
|
238
336
|
}, null)]
|
|
239
337
|
})
|
|
240
338
|
};
|
|
241
339
|
}
|
|
242
|
-
return
|
|
243
|
-
ref:
|
|
244
|
-
},
|
|
245
|
-
default: () => [
|
|
340
|
+
return s(y, L({
|
|
341
|
+
ref: w
|
|
342
|
+
}, E), q(C) ? C : {
|
|
343
|
+
default: () => [C]
|
|
246
344
|
});
|
|
247
345
|
};
|
|
248
346
|
function U() {
|
|
249
347
|
const {
|
|
250
348
|
showLabel: r = !0,
|
|
251
349
|
label: t,
|
|
252
|
-
title:
|
|
253
|
-
subLabel:
|
|
254
|
-
labelRequired:
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
350
|
+
title: m,
|
|
351
|
+
subLabel: a,
|
|
352
|
+
labelRequired: P,
|
|
353
|
+
helpIcon: u,
|
|
354
|
+
helpTooltip: h
|
|
355
|
+
} = o.schema;
|
|
356
|
+
let f = t || m;
|
|
357
|
+
f = P ? s("span", null, [s("span", {
|
|
258
358
|
class: "label-required"
|
|
259
|
-
}, [G("*")]),
|
|
359
|
+
}, [G("*")]), s("span", null, [f])]) : f;
|
|
360
|
+
const p = () => {
|
|
361
|
+
if (!u && !h) return null;
|
|
362
|
+
const i = v(() => z(u, "icon", {
|
|
363
|
+
size: 20,
|
|
364
|
+
pointer: !0,
|
|
365
|
+
icon: "icon-help"
|
|
366
|
+
}));
|
|
367
|
+
if (h) {
|
|
368
|
+
const g = v(() => z(h, "content", {
|
|
369
|
+
placement: "right-start"
|
|
370
|
+
}));
|
|
371
|
+
return s(fe, L({
|
|
372
|
+
className: "box-item"
|
|
373
|
+
}, g.value), {
|
|
374
|
+
default: () => [s(W, i.value, null)]
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
return s(W, i.value, null);
|
|
378
|
+
};
|
|
379
|
+
return r && f ? a ? s("div", {
|
|
380
|
+
class: "label-content"
|
|
381
|
+
}, [s("div", null, [f, G(" "), s("span", {
|
|
260
382
|
class: "sub-label"
|
|
261
|
-
}, [
|
|
383
|
+
}, [a])]), p()]) : s("div", {
|
|
384
|
+
class: "label-content"
|
|
385
|
+
}, [s("div", null, [f]), p()]) : void 0;
|
|
262
386
|
}
|
|
263
|
-
const
|
|
264
|
-
function H(r, t = "default",
|
|
387
|
+
const B = oe();
|
|
388
|
+
function H(r, t = "default", m) {
|
|
265
389
|
if (!r || !Reflect.has(r, t))
|
|
266
390
|
return null;
|
|
267
|
-
if (!
|
|
391
|
+
if (!b(r[t]))
|
|
268
392
|
return console.error(`${t} is not a function!`), null;
|
|
269
|
-
const
|
|
270
|
-
return
|
|
393
|
+
const a = r[t];
|
|
394
|
+
return a ? a(m) : null;
|
|
271
395
|
}
|
|
272
|
-
function
|
|
396
|
+
function te() {
|
|
273
397
|
const {
|
|
274
398
|
itemProps: r,
|
|
275
399
|
slot: t,
|
|
276
|
-
render:
|
|
277
|
-
field:
|
|
278
|
-
suffix:
|
|
279
|
-
prefix:
|
|
280
|
-
prefixParentStyle:
|
|
281
|
-
} =
|
|
282
|
-
autoCleanErrorMessage:
|
|
283
|
-
compFullWidth:
|
|
284
|
-
} =
|
|
285
|
-
|
|
286
|
-
field:
|
|
400
|
+
render: m,
|
|
401
|
+
field: a,
|
|
402
|
+
suffix: P,
|
|
403
|
+
prefix: u,
|
|
404
|
+
prefixParentStyle: h
|
|
405
|
+
} = o.schema, {
|
|
406
|
+
autoCleanErrorMessage: f,
|
|
407
|
+
compFullWidth: p
|
|
408
|
+
} = o.formProps, i = () => t ? H(B, t, c(I)) : m ? m(c(I)) : ee(), g = !!P, y = !!u, A = b(P) ? P(c(I)) : P, M = b(u) ? u(c(I)) : u, d = () => {
|
|
409
|
+
o.updateSchema([{
|
|
410
|
+
field: a,
|
|
287
411
|
itemProps: {
|
|
288
412
|
error: ""
|
|
289
413
|
}
|
|
290
414
|
}]);
|
|
291
|
-
}, T = () =>
|
|
415
|
+
}, T = () => s(ue, L({
|
|
292
416
|
style: {
|
|
293
|
-
marginRight:
|
|
417
|
+
marginRight: o.formProps.customLayout ? "10px" : 0
|
|
294
418
|
},
|
|
295
|
-
prop:
|
|
419
|
+
prop: a,
|
|
296
420
|
class: [{
|
|
297
|
-
[
|
|
421
|
+
[S.is("suffix")]: g
|
|
298
422
|
}, {
|
|
299
|
-
[
|
|
300
|
-
},
|
|
423
|
+
[S.is("comp-full-width")]: p
|
|
424
|
+
}, S.e("item")]
|
|
301
425
|
}, r, {
|
|
302
426
|
label: r?.label || r?.title,
|
|
303
|
-
"onUpdate:error":
|
|
427
|
+
"onUpdate:error": f ? d : () => {
|
|
304
428
|
},
|
|
305
|
-
rules:
|
|
429
|
+
rules: _()
|
|
306
430
|
}), {
|
|
307
|
-
default: () => [
|
|
308
|
-
class:
|
|
309
|
-
}, [
|
|
310
|
-
class:
|
|
311
|
-
}, [
|
|
312
|
-
class:
|
|
431
|
+
default: () => [s("div", {
|
|
432
|
+
class: S.e("container")
|
|
433
|
+
}, [s("div", {
|
|
434
|
+
class: S.e("content")
|
|
435
|
+
}, [i(), g && s("span", {
|
|
436
|
+
class: S.m("suffix")
|
|
313
437
|
}, [A])])])],
|
|
314
438
|
label: U() ? () => U() : void 0
|
|
315
439
|
});
|
|
316
|
-
return y ?
|
|
317
|
-
style:
|
|
318
|
-
}, [
|
|
319
|
-
class:
|
|
440
|
+
return y ? s("div", {
|
|
441
|
+
style: h
|
|
442
|
+
}, [s("span", {
|
|
443
|
+
class: S.m("prefix")
|
|
320
444
|
}, [M]), T()]) : T();
|
|
321
445
|
}
|
|
322
446
|
return () => {
|
|
323
447
|
let r;
|
|
324
448
|
const {
|
|
325
449
|
colProps: t = {},
|
|
326
|
-
colSlot:
|
|
327
|
-
renderColContent:
|
|
328
|
-
type:
|
|
329
|
-
render:
|
|
330
|
-
quickColSpan:
|
|
331
|
-
} =
|
|
332
|
-
if (
|
|
450
|
+
colSlot: m,
|
|
451
|
+
renderColContent: a,
|
|
452
|
+
type: P = e.INPUT,
|
|
453
|
+
render: u,
|
|
454
|
+
quickColSpan: h
|
|
455
|
+
} = o.schema;
|
|
456
|
+
if (!$(P) && !a && !u)
|
|
333
457
|
return null;
|
|
334
458
|
const {
|
|
335
|
-
baseColProps:
|
|
336
|
-
quickColSpan:
|
|
337
|
-
} =
|
|
338
|
-
span: Math.ceil(24 /
|
|
339
|
-
...
|
|
459
|
+
baseColProps: f = {},
|
|
460
|
+
quickColSpan: p
|
|
461
|
+
} = o.formProps, i = p ? {
|
|
462
|
+
span: Math.ceil(24 / p),
|
|
463
|
+
...f
|
|
340
464
|
} : {
|
|
341
|
-
...
|
|
342
|
-
},
|
|
343
|
-
span: Math.ceil(24 /
|
|
465
|
+
...f
|
|
466
|
+
}, g = h ? {
|
|
467
|
+
span: Math.ceil(24 / h),
|
|
344
468
|
...t
|
|
345
469
|
} : {
|
|
346
470
|
...t
|
|
347
471
|
}, y = {
|
|
348
|
-
...
|
|
349
|
-
...
|
|
472
|
+
...i,
|
|
473
|
+
...g
|
|
350
474
|
}, {
|
|
351
475
|
isIfShow: A,
|
|
352
476
|
isShow: M
|
|
353
|
-
} =
|
|
354
|
-
if (
|
|
355
|
-
let
|
|
356
|
-
return
|
|
477
|
+
} = k(), d = c(I), T = () => m ? H(B, m, d) : a ? a(d) : te();
|
|
478
|
+
if (P === e.DIVIDER) {
|
|
479
|
+
let x;
|
|
480
|
+
return s(X, L({
|
|
357
481
|
span: 24
|
|
358
|
-
},
|
|
359
|
-
default: () => [
|
|
360
|
-
default: () => [
|
|
482
|
+
}, g), {
|
|
483
|
+
default: () => [s(pe, c(K), q(x = U()) ? x : {
|
|
484
|
+
default: () => [x]
|
|
361
485
|
})]
|
|
362
486
|
});
|
|
363
487
|
}
|
|
364
|
-
return A && (
|
|
488
|
+
return A && (o.formProps.customLayout ? T() : ie(s(X, y, q(r = T()) ? r : {
|
|
365
489
|
default: () => [r]
|
|
366
490
|
}), [[ne, M]]));
|
|
367
491
|
};
|
|
368
492
|
}
|
|
369
493
|
});
|
|
370
494
|
export {
|
|
371
|
-
|
|
495
|
+
Tr as default
|
|
372
496
|
};
|