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