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