orion-design 0.1.10 → 0.1.13

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