@web-utils/form-ui 1.0.0-beta4 → 1.0.0-beta41
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 -0
- package/chunks/4GMuTlFS.mjs +25 -0
- package/chunks/B-YO6Py8.mjs +145 -0
- package/chunks/B1MSrc6f.mjs +8 -0
- package/chunks/B40JZqF5.mjs +60 -0
- package/chunks/BLNpMvUQ.mjs +95 -0
- package/chunks/BNQD6fKI.mjs +40 -0
- package/chunks/BROfNO6c.mjs +17 -0
- package/chunks/BiF8cEVB.mjs +102 -0
- package/chunks/Bm5eiSmT.mjs +79 -0
- package/chunks/C5BjmbyR.mjs +91 -0
- package/chunks/CBHZpxPE.mjs +108 -0
- package/chunks/CD2WYSl1.mjs +188 -0
- package/chunks/CE0MejA6.mjs +200 -0
- package/chunks/CSf0Lu3w.mjs +102 -0
- package/chunks/CXSIP67a.mjs +234 -0
- package/chunks/ChmDDqoZ2.mjs +478 -0
- package/chunks/ClpNoMQe.mjs +37 -0
- package/chunks/Csa9EgOO.mjs +152 -0
- package/chunks/CuBH-6_y.mjs +25 -0
- package/chunks/CybmpSN8.mjs +664 -0
- package/chunks/CzvmkGvn.mjs +89 -0
- package/chunks/DASUt7ot.mjs +166 -0
- package/chunks/DBNqhkDl.mjs +174 -0
- package/chunks/DMcUruCK2.mjs +207 -0
- package/chunks/DUjgfS7g.mjs +95 -0
- package/chunks/DWLv8UUC.mjs +612 -0
- package/chunks/Ds_Tpa_M.mjs +83 -0
- package/chunks/MeM8FGzA.mjs +200 -0
- package/chunks/_90XRi0U.mjs +105 -0
- package/chunks/_Uzl3uMy.mjs +109 -0
- package/chunks/b5HOxD60.mjs +1369 -0
- package/chunks/cmuHpsX6.mjs +109 -0
- package/chunks/ePSxkHli.mjs +95 -0
- package/chunks/jHrYQI1Q.mjs +320 -0
- package/chunks/kKoMKOYH.mjs +180 -0
- package/chunks/lPLJkGiz.mjs +25 -0
- package/chunks/mbLUSXcZ.mjs +56 -0
- package/chunks/y-DmM31a.mjs +168 -0
- package/confirm-button/index.d.ts +113 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +84 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +53 -0
- package/constants/index.mjs +4 -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/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 +114 -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-check-box-group/index.d.ts +289 -18
- package/form-check-box-group/index.mjs +1 -1
- package/form-check-box-group/style.css +1 -0
- package/form-checkbox/index.d.ts +236 -16
- package/form-checkbox/index.mjs +1 -1
- 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-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.d.ts +52 -36
- package/index.mjs +54 -61
- package/package.json +10 -5
- package/pageable-table/index.d.ts +398 -0
- package/pageable-table/index.mjs +2 -0
- package/pageable-table/style.css +1 -0
- package/resize-observer/index.d.ts +8 -0
- package/resize-observer/index.mjs +40 -0
- package/resize-observer/style.css +1 -0
- package/resolver/index.mjs +29 -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 +85 -0
- package/table-column-def/index.mjs +11 -0
- package/table-view/index.d.ts +340 -1
- package/table-view/index.mjs +459 -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 +232 -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/input/style.css +0 -1
- package/resolver.mjs +0 -79
- package/utils/style.css +0 -1
- /package/{resolver.d.ts → resolver/index.d.ts} +0 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { i as e, n as t } from "./CXSIP67a.mjs";
|
|
2
|
+
import { n, t as r } from "./BROfNO6c.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
|
+
import "element-plus/es/components/base/style/css";
|
|
9
|
+
import "element-plus/es/components/cascader/style/css";
|
|
10
|
+
//#region src/components/form/props/cascader.ts
|
|
11
|
+
var m = {
|
|
12
|
+
...n,
|
|
13
|
+
...r,
|
|
14
|
+
modelValue: [
|
|
15
|
+
String,
|
|
16
|
+
Number,
|
|
17
|
+
Array
|
|
18
|
+
],
|
|
19
|
+
options: Array,
|
|
20
|
+
props: Object,
|
|
21
|
+
size: String,
|
|
22
|
+
placeholder: String,
|
|
23
|
+
disabled: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: !1
|
|
26
|
+
},
|
|
27
|
+
clearable: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: !1
|
|
30
|
+
},
|
|
31
|
+
clearIcon: [String, Object],
|
|
32
|
+
showAllLevels: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: !0
|
|
35
|
+
},
|
|
36
|
+
collapseTags: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: !1
|
|
39
|
+
},
|
|
40
|
+
collapseTagsTooltip: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
default: !1
|
|
43
|
+
},
|
|
44
|
+
maxCollapseTagsTooltipHeight: [String, Number],
|
|
45
|
+
separator: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "/"
|
|
48
|
+
},
|
|
49
|
+
filterable: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: !1
|
|
52
|
+
},
|
|
53
|
+
filterMethod: Function,
|
|
54
|
+
debounce: {
|
|
55
|
+
type: Number,
|
|
56
|
+
default: 300
|
|
57
|
+
},
|
|
58
|
+
beforeFilter: Function,
|
|
59
|
+
popperClass: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
popperStyle: [String, Object],
|
|
64
|
+
teleported: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: !0
|
|
67
|
+
},
|
|
68
|
+
effect: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: "light"
|
|
71
|
+
},
|
|
72
|
+
tagType: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "info"
|
|
75
|
+
},
|
|
76
|
+
tagEffect: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "light"
|
|
79
|
+
},
|
|
80
|
+
validateEvent: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: !0
|
|
83
|
+
},
|
|
84
|
+
maxCollapseTags: {
|
|
85
|
+
type: Number,
|
|
86
|
+
default: 1
|
|
87
|
+
},
|
|
88
|
+
emptyValues: Array,
|
|
89
|
+
valueOnClear: [
|
|
90
|
+
String,
|
|
91
|
+
Number,
|
|
92
|
+
Boolean,
|
|
93
|
+
Function
|
|
94
|
+
],
|
|
95
|
+
persistent: {
|
|
96
|
+
type: Boolean,
|
|
97
|
+
default: !0
|
|
98
|
+
},
|
|
99
|
+
fallbackPlacements: {
|
|
100
|
+
type: Array,
|
|
101
|
+
default: () => [
|
|
102
|
+
"bottom-start",
|
|
103
|
+
"top-start",
|
|
104
|
+
"right",
|
|
105
|
+
"left"
|
|
106
|
+
]
|
|
107
|
+
},
|
|
108
|
+
placement: {
|
|
109
|
+
type: String,
|
|
110
|
+
default: "bottom-start"
|
|
111
|
+
},
|
|
112
|
+
popperAppendToBody: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
default: !0
|
|
115
|
+
},
|
|
116
|
+
showCheckedStrategy: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: "child"
|
|
119
|
+
},
|
|
120
|
+
readonly: Boolean,
|
|
121
|
+
last: Boolean,
|
|
122
|
+
checkStrictly: Boolean,
|
|
123
|
+
labelKey: {
|
|
124
|
+
type: String,
|
|
125
|
+
default: "label"
|
|
126
|
+
},
|
|
127
|
+
valueKey: {
|
|
128
|
+
type: String,
|
|
129
|
+
default: "value"
|
|
130
|
+
},
|
|
131
|
+
emitPath: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: !0
|
|
134
|
+
},
|
|
135
|
+
join: {
|
|
136
|
+
type: Boolean,
|
|
137
|
+
default: !0
|
|
138
|
+
},
|
|
139
|
+
idAsValue: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: !0
|
|
142
|
+
},
|
|
143
|
+
labelAsValue: Boolean,
|
|
144
|
+
treeDict: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: !0
|
|
147
|
+
},
|
|
148
|
+
dictType: String
|
|
149
|
+
}, h = {
|
|
150
|
+
modelValue: !0,
|
|
151
|
+
readonly: !0,
|
|
152
|
+
disabled: !0,
|
|
153
|
+
props: !0
|
|
154
|
+
}, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
|
|
155
|
+
name: "FormCascader",
|
|
156
|
+
props: { ...m },
|
|
157
|
+
emits: { ...t },
|
|
158
|
+
setup(t, { emit: n, slots: r, attrs: m }) {
|
|
159
|
+
let { emitInput: h, render: _, placeholder: v, disabled: y, listeners: b, inputProps: x } = e(t, {
|
|
160
|
+
emit: n,
|
|
161
|
+
slots: r,
|
|
162
|
+
attrs: m,
|
|
163
|
+
predicate: g
|
|
164
|
+
}), { dictItems: S } = i(t), C = l(() => {
|
|
165
|
+
if (t.dictType) return S.value;
|
|
166
|
+
if (t.options) {
|
|
167
|
+
let e = f(t.options);
|
|
168
|
+
return t.last && c(e), e;
|
|
169
|
+
} else return [];
|
|
170
|
+
}), w = l(() => {
|
|
171
|
+
if (t.join) return o(t.modelValue) ? t.modelValue : s(t.modelValue) ? t.modelValue.split(t.separator) : [];
|
|
172
|
+
if (t.last) {
|
|
173
|
+
let [e] = a(C.value, (e) => e[t.valueKey] === t.modelValue), n = [];
|
|
174
|
+
for (; e;) n.push(e[t.valueKey]), e = e.parent;
|
|
175
|
+
return n.reverse();
|
|
176
|
+
}
|
|
177
|
+
return t.modelValue;
|
|
178
|
+
}), T = (e) => {
|
|
179
|
+
t.join && o(e) ? h(e.join(t.separator)) : h(t.last ? e[e.length - 1] : e);
|
|
180
|
+
};
|
|
181
|
+
return () => _({ vNodes: u(p, d(b.value, x.value, {
|
|
182
|
+
style: "width: 100%",
|
|
183
|
+
class: { "is-readonly": t.readonly },
|
|
184
|
+
"model-value": w.value,
|
|
185
|
+
options: C.value,
|
|
186
|
+
props: {
|
|
187
|
+
checkStrictly: t.checkStrictly,
|
|
188
|
+
label: t.labelKey,
|
|
189
|
+
value: t.valueKey,
|
|
190
|
+
emitPath: t.emitPath,
|
|
191
|
+
expandTrigger: "hover"
|
|
192
|
+
},
|
|
193
|
+
disabled: y.value,
|
|
194
|
+
placeholder: v.value,
|
|
195
|
+
"onUpdate:modelValue": T
|
|
196
|
+
}), null) });
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
//#endregion
|
|
200
|
+
export { _ as t };
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { i as e, n as t } from "./CXSIP67a.mjs";
|
|
2
|
+
import { n, t as r } from "./BROfNO6c.mjs";
|
|
3
|
+
import { isString as i } from "@web-utils/core";
|
|
4
|
+
import { computed as a, createVNode as o, mergeProps as s } from "vue";
|
|
5
|
+
import { ElInputNumber as c } from "element-plus/es";
|
|
6
|
+
import "element-plus/es/components/base/style/css";
|
|
7
|
+
import "element-plus/es/components/input-number/style/css";
|
|
8
|
+
//#region src/components/form/props/input-number.ts
|
|
9
|
+
var l = {
|
|
10
|
+
...n,
|
|
11
|
+
...r,
|
|
12
|
+
modelValue: [Number, null],
|
|
13
|
+
min: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: -(2 ** 53 - 1)
|
|
16
|
+
},
|
|
17
|
+
max: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 2 ** 53 - 1
|
|
20
|
+
},
|
|
21
|
+
step: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 1
|
|
24
|
+
},
|
|
25
|
+
stepStrictly: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: !1
|
|
28
|
+
},
|
|
29
|
+
precision: Number,
|
|
30
|
+
size: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "default"
|
|
33
|
+
},
|
|
34
|
+
readonly: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
controls: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
controlsPosition: String,
|
|
43
|
+
name: String,
|
|
44
|
+
ariaLabel: String,
|
|
45
|
+
placeholder: String,
|
|
46
|
+
id: String,
|
|
47
|
+
valueOnClear: [
|
|
48
|
+
Number,
|
|
49
|
+
null,
|
|
50
|
+
String
|
|
51
|
+
],
|
|
52
|
+
validateEvent: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: !0
|
|
55
|
+
},
|
|
56
|
+
inputmode: String,
|
|
57
|
+
align: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "left"
|
|
60
|
+
},
|
|
61
|
+
disabledScientific: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: !1
|
|
64
|
+
},
|
|
65
|
+
prefix: String,
|
|
66
|
+
suffix: String,
|
|
67
|
+
append: String
|
|
68
|
+
}, u = {
|
|
69
|
+
readonly: !0,
|
|
70
|
+
placeholder: !0,
|
|
71
|
+
disabled: !0,
|
|
72
|
+
modelValue: !0,
|
|
73
|
+
prefix: !0,
|
|
74
|
+
suffix: !0
|
|
75
|
+
}, d = (e) => n[e] === void 0 && u[e] !== !0, f = {
|
|
76
|
+
name: "FormInputNumber",
|
|
77
|
+
inheritAttrs: !1,
|
|
78
|
+
props: { ...l },
|
|
79
|
+
emits: { ...t },
|
|
80
|
+
setup(t, { emit: n, slots: r, attrs: l }) {
|
|
81
|
+
let { emitInput: u, render: f, placeholder: p, disabled: m, listeners: h, inputProps: g } = e(t, {
|
|
82
|
+
emit: n,
|
|
83
|
+
slots: r,
|
|
84
|
+
attrs: l,
|
|
85
|
+
predicate: d
|
|
86
|
+
}), _ = a(() => i(t.modelValue) ? Number(t.modelValue) : t.modelValue);
|
|
87
|
+
return () => f({ vNodes: o(c, s(h.value, g.value, {
|
|
88
|
+
style: "width: 100%",
|
|
89
|
+
modelValue: _.value,
|
|
90
|
+
disabled: m.value,
|
|
91
|
+
"onUpdate:modelValue": u,
|
|
92
|
+
placeholder: p.value
|
|
93
|
+
}), {
|
|
94
|
+
prefix: r.prefix || t.prefix ? () => t.prefix : null,
|
|
95
|
+
suffix: r.suffix || t.suffix ? () => t.suffix : t.append,
|
|
96
|
+
"decrease-icon": r["decrease-icon"],
|
|
97
|
+
"increase-icon": r["increase-icon"]
|
|
98
|
+
}) });
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
//#endregion
|
|
102
|
+
export { f as t };
|
|
@@ -0,0 +1,234 @@
|
|
|
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
|
+
import "element-plus/es/components/base/style/css";
|
|
8
|
+
import "element-plus/es/components/col/style/css";
|
|
9
|
+
import "element-plus/es/components/form-item/style/css";
|
|
10
|
+
import "element-plus/es/components/tooltip/style/css";
|
|
11
|
+
//#region src/components/form/props/form-item.ts
|
|
12
|
+
var S = {
|
|
13
|
+
prop: [String, Array],
|
|
14
|
+
label: String,
|
|
15
|
+
labelPosition: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: ""
|
|
18
|
+
},
|
|
19
|
+
labelWidth: [String, Number],
|
|
20
|
+
required: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: !1
|
|
23
|
+
},
|
|
24
|
+
rules: Object,
|
|
25
|
+
error: String,
|
|
26
|
+
showMessage: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !0
|
|
29
|
+
},
|
|
30
|
+
inlineMessage: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !1
|
|
33
|
+
},
|
|
34
|
+
size: String,
|
|
35
|
+
for: String,
|
|
36
|
+
validateStatus: String,
|
|
37
|
+
messagePrefix: String,
|
|
38
|
+
message: String,
|
|
39
|
+
wrapCol: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !0
|
|
42
|
+
},
|
|
43
|
+
fixedSpan: Number,
|
|
44
|
+
block: Boolean,
|
|
45
|
+
unwrap: Boolean,
|
|
46
|
+
half: Boolean,
|
|
47
|
+
formItemClass: String,
|
|
48
|
+
hideLabel: Boolean,
|
|
49
|
+
tips: { type: String },
|
|
50
|
+
tipsAfterLabel: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: !1
|
|
53
|
+
},
|
|
54
|
+
labelColspan: [Number, String],
|
|
55
|
+
inputColspan: [Number, String],
|
|
56
|
+
labelRowspan: [Number, String],
|
|
57
|
+
inputRowspan: [Number, String]
|
|
58
|
+
}, C = {
|
|
59
|
+
required: !0,
|
|
60
|
+
rules: !0,
|
|
61
|
+
messagePrefix: !0,
|
|
62
|
+
message: !0,
|
|
63
|
+
wrapCol: !0,
|
|
64
|
+
fixedSpan: !0,
|
|
65
|
+
block: !0,
|
|
66
|
+
unwrap: !0,
|
|
67
|
+
half: !0,
|
|
68
|
+
formItemClass: !0,
|
|
69
|
+
hideLabel: !0,
|
|
70
|
+
tips: !0,
|
|
71
|
+
tipsAfterLabel: !0,
|
|
72
|
+
labelColspan: !0,
|
|
73
|
+
inputColspan: !0,
|
|
74
|
+
labelRowspan: !0,
|
|
75
|
+
inputRowspan: !0
|
|
76
|
+
}, w = (e) => S[e] !== void 0 && C[e] !== !0, T = (t, { emit: n, events: r, predicate: i }) => l(() => e(t, i, r, n)), E = {
|
|
77
|
+
span: {
|
|
78
|
+
type: Number,
|
|
79
|
+
default: 12
|
|
80
|
+
},
|
|
81
|
+
offset: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 0
|
|
84
|
+
},
|
|
85
|
+
push: {
|
|
86
|
+
type: Number,
|
|
87
|
+
default: 0
|
|
88
|
+
},
|
|
89
|
+
pull: {
|
|
90
|
+
type: Number,
|
|
91
|
+
default: 0
|
|
92
|
+
},
|
|
93
|
+
xs: { type: [Number, Object] },
|
|
94
|
+
sm: { type: [Number, Object] },
|
|
95
|
+
md: { type: [Number, Object] },
|
|
96
|
+
lg: { type: [Number, Object] },
|
|
97
|
+
xl: { type: [Number, Object] },
|
|
98
|
+
tag: {
|
|
99
|
+
type: String,
|
|
100
|
+
default: "div"
|
|
101
|
+
}
|
|
102
|
+
}, 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) => {
|
|
103
|
+
let t = f(r, null);
|
|
104
|
+
return l(() => e.required === !0 ? !0 : (t == null ? void 0 : t.requiredFieldsMap[e.prop]) === !0);
|
|
105
|
+
}, j = (e, t) => {
|
|
106
|
+
c(t) ? e.push(t) : o(t) ? e.push(...t) : s(t) && e.push(t);
|
|
107
|
+
}, M = (e, { rules: t, attrs: n, messagePrefix: r, message: i, ...a } = {}) => {
|
|
108
|
+
let o = A(e);
|
|
109
|
+
return l(() => {
|
|
110
|
+
let s = { message: i }, c = h(t);
|
|
111
|
+
Object.keys({
|
|
112
|
+
...S,
|
|
113
|
+
...E
|
|
114
|
+
}).forEach((t) => {
|
|
115
|
+
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];
|
|
116
|
+
});
|
|
117
|
+
let l = [];
|
|
118
|
+
return j(l, h(n == null ? void 0 : n.class)), j(l, h(a == null ? void 0 : a.class)), s.required = o.value, s.class = l, s.style = n == null ? void 0 : n.style, s;
|
|
119
|
+
});
|
|
120
|
+
}, N = {
|
|
121
|
+
name: "FormItemX",
|
|
122
|
+
inheritAttrs: !1,
|
|
123
|
+
props: {
|
|
124
|
+
...S,
|
|
125
|
+
...E
|
|
126
|
+
},
|
|
127
|
+
setup(e, { attrs: t, slots: n, expose: a }) {
|
|
128
|
+
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(() => {
|
|
129
|
+
if (d.value) return [];
|
|
130
|
+
if (C.value) {
|
|
131
|
+
let t = {
|
|
132
|
+
required: !0,
|
|
133
|
+
message: e.message || `${e.messagePrefix || "请输入"}${e.label}`
|
|
134
|
+
};
|
|
135
|
+
return e.rules ? [...e.rules, t] : [t];
|
|
136
|
+
}
|
|
137
|
+
return e.rules;
|
|
138
|
+
});
|
|
139
|
+
return a({
|
|
140
|
+
clearValidate: async () => {
|
|
141
|
+
var e;
|
|
142
|
+
await m(), (e = E.value) == null || e.clearValidate();
|
|
143
|
+
},
|
|
144
|
+
validate: async () => {
|
|
145
|
+
var e;
|
|
146
|
+
await m(), (e = E.value) == null || e.validate();
|
|
147
|
+
}
|
|
148
|
+
}), () => {
|
|
149
|
+
var r;
|
|
150
|
+
let i = n.tips || e.tips, a = i ? u(x, {
|
|
151
|
+
effect: "light",
|
|
152
|
+
content: e.tips,
|
|
153
|
+
offset: 4
|
|
154
|
+
}, {
|
|
155
|
+
default: () => u("i", { class: "el-icon-info form-item-input-info" }, null),
|
|
156
|
+
content: n.tips ? n.tips : null
|
|
157
|
+
}) : null, o = u(b, p(h.value, t, {
|
|
158
|
+
ref: "formItem",
|
|
159
|
+
style: { width: j.value },
|
|
160
|
+
class: [
|
|
161
|
+
"form-item",
|
|
162
|
+
e.formItemClass,
|
|
163
|
+
{
|
|
164
|
+
"form-item-hide-label": e.hideLabel,
|
|
165
|
+
"with-tips": !e.tipsAfterLabel && i,
|
|
166
|
+
required: d.value === !1 && C.value
|
|
167
|
+
}
|
|
168
|
+
],
|
|
169
|
+
rules: N.value
|
|
170
|
+
}), {
|
|
171
|
+
...n,
|
|
172
|
+
default: () => {
|
|
173
|
+
var t;
|
|
174
|
+
return [(t = n.default) == null ? void 0 : t.call(n, {
|
|
175
|
+
disabled: d.value,
|
|
176
|
+
required: C.value
|
|
177
|
+
}), i && !e.tipsAfterLabel ? a : null];
|
|
178
|
+
},
|
|
179
|
+
label: () => [n.label ? n.label() : e.label, e.tipsAfterLabel ? a : null]
|
|
180
|
+
}), s = [o, (r = n.below) == null ? void 0 : r.call(n)];
|
|
181
|
+
return e.unwrap ? s : D.value ? u(y, p(_.value, S.value ? {
|
|
182
|
+
xs: 24,
|
|
183
|
+
sm: 12,
|
|
184
|
+
md: 12,
|
|
185
|
+
lg: 8,
|
|
186
|
+
xl: 6
|
|
187
|
+
} : {}, { span: M.value }), { default: () => s }) : o;
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}, P = "update:modelValue", F = (e) => {
|
|
191
|
+
let t = f(r, null), n = f(a, null);
|
|
192
|
+
return l(() => {
|
|
193
|
+
if (e.disabled !== void 0) return e.disabled;
|
|
194
|
+
if (t) {
|
|
195
|
+
if (t.requiredFieldsMap[e.prop] === !0 || t.enabledFieldsMap[e.prop] === !0) return !1;
|
|
196
|
+
if (t.disabledFieldsMap[e.prop] === !0) return !0;
|
|
197
|
+
}
|
|
198
|
+
return (n == null ? void 0 : n.enabled) === !0 ? !1 : (n == null ? void 0 : n.disabled) === !0 ? !0 : (t == null ? void 0 : t.disabled) === !0;
|
|
199
|
+
});
|
|
200
|
+
}, I = { [P]: null }, L = (e, t) => e(P, t), R = (e, { vNodes: t, formItemProps: n, slots: r, disabled: i }) => e.wrapFormItem ? d(N, {
|
|
201
|
+
...n.value,
|
|
202
|
+
embed: !0,
|
|
203
|
+
disabled: i == null ? void 0 : i.value
|
|
204
|
+
}, {
|
|
205
|
+
default: () => t,
|
|
206
|
+
label: r.label,
|
|
207
|
+
error: r.error,
|
|
208
|
+
tips: r.tips,
|
|
209
|
+
below: r.below
|
|
210
|
+
}) : t, z = (r, { emit: i, slots: a, attrs: o, rules: s, events: c, predicate: u, messagePrefix: f = "请输入", removeOn: p = !1, ...m }) => {
|
|
211
|
+
let h = F(r), g = l(() => h.value ? "" : `${f}${r.label}`), v = M(r, {
|
|
212
|
+
rules: s,
|
|
213
|
+
attrs: o,
|
|
214
|
+
message: g.value,
|
|
215
|
+
...m
|
|
216
|
+
}), y = (e) => L(i, e), b = (e) => r.col ? d(_, { span: r.block ? 24 : r.span }, { default: () => e }) : e, x = ({ vNodes: e }) => R(r, {
|
|
217
|
+
vNodes: b(e),
|
|
218
|
+
formItemProps: v,
|
|
219
|
+
slots: a,
|
|
220
|
+
disabled: h
|
|
221
|
+
}), S = l(() => e(r, u, c, i)), C = n({ removeOn: p });
|
|
222
|
+
return {
|
|
223
|
+
emitInput: y,
|
|
224
|
+
render: x,
|
|
225
|
+
placeholder: g,
|
|
226
|
+
disabled: h,
|
|
227
|
+
formItemProps: v,
|
|
228
|
+
autoBind: S,
|
|
229
|
+
inputProps: t(r, u),
|
|
230
|
+
listeners: C
|
|
231
|
+
};
|
|
232
|
+
}, B = (e) => e.icon ? d("i", { class: e.icon }) : null;
|
|
233
|
+
//#endregion
|
|
234
|
+
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 };
|