@web-utils/form-ui 1.0.0-beta5 → 1.0.0-beta51
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/api/index.d.ts +60 -0
- package/api/index.mjs +42 -0
- package/awesome-button/index.d.ts +60 -0
- package/awesome-button/index.mjs +49 -0
- package/base.css +1 -1
- package/chunks/6yfBZFOB.mjs +56 -0
- package/chunks/B1IPSTA6.mjs +198 -0
- package/chunks/B9gA65rt2.mjs +38 -0
- package/chunks/BBERmTup.mjs +83 -0
- package/chunks/BG8z3V9d2.mjs +643 -0
- package/chunks/BQk3-Ppb2.mjs +146 -0
- package/chunks/BQyL45PF2.mjs +207 -0
- package/chunks/BWh6u1O0.mjs +660 -0
- package/chunks/BbSPWDDZ.mjs +100 -0
- package/chunks/BfxDxIg0.mjs +106 -0
- package/chunks/BqWvBF14.mjs +35 -0
- package/chunks/BsZgAJX_2.mjs +81 -0
- package/chunks/BtcjAHE6.mjs +317 -0
- package/chunks/Bwbtu2cp.mjs +194 -0
- package/chunks/ByHz4mmh.mjs +87 -0
- package/chunks/C2zgFLYO.mjs +185 -0
- package/chunks/C7G-cAoI.mjs +1361 -0
- package/chunks/CAd1zK9Q.mjs +25 -0
- package/chunks/CJdkjadi.mjs +17 -0
- package/chunks/CXsoKP22.mjs +86 -0
- package/chunks/CabldOLo.mjs +157 -0
- package/chunks/CkOD-_VV.mjs +8 -0
- package/chunks/CqVd8D222.mjs +89 -0
- package/chunks/CuAoMR3n.mjs +105 -0
- package/chunks/DA7oGHSX.mjs +141 -0
- package/chunks/DKwp6AMl.mjs +168 -0
- package/chunks/DOP3aBxf.mjs +93 -0
- package/chunks/DOZRzqlo.mjs +37 -0
- package/chunks/D_Fs3bkZ.mjs +57 -0
- package/chunks/D_qiRmiE.mjs +230 -0
- package/chunks/DcTVYqeJ.mjs +113 -0
- package/chunks/Dt3lfDnL.mjs +166 -0
- package/chunks/GI8krYU82.mjs +478 -0
- package/chunks/V2p-PCpL.mjs +176 -0
- package/chunks/YFiU0ngn.mjs +622 -0
- package/chunks/bFbPPcdq.mjs +25 -0
- package/chunks/eae6huQB.mjs +25 -0
- package/chunks/gCeDFHo1.mjs +32 -0
- package/chunks/gLPy4Sus.mjs +164 -0
- package/chunks/hlha6Bhc.mjs +107 -0
- package/chunks/pIzhYsBe.mjs +93 -0
- package/chunks/wDS9KBFw.mjs +67 -0
- package/chunks/wXeqV-_7.mjs +89 -0
- package/confirm-button/index.d.ts +122 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +93 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +54 -0
- package/constants/index.mjs +4 -0
- package/dict-render/index.d.ts +28 -0
- package/dict-render/index.mjs +2 -0
- package/editable-tree/index.d.ts +254 -0
- package/editable-tree/index.mjs +2 -0
- package/editable-tree/style.css +1 -0
- package/element-dialog/index.d.ts +337 -16
- package/element-dialog/index.mjs +2 -91
- package/element-resize-observer/index.d.ts +8 -0
- package/element-resize-observer/index.mjs +40 -0
- package/element-resize-observer/style.css +1 -0
- package/empty-view/index.d.ts +2 -2
- package/empty-view/index.mjs +1 -1
- package/flex-scroll-area/index.d.ts +1 -1
- package/flex-scroll-area/index.mjs +1 -1
- package/form-advice/index.mjs +13 -12
- package/form-button/index.d.ts +123 -0
- package/form-button/index.mjs +36 -0
- package/form-card/index.d.ts +14 -0
- package/form-card/index.mjs +18 -0
- package/form-cascader/index.d.ts +472 -0
- package/form-cascader/index.mjs +2 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- package/form-checkbox-group/index.d.ts +364 -0
- package/form-checkbox-group/index.mjs +2 -0
- package/form-checkbox-group/style.css +1 -0
- package/form-date-picker/index.d.ts +390 -19
- package/form-date-picker/index.mjs +1 -1
- package/form-holder/index.d.ts +87 -20
- package/form-holder/index.mjs +1 -1
- package/form-holder/style.css +1 -1
- package/form-image/index.d.ts +145 -13
- package/form-image/index.mjs +1 -1
- package/form-input/index.d.ts +301 -20
- package/form-input/index.mjs +1 -1
- package/form-input/style.css +1 -0
- package/form-input-cron-expression/index.d.ts +217 -0
- package/form-input-cron-expression/index.mjs +2 -0
- package/form-input-cron-expression/style.css +1 -0
- package/form-input-email/index.d.ts +307 -16
- package/form-input-email/index.mjs +1 -1
- package/form-input-id-card/index.d.ts +307 -16
- package/form-input-id-card/index.mjs +1 -1
- package/form-input-number/index.d.ts +246 -18
- package/form-input-number/index.mjs +1 -1
- package/form-input-phone-number/index.d.ts +307 -16
- package/form-input-phone-number/index.mjs +1 -1
- package/form-input-tag/index.d.ts +263 -1
- package/form-input-tag/index.mjs +1 -3
- package/form-input-time/index.d.ts +434 -1
- package/form-input-time/index.mjs +1 -3
- package/form-item-config-provider/index.d.ts +22 -0
- package/form-item-config-provider/index.mjs +24 -0
- package/form-item-group/index.d.ts +91 -17
- package/form-item-group/index.mjs +2 -78
- package/form-item-group/style.css +1 -1
- package/form-item-x/index.d.ts +141 -11
- package/form-item-x/index.mjs +1 -1
- package/form-item-x/style.css +1 -0
- package/form-radio-group/index.d.ts +303 -16
- package/form-radio-group/index.mjs +1 -1
- package/form-rate/index.d.ts +254 -14
- package/form-rate/index.mjs +1 -1
- package/form-red-table/index.mjs +27 -26
- package/form-row/index.d.ts +2 -2
- package/form-row/index.mjs +1 -1
- package/form-select/index.d.ts +537 -18
- package/form-select/index.mjs +1 -1
- package/form-slider/index.d.ts +283 -16
- package/form-slider/index.mjs +1 -1
- package/form-switch/index.d.ts +272 -14
- package/form-switch/index.mjs +1 -1
- package/form-table/index.d.ts +269 -0
- package/form-table/index.mjs +2 -0
- package/form-table-plus/index.d.ts +266 -0
- package/form-table-plus/index.mjs +2 -0
- package/form-text/index.d.ts +165 -13
- package/form-text/index.mjs +1 -1
- package/form-textarea/index.d.ts +351 -0
- package/form-textarea/index.mjs +2 -0
- package/form-time-select/index.d.ts +319 -0
- package/form-time-select/index.mjs +2 -0
- package/form-view/index.mjs +1 -1
- package/helper/dictionary.d.ts +15 -0
- package/helper/dictionary.mjs +97 -0
- package/hook/useDictionary.d.ts +60 -0
- package/hook/useDictionary.mjs +15 -0
- package/hook/useVisibilityChange.d.ts +4 -0
- package/hook/useVisibilityChange.mjs +14 -0
- package/iframe-window/index.d.ts +9 -0
- package/iframe-window/index.mjs +37 -0
- package/iframe-window/style.css +1 -0
- package/index.css +2 -0
- package/index.d.ts +57 -36
- package/index.mjs +59 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +400 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resolver/index.mjs +29 -0
- package/sub-table/index.d.ts +100 -0
- package/sub-table/index.mjs +537 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.d.ts +100 -0
- package/sub-table-plus/index.mjs +2 -0
- package/sub-table-plus/style.css +1 -0
- package/table-column/index.d.ts +160 -0
- package/table-column/index.mjs +2 -0
- package/table-column/style.css +1 -0
- package/table-column-def/index.d.ts +95 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +341 -1
- package/table-view/index.mjs +457 -6
- package/table-view/style.css +1 -0
- package/toolbar/index.d.ts +128 -1
- package/toolbar/index.mjs +1 -8
- package/toolbar/style.css +1 -0
- package/toolbar-button/index.d.ts +188 -1
- package/toolbar-button/index.mjs +1 -8
- package/vue-cron/index.d.ts +191 -0
- package/vue-cron/index.mjs +2 -0
- package/vue-cron/style.css +1 -0
- package/web-types.json +1 -1
- package/x-input-tag/index.d.ts +2 -0
- package/x-input-tag/index.mjs +228 -0
- package/x-input-tag/style.css +1 -0
- package/year-calendar/index.d.ts +99 -0
- package/year-calendar/index.mjs +2 -0
- package/year-calendar/style.css +1 -0
- package/chunks/B4M_TFeR.mjs +0 -152
- package/chunks/B5BIQCcK.mjs +0 -149
- package/chunks/BHNKrW1j.mjs +0 -61
- package/chunks/BO9jWhBl.mjs +0 -46
- package/chunks/BZ8aOa78.mjs +0 -35
- package/chunks/Bsz7y4Xp.mjs +0 -73
- package/chunks/Bxj372sF.mjs +0 -53
- package/chunks/C33EmJN8.mjs +0 -32
- package/chunks/C6Li3-l7.mjs +0 -28
- package/chunks/CBcdalMX.mjs +0 -35
- package/chunks/CdRsyF0n.mjs +0 -43
- package/chunks/ClNahmiU.mjs +0 -23
- package/chunks/CstztYMu.mjs +0 -28
- package/chunks/DC9b53M6.mjs +0 -32
- package/chunks/DDVAgRED.mjs +0 -36
- package/chunks/DpJQABVD.mjs +0 -91
- package/chunks/ZsLNWI9x.mjs +0 -46
- package/chunks/jn_iQrVZ.mjs +0 -28
- package/constants.d.ts +0 -1
- package/constants.mjs +0 -4
- package/form-check-box-group/index.d.ts +0 -93
- package/form-check-box-group/index.mjs +0 -2
- package/input/style.css +0 -1
- package/resolver.mjs +0 -79
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { i as e, n as t } from "./D_qiRmiE.mjs";
|
|
2
|
+
import { n, t as r } from "./CJdkjadi.mjs";
|
|
3
|
+
import { useDictionary as i } from "../hook/useDictionary.mjs";
|
|
4
|
+
import { findTreeChildren as a, isArray as o, isString as s, setParent as c } from "@web-utils/core";
|
|
5
|
+
import { computed as l, createVNode as u, mergeProps as d } from "vue";
|
|
6
|
+
import { cloneDeep as f } from "@web-utils/integrations/lodash";
|
|
7
|
+
import { ElCascader as p } from "element-plus/es";
|
|
8
|
+
//#region src/components/form/props/cascader.ts
|
|
9
|
+
var m = {
|
|
10
|
+
...n,
|
|
11
|
+
...r,
|
|
12
|
+
modelValue: [
|
|
13
|
+
String,
|
|
14
|
+
Number,
|
|
15
|
+
Array
|
|
16
|
+
],
|
|
17
|
+
options: Array,
|
|
18
|
+
props: Object,
|
|
19
|
+
size: String,
|
|
20
|
+
placeholder: String,
|
|
21
|
+
clearable: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
clearIcon: [String, Object],
|
|
26
|
+
showAllLevels: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
collapseTags: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
collapseTagsTooltip: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
maxCollapseTagsTooltipHeight: [String, Number],
|
|
39
|
+
separator: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: "/"
|
|
42
|
+
},
|
|
43
|
+
filterable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: !1
|
|
46
|
+
},
|
|
47
|
+
filterMethod: Function,
|
|
48
|
+
debounce: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 300
|
|
51
|
+
},
|
|
52
|
+
beforeFilter: Function,
|
|
53
|
+
popperClass: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: ""
|
|
56
|
+
},
|
|
57
|
+
popperStyle: [String, Object],
|
|
58
|
+
teleported: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !0
|
|
61
|
+
},
|
|
62
|
+
effect: {
|
|
63
|
+
type: String,
|
|
64
|
+
default: "light"
|
|
65
|
+
},
|
|
66
|
+
tagType: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "info"
|
|
69
|
+
},
|
|
70
|
+
tagEffect: {
|
|
71
|
+
type: String,
|
|
72
|
+
default: "light"
|
|
73
|
+
},
|
|
74
|
+
validateEvent: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: !0
|
|
77
|
+
},
|
|
78
|
+
maxCollapseTags: {
|
|
79
|
+
type: Number,
|
|
80
|
+
default: 1
|
|
81
|
+
},
|
|
82
|
+
emptyValues: Array,
|
|
83
|
+
valueOnClear: [
|
|
84
|
+
String,
|
|
85
|
+
Number,
|
|
86
|
+
Boolean,
|
|
87
|
+
Function
|
|
88
|
+
],
|
|
89
|
+
persistent: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: !0
|
|
92
|
+
},
|
|
93
|
+
fallbackPlacements: {
|
|
94
|
+
type: Array,
|
|
95
|
+
default: () => [
|
|
96
|
+
"bottom-start",
|
|
97
|
+
"top-start",
|
|
98
|
+
"right",
|
|
99
|
+
"left"
|
|
100
|
+
]
|
|
101
|
+
},
|
|
102
|
+
placement: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "bottom-start"
|
|
105
|
+
},
|
|
106
|
+
popperAppendToBody: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: !0
|
|
109
|
+
},
|
|
110
|
+
showCheckedStrategy: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "child"
|
|
113
|
+
},
|
|
114
|
+
readonly: Boolean,
|
|
115
|
+
last: Boolean,
|
|
116
|
+
checkStrictly: Boolean,
|
|
117
|
+
labelKey: {
|
|
118
|
+
type: String,
|
|
119
|
+
default: "label"
|
|
120
|
+
},
|
|
121
|
+
valueKey: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: "value"
|
|
124
|
+
},
|
|
125
|
+
emitPath: {
|
|
126
|
+
type: Boolean,
|
|
127
|
+
default: !0
|
|
128
|
+
},
|
|
129
|
+
join: {
|
|
130
|
+
type: Boolean,
|
|
131
|
+
default: !0
|
|
132
|
+
},
|
|
133
|
+
idAsValue: {
|
|
134
|
+
type: Boolean,
|
|
135
|
+
default: !0
|
|
136
|
+
},
|
|
137
|
+
labelAsValue: Boolean,
|
|
138
|
+
treeDict: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
default: !0
|
|
141
|
+
},
|
|
142
|
+
dictType: String
|
|
143
|
+
}, h = {
|
|
144
|
+
modelValue: !0,
|
|
145
|
+
readonly: !0,
|
|
146
|
+
disabled: !0,
|
|
147
|
+
props: !0
|
|
148
|
+
}, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
|
|
149
|
+
name: "FormCascader",
|
|
150
|
+
props: { ...m },
|
|
151
|
+
emits: { ...t },
|
|
152
|
+
setup(t, { emit: n, slots: r, attrs: m }) {
|
|
153
|
+
let { emitInput: h, render: _, placeholder: v, disabled: y, listeners: b, inputProps: x } = e(t, {
|
|
154
|
+
emit: n,
|
|
155
|
+
slots: r,
|
|
156
|
+
attrs: m,
|
|
157
|
+
predicate: g
|
|
158
|
+
}), { dictItems: S } = i(t), C = l(() => {
|
|
159
|
+
if (t.dictType) return S.value;
|
|
160
|
+
if (t.options) {
|
|
161
|
+
let e = f(t.options);
|
|
162
|
+
return t.last && c(e), e;
|
|
163
|
+
} else return [];
|
|
164
|
+
}), w = l(() => {
|
|
165
|
+
if (t.join) return o(t.modelValue) ? t.modelValue : s(t.modelValue) ? t.modelValue.split(t.separator) : [];
|
|
166
|
+
if (t.last) {
|
|
167
|
+
let [e] = a(C.value, (e) => e[t.valueKey] === t.modelValue), n = [];
|
|
168
|
+
for (; e;) n.push(e[t.valueKey]), e = e.parent;
|
|
169
|
+
return n.reverse();
|
|
170
|
+
}
|
|
171
|
+
return t.modelValue;
|
|
172
|
+
}), T = (e) => {
|
|
173
|
+
t.join && o(e) ? h(e.join(t.separator)) : h(t.last ? e[e.length - 1] : e);
|
|
174
|
+
};
|
|
175
|
+
return () => _({ vNodes: u(p, d(b.value, x.value, {
|
|
176
|
+
style: "width: 100%",
|
|
177
|
+
class: { "is-readonly": t.readonly },
|
|
178
|
+
"model-value": w.value,
|
|
179
|
+
options: C.value,
|
|
180
|
+
props: {
|
|
181
|
+
checkStrictly: t.checkStrictly,
|
|
182
|
+
label: t.labelKey,
|
|
183
|
+
value: t.valueKey,
|
|
184
|
+
emitPath: t.emitPath,
|
|
185
|
+
expandTrigger: "hover"
|
|
186
|
+
},
|
|
187
|
+
disabled: y.value,
|
|
188
|
+
placeholder: v.value,
|
|
189
|
+
"onUpdate:modelValue": T
|
|
190
|
+
}), null) });
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
//#endregion
|
|
194
|
+
export { _ as t };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { i as e, n as t } from "./D_qiRmiE.mjs";
|
|
2
|
+
import { n } from "./CJdkjadi.mjs";
|
|
3
|
+
import { createVNode as r, mergeProps as i, useModel as a } from "vue";
|
|
4
|
+
import { ElRate as o } from "element-plus/es";
|
|
5
|
+
//#region src/components/form/props/rate.ts
|
|
6
|
+
var s = {
|
|
7
|
+
...n,
|
|
8
|
+
modelValue: Number,
|
|
9
|
+
max: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 5
|
|
12
|
+
},
|
|
13
|
+
size: String,
|
|
14
|
+
allowHalf: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
lowThreshold: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 2
|
|
21
|
+
},
|
|
22
|
+
highThreshold: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 4
|
|
25
|
+
},
|
|
26
|
+
colors: [Array, Object],
|
|
27
|
+
voidColor: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: "#c6d1de"
|
|
30
|
+
},
|
|
31
|
+
disabledVoidColor: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "#eff2f7"
|
|
34
|
+
},
|
|
35
|
+
icons: [Array, Object],
|
|
36
|
+
voidIcon: [String, Object],
|
|
37
|
+
disabledVoidIcon: [String, Object],
|
|
38
|
+
showText: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
showScore: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: !1
|
|
45
|
+
},
|
|
46
|
+
textColor: String,
|
|
47
|
+
texts: {
|
|
48
|
+
type: Array,
|
|
49
|
+
default: () => [
|
|
50
|
+
"Extremely bad",
|
|
51
|
+
"Disappointed",
|
|
52
|
+
"Fair",
|
|
53
|
+
"Satisfied",
|
|
54
|
+
"Surprise"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
scoreTemplate: String,
|
|
58
|
+
clearable: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: !1
|
|
61
|
+
},
|
|
62
|
+
id: String,
|
|
63
|
+
ariaLabel: String
|
|
64
|
+
}, c = {
|
|
65
|
+
disabled: !0,
|
|
66
|
+
modelValue: !0
|
|
67
|
+
}, l = (e) => n[e] === void 0 && c[e] !== !0, u = {
|
|
68
|
+
name: "FormRate",
|
|
69
|
+
inheritAttrs: !1,
|
|
70
|
+
props: { ...s },
|
|
71
|
+
emits: { ...t },
|
|
72
|
+
setup(t, { emit: n, slots: s, attrs: c }) {
|
|
73
|
+
let u = a(t, "modelValue"), { render: d, disabled: f, listeners: p, inputProps: m } = e(t, {
|
|
74
|
+
emit: n,
|
|
75
|
+
slots: s,
|
|
76
|
+
attrs: c,
|
|
77
|
+
predicate: l
|
|
78
|
+
});
|
|
79
|
+
return () => d({ vNodes: r(o, i(p.value, m.value, {
|
|
80
|
+
modelValue: u.value,
|
|
81
|
+
"onUpdate:modelValue": (e) => u.value = e,
|
|
82
|
+
disabled: f.value
|
|
83
|
+
}), null) });
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
//#endregion
|
|
87
|
+
export { u as t };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { d as e } from "./DcTVYqeJ.mjs";
|
|
2
|
+
import { formHolderContextKey as t, formViewContextKey as n } from "../constants/index.mjs";
|
|
3
|
+
import r from "../form-advice/index.mjs";
|
|
4
|
+
import i from "../form-red-table/index.mjs";
|
|
5
|
+
import { animate as a } from "@web-utils/core";
|
|
6
|
+
import { computed as o, createVNode as s, inject as c, mergeProps as l, nextTick as u, provide as d, reactive as f, toRef as p, useTemplateRef as m } from "vue";
|
|
7
|
+
import { ElForm as h, ElRow as g } from "element-plus/es";
|
|
8
|
+
//#region src/components/form/props/form.ts
|
|
9
|
+
var _ = {
|
|
10
|
+
model: Object,
|
|
11
|
+
rules: Object,
|
|
12
|
+
inline: {
|
|
13
|
+
type: Boolean,
|
|
14
|
+
default: !1
|
|
15
|
+
},
|
|
16
|
+
labelPosition: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "right"
|
|
19
|
+
},
|
|
20
|
+
labelWidth: {
|
|
21
|
+
type: [String, Number],
|
|
22
|
+
default: "auto"
|
|
23
|
+
},
|
|
24
|
+
labelSuffix: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
hideRequiredAsterisk: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
requireAsteriskPosition: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "left"
|
|
35
|
+
},
|
|
36
|
+
showMessage: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !0
|
|
39
|
+
},
|
|
40
|
+
inlineMessage: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
statusIcon: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
},
|
|
48
|
+
validateOnRuleChange: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: !0
|
|
51
|
+
},
|
|
52
|
+
size: String,
|
|
53
|
+
disabled: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: void 0
|
|
56
|
+
},
|
|
57
|
+
scrollToError: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: !1
|
|
60
|
+
},
|
|
61
|
+
scrollIntoViewOptions: [Object, Boolean],
|
|
62
|
+
requiredFields: Array,
|
|
63
|
+
disabledFields: Array,
|
|
64
|
+
enabledFields: Array,
|
|
65
|
+
showAdvice: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: !0
|
|
68
|
+
},
|
|
69
|
+
columns: [Array, Object],
|
|
70
|
+
colCount: Number,
|
|
71
|
+
notTableForm: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: void 0
|
|
74
|
+
},
|
|
75
|
+
commentValueColspan: Number,
|
|
76
|
+
commentLabelColspan: Number,
|
|
77
|
+
wrapRow: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !0
|
|
80
|
+
}
|
|
81
|
+
}, v = {
|
|
82
|
+
showMessage: !0,
|
|
83
|
+
required: !0,
|
|
84
|
+
requiredFields: !0,
|
|
85
|
+
disabledFields: !0,
|
|
86
|
+
enabledFields: !0,
|
|
87
|
+
showAdvice: !0,
|
|
88
|
+
columns: !0,
|
|
89
|
+
colCount: !0,
|
|
90
|
+
notTableForm: !0,
|
|
91
|
+
commentValueColspan: !0,
|
|
92
|
+
commentLabelColspan: !0,
|
|
93
|
+
wrapRow: !0
|
|
94
|
+
}, y = (e) => v[e] !== !0, b = {
|
|
95
|
+
name: "FormHolder",
|
|
96
|
+
inheritAttrs: !1,
|
|
97
|
+
props: { ..._ },
|
|
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(() => {
|
|
101
|
+
let e = {};
|
|
102
|
+
return _.disabledFields && _.disabledFields.forEach((t) => {
|
|
103
|
+
e[t] = !0;
|
|
104
|
+
}), e;
|
|
105
|
+
}), O = o(() => {
|
|
106
|
+
let e = {};
|
|
107
|
+
return _.enabledFields && _.enabledFields.length && _.enabledFields.forEach((t) => {
|
|
108
|
+
e[t] = !0;
|
|
109
|
+
}), e;
|
|
110
|
+
}), k = o(() => {
|
|
111
|
+
let e = {};
|
|
112
|
+
return _.requiredFields && _.requiredFields.length && _.requiredFields.forEach((t) => {
|
|
113
|
+
e[t] = !0;
|
|
114
|
+
}), e;
|
|
115
|
+
}), A = o(() => _.disabled === !0 ? !0 : _.disabled), j = p(() => _.enabledFields), M = p(() => _.requiredFields), N = p(() => _.disabledFields), P = async () => {
|
|
116
|
+
await u();
|
|
117
|
+
let e = w.value.$el.querySelector(".el-form-item.is-error");
|
|
118
|
+
e && e.scrollIntoView({
|
|
119
|
+
block: "center",
|
|
120
|
+
inline: "center",
|
|
121
|
+
behavior: "smooth"
|
|
122
|
+
});
|
|
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,
|
|
134
|
+
validate: async () => {
|
|
135
|
+
try {
|
|
136
|
+
return await w.value.validate();
|
|
137
|
+
} catch {
|
|
138
|
+
throw await P(), w.value.$el.querySelectorAll(".el-form-item.is-error .el-form-item__content > :first-child").forEach((e) => {
|
|
139
|
+
a(e, "breathe-animation");
|
|
140
|
+
}), Error("表单验证不通过!");
|
|
141
|
+
}
|
|
142
|
+
},
|
|
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
|
|
150
|
+
});
|
|
151
|
+
return d(t, F), b(F), () => s(h, l(S.value, x.value, {
|
|
152
|
+
ref: "form",
|
|
153
|
+
class: "form-holder",
|
|
154
|
+
"show-message": E.value
|
|
155
|
+
}), { default: () => {
|
|
156
|
+
if (T.value) {
|
|
157
|
+
var e, t, n;
|
|
158
|
+
return [
|
|
159
|
+
(e = v.top) == null ? void 0 : e.call(v),
|
|
160
|
+
s(i, {
|
|
161
|
+
class: { "hide-error-message": T.value },
|
|
162
|
+
columns: _.columns,
|
|
163
|
+
"col-count": _.colCount
|
|
164
|
+
}, { default: () => {
|
|
165
|
+
var e;
|
|
166
|
+
return [(e = v.default) == null ? void 0 : e.call(v), _.showAdvice ? s(r, {
|
|
167
|
+
"label-colspan": _.commentLabelColspan,
|
|
168
|
+
"value-colspan": _.commentValueColspan
|
|
169
|
+
}, null) : null];
|
|
170
|
+
} }),
|
|
171
|
+
(t = v.bottom) == null ? void 0 : t.call(v),
|
|
172
|
+
s("div", { class: "red-form-footer" }, [(n = v.footer) == null ? void 0 : n.call(v)])
|
|
173
|
+
];
|
|
174
|
+
} else {
|
|
175
|
+
var a;
|
|
176
|
+
return _.wrapRow ? s(g, null, { default: () => {
|
|
177
|
+
var e;
|
|
178
|
+
return [(e = v.default) == null ? void 0 : e.call(v)];
|
|
179
|
+
} }) : (a = v.default) == null ? void 0 : a.call(v);
|
|
180
|
+
}
|
|
181
|
+
} });
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
//#endregion
|
|
185
|
+
export { b as t };
|