@web-utils/form-ui 1.0.0-beta5 → 1.0.0-beta50
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/B-zqRAXo.mjs +69 -0
- package/chunks/B1IPSTA6.mjs +198 -0
- package/chunks/B9gA65rt2.mjs +38 -0
- package/chunks/BA2KEptL.mjs +172 -0
- package/chunks/BBERmTup.mjs +83 -0
- package/chunks/BUGCiCnl.mjs +83 -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/ByHz4mmh.mjs +87 -0
- package/chunks/C2zgFLYO.mjs +185 -0
- package/chunks/CAd1zK9Q.mjs +25 -0
- package/chunks/CJdkjadi.mjs +17 -0
- package/chunks/CabldOLo.mjs +157 -0
- package/chunks/CkOD-_VV.mjs +8 -0
- package/chunks/Cln3RBAD.mjs +660 -0
- package/chunks/CqoVAnxC2.mjs +93 -0
- package/chunks/CuAoMR3n.mjs +105 -0
- package/chunks/CxTg0r4n.mjs +166 -0
- package/chunks/D0Zg2CV0.mjs +57 -0
- package/chunks/DA7oGHSX.mjs +141 -0
- package/chunks/DOP3aBxf.mjs +93 -0
- package/chunks/DOZRzqlo.mjs +37 -0
- package/chunks/D_qiRmiE.mjs +230 -0
- package/chunks/DcTVYqeJ.mjs +113 -0
- package/chunks/Dkd5BC98.mjs +198 -0
- package/chunks/GI8krYU82.mjs +478 -0
- package/chunks/V2p-PCpL.mjs +176 -0
- package/chunks/bFbPPcdq.mjs +25 -0
- package/chunks/cqIZWDHo.mjs +614 -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/hzaYr6Ud2.mjs +207 -0
- package/chunks/kflKDW4T2.mjs +146 -0
- package/chunks/pIzhYsBe.mjs +93 -0
- package/chunks/vXQf89tS.mjs +1361 -0
- package/chunks/wXeqV-_7.mjs +89 -0
- package/chunks/zwXzk9ff2.mjs +568 -0
- package/confirm-button/index.d.ts +115 -0
- package/confirm-button/index.mjs +35 -0
- package/confirmable/index.d.ts +86 -0
- package/confirmable/index.mjs +8 -0
- package/constants/index.d.ts +53 -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 +116 -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 +398 -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 +472 -0
- package/sub-table/style.css +1 -0
- package/sub-table-plus/index.d.ts +97 -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 +340 -1
- package/table-view/index.mjs +454 -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,317 @@
|
|
|
1
|
+
import { i as e, n as t } from "./D_qiRmiE.mjs";
|
|
2
|
+
import { n } from "./CJdkjadi.mjs";
|
|
3
|
+
import { useDictionary as r } from "../hook/useDictionary.mjs";
|
|
4
|
+
import { isNumber as i, isPlainObject as a, isString as o } from "@web-utils/core";
|
|
5
|
+
import { computed as s, createVNode as c, mergeProps as l, ref as u, watchEffect as d } from "vue";
|
|
6
|
+
import { ElOption as f, ElSelect as p } from "element-plus/es";
|
|
7
|
+
//#region src/components/form/props/select.ts
|
|
8
|
+
var m = {
|
|
9
|
+
...n,
|
|
10
|
+
modelValue: [
|
|
11
|
+
String,
|
|
12
|
+
Number,
|
|
13
|
+
Boolean,
|
|
14
|
+
Object,
|
|
15
|
+
Array
|
|
16
|
+
],
|
|
17
|
+
multiple: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
},
|
|
21
|
+
options: {
|
|
22
|
+
type: Array,
|
|
23
|
+
default: () => []
|
|
24
|
+
},
|
|
25
|
+
props: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default: () => ({
|
|
28
|
+
label: "label",
|
|
29
|
+
value: "value"
|
|
30
|
+
})
|
|
31
|
+
},
|
|
32
|
+
valueKey: {
|
|
33
|
+
type: String,
|
|
34
|
+
default: "value"
|
|
35
|
+
},
|
|
36
|
+
size: String,
|
|
37
|
+
clearable: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: !0
|
|
40
|
+
},
|
|
41
|
+
collapseTags: {
|
|
42
|
+
type: Boolean,
|
|
43
|
+
default: !1
|
|
44
|
+
},
|
|
45
|
+
collapseTagsTooltip: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: !1
|
|
48
|
+
},
|
|
49
|
+
tagTooltip: {
|
|
50
|
+
type: Object,
|
|
51
|
+
default: () => ({})
|
|
52
|
+
},
|
|
53
|
+
multipleLimit: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 0
|
|
56
|
+
},
|
|
57
|
+
id: String,
|
|
58
|
+
name: String,
|
|
59
|
+
effect: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "light"
|
|
62
|
+
},
|
|
63
|
+
autocomplete: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: "off"
|
|
66
|
+
},
|
|
67
|
+
placeholder: String,
|
|
68
|
+
filterable: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: !1
|
|
71
|
+
},
|
|
72
|
+
allowCreate: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: !1
|
|
75
|
+
},
|
|
76
|
+
filterMethod: Function,
|
|
77
|
+
remote: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: !1
|
|
80
|
+
},
|
|
81
|
+
debounce: {
|
|
82
|
+
type: Number,
|
|
83
|
+
default: 300
|
|
84
|
+
},
|
|
85
|
+
remoteMethod: Function,
|
|
86
|
+
remoteShowSuffix: {
|
|
87
|
+
type: Boolean,
|
|
88
|
+
default: !1
|
|
89
|
+
},
|
|
90
|
+
loading: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
loadingText: String,
|
|
95
|
+
noMatchText: String,
|
|
96
|
+
noDataText: String,
|
|
97
|
+
popperClass: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: ""
|
|
100
|
+
},
|
|
101
|
+
popperStyle: [String, Object],
|
|
102
|
+
reserveKeyword: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: !0
|
|
105
|
+
},
|
|
106
|
+
defaultFirstOption: {
|
|
107
|
+
type: Boolean,
|
|
108
|
+
default: !1
|
|
109
|
+
},
|
|
110
|
+
teleported: {
|
|
111
|
+
type: Boolean,
|
|
112
|
+
default: !0
|
|
113
|
+
},
|
|
114
|
+
appendTo: [String, Object],
|
|
115
|
+
persistent: {
|
|
116
|
+
type: Boolean,
|
|
117
|
+
default: !0
|
|
118
|
+
},
|
|
119
|
+
automaticDropdown: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
clearIcon: [String, Object],
|
|
124
|
+
fitInputWidth: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: !1
|
|
127
|
+
},
|
|
128
|
+
suffixIcon: [String, Object],
|
|
129
|
+
tagType: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: "info"
|
|
132
|
+
},
|
|
133
|
+
tagEffect: {
|
|
134
|
+
type: String,
|
|
135
|
+
default: "light"
|
|
136
|
+
},
|
|
137
|
+
validateEvent: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
default: !0
|
|
140
|
+
},
|
|
141
|
+
dropDownOffset: {
|
|
142
|
+
type: Number,
|
|
143
|
+
default: 12
|
|
144
|
+
},
|
|
145
|
+
showArrow: {
|
|
146
|
+
type: Boolean,
|
|
147
|
+
default: !0
|
|
148
|
+
},
|
|
149
|
+
placement: {
|
|
150
|
+
type: String,
|
|
151
|
+
default: "bottom-start"
|
|
152
|
+
},
|
|
153
|
+
fallbackPlacements: {
|
|
154
|
+
type: Array,
|
|
155
|
+
default: () => [
|
|
156
|
+
"bottom-start",
|
|
157
|
+
"top-start",
|
|
158
|
+
"right",
|
|
159
|
+
"left"
|
|
160
|
+
]
|
|
161
|
+
},
|
|
162
|
+
maxCollapseTags: {
|
|
163
|
+
type: Number,
|
|
164
|
+
default: 1
|
|
165
|
+
},
|
|
166
|
+
popperOptions: {
|
|
167
|
+
type: Object,
|
|
168
|
+
default: () => ({})
|
|
169
|
+
},
|
|
170
|
+
ariaLabel: String,
|
|
171
|
+
emptyValues: Array,
|
|
172
|
+
valueOnClear: [
|
|
173
|
+
String,
|
|
174
|
+
Number,
|
|
175
|
+
Boolean,
|
|
176
|
+
Function
|
|
177
|
+
],
|
|
178
|
+
suffixTransition: {
|
|
179
|
+
type: Boolean,
|
|
180
|
+
default: !0
|
|
181
|
+
},
|
|
182
|
+
tabindex: [String, Number],
|
|
183
|
+
dictType: String,
|
|
184
|
+
gender: Boolean,
|
|
185
|
+
year: [Boolean, Number],
|
|
186
|
+
all: Boolean,
|
|
187
|
+
confirm: Boolean,
|
|
188
|
+
start: Number,
|
|
189
|
+
end: Number,
|
|
190
|
+
optionLabel: [String, Number],
|
|
191
|
+
emitLabel: Boolean,
|
|
192
|
+
english: Boolean,
|
|
193
|
+
chinese: Boolean,
|
|
194
|
+
typing: Boolean,
|
|
195
|
+
multipleStringMode: Boolean,
|
|
196
|
+
multipleStringSeparator: {
|
|
197
|
+
type: String,
|
|
198
|
+
default: ","
|
|
199
|
+
}
|
|
200
|
+
}, h = {
|
|
201
|
+
modelValue: !0,
|
|
202
|
+
emptyValues: !0,
|
|
203
|
+
disabled: !0,
|
|
204
|
+
dropDownOffset: !0,
|
|
205
|
+
valueOnClear: !0,
|
|
206
|
+
options: !0,
|
|
207
|
+
dictType: !0,
|
|
208
|
+
gender: !0,
|
|
209
|
+
year: !0,
|
|
210
|
+
all: !0,
|
|
211
|
+
confirm: !0,
|
|
212
|
+
start: !0,
|
|
213
|
+
end: !0,
|
|
214
|
+
optionLabel: !0,
|
|
215
|
+
emitLabel: !0,
|
|
216
|
+
english: !0,
|
|
217
|
+
chinese: !0,
|
|
218
|
+
typing: !0,
|
|
219
|
+
multipleStringMode: !0,
|
|
220
|
+
multipleStringSeparator: !0
|
|
221
|
+
}, g = (e) => n[e] === void 0 && h[e] !== !0, _ = {
|
|
222
|
+
name: "FormSelect",
|
|
223
|
+
inheritAttrs: !1,
|
|
224
|
+
props: { ...m },
|
|
225
|
+
emits: { ...t },
|
|
226
|
+
setup(t, { emit: n, slots: m, attrs: h }) {
|
|
227
|
+
let { emitInput: _, render: v, placeholder: y, disabled: b, listeners: x, inputProps: S } = e(t, {
|
|
228
|
+
emit: n,
|
|
229
|
+
slots: m,
|
|
230
|
+
attrs: h,
|
|
231
|
+
predicate: g,
|
|
232
|
+
messagePrefix: "请选择"
|
|
233
|
+
}), C = u(null), w = u(!1);
|
|
234
|
+
d(() => {
|
|
235
|
+
if (t.multiple && t.multipleStringMode) {
|
|
236
|
+
var e;
|
|
237
|
+
C.value = (e = t.modelValue) == null ? void 0 : e.split(",").filter((e) => e);
|
|
238
|
+
} else C.value = t.modelValue;
|
|
239
|
+
});
|
|
240
|
+
let T = (e) => {
|
|
241
|
+
if (t.multiple && t.multipleStringMode ? _(e.join(t.multipleStringSeparator)) : _(e), t.emitLabel) {
|
|
242
|
+
let r = O.value.find((n) => n[t.props.value] === e), i = r == null ? void 0 : r[t.props.label];
|
|
243
|
+
i !== t.optionLabel && n("update:optionLabel", i);
|
|
244
|
+
}
|
|
245
|
+
}, { dictItems: E } = r(t), D = u([]), O = s(() => {
|
|
246
|
+
if (t.dictType) return E.value;
|
|
247
|
+
if (t.remote) return D.value;
|
|
248
|
+
if (t.gender) return [{
|
|
249
|
+
[t.props.label]: "男",
|
|
250
|
+
[t.props.value]: t.chinese ? "男" : t.typing ? 1 : "1"
|
|
251
|
+
}, {
|
|
252
|
+
[t.props.label]: "女",
|
|
253
|
+
[t.props.value]: t.chinese ? "女" : t.typing ? 2 : "2"
|
|
254
|
+
}];
|
|
255
|
+
if (t.confirm) return [{
|
|
256
|
+
[t.props.label]: "是",
|
|
257
|
+
[t.props.value]: t.chinese ? "是" : t.english ? "Y" : t.typing ? 1 : "1"
|
|
258
|
+
}, {
|
|
259
|
+
[t.props.label]: "否",
|
|
260
|
+
[t.props.value]: t.chinese ? "否" : t.english ? "N" : t.typing ? 0 : "0"
|
|
261
|
+
}];
|
|
262
|
+
if (t.all) return [{
|
|
263
|
+
[t.props.value]: "",
|
|
264
|
+
[t.props.label]: "全部"
|
|
265
|
+
}, ...t.options];
|
|
266
|
+
if (t.start && t.end) return Array(t.end - t.start + 1).fill(1).map((e, n) => ({
|
|
267
|
+
[t.props.label]: t.start + n,
|
|
268
|
+
[t.props.value]: t.start + n
|
|
269
|
+
}));
|
|
270
|
+
if (t.year) {
|
|
271
|
+
let e = (/* @__PURE__ */ new Date()).getFullYear(), n = [], r = 10;
|
|
272
|
+
i(t.year) && (r = t.year);
|
|
273
|
+
for (let i = -r; i <= r; i++) {
|
|
274
|
+
let r = e + i;
|
|
275
|
+
n.push({
|
|
276
|
+
[t.props.label]: r,
|
|
277
|
+
[t.props.value]: r
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
return n;
|
|
281
|
+
}
|
|
282
|
+
return t.options ? t.options.map((e) => (e[t.props.value] = e[t.props.value] ?? e[t.props.label], e)) : [];
|
|
283
|
+
}), k = async (e) => {
|
|
284
|
+
try {
|
|
285
|
+
var n;
|
|
286
|
+
w.value = !0;
|
|
287
|
+
let r = await t.remoteMethod(e, t.prop);
|
|
288
|
+
((n = r.data.data) == null ? void 0 : n.length) >= 0 ? o(r.data.data[0]) ? D.value = r.data.data.map((e) => ({
|
|
289
|
+
[t.props.value]: e,
|
|
290
|
+
[t.props.label]: e
|
|
291
|
+
})) : a(r.data.data[0]) && (D.value = r.data.data) : D.value = [];
|
|
292
|
+
} catch {}
|
|
293
|
+
w.value = !1;
|
|
294
|
+
};
|
|
295
|
+
return d(() => {
|
|
296
|
+
t.remote && k();
|
|
297
|
+
}), () => v({ vNodes: c(p, l(x.value, S.value, {
|
|
298
|
+
offset: t.dropDownOffset,
|
|
299
|
+
"model-value": C.value,
|
|
300
|
+
"onUpdate:modelValue": T,
|
|
301
|
+
disabled: b.value,
|
|
302
|
+
placeholder: y.value
|
|
303
|
+
}), {
|
|
304
|
+
...m,
|
|
305
|
+
default: m.default || (() => {
|
|
306
|
+
var e;
|
|
307
|
+
return (e = O.value) == null ? void 0 : e.map(({ value: e, label: t }) => c(f, {
|
|
308
|
+
key: e,
|
|
309
|
+
label: t,
|
|
310
|
+
value: e
|
|
311
|
+
}, null));
|
|
312
|
+
})
|
|
313
|
+
}) });
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
//#endregion
|
|
317
|
+
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 };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { n as e } from "./D_qiRmiE.mjs";
|
|
2
|
+
import { n as t, t as n } from "./CabldOLo.mjs";
|
|
3
|
+
import { createVNode as r, isVNode as i, mergeProps as a, useModel as o } from "vue";
|
|
4
|
+
//#region src/components/form/FormInputIdCard.vue?vue&type=script&lang.jsx
|
|
5
|
+
function s(e) {
|
|
6
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !i(e);
|
|
7
|
+
}
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/components/form/FormInputIdCard.vue
|
|
10
|
+
var c = {
|
|
11
|
+
name: "FormInputIdCard",
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
props: { ...t },
|
|
14
|
+
emits: { ...e },
|
|
15
|
+
setup(e, { slots: t, attrs: i }) {
|
|
16
|
+
let c = o(e, "modelValue");
|
|
17
|
+
return () => r(n, a(e, i, {
|
|
18
|
+
modelValue: c.value,
|
|
19
|
+
"onUpdate:modelValue": (e) => c.value = e,
|
|
20
|
+
type: "idcard"
|
|
21
|
+
}), s(t) ? t : { default: () => [t] });
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
export { c as t };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { c as e, s as t } from "./D_qiRmiE.mjs";
|
|
2
|
+
//#region src/components/form/props/common.ts
|
|
3
|
+
var n = {
|
|
4
|
+
...e,
|
|
5
|
+
...t,
|
|
6
|
+
wrapFormItem: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
default: !0
|
|
9
|
+
},
|
|
10
|
+
disabled: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
col: Boolean
|
|
15
|
+
}, r = { size: { type: String } };
|
|
16
|
+
//#endregion
|
|
17
|
+
export { n, r as t };
|