orion-design 0.1.9 → 0.1.10
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/Button/index.js +11 -10
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Form/FileInput/FileInput.vue.d.ts +1 -1
- package/dist/components/Form/hooks/FormItemValidateTrigger.d.ts +15 -0
- package/dist/components/Form/hooks/FormItemValidateTrigger.js +18 -0
- package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -0
- package/dist/components/Form/hooks/index.d.ts +10 -0
- package/dist/components/Form/hooks/index.js +83 -0
- package/dist/components/Form/hooks/index.js.map +1 -0
- package/dist/components/Form/index.js +180 -182
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +7 -7
- package/dist/components/Pagetable/index.js +182 -180
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/utils/index.js +82 -82
- package/dist/components/Pagetable/utils/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/index.css +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
- package/dist/components/Form/hooks/useForm.d.ts +0 -10
- package/dist/components/Form/hooks/useForm.js +0 -82
- package/dist/components/Form/hooks/useForm.js.map +0 -1
@@ -1,14 +1,15 @@
|
|
1
|
-
import { isString as
|
2
|
-
import { defineComponent as h, useTemplateRef as $, provide as
|
1
|
+
import { isString as P, isDate as H } from "lodash-es";
|
2
|
+
import { defineComponent as h, useTemplateRef as $, provide as j, reactive as L, toRef as F, openBlock as s, createBlock as p, unref as e, withCtx as u, createVNode as b, renderSlot as C, isRef as g, computed as S, createElementBlock as z, Fragment as M, renderList as W, createTextVNode as N, toDisplayString as K, watch as J, ref as Q, onMounted as X, normalizeStyle as Z } from "vue";
|
3
3
|
import { withInstall as x } from "../_util/vue/install.js";
|
4
|
-
import { ElForm as _, ElRow as ee, ElCol as c, ElFormItem as
|
5
|
-
import { formContextKey as
|
6
|
-
import {
|
4
|
+
import { ElForm as _, ElRow as ee, ElCol as c, ElFormItem as V, ElInput as q, ElSelect as E, ElOption as A, ElRadioGroup as le, ElRadio as ae, ElCheckboxGroup as re, ElCheckbox as I, ElSwitch as oe, dayjs as R, ElTimePicker as te, ElDatePicker as ne } from "element-plus";
|
5
|
+
import { formContextKey as de } from "./Form.js";
|
6
|
+
import { useFormItemSpan as v, useFormItemRules as w, useFormItemStringModel as B, useFormItemDisabled as U, useFormItemCode as O, useFormItemMultiModel as T, useFormContext as Y, useFormItemBooleanModel as G } from "./hooks/index.js";
|
7
7
|
import { getSingleCodeContent as ue, getMultiCodeContent as ie } from "./utils/index.js";
|
8
8
|
import D from "../../error/OrionError.js";
|
9
9
|
import { S as se } from "../../index-BbsXWo7C.js";
|
10
10
|
const me = /* @__PURE__ */ h({
|
11
11
|
name: "OForm",
|
12
|
+
inheritAttrs: !1,
|
12
13
|
__name: "Form",
|
13
14
|
props: {
|
14
15
|
rules: {},
|
@@ -18,32 +19,32 @@ const me = /* @__PURE__ */ h({
|
|
18
19
|
modelValue: {}
|
19
20
|
},
|
20
21
|
emits: ["update:modelValue"],
|
21
|
-
setup(
|
22
|
-
const a = i, l = (
|
23
|
-
a("update:modelValue", { ...
|
24
|
-
},
|
22
|
+
setup(r, { expose: m, emit: i }) {
|
23
|
+
const a = i, l = (n, f) => {
|
24
|
+
a("update:modelValue", { ...r.modelValue, [n]: f });
|
25
|
+
}, t = $("form");
|
25
26
|
return m({
|
26
|
-
validate: async () => await
|
27
|
-
}),
|
28
|
-
|
29
|
-
|
30
|
-
modelValue:
|
27
|
+
validate: async () => await t.value.validate()
|
28
|
+
}), j(
|
29
|
+
de,
|
30
|
+
L({
|
31
|
+
modelValue: F(() => r.modelValue),
|
31
32
|
updateModelValue: l,
|
32
|
-
rules:
|
33
|
-
itemSpan:
|
34
|
-
disabled:
|
33
|
+
rules: F(() => r.rules),
|
34
|
+
itemSpan: F(() => r.itemSpan),
|
35
|
+
disabled: F(() => r.disabled)
|
35
36
|
})
|
36
|
-
), (
|
37
|
+
), (n, f) => (s(), p(e(_), {
|
37
38
|
ref: "form",
|
38
|
-
model:
|
39
|
-
rules:
|
40
|
-
"label-width":
|
41
|
-
disabled:
|
39
|
+
model: n.modelValue,
|
40
|
+
rules: n.rules,
|
41
|
+
"label-width": n.itemLabelWidth,
|
42
|
+
disabled: n.disabled
|
42
43
|
}, {
|
43
44
|
default: u(() => [
|
44
45
|
b(e(ee), { gutter: 16 }, {
|
45
46
|
default: u(() => [
|
46
|
-
C(
|
47
|
+
C(n.$slots, "default")
|
47
48
|
]),
|
48
49
|
_: 3
|
49
50
|
})
|
@@ -53,7 +54,7 @@ const me = /* @__PURE__ */ h({
|
|
53
54
|
}
|
54
55
|
}), pe = /* @__PURE__ */ h({
|
55
56
|
name: "OFormString",
|
56
|
-
|
57
|
+
inheritAttrs: !1,
|
57
58
|
__name: "StringInput",
|
58
59
|
props: {
|
59
60
|
name: {},
|
@@ -67,11 +68,11 @@ const me = /* @__PURE__ */ h({
|
|
67
68
|
disabled: { type: Boolean },
|
68
69
|
readonly: { type: Boolean }
|
69
70
|
},
|
70
|
-
setup(
|
71
|
-
const m = v(), i =
|
72
|
-
return (l,
|
71
|
+
setup(r) {
|
72
|
+
const m = v(), i = w(), a = B();
|
73
|
+
return (l, t) => (s(), p(e(c), { span: e(m) }, {
|
73
74
|
default: u(() => [
|
74
|
-
b(e(
|
75
|
+
b(e(V), {
|
75
76
|
prop: l.name,
|
76
77
|
label: l.label,
|
77
78
|
"label-width": l.labelWidth,
|
@@ -81,7 +82,7 @@ const me = /* @__PURE__ */ h({
|
|
81
82
|
default: u(() => [
|
82
83
|
b(e(q), {
|
83
84
|
modelValue: e(a),
|
84
|
-
"onUpdate:modelValue":
|
85
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
|
85
86
|
maxlength: l.maxlength,
|
86
87
|
placeholder: l.placeholder,
|
87
88
|
disabled: l.disabled,
|
@@ -96,7 +97,7 @@ const me = /* @__PURE__ */ h({
|
|
96
97
|
}
|
97
98
|
}), be = /* @__PURE__ */ h({
|
98
99
|
name: "OFormPassword",
|
99
|
-
|
100
|
+
inheritAttrs: !1,
|
100
101
|
__name: "PasswordInput",
|
101
102
|
props: {
|
102
103
|
name: {},
|
@@ -110,11 +111,11 @@ const me = /* @__PURE__ */ h({
|
|
110
111
|
disabled: { type: Boolean },
|
111
112
|
readonly: { type: Boolean }
|
112
113
|
},
|
113
|
-
setup(
|
114
|
-
const m = v(), i =
|
115
|
-
return (l,
|
114
|
+
setup(r) {
|
115
|
+
const m = v(), i = w(), a = B();
|
116
|
+
return (l, t) => (s(), p(e(c), { span: e(m) }, {
|
116
117
|
default: u(() => [
|
117
|
-
b(e(
|
118
|
+
b(e(V), {
|
118
119
|
prop: l.name,
|
119
120
|
label: l.label,
|
120
121
|
"label-width": l.labelWidth,
|
@@ -124,7 +125,7 @@ const me = /* @__PURE__ */ h({
|
|
124
125
|
default: u(() => [
|
125
126
|
b(e(q), {
|
126
127
|
modelValue: e(a),
|
127
|
-
"onUpdate:modelValue":
|
128
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
|
128
129
|
maxlength: l.maxlength,
|
129
130
|
placeholder: l.placeholder,
|
130
131
|
disabled: l.disabled,
|
@@ -140,7 +141,7 @@ const me = /* @__PURE__ */ h({
|
|
140
141
|
}
|
141
142
|
}), fe = /* @__PURE__ */ h({
|
142
143
|
name: "OFormTextarea",
|
143
|
-
|
144
|
+
inheritAttrs: !1,
|
144
145
|
__name: "Textarea",
|
145
146
|
props: {
|
146
147
|
name: {},
|
@@ -155,11 +156,11 @@ const me = /* @__PURE__ */ h({
|
|
155
156
|
readonly: { type: Boolean },
|
156
157
|
rows: {}
|
157
158
|
},
|
158
|
-
setup(
|
159
|
-
const m = v(), i =
|
160
|
-
return (l,
|
159
|
+
setup(r) {
|
160
|
+
const m = v(), i = w(), a = B();
|
161
|
+
return (l, t) => (s(), p(e(c), { span: e(m) }, {
|
161
162
|
default: u(() => [
|
162
|
-
b(e(
|
163
|
+
b(e(V), {
|
163
164
|
prop: l.name,
|
164
165
|
label: l.label,
|
165
166
|
"label-width": l.labelWidth,
|
@@ -169,7 +170,7 @@ const me = /* @__PURE__ */ h({
|
|
169
170
|
default: u(() => [
|
170
171
|
b(e(q), {
|
171
172
|
modelValue: e(a),
|
172
|
-
"onUpdate:modelValue":
|
173
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
|
173
174
|
maxlength: l.maxlength,
|
174
175
|
placeholder: l.placeholder,
|
175
176
|
disabled: l.disabled,
|
@@ -187,7 +188,7 @@ const me = /* @__PURE__ */ h({
|
|
187
188
|
}
|
188
189
|
}), he = /* @__PURE__ */ h({
|
189
190
|
name: "OFormSingleselect",
|
190
|
-
|
191
|
+
inheritAttrs: !1,
|
191
192
|
__name: "SingleSelect",
|
192
193
|
props: {
|
193
194
|
name: {},
|
@@ -202,37 +203,37 @@ const me = /* @__PURE__ */ h({
|
|
202
203
|
clearable: { type: Boolean },
|
203
204
|
filterable: { type: Boolean }
|
204
205
|
},
|
205
|
-
setup(
|
206
|
-
const m = v(), i =
|
207
|
-
return (
|
206
|
+
setup(r) {
|
207
|
+
const m = v(), i = w(), a = U(), l = O(), t = B(), d = S(() => ue(l.value, t.value));
|
208
|
+
return (n, f) => (s(), p(e(c), { span: e(m) }, {
|
208
209
|
default: u(() => [
|
209
|
-
b(e(
|
210
|
-
prop:
|
211
|
-
label:
|
212
|
-
"label-width":
|
213
|
-
required:
|
210
|
+
b(e(V), {
|
211
|
+
prop: n.name,
|
212
|
+
label: n.label,
|
213
|
+
"label-width": n.labelWidth,
|
214
|
+
required: n.required,
|
214
215
|
rules: e(i)
|
215
216
|
}, {
|
216
217
|
default: u(() => [
|
217
218
|
e(a) ? (s(), p(e(q), {
|
218
219
|
key: 0,
|
219
|
-
"model-value":
|
220
|
-
placeholder:
|
220
|
+
"model-value": d.value,
|
221
|
+
placeholder: n.placeholder,
|
221
222
|
disabled: !0,
|
222
223
|
readonly: !0
|
223
224
|
}, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
|
224
225
|
key: 1,
|
225
|
-
modelValue: e(
|
226
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
227
|
-
placeholder:
|
228
|
-
clearable:
|
229
|
-
filterable:
|
226
|
+
modelValue: e(t),
|
227
|
+
"onUpdate:modelValue": f[0] || (f[0] = (o) => g(t) ? t.value = o : null),
|
228
|
+
placeholder: n.placeholder,
|
229
|
+
clearable: n.clearable,
|
230
|
+
filterable: n.filterable
|
230
231
|
}, {
|
231
232
|
default: u(() => [
|
232
|
-
(s(!0),
|
233
|
-
key:
|
234
|
-
label:
|
235
|
-
value:
|
233
|
+
(s(!0), z(M, null, W(e(l), (o) => (s(), p(e(A), {
|
234
|
+
key: o.value,
|
235
|
+
label: o.content,
|
236
|
+
value: o.value
|
236
237
|
}, null, 8, ["label", "value"]))), 128))
|
237
238
|
]),
|
238
239
|
_: 1
|
@@ -246,7 +247,7 @@ const me = /* @__PURE__ */ h({
|
|
246
247
|
}
|
247
248
|
}), ye = /* @__PURE__ */ h({
|
248
249
|
name: "OFormMultiselect",
|
249
|
-
|
250
|
+
inheritAttrs: !1,
|
250
251
|
__name: "MultiSelect",
|
251
252
|
props: {
|
252
253
|
name: {},
|
@@ -259,13 +260,11 @@ const me = /* @__PURE__ */ h({
|
|
259
260
|
disabled: { type: Boolean },
|
260
261
|
code: {}
|
261
262
|
},
|
262
|
-
setup(
|
263
|
-
const m = v(), i =
|
264
|
-
|
265
|
-
);
|
266
|
-
return (f, r) => (s(), p(e(c), { span: e(m) }, {
|
263
|
+
setup(r) {
|
264
|
+
const m = v(), i = w(), a = U(), l = O(), t = T(), d = Y(), n = S(() => ie(l.value, d.modelValue[r.name]));
|
265
|
+
return (f, o) => (s(), p(e(c), { span: e(m) }, {
|
267
266
|
default: u(() => [
|
268
|
-
b(e(
|
267
|
+
b(e(V), {
|
269
268
|
prop: f.name,
|
270
269
|
label: f.label,
|
271
270
|
"label-width": f.labelWidth,
|
@@ -275,19 +274,19 @@ const me = /* @__PURE__ */ h({
|
|
275
274
|
default: u(() => [
|
276
275
|
e(a) ? (s(), p(e(q), {
|
277
276
|
key: 0,
|
278
|
-
"model-value":
|
277
|
+
"model-value": n.value,
|
279
278
|
placeholder: f.placeholder,
|
280
279
|
disabled: !0,
|
281
280
|
readonly: !0
|
282
281
|
}, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
|
283
282
|
key: 1,
|
284
|
-
modelValue: e(
|
285
|
-
"onUpdate:modelValue":
|
283
|
+
modelValue: e(t),
|
284
|
+
"onUpdate:modelValue": o[0] || (o[0] = (y) => g(t) ? t.value = y : null),
|
286
285
|
placeholder: f.placeholder,
|
287
286
|
multiple: ""
|
288
287
|
}, {
|
289
288
|
default: u(() => [
|
290
|
-
(s(!0),
|
289
|
+
(s(!0), z(M, null, W(e(l), (y) => (s(), p(e(A), {
|
291
290
|
key: y.value,
|
292
291
|
label: y.content,
|
293
292
|
value: y.value
|
@@ -304,7 +303,7 @@ const me = /* @__PURE__ */ h({
|
|
304
303
|
}
|
305
304
|
}), ce = /* @__PURE__ */ h({
|
306
305
|
name: "OFormRadiogroup",
|
307
|
-
|
306
|
+
inheritAttrs: !1,
|
308
307
|
__name: "RadioGroup",
|
309
308
|
props: {
|
310
309
|
name: {},
|
@@ -316,30 +315,30 @@ const me = /* @__PURE__ */ h({
|
|
316
315
|
disabled: { type: Boolean },
|
317
316
|
code: {}
|
318
317
|
},
|
319
|
-
setup(
|
320
|
-
const m = v(), i =
|
321
|
-
return (
|
318
|
+
setup(r) {
|
319
|
+
const m = v(), i = w(), a = O(), l = B();
|
320
|
+
return (t, d) => (s(), p(e(c), { span: e(m) }, {
|
322
321
|
default: u(() => [
|
323
|
-
b(e(
|
324
|
-
prop:
|
325
|
-
label:
|
326
|
-
"label-width":
|
327
|
-
required:
|
322
|
+
b(e(V), {
|
323
|
+
prop: t.name,
|
324
|
+
label: t.label,
|
325
|
+
"label-width": t.labelWidth,
|
326
|
+
required: t.required,
|
328
327
|
rules: e(i)
|
329
328
|
}, {
|
330
329
|
default: u(() => [
|
331
330
|
b(e(le), {
|
332
331
|
modelValue: e(l),
|
333
|
-
"onUpdate:modelValue":
|
334
|
-
disabled:
|
332
|
+
"onUpdate:modelValue": d[0] || (d[0] = (n) => g(l) ? l.value = n : null),
|
333
|
+
disabled: t.disabled
|
335
334
|
}, {
|
336
335
|
default: u(() => [
|
337
|
-
(s(!0),
|
338
|
-
key:
|
339
|
-
value:
|
336
|
+
(s(!0), z(M, null, W(e(a), (n) => (s(), p(e(ae), {
|
337
|
+
key: n.value,
|
338
|
+
value: n.value
|
340
339
|
}, {
|
341
340
|
default: u(() => [
|
342
|
-
|
341
|
+
N(K(n.content), 1)
|
343
342
|
]),
|
344
343
|
_: 2
|
345
344
|
}, 1032, ["value"]))), 128))
|
@@ -355,7 +354,7 @@ const me = /* @__PURE__ */ h({
|
|
355
354
|
}
|
356
355
|
}), ve = /* @__PURE__ */ h({
|
357
356
|
name: "OFormCheckboxgroup",
|
358
|
-
|
357
|
+
inheritAttrs: !1,
|
359
358
|
__name: "CheckboxGroup",
|
360
359
|
props: {
|
361
360
|
name: {},
|
@@ -367,28 +366,28 @@ const me = /* @__PURE__ */ h({
|
|
367
366
|
disabled: { type: Boolean },
|
368
367
|
code: {}
|
369
368
|
},
|
370
|
-
setup(
|
371
|
-
const m = v(), i =
|
372
|
-
return (
|
369
|
+
setup(r) {
|
370
|
+
const m = v(), i = w(), a = O(), l = T();
|
371
|
+
return (t, d) => (s(), p(e(c), { span: e(m) }, {
|
373
372
|
default: u(() => [
|
374
|
-
b(e(
|
375
|
-
prop:
|
376
|
-
label:
|
377
|
-
"label-width":
|
378
|
-
required:
|
373
|
+
b(e(V), {
|
374
|
+
prop: t.name,
|
375
|
+
label: t.label,
|
376
|
+
"label-width": t.labelWidth,
|
377
|
+
required: t.required,
|
379
378
|
rules: e(i)
|
380
379
|
}, {
|
381
380
|
default: u(() => [
|
382
|
-
b(e(
|
381
|
+
b(e(re), {
|
383
382
|
modelValue: e(l),
|
384
|
-
"onUpdate:modelValue":
|
385
|
-
disabled:
|
383
|
+
"onUpdate:modelValue": d[0] || (d[0] = (n) => g(l) ? l.value = n : null),
|
384
|
+
disabled: t.disabled
|
386
385
|
}, {
|
387
386
|
default: u(() => [
|
388
|
-
(s(!0),
|
389
|
-
key:
|
390
|
-
label:
|
391
|
-
value:
|
387
|
+
(s(!0), z(M, null, W(e(a), (n) => (s(), p(e(I), {
|
388
|
+
key: n.value,
|
389
|
+
label: n.content,
|
390
|
+
value: n.value
|
392
391
|
}, null, 8, ["label", "value"]))), 128))
|
393
392
|
]),
|
394
393
|
_: 1
|
@@ -400,9 +399,9 @@ const me = /* @__PURE__ */ h({
|
|
400
399
|
_: 1
|
401
400
|
}, 8, ["span"]));
|
402
401
|
}
|
403
|
-
}),
|
402
|
+
}), Ve = /* @__PURE__ */ h({
|
404
403
|
name: "OFormCheckbox",
|
405
|
-
|
404
|
+
inheritAttrs: !1,
|
406
405
|
__name: "Checkbox",
|
407
406
|
props: {
|
408
407
|
name: {},
|
@@ -412,20 +411,20 @@ const me = /* @__PURE__ */ h({
|
|
412
411
|
rules: {},
|
413
412
|
disabled: { type: Boolean }
|
414
413
|
},
|
415
|
-
setup(
|
416
|
-
const m = v(), i =
|
414
|
+
setup(r) {
|
415
|
+
const m = v(), i = G();
|
417
416
|
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
418
417
|
default: u(() => [
|
419
|
-
b(e(
|
418
|
+
b(e(V), {
|
420
419
|
prop: a.name,
|
421
420
|
label: a.label,
|
422
421
|
"label-width": a.labelWidth,
|
423
422
|
rules: a.rules
|
424
423
|
}, {
|
425
424
|
default: u(() => [
|
426
|
-
b(e(
|
425
|
+
b(e(I), {
|
427
426
|
modelValue: e(i),
|
428
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
427
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => g(i) ? i.value = t : null),
|
429
428
|
disabled: a.disabled
|
430
429
|
}, null, 8, ["modelValue", "disabled"])
|
431
430
|
]),
|
@@ -435,9 +434,9 @@ const me = /* @__PURE__ */ h({
|
|
435
434
|
_: 1
|
436
435
|
}, 8, ["span"]));
|
437
436
|
}
|
438
|
-
}),
|
437
|
+
}), we = /* @__PURE__ */ h({
|
439
438
|
name: "OFormSwitch",
|
440
|
-
|
439
|
+
inheritAttrs: !1,
|
441
440
|
__name: "Switch",
|
442
441
|
props: {
|
443
442
|
name: {},
|
@@ -447,20 +446,20 @@ const me = /* @__PURE__ */ h({
|
|
447
446
|
rules: {},
|
448
447
|
disabled: { type: Boolean }
|
449
448
|
},
|
450
|
-
setup(
|
451
|
-
const m = v(), i =
|
449
|
+
setup(r) {
|
450
|
+
const m = v(), i = G();
|
452
451
|
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
453
452
|
default: u(() => [
|
454
|
-
b(e(
|
453
|
+
b(e(V), {
|
455
454
|
prop: a.name,
|
456
455
|
label: a.label,
|
457
456
|
"label-width": a.labelWidth,
|
458
457
|
rules: a.rules
|
459
458
|
}, {
|
460
459
|
default: u(() => [
|
461
|
-
b(e(
|
460
|
+
b(e(oe), {
|
462
461
|
modelValue: e(i),
|
463
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
462
|
+
"onUpdate:modelValue": l[0] || (l[0] = (t) => g(i) ? i.value = t : null),
|
464
463
|
disabled: a.disabled
|
465
464
|
}, null, 8, ["modelValue", "disabled"])
|
466
465
|
]),
|
@@ -470,9 +469,9 @@ const me = /* @__PURE__ */ h({
|
|
470
469
|
_: 1
|
471
470
|
}, 8, ["span"]));
|
472
471
|
}
|
473
|
-
}),
|
472
|
+
}), ge = /* @__PURE__ */ h({
|
474
473
|
name: "OFormDate",
|
475
|
-
|
474
|
+
inheritAttrs: !1,
|
476
475
|
__name: "DateInput",
|
477
476
|
props: {
|
478
477
|
name: {},
|
@@ -490,69 +489,67 @@ const me = /* @__PURE__ */ h({
|
|
490
489
|
format: { default: "YYYY-MM-DD" },
|
491
490
|
sourceFormat: {}
|
492
491
|
},
|
493
|
-
setup(
|
494
|
-
const m = v(), i =
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
const r = t.modelValue[o.name];
|
501
|
-
if (H(r))
|
492
|
+
setup(r) {
|
493
|
+
const m = v(), i = w(), a = S(() => r.format.startsWith("H") || r.format.startsWith("h") || r.format.startsWith("m") || r.format.startsWith("s")), l = S(() => r.sourceFormat ? r.sourceFormat : a.value ? "HH:mm:ss" : "YYYY-MM-DD"), t = S(() => {
|
494
|
+
let o = "date";
|
495
|
+
return (r.format.indexOf("y") > -1 || r.format.indexOf("Y") > -1) && (o = "year"), r.format.indexOf("M") > -1 && (o = "month"), (r.format.indexOf("d") > -1 || r.format.indexOf("D") > -1) && (o = "date"), (r.format.indexOf("H") > -1 || r.format.indexOf("h") > -1 || r.format.indexOf("k") > -1 || r.format.indexOf("m") > -1 || r.format.indexOf("s") > -1 || r.format.indexOf("S") > -1) && (o = "datetime"), o;
|
496
|
+
}), d = Y(), n = S(() => {
|
497
|
+
const o = d.modelValue[r.name];
|
498
|
+
if (P(o))
|
502
499
|
return "string";
|
503
|
-
if (
|
500
|
+
if (H(o))
|
504
501
|
return "date";
|
505
502
|
throw new D("日期输入框的值只能为字符串或日期类型");
|
506
503
|
}), f = S({
|
507
504
|
get: () => {
|
508
|
-
const
|
509
|
-
if (
|
510
|
-
if (
|
511
|
-
return
|
505
|
+
const o = d.modelValue[r.name];
|
506
|
+
if (o) {
|
507
|
+
if (n.value == "date")
|
508
|
+
return o;
|
512
509
|
{
|
513
|
-
const y = R(
|
510
|
+
const y = R(o, l.value, !0);
|
514
511
|
if (!y.isValid())
|
515
512
|
throw new D(`日期输入框的值无效,不符合${l.value}格式`);
|
516
513
|
return y.toDate();
|
517
514
|
}
|
518
515
|
}
|
519
516
|
},
|
520
|
-
set: (
|
521
|
-
|
517
|
+
set: (o) => {
|
518
|
+
n.value == "date" ? o ? d.updateModelValue(r.name, o) : d.updateModelValue(r.name, void 0) : o ? d.updateModelValue(r.name, R(o).format(l.value)) : d.updateModelValue(r.name, "");
|
522
519
|
}
|
523
520
|
});
|
524
|
-
return (
|
521
|
+
return (o, y) => (s(), p(e(c), { span: e(m) }, {
|
525
522
|
default: u(() => [
|
526
|
-
b(e(
|
527
|
-
prop:
|
528
|
-
label:
|
529
|
-
"label-width":
|
530
|
-
required:
|
523
|
+
b(e(V), {
|
524
|
+
prop: o.name,
|
525
|
+
label: o.label,
|
526
|
+
"label-width": o.labelWidth,
|
527
|
+
required: o.required,
|
531
528
|
rules: e(i)
|
532
529
|
}, {
|
533
530
|
default: u(() => [
|
534
|
-
a.value ? (s(), p(e(
|
531
|
+
a.value ? (s(), p(e(te), {
|
535
532
|
key: 0,
|
536
533
|
modelValue: f.value,
|
537
534
|
"onUpdate:modelValue": y[0] || (y[0] = (k) => f.value = k),
|
538
|
-
placeholder:
|
539
|
-
disabled:
|
540
|
-
readonly:
|
541
|
-
editable:
|
542
|
-
clearable:
|
535
|
+
placeholder: o.placeholder,
|
536
|
+
disabled: o.disabled,
|
537
|
+
readonly: o.readonly,
|
538
|
+
editable: o.editable,
|
539
|
+
clearable: o.clearable,
|
543
540
|
format: l.value,
|
544
541
|
"arrow-control": "",
|
545
542
|
style: { width: "100%" }
|
546
|
-
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (s(), p(e(
|
543
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (s(), p(e(ne), {
|
547
544
|
key: 1,
|
548
545
|
modelValue: f.value,
|
549
546
|
"onUpdate:modelValue": y[1] || (y[1] = (k) => f.value = k),
|
550
|
-
placeholder:
|
551
|
-
disabled:
|
552
|
-
readonly:
|
553
|
-
editable:
|
554
|
-
clearable:
|
555
|
-
type:
|
547
|
+
placeholder: o.placeholder,
|
548
|
+
disabled: o.disabled,
|
549
|
+
readonly: o.readonly,
|
550
|
+
editable: o.editable,
|
551
|
+
clearable: o.clearable,
|
552
|
+
type: t.value,
|
556
553
|
format: l.value,
|
557
554
|
style: { width: "100%" }
|
558
555
|
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
|
@@ -565,7 +562,7 @@ const me = /* @__PURE__ */ h({
|
|
565
562
|
}
|
566
563
|
}), Se = /* @__PURE__ */ h({
|
567
564
|
name: "OFormFile",
|
568
|
-
|
565
|
+
inheritAttrs: !1,
|
569
566
|
__name: "FileInput",
|
570
567
|
props: {
|
571
568
|
name: {},
|
@@ -576,32 +573,32 @@ const me = /* @__PURE__ */ h({
|
|
576
573
|
rules: {},
|
577
574
|
disabled: { type: Boolean }
|
578
575
|
},
|
579
|
-
setup(
|
580
|
-
const m = v(), i =
|
576
|
+
setup(r) {
|
577
|
+
const m = v(), i = w(), a = B();
|
581
578
|
J(a, () => {
|
582
579
|
a.value || (l.value = "");
|
583
580
|
});
|
584
|
-
const l = Q(""),
|
581
|
+
const l = Q(""), t = $("inputRef");
|
585
582
|
return X(() => {
|
586
|
-
|
587
|
-
var
|
588
|
-
a.value = (
|
583
|
+
t.value.input.onchange = (d) => {
|
584
|
+
var n;
|
585
|
+
a.value = (n = d == null ? void 0 : d.target) == null ? void 0 : n.files[0];
|
589
586
|
}, l.value = "";
|
590
|
-
}), (
|
587
|
+
}), (d, n) => (s(), p(e(c), { span: e(m) }, {
|
591
588
|
default: u(() => [
|
592
|
-
b(e(
|
593
|
-
prop:
|
594
|
-
label:
|
595
|
-
"label-width":
|
596
|
-
required:
|
589
|
+
b(e(V), {
|
590
|
+
prop: d.name,
|
591
|
+
label: d.label,
|
592
|
+
"label-width": d.labelWidth,
|
593
|
+
required: d.required,
|
597
594
|
rules: e(i)
|
598
595
|
}, {
|
599
596
|
default: u(() => [
|
600
597
|
b(e(q), {
|
601
598
|
ref: "inputRef",
|
602
599
|
modelValue: l.value,
|
603
|
-
"onUpdate:modelValue":
|
604
|
-
disabled:
|
600
|
+
"onUpdate:modelValue": n[0] || (n[0] = (f) => l.value = f),
|
601
|
+
disabled: d.disabled,
|
605
602
|
type: "file",
|
606
603
|
"validate-event": !1
|
607
604
|
}, null, 8, ["modelValue", "disabled"])
|
@@ -614,15 +611,16 @@ const me = /* @__PURE__ */ h({
|
|
614
611
|
}
|
615
612
|
}), qe = /* @__PURE__ */ h({
|
616
613
|
name: "OFormButtongroup",
|
614
|
+
inheritAttrs: !1,
|
617
615
|
__name: "ButtonGroup",
|
618
616
|
props: {
|
619
617
|
span: {},
|
620
618
|
gutter: { type: [Boolean, String] },
|
621
619
|
align: { default: "right" }
|
622
620
|
},
|
623
|
-
setup(
|
621
|
+
setup(r) {
|
624
622
|
const m = S(() => ({
|
625
|
-
textAlign:
|
623
|
+
textAlign: r.align
|
626
624
|
})), i = v();
|
627
625
|
return (a, l) => (s(), p(e(c), {
|
628
626
|
span: e(i),
|
@@ -642,9 +640,9 @@ const me = /* @__PURE__ */ h({
|
|
642
640
|
_: 3
|
643
641
|
}, 8, ["span", "style"]));
|
644
642
|
}
|
645
|
-
}),
|
643
|
+
}), Be = /* @__PURE__ */ h({
|
646
644
|
name: "OFormDiy",
|
647
|
-
|
645
|
+
inheritAttrs: !1,
|
648
646
|
__name: "DiyItem",
|
649
647
|
props: {
|
650
648
|
name: {},
|
@@ -654,11 +652,11 @@ const me = /* @__PURE__ */ h({
|
|
654
652
|
required: { type: Boolean },
|
655
653
|
rules: {}
|
656
654
|
},
|
657
|
-
setup(
|
658
|
-
const m = v(), i =
|
655
|
+
setup(r) {
|
656
|
+
const m = v(), i = w();
|
659
657
|
return (a, l) => (s(), p(e(c), { span: e(m) }, {
|
660
658
|
default: u(() => [
|
661
|
-
b(e(
|
659
|
+
b(e(V), {
|
662
660
|
prop: a.name,
|
663
661
|
label: a.label,
|
664
662
|
"label-width": a.labelWidth,
|
@@ -682,15 +680,15 @@ const me = /* @__PURE__ */ h({
|
|
682
680
|
MultiSelect: ye,
|
683
681
|
RadioGroup: ce,
|
684
682
|
CheckboxGroup: ve,
|
685
|
-
Checkbox:
|
686
|
-
Switch:
|
687
|
-
DateInput:
|
683
|
+
Checkbox: Ve,
|
684
|
+
Switch: we,
|
685
|
+
DateInput: ge,
|
688
686
|
FileInput: Se,
|
689
687
|
ButtonGroup: qe,
|
690
|
-
DiyItem:
|
688
|
+
DiyItem: Be
|
691
689
|
});
|
692
690
|
export {
|
693
691
|
$e as default,
|
694
|
-
|
692
|
+
de as formContextKey
|
695
693
|
};
|
696
694
|
//# sourceMappingURL=index.js.map
|