orion-design 0.1.13 → 0.1.14
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Form/index.js +230 -220
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.d.ts +2 -0
- package/dist/components/LovTable/LovQuerytable.d.ts +2 -0
- package/dist/components/LovTable/index.d.ts +5 -0
- package/dist/components/LovTable/index.js +54 -0
- package/dist/components/LovTable/index.js.map +1 -0
- package/dist/components/Pagetable/Pagetable.d.ts +2 -1
- package/dist/components/Pagetable/hooks/useColumns.js +36 -35
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +2 -1
- package/dist/components/Pagetable/index.js +130 -128
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Querytable/Querytable.d.ts +2 -1
- package/dist/components/Querytable/hooks/useColumns.js +16 -15
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +2 -1
- package/dist/components/Querytable/index.js +90 -88
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/components.d.ts +2 -0
- package/dist/components/components.js +18 -10
- package/dist/components/components.js.map +1 -1
- package/dist/components/index.js +21 -13
- package/dist/components/index.js.map +1 -1
- package/dist/components-1bMIJYPN.js +78 -0
- package/dist/{components-OIbu7HLW.js.map → components-1bMIJYPN.js.map} +1 -1
- package/dist/index.js +24 -16
- package/dist/index.js.map +1 -1
- package/dist/request/disivion/index.d.ts +11 -12
- package/dist/request/disivion/index.js +137 -134
- package/dist/request/disivion/index.js.map +1 -1
- package/dist/request/index.d.ts +1 -1
- package/dist/request/index.js +11 -8
- 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 +4 -2
- package/dist/components-OIbu7HLW.js +0 -70
@@ -1,15 +1,15 @@
|
|
1
|
-
import { difference as
|
2
|
-
import { defineComponent as c, useTemplateRef as
|
3
|
-
import { withInstall as
|
4
|
-
import { ElForm as
|
5
|
-
import { formContextKey as
|
6
|
-
import
|
7
|
-
import { useFormItemSpan as v, useFormItemRules as
|
8
|
-
import { getSingleCodeContent as
|
9
|
-
import { S as
|
10
|
-
import { lovContextKey as
|
1
|
+
import { difference as Q, isEmpty as X, isString as D, isDate as Z } from "lodash-es";
|
2
|
+
import { defineComponent as c, useTemplateRef as E, provide as U, reactive as T, toRef as z, openBlock as p, createBlock as b, unref as e, withCtx as d, createVNode as f, renderSlot as O, isRef as S, computed as q, createElementBlock as W, Fragment as C, renderList as R, createTextVNode as x, toDisplayString as _, watch as ee, ref as le, onMounted as ae, normalizeStyle as oe } from "vue";
|
3
|
+
import { withInstall as re } from "../_util/vue/install.js";
|
4
|
+
import { ElForm as te, ElRow as ne, ElCol as y, ElFormItem as V, ElInput as M, ElSelect as Y, ElOption as G, ElRadioGroup as de, ElRadio as ue, ElCheckboxGroup as ie, ElCheckbox as j, ElSwitch as se, dayjs as I, ElTimePicker as me, ElDatePicker as pe, ElDropdown as be } from "element-plus";
|
5
|
+
import { formContextKey as fe } from "./Form.js";
|
6
|
+
import k from "../../error/OrionError.js";
|
7
|
+
import { useFormItemSpan as v, useFormItemRules as w, useFormItemStringModel as B, useFormItemDisabled as L, useFormItemCode as $, useFormItemMultiModel as P, useFormContext as A, useFormItemBooleanModel as N } from "./hooks/index.js";
|
8
|
+
import { getSingleCodeContent as he, getMultiCodeContent as ce } from "./utils/index.js";
|
9
|
+
import { S as ye } from "../../index-BbsXWo7C.js";
|
10
|
+
import { lovContextKey as ve } from "./LovInput/LovInput.js";
|
11
11
|
import { default as Ke } from "./LovInput/hooks/useLov.js";
|
12
|
-
const
|
12
|
+
const Ve = /* @__PURE__ */ c({
|
13
13
|
name: "OForm",
|
14
14
|
inheritAttrs: !1,
|
15
15
|
__name: "Form",
|
@@ -21,40 +21,40 @@ const ve = /* @__PURE__ */ c({
|
|
21
21
|
modelValue: {}
|
22
22
|
},
|
23
23
|
emits: ["update:modelValue"],
|
24
|
-
setup(
|
25
|
-
const a =
|
26
|
-
if (!Object.keys(
|
27
|
-
throw new
|
28
|
-
a("update:modelValue", { ...
|
29
|
-
}, n = (
|
30
|
-
const
|
31
|
-
if (!
|
32
|
-
throw new
|
33
|
-
a("update:modelValue", { ...
|
34
|
-
}, u =
|
24
|
+
setup(r, { expose: m, emit: i }) {
|
25
|
+
const a = i, l = (t, o) => {
|
26
|
+
if (!Object.keys(r.modelValue).includes(t))
|
27
|
+
throw new k(`modelValue中不存在[${t}]`);
|
28
|
+
a("update:modelValue", { ...r.modelValue, [t]: o });
|
29
|
+
}, n = (t) => {
|
30
|
+
const o = Object.keys(r.modelValue), h = Object.keys(t), g = Q(h, o);
|
31
|
+
if (!X(g))
|
32
|
+
throw new k(`modelValue中不存在[${g.join(",")}]`);
|
33
|
+
a("update:modelValue", { ...r.modelValue, ...t });
|
34
|
+
}, u = E("form");
|
35
35
|
return m({
|
36
36
|
validate: async () => await u.value.validate()
|
37
|
-
}),
|
38
|
-
|
39
|
-
|
40
|
-
modelValue:
|
37
|
+
}), U(
|
38
|
+
fe,
|
39
|
+
T({
|
40
|
+
modelValue: z(() => r.modelValue),
|
41
41
|
updateModelValue: l,
|
42
42
|
updateModelValueMulti: n,
|
43
|
-
rules:
|
44
|
-
itemSpan:
|
45
|
-
disabled:
|
43
|
+
rules: z(() => r.rules),
|
44
|
+
itemSpan: z(() => r.itemSpan),
|
45
|
+
disabled: z(() => r.disabled)
|
46
46
|
})
|
47
|
-
), (
|
47
|
+
), (t, o) => (p(), b(e(te), {
|
48
48
|
ref: "form",
|
49
|
-
model:
|
50
|
-
rules:
|
51
|
-
"label-width":
|
52
|
-
disabled:
|
49
|
+
model: t.modelValue,
|
50
|
+
rules: t.rules,
|
51
|
+
"label-width": t.itemLabelWidth,
|
52
|
+
disabled: t.disabled
|
53
53
|
}, {
|
54
54
|
default: d(() => [
|
55
|
-
f(e(
|
55
|
+
f(e(ne), { gutter: 16 }, {
|
56
56
|
default: d(() => [
|
57
|
-
|
57
|
+
O(t.$slots, "default")
|
58
58
|
]),
|
59
59
|
_: 3
|
60
60
|
})
|
@@ -62,7 +62,7 @@ const ve = /* @__PURE__ */ c({
|
|
62
62
|
_: 3
|
63
63
|
}, 8, ["model", "rules", "label-width", "disabled"]));
|
64
64
|
}
|
65
|
-
}),
|
65
|
+
}), ge = /* @__PURE__ */ c({
|
66
66
|
name: "OFormString",
|
67
67
|
inheritAttrs: !1,
|
68
68
|
__name: "StringInput",
|
@@ -78,8 +78,8 @@ const ve = /* @__PURE__ */ c({
|
|
78
78
|
disabled: { type: Boolean },
|
79
79
|
readonly: { type: Boolean }
|
80
80
|
},
|
81
|
-
setup(
|
82
|
-
const m = v(),
|
81
|
+
setup(r) {
|
82
|
+
const m = v(), i = w(), a = B();
|
83
83
|
return (l, n) => (p(), b(e(y), { span: e(m) }, {
|
84
84
|
default: d(() => [
|
85
85
|
f(e(V), {
|
@@ -87,10 +87,10 @@ const ve = /* @__PURE__ */ c({
|
|
87
87
|
label: l.label,
|
88
88
|
"label-width": l.labelWidth,
|
89
89
|
required: l.required,
|
90
|
-
rules: e(
|
90
|
+
rules: e(i)
|
91
91
|
}, {
|
92
92
|
default: d(() => [
|
93
|
-
f(e(
|
93
|
+
f(e(M), {
|
94
94
|
modelValue: e(a),
|
95
95
|
"onUpdate:modelValue": n[0] || (n[0] = (u) => S(a) ? a.value = u : null),
|
96
96
|
maxlength: l.maxlength,
|
@@ -121,8 +121,8 @@ const ve = /* @__PURE__ */ c({
|
|
121
121
|
disabled: { type: Boolean },
|
122
122
|
readonly: { type: Boolean }
|
123
123
|
},
|
124
|
-
setup(
|
125
|
-
const m = v(),
|
124
|
+
setup(r) {
|
125
|
+
const m = v(), i = w(), a = B();
|
126
126
|
return (l, n) => (p(), b(e(y), { span: e(m) }, {
|
127
127
|
default: d(() => [
|
128
128
|
f(e(V), {
|
@@ -130,10 +130,10 @@ const ve = /* @__PURE__ */ c({
|
|
130
130
|
label: l.label,
|
131
131
|
"label-width": l.labelWidth,
|
132
132
|
required: l.required,
|
133
|
-
rules: e(
|
133
|
+
rules: e(i)
|
134
134
|
}, {
|
135
135
|
default: d(() => [
|
136
|
-
f(e(
|
136
|
+
f(e(M), {
|
137
137
|
modelValue: e(a),
|
138
138
|
"onUpdate:modelValue": n[0] || (n[0] = (u) => S(a) ? a.value = u : null),
|
139
139
|
maxlength: l.maxlength,
|
@@ -149,7 +149,7 @@ const ve = /* @__PURE__ */ c({
|
|
149
149
|
_: 1
|
150
150
|
}, 8, ["span"]));
|
151
151
|
}
|
152
|
-
}),
|
152
|
+
}), Se = /* @__PURE__ */ c({
|
153
153
|
name: "OFormTextarea",
|
154
154
|
inheritAttrs: !1,
|
155
155
|
__name: "Textarea",
|
@@ -166,8 +166,8 @@ const ve = /* @__PURE__ */ c({
|
|
166
166
|
readonly: { type: Boolean },
|
167
167
|
rows: {}
|
168
168
|
},
|
169
|
-
setup(
|
170
|
-
const m = v(),
|
169
|
+
setup(r) {
|
170
|
+
const m = v(), i = w(), a = B();
|
171
171
|
return (l, n) => (p(), b(e(y), { span: e(m) }, {
|
172
172
|
default: d(() => [
|
173
173
|
f(e(V), {
|
@@ -175,10 +175,10 @@ const ve = /* @__PURE__ */ c({
|
|
175
175
|
label: l.label,
|
176
176
|
"label-width": l.labelWidth,
|
177
177
|
required: l.required,
|
178
|
-
rules: e(
|
178
|
+
rules: e(i)
|
179
179
|
}, {
|
180
180
|
default: d(() => [
|
181
|
-
f(e(
|
181
|
+
f(e(M), {
|
182
182
|
modelValue: e(a),
|
183
183
|
"onUpdate:modelValue": n[0] || (n[0] = (u) => S(a) ? a.value = u : null),
|
184
184
|
maxlength: l.maxlength,
|
@@ -196,7 +196,7 @@ const ve = /* @__PURE__ */ c({
|
|
196
196
|
_: 1
|
197
197
|
}, 8, ["span"]));
|
198
198
|
}
|
199
|
-
}),
|
199
|
+
}), qe = /* @__PURE__ */ c({
|
200
200
|
name: "OFormSingleselect",
|
201
201
|
inheritAttrs: !1,
|
202
202
|
__name: "SingleSelect",
|
@@ -213,37 +213,37 @@ const ve = /* @__PURE__ */ c({
|
|
213
213
|
clearable: { type: Boolean },
|
214
214
|
filterable: { type: Boolean }
|
215
215
|
},
|
216
|
-
setup(
|
217
|
-
const m = v(),
|
218
|
-
return (
|
216
|
+
setup(r) {
|
217
|
+
const m = v(), i = w(), a = L(), l = $(), n = B(), u = q(() => he(l.value, n.value));
|
218
|
+
return (s, t) => (p(), b(e(y), { span: e(m) }, {
|
219
219
|
default: d(() => [
|
220
220
|
f(e(V), {
|
221
|
-
prop:
|
222
|
-
label:
|
223
|
-
"label-width":
|
224
|
-
required:
|
225
|
-
rules: e(
|
221
|
+
prop: s.name,
|
222
|
+
label: s.label,
|
223
|
+
"label-width": s.labelWidth,
|
224
|
+
required: s.required,
|
225
|
+
rules: e(i)
|
226
226
|
}, {
|
227
227
|
default: d(() => [
|
228
|
-
e(a) ? (p(), b(e(
|
228
|
+
e(a) ? (p(), b(e(M), {
|
229
229
|
key: 0,
|
230
230
|
"model-value": u.value,
|
231
|
-
placeholder:
|
231
|
+
placeholder: s.placeholder,
|
232
232
|
disabled: !0,
|
233
233
|
readonly: !0
|
234
|
-
}, null, 8, ["model-value", "placeholder"])) : (p(), b(e(
|
234
|
+
}, null, 8, ["model-value", "placeholder"])) : (p(), b(e(Y), {
|
235
235
|
key: 1,
|
236
236
|
modelValue: e(n),
|
237
|
-
"onUpdate:modelValue":
|
238
|
-
placeholder:
|
239
|
-
clearable:
|
240
|
-
filterable:
|
237
|
+
"onUpdate:modelValue": t[0] || (t[0] = (o) => S(n) ? n.value = o : null),
|
238
|
+
placeholder: s.placeholder,
|
239
|
+
clearable: s.clearable,
|
240
|
+
filterable: s.filterable
|
241
241
|
}, {
|
242
242
|
default: d(() => [
|
243
|
-
(p(!0),
|
244
|
-
key:
|
245
|
-
label:
|
246
|
-
value:
|
243
|
+
(p(!0), W(C, null, R(e(l), (o) => (p(), b(e(G), {
|
244
|
+
key: o.value,
|
245
|
+
label: o.content,
|
246
|
+
value: o.value
|
247
247
|
}, null, 8, ["label", "value"]))), 128))
|
248
248
|
]),
|
249
249
|
_: 1
|
@@ -255,7 +255,7 @@ const ve = /* @__PURE__ */ c({
|
|
255
255
|
_: 1
|
256
256
|
}, 8, ["span"]));
|
257
257
|
}
|
258
|
-
}),
|
258
|
+
}), Me = /* @__PURE__ */ c({
|
259
259
|
name: "OFormMultiselect",
|
260
260
|
inheritAttrs: !1,
|
261
261
|
__name: "MultiSelect",
|
@@ -270,33 +270,33 @@ const ve = /* @__PURE__ */ c({
|
|
270
270
|
disabled: { type: Boolean },
|
271
271
|
code: {}
|
272
272
|
},
|
273
|
-
setup(
|
274
|
-
const m = v(),
|
275
|
-
return (
|
273
|
+
setup(r) {
|
274
|
+
const m = v(), i = w(), a = L(), l = $(), n = P(), u = A(), s = q(() => ce(l.value, u.modelValue[r.name]));
|
275
|
+
return (t, o) => (p(), b(e(y), { span: e(m) }, {
|
276
276
|
default: d(() => [
|
277
277
|
f(e(V), {
|
278
|
-
prop:
|
279
|
-
label:
|
280
|
-
"label-width":
|
281
|
-
required:
|
282
|
-
rules: e(
|
278
|
+
prop: t.name,
|
279
|
+
label: t.label,
|
280
|
+
"label-width": t.labelWidth,
|
281
|
+
required: t.required,
|
282
|
+
rules: e(i)
|
283
283
|
}, {
|
284
284
|
default: d(() => [
|
285
|
-
e(a) ? (p(), b(e(
|
285
|
+
e(a) ? (p(), b(e(M), {
|
286
286
|
key: 0,
|
287
|
-
"model-value":
|
288
|
-
placeholder:
|
287
|
+
"model-value": s.value,
|
288
|
+
placeholder: t.placeholder,
|
289
289
|
disabled: !0,
|
290
290
|
readonly: !0
|
291
|
-
}, null, 8, ["model-value", "placeholder"])) : (p(), b(e(
|
291
|
+
}, null, 8, ["model-value", "placeholder"])) : (p(), b(e(Y), {
|
292
292
|
key: 1,
|
293
293
|
modelValue: e(n),
|
294
|
-
"onUpdate:modelValue":
|
295
|
-
placeholder:
|
294
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => S(n) ? n.value = h : null),
|
295
|
+
placeholder: t.placeholder,
|
296
296
|
multiple: ""
|
297
297
|
}, {
|
298
298
|
default: d(() => [
|
299
|
-
(p(!0),
|
299
|
+
(p(!0), W(C, null, R(e(l), (h) => (p(), b(e(G), {
|
300
300
|
key: h.value,
|
301
301
|
label: h.content,
|
302
302
|
value: h.value
|
@@ -325,8 +325,8 @@ const ve = /* @__PURE__ */ c({
|
|
325
325
|
disabled: { type: Boolean },
|
326
326
|
code: {}
|
327
327
|
},
|
328
|
-
setup(
|
329
|
-
const m = v(),
|
328
|
+
setup(r) {
|
329
|
+
const m = v(), i = w(), a = $(), l = B();
|
330
330
|
return (n, u) => (p(), b(e(y), { span: e(m) }, {
|
331
331
|
default: d(() => [
|
332
332
|
f(e(V), {
|
@@ -334,21 +334,21 @@ const ve = /* @__PURE__ */ c({
|
|
334
334
|
label: n.label,
|
335
335
|
"label-width": n.labelWidth,
|
336
336
|
required: n.required,
|
337
|
-
rules: e(
|
337
|
+
rules: e(i)
|
338
338
|
}, {
|
339
339
|
default: d(() => [
|
340
|
-
f(e(
|
340
|
+
f(e(de), {
|
341
341
|
modelValue: e(l),
|
342
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
342
|
+
"onUpdate:modelValue": u[0] || (u[0] = (s) => S(l) ? l.value = s : null),
|
343
343
|
disabled: n.disabled
|
344
344
|
}, {
|
345
345
|
default: d(() => [
|
346
|
-
(p(!0),
|
347
|
-
key:
|
348
|
-
value:
|
346
|
+
(p(!0), W(C, null, R(e(a), (s) => (p(), b(e(ue), {
|
347
|
+
key: s.value,
|
348
|
+
value: s.value
|
349
349
|
}, {
|
350
350
|
default: d(() => [
|
351
|
-
|
351
|
+
x(_(s.content), 1)
|
352
352
|
]),
|
353
353
|
_: 2
|
354
354
|
}, 1032, ["value"]))), 128))
|
@@ -362,7 +362,7 @@ const ve = /* @__PURE__ */ c({
|
|
362
362
|
_: 1
|
363
363
|
}, 8, ["span"]));
|
364
364
|
}
|
365
|
-
}),
|
365
|
+
}), Fe = /* @__PURE__ */ c({
|
366
366
|
name: "OFormCheckboxgroup",
|
367
367
|
inheritAttrs: !1,
|
368
368
|
__name: "CheckboxGroup",
|
@@ -376,8 +376,8 @@ const ve = /* @__PURE__ */ c({
|
|
376
376
|
disabled: { type: Boolean },
|
377
377
|
code: {}
|
378
378
|
},
|
379
|
-
setup(
|
380
|
-
const m = v(),
|
379
|
+
setup(r) {
|
380
|
+
const m = v(), i = w(), a = $(), l = P();
|
381
381
|
return (n, u) => (p(), b(e(y), { span: e(m) }, {
|
382
382
|
default: d(() => [
|
383
383
|
f(e(V), {
|
@@ -385,19 +385,19 @@ const ve = /* @__PURE__ */ c({
|
|
385
385
|
label: n.label,
|
386
386
|
"label-width": n.labelWidth,
|
387
387
|
required: n.required,
|
388
|
-
rules: e(
|
388
|
+
rules: e(i)
|
389
389
|
}, {
|
390
390
|
default: d(() => [
|
391
|
-
f(e(
|
391
|
+
f(e(ie), {
|
392
392
|
modelValue: e(l),
|
393
|
-
"onUpdate:modelValue": u[0] || (u[0] = (
|
393
|
+
"onUpdate:modelValue": u[0] || (u[0] = (s) => S(l) ? l.value = s : null),
|
394
394
|
disabled: n.disabled
|
395
395
|
}, {
|
396
396
|
default: d(() => [
|
397
|
-
(p(!0),
|
398
|
-
key:
|
399
|
-
label:
|
400
|
-
value:
|
397
|
+
(p(!0), W(C, null, R(e(a), (s) => (p(), b(e(j), {
|
398
|
+
key: s.value,
|
399
|
+
label: s.content,
|
400
|
+
value: s.value
|
401
401
|
}, null, 8, ["label", "value"]))), 128))
|
402
402
|
]),
|
403
403
|
_: 1
|
@@ -409,7 +409,7 @@ const ve = /* @__PURE__ */ c({
|
|
409
409
|
_: 1
|
410
410
|
}, 8, ["span"]));
|
411
411
|
}
|
412
|
-
}),
|
412
|
+
}), ze = /* @__PURE__ */ c({
|
413
413
|
name: "OFormCheckbox",
|
414
414
|
inheritAttrs: !1,
|
415
415
|
__name: "Checkbox",
|
@@ -421,8 +421,8 @@ const ve = /* @__PURE__ */ c({
|
|
421
421
|
rules: {},
|
422
422
|
disabled: { type: Boolean }
|
423
423
|
},
|
424
|
-
setup(
|
425
|
-
const m = v(),
|
424
|
+
setup(r) {
|
425
|
+
const m = v(), i = N();
|
426
426
|
return (a, l) => (p(), b(e(y), { span: e(m) }, {
|
427
427
|
default: d(() => [
|
428
428
|
f(e(V), {
|
@@ -432,9 +432,9 @@ const ve = /* @__PURE__ */ c({
|
|
432
432
|
rules: a.rules
|
433
433
|
}, {
|
434
434
|
default: d(() => [
|
435
|
-
f(e(
|
436
|
-
modelValue: e(
|
437
|
-
"onUpdate:modelValue": l[0] || (l[0] = (n) => S(
|
435
|
+
f(e(j), {
|
436
|
+
modelValue: e(i),
|
437
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => S(i) ? i.value = n : null),
|
438
438
|
disabled: a.disabled
|
439
439
|
}, null, 8, ["modelValue", "disabled"])
|
440
440
|
]),
|
@@ -444,7 +444,7 @@ const ve = /* @__PURE__ */ c({
|
|
444
444
|
_: 1
|
445
445
|
}, 8, ["span"]));
|
446
446
|
}
|
447
|
-
}),
|
447
|
+
}), ke = /* @__PURE__ */ c({
|
448
448
|
name: "OFormSwitch",
|
449
449
|
inheritAttrs: !1,
|
450
450
|
__name: "Switch",
|
@@ -456,8 +456,8 @@ const ve = /* @__PURE__ */ c({
|
|
456
456
|
rules: {},
|
457
457
|
disabled: { type: Boolean }
|
458
458
|
},
|
459
|
-
setup(
|
460
|
-
const m = v(),
|
459
|
+
setup(r) {
|
460
|
+
const m = v(), i = N();
|
461
461
|
return (a, l) => (p(), b(e(y), { span: e(m) }, {
|
462
462
|
default: d(() => [
|
463
463
|
f(e(V), {
|
@@ -467,9 +467,9 @@ const ve = /* @__PURE__ */ c({
|
|
467
467
|
rules: a.rules
|
468
468
|
}, {
|
469
469
|
default: d(() => [
|
470
|
-
f(e(
|
471
|
-
modelValue: e(
|
472
|
-
"onUpdate:modelValue": l[0] || (l[0] = (n) => S(
|
470
|
+
f(e(se), {
|
471
|
+
modelValue: e(i),
|
472
|
+
"onUpdate:modelValue": l[0] || (l[0] = (n) => S(i) ? i.value = n : null),
|
473
473
|
disabled: a.disabled
|
474
474
|
}, null, 8, ["modelValue", "disabled"])
|
475
475
|
]),
|
@@ -479,7 +479,7 @@ const ve = /* @__PURE__ */ c({
|
|
479
479
|
_: 1
|
480
480
|
}, 8, ["span"]));
|
481
481
|
}
|
482
|
-
}),
|
482
|
+
}), Oe = /* @__PURE__ */ c({
|
483
483
|
name: "OFormDate",
|
484
484
|
inheritAttrs: !1,
|
485
485
|
__name: "DateInput",
|
@@ -499,66 +499,66 @@ const ve = /* @__PURE__ */ c({
|
|
499
499
|
format: { default: "YYYY-MM-DD" },
|
500
500
|
sourceFormat: {}
|
501
501
|
},
|
502
|
-
setup(
|
503
|
-
const m = v(),
|
504
|
-
let
|
505
|
-
return (
|
506
|
-
}), u =
|
507
|
-
const
|
508
|
-
if (
|
502
|
+
setup(r) {
|
503
|
+
const m = v(), i = w(), a = q(() => r.format.startsWith("H") || r.format.startsWith("h") || r.format.startsWith("m") || r.format.startsWith("s")), l = q(() => r.sourceFormat ? r.sourceFormat : a.value ? "HH:mm:ss" : "YYYY-MM-DD"), n = q(() => {
|
504
|
+
let o = "date";
|
505
|
+
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;
|
506
|
+
}), u = A(), s = q(() => {
|
507
|
+
const o = u.modelValue[r.name];
|
508
|
+
if (D(o))
|
509
509
|
return "string";
|
510
|
-
if (
|
510
|
+
if (Z(o))
|
511
511
|
return "date";
|
512
|
-
throw new
|
513
|
-
}),
|
512
|
+
throw new k("日期输入框的值只能为字符串或日期类型");
|
513
|
+
}), t = q({
|
514
514
|
get: () => {
|
515
|
-
const
|
516
|
-
if (
|
517
|
-
if (
|
518
|
-
return
|
515
|
+
const o = u.modelValue[r.name];
|
516
|
+
if (o) {
|
517
|
+
if (s.value == "date")
|
518
|
+
return o;
|
519
519
|
{
|
520
|
-
const h =
|
520
|
+
const h = I(o, l.value, !0);
|
521
521
|
if (!h.isValid())
|
522
|
-
throw new
|
522
|
+
throw new k(`日期输入框的值无效,不符合${l.value}格式`);
|
523
523
|
return h.toDate();
|
524
524
|
}
|
525
525
|
}
|
526
526
|
},
|
527
|
-
set: (
|
528
|
-
|
527
|
+
set: (o) => {
|
528
|
+
s.value == "date" ? o ? u.updateModelValue(r.name, o) : u.updateModelValue(r.name, void 0) : o ? u.updateModelValue(r.name, I(o).format(l.value)) : u.updateModelValue(r.name, "");
|
529
529
|
}
|
530
530
|
});
|
531
|
-
return (
|
531
|
+
return (o, h) => (p(), b(e(y), { span: e(m) }, {
|
532
532
|
default: d(() => [
|
533
533
|
f(e(V), {
|
534
|
-
prop:
|
535
|
-
label:
|
536
|
-
"label-width":
|
537
|
-
required:
|
538
|
-
rules: e(
|
534
|
+
prop: o.name,
|
535
|
+
label: o.label,
|
536
|
+
"label-width": o.labelWidth,
|
537
|
+
required: o.required,
|
538
|
+
rules: e(i)
|
539
539
|
}, {
|
540
540
|
default: d(() => [
|
541
|
-
a.value ? (p(), b(e(
|
541
|
+
a.value ? (p(), b(e(me), {
|
542
542
|
key: 0,
|
543
|
-
modelValue:
|
544
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
545
|
-
placeholder:
|
546
|
-
disabled:
|
547
|
-
readonly:
|
548
|
-
editable:
|
549
|
-
clearable:
|
543
|
+
modelValue: t.value,
|
544
|
+
"onUpdate:modelValue": h[0] || (h[0] = (g) => t.value = g),
|
545
|
+
placeholder: o.placeholder,
|
546
|
+
disabled: o.disabled,
|
547
|
+
readonly: o.readonly,
|
548
|
+
editable: o.editable,
|
549
|
+
clearable: o.clearable,
|
550
550
|
format: l.value,
|
551
551
|
"arrow-control": "",
|
552
552
|
style: { width: "100%" }
|
553
|
-
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(), b(e(
|
553
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(), b(e(pe), {
|
554
554
|
key: 1,
|
555
|
-
modelValue:
|
556
|
-
"onUpdate:modelValue": h[1] || (h[1] = (
|
557
|
-
placeholder:
|
558
|
-
disabled:
|
559
|
-
readonly:
|
560
|
-
editable:
|
561
|
-
clearable:
|
555
|
+
modelValue: t.value,
|
556
|
+
"onUpdate:modelValue": h[1] || (h[1] = (g) => t.value = g),
|
557
|
+
placeholder: o.placeholder,
|
558
|
+
disabled: o.disabled,
|
559
|
+
readonly: o.readonly,
|
560
|
+
editable: o.editable,
|
561
|
+
clearable: o.clearable,
|
562
562
|
type: n.value,
|
563
563
|
format: l.value,
|
564
564
|
style: { width: "100%" }
|
@@ -570,7 +570,7 @@ const ve = /* @__PURE__ */ c({
|
|
570
570
|
_: 1
|
571
571
|
}, 8, ["span"]));
|
572
572
|
}
|
573
|
-
}),
|
573
|
+
}), We = /* @__PURE__ */ c({
|
574
574
|
name: "OFormFile",
|
575
575
|
inheritAttrs: !1,
|
576
576
|
__name: "FileInput",
|
@@ -583,31 +583,31 @@ const ve = /* @__PURE__ */ c({
|
|
583
583
|
rules: {},
|
584
584
|
disabled: { type: Boolean }
|
585
585
|
},
|
586
|
-
setup(
|
587
|
-
const m = v(),
|
588
|
-
|
586
|
+
setup(r) {
|
587
|
+
const m = v(), i = w(), a = B();
|
588
|
+
ee(a, () => {
|
589
589
|
a.value || (l.value = "");
|
590
590
|
});
|
591
|
-
const l =
|
592
|
-
return
|
591
|
+
const l = le(""), n = E("inputRef");
|
592
|
+
return ae(() => {
|
593
593
|
n.value.input.onchange = (u) => {
|
594
|
-
var
|
595
|
-
a.value = (
|
594
|
+
var s;
|
595
|
+
a.value = (s = u == null ? void 0 : u.target) == null ? void 0 : s.files[0];
|
596
596
|
}, l.value = "";
|
597
|
-
}), (u,
|
597
|
+
}), (u, s) => (p(), b(e(y), { span: e(m) }, {
|
598
598
|
default: d(() => [
|
599
599
|
f(e(V), {
|
600
600
|
prop: u.name,
|
601
601
|
label: u.label,
|
602
602
|
"label-width": u.labelWidth,
|
603
603
|
required: u.required,
|
604
|
-
rules: e(
|
604
|
+
rules: e(i)
|
605
605
|
}, {
|
606
606
|
default: d(() => [
|
607
|
-
f(e(
|
607
|
+
f(e(M), {
|
608
608
|
ref: "inputRef",
|
609
609
|
modelValue: l.value,
|
610
|
-
"onUpdate:modelValue":
|
610
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => l.value = t),
|
611
611
|
disabled: u.disabled,
|
612
612
|
type: "file",
|
613
613
|
"validate-event": !1
|
@@ -619,7 +619,7 @@ const ve = /* @__PURE__ */ c({
|
|
619
619
|
_: 1
|
620
620
|
}, 8, ["span"]));
|
621
621
|
}
|
622
|
-
}),
|
622
|
+
}), Ce = /* @__PURE__ */ c({
|
623
623
|
name: "OFormButtongroup",
|
624
624
|
inheritAttrs: !1,
|
625
625
|
__name: "ButtonGroup",
|
@@ -628,21 +628,21 @@ const ve = /* @__PURE__ */ c({
|
|
628
628
|
gutter: { type: [Boolean, String] },
|
629
629
|
align: { default: "right" }
|
630
630
|
},
|
631
|
-
setup(
|
631
|
+
setup(r) {
|
632
632
|
const m = q(() => ({
|
633
|
-
textAlign:
|
634
|
-
})),
|
633
|
+
textAlign: r.align
|
634
|
+
})), i = v();
|
635
635
|
return (a, l) => (p(), b(e(y), {
|
636
|
-
span: e(
|
637
|
-
style:
|
636
|
+
span: e(i),
|
637
|
+
style: oe(m.value)
|
638
638
|
}, {
|
639
639
|
default: d(() => [
|
640
|
-
f(e(
|
640
|
+
f(e(ye), {
|
641
641
|
gutter: a.gutter,
|
642
642
|
style: { "margin-bottom": "18px" }
|
643
643
|
}, {
|
644
644
|
default: d(() => [
|
645
|
-
|
645
|
+
O(a.$slots, "default")
|
646
646
|
]),
|
647
647
|
_: 3
|
648
648
|
}, 8, ["gutter"])
|
@@ -650,7 +650,7 @@ const ve = /* @__PURE__ */ c({
|
|
650
650
|
_: 3
|
651
651
|
}, 8, ["span", "style"]));
|
652
652
|
}
|
653
|
-
}),
|
653
|
+
}), Re = /* @__PURE__ */ c({
|
654
654
|
name: "OFormDiy",
|
655
655
|
inheritAttrs: !1,
|
656
656
|
__name: "DiyItem",
|
@@ -662,8 +662,8 @@ const ve = /* @__PURE__ */ c({
|
|
662
662
|
required: { type: Boolean },
|
663
663
|
rules: {}
|
664
664
|
},
|
665
|
-
setup(
|
666
|
-
const m = v(),
|
665
|
+
setup(r) {
|
666
|
+
const m = v(), i = w();
|
667
667
|
return (a, l) => (p(), b(e(y), { span: e(m) }, {
|
668
668
|
default: d(() => [
|
669
669
|
f(e(V), {
|
@@ -671,10 +671,10 @@ const ve = /* @__PURE__ */ c({
|
|
671
671
|
label: a.label,
|
672
672
|
"label-width": a.labelWidth,
|
673
673
|
required: a.required,
|
674
|
-
rules: e(
|
674
|
+
rules: e(i)
|
675
675
|
}, {
|
676
676
|
default: d(() => [
|
677
|
-
|
677
|
+
O(a.$slots, "default")
|
678
678
|
]),
|
679
679
|
_: 3
|
680
680
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -682,7 +682,7 @@ const ve = /* @__PURE__ */ c({
|
|
682
682
|
_: 3
|
683
683
|
}, 8, ["span"]));
|
684
684
|
}
|
685
|
-
}),
|
685
|
+
}), $e = /* @__PURE__ */ c({
|
686
686
|
name: "OFormLov",
|
687
687
|
inheritAttrs: !1,
|
688
688
|
__name: "LovInput",
|
@@ -699,51 +699,61 @@ const ve = /* @__PURE__ */ c({
|
|
699
699
|
readonly: { type: Boolean },
|
700
700
|
fillMapping: { type: [String, Function] }
|
701
701
|
},
|
702
|
-
setup(
|
703
|
-
const m = v(),
|
704
|
-
|
705
|
-
|
706
|
-
|
702
|
+
setup(r) {
|
703
|
+
const m = v(), i = w(), a = B(), l = A(), n = () => {
|
704
|
+
if (D(r.fillMapping)) {
|
705
|
+
const t = {}, o = r.fillMapping.split(",");
|
706
|
+
for (let h = 0; h < o.length; h++) {
|
707
|
+
const g = o[h].split(":")[0].trim();
|
708
|
+
t[g] = void 0;
|
709
|
+
}
|
710
|
+
l.updateModelValueMulti(t);
|
711
|
+
}
|
712
|
+
}, u = E("dropdown");
|
713
|
+
return U(
|
714
|
+
ve,
|
715
|
+
T({
|
707
716
|
lovValue: a,
|
708
717
|
backfill: (t) => {
|
709
|
-
var
|
710
|
-
if ((
|
711
|
-
const
|
712
|
-
for (let
|
713
|
-
const H =
|
714
|
-
|
718
|
+
var o;
|
719
|
+
if ((o = u.value) == null || o.handleClose(), D(r.fillMapping)) {
|
720
|
+
const h = {}, g = r.fillMapping.split(",");
|
721
|
+
for (let F = 0; F < g.length; F++) {
|
722
|
+
const H = g[F].split(":")[0].trim(), K = g[F].split(":")[1].trim(), J = t[K];
|
723
|
+
h[H] = J;
|
715
724
|
}
|
716
|
-
l.updateModelValueMulti(
|
725
|
+
l.updateModelValueMulti(h);
|
717
726
|
} else
|
718
|
-
|
727
|
+
r.fillMapping && r.fillMapping(t);
|
719
728
|
}
|
720
729
|
})
|
721
|
-
), (t,
|
730
|
+
), (t, o) => (p(), b(e(y), { span: e(m) }, {
|
722
731
|
default: d(() => [
|
723
732
|
f(e(V), {
|
724
733
|
prop: t.name,
|
725
734
|
label: t.label,
|
726
735
|
"label-width": t.labelWidth,
|
727
736
|
required: t.required,
|
728
|
-
rules: e(
|
737
|
+
rules: e(i)
|
729
738
|
}, {
|
730
739
|
default: d(() => [
|
731
|
-
f(e(
|
740
|
+
f(e(be), {
|
732
741
|
ref: "dropdown",
|
733
742
|
trigger: "click",
|
734
743
|
style: { width: "100%" }
|
735
744
|
}, {
|
736
745
|
dropdown: d(() => [
|
737
|
-
|
746
|
+
O(t.$slots, "default")
|
738
747
|
]),
|
739
748
|
default: d(() => [
|
740
|
-
f(e(
|
749
|
+
f(e(M), {
|
741
750
|
modelValue: e(a),
|
742
|
-
"onUpdate:modelValue":
|
751
|
+
"onUpdate:modelValue": o[0] || (o[0] = (h) => S(a) ? a.value = h : null),
|
743
752
|
maxlength: t.maxlength,
|
744
753
|
placeholder: t.placeholder,
|
745
754
|
disabled: t.disabled,
|
746
|
-
readonly: t.readonly
|
755
|
+
readonly: t.readonly,
|
756
|
+
onChange: n
|
747
757
|
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
|
748
758
|
]),
|
749
759
|
_: 3
|
@@ -755,26 +765,26 @@ const ve = /* @__PURE__ */ c({
|
|
755
765
|
_: 3
|
756
766
|
}, 8, ["span"]));
|
757
767
|
}
|
758
|
-
}),
|
759
|
-
StringInput:
|
768
|
+
}), Pe = re(Ve, {
|
769
|
+
StringInput: ge,
|
760
770
|
PasswordInput: we,
|
761
|
-
Textarea:
|
762
|
-
SingleSelect:
|
763
|
-
MultiSelect:
|
771
|
+
Textarea: Se,
|
772
|
+
SingleSelect: qe,
|
773
|
+
MultiSelect: Me,
|
764
774
|
RadioGroup: Be,
|
765
|
-
CheckboxGroup:
|
766
|
-
Checkbox:
|
767
|
-
Switch:
|
768
|
-
DateInput:
|
769
|
-
FileInput:
|
770
|
-
ButtonGroup:
|
771
|
-
DiyItem:
|
772
|
-
LovInput:
|
775
|
+
CheckboxGroup: Fe,
|
776
|
+
Checkbox: ze,
|
777
|
+
Switch: ke,
|
778
|
+
DateInput: Oe,
|
779
|
+
FileInput: We,
|
780
|
+
ButtonGroup: Ce,
|
781
|
+
DiyItem: Re,
|
782
|
+
LovInput: $e
|
773
783
|
});
|
774
784
|
export {
|
775
|
-
|
776
|
-
|
777
|
-
|
785
|
+
Pe as default,
|
786
|
+
fe as formContextKey,
|
787
|
+
ve as lovContextKey,
|
778
788
|
Ke as useLov
|
779
789
|
};
|
780
790
|
//# sourceMappingURL=index.js.map
|