orion-design 0.1.9 → 0.1.12

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