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