orion-design 0.1.6 → 0.1.7

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