orion-design 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) 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/hooks/FormItemValidateTrigger.d.ts +15 -0
  6. package/dist/components/Form/hooks/FormItemValidateTrigger.js +18 -0
  7. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -0
  8. package/dist/components/Form/hooks/index.d.ts +10 -0
  9. package/dist/components/Form/hooks/index.js +83 -0
  10. package/dist/components/Form/hooks/index.js.map +1 -0
  11. package/dist/components/Form/index.js +180 -182
  12. package/dist/components/Form/index.js.map +1 -1
  13. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +7 -7
  14. package/dist/components/Pagetable/index.js +182 -180
  15. package/dist/components/Pagetable/index.js.map +1 -1
  16. package/dist/components/Pagetable/utils/index.js +82 -82
  17. package/dist/components/Pagetable/utils/index.js.map +1 -1
  18. package/dist/components/_util/arrays.js.map +1 -1
  19. package/dist/components/_util/browser.js.map +1 -1
  20. package/dist/components/_util/dom/aria.js.map +1 -1
  21. package/dist/components/_util/dom/element.js.map +1 -1
  22. package/dist/components/_util/dom/event.js.map +1 -1
  23. package/dist/components/_util/dom/position.js.map +1 -1
  24. package/dist/components/_util/dom/scroll.js.map +1 -1
  25. package/dist/components/_util/dom/style.js.map +1 -1
  26. package/dist/components/_util/easings.js.map +1 -1
  27. package/dist/components/_util/error.js.map +1 -1
  28. package/dist/components/_util/i18n.js.map +1 -1
  29. package/dist/components/_util/objects.js.map +1 -1
  30. package/dist/components/_util/raf.js.map +1 -1
  31. package/dist/components/_util/rand.js.map +1 -1
  32. package/dist/components/_util/strings.js.map +1 -1
  33. package/dist/components/_util/throttleByRaf.js.map +1 -1
  34. package/dist/components/_util/types.js.map +1 -1
  35. package/dist/components/_util/typescript.js.map +1 -1
  36. package/dist/components/_util/vue/global-node.js.map +1 -1
  37. package/dist/components/_util/vue/icon.js.map +1 -1
  38. package/dist/components/_util/vue/install.js.map +1 -1
  39. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  40. package/dist/components/_util/vue/refs.js.map +1 -1
  41. package/dist/components/_util/vue/size.js.map +1 -1
  42. package/dist/components/_util/vue/validator.js.map +1 -1
  43. package/dist/components/_util/vue/vnode.js.map +1 -1
  44. package/dist/index.css +1 -1
  45. package/dist/version/version.d.ts +1 -1
  46. package/dist/version/version.js +1 -1
  47. package/dist/version/version.js.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/components/Form/hooks/useForm.d.ts +0 -10
  50. package/dist/components/Form/hooks/useForm.js +0 -82
  51. package/dist/components/Form/hooks/useForm.js.map +0 -1
@@ -1,14 +1,15 @@
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";
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
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";
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
7
  import { getSingleCodeContent as ue, getMultiCodeContent as ie } from "./utils/index.js";
8
8
  import D from "../../error/OrionError.js";
9
9
  import { S as se } from "../../index-BbsXWo7C.js";
10
10
  const me = /* @__PURE__ */ h({
11
11
  name: "OForm",
12
+ inheritAttrs: !1,
12
13
  __name: "Form",
13
14
  props: {
14
15
  rules: {},
@@ -18,32 +19,32 @@ const me = /* @__PURE__ */ h({
18
19
  modelValue: {}
19
20
  },
20
21
  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");
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");
25
26
  return m({
26
- validate: async () => await n.value.validate()
27
- }), L(
28
- te,
29
- N({
30
- modelValue: B(() => o.modelValue),
27
+ validate: async () => await t.value.validate()
28
+ }), j(
29
+ de,
30
+ L({
31
+ modelValue: F(() => r.modelValue),
31
32
  updateModelValue: l,
32
- rules: B(() => o.rules),
33
- itemSpan: B(() => o.itemSpan),
34
- disabled: B(() => o.disabled)
33
+ rules: F(() => r.rules),
34
+ itemSpan: F(() => r.itemSpan),
35
+ disabled: F(() => r.disabled)
35
36
  })
36
- ), (d, f) => (s(), p(e(_), {
37
+ ), (n, f) => (s(), p(e(_), {
37
38
  ref: "form",
38
- model: d.modelValue,
39
- rules: d.rules,
40
- "label-width": d.itemLabelWidth,
41
- disabled: d.disabled
39
+ model: n.modelValue,
40
+ rules: n.rules,
41
+ "label-width": n.itemLabelWidth,
42
+ disabled: n.disabled
42
43
  }, {
43
44
  default: u(() => [
44
45
  b(e(ee), { gutter: 16 }, {
45
46
  default: u(() => [
46
- C(d.$slots, "default")
47
+ C(n.$slots, "default")
47
48
  ]),
48
49
  _: 3
49
50
  })
@@ -53,7 +54,7 @@ const me = /* @__PURE__ */ h({
53
54
  }
54
55
  }), pe = /* @__PURE__ */ h({
55
56
  name: "OFormString",
56
- extendOptions: { trigger: "blur" },
57
+ inheritAttrs: !1,
57
58
  __name: "StringInput",
58
59
  props: {
59
60
  name: {},
@@ -67,11 +68,11 @@ const me = /* @__PURE__ */ h({
67
68
  disabled: { type: Boolean },
68
69
  readonly: { type: Boolean }
69
70
  },
70
- setup(o) {
71
- const m = v(), i = V(), a = O();
72
- return (l, n) => (s(), p(e(c), { span: e(m) }, {
71
+ setup(r) {
72
+ const m = v(), i = w(), a = B();
73
+ return (l, t) => (s(), p(e(c), { span: e(m) }, {
73
74
  default: u(() => [
74
- b(e(g), {
75
+ b(e(V), {
75
76
  prop: l.name,
76
77
  label: l.label,
77
78
  "label-width": l.labelWidth,
@@ -81,7 +82,7 @@ const me = /* @__PURE__ */ h({
81
82
  default: u(() => [
82
83
  b(e(q), {
83
84
  modelValue: e(a),
84
- "onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
85
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
85
86
  maxlength: l.maxlength,
86
87
  placeholder: l.placeholder,
87
88
  disabled: l.disabled,
@@ -96,7 +97,7 @@ const me = /* @__PURE__ */ h({
96
97
  }
97
98
  }), be = /* @__PURE__ */ h({
98
99
  name: "OFormPassword",
99
- extendOptions: { trigger: "blur" },
100
+ inheritAttrs: !1,
100
101
  __name: "PasswordInput",
101
102
  props: {
102
103
  name: {},
@@ -110,11 +111,11 @@ const me = /* @__PURE__ */ h({
110
111
  disabled: { type: Boolean },
111
112
  readonly: { type: Boolean }
112
113
  },
113
- setup(o) {
114
- const m = v(), i = V(), a = O();
115
- return (l, n) => (s(), p(e(c), { span: e(m) }, {
114
+ setup(r) {
115
+ const m = v(), i = w(), a = B();
116
+ return (l, t) => (s(), p(e(c), { span: e(m) }, {
116
117
  default: u(() => [
117
- b(e(g), {
118
+ b(e(V), {
118
119
  prop: l.name,
119
120
  label: l.label,
120
121
  "label-width": l.labelWidth,
@@ -124,7 +125,7 @@ const me = /* @__PURE__ */ h({
124
125
  default: u(() => [
125
126
  b(e(q), {
126
127
  modelValue: e(a),
127
- "onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
128
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
128
129
  maxlength: l.maxlength,
129
130
  placeholder: l.placeholder,
130
131
  disabled: l.disabled,
@@ -140,7 +141,7 @@ const me = /* @__PURE__ */ h({
140
141
  }
141
142
  }), fe = /* @__PURE__ */ h({
142
143
  name: "OFormTextarea",
143
- extendOptions: { trigger: "blur" },
144
+ inheritAttrs: !1,
144
145
  __name: "Textarea",
145
146
  props: {
146
147
  name: {},
@@ -155,11 +156,11 @@ const me = /* @__PURE__ */ h({
155
156
  readonly: { type: Boolean },
156
157
  rows: {}
157
158
  },
158
- setup(o) {
159
- const m = v(), i = V(), a = O();
160
- return (l, n) => (s(), p(e(c), { span: e(m) }, {
159
+ setup(r) {
160
+ const m = v(), i = w(), a = B();
161
+ return (l, t) => (s(), p(e(c), { span: e(m) }, {
161
162
  default: u(() => [
162
- b(e(g), {
163
+ b(e(V), {
163
164
  prop: l.name,
164
165
  label: l.label,
165
166
  "label-width": l.labelWidth,
@@ -169,7 +170,7 @@ const me = /* @__PURE__ */ h({
169
170
  default: u(() => [
170
171
  b(e(q), {
171
172
  modelValue: e(a),
172
- "onUpdate:modelValue": n[0] || (n[0] = (t) => w(a) ? a.value = t : null),
173
+ "onUpdate:modelValue": t[0] || (t[0] = (d) => g(a) ? a.value = d : null),
173
174
  maxlength: l.maxlength,
174
175
  placeholder: l.placeholder,
175
176
  disabled: l.disabled,
@@ -187,7 +188,7 @@ const me = /* @__PURE__ */ h({
187
188
  }
188
189
  }), he = /* @__PURE__ */ h({
189
190
  name: "OFormSingleselect",
190
- extendOptions: {},
191
+ inheritAttrs: !1,
191
192
  __name: "SingleSelect",
192
193
  props: {
193
194
  name: {},
@@ -202,37 +203,37 @@ const me = /* @__PURE__ */ h({
202
203
  clearable: { type: Boolean },
203
204
  filterable: { type: Boolean }
204
205
  },
205
- 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) }, {
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) }, {
208
209
  default: u(() => [
209
- b(e(g), {
210
- prop: d.name,
211
- label: d.label,
212
- "label-width": d.labelWidth,
213
- required: d.required,
210
+ b(e(V), {
211
+ prop: n.name,
212
+ label: n.label,
213
+ "label-width": n.labelWidth,
214
+ required: n.required,
214
215
  rules: e(i)
215
216
  }, {
216
217
  default: u(() => [
217
218
  e(a) ? (s(), p(e(q), {
218
219
  key: 0,
219
- "model-value": t.value,
220
- placeholder: d.placeholder,
220
+ "model-value": d.value,
221
+ placeholder: n.placeholder,
221
222
  disabled: !0,
222
223
  readonly: !0
223
224
  }, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
224
225
  key: 1,
225
- 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
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
230
231
  }, {
231
232
  default: u(() => [
232
- (s(!0), F(z, null, M(e(l), (r) => (s(), p(e(U), {
233
- key: r.value,
234
- label: r.content,
235
- value: r.value
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
236
237
  }, null, 8, ["label", "value"]))), 128))
237
238
  ]),
238
239
  _: 1
@@ -246,7 +247,7 @@ const me = /* @__PURE__ */ h({
246
247
  }
247
248
  }), ye = /* @__PURE__ */ h({
248
249
  name: "OFormMultiselect",
249
- extendOptions: {},
250
+ inheritAttrs: !1,
250
251
  __name: "MultiSelect",
251
252
  props: {
252
253
  name: {},
@@ -259,13 +260,11 @@ const me = /* @__PURE__ */ h({
259
260
  disabled: { type: Boolean },
260
261
  code: {}
261
262
  },
262
- 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) }, {
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) }, {
267
266
  default: u(() => [
268
- b(e(g), {
267
+ b(e(V), {
269
268
  prop: f.name,
270
269
  label: f.label,
271
270
  "label-width": f.labelWidth,
@@ -275,19 +274,19 @@ const me = /* @__PURE__ */ h({
275
274
  default: u(() => [
276
275
  e(a) ? (s(), p(e(q), {
277
276
  key: 0,
278
- "model-value": d.value,
277
+ "model-value": n.value,
279
278
  placeholder: f.placeholder,
280
279
  disabled: !0,
281
280
  readonly: !0
282
281
  }, null, 8, ["model-value", "placeholder"])) : (s(), p(e(E), {
283
282
  key: 1,
284
- modelValue: e(n),
285
- "onUpdate:modelValue": r[0] || (r[0] = (y) => w(n) ? n.value = y : null),
283
+ modelValue: e(t),
284
+ "onUpdate:modelValue": o[0] || (o[0] = (y) => g(t) ? t.value = y : null),
286
285
  placeholder: f.placeholder,
287
286
  multiple: ""
288
287
  }, {
289
288
  default: u(() => [
290
- (s(!0), F(z, null, M(e(l), (y) => (s(), p(e(U), {
289
+ (s(!0), z(M, null, W(e(l), (y) => (s(), p(e(A), {
291
290
  key: y.value,
292
291
  label: y.content,
293
292
  value: y.value
@@ -304,7 +303,7 @@ const me = /* @__PURE__ */ h({
304
303
  }
305
304
  }), ce = /* @__PURE__ */ h({
306
305
  name: "OFormRadiogroup",
307
- extendOptions: {},
306
+ inheritAttrs: !1,
308
307
  __name: "RadioGroup",
309
308
  props: {
310
309
  name: {},
@@ -316,30 +315,30 @@ const me = /* @__PURE__ */ h({
316
315
  disabled: { type: Boolean },
317
316
  code: {}
318
317
  },
319
- setup(o) {
320
- const m = v(), i = V(), a = W(), l = O();
321
- return (n, t) => (s(), p(e(c), { span: e(m) }, {
318
+ setup(r) {
319
+ const m = v(), i = w(), a = O(), l = B();
320
+ return (t, d) => (s(), p(e(c), { span: e(m) }, {
322
321
  default: u(() => [
323
- b(e(g), {
324
- prop: n.name,
325
- label: n.label,
326
- "label-width": n.labelWidth,
327
- required: n.required,
322
+ b(e(V), {
323
+ prop: t.name,
324
+ label: t.label,
325
+ "label-width": t.labelWidth,
326
+ required: t.required,
328
327
  rules: e(i)
329
328
  }, {
330
329
  default: u(() => [
331
330
  b(e(le), {
332
331
  modelValue: e(l),
333
- "onUpdate:modelValue": t[0] || (t[0] = (d) => w(l) ? l.value = d : null),
334
- disabled: n.disabled
332
+ "onUpdate:modelValue": d[0] || (d[0] = (n) => g(l) ? l.value = n : null),
333
+ disabled: t.disabled
335
334
  }, {
336
335
  default: u(() => [
337
- (s(!0), F(z, null, M(e(a), (d) => (s(), p(e(ae), {
338
- key: d.value,
339
- value: d.value
336
+ (s(!0), z(M, null, W(e(a), (n) => (s(), p(e(ae), {
337
+ key: n.value,
338
+ value: n.value
340
339
  }, {
341
340
  default: u(() => [
342
- A(K(d.content), 1)
341
+ N(K(n.content), 1)
343
342
  ]),
344
343
  _: 2
345
344
  }, 1032, ["value"]))), 128))
@@ -355,7 +354,7 @@ const me = /* @__PURE__ */ h({
355
354
  }
356
355
  }), ve = /* @__PURE__ */ h({
357
356
  name: "OFormCheckboxgroup",
358
- extendOptions: {},
357
+ inheritAttrs: !1,
359
358
  __name: "CheckboxGroup",
360
359
  props: {
361
360
  name: {},
@@ -367,28 +366,28 @@ const me = /* @__PURE__ */ h({
367
366
  disabled: { type: Boolean },
368
367
  code: {}
369
368
  },
370
- setup(o) {
371
- const m = v(), i = V(), a = W(), l = G();
372
- return (n, t) => (s(), p(e(c), { span: e(m) }, {
369
+ setup(r) {
370
+ const m = v(), i = w(), a = O(), l = T();
371
+ return (t, d) => (s(), p(e(c), { span: e(m) }, {
373
372
  default: u(() => [
374
- b(e(g), {
375
- prop: n.name,
376
- label: n.label,
377
- "label-width": n.labelWidth,
378
- required: n.required,
373
+ b(e(V), {
374
+ prop: t.name,
375
+ label: t.label,
376
+ "label-width": t.labelWidth,
377
+ required: t.required,
379
378
  rules: e(i)
380
379
  }, {
381
380
  default: u(() => [
382
- b(e(oe), {
381
+ b(e(re), {
383
382
  modelValue: e(l),
384
- "onUpdate:modelValue": t[0] || (t[0] = (d) => w(l) ? l.value = d : null),
385
- disabled: n.disabled
383
+ "onUpdate:modelValue": d[0] || (d[0] = (n) => g(l) ? l.value = n : null),
384
+ disabled: t.disabled
386
385
  }, {
387
386
  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
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
392
391
  }, null, 8, ["label", "value"]))), 128))
393
392
  ]),
394
393
  _: 1
@@ -400,9 +399,9 @@ const me = /* @__PURE__ */ h({
400
399
  _: 1
401
400
  }, 8, ["span"]));
402
401
  }
403
- }), ge = /* @__PURE__ */ h({
402
+ }), Ve = /* @__PURE__ */ h({
404
403
  name: "OFormCheckbox",
405
- extendOptions: {},
404
+ inheritAttrs: !1,
406
405
  __name: "Checkbox",
407
406
  props: {
408
407
  name: {},
@@ -412,20 +411,20 @@ const me = /* @__PURE__ */ h({
412
411
  rules: {},
413
412
  disabled: { type: Boolean }
414
413
  },
415
- setup(o) {
416
- const m = v(), i = I();
414
+ setup(r) {
415
+ const m = v(), i = G();
417
416
  return (a, l) => (s(), p(e(c), { span: e(m) }, {
418
417
  default: u(() => [
419
- b(e(g), {
418
+ b(e(V), {
420
419
  prop: a.name,
421
420
  label: a.label,
422
421
  "label-width": a.labelWidth,
423
422
  rules: a.rules
424
423
  }, {
425
424
  default: u(() => [
426
- b(e(T), {
425
+ b(e(I), {
427
426
  modelValue: e(i),
428
- "onUpdate:modelValue": l[0] || (l[0] = (n) => w(i) ? i.value = n : null),
427
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => g(i) ? i.value = t : null),
429
428
  disabled: a.disabled
430
429
  }, null, 8, ["modelValue", "disabled"])
431
430
  ]),
@@ -435,9 +434,9 @@ const me = /* @__PURE__ */ h({
435
434
  _: 1
436
435
  }, 8, ["span"]));
437
436
  }
438
- }), Ve = /* @__PURE__ */ h({
437
+ }), we = /* @__PURE__ */ h({
439
438
  name: "OFormSwitch",
440
- extendOptions: {},
439
+ inheritAttrs: !1,
441
440
  __name: "Switch",
442
441
  props: {
443
442
  name: {},
@@ -447,20 +446,20 @@ const me = /* @__PURE__ */ h({
447
446
  rules: {},
448
447
  disabled: { type: Boolean }
449
448
  },
450
- setup(o) {
451
- const m = v(), i = I();
449
+ setup(r) {
450
+ const m = v(), i = G();
452
451
  return (a, l) => (s(), p(e(c), { span: e(m) }, {
453
452
  default: u(() => [
454
- b(e(g), {
453
+ b(e(V), {
455
454
  prop: a.name,
456
455
  label: a.label,
457
456
  "label-width": a.labelWidth,
458
457
  rules: a.rules
459
458
  }, {
460
459
  default: u(() => [
461
- b(e(re), {
460
+ b(e(oe), {
462
461
  modelValue: e(i),
463
- "onUpdate:modelValue": l[0] || (l[0] = (n) => w(i) ? i.value = n : null),
462
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => g(i) ? i.value = t : null),
464
463
  disabled: a.disabled
465
464
  }, null, 8, ["modelValue", "disabled"])
466
465
  ]),
@@ -470,9 +469,9 @@ const me = /* @__PURE__ */ h({
470
469
  _: 1
471
470
  }, 8, ["span"]));
472
471
  }
473
- }), we = /* @__PURE__ */ h({
472
+ }), ge = /* @__PURE__ */ h({
474
473
  name: "OFormDate",
475
- extendOptions: { trigger: "blur" },
474
+ inheritAttrs: !1,
476
475
  __name: "DateInput",
477
476
  props: {
478
477
  name: {},
@@ -490,69 +489,67 @@ const me = /* @__PURE__ */ h({
490
489
  format: { default: "YYYY-MM-DD" },
491
490
  sourceFormat: {}
492
491
  },
493
- 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(() => {
497
- let r = "date";
498
- 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))
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
499
  return "string";
503
- if (j(r))
500
+ if (H(o))
504
501
  return "date";
505
502
  throw new D("日期输入框的值只能为字符串或日期类型");
506
503
  }), f = S({
507
504
  get: () => {
508
- const r = t.modelValue[o.name];
509
- if (r) {
510
- if (d.value == "date")
511
- return r;
505
+ const o = d.modelValue[r.name];
506
+ if (o) {
507
+ if (n.value == "date")
508
+ return o;
512
509
  {
513
- const y = R(r, l.value, !0);
510
+ const y = R(o, l.value, !0);
514
511
  if (!y.isValid())
515
512
  throw new D(`日期输入框的值无效,不符合${l.value}格式`);
516
513
  return y.toDate();
517
514
  }
518
515
  }
519
516
  },
520
- 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, "");
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, "");
522
519
  }
523
520
  });
524
- return (r, y) => (s(), p(e(c), { span: e(m) }, {
521
+ return (o, y) => (s(), p(e(c), { span: e(m) }, {
525
522
  default: u(() => [
526
- b(e(g), {
527
- prop: r.name,
528
- label: r.label,
529
- "label-width": r.labelWidth,
530
- required: r.required,
523
+ b(e(V), {
524
+ prop: o.name,
525
+ label: o.label,
526
+ "label-width": o.labelWidth,
527
+ required: o.required,
531
528
  rules: e(i)
532
529
  }, {
533
530
  default: u(() => [
534
- a.value ? (s(), p(e(ne), {
531
+ a.value ? (s(), p(e(te), {
535
532
  key: 0,
536
533
  modelValue: f.value,
537
534
  "onUpdate:modelValue": y[0] || (y[0] = (k) => f.value = k),
538
- placeholder: r.placeholder,
539
- disabled: r.disabled,
540
- readonly: r.readonly,
541
- editable: r.editable,
542
- clearable: r.clearable,
535
+ placeholder: o.placeholder,
536
+ disabled: o.disabled,
537
+ readonly: o.readonly,
538
+ editable: o.editable,
539
+ clearable: o.clearable,
543
540
  format: l.value,
544
541
  "arrow-control": "",
545
542
  style: { width: "100%" }
546
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (s(), p(e(de), {
543
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (s(), p(e(ne), {
547
544
  key: 1,
548
545
  modelValue: f.value,
549
546
  "onUpdate:modelValue": y[1] || (y[1] = (k) => f.value = k),
550
- placeholder: r.placeholder,
551
- disabled: r.disabled,
552
- readonly: r.readonly,
553
- editable: r.editable,
554
- clearable: r.clearable,
555
- type: n.value,
547
+ placeholder: o.placeholder,
548
+ disabled: o.disabled,
549
+ readonly: o.readonly,
550
+ editable: o.editable,
551
+ clearable: o.clearable,
552
+ type: t.value,
556
553
  format: l.value,
557
554
  style: { width: "100%" }
558
555
  }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
@@ -565,7 +562,7 @@ const me = /* @__PURE__ */ h({
565
562
  }
566
563
  }), Se = /* @__PURE__ */ h({
567
564
  name: "OFormFile",
568
- extendOptions: {},
565
+ inheritAttrs: !1,
569
566
  __name: "FileInput",
570
567
  props: {
571
568
  name: {},
@@ -576,32 +573,32 @@ const me = /* @__PURE__ */ h({
576
573
  rules: {},
577
574
  disabled: { type: Boolean }
578
575
  },
579
- setup(o) {
580
- const m = v(), i = V(), a = O();
576
+ setup(r) {
577
+ const m = v(), i = w(), a = B();
581
578
  J(a, () => {
582
579
  a.value || (l.value = "");
583
580
  });
584
- const l = Q(""), n = $("inputRef");
581
+ const l = Q(""), t = $("inputRef");
585
582
  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];
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];
589
586
  }, l.value = "";
590
- }), (t, d) => (s(), p(e(c), { span: e(m) }, {
587
+ }), (d, n) => (s(), p(e(c), { span: e(m) }, {
591
588
  default: u(() => [
592
- b(e(g), {
593
- prop: t.name,
594
- label: t.label,
595
- "label-width": t.labelWidth,
596
- required: t.required,
589
+ b(e(V), {
590
+ prop: d.name,
591
+ label: d.label,
592
+ "label-width": d.labelWidth,
593
+ required: d.required,
597
594
  rules: e(i)
598
595
  }, {
599
596
  default: u(() => [
600
597
  b(e(q), {
601
598
  ref: "inputRef",
602
599
  modelValue: l.value,
603
- "onUpdate:modelValue": d[0] || (d[0] = (f) => l.value = f),
604
- disabled: t.disabled,
600
+ "onUpdate:modelValue": n[0] || (n[0] = (f) => l.value = f),
601
+ disabled: d.disabled,
605
602
  type: "file",
606
603
  "validate-event": !1
607
604
  }, null, 8, ["modelValue", "disabled"])
@@ -614,15 +611,16 @@ const me = /* @__PURE__ */ h({
614
611
  }
615
612
  }), qe = /* @__PURE__ */ h({
616
613
  name: "OFormButtongroup",
614
+ inheritAttrs: !1,
617
615
  __name: "ButtonGroup",
618
616
  props: {
619
617
  span: {},
620
618
  gutter: { type: [Boolean, String] },
621
619
  align: { default: "right" }
622
620
  },
623
- setup(o) {
621
+ setup(r) {
624
622
  const m = S(() => ({
625
- textAlign: o.align
623
+ textAlign: r.align
626
624
  })), i = v();
627
625
  return (a, l) => (s(), p(e(c), {
628
626
  span: e(i),
@@ -642,9 +640,9 @@ const me = /* @__PURE__ */ h({
642
640
  _: 3
643
641
  }, 8, ["span", "style"]));
644
642
  }
645
- }), Oe = /* @__PURE__ */ h({
643
+ }), Be = /* @__PURE__ */ h({
646
644
  name: "OFormDiy",
647
- extendOptions: {},
645
+ inheritAttrs: !1,
648
646
  __name: "DiyItem",
649
647
  props: {
650
648
  name: {},
@@ -654,11 +652,11 @@ const me = /* @__PURE__ */ h({
654
652
  required: { type: Boolean },
655
653
  rules: {}
656
654
  },
657
- setup(o) {
658
- const m = v(), i = V();
655
+ setup(r) {
656
+ const m = v(), i = w();
659
657
  return (a, l) => (s(), p(e(c), { span: e(m) }, {
660
658
  default: u(() => [
661
- b(e(g), {
659
+ b(e(V), {
662
660
  prop: a.name,
663
661
  label: a.label,
664
662
  "label-width": a.labelWidth,
@@ -682,15 +680,15 @@ const me = /* @__PURE__ */ h({
682
680
  MultiSelect: ye,
683
681
  RadioGroup: ce,
684
682
  CheckboxGroup: ve,
685
- Checkbox: ge,
686
- Switch: Ve,
687
- DateInput: we,
683
+ Checkbox: Ve,
684
+ Switch: we,
685
+ DateInput: ge,
688
686
  FileInput: Se,
689
687
  ButtonGroup: qe,
690
- DiyItem: Oe
688
+ DiyItem: Be
691
689
  });
692
690
  export {
693
691
  $e as default,
694
- te as formContextKey
692
+ de as formContextKey
695
693
  };
696
694
  //# sourceMappingURL=index.js.map