orion-design 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +5 -5
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +3 -1
- package/dist/components/Form/Form.js.map +1 -1
- package/dist/components/Form/Form.vue.d.ts +6 -10
- package/dist/components/Form/hooks/useForm.d.ts +4 -1
- package/dist/components/Form/hooks/useForm.js +67 -30
- package/dist/components/Form/hooks/useForm.js.map +1 -1
- package/dist/components/Form/index.d.ts +11 -19
- package/dist/components/Form/index.js +285 -295
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/_util/arrays.js.map +1 -1
- package/dist/components/_util/browser.js.map +1 -1
- package/dist/components/_util/dom/aria.js.map +1 -1
- package/dist/components/_util/dom/element.js.map +1 -1
- package/dist/components/_util/dom/event.js.map +1 -1
- package/dist/components/_util/dom/position.js.map +1 -1
- package/dist/components/_util/dom/scroll.js.map +1 -1
- package/dist/components/_util/dom/style.js.map +1 -1
- package/dist/components/_util/easings.js.map +1 -1
- package/dist/components/_util/error.js.map +1 -1
- package/dist/components/_util/i18n.js.map +1 -1
- package/dist/components/_util/objects.js.map +1 -1
- package/dist/components/_util/raf.js.map +1 -1
- package/dist/components/_util/rand.js.map +1 -1
- package/dist/components/_util/strings.js.map +1 -1
- package/dist/components/_util/throttleByRaf.js.map +1 -1
- package/dist/components/_util/types.js.map +1 -1
- package/dist/components/_util/typescript.js.map +1 -1
- package/dist/components/_util/vue/global-node.js.map +1 -1
- package/dist/components/_util/vue/icon.js.map +1 -1
- package/dist/components/_util/vue/install.js.map +1 -1
- package/dist/components/_util/vue/props/runtime.js.map +1 -1
- package/dist/components/_util/vue/refs.js.map +1 -1
- package/dist/components/_util/vue/size.js.map +1 -1
- package/dist/components/_util/vue/validator.js.map +1 -1
- package/dist/components/_util/vue/vnode.js.map +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/version/version.d.ts +1 -1
- package/dist/version/version.js +1 -1
- package/dist/version/version.js.map +1 -1
- package/package.json +1 -1
@@ -1,59 +1,57 @@
|
|
1
|
-
import { isString as
|
2
|
-
import { defineComponent as
|
3
|
-
import { withInstall as
|
4
|
-
import { ElForm as
|
1
|
+
import { isString as H, isDate as j } from "lodash-es";
|
2
|
+
import { defineComponent as h, useTemplateRef as $, provide as L, reactive as N, toRef as B, openBlock as s, createBlock as p, unref as e, withCtx as u, createVNode as b, renderSlot as C, isRef as w, computed as S, createElementBlock as F, Fragment as z, renderList as M, createTextVNode as A, toDisplayString as K, watch as J, ref as Q, onMounted as X, normalizeStyle as Z } from "vue";
|
3
|
+
import { withInstall as x } from "../_util/vue/install.js";
|
4
|
+
import { ElForm as _, ElRow as ee, ElCol as c, ElFormItem as g, ElInput as q, ElSelect as E, ElOption as U, ElRadioGroup as le, ElRadio as ae, ElCheckboxGroup as oe, ElCheckbox as T, ElSwitch as re, dayjs as R, ElTimePicker as ne, ElDatePicker as de } from "element-plus";
|
5
5
|
import { formContextKey as te } from "./Form.js";
|
6
|
-
import { useFormSpan as
|
7
|
-
import { getSingleCodeContent as
|
6
|
+
import { useFormSpan as v, useFormRules as V, useFormDirectModel as O, useFormDisabled as Y, useFormCode as W, useFormMultiModel as G, useFormContext as P, useFormBooleanModel as I } from "./hooks/useForm.js";
|
7
|
+
import { getSingleCodeContent as ue, getMultiCodeContent as ie } from "./utils/index.js";
|
8
8
|
import D from "../../error/OrionError.js";
|
9
|
-
import { S as
|
10
|
-
const
|
9
|
+
import { S as se } from "../../index-BbsXWo7C.js";
|
10
|
+
const me = /* @__PURE__ */ h({
|
11
11
|
name: "OForm",
|
12
12
|
__name: "Form",
|
13
|
-
props:
|
13
|
+
props: {
|
14
14
|
rules: {},
|
15
15
|
itemSpan: { default: 6 },
|
16
16
|
itemLabelWidth: { default: "auto" },
|
17
|
-
disabled: { type: Boolean, default: !1 }
|
18
|
-
|
19
|
-
|
20
|
-
modelModifiers: {}
|
21
|
-
}),
|
17
|
+
disabled: { type: Boolean, default: !1 },
|
18
|
+
modelValue: {}
|
19
|
+
},
|
22
20
|
emits: ["update:modelValue"],
|
23
|
-
setup(o, { expose:
|
24
|
-
const i =
|
25
|
-
|
26
|
-
|
27
|
-
|
21
|
+
setup(o, { expose: m, emit: i }) {
|
22
|
+
const a = i, l = (d, f) => {
|
23
|
+
a("update:modelValue", { ...o.modelValue, [d]: f });
|
24
|
+
}, n = $("form");
|
25
|
+
return m({
|
26
|
+
validate: async () => await n.value.validate()
|
27
|
+
}), L(
|
28
28
|
te,
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
N({
|
30
|
+
modelValue: B(() => o.modelValue),
|
31
|
+
updateModelValue: l,
|
32
|
+
rules: B(() => o.rules),
|
33
|
+
itemSpan: B(() => o.itemSpan),
|
34
|
+
disabled: B(() => o.disabled)
|
34
35
|
})
|
35
|
-
), (
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
"
|
40
|
-
|
41
|
-
rules: l.rules,
|
42
|
-
"label-width": l.itemLabelWidth,
|
43
|
-
disabled: l.disabled
|
36
|
+
), (d, f) => (s(), p(e(_), {
|
37
|
+
ref: "form",
|
38
|
+
model: d.modelValue,
|
39
|
+
rules: d.rules,
|
40
|
+
"label-width": d.itemLabelWidth,
|
41
|
+
disabled: d.disabled
|
44
42
|
}, {
|
45
|
-
default:
|
46
|
-
|
47
|
-
default:
|
48
|
-
|
43
|
+
default: u(() => [
|
44
|
+
b(e(ee), { gutter: 16 }, {
|
45
|
+
default: u(() => [
|
46
|
+
C(d.$slots, "default")
|
49
47
|
]),
|
50
48
|
_: 3
|
51
49
|
})
|
52
50
|
]),
|
53
51
|
_: 3
|
54
|
-
}, 8, ["
|
52
|
+
}, 8, ["model", "rules", "label-width", "disabled"]));
|
55
53
|
}
|
56
|
-
}),
|
54
|
+
}), pe = /* @__PURE__ */ h({
|
57
55
|
name: "OFormString",
|
58
56
|
extendOptions: { trigger: "blur" },
|
59
57
|
__name: "StringInput",
|
@@ -70,20 +68,20 @@ const ie = /* @__PURE__ */ y({
|
|
70
68
|
readonly: { type: Boolean }
|
71
69
|
},
|
72
70
|
setup(o) {
|
73
|
-
const
|
74
|
-
return (l,
|
75
|
-
default:
|
76
|
-
|
71
|
+
const m = v(), i = V(), a = O();
|
72
|
+
return (l, n) => (s(), p(e(c), { span: e(m) }, {
|
73
|
+
default: u(() => [
|
74
|
+
b(e(g), {
|
77
75
|
prop: l.name,
|
78
76
|
label: l.label,
|
79
77
|
"label-width": l.labelWidth,
|
80
78
|
required: l.required,
|
81
79
|
rules: e(i)
|
82
80
|
}, {
|
83
|
-
default:
|
84
|
-
|
85
|
-
modelValue:
|
86
|
-
"onUpdate:modelValue":
|
81
|
+
default: u(() => [
|
82
|
+
b(e(q), {
|
83
|
+
modelValue: e(a),
|
84
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
|
87
85
|
maxlength: l.maxlength,
|
88
86
|
placeholder: l.placeholder,
|
89
87
|
disabled: l.disabled,
|
@@ -96,7 +94,7 @@ const ie = /* @__PURE__ */ y({
|
|
96
94
|
_: 1
|
97
95
|
}, 8, ["span"]));
|
98
96
|
}
|
99
|
-
}),
|
97
|
+
}), be = /* @__PURE__ */ h({
|
100
98
|
name: "OFormPassword",
|
101
99
|
extendOptions: { trigger: "blur" },
|
102
100
|
__name: "PasswordInput",
|
@@ -113,20 +111,20 @@ const ie = /* @__PURE__ */ y({
|
|
113
111
|
readonly: { type: Boolean }
|
114
112
|
},
|
115
113
|
setup(o) {
|
116
|
-
const
|
117
|
-
return (l,
|
118
|
-
default:
|
119
|
-
|
114
|
+
const m = v(), i = V(), a = O();
|
115
|
+
return (l, n) => (s(), p(e(c), { span: e(m) }, {
|
116
|
+
default: u(() => [
|
117
|
+
b(e(g), {
|
120
118
|
prop: l.name,
|
121
119
|
label: l.label,
|
122
120
|
"label-width": l.labelWidth,
|
123
121
|
required: l.required,
|
124
122
|
rules: e(i)
|
125
123
|
}, {
|
126
|
-
default:
|
127
|
-
|
128
|
-
modelValue:
|
129
|
-
"onUpdate:modelValue":
|
124
|
+
default: u(() => [
|
125
|
+
b(e(q), {
|
126
|
+
modelValue: e(a),
|
127
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
|
130
128
|
maxlength: l.maxlength,
|
131
129
|
placeholder: l.placeholder,
|
132
130
|
disabled: l.disabled,
|
@@ -140,7 +138,7 @@ const ie = /* @__PURE__ */ y({
|
|
140
138
|
_: 1
|
141
139
|
}, 8, ["span"]));
|
142
140
|
}
|
143
|
-
}),
|
141
|
+
}), fe = /* @__PURE__ */ h({
|
144
142
|
name: "OFormTextarea",
|
145
143
|
extendOptions: { trigger: "blur" },
|
146
144
|
__name: "Textarea",
|
@@ -158,20 +156,20 @@ const ie = /* @__PURE__ */ y({
|
|
158
156
|
rows: {}
|
159
157
|
},
|
160
158
|
setup(o) {
|
161
|
-
const
|
162
|
-
return (l,
|
163
|
-
default:
|
164
|
-
|
159
|
+
const m = v(), i = V(), a = O();
|
160
|
+
return (l, n) => (s(), p(e(c), { span: e(m) }, {
|
161
|
+
default: u(() => [
|
162
|
+
b(e(g), {
|
165
163
|
prop: l.name,
|
166
164
|
label: l.label,
|
167
165
|
"label-width": l.labelWidth,
|
168
166
|
required: l.required,
|
169
167
|
rules: e(i)
|
170
168
|
}, {
|
171
|
-
default:
|
172
|
-
|
173
|
-
modelValue:
|
174
|
-
"onUpdate:modelValue":
|
169
|
+
default: u(() => [
|
170
|
+
b(e(q), {
|
171
|
+
modelValue: e(a),
|
172
|
+
"onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
|
175
173
|
maxlength: l.maxlength,
|
176
174
|
placeholder: l.placeholder,
|
177
175
|
disabled: l.disabled,
|
@@ -187,7 +185,7 @@ const ie = /* @__PURE__ */ y({
|
|
187
185
|
_: 1
|
188
186
|
}, 8, ["span"]));
|
189
187
|
}
|
190
|
-
}),
|
188
|
+
}), he = /* @__PURE__ */ h({
|
191
189
|
name: "OFormSingleselect",
|
192
190
|
extendOptions: {},
|
193
191
|
__name: "SingleSelect",
|
@@ -205,36 +203,36 @@ const ie = /* @__PURE__ */ y({
|
|
205
203
|
filterable: { type: Boolean }
|
206
204
|
},
|
207
205
|
setup(o) {
|
208
|
-
const
|
209
|
-
return (
|
210
|
-
default:
|
211
|
-
|
212
|
-
prop:
|
213
|
-
label:
|
214
|
-
"label-width":
|
215
|
-
required:
|
206
|
+
const m = v(), i = V(), a = Y(), l = W(), n = O(), t = S(() => ue(l.value, n.value));
|
207
|
+
return (d, f) => (s(), p(e(c), { span: e(m) }, {
|
208
|
+
default: u(() => [
|
209
|
+
b(e(g), {
|
210
|
+
prop: d.name,
|
211
|
+
label: d.label,
|
212
|
+
"label-width": d.labelWidth,
|
213
|
+
required: d.required,
|
216
214
|
rules: e(i)
|
217
215
|
}, {
|
218
|
-
default:
|
219
|
-
e(
|
216
|
+
default: u(() => [
|
217
|
+
e(a) ? (s(), p(e(q), {
|
220
218
|
key: 0,
|
221
|
-
"model-value":
|
222
|
-
placeholder:
|
219
|
+
"model-value": t.value,
|
220
|
+
placeholder: d.placeholder,
|
223
221
|
disabled: !0,
|
224
222
|
readonly: !0
|
225
|
-
}, null, 8, ["model-value", "placeholder"])) : (
|
223
|
+
}, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
|
226
224
|
key: 1,
|
227
|
-
modelValue:
|
228
|
-
"onUpdate:modelValue":
|
229
|
-
placeholder:
|
230
|
-
clearable:
|
231
|
-
filterable:
|
225
|
+
modelValue: e(n),
|
226
|
+
"onUpdate:modelValue": f[0] || (f[0] = (r) => w(n) ? n.value = r : null),
|
227
|
+
placeholder: d.placeholder,
|
228
|
+
clearable: d.clearable,
|
229
|
+
filterable: d.filterable
|
232
230
|
}, {
|
233
|
-
default:
|
234
|
-
(
|
235
|
-
key:
|
236
|
-
label:
|
237
|
-
value:
|
231
|
+
default: u(() => [
|
232
|
+
(s(!0), F(z, null, M(e(l), (r) => (s(), p(e(U), {
|
233
|
+
key: r.value,
|
234
|
+
label: r.content,
|
235
|
+
value: r.value
|
238
236
|
}, null, 8, ["label", "value"]))), 128))
|
239
237
|
]),
|
240
238
|
_: 1
|
@@ -246,7 +244,7 @@ const ie = /* @__PURE__ */ y({
|
|
246
244
|
_: 1
|
247
245
|
}, 8, ["span"]));
|
248
246
|
}
|
249
|
-
}),
|
247
|
+
}), ye = /* @__PURE__ */ h({
|
250
248
|
name: "OFormMultiselect",
|
251
249
|
extendOptions: {},
|
252
250
|
__name: "MultiSelect",
|
@@ -262,40 +260,37 @@ const ie = /* @__PURE__ */ y({
|
|
262
260
|
code: {}
|
263
261
|
},
|
264
262
|
setup(o) {
|
265
|
-
const
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
label: b.label,
|
276
|
-
"label-width": b.labelWidth,
|
277
|
-
required: b.required,
|
263
|
+
const m = v(), i = V(), a = Y(), l = W(), n = G(), t = P(), d = S(
|
264
|
+
() => ie(l.value, t.modelValue[o.name])
|
265
|
+
);
|
266
|
+
return (f, r) => (s(), p(e(c), { span: e(m) }, {
|
267
|
+
default: u(() => [
|
268
|
+
b(e(g), {
|
269
|
+
prop: f.name,
|
270
|
+
label: f.label,
|
271
|
+
"label-width": f.labelWidth,
|
272
|
+
required: f.required,
|
278
273
|
rules: e(i)
|
279
274
|
}, {
|
280
|
-
default:
|
281
|
-
e(
|
275
|
+
default: u(() => [
|
276
|
+
e(a) ? (s(), p(e(q), {
|
282
277
|
key: 0,
|
283
|
-
"model-value":
|
284
|
-
placeholder:
|
278
|
+
"model-value": d.value,
|
279
|
+
placeholder: f.placeholder,
|
285
280
|
disabled: !0,
|
286
281
|
readonly: !0
|
287
|
-
}, null, 8, ["model-value", "placeholder"])) : (
|
282
|
+
}, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
|
288
283
|
key: 1,
|
289
|
-
modelValue:
|
290
|
-
"onUpdate:modelValue":
|
291
|
-
placeholder:
|
284
|
+
modelValue: e(n),
|
285
|
+
"onUpdate:modelValue": r[0] || (r[0] = (y) => w(n) ? n.value = y : null),
|
286
|
+
placeholder: f.placeholder,
|
292
287
|
multiple: ""
|
293
288
|
}, {
|
294
|
-
default:
|
295
|
-
(
|
296
|
-
key:
|
297
|
-
label:
|
298
|
-
value:
|
289
|
+
default: u(() => [
|
290
|
+
(s(!0), F(z, null, M(e(l), (y) => (s(), p(e(U), {
|
291
|
+
key: y.value,
|
292
|
+
label: y.content,
|
293
|
+
value: y.value
|
299
294
|
}, null, 8, ["label", "value"]))), 128))
|
300
295
|
]),
|
301
296
|
_: 1
|
@@ -307,7 +302,7 @@ const ie = /* @__PURE__ */ y({
|
|
307
302
|
_: 1
|
308
303
|
}, 8, ["span"]));
|
309
304
|
}
|
310
|
-
}),
|
305
|
+
}), ce = /* @__PURE__ */ h({
|
311
306
|
name: "OFormRadiogroup",
|
312
307
|
extendOptions: {},
|
313
308
|
__name: "RadioGroup",
|
@@ -322,29 +317,29 @@ const ie = /* @__PURE__ */ y({
|
|
322
317
|
code: {}
|
323
318
|
},
|
324
319
|
setup(o) {
|
325
|
-
const
|
326
|
-
return (
|
327
|
-
default:
|
328
|
-
|
329
|
-
prop:
|
330
|
-
label:
|
331
|
-
"label-width":
|
332
|
-
required:
|
320
|
+
const m = v(), i = V(), a = W(), l = O();
|
321
|
+
return (n, t) => (s(), p(e(c), { span: e(m) }, {
|
322
|
+
default: u(() => [
|
323
|
+
b(e(g), {
|
324
|
+
prop: n.name,
|
325
|
+
label: n.label,
|
326
|
+
"label-width": n.labelWidth,
|
327
|
+
required: n.required,
|
333
328
|
rules: e(i)
|
334
329
|
}, {
|
335
|
-
default:
|
336
|
-
|
337
|
-
modelValue: l
|
338
|
-
"onUpdate:modelValue":
|
339
|
-
disabled:
|
330
|
+
default: u(() => [
|
331
|
+
b(e(le), {
|
332
|
+
modelValue: e(l),
|
333
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => w(l) ? l.value = d : null),
|
334
|
+
disabled: n.disabled
|
340
335
|
}, {
|
341
|
-
default:
|
342
|
-
(
|
343
|
-
key:
|
344
|
-
value:
|
336
|
+
default: u(() => [
|
337
|
+
(s(!0), F(z, null, M(e(a), (d) => (s(), p(e(ae), {
|
338
|
+
key: d.value,
|
339
|
+
value: d.value
|
345
340
|
}, {
|
346
|
-
default:
|
347
|
-
|
341
|
+
default: u(() => [
|
342
|
+
A(K(d.content), 1)
|
348
343
|
]),
|
349
344
|
_: 2
|
350
345
|
}, 1032, ["value"]))), 128))
|
@@ -358,7 +353,7 @@ const ie = /* @__PURE__ */ y({
|
|
358
353
|
_: 1
|
359
354
|
}, 8, ["span"]));
|
360
355
|
}
|
361
|
-
}), ve = /* @__PURE__ */
|
356
|
+
}), ve = /* @__PURE__ */ h({
|
362
357
|
name: "OFormCheckboxgroup",
|
363
358
|
extendOptions: {},
|
364
359
|
__name: "CheckboxGroup",
|
@@ -373,32 +368,27 @@ const ie = /* @__PURE__ */ y({
|
|
373
368
|
code: {}
|
374
369
|
},
|
375
370
|
setup(o) {
|
376
|
-
const
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
h(e(w), {
|
385
|
-
prop: a.name,
|
386
|
-
label: a.label,
|
387
|
-
"label-width": a.labelWidth,
|
388
|
-
required: a.required,
|
371
|
+
const m = v(), i = V(), a = W(), l = G();
|
372
|
+
return (n, t) => (s(), p(e(c), { span: e(m) }, {
|
373
|
+
default: u(() => [
|
374
|
+
b(e(g), {
|
375
|
+
prop: n.name,
|
376
|
+
label: n.label,
|
377
|
+
"label-width": n.labelWidth,
|
378
|
+
required: n.required,
|
389
379
|
rules: e(i)
|
390
380
|
}, {
|
391
|
-
default:
|
392
|
-
|
393
|
-
modelValue:
|
394
|
-
"onUpdate:modelValue":
|
395
|
-
disabled:
|
381
|
+
default: u(() => [
|
382
|
+
b(e(oe), {
|
383
|
+
modelValue: e(l),
|
384
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => w(l) ? l.value = d : null),
|
385
|
+
disabled: n.disabled
|
396
386
|
}, {
|
397
|
-
default:
|
398
|
-
(
|
399
|
-
key:
|
400
|
-
label:
|
401
|
-
value:
|
387
|
+
default: u(() => [
|
388
|
+
(s(!0), F(z, null, M(e(a), (d) => (s(), p(e(T), {
|
389
|
+
key: d.value,
|
390
|
+
label: d.content,
|
391
|
+
value: d.value
|
402
392
|
}, null, 8, ["label", "value"]))), 128))
|
403
393
|
]),
|
404
394
|
_: 1
|
@@ -410,7 +400,7 @@ const ie = /* @__PURE__ */ y({
|
|
410
400
|
_: 1
|
411
401
|
}, 8, ["span"]));
|
412
402
|
}
|
413
|
-
}),
|
403
|
+
}), ge = /* @__PURE__ */ h({
|
414
404
|
name: "OFormCheckbox",
|
415
405
|
extendOptions: {},
|
416
406
|
__name: "Checkbox",
|
@@ -423,22 +413,20 @@ const ie = /* @__PURE__ */ y({
|
|
423
413
|
disabled: { type: Boolean }
|
424
414
|
},
|
425
415
|
setup(o) {
|
426
|
-
const
|
427
|
-
return (
|
428
|
-
default:
|
429
|
-
|
430
|
-
prop:
|
431
|
-
label:
|
432
|
-
"label-width":
|
433
|
-
rules:
|
416
|
+
const m = v(), i = I();
|
417
|
+
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
418
|
+
default: u(() => [
|
419
|
+
b(e(g), {
|
420
|
+
prop: a.name,
|
421
|
+
label: a.label,
|
422
|
+
"label-width": a.labelWidth,
|
423
|
+
rules: a.rules
|
434
424
|
}, {
|
435
|
-
default:
|
436
|
-
|
437
|
-
modelValue:
|
438
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
439
|
-
disabled:
|
440
|
-
"true-value": "1",
|
441
|
-
"false-value": "0"
|
425
|
+
default: u(() => [
|
426
|
+
b(e(T), {
|
427
|
+
modelValue: e(i),
|
428
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => w(i) ? i.value = n : null),
|
429
|
+
disabled: a.disabled
|
442
430
|
}, null, 8, ["modelValue", "disabled"])
|
443
431
|
]),
|
444
432
|
_: 1
|
@@ -447,7 +435,7 @@ const ie = /* @__PURE__ */ y({
|
|
447
435
|
_: 1
|
448
436
|
}, 8, ["span"]));
|
449
437
|
}
|
450
|
-
}),
|
438
|
+
}), Ve = /* @__PURE__ */ h({
|
451
439
|
name: "OFormSwitch",
|
452
440
|
extendOptions: {},
|
453
441
|
__name: "Switch",
|
@@ -460,22 +448,20 @@ const ie = /* @__PURE__ */ y({
|
|
460
448
|
disabled: { type: Boolean }
|
461
449
|
},
|
462
450
|
setup(o) {
|
463
|
-
const
|
464
|
-
return (
|
465
|
-
default:
|
466
|
-
|
467
|
-
prop:
|
468
|
-
label:
|
469
|
-
"label-width":
|
470
|
-
rules:
|
451
|
+
const m = v(), i = I();
|
452
|
+
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
453
|
+
default: u(() => [
|
454
|
+
b(e(g), {
|
455
|
+
prop: a.name,
|
456
|
+
label: a.label,
|
457
|
+
"label-width": a.labelWidth,
|
458
|
+
rules: a.rules
|
471
459
|
}, {
|
472
|
-
default:
|
473
|
-
|
474
|
-
modelValue:
|
475
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
476
|
-
disabled:
|
477
|
-
"active-value": "1",
|
478
|
-
"inactive-value": "0"
|
460
|
+
default: u(() => [
|
461
|
+
b(e(re), {
|
462
|
+
modelValue: e(i),
|
463
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => w(i) ? i.value = n : null),
|
464
|
+
disabled: a.disabled
|
479
465
|
}, null, 8, ["modelValue", "disabled"])
|
480
466
|
]),
|
481
467
|
_: 1
|
@@ -484,7 +470,7 @@ const ie = /* @__PURE__ */ y({
|
|
484
470
|
_: 1
|
485
471
|
}, 8, ["span"]));
|
486
472
|
}
|
487
|
-
}),
|
473
|
+
}), we = /* @__PURE__ */ h({
|
488
474
|
name: "OFormDate",
|
489
475
|
extendOptions: { trigger: "blur" },
|
490
476
|
__name: "DateInput",
|
@@ -505,67 +491,69 @@ const ie = /* @__PURE__ */ y({
|
|
505
491
|
sourceFormat: {}
|
506
492
|
},
|
507
493
|
setup(o) {
|
508
|
-
const
|
494
|
+
const m = v(), i = V(), a = S(
|
509
495
|
() => o.format.startsWith("H") || o.format.startsWith("h") || o.format.startsWith("m") || o.format.startsWith("s")
|
510
|
-
),
|
511
|
-
let
|
512
|
-
return (o.format.indexOf("y") > -1 || o.format.indexOf("Y") > -1) && (
|
513
|
-
}),
|
514
|
-
|
496
|
+
), l = S(() => o.sourceFormat ? o.sourceFormat : a.value ? "HH:mm:ss" : "YYYY-MM-DD"), n = S(() => {
|
497
|
+
let r = "date";
|
498
|
+
return (o.format.indexOf("y") > -1 || o.format.indexOf("Y") > -1) && (r = "year"), o.format.indexOf("M") > -1 && (r = "month"), (o.format.indexOf("d") > -1 || o.format.indexOf("D") > -1) && (r = "date"), (o.format.indexOf("H") > -1 || o.format.indexOf("h") > -1 || o.format.indexOf("k") > -1 || o.format.indexOf("m") > -1 || o.format.indexOf("s") > -1 || o.format.indexOf("S") > -1) && (r = "datetime"), r;
|
499
|
+
}), t = P(), d = S(() => {
|
500
|
+
const r = t.modelValue[o.name];
|
501
|
+
if (H(r))
|
515
502
|
return "string";
|
516
|
-
if (
|
503
|
+
if (j(r))
|
517
504
|
return "date";
|
518
505
|
throw new D("日期输入框的值只能为字符串或日期类型");
|
519
|
-
}),
|
506
|
+
}), f = S({
|
520
507
|
get: () => {
|
521
|
-
|
522
|
-
|
523
|
-
|
508
|
+
const r = t.modelValue[o.name];
|
509
|
+
if (r) {
|
510
|
+
if (d.value == "date")
|
511
|
+
return r;
|
524
512
|
{
|
525
|
-
const
|
526
|
-
if (!
|
527
|
-
throw new D(`日期输入框的值无效,不符合${
|
528
|
-
return
|
513
|
+
const y = R(r, l.value, !0);
|
514
|
+
if (!y.isValid())
|
515
|
+
throw new D(`日期输入框的值无效,不符合${l.value}格式`);
|
516
|
+
return y.toDate();
|
529
517
|
}
|
530
518
|
}
|
531
519
|
},
|
532
|
-
set: (
|
533
|
-
|
520
|
+
set: (r) => {
|
521
|
+
d.value == "date" ? r ? t.updateModelValue(o.name, r) : t.updateModelValue(o.name, void 0) : r ? t.updateModelValue(o.name, R(r).format(l.value)) : t.updateModelValue(o.name, "");
|
534
522
|
}
|
535
523
|
});
|
536
|
-
return (
|
537
|
-
default:
|
538
|
-
|
539
|
-
prop:
|
540
|
-
label:
|
541
|
-
"label-width":
|
542
|
-
required:
|
524
|
+
return (r, y) => (s(), p(e(c), { span: e(m) }, {
|
525
|
+
default: u(() => [
|
526
|
+
b(e(g), {
|
527
|
+
prop: r.name,
|
528
|
+
label: r.label,
|
529
|
+
"label-width": r.labelWidth,
|
530
|
+
required: r.required,
|
543
531
|
rules: e(i)
|
544
532
|
}, {
|
545
|
-
default:
|
546
|
-
|
533
|
+
default: u(() => [
|
534
|
+
a.value ? (s(), p(e(ne), {
|
547
535
|
key: 0,
|
548
|
-
modelValue:
|
549
|
-
"onUpdate:modelValue":
|
550
|
-
placeholder:
|
551
|
-
disabled:
|
552
|
-
readonly:
|
553
|
-
editable:
|
554
|
-
clearable:
|
555
|
-
format:
|
536
|
+
modelValue: f.value,
|
537
|
+
"onUpdate:modelValue": y[0] || (y[0] = (k) => f.value = k),
|
538
|
+
placeholder: r.placeholder,
|
539
|
+
disabled: r.disabled,
|
540
|
+
readonly: r.readonly,
|
541
|
+
editable: r.editable,
|
542
|
+
clearable: r.clearable,
|
543
|
+
format: l.value,
|
556
544
|
"arrow-control": "",
|
557
545
|
style: { width: "100%" }
|
558
|
-
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (
|
546
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (s(), p(e(de), {
|
559
547
|
key: 1,
|
560
|
-
modelValue:
|
561
|
-
"onUpdate:modelValue":
|
562
|
-
placeholder:
|
563
|
-
disabled:
|
564
|
-
readonly:
|
565
|
-
editable:
|
566
|
-
clearable:
|
567
|
-
type:
|
568
|
-
format:
|
548
|
+
modelValue: f.value,
|
549
|
+
"onUpdate:modelValue": y[1] || (y[1] = (k) => f.value = k),
|
550
|
+
placeholder: r.placeholder,
|
551
|
+
disabled: r.disabled,
|
552
|
+
readonly: r.readonly,
|
553
|
+
editable: r.editable,
|
554
|
+
clearable: r.clearable,
|
555
|
+
type: n.value,
|
556
|
+
format: l.value,
|
569
557
|
style: { width: "100%" }
|
570
558
|
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
|
571
559
|
]),
|
@@ -575,7 +563,7 @@ const ie = /* @__PURE__ */ y({
|
|
575
563
|
_: 1
|
576
564
|
}, 8, ["span"]));
|
577
565
|
}
|
578
|
-
}),
|
566
|
+
}), Se = /* @__PURE__ */ h({
|
579
567
|
name: "OFormFile",
|
580
568
|
extendOptions: {},
|
581
569
|
__name: "FileInput",
|
@@ -589,31 +577,33 @@ const ie = /* @__PURE__ */ y({
|
|
589
577
|
disabled: { type: Boolean }
|
590
578
|
},
|
591
579
|
setup(o) {
|
592
|
-
const
|
593
|
-
J(() => {
|
594
|
-
|
595
|
-
var s;
|
596
|
-
u.value = (s = a == null ? void 0 : a.target) == null ? void 0 : s.files[0];
|
597
|
-
};
|
580
|
+
const m = v(), i = V(), a = O();
|
581
|
+
J(a, () => {
|
582
|
+
a.value || (l.value = "");
|
598
583
|
});
|
599
|
-
const l =
|
600
|
-
return (
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
584
|
+
const l = Q(""), n = $("inputRef");
|
585
|
+
return X(() => {
|
586
|
+
n.value.input.onchange = (t) => {
|
587
|
+
var d;
|
588
|
+
a.value = (d = t == null ? void 0 : t.target) == null ? void 0 : d.files[0];
|
589
|
+
}, l.value = "";
|
590
|
+
}), (t, d) => (s(), p(e(c), { span: e(m) }, {
|
591
|
+
default: u(() => [
|
592
|
+
b(e(g), {
|
593
|
+
prop: t.name,
|
594
|
+
label: t.label,
|
595
|
+
"label-width": t.labelWidth,
|
596
|
+
required: t.required,
|
607
597
|
rules: e(i)
|
608
598
|
}, {
|
609
|
-
default:
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
modelValue:
|
614
|
-
|
615
|
-
|
616
|
-
|
599
|
+
default: u(() => [
|
600
|
+
b(e(q), {
|
601
|
+
ref: "inputRef",
|
602
|
+
modelValue: l.value,
|
603
|
+
"onUpdate:modelValue": d[0] || (d[0] = (f) => l.value = f),
|
604
|
+
disabled: t.disabled,
|
605
|
+
type: "file",
|
606
|
+
"validate-event": !1
|
617
607
|
}, null, 8, ["modelValue", "disabled"])
|
618
608
|
]),
|
619
609
|
_: 1
|
@@ -622,7 +612,7 @@ const ie = /* @__PURE__ */ y({
|
|
622
612
|
_: 1
|
623
613
|
}, 8, ["span"]));
|
624
614
|
}
|
625
|
-
}),
|
615
|
+
}), qe = /* @__PURE__ */ h({
|
626
616
|
name: "OFormButtongroup",
|
627
617
|
__name: "ButtonGroup",
|
628
618
|
props: {
|
@@ -631,20 +621,20 @@ const ie = /* @__PURE__ */ y({
|
|
631
621
|
align: { default: "right" }
|
632
622
|
},
|
633
623
|
setup(o) {
|
634
|
-
const
|
624
|
+
const m = S(() => ({
|
635
625
|
textAlign: o.align
|
636
|
-
})), i =
|
637
|
-
return (
|
626
|
+
})), i = v();
|
627
|
+
return (a, l) => (s(), p(e(c), {
|
638
628
|
span: e(i),
|
639
|
-
style:
|
629
|
+
style: Z(m.value)
|
640
630
|
}, {
|
641
|
-
default:
|
642
|
-
|
643
|
-
gutter:
|
631
|
+
default: u(() => [
|
632
|
+
b(e(se), {
|
633
|
+
gutter: a.gutter,
|
644
634
|
style: { "margin-bottom": "18px" }
|
645
635
|
}, {
|
646
|
-
default:
|
647
|
-
|
636
|
+
default: u(() => [
|
637
|
+
C(a.$slots, "default")
|
648
638
|
]),
|
649
639
|
_: 3
|
650
640
|
}, 8, ["gutter"])
|
@@ -652,7 +642,7 @@ const ie = /* @__PURE__ */ y({
|
|
652
642
|
_: 3
|
653
643
|
}, 8, ["span", "style"]));
|
654
644
|
}
|
655
|
-
}),
|
645
|
+
}), Oe = /* @__PURE__ */ h({
|
656
646
|
name: "OFormDiy",
|
657
647
|
extendOptions: {},
|
658
648
|
__name: "DiyItem",
|
@@ -665,18 +655,18 @@ const ie = /* @__PURE__ */ y({
|
|
665
655
|
rules: {}
|
666
656
|
},
|
667
657
|
setup(o) {
|
668
|
-
const
|
669
|
-
return (
|
670
|
-
default:
|
671
|
-
|
672
|
-
prop:
|
673
|
-
label:
|
674
|
-
"label-width":
|
675
|
-
required:
|
658
|
+
const m = v(), i = V();
|
659
|
+
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
660
|
+
default: u(() => [
|
661
|
+
b(e(g), {
|
662
|
+
prop: a.name,
|
663
|
+
label: a.label,
|
664
|
+
"label-width": a.labelWidth,
|
665
|
+
required: a.required,
|
676
666
|
rules: e(i)
|
677
667
|
}, {
|
678
|
-
default:
|
679
|
-
|
668
|
+
default: u(() => [
|
669
|
+
C(a.$slots, "default")
|
680
670
|
]),
|
681
671
|
_: 3
|
682
672
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -684,23 +674,23 @@ const ie = /* @__PURE__ */ y({
|
|
684
674
|
_: 3
|
685
675
|
}, 8, ["span"]));
|
686
676
|
}
|
687
|
-
}),
|
688
|
-
StringInput:
|
689
|
-
PasswordInput:
|
690
|
-
Textarea:
|
691
|
-
SingleSelect:
|
692
|
-
MultiSelect:
|
693
|
-
RadioGroup:
|
677
|
+
}), $e = x(me, {
|
678
|
+
StringInput: pe,
|
679
|
+
PasswordInput: be,
|
680
|
+
Textarea: fe,
|
681
|
+
SingleSelect: he,
|
682
|
+
MultiSelect: ye,
|
683
|
+
RadioGroup: ce,
|
694
684
|
CheckboxGroup: ve,
|
695
|
-
Checkbox:
|
696
|
-
Switch:
|
697
|
-
DateInput:
|
698
|
-
FileInput:
|
699
|
-
ButtonGroup:
|
700
|
-
DiyItem:
|
685
|
+
Checkbox: ge,
|
686
|
+
Switch: Ve,
|
687
|
+
DateInput: we,
|
688
|
+
FileInput: Se,
|
689
|
+
ButtonGroup: qe,
|
690
|
+
DiyItem: Oe
|
701
691
|
});
|
702
692
|
export {
|
703
|
-
|
693
|
+
$e as default,
|
704
694
|
te as formContextKey
|
705
695
|
};
|
706
696
|
//# sourceMappingURL=index.js.map
|