orion-design 0.1.19 → 0.1.21

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