orion-design 0.1.28 → 0.1.29
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/Form/index.js +308 -306
- 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
|
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
|
27
|
-
if (!Object.keys(t.modelValue).includes(
|
28
|
-
throw new
|
29
|
-
|
30
|
-
}, a = (
|
31
|
-
const
|
32
|
-
if (!
|
33
|
-
throw new
|
34
|
-
|
35
|
-
},
|
36
|
-
return
|
37
|
-
validate: async () => await
|
25
|
+
setup(t, { expose: i, emit: u }) {
|
26
|
+
const o = u, l = (r, m) => {
|
27
|
+
if (!Object.keys(t.modelValue).includes(r))
|
28
|
+
throw new W(`modelValue中不存在[${r}]`);
|
29
|
+
o("update:modelValue", { ...t.modelValue, [r]: m });
|
30
|
+
}, a = (r) => {
|
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
|
+
o("update:modelValue", { ...t.modelValue, ...r });
|
35
|
+
}, n = Y("form");
|
36
|
+
return i({
|
37
|
+
validate: async () => await n.value.validate()
|
38
38
|
}), L(
|
39
|
-
|
39
|
+
Be,
|
40
40
|
j({
|
41
41
|
modelValue: R(() => t.modelValue),
|
42
42
|
updateModelValue: l,
|
@@ -45,17 +45,17 @@ const Ce = /* @__PURE__ */ c({
|
|
45
45
|
itemSpan: R(() => t.itemSpan),
|
46
46
|
disabled: R(() => t.disabled)
|
47
47
|
})
|
48
|
-
), (
|
48
|
+
), (r, m) => (p(), h(e(fe), {
|
49
49
|
ref: "form",
|
50
|
-
model:
|
51
|
-
rules:
|
52
|
-
"label-width":
|
53
|
-
disabled:
|
50
|
+
model: r.modelValue,
|
51
|
+
rules: r.rules,
|
52
|
+
"label-width": r.itemLabelWidth,
|
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
|
]),
|
60
60
|
_: 3
|
61
61
|
})
|
@@ -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
|
-
|
95
|
-
modelValue: e(
|
96
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
94
|
+
f(e(O), {
|
95
|
+
modelValue: e(o),
|
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
|
-
|
138
|
-
modelValue: e(
|
139
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
137
|
+
f(e(O), {
|
138
|
+
modelValue: e(o),
|
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
|
-
|
183
|
-
modelValue: e(
|
184
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
182
|
+
f(e(O), {
|
183
|
+
modelValue: e(o),
|
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",
|
@@ -274,41 +275,42 @@ const Ce = /* @__PURE__ */ c({
|
|
274
275
|
collapseTagsTooltip: { type: Boolean }
|
275
276
|
},
|
276
277
|
setup(t) {
|
277
|
-
const
|
278
|
-
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) }, {
|
279
280
|
default: d(() => [
|
280
|
-
|
281
|
-
prop:
|
282
|
-
label:
|
283
|
-
"label-width":
|
284
|
-
required:
|
285
|
-
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)
|
286
287
|
}, {
|
287
288
|
default: d(() => [
|
288
|
-
e(
|
289
|
+
e(l) ? (p(), h(e(O), {
|
289
290
|
key: 0,
|
290
|
-
"model-value":
|
291
|
-
placeholder:
|
291
|
+
"model-value": r.value,
|
292
|
+
placeholder: m.placeholder,
|
292
293
|
disabled: !0,
|
293
294
|
readonly: !0
|
294
|
-
}, null, 8, ["model-value", "placeholder"])) : (p(),
|
295
|
+
}, null, 8, ["model-value", "placeholder"])) : (p(), h(e(K), {
|
295
296
|
key: 1,
|
296
|
-
modelValue: e(
|
297
|
-
"onUpdate:modelValue":
|
298
|
-
placeholder:
|
297
|
+
modelValue: e(n),
|
298
|
+
"onUpdate:modelValue": c[0] || (c[0] = (S) => q(n) ? n.value = S : null),
|
299
|
+
placeholder: m.placeholder,
|
299
300
|
multiple: "",
|
300
|
-
"collapse-tags":
|
301
|
-
"collapse-tags-tooltip":
|
301
|
+
"collapse-tags": m.collapseTags,
|
302
|
+
"collapse-tags-tooltip": m.collapseTagsTooltip,
|
303
|
+
onChange: e(i).onChange
|
302
304
|
}, {
|
303
305
|
default: d(() => [
|
304
|
-
(p(!0), D(E, null, I(e(
|
305
|
-
key:
|
306
|
-
label:
|
307
|
-
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
|
308
310
|
}, null, 8, ["label", "value"]))), 128))
|
309
311
|
]),
|
310
312
|
_: 1
|
311
|
-
}, 8, ["modelValue", "placeholder", "collapse-tags", "collapse-tags-tooltip"]))
|
313
|
+
}, 8, ["modelValue", "placeholder", "collapse-tags", "collapse-tags-tooltip", "onChange"]))
|
312
314
|
]),
|
313
315
|
_: 1
|
314
316
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -316,7 +318,7 @@ const Ce = /* @__PURE__ */ c({
|
|
316
318
|
_: 1
|
317
319
|
}, 8, ["span"]));
|
318
320
|
}
|
319
|
-
}),
|
321
|
+
}), Ee = /* @__PURE__ */ y({
|
320
322
|
name: "OFormRadiogroup",
|
321
323
|
inheritAttrs: !1,
|
322
324
|
__name: "RadioGroup",
|
@@ -331,29 +333,29 @@ const Ce = /* @__PURE__ */ c({
|
|
331
333
|
code: {}
|
332
334
|
},
|
333
335
|
setup(t) {
|
334
|
-
const
|
335
|
-
return (a,
|
336
|
+
const i = v(), u = V(), o = U(), l = z();
|
337
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
336
338
|
default: d(() => [
|
337
|
-
|
339
|
+
f(e(w), {
|
338
340
|
prop: a.name,
|
339
341
|
label: a.label,
|
340
342
|
"label-width": a.labelWidth,
|
341
343
|
required: a.required,
|
342
|
-
rules: e(
|
344
|
+
rules: e(u)
|
343
345
|
}, {
|
344
346
|
default: d(() => [
|
345
|
-
|
347
|
+
f(e(ce), {
|
346
348
|
modelValue: e(l),
|
347
|
-
"onUpdate:modelValue":
|
349
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
|
348
350
|
disabled: a.disabled
|
349
351
|
}, {
|
350
352
|
default: d(() => [
|
351
|
-
(p(!0), D(E, null, I(e(
|
352
|
-
key:
|
353
|
-
value:
|
353
|
+
(p(!0), D(E, null, I(e(o), (s) => (p(), h(e(ye), {
|
354
|
+
key: s.value,
|
355
|
+
value: s.value
|
354
356
|
}, {
|
355
357
|
default: d(() => [
|
356
|
-
|
358
|
+
ue(se(s.content), 1)
|
357
359
|
]),
|
358
360
|
_: 2
|
359
361
|
}, 1032, ["value"]))), 128))
|
@@ -367,7 +369,7 @@ const Ce = /* @__PURE__ */ c({
|
|
367
369
|
_: 1
|
368
370
|
}, 8, ["span"]));
|
369
371
|
}
|
370
|
-
}),
|
372
|
+
}), Ie = /* @__PURE__ */ y({
|
371
373
|
name: "OFormCheckboxgroup",
|
372
374
|
inheritAttrs: !1,
|
373
375
|
__name: "CheckboxGroup",
|
@@ -382,27 +384,27 @@ const Ce = /* @__PURE__ */ c({
|
|
382
384
|
code: {}
|
383
385
|
},
|
384
386
|
setup(t) {
|
385
|
-
const
|
386
|
-
return (a,
|
387
|
+
const i = v(), u = V(), o = U(), l = Z();
|
388
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
387
389
|
default: d(() => [
|
388
|
-
|
390
|
+
f(e(w), {
|
389
391
|
prop: a.name,
|
390
392
|
label: a.label,
|
391
393
|
"label-width": a.labelWidth,
|
392
394
|
required: a.required,
|
393
|
-
rules: e(
|
395
|
+
rules: e(u)
|
394
396
|
}, {
|
395
397
|
default: d(() => [
|
396
|
-
|
398
|
+
f(e(ge), {
|
397
399
|
modelValue: e(l),
|
398
|
-
"onUpdate:modelValue":
|
400
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
|
399
401
|
disabled: a.disabled
|
400
402
|
}, {
|
401
403
|
default: d(() => [
|
402
|
-
(p(!0), D(E, null, I(e(
|
403
|
-
key:
|
404
|
-
label:
|
405
|
-
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
|
406
408
|
}, null, 8, ["label", "value"]))), 128))
|
407
409
|
]),
|
408
410
|
_: 1
|
@@ -414,7 +416,7 @@ const Ce = /* @__PURE__ */ c({
|
|
414
416
|
_: 1
|
415
417
|
}, 8, ["span"]));
|
416
418
|
}
|
417
|
-
}),
|
419
|
+
}), Ue = /* @__PURE__ */ y({
|
418
420
|
name: "OFormCheckbox",
|
419
421
|
inheritAttrs: !1,
|
420
422
|
__name: "Checkbox",
|
@@ -427,20 +429,20 @@ const Ce = /* @__PURE__ */ c({
|
|
427
429
|
disabled: { type: Boolean }
|
428
430
|
},
|
429
431
|
setup(t) {
|
430
|
-
const
|
431
|
-
return (
|
432
|
+
const i = v(), u = x();
|
433
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
432
434
|
default: d(() => [
|
433
|
-
|
434
|
-
prop:
|
435
|
-
label:
|
436
|
-
"label-width":
|
437
|
-
rules:
|
435
|
+
f(e(w), {
|
436
|
+
prop: o.name,
|
437
|
+
label: o.label,
|
438
|
+
"label-width": o.labelWidth,
|
439
|
+
rules: o.rules
|
438
440
|
}, {
|
439
441
|
default: d(() => [
|
440
|
-
|
441
|
-
modelValue: e(
|
442
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
443
|
-
disabled:
|
442
|
+
f(e(Q), {
|
443
|
+
modelValue: e(u),
|
444
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
|
445
|
+
disabled: o.disabled
|
444
446
|
}, null, 8, ["modelValue", "disabled"])
|
445
447
|
]),
|
446
448
|
_: 1
|
@@ -449,7 +451,7 @@ const Ce = /* @__PURE__ */ c({
|
|
449
451
|
_: 1
|
450
452
|
}, 8, ["span"]));
|
451
453
|
}
|
452
|
-
}),
|
454
|
+
}), Te = /* @__PURE__ */ y({
|
453
455
|
name: "OFormSwitch",
|
454
456
|
inheritAttrs: !1,
|
455
457
|
__name: "Switch",
|
@@ -462,20 +464,20 @@ const Ce = /* @__PURE__ */ c({
|
|
462
464
|
disabled: { type: Boolean }
|
463
465
|
},
|
464
466
|
setup(t) {
|
465
|
-
const
|
466
|
-
return (
|
467
|
+
const i = v(), u = x();
|
468
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
467
469
|
default: d(() => [
|
468
|
-
|
469
|
-
prop:
|
470
|
-
label:
|
471
|
-
"label-width":
|
472
|
-
rules:
|
470
|
+
f(e(w), {
|
471
|
+
prop: o.name,
|
472
|
+
label: o.label,
|
473
|
+
"label-width": o.labelWidth,
|
474
|
+
rules: o.rules
|
473
475
|
}, {
|
474
476
|
default: d(() => [
|
475
|
-
|
476
|
-
modelValue: e(
|
477
|
-
"onUpdate:modelValue": l[0] || (l[0] = (a) =>
|
478
|
-
disabled:
|
477
|
+
f(e(ve), {
|
478
|
+
modelValue: e(u),
|
479
|
+
"onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
|
480
|
+
disabled: o.disabled
|
479
481
|
}, null, 8, ["modelValue", "disabled"])
|
480
482
|
]),
|
481
483
|
_: 1
|
@@ -484,7 +486,7 @@ const Ce = /* @__PURE__ */ c({
|
|
484
486
|
_: 1
|
485
487
|
}, 8, ["span"]));
|
486
488
|
}
|
487
|
-
}),
|
489
|
+
}), Ne = /* @__PURE__ */ y({
|
488
490
|
name: "OFormDate",
|
489
491
|
inheritAttrs: !1,
|
490
492
|
__name: "DateInput",
|
@@ -505,59 +507,59 @@ const Ce = /* @__PURE__ */ c({
|
|
505
507
|
sourceFormat: {}
|
506
508
|
},
|
507
509
|
setup(t) {
|
508
|
-
const
|
509
|
-
let
|
510
|
-
return (t.format.indexOf("y") > -1 || t.format.indexOf("Y") > -1) && (
|
511
|
-
}),
|
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(() => {
|
511
|
+
let r = "date";
|
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;
|
513
|
+
}), n = T(), s = F({
|
512
514
|
get: () => {
|
513
|
-
const
|
514
|
-
if (
|
515
|
-
if (
|
516
|
-
return
|
517
|
-
if (A(
|
518
|
-
const
|
519
|
-
if (!
|
520
|
-
throw new
|
521
|
-
return
|
515
|
+
const r = n.modelValue[t.name];
|
516
|
+
if (r) {
|
517
|
+
if (te(r))
|
518
|
+
return r;
|
519
|
+
if (A(r)) {
|
520
|
+
const m = G(r, l.value, !0);
|
521
|
+
if (!m.isValid())
|
522
|
+
throw new W(`日期输入框的值无效,不符合${l.value}格式`);
|
523
|
+
return m.toDate();
|
522
524
|
} else
|
523
|
-
throw new
|
525
|
+
throw new W("日期输入框的值只能为字符串或日期类型");
|
524
526
|
}
|
525
527
|
},
|
526
|
-
set: (
|
527
|
-
t.sourceFormat ?
|
528
|
+
set: (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);
|
528
530
|
}
|
529
531
|
});
|
530
|
-
return (
|
532
|
+
return (r, m) => (p(), h(e(g), { span: e(i) }, {
|
531
533
|
default: d(() => [
|
532
|
-
|
533
|
-
prop:
|
534
|
-
label:
|
535
|
-
"label-width":
|
536
|
-
required:
|
537
|
-
rules: e(
|
534
|
+
f(e(w), {
|
535
|
+
prop: r.name,
|
536
|
+
label: r.label,
|
537
|
+
"label-width": r.labelWidth,
|
538
|
+
required: r.required,
|
539
|
+
rules: e(u)
|
538
540
|
}, {
|
539
541
|
default: d(() => [
|
540
|
-
|
542
|
+
o.value ? (p(), h(e(we), {
|
541
543
|
key: 0,
|
542
|
-
modelValue:
|
543
|
-
"onUpdate:modelValue":
|
544
|
-
placeholder:
|
545
|
-
disabled:
|
546
|
-
readonly:
|
547
|
-
editable:
|
548
|
-
clearable:
|
544
|
+
modelValue: s.value,
|
545
|
+
"onUpdate:modelValue": m[0] || (m[0] = (c) => s.value = c),
|
546
|
+
placeholder: r.placeholder,
|
547
|
+
disabled: r.disabled,
|
548
|
+
readonly: r.readonly,
|
549
|
+
editable: r.editable,
|
550
|
+
clearable: r.clearable,
|
549
551
|
format: l.value,
|
550
552
|
"arrow-control": "",
|
551
553
|
style: { width: "100%" }
|
552
|
-
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(),
|
554
|
+
}, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(), h(e(Ve), {
|
553
555
|
key: 1,
|
554
|
-
modelValue:
|
555
|
-
"onUpdate:modelValue":
|
556
|
-
placeholder:
|
557
|
-
disabled:
|
558
|
-
readonly:
|
559
|
-
editable:
|
560
|
-
clearable:
|
556
|
+
modelValue: s.value,
|
557
|
+
"onUpdate:modelValue": m[1] || (m[1] = (c) => s.value = c),
|
558
|
+
placeholder: r.placeholder,
|
559
|
+
disabled: r.disabled,
|
560
|
+
readonly: r.readonly,
|
561
|
+
editable: r.editable,
|
562
|
+
clearable: r.clearable,
|
561
563
|
type: a.value,
|
562
564
|
format: l.value,
|
563
565
|
style: { width: "100%" }
|
@@ -569,7 +571,7 @@ const Ce = /* @__PURE__ */ c({
|
|
569
571
|
_: 1
|
570
572
|
}, 8, ["span"]));
|
571
573
|
}
|
572
|
-
}),
|
574
|
+
}), Pe = /* @__PURE__ */ y({
|
573
575
|
name: "OFormFile",
|
574
576
|
inheritAttrs: !1,
|
575
577
|
__name: "FileInput",
|
@@ -583,31 +585,31 @@ const Ce = /* @__PURE__ */ c({
|
|
583
585
|
disabled: { type: Boolean }
|
584
586
|
},
|
585
587
|
setup(t) {
|
586
|
-
const
|
587
|
-
ie(
|
588
|
-
|
588
|
+
const i = v(), u = V(), o = z();
|
589
|
+
ie(o, () => {
|
590
|
+
o.value || (l.value = "");
|
589
591
|
});
|
590
592
|
const l = P(""), a = Y("inputRef");
|
591
|
-
return
|
592
|
-
a.value.input.onchange = (
|
593
|
-
var
|
594
|
-
|
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];
|
595
597
|
}, l.value = "";
|
596
|
-
}), (
|
598
|
+
}), (n, s) => (p(), h(e(g), { span: e(i) }, {
|
597
599
|
default: d(() => [
|
598
|
-
|
599
|
-
prop:
|
600
|
-
label:
|
601
|
-
"label-width":
|
602
|
-
required:
|
603
|
-
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)
|
604
606
|
}, {
|
605
607
|
default: d(() => [
|
606
|
-
|
608
|
+
f(e(O), {
|
607
609
|
ref: "inputRef",
|
608
610
|
modelValue: l.value,
|
609
|
-
"onUpdate:modelValue":
|
610
|
-
disabled:
|
611
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
|
612
|
+
disabled: n.disabled,
|
611
613
|
type: "file",
|
612
614
|
"validate-event": !1
|
613
615
|
}, null, 8, ["modelValue", "disabled"])
|
@@ -618,7 +620,7 @@ const Ce = /* @__PURE__ */ c({
|
|
618
620
|
_: 1
|
619
621
|
}, 8, ["span"]));
|
620
622
|
}
|
621
|
-
}),
|
623
|
+
}), Ye = /* @__PURE__ */ y({
|
622
624
|
name: "OFormButtongroup",
|
623
625
|
inheritAttrs: !1,
|
624
626
|
__name: "ButtonGroup",
|
@@ -628,20 +630,20 @@ const Ce = /* @__PURE__ */ c({
|
|
628
630
|
align: { default: "right" }
|
629
631
|
},
|
630
632
|
setup(t) {
|
631
|
-
const
|
633
|
+
const i = F(() => ({
|
632
634
|
textAlign: t.align
|
633
|
-
})),
|
634
|
-
return (
|
635
|
-
span: e(
|
636
|
-
style:
|
635
|
+
})), u = v();
|
636
|
+
return (o, l) => (p(), h(e(g), {
|
637
|
+
span: e(u),
|
638
|
+
style: me(i.value)
|
637
639
|
}, {
|
638
640
|
default: d(() => [
|
639
|
-
|
640
|
-
gutter:
|
641
|
+
f(e(Fe), {
|
642
|
+
gutter: o.gutter,
|
641
643
|
style: { "margin-bottom": "18px" }
|
642
644
|
}, {
|
643
645
|
default: d(() => [
|
644
|
-
$(
|
646
|
+
$(o.$slots, "default")
|
645
647
|
]),
|
646
648
|
_: 3
|
647
649
|
}, 8, ["gutter"])
|
@@ -649,7 +651,7 @@ const Ce = /* @__PURE__ */ c({
|
|
649
651
|
_: 3
|
650
652
|
}, 8, ["span", "style"]));
|
651
653
|
}
|
652
|
-
}),
|
654
|
+
}), Ge = /* @__PURE__ */ y({
|
653
655
|
name: "OFormDiy",
|
654
656
|
inheritAttrs: !1,
|
655
657
|
__name: "DiyItem",
|
@@ -662,18 +664,18 @@ const Ce = /* @__PURE__ */ c({
|
|
662
664
|
rules: {}
|
663
665
|
},
|
664
666
|
setup(t) {
|
665
|
-
const
|
666
|
-
return (
|
667
|
+
const i = v(), u = V();
|
668
|
+
return (o, l) => (p(), h(e(g), { span: e(i) }, {
|
667
669
|
default: d(() => [
|
668
|
-
|
669
|
-
prop:
|
670
|
-
label:
|
671
|
-
"label-width":
|
672
|
-
required:
|
673
|
-
rules: e(
|
670
|
+
f(e(w), {
|
671
|
+
prop: o.name,
|
672
|
+
label: o.label,
|
673
|
+
"label-width": o.labelWidth,
|
674
|
+
required: o.required,
|
675
|
+
rules: e(u)
|
674
676
|
}, {
|
675
677
|
default: d(() => [
|
676
|
-
$(
|
678
|
+
$(o.$slots, "default")
|
677
679
|
]),
|
678
680
|
_: 3
|
679
681
|
}, 8, ["prop", "label", "label-width", "required", "rules"])
|
@@ -681,7 +683,7 @@ const Ce = /* @__PURE__ */ c({
|
|
681
683
|
_: 3
|
682
684
|
}, 8, ["span"]));
|
683
685
|
}
|
684
|
-
}),
|
686
|
+
}), Le = /* @__PURE__ */ y({
|
685
687
|
name: "OFormLov",
|
686
688
|
inheritAttrs: !1,
|
687
689
|
__name: "LovInput",
|
@@ -699,77 +701,77 @@ const Ce = /* @__PURE__ */ c({
|
|
699
701
|
fillMapping: { type: [String, Function] }
|
700
702
|
},
|
701
703
|
setup(t) {
|
702
|
-
const
|
703
|
-
a.value =
|
704
|
-
},
|
705
|
-
var
|
706
|
-
|
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();
|
707
709
|
};
|
708
|
-
let
|
709
|
-
const
|
710
|
-
|
711
|
-
},
|
712
|
-
var
|
713
|
-
["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Space"].indexOf(
|
714
|
-
},
|
715
|
-
if (
|
716
|
-
const
|
717
|
-
for (let
|
718
|
-
const
|
719
|
-
|
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;
|
720
722
|
}
|
721
|
-
l.updateModelValueMulti(
|
723
|
+
l.updateModelValueMulti(b);
|
722
724
|
}
|
723
725
|
}, N = Y("dropdown");
|
724
726
|
return L(
|
725
727
|
ze,
|
726
728
|
j({
|
727
|
-
lovValue:
|
728
|
-
backfill: (
|
729
|
-
var
|
730
|
-
if ((
|
731
|
-
const
|
732
|
-
for (let k = 0; k <
|
733
|
-
const
|
734
|
-
|
729
|
+
lovValue: o,
|
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;
|
735
737
|
}
|
736
|
-
l.updateModelValueMulti(
|
738
|
+
l.updateModelValueMulti(M);
|
737
739
|
} else
|
738
|
-
t.fillMapping && t.fillMapping(
|
739
|
-
|
740
|
+
t.fillMapping && t.fillMapping(b);
|
741
|
+
s.value && (s.value = !1);
|
740
742
|
},
|
741
|
-
registerKeydownHandler:
|
743
|
+
registerKeydownHandler: c
|
742
744
|
})
|
743
|
-
), (
|
745
|
+
), (b, B) => (p(), h(e(g), { span: e(i) }, {
|
744
746
|
default: d(() => [
|
745
|
-
|
746
|
-
prop:
|
747
|
-
label:
|
748
|
-
"label-width":
|
749
|
-
required:
|
750
|
-
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)
|
751
753
|
}, {
|
752
754
|
default: d(() => [
|
753
|
-
|
755
|
+
f(e(Se), {
|
754
756
|
ref: "dropdown",
|
755
757
|
trigger: "click",
|
756
|
-
onVisibleChange:
|
758
|
+
onVisibleChange: n,
|
757
759
|
style: { width: "100%" }
|
758
760
|
}, {
|
759
761
|
dropdown: d(() => [
|
760
|
-
$(
|
762
|
+
$(b.$slots, "default")
|
761
763
|
]),
|
762
764
|
default: d(() => [
|
763
|
-
|
764
|
-
modelValue: e(
|
765
|
-
"onUpdate:modelValue":
|
766
|
-
maxlength:
|
767
|
-
placeholder:
|
768
|
-
disabled:
|
769
|
-
readonly:
|
770
|
-
onInput:
|
771
|
-
onKeydown:
|
772
|
-
onChange:
|
765
|
+
f(e(O), {
|
766
|
+
modelValue: e(o),
|
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,
|
772
|
+
onInput: r,
|
773
|
+
onKeydown: S,
|
774
|
+
onChange: _,
|
773
775
|
"suffix-icon": e(Oe)
|
774
776
|
}, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "suffix-icon"])
|
775
777
|
]),
|
@@ -782,7 +784,7 @@ const Ce = /* @__PURE__ */ c({
|
|
782
784
|
_: 3
|
783
785
|
}, 8, ["span"]));
|
784
786
|
}
|
785
|
-
}),
|
787
|
+
}), je = /* @__PURE__ */ y({
|
786
788
|
name: "OFormNumber",
|
787
789
|
inheritAttrs: !1,
|
788
790
|
__name: "NumberInput",
|
@@ -805,34 +807,34 @@ const Ce = /* @__PURE__ */ c({
|
|
805
807
|
controlsPosition: {}
|
806
808
|
},
|
807
809
|
setup(t) {
|
808
|
-
const
|
810
|
+
const i = v(), u = V(), o = T(), l = F({
|
809
811
|
get: () => {
|
810
|
-
const a =
|
812
|
+
const a = o.modelValue[t.name];
|
811
813
|
if (a) {
|
812
|
-
if (
|
814
|
+
if (ne(a))
|
813
815
|
return a;
|
814
816
|
if (A(a))
|
815
|
-
return
|
816
|
-
throw new
|
817
|
+
return de(a);
|
818
|
+
throw new W("数字输入框的值只能为字符串或数字类型");
|
817
819
|
}
|
818
820
|
},
|
819
821
|
set: (a) => {
|
820
|
-
a ?
|
822
|
+
a ? o.updateModelValue(t.name, a) : o.updateModelValue(t.name, void 0);
|
821
823
|
}
|
822
824
|
});
|
823
|
-
return (a,
|
825
|
+
return (a, n) => (p(), h(e(g), { span: e(i) }, {
|
824
826
|
default: d(() => [
|
825
|
-
|
827
|
+
f(e(w), {
|
826
828
|
prop: a.name,
|
827
829
|
label: a.label,
|
828
830
|
"label-width": a.labelWidth,
|
829
831
|
required: a.required,
|
830
|
-
rules: e(
|
832
|
+
rules: e(u)
|
831
833
|
}, {
|
832
834
|
default: d(() => [
|
833
|
-
|
835
|
+
f(e(qe), {
|
834
836
|
modelValue: l.value,
|
835
|
-
"onUpdate:modelValue":
|
837
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => l.value = s),
|
836
838
|
placeholder: a.placeholder,
|
837
839
|
disabled: a.disabled,
|
838
840
|
readonly: a.readonly,
|
@@ -852,27 +854,27 @@ const Ce = /* @__PURE__ */ c({
|
|
852
854
|
_: 1
|
853
855
|
}, 8, ["span"]));
|
854
856
|
}
|
855
|
-
}),
|
856
|
-
StringInput:
|
857
|
-
PasswordInput:
|
858
|
-
Textarea:
|
859
|
-
SingleSelect:
|
860
|
-
MultiSelect:
|
861
|
-
RadioGroup:
|
862
|
-
CheckboxGroup:
|
863
|
-
Checkbox:
|
864
|
-
Switch:
|
865
|
-
DateInput:
|
866
|
-
FileInput:
|
867
|
-
ButtonGroup:
|
868
|
-
DiyItem:
|
869
|
-
LovInput:
|
870
|
-
NumberInput:
|
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,
|
867
|
+
DateInput: Ne,
|
868
|
+
FileInput: Pe,
|
869
|
+
ButtonGroup: Ye,
|
870
|
+
DiyItem: Ge,
|
871
|
+
LovInput: Le,
|
872
|
+
NumberInput: je
|
871
873
|
});
|
872
874
|
export {
|
873
|
-
|
874
|
-
|
875
|
+
rl as default,
|
876
|
+
Be as formContextKey,
|
875
877
|
ze as lovContextKey,
|
876
|
-
|
878
|
+
dl as useLov
|
877
879
|
};
|
878
880
|
//# sourceMappingURL=index.js.map
|