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