orion-design 0.1.27 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Form/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/Form/index.js +255 -249
- package/dist/components/Form/index.js.map +1 -1
- package/dist/components/LovTable/LovPagetable.vue.d.ts +16 -0
- package/dist/components/LovTable/index.d.ts +8 -0
- package/dist/components/Pagetable/Pagetable.d.ts +7 -0
- package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +75 -0
- package/dist/components/Pagetable/hooks/useColumns.js +6 -6
- package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
- package/dist/components/Pagetable/index.d.ts +7 -0
- package/dist/components/Pagetable/index.js +297 -243
- package/dist/components/Pagetable/index.js.map +1 -1
- package/dist/components/Pagetable/interface.d.ts +1 -0
- package/dist/components/Querytable/columns/QuerytableColumnLink.d.ts +75 -0
- package/dist/components/Querytable/hooks/useColumns.js +6 -6
- package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
- package/dist/components/Querytable/index.d.ts +2 -0
- package/dist/components/Querytable/index.js +227 -180
- package/dist/components/Querytable/index.js.map +1 -1
- package/dist/components/components.js +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components-J6-qau6Y.js +73 -0
- package/dist/components-J6-qau6Y.js.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.js +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-0PErqPHo.js +0 -72
- package/dist/components-0PErqPHo.js.map +0 -1
@@ -1,16 +1,16 @@
|
|
1
|
-
import { difference as
|
2
|
-
import { defineComponent as
|
3
|
-
import { withInstall as
|
4
|
-
import { ElForm as
|
5
|
-
import { formContextKey as
|
6
|
-
import
|
7
|
-
import { useFormItemSpan as v, useFormItemRules as V, useFormItemStringModel as z, useFormItemDisabled as
|
8
|
-
import { getSingleCodeContent as Me, getMultiCodeContent as
|
1
|
+
import { difference as oe, isEmpty as re, isDate as te, isString as A, isNumber as ne, toNumber as de } from "lodash-es";
|
2
|
+
import { defineComponent as y, useTemplateRef as Y, provide as L, reactive as j, toRef as R, openBlock as p, createBlock as h, unref as e, withCtx as d, createVNode as f, renderSlot as $, isRef as q, useAttrs as H, computed as F, createElementBlock as D, Fragment as E, renderList as I, createTextVNode as ue, toDisplayString as se, watch as ie, ref as P, onMounted as pe, normalizeStyle as me } from "vue";
|
3
|
+
import { withInstall as be } from "../_util/vue/install.js";
|
4
|
+
import { ElForm as fe, ElRow as he, ElCol as g, ElFormItem as w, ElInput as O, ElSelect as K, ElOption as J, ElRadioGroup as ce, ElRadio as ye, ElCheckboxGroup as ge, ElCheckbox as Q, ElSwitch as ve, dayjs as G, ElTimePicker as we, ElDatePicker as Ve, ElDropdown as Se, ElInputNumber as qe } from "element-plus";
|
5
|
+
import { formContextKey as Be } from "./Form.js";
|
6
|
+
import W from "../../error/OrionError.js";
|
7
|
+
import { useFormItemSpan as v, useFormItemRules as V, useFormItemStringModel as z, useFormItemDisabled as X, useFormItemCode as U, useFormItemMultiModel as Z, useFormContext as T, useFormItemBooleanModel as x } from "./hooks/index.js";
|
8
|
+
import { getSingleCodeContent as Me, getMultiCodeContent as Ce } from "./utils/index.js";
|
9
9
|
import { S as Fe } from "../../index-BbsXWo7C.js";
|
10
10
|
import { g as Oe } from "../../index-C6P_0wAy.js";
|
11
11
|
import { lovContextKey as ze } from "./LovInput/LovInput.js";
|
12
|
-
import { default as
|
13
|
-
const
|
12
|
+
import { default as dl } from "./LovInput/hooks/useLov.js";
|
13
|
+
const We = /* @__PURE__ */ y({
|
14
14
|
name: "OForm",
|
15
15
|
inheritAttrs: !1,
|
16
16
|
__name: "Form",
|
@@ -22,21 +22,21 @@ const Ce = /* @__PURE__ */ c({
|
|
22
22
|
modelValue: {}
|
23
23
|
},
|
24
24
|
emits: ["update:modelValue"],
|
25
|
-
setup(t, { expose:
|
26
|
-
const o =
|
25
|
+
setup(t, { expose: i, emit: u }) {
|
26
|
+
const o = u, l = (r, m) => {
|
27
27
|
if (!Object.keys(t.modelValue).includes(r))
|
28
|
-
throw new
|
29
|
-
o("update:modelValue", { ...t.modelValue, [r]:
|
28
|
+
throw new W(`modelValue中不存在[${r}]`);
|
29
|
+
o("update:modelValue", { ...t.modelValue, [r]: m });
|
30
30
|
}, a = (r) => {
|
31
|
-
const
|
32
|
-
if (!
|
33
|
-
throw new
|
31
|
+
const m = Object.keys(t.modelValue), c = Object.keys(r), S = oe(c, m);
|
32
|
+
if (!re(S))
|
33
|
+
throw new W(`modelValue中不存在[${S.join(",")}]`);
|
34
34
|
o("update:modelValue", { ...t.modelValue, ...r });
|
35
|
-
},
|
36
|
-
return
|
37
|
-
validate: async () => await
|
38
|
-
}),
|
39
|
-
|
35
|
+
}, n = Y("form");
|
36
|
+
return i({
|
37
|
+
validate: async () => await n.value.validate()
|
38
|
+
}), L(
|
39
|
+
Be,
|
40
40
|
j({
|
41
41
|
modelValue: R(() => t.modelValue),
|
42
42
|
updateModelValue: l,
|
@@ -45,7 +45,7 @@ const Ce = /* @__PURE__ */ c({
|
|
45
45
|
itemSpan: R(() => t.itemSpan),
|
46
46
|
disabled: R(() => t.disabled)
|
47
47
|
})
|
48
|
-
), (r,
|
48
|
+
), (r, m) => (p(), h(e(fe), {
|
49
49
|
ref: "form",
|
50
50
|
model: r.modelValue,
|
51
51
|
rules: r.rules,
|
@@ -53,7 +53,7 @@ const Ce = /* @__PURE__ */ c({
|
|
53
53
|
disabled: r.disabled
|
54
54
|
}, {
|
55
55
|
default: d(() => [
|
56
|
-
|
56
|
+
f(e(he), { gutter: 16 }, {
|
57
57
|
default: d(() => [
|
58
58
|
$(r.$slots, "default")
|
59
59
|
]),
|
@@ -63,7 +63,7 @@ const Ce = /* @__PURE__ */ c({
|
|
63
63
|
_: 3
|
64
64
|
}, 8, ["model", "rules", "label-width", "disabled"]));
|
65
65
|
}
|
66
|
-
}),
|
66
|
+
}), ke = /* @__PURE__ */ y({
|
67
67
|
name: "OFormString",
|
68
68
|
inheritAttrs: !1,
|
69
69
|
__name: "StringInput",
|
@@ -80,20 +80,20 @@ const Ce = /* @__PURE__ */ c({
|
|
80
80
|
readonly: { type: Boolean }
|
81
81
|
},
|
82
82
|
setup(t) {
|
83
|
-
const
|
84
|
-
return (l, a) => (p(),
|
83
|
+
const i = v(), u = V(), o = z();
|
84
|
+
return (l, a) => (p(), h(e(g), { span: e(i) }, {
|
85
85
|
default: d(() => [
|
86
|
-
|
86
|
+
f(e(w), {
|
87
87
|
prop: l.name,
|
88
88
|
label: l.label,
|
89
89
|
"label-width": l.labelWidth,
|
90
90
|
required: l.required,
|
91
|
-
rules: e(
|
91
|
+
rules: e(u)
|
92
92
|
}, {
|
93
93
|
default: d(() => [
|
94
|
-
|
94
|
+
f(e(O), {
|
95
95
|
modelValue: e(o),
|
96
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
96
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
|
97
97
|
maxlength: l.maxlength,
|
98
98
|
placeholder: l.placeholder,
|
99
99
|
disabled: l.disabled,
|
@@ -106,7 +106,7 @@ const Ce = /* @__PURE__ */ c({
|
|
106
106
|
_: 1
|
107
107
|
}, 8, ["span"]));
|
108
108
|
}
|
109
|
-
}),
|
109
|
+
}), Re = /* @__PURE__ */ y({
|
110
110
|
name: "OFormPassword",
|
111
111
|
inheritAttrs: !1,
|
112
112
|
__name: "PasswordInput",
|
@@ -123,20 +123,20 @@ const Ce = /* @__PURE__ */ c({
|
|
123
123
|
readonly: { type: Boolean }
|
124
124
|
},
|
125
125
|
setup(t) {
|
126
|
-
const
|
127
|
-
return (l, a) => (p(),
|
126
|
+
const i = v(), u = V(), o = z();
|
127
|
+
return (l, a) => (p(), h(e(g), { span: e(i) }, {
|
128
128
|
default: d(() => [
|
129
|
-
|
129
|
+
f(e(w), {
|
130
130
|
prop: l.name,
|
131
131
|
label: l.label,
|
132
132
|
"label-width": l.labelWidth,
|
133
133
|
required: l.required,
|
134
|
-
rules: e(
|
134
|
+
rules: e(u)
|
135
135
|
}, {
|
136
136
|
default: d(() => [
|
137
|
-
|
137
|
+
f(e(O), {
|
138
138
|
modelValue: e(o),
|
139
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
139
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
|
140
140
|
maxlength: l.maxlength,
|
141
141
|
placeholder: l.placeholder,
|
142
142
|
disabled: l.disabled,
|
@@ -150,7 +150,7 @@ const Ce = /* @__PURE__ */ c({
|
|
150
150
|
_: 1
|
151
151
|
}, 8, ["span"]));
|
152
152
|
}
|
153
|
-
}),
|
153
|
+
}), Ae = /* @__PURE__ */ y({
|
154
154
|
name: "OFormTextarea",
|
155
155
|
inheritAttrs: !1,
|
156
156
|
__name: "Textarea",
|
@@ -168,20 +168,20 @@ const Ce = /* @__PURE__ */ c({
|
|
168
168
|
rows: {}
|
169
169
|
},
|
170
170
|
setup(t) {
|
171
|
-
const
|
172
|
-
return (l, a) => (p(),
|
171
|
+
const i = v(), u = V(), o = z();
|
172
|
+
return (l, a) => (p(), h(e(g), { span: e(i) }, {
|
173
173
|
default: d(() => [
|
174
|
-
|
174
|
+
f(e(w), {
|
175
175
|
prop: l.name,
|
176
176
|
label: l.label,
|
177
177
|
"label-width": l.labelWidth,
|
178
178
|
required: l.required,
|
179
|
-
rules: e(
|
179
|
+
rules: e(u)
|
180
180
|
}, {
|
181
181
|
default: d(() => [
|
182
|
-
|
182
|
+
f(e(O), {
|
183
183
|
modelValue: e(o),
|
184
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
184
|
+
"onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
|
185
185
|
maxlength: l.maxlength,
|
186
186
|
placeholder: l.placeholder,
|
187
187
|
disabled: l.disabled,
|
@@ -197,7 +197,7 @@ const Ce = /* @__PURE__ */ c({
|
|
197
197
|
_: 1
|
198
198
|
}, 8, ["span"]));
|
199
199
|
}
|
200
|
-
}),
|
200
|
+
}), $e = /* @__PURE__ */ y({
|
201
201
|
name: "OFormSingleselect",
|
202
202
|
inheritAttrs: !1,
|
203
203
|
__name: "SingleSelect",
|
@@ -215,40 +215,41 @@ const Ce = /* @__PURE__ */ c({
|
|
215
215
|
filterable: { type: Boolean }
|
216
216
|
},
|
217
217
|
setup(t) {
|
218
|
-
const
|
219
|
-
return (
|
218
|
+
const i = H(), u = v(), o = V(), l = X(), a = U(), n = z(), s = F(() => Me(a.value, n.value));
|
219
|
+
return (r, m) => (p(), h(e(g), { span: e(u) }, {
|
220
220
|
default: d(() => [
|
221
|
-
|
222
|
-
prop:
|
223
|
-
label:
|
224
|
-
"label-width":
|
225
|
-
required:
|
226
|
-
rules: e(
|
221
|
+
f(e(w), {
|
222
|
+
prop: r.name,
|
223
|
+
label: r.label,
|
224
|
+
"label-width": r.labelWidth,
|
225
|
+
required: r.required,
|
226
|
+
rules: e(o)
|
227
227
|
}, {
|
228
228
|
default: d(() => [
|
229
|
-
e(
|
229
|
+
e(l) ? (p(), h(e(O), {
|
230
230
|
key: 0,
|
231
|
-
"model-value":
|
232
|
-
placeholder:
|
231
|
+
"model-value": s.value,
|
232
|
+
placeholder: r.placeholder,
|
233
233
|
disabled: !0,
|
234
234
|
readonly: !0
|
235
|
-
}, null, 8, ["model-value", "placeholder"])) : (p(),
|
235
|
+
}, null, 8, ["model-value", "placeholder"])) : (p(), h(e(K), {
|
236
236
|
key: 1,
|
237
|
-
modelValue: e(
|
238
|
-
"onUpdate:modelValue":
|
239
|
-
placeholder:
|
240
|
-
clearable:
|
241
|
-
filterable:
|
237
|
+
modelValue: e(n),
|
238
|
+
"onUpdate:modelValue": m[0] || (m[0] = (c) => q(n) ? n.value = c : null),
|
239
|
+
placeholder: r.placeholder,
|
240
|
+
clearable: r.clearable,
|
241
|
+
filterable: r.filterable,
|
242
|
+
onChange: e(i).onChange
|
242
243
|
}, {
|
243
244
|
default: d(() => [
|
244
|
-
(p(!0), D(E, null, I(e(
|
245
|
-
key:
|
246
|
-
label:
|
247
|
-
value:
|
245
|
+
(p(!0), D(E, null, I(e(a), (c) => (p(), h(e(J), {
|
246
|
+
key: c.value,
|
247
|
+
label: c.content,
|
248
|
+
value: c.value
|
248
249
|
}, null, 8, ["label", "value"]))), 128))
|
249
250
|
]),
|
250
251
|
_: 1
|
251
|
-
}, 8, ["modelValue", "placeholder", "clearable", "filterable"]))
|
252
|
+
}, 8, ["modelValue", "placeholder", "clearable", "filterable", "onChange"]))
|
252
253
|
]),
|
253
254
|
_: 1
|
254
255
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -256,7 +257,7 @@ const Ce = /* @__PURE__ */ c({
|
|
256
257
|
_: 1
|
257
258
|
}, 8, ["span"]));
|
258
259
|
}
|
259
|
-
}),
|
260
|
+
}), De = /* @__PURE__ */ y({
|
260
261
|
name: "OFormMultiselect",
|
261
262
|
inheritAttrs: !1,
|
262
263
|
__name: "MultiSelect",
|
@@ -269,42 +270,47 @@ const Ce = /* @__PURE__ */ c({
|
|
269
270
|
rules: {},
|
270
271
|
placeholder: {},
|
271
272
|
disabled: { type: Boolean },
|
272
|
-
code: {}
|
273
|
+
code: {},
|
274
|
+
collapseTags: { type: Boolean },
|
275
|
+
collapseTagsTooltip: { type: Boolean }
|
273
276
|
},
|
274
277
|
setup(t) {
|
275
|
-
const
|
276
|
-
return (
|
278
|
+
const i = H(), u = v(), o = V(), l = X(), a = U(), n = Z(), s = T(), r = F(() => Ce(a.value, s.modelValue[t.name]));
|
279
|
+
return (m, c) => (p(), h(e(g), { span: e(u) }, {
|
277
280
|
default: d(() => [
|
278
|
-
|
279
|
-
prop:
|
280
|
-
label:
|
281
|
-
"label-width":
|
282
|
-
required:
|
283
|
-
rules: e(
|
281
|
+
f(e(w), {
|
282
|
+
prop: m.name,
|
283
|
+
label: m.label,
|
284
|
+
"label-width": m.labelWidth,
|
285
|
+
required: m.required,
|
286
|
+
rules: e(o)
|
284
287
|
}, {
|
285
288
|
default: d(() => [
|
286
|
-
e(
|
289
|
+
e(l) ? (p(), h(e(O), {
|
287
290
|
key: 0,
|
288
|
-
"model-value":
|
289
|
-
placeholder:
|
291
|
+
"model-value": r.value,
|
292
|
+
placeholder: m.placeholder,
|
290
293
|
disabled: !0,
|
291
294
|
readonly: !0
|
292
|
-
}, null, 8, ["model-value", "placeholder"])) : (p(),
|
295
|
+
}, null, 8, ["model-value", "placeholder"])) : (p(), h(e(K), {
|
293
296
|
key: 1,
|
294
|
-
modelValue: e(
|
295
|
-
"onUpdate:modelValue":
|
296
|
-
placeholder:
|
297
|
-
multiple: ""
|
297
|
+
modelValue: e(n),
|
298
|
+
"onUpdate:modelValue": c[0] || (c[0] = (S) => q(n) ? n.value = S : null),
|
299
|
+
placeholder: m.placeholder,
|
300
|
+
multiple: "",
|
301
|
+
"collapse-tags": m.collapseTags,
|
302
|
+
"collapse-tags-tooltip": m.collapseTagsTooltip,
|
303
|
+
onChange: e(i).onChange
|
298
304
|
}, {
|
299
305
|
default: d(() => [
|
300
|
-
(p(!0), D(E, null, I(e(
|
301
|
-
key:
|
302
|
-
label:
|
303
|
-
value:
|
306
|
+
(p(!0), D(E, null, I(e(a), (S) => (p(), h(e(J), {
|
307
|
+
key: S.value,
|
308
|
+
label: S.content,
|
309
|
+
value: S.value
|
304
310
|
}, null, 8, ["label", "value"]))), 128))
|
305
311
|
]),
|
306
312
|
_: 1
|
307
|
-
}, 8, ["modelValue", "placeholder"]))
|
313
|
+
}, 8, ["modelValue", "placeholder", "collapse-tags", "collapse-tags-tooltip", "onChange"]))
|
308
314
|
]),
|
309
315
|
_: 1
|
310
316
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -312,7 +318,7 @@ const Ce = /* @__PURE__ */ c({
|
|
312
318
|
_: 1
|
313
319
|
}, 8, ["span"]));
|
314
320
|
}
|
315
|
-
}),
|
321
|
+
}), Ee = /* @__PURE__ */ y({
|
316
322
|
name: "OFormRadiogroup",
|
317
323
|
inheritAttrs: !1,
|
318
324
|
__name: "RadioGroup",
|
@@ -327,29 +333,29 @@ const Ce = /* @__PURE__ */ c({
|
|
327
333
|
code: {}
|
328
334
|
},
|
329
335
|
setup(t) {
|
330
|
-
const
|
331
|
-
return (a,
|
336
|
+
const i = v(), u = V(), o = U(), l = z();
|
337
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
332
338
|
default: d(() => [
|
333
|
-
|
339
|
+
f(e(w), {
|
334
340
|
prop: a.name,
|
335
341
|
label: a.label,
|
336
342
|
"label-width": a.labelWidth,
|
337
343
|
required: a.required,
|
338
|
-
rules: e(
|
344
|
+
rules: e(u)
|
339
345
|
}, {
|
340
346
|
default: d(() => [
|
341
|
-
|
347
|
+
f(e(ce), {
|
342
348
|
modelValue: e(l),
|
343
|
-
"onUpdate:modelValue":
|
349
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
|
344
350
|
disabled: a.disabled
|
345
351
|
}, {
|
346
352
|
default: d(() => [
|
347
|
-
(p(!0), D(E, null, I(e(o), (
|
348
|
-
key:
|
349
|
-
value:
|
353
|
+
(p(!0), D(E, null, I(e(o), (s) => (p(), h(e(ye), {
|
354
|
+
key: s.value,
|
355
|
+
value: s.value
|
350
356
|
}, {
|
351
357
|
default: d(() => [
|
352
|
-
|
358
|
+
ue(se(s.content), 1)
|
353
359
|
]),
|
354
360
|
_: 2
|
355
361
|
}, 1032, ["value"]))), 128))
|
@@ -363,7 +369,7 @@ const Ce = /* @__PURE__ */ c({
|
|
363
369
|
_: 1
|
364
370
|
}, 8, ["span"]));
|
365
371
|
}
|
366
|
-
}),
|
372
|
+
}), Ie = /* @__PURE__ */ y({
|
367
373
|
name: "OFormCheckboxgroup",
|
368
374
|
inheritAttrs: !1,
|
369
375
|
__name: "CheckboxGroup",
|
@@ -378,27 +384,27 @@ const Ce = /* @__PURE__ */ c({
|
|
378
384
|
code: {}
|
379
385
|
},
|
380
386
|
setup(t) {
|
381
|
-
const
|
382
|
-
return (a,
|
387
|
+
const i = v(), u = V(), o = U(), l = Z();
|
388
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
383
389
|
default: d(() => [
|
384
|
-
|
390
|
+
f(e(w), {
|
385
391
|
prop: a.name,
|
386
392
|
label: a.label,
|
387
393
|
"label-width": a.labelWidth,
|
388
394
|
required: a.required,
|
389
|
-
rules: e(
|
395
|
+
rules: e(u)
|
390
396
|
}, {
|
391
397
|
default: d(() => [
|
392
|
-
|
398
|
+
f(e(ge), {
|
393
399
|
modelValue: e(l),
|
394
|
-
"onUpdate:modelValue":
|
400
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
|
395
401
|
disabled: a.disabled
|
396
402
|
}, {
|
397
403
|
default: d(() => [
|
398
|
-
(p(!0), D(E, null, I(e(o), (
|
399
|
-
key:
|
400
|
-
label:
|
401
|
-
value:
|
404
|
+
(p(!0), D(E, null, I(e(o), (s) => (p(), h(e(Q), {
|
405
|
+
key: s.value,
|
406
|
+
label: s.content,
|
407
|
+
value: s.value
|
402
408
|
}, null, 8, ["label", "value"]))), 128))
|
403
409
|
]),
|
404
410
|
_: 1
|
@@ -410,7 +416,7 @@ const Ce = /* @__PURE__ */ c({
|
|
410
416
|
_: 1
|
411
417
|
}, 8, ["span"]));
|
412
418
|
}
|
413
|
-
}),
|
419
|
+
}), Ue = /* @__PURE__ */ y({
|
414
420
|
name: "OFormCheckbox",
|
415
421
|
inheritAttrs: !1,
|
416
422
|
__name: "Checkbox",
|
@@ -423,19 +429,19 @@ const Ce = /* @__PURE__ */ c({
|
|
423
429
|
disabled: { type: Boolean }
|
424
430
|
},
|
425
431
|
setup(t) {
|
426
|
-
const
|
427
|
-
return (o, l) => (p(),
|
432
|
+
const i = v(), u = x();
|
433
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
428
434
|
default: d(() => [
|
429
|
-
|
435
|
+
f(e(w), {
|
430
436
|
prop: o.name,
|
431
437
|
label: o.label,
|
432
438
|
"label-width": o.labelWidth,
|
433
439
|
rules: o.rules
|
434
440
|
}, {
|
435
441
|
default: d(() => [
|
436
|
-
|
437
|
-
modelValue: e(
|
438
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
442
|
+
f(e(Q), {
|
443
|
+
modelValue: e(u),
|
444
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
|
439
445
|
disabled: o.disabled
|
440
446
|
}, null, 8, ["modelValue", "disabled"])
|
441
447
|
]),
|
@@ -445,7 +451,7 @@ const Ce = /* @__PURE__ */ c({
|
|
445
451
|
_: 1
|
446
452
|
}, 8, ["span"]));
|
447
453
|
}
|
448
|
-
}),
|
454
|
+
}), Te = /* @__PURE__ */ y({
|
449
455
|
name: "OFormSwitch",
|
450
456
|
inheritAttrs: !1,
|
451
457
|
__name: "Switch",
|
@@ -458,19 +464,19 @@ const Ce = /* @__PURE__ */ c({
|
|
458
464
|
disabled: { type: Boolean }
|
459
465
|
},
|
460
466
|
setup(t) {
|
461
|
-
const
|
462
|
-
return (o, l) => (p(),
|
467
|
+
const i = v(), u = x();
|
468
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
463
469
|
default: d(() => [
|
464
|
-
|
470
|
+
f(e(w), {
|
465
471
|
prop: o.name,
|
466
472
|
label: o.label,
|
467
473
|
"label-width": o.labelWidth,
|
468
474
|
rules: o.rules
|
469
475
|
}, {
|
470
476
|
default: d(() => [
|
471
|
-
|
472
|
-
modelValue: e(
|
473
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
477
|
+
f(e(ve), {
|
478
|
+
modelValue: e(u),
|
479
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
|
474
480
|
disabled: o.disabled
|
475
481
|
}, null, 8, ["modelValue", "disabled"])
|
476
482
|
]),
|
@@ -480,7 +486,7 @@ const Ce = /* @__PURE__ */ c({
|
|
480
486
|
_: 1
|
481
487
|
}, 8, ["span"]));
|
482
488
|
}
|
483
|
-
}), Ne = /* @__PURE__ */
|
489
|
+
}), Ne = /* @__PURE__ */ y({
|
484
490
|
name: "OFormDate",
|
485
491
|
inheritAttrs: !1,
|
486
492
|
__name: "DateInput",
|
@@ -501,42 +507,42 @@ const Ce = /* @__PURE__ */ c({
|
|
501
507
|
sourceFormat: {}
|
502
508
|
},
|
503
509
|
setup(t) {
|
504
|
-
const
|
510
|
+
const i = v(), u = V(), o = F(() => t.format.startsWith("H") || t.format.startsWith("h") || t.format.startsWith("m") || t.format.startsWith("s")), l = F(() => t.sourceFormat ? t.sourceFormat : o.value ? "HH:mm:ss" : "YYYY-MM-DD"), a = F(() => {
|
505
511
|
let r = "date";
|
506
512
|
return (t.format.indexOf("y") > -1 || t.format.indexOf("Y") > -1) && (r = "year"), t.format.indexOf("M") > -1 && (r = "month"), (t.format.indexOf("d") > -1 || t.format.indexOf("D") > -1) && (r = "date"), (t.format.indexOf("H") > -1 || t.format.indexOf("h") > -1 || t.format.indexOf("k") > -1 || t.format.indexOf("m") > -1 || t.format.indexOf("s") > -1 || t.format.indexOf("S") > -1) && (r = "datetime"), r;
|
507
|
-
}),
|
513
|
+
}), n = T(), s = F({
|
508
514
|
get: () => {
|
509
|
-
const r =
|
515
|
+
const r = n.modelValue[t.name];
|
510
516
|
if (r) {
|
511
|
-
if (
|
517
|
+
if (te(r))
|
512
518
|
return r;
|
513
519
|
if (A(r)) {
|
514
|
-
const
|
515
|
-
if (!
|
516
|
-
throw new
|
517
|
-
return
|
520
|
+
const m = G(r, l.value, !0);
|
521
|
+
if (!m.isValid())
|
522
|
+
throw new W(`日期输入框的值无效,不符合${l.value}格式`);
|
523
|
+
return m.toDate();
|
518
524
|
} else
|
519
|
-
throw new
|
525
|
+
throw new W("日期输入框的值只能为字符串或日期类型");
|
520
526
|
}
|
521
527
|
},
|
522
528
|
set: (r) => {
|
523
|
-
t.sourceFormat ? r ?
|
529
|
+
t.sourceFormat ? r ? n.updateModelValue(t.name, G(r).format(l.value)) : n.updateModelValue(t.name, "") : r ? n.updateModelValue(t.name, r) : n.updateModelValue(t.name, void 0);
|
524
530
|
}
|
525
531
|
});
|
526
|
-
return (r,
|
532
|
+
return (r, m) => (p(), h(e(g), { span: e(i) }, {
|
527
533
|
default: d(() => [
|
528
|
-
|
534
|
+
f(e(w), {
|
529
535
|
prop: r.name,
|
530
536
|
label: r.label,
|
531
537
|
"label-width": r.labelWidth,
|
532
538
|
required: r.required,
|
533
|
-
rules: e(
|
539
|
+
rules: e(u)
|
534
540
|
}, {
|
535
541
|
default: d(() => [
|
536
|
-
o.value ? (p(),
|
542
|
+
o.value ? (p(), h(e(we), {
|
537
543
|
key: 0,
|
538
|
-
modelValue:
|
539
|
-
"onUpdate:modelValue":
|
544
|
+
modelValue: s.value,
|
545
|
+
"onUpdate:modelValue": m[0] || (m[0] = (c) => s.value = c),
|
540
546
|
placeholder: r.placeholder,
|
541
547
|
disabled: r.disabled,
|
542
548
|
readonly: r.readonly,
|
@@ -545,10 +551,10 @@ const Ce = /* @__PURE__ */ c({
|
|
545
551
|
format: l.value,
|
546
552
|
"arrow-control": "",
|
547
553
|
style: { width: "100%" }
|
548
|
-
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(),
|
554
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(), h(e(Ve), {
|
549
555
|
key: 1,
|
550
|
-
modelValue:
|
551
|
-
"onUpdate:modelValue":
|
556
|
+
modelValue: s.value,
|
557
|
+
"onUpdate:modelValue": m[1] || (m[1] = (c) => s.value = c),
|
552
558
|
placeholder: r.placeholder,
|
553
559
|
disabled: r.disabled,
|
554
560
|
readonly: r.readonly,
|
@@ -565,7 +571,7 @@ const Ce = /* @__PURE__ */ c({
|
|
565
571
|
_: 1
|
566
572
|
}, 8, ["span"]));
|
567
573
|
}
|
568
|
-
}), Pe = /* @__PURE__ */
|
574
|
+
}), Pe = /* @__PURE__ */ y({
|
569
575
|
name: "OFormFile",
|
570
576
|
inheritAttrs: !1,
|
571
577
|
__name: "FileInput",
|
@@ -579,31 +585,31 @@ const Ce = /* @__PURE__ */ c({
|
|
579
585
|
disabled: { type: Boolean }
|
580
586
|
},
|
581
587
|
setup(t) {
|
582
|
-
const
|
588
|
+
const i = v(), u = V(), o = z();
|
583
589
|
ie(o, () => {
|
584
590
|
o.value || (l.value = "");
|
585
591
|
});
|
586
|
-
const l =
|
587
|
-
return
|
588
|
-
a.value.input.onchange = (
|
589
|
-
var
|
590
|
-
o.value = (
|
592
|
+
const l = P(""), a = Y("inputRef");
|
593
|
+
return pe(() => {
|
594
|
+
a.value.input.onchange = (n) => {
|
595
|
+
var s;
|
596
|
+
o.value = (s = n == null ? void 0 : n.target) == null ? void 0 : s.files[0];
|
591
597
|
}, l.value = "";
|
592
|
-
}), (
|
598
|
+
}), (n, s) => (p(), h(e(g), { span: e(i) }, {
|
593
599
|
default: d(() => [
|
594
|
-
|
595
|
-
prop:
|
596
|
-
label:
|
597
|
-
"label-width":
|
598
|
-
required:
|
599
|
-
rules: e(
|
600
|
+
f(e(w), {
|
601
|
+
prop: n.name,
|
602
|
+
label: n.label,
|
603
|
+
"label-width": n.labelWidth,
|
604
|
+
required: n.required,
|
605
|
+
rules: e(u)
|
600
606
|
}, {
|
601
607
|
default: d(() => [
|
602
|
-
|
608
|
+
f(e(O), {
|
603
609
|
ref: "inputRef",
|
604
610
|
modelValue: l.value,
|
605
|
-
"onUpdate:modelValue":
|
606
|
-
disabled:
|
611
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
|
612
|
+
disabled: n.disabled,
|
607
613
|
type: "file",
|
608
614
|
"validate-event": !1
|
609
615
|
}, null, 8, ["modelValue", "disabled"])
|
@@ -614,7 +620,7 @@ const Ce = /* @__PURE__ */ c({
|
|
614
620
|
_: 1
|
615
621
|
}, 8, ["span"]));
|
616
622
|
}
|
617
|
-
}), Ye = /* @__PURE__ */
|
623
|
+
}), Ye = /* @__PURE__ */ y({
|
618
624
|
name: "OFormButtongroup",
|
619
625
|
inheritAttrs: !1,
|
620
626
|
__name: "ButtonGroup",
|
@@ -624,15 +630,15 @@ const Ce = /* @__PURE__ */ c({
|
|
624
630
|
align: { default: "right" }
|
625
631
|
},
|
626
632
|
setup(t) {
|
627
|
-
const
|
633
|
+
const i = F(() => ({
|
628
634
|
textAlign: t.align
|
629
|
-
})),
|
630
|
-
return (o, l) => (p(),
|
631
|
-
span: e(
|
632
|
-
style:
|
635
|
+
})), u = v();
|
636
|
+
return (o, l) => (p(), h(e(g), {
|
637
|
+
span: e(u),
|
638
|
+
style: me(i.value)
|
633
639
|
}, {
|
634
640
|
default: d(() => [
|
635
|
-
|
641
|
+
f(e(Fe), {
|
636
642
|
gutter: o.gutter,
|
637
643
|
style: { "margin-bottom": "18px" }
|
638
644
|
}, {
|
@@ -645,7 +651,7 @@ const Ce = /* @__PURE__ */ c({
|
|
645
651
|
_: 3
|
646
652
|
}, 8, ["span", "style"]));
|
647
653
|
}
|
648
|
-
}), Ge = /* @__PURE__ */
|
654
|
+
}), Ge = /* @__PURE__ */ y({
|
649
655
|
name: "OFormDiy",
|
650
656
|
inheritAttrs: !1,
|
651
657
|
__name: "DiyItem",
|
@@ -658,15 +664,15 @@ const Ce = /* @__PURE__ */ c({
|
|
658
664
|
rules: {}
|
659
665
|
},
|
660
666
|
setup(t) {
|
661
|
-
const
|
662
|
-
return (o, l) => (p(),
|
667
|
+
const i = v(), u = V();
|
668
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
663
669
|
default: d(() => [
|
664
|
-
|
670
|
+
f(e(w), {
|
665
671
|
prop: o.name,
|
666
672
|
label: o.label,
|
667
673
|
"label-width": o.labelWidth,
|
668
674
|
required: o.required,
|
669
|
-
rules: e(
|
675
|
+
rules: e(u)
|
670
676
|
}, {
|
671
677
|
default: d(() => [
|
672
678
|
$(o.$slots, "default")
|
@@ -677,7 +683,7 @@ const Ce = /* @__PURE__ */ c({
|
|
677
683
|
_: 3
|
678
684
|
}, 8, ["span"]));
|
679
685
|
}
|
680
|
-
}), Le = /* @__PURE__ */
|
686
|
+
}), Le = /* @__PURE__ */ y({
|
681
687
|
name: "OFormLov",
|
682
688
|
inheritAttrs: !1,
|
683
689
|
__name: "LovInput",
|
@@ -695,77 +701,77 @@ const Ce = /* @__PURE__ */ c({
|
|
695
701
|
fillMapping: { type: [String, Function] }
|
696
702
|
},
|
697
703
|
setup(t) {
|
698
|
-
const
|
699
|
-
a.value =
|
700
|
-
},
|
701
|
-
var
|
702
|
-
|
704
|
+
const i = v(), u = V(), o = z(), l = T(), a = P(!1), n = (b) => {
|
705
|
+
a.value = b;
|
706
|
+
}, s = P(!1), r = () => {
|
707
|
+
var b;
|
708
|
+
s.value || (s.value = !0), a.value || (b = N.value) == null || b.handleOpen();
|
703
709
|
};
|
704
|
-
let
|
705
|
-
const
|
706
|
-
|
707
|
-
},
|
708
|
-
var
|
709
|
-
["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Space"].indexOf(
|
710
|
-
},
|
711
|
-
if (
|
712
|
-
const
|
713
|
-
for (let M = 0; M <
|
714
|
-
const
|
715
|
-
|
710
|
+
let m;
|
711
|
+
const c = (b) => {
|
712
|
+
m = b;
|
713
|
+
}, S = (b) => {
|
714
|
+
var C;
|
715
|
+
["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Space"].indexOf(b.code) > -1 && (a.value && m && m(b.code), b.stopPropagation()), ["ArrowUp", "ArrowDown"].indexOf(b.code) > -1 && !a.value && ((C = N.value) == null || C.handleOpen());
|
716
|
+
}, _ = () => {
|
717
|
+
if (s.value && A(t.fillMapping)) {
|
718
|
+
const b = {}, B = t.fillMapping.split(",");
|
719
|
+
for (let M = 0; M < B.length; M++) {
|
720
|
+
const C = B[M].split(":")[0].trim();
|
721
|
+
b[C] = void 0;
|
716
722
|
}
|
717
|
-
l.updateModelValueMulti(
|
723
|
+
l.updateModelValueMulti(b);
|
718
724
|
}
|
719
|
-
},
|
720
|
-
return
|
725
|
+
}, N = Y("dropdown");
|
726
|
+
return L(
|
721
727
|
ze,
|
722
728
|
j({
|
723
729
|
lovValue: o,
|
724
|
-
backfill: (
|
725
|
-
var
|
726
|
-
if ((
|
727
|
-
const M = {},
|
728
|
-
for (let k = 0; k <
|
729
|
-
const
|
730
|
-
M[
|
730
|
+
backfill: (b) => {
|
731
|
+
var B;
|
732
|
+
if ((B = N.value) == null || B.handleClose(), A(t.fillMapping)) {
|
733
|
+
const M = {}, C = t.fillMapping.split(",");
|
734
|
+
for (let k = 0; k < C.length; k++) {
|
735
|
+
const ee = C[k].split(":")[0].trim(), le = C[k].split(":")[1].trim(), ae = b[le];
|
736
|
+
M[ee] = ae;
|
731
737
|
}
|
732
738
|
l.updateModelValueMulti(M);
|
733
739
|
} else
|
734
|
-
t.fillMapping && t.fillMapping(
|
735
|
-
|
740
|
+
t.fillMapping && t.fillMapping(b);
|
741
|
+
s.value && (s.value = !1);
|
736
742
|
},
|
737
|
-
registerKeydownHandler:
|
743
|
+
registerKeydownHandler: c
|
738
744
|
})
|
739
|
-
), (
|
745
|
+
), (b, B) => (p(), h(e(g), { span: e(i) }, {
|
740
746
|
default: d(() => [
|
741
|
-
|
742
|
-
prop:
|
743
|
-
label:
|
744
|
-
"label-width":
|
745
|
-
required:
|
746
|
-
rules: e(
|
747
|
+
f(e(w), {
|
748
|
+
prop: b.name,
|
749
|
+
label: b.label,
|
750
|
+
"label-width": b.labelWidth,
|
751
|
+
required: b.required,
|
752
|
+
rules: e(u)
|
747
753
|
}, {
|
748
754
|
default: d(() => [
|
749
|
-
|
755
|
+
f(e(Se), {
|
750
756
|
ref: "dropdown",
|
751
757
|
trigger: "click",
|
752
|
-
onVisibleChange:
|
758
|
+
onVisibleChange: n,
|
753
759
|
style: { width: "100%" }
|
754
760
|
}, {
|
755
761
|
dropdown: d(() => [
|
756
|
-
$(
|
762
|
+
$(b.$slots, "default")
|
757
763
|
]),
|
758
764
|
default: d(() => [
|
759
|
-
|
765
|
+
f(e(O), {
|
760
766
|
modelValue: e(o),
|
761
|
-
"onUpdate:modelValue":
|
762
|
-
maxlength:
|
763
|
-
placeholder:
|
764
|
-
disabled:
|
765
|
-
readonly:
|
767
|
+
"onUpdate:modelValue": B[0] || (B[0] = (M) => q(o) ? o.value = M : null),
|
768
|
+
maxlength: b.maxlength,
|
769
|
+
placeholder: b.placeholder,
|
770
|
+
disabled: b.disabled,
|
771
|
+
readonly: b.readonly,
|
766
772
|
onInput: r,
|
767
|
-
onKeydown:
|
768
|
-
onChange:
|
773
|
+
onKeydown: S,
|
774
|
+
onChange: _,
|
769
775
|
"suffix-icon": e(Oe)
|
770
776
|
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "suffix-icon"])
|
771
777
|
]),
|
@@ -778,7 +784,7 @@ const Ce = /* @__PURE__ */ c({
|
|
778
784
|
_: 3
|
779
785
|
}, 8, ["span"]));
|
780
786
|
}
|
781
|
-
}),
|
787
|
+
}), je = /* @__PURE__ */ y({
|
782
788
|
name: "OFormNumber",
|
783
789
|
inheritAttrs: !1,
|
784
790
|
__name: "NumberInput",
|
@@ -801,34 +807,34 @@ const Ce = /* @__PURE__ */ c({
|
|
801
807
|
controlsPosition: {}
|
802
808
|
},
|
803
809
|
setup(t) {
|
804
|
-
const
|
810
|
+
const i = v(), u = V(), o = T(), l = F({
|
805
811
|
get: () => {
|
806
812
|
const a = o.modelValue[t.name];
|
807
813
|
if (a) {
|
808
|
-
if (
|
814
|
+
if (ne(a))
|
809
815
|
return a;
|
810
816
|
if (A(a))
|
811
|
-
return
|
812
|
-
throw new
|
817
|
+
return de(a);
|
818
|
+
throw new W("数字输入框的值只能为字符串或数字类型");
|
813
819
|
}
|
814
820
|
},
|
815
821
|
set: (a) => {
|
816
822
|
a ? o.updateModelValue(t.name, a) : o.updateModelValue(t.name, void 0);
|
817
823
|
}
|
818
824
|
});
|
819
|
-
return (a,
|
825
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
820
826
|
default: d(() => [
|
821
|
-
|
827
|
+
f(e(w), {
|
822
828
|
prop: a.name,
|
823
829
|
label: a.label,
|
824
830
|
"label-width": a.labelWidth,
|
825
831
|
required: a.required,
|
826
|
-
rules: e(
|
832
|
+
rules: e(u)
|
827
833
|
}, {
|
828
834
|
default: d(() => [
|
829
|
-
|
835
|
+
f(e(qe), {
|
830
836
|
modelValue: l.value,
|
831
|
-
"onUpdate:modelValue":
|
837
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => l.value = s),
|
832
838
|
placeholder: a.placeholder,
|
833
839
|
disabled: a.disabled,
|
834
840
|
readonly: a.readonly,
|
@@ -848,27 +854,27 @@ const Ce = /* @__PURE__ */ c({
|
|
848
854
|
_: 1
|
849
855
|
}, 8, ["span"]));
|
850
856
|
}
|
851
|
-
}),
|
852
|
-
StringInput:
|
853
|
-
PasswordInput:
|
854
|
-
Textarea:
|
855
|
-
SingleSelect:
|
856
|
-
MultiSelect:
|
857
|
-
RadioGroup:
|
858
|
-
CheckboxGroup:
|
859
|
-
Checkbox:
|
860
|
-
Switch:
|
857
|
+
}), rl = be(We, {
|
858
|
+
StringInput: ke,
|
859
|
+
PasswordInput: Re,
|
860
|
+
Textarea: Ae,
|
861
|
+
SingleSelect: $e,
|
862
|
+
MultiSelect: De,
|
863
|
+
RadioGroup: Ee,
|
864
|
+
CheckboxGroup: Ie,
|
865
|
+
Checkbox: Ue,
|
866
|
+
Switch: Te,
|
861
867
|
DateInput: Ne,
|
862
868
|
FileInput: Pe,
|
863
869
|
ButtonGroup: Ye,
|
864
870
|
DiyItem: Ge,
|
865
871
|
LovInput: Le,
|
866
|
-
NumberInput:
|
872
|
+
NumberInput: je
|
867
873
|
});
|
868
874
|
export {
|
869
|
-
|
870
|
-
|
875
|
+
rl as default,
|
876
|
+
Be as formContextKey,
|
871
877
|
ze as lovContextKey,
|
872
|
-
|
878
|
+
dl as useLov
|
873
879
|
};
|
874
880
|
//# sourceMappingURL=index.js.map
|