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