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