orion-design 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. package/dist/Throne/index.d.ts +18 -0
  2. package/dist/Throne/index.js +20 -0
  3. package/dist/Throne/index.js.map +1 -0
  4. package/dist/_commonjsHelpers-DaMA6jEr.js +9 -0
  5. package/dist/_commonjsHelpers-DaMA6jEr.js.map +1 -0
  6. package/dist/components/Button/index.d.ts +2 -4
  7. package/dist/components/Button/index.js +12 -12
  8. package/dist/components/Button/index.js.map +1 -1
  9. package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
  10. package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
  11. package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
  12. package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  13. package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
  14. package/dist/components/Form/ButtonGroup/index.js +2 -0
  15. package/dist/components/Form/ButtonGroup/index.js.map +1 -0
  16. package/dist/components/Form/Checkbox/Checkbox.d.ts +10 -0
  17. package/dist/components/Form/Checkbox/Checkbox.js +2 -0
  18. package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
  19. package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
  20. package/dist/components/Form/Checkbox/index.d.ts +1 -0
  21. package/dist/components/Form/Checkbox/index.js +2 -0
  22. package/dist/components/Form/Checkbox/index.js.map +1 -0
  23. package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
  24. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
  25. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
  26. package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
  27. package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
  28. package/dist/components/Form/CheckboxGroup/index.js +2 -0
  29. package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
  30. package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
  31. package/dist/components/Form/DateInput/DateInput.js +2 -0
  32. package/dist/components/Form/DateInput/DateInput.js.map +1 -0
  33. package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
  34. package/dist/components/Form/DateInput/index.d.ts +1 -0
  35. package/dist/components/Form/DateInput/index.js +2 -0
  36. package/dist/components/Form/DateInput/index.js.map +1 -0
  37. package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
  38. package/dist/components/Form/FileInput/FileInput.js +2 -0
  39. package/dist/components/Form/FileInput/FileInput.js.map +1 -0
  40. package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
  41. package/dist/components/Form/FileInput/index.d.ts +1 -0
  42. package/dist/components/Form/FileInput/index.js +2 -0
  43. package/dist/components/Form/FileInput/index.js.map +1 -0
  44. package/dist/components/Form/Form.vue.d.ts +10 -10
  45. package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
  46. package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
  47. package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
  48. package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
  49. package/dist/components/Form/MultiSelect/index.d.ts +1 -0
  50. package/dist/components/Form/MultiSelect/index.js +2 -0
  51. package/dist/components/Form/MultiSelect/index.js.map +1 -0
  52. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +0 -2
  53. package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
  54. package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
  55. package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
  56. package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
  57. package/dist/components/Form/RadioGroup/index.d.ts +1 -0
  58. package/dist/components/Form/RadioGroup/index.js +2 -0
  59. package/dist/components/Form/RadioGroup/index.js.map +1 -0
  60. package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
  61. package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
  62. package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
  63. package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
  64. package/dist/components/Form/SingleSelect/index.d.ts +1 -0
  65. package/dist/components/Form/SingleSelect/index.js +2 -0
  66. package/dist/components/Form/SingleSelect/index.js.map +1 -0
  67. package/dist/components/Form/StringInput/StringInput.d.ts +0 -2
  68. package/dist/components/Form/Switch/Switch.d.ts +10 -0
  69. package/dist/components/Form/Switch/Switch.js +2 -0
  70. package/dist/components/Form/Switch/Switch.js.map +1 -0
  71. package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
  72. package/dist/components/Form/Switch/index.d.ts +1 -0
  73. package/dist/components/Form/Switch/index.js +2 -0
  74. package/dist/components/Form/Switch/index.js.map +1 -0
  75. package/dist/components/Form/Textarea/Textarea.d.ts +0 -2
  76. package/dist/components/Form/hooks/useForm.d.ts +6 -3
  77. package/dist/components/Form/hooks/useForm.js +40 -17
  78. package/dist/components/Form/hooks/useForm.js.map +1 -1
  79. package/dist/components/Form/index.d.ts +34 -6
  80. package/dist/components/Form/index.js +554 -88
  81. package/dist/components/Form/index.js.map +1 -1
  82. package/dist/components/Form/utils/index.d.ts +8 -0
  83. package/dist/components/Form/utils/index.js +26 -0
  84. package/dist/components/Form/utils/index.js.map +1 -0
  85. package/dist/components/Modal/index.d.ts +1 -1
  86. package/dist/components/Pagetable/Pagetable.d.ts +29 -17
  87. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
  88. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
  89. package/dist/components/Pagetable/columns/{PagetableDatecolumn.d.ts → PagetableColumnDate.d.ts} +17 -4
  90. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
  91. package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
  92. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
  93. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
  94. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
  95. package/dist/components/Pagetable/columns/{PagetableStringcolumn.d.ts → PagetableColumnString.d.ts} +17 -4
  96. package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
  97. package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
  98. package/dist/components/Pagetable/hooks/useColumns.js +96 -0
  99. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
  100. package/dist/components/Pagetable/index.d.ts +42 -17
  101. package/dist/components/Pagetable/index.js +496 -119
  102. package/dist/components/Pagetable/index.js.map +1 -1
  103. package/dist/components/Pagetable/utils/index.d.ts +15 -0
  104. package/dist/components/Pagetable/utils/index.js +169 -0
  105. package/dist/components/Pagetable/utils/index.js.map +1 -0
  106. package/dist/components/Space/index.d.ts +3 -3
  107. package/dist/components/_util/type.d.ts +4 -0
  108. package/dist/components/_util/type.js +8 -4
  109. package/dist/components/_util/type.js.map +1 -1
  110. package/dist/components/_util/vue/size.d.ts +1 -1
  111. package/dist/components/components.js +15 -14
  112. package/dist/components/components.js.map +1 -1
  113. package/dist/components/index.js +20 -19
  114. package/dist/components/index.js.map +1 -1
  115. package/dist/components-CutWiB7Q.js +68 -0
  116. package/dist/components-CutWiB7Q.js.map +1 -0
  117. package/dist/index-BbsXWo7C.js +44 -0
  118. package/dist/index-BbsXWo7C.js.map +1 -0
  119. package/dist/index.css +1 -1
  120. package/dist/index.d.ts +1 -0
  121. package/dist/index.js +22 -19
  122. package/dist/index.js.map +1 -1
  123. package/dist/utils/md5.js +77 -79
  124. package/dist/utils/md5.js.map +1 -1
  125. package/dist/version/version.d.ts +1 -1
  126. package/dist/version/version.js +1 -1
  127. package/dist/version/version.js.map +1 -1
  128. package/package.json +2 -1
  129. package/dist/components-BZukhWDk.js +0 -106
  130. package/dist/components-BZukhWDk.js.map +0 -1
  131. package/dist/utils/vue/install.d.ts +0 -6
  132. package/dist/utils/vue/install.js +0 -21
  133. package/dist/utils/vue/install.js.map +0 -1
  134. package/dist/utils/vue/typescript.d.ts +0 -5
  135. package/dist/utils/vue/typescript.js +0 -2
  136. package/dist/utils/vue/typescript.js.map +0 -1
@@ -1,12 +1,16 @@
1
- import { withInstall as B } from "../../utils/vue/install.js";
2
- import { defineComponent as p, mergeModels as S, useModel as F, useTemplateRef as R, provide as C, openBlock as b, createBlock as f, unref as a, withCtx as t, createVNode as m, renderSlot as W, computed as i, toRef as y } from "vue";
3
- import { ElForm as c, ElRow as z, ElCol as h, ElFormItem as v, ElInput as w } from "element-plus";
4
- import { formContextKey as I } from "./Form.js";
5
- import { useFormSpan as g, useFormRules as V, useFormContext as q } from "./hooks/useForm.js";
6
- const M = /* @__PURE__ */ p({
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";
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({
7
11
  name: "OForm",
8
12
  __name: "Form",
9
- props: /* @__PURE__ */ S({
13
+ props: /* @__PURE__ */ j({
10
14
  rules: {},
11
15
  itemSpan: { default: 8 },
12
16
  itemLabelWidth: { default: "auto" },
@@ -16,28 +20,28 @@ const M = /* @__PURE__ */ p({
16
20
  modelModifiers: {}
17
21
  }),
18
22
  emits: ["update:modelValue"],
19
- setup(o, { expose: u }) {
20
- const r = F(o, "modelValue"), n = R("formRef");
21
- return u({
22
- validate: async () => await n.value.validate()
23
- }), C(I, {
24
- model: r.value,
23
+ setup(o, { expose: p }) {
24
+ const s = H(o, "modelValue"), u = E("formRef");
25
+ return p({
26
+ validate: async () => await u.value.validate()
27
+ }), I(re, {
28
+ model: s.value,
25
29
  rules: o.rules,
26
30
  itemSpan: o.itemSpan
27
- }), (e, l) => (b(), f(a(c), {
31
+ }), (l, d) => (m(), f(e(X), {
28
32
  ref_key: "formRef",
29
- ref: n,
30
- modelValue: r.value,
31
- "onUpdate:modelValue": l[0] || (l[0] = (s) => r.value = s),
32
- model: r.value,
33
- rules: e.rules,
33
+ ref: u,
34
+ modelValue: s.value,
35
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => s.value = a),
36
+ model: s.value,
37
+ rules: l.rules,
34
38
  "label-width": o.itemLabelWidth,
35
- disabled: e.disabled
39
+ disabled: l.disabled
36
40
  }, {
37
41
  default: t(() => [
38
- m(a(z), { gutter: 16 }, {
42
+ h(e(Z), { gutter: 16 }, {
39
43
  default: t(() => [
40
- W(e.$slots, "default")
44
+ D(l.$slots, "default")
41
45
  ]),
42
46
  _: 3
43
47
  })
@@ -45,7 +49,7 @@ const M = /* @__PURE__ */ p({
45
49
  _: 3
46
50
  }, 8, ["modelValue", "model", "rules", "label-width", "disabled"]));
47
51
  }
48
- }), E = /* @__PURE__ */ p({
52
+ }), ie = /* @__PURE__ */ v({
49
53
  name: "OFormString",
50
54
  __name: "StringInput",
51
55
  props: {
@@ -58,30 +62,28 @@ const M = /* @__PURE__ */ p({
58
62
  maxlength: {},
59
63
  placeholder: {},
60
64
  disabled: { type: Boolean },
61
- readonly: { type: Boolean },
62
- style: {}
65
+ readonly: { type: Boolean }
63
66
  },
64
67
  setup(o) {
65
- const u = i(() => g()), r = i(() => V()), n = q(), d = y(n.model, o.name);
66
- return (e, l) => (b(), f(a(h), { span: u.value }, {
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) }, {
67
70
  default: t(() => [
68
- m(a(v), {
69
- prop: e.name,
70
- label: e.label,
71
- "label-width": e.labelWidth,
72
- required: e.required,
73
- rules: r.value
71
+ h(e(q), {
72
+ prop: l.name,
73
+ label: l.label,
74
+ "label-width": l.labelWidth,
75
+ required: l.required,
76
+ rules: e(s)
74
77
  }, {
75
78
  default: t(() => [
76
- m(a(w), {
77
- modelValue: d.value,
78
- "onUpdate:modelValue": l[0] || (l[0] = (s) => d.value = s),
79
- maxlength: e.maxlength,
80
- placeholder: e.placeholder,
81
- disabled: e.disabled,
82
- readonly: e.readonly,
83
- "input-style": e.style
84
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style"])
79
+ h(e(C), {
80
+ modelValue: n.value,
81
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => n.value = a),
82
+ maxlength: l.maxlength,
83
+ placeholder: l.placeholder,
84
+ disabled: l.disabled,
85
+ readonly: l.readonly
86
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
85
87
  ]),
86
88
  _: 1
87
89
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -89,7 +91,7 @@ const M = /* @__PURE__ */ p({
89
91
  _: 1
90
92
  }, 8, ["span"]));
91
93
  }
92
- }), O = /* @__PURE__ */ p({
94
+ }), se = /* @__PURE__ */ v({
93
95
  name: "OFormPassword",
94
96
  __name: "PasswordInput",
95
97
  props: {
@@ -102,31 +104,29 @@ const M = /* @__PURE__ */ p({
102
104
  maxlength: {},
103
105
  placeholder: {},
104
106
  disabled: { type: Boolean },
105
- readonly: { type: Boolean },
106
- style: {}
107
+ readonly: { type: Boolean }
107
108
  },
108
109
  setup(o) {
109
- const u = i(() => g()), r = i(() => V()), n = q(), d = y(n.model, o.name);
110
- return (e, l) => (b(), f(a(h), { span: u.value }, {
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) }, {
111
112
  default: t(() => [
112
- m(a(v), {
113
- prop: e.name,
114
- label: e.label,
115
- "label-width": e.labelWidth,
116
- required: e.required,
117
- rules: r.value
113
+ h(e(q), {
114
+ prop: l.name,
115
+ label: l.label,
116
+ "label-width": l.labelWidth,
117
+ required: l.required,
118
+ rules: e(s)
118
119
  }, {
119
120
  default: t(() => [
120
- m(a(w), {
121
- modelValue: d.value,
122
- "onUpdate:modelValue": l[0] || (l[0] = (s) => d.value = s),
123
- maxlength: e.maxlength,
124
- placeholder: e.placeholder,
125
- disabled: e.disabled,
126
- readonly: e.readonly,
127
- "input-style": e.style,
121
+ h(e(C), {
122
+ modelValue: n.value,
123
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => n.value = a),
124
+ maxlength: l.maxlength,
125
+ placeholder: l.placeholder,
126
+ disabled: l.disabled,
127
+ readonly: l.readonly,
128
128
  type: "password"
129
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style"])
129
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
130
130
  ]),
131
131
  _: 1
132
132
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -134,7 +134,7 @@ const M = /* @__PURE__ */ p({
134
134
  _: 1
135
135
  }, 8, ["span"]));
136
136
  }
137
- }), T = /* @__PURE__ */ p({
137
+ }), me = /* @__PURE__ */ v({
138
138
  name: "OFormTextarea",
139
139
  __name: "Textarea",
140
140
  props: {
@@ -148,33 +148,89 @@ const M = /* @__PURE__ */ p({
148
148
  placeholder: {},
149
149
  disabled: { type: Boolean },
150
150
  readonly: { type: Boolean },
151
- style: {},
152
151
  rows: {}
153
152
  },
154
153
  setup(o) {
155
- const u = i(() => g()), r = i(() => V()), n = q(), d = y(n.model, o.name);
156
- return (e, l) => (b(), f(a(h), { span: u.value }, {
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) }, {
157
156
  default: t(() => [
158
- m(a(v), {
159
- prop: e.name,
160
- label: e.label,
161
- "label-width": e.labelWidth,
162
- required: e.required,
163
- rules: r.value
157
+ h(e(q), {
158
+ prop: l.name,
159
+ label: l.label,
160
+ "label-width": l.labelWidth,
161
+ required: l.required,
162
+ rules: e(s)
164
163
  }, {
165
164
  default: t(() => [
166
- m(a(w), {
167
- modelValue: d.value,
168
- "onUpdate:modelValue": l[0] || (l[0] = (s) => d.value = s),
169
- maxlength: e.maxlength,
170
- placeholder: e.placeholder,
171
- disabled: e.disabled,
172
- readonly: e.readonly,
173
- "input-style": e.style,
165
+ h(e(C), {
166
+ modelValue: n.value,
167
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => n.value = a),
168
+ maxlength: l.maxlength,
169
+ placeholder: l.placeholder,
170
+ disabled: l.disabled,
171
+ readonly: l.readonly,
174
172
  type: "textarea",
175
- rows: e.rows,
173
+ rows: l.rows,
176
174
  resize: "none"
177
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style", "rows"])
175
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "rows"])
176
+ ]),
177
+ _: 1
178
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
179
+ ]),
180
+ _: 1
181
+ }, 8, ["span"]));
182
+ }
183
+ }), pe = /* @__PURE__ */ v({
184
+ name: "OFormSingleselect",
185
+ __name: "SingleSelect",
186
+ props: {
187
+ name: {},
188
+ label: {},
189
+ span: {},
190
+ labelWidth: {},
191
+ required: { type: Boolean },
192
+ rules: {},
193
+ placeholder: {},
194
+ disabled: { type: Boolean },
195
+ code: {},
196
+ clearable: { type: Boolean },
197
+ filterable: { type: Boolean }
198
+ },
199
+ 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)
209
+ }, {
210
+ default: t(() => [
211
+ e(u) ? (m(), f(e(C), {
212
+ key: 0,
213
+ "model-value": l.value,
214
+ placeholder: i.placeholder,
215
+ disabled: !0,
216
+ readonly: !0
217
+ }, null, 8, ["model-value", "placeholder"])) : (m(), f(e($), {
218
+ key: 1,
219
+ 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
224
+ }, {
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
230
+ }, null, 8, ["label", "value"]))), 128))
231
+ ]),
232
+ _: 1
233
+ }, 8, ["modelValue", "placeholder", "clearable", "filterable"]))
178
234
  ]),
179
235
  _: 1
180
236
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -182,13 +238,423 @@ const M = /* @__PURE__ */ p({
182
238
  _: 1
183
239
  }, 8, ["span"]));
184
240
  }
185
- }), K = B(M, {
186
- StringInput: E,
187
- PasswordInput: O,
188
- Textarea: T
241
+ }), be = /* @__PURE__ */ v({
242
+ name: "OFormMultiselect",
243
+ __name: "MultiSelect",
244
+ props: {
245
+ name: {},
246
+ label: {},
247
+ span: {},
248
+ labelWidth: {},
249
+ required: { type: Boolean },
250
+ rules: {},
251
+ placeholder: {},
252
+ disabled: { type: Boolean },
253
+ code: {}
254
+ },
255
+ 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({
257
+ get: () => a.value ? a.value.split(",") : [],
258
+ set: (b) => {
259
+ b ? a.value = b.join(",") : a.value = "";
260
+ }
261
+ });
262
+ return (b, r) => (m(), f(e(c), { span: e(p) }, {
263
+ default: t(() => [
264
+ h(e(q), {
265
+ prop: b.name,
266
+ label: b.label,
267
+ "label-width": b.labelWidth,
268
+ required: b.required,
269
+ rules: e(s)
270
+ }, {
271
+ default: t(() => [
272
+ e(u) ? (m(), f(e(C), {
273
+ key: 0,
274
+ "model-value": l.value,
275
+ placeholder: b.placeholder,
276
+ disabled: !0,
277
+ readonly: !0
278
+ }, null, 8, ["model-value", "placeholder"])) : (m(), f(e($), {
279
+ key: 1,
280
+ modelValue: i.value,
281
+ "onUpdate:modelValue": r[0] || (r[0] = (V) => i.value = V),
282
+ placeholder: b.placeholder,
283
+ multiple: ""
284
+ }, {
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
290
+ }, null, 8, ["label", "value"]))), 128))
291
+ ]),
292
+ _: 1
293
+ }, 8, ["modelValue", "placeholder"]))
294
+ ]),
295
+ _: 1
296
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
297
+ ]),
298
+ _: 1
299
+ }, 8, ["span"]));
300
+ }
301
+ }), fe = /* @__PURE__ */ v({
302
+ name: "OFormRadiogroup",
303
+ __name: "RadioGroup",
304
+ props: {
305
+ name: {},
306
+ label: {},
307
+ span: {},
308
+ labelWidth: {},
309
+ required: { type: Boolean },
310
+ rules: {},
311
+ disabled: { type: Boolean },
312
+ code: {}
313
+ },
314
+ 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)
324
+ }, {
325
+ default: t(() => [
326
+ h(e(x), {
327
+ modelValue: l.value,
328
+ "onUpdate:modelValue": a[0] || (a[0] = (i) => l.value = i),
329
+ disabled: d.disabled
330
+ }, {
331
+ default: t(() => [
332
+ (m(!0), z(F, null, k(e(u), (i) => (m(), f(e(_), {
333
+ key: i.value,
334
+ value: i.value
335
+ }, {
336
+ default: t(() => [
337
+ L(N(i.content), 1)
338
+ ]),
339
+ _: 2
340
+ }, 1032, ["value"]))), 128))
341
+ ]),
342
+ _: 1
343
+ }, 8, ["modelValue", "disabled"])
344
+ ]),
345
+ _: 1
346
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
347
+ ]),
348
+ _: 1
349
+ }, 8, ["span"]));
350
+ }
351
+ }), he = /* @__PURE__ */ v({
352
+ name: "OFormCheckboxgroup",
353
+ __name: "CheckboxGroup",
354
+ props: {
355
+ name: {},
356
+ label: {},
357
+ span: {},
358
+ labelWidth: {},
359
+ required: { type: Boolean },
360
+ rules: {},
361
+ disabled: { type: Boolean },
362
+ code: {}
363
+ },
364
+ setup(o) {
365
+ const p = y(), s = S(), u = W(), n = w(), l = g(n.model, o.name), d = B({
366
+ get: () => l.value ? l.value.split(",") : [],
367
+ set: (a) => {
368
+ a ? l.value = a.join(",") : l.value = "";
369
+ }
370
+ });
371
+ return (a, i) => (m(), f(e(c), { span: e(p) }, {
372
+ default: t(() => [
373
+ h(e(q), {
374
+ prop: a.name,
375
+ label: a.label,
376
+ "label-width": a.labelWidth,
377
+ required: a.required,
378
+ rules: e(s)
379
+ }, {
380
+ default: t(() => [
381
+ h(e(ee), {
382
+ modelValue: d.value,
383
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => d.value = b),
384
+ disabled: a.disabled
385
+ }, {
386
+ default: t(() => [
387
+ (m(!0), z(F, null, k(e(u), (b) => (m(), f(e(T), {
388
+ key: b.value,
389
+ label: b.content,
390
+ value: b.value
391
+ }, null, 8, ["label", "value"]))), 128))
392
+ ]),
393
+ _: 1
394
+ }, 8, ["modelValue", "disabled"])
395
+ ]),
396
+ _: 1
397
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
398
+ ]),
399
+ _: 1
400
+ }, 8, ["span"]));
401
+ }
402
+ }), ve = /* @__PURE__ */ v({
403
+ name: "OFormCheckbox",
404
+ __name: "Checkbox",
405
+ props: {
406
+ name: {},
407
+ label: {},
408
+ span: {},
409
+ labelWidth: {},
410
+ required: { type: Boolean },
411
+ rules: {},
412
+ disabled: { type: Boolean }
413
+ },
414
+ 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)
424
+ }, {
425
+ default: t(() => [
426
+ h(e(T), {
427
+ modelValue: n.value,
428
+ "onUpdate:modelValue": d[0] || (d[0] = (a) => n.value = a),
429
+ disabled: l.disabled,
430
+ "true-value": "1",
431
+ "false-value": "0"
432
+ }, null, 8, ["modelValue", "disabled"])
433
+ ]),
434
+ _: 1
435
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
436
+ ]),
437
+ _: 1
438
+ }, 8, ["span"]));
439
+ }
440
+ }), ce = /* @__PURE__ */ v({
441
+ name: "OFormSwitch",
442
+ __name: "Switch",
443
+ props: {
444
+ name: {},
445
+ label: {},
446
+ span: {},
447
+ labelWidth: {},
448
+ required: { type: Boolean },
449
+ rules: {},
450
+ disabled: { type: Boolean }
451
+ },
452
+ 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)
462
+ }, {
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,
468
+ "active-value": "1",
469
+ "inactive-value": "0"
470
+ }, null, 8, ["modelValue", "disabled"])
471
+ ]),
472
+ _: 1
473
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
474
+ ]),
475
+ _: 1
476
+ }, 8, ["span"]));
477
+ }
478
+ }), ye = /* @__PURE__ */ v({
479
+ name: "OFormDate",
480
+ __name: "DateInput",
481
+ props: {
482
+ name: {},
483
+ label: {},
484
+ span: {},
485
+ labelWidth: {},
486
+ required: { type: Boolean },
487
+ rules: {},
488
+ maxlength: {},
489
+ placeholder: {},
490
+ disabled: { type: Boolean },
491
+ readonly: { type: Boolean },
492
+ editable: { type: Boolean },
493
+ clearable: { type: Boolean },
494
+ format: { default: "YYYY-MM-DD" },
495
+ sourceFormat: {}
496
+ },
497
+ setup(o) {
498
+ const p = y(), s = S(), u = B(
499
+ () => 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(() => {
504
+ if (G(a.value))
505
+ return "string";
506
+ if (P(a.value))
507
+ return "date";
508
+ throw new R("日期输入框的值只能为字符串或日期类型");
509
+ }), b = B({
510
+ get: () => {
511
+ if (a.value) {
512
+ if (i.value == "date")
513
+ return a.value;
514
+ {
515
+ const r = O(a.value, n.value, !0);
516
+ if (!r.isValid())
517
+ throw new R(`日期输入框的值无效,不符合${n.value}格式`);
518
+ return r.toDate();
519
+ }
520
+ }
521
+ },
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 = "";
524
+ }
525
+ });
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)
534
+ }, {
535
+ default: t(() => [
536
+ u.value ? (m(), f(e(ae), {
537
+ key: 0,
538
+ 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), {
548
+ key: 1,
549
+ 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,
556
+ type: l.value,
557
+ format: n.value
558
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
559
+ ]),
560
+ _: 1
561
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
562
+ ]),
563
+ _: 1
564
+ }, 8, ["span"]));
565
+ }
566
+ }), ge = /* @__PURE__ */ v({
567
+ name: "OFormFile",
568
+ __name: "FileInput",
569
+ props: {
570
+ name: {},
571
+ label: {},
572
+ span: {},
573
+ labelWidth: {},
574
+ required: { type: Boolean },
575
+ rules: {},
576
+ disabled: { type: Boolean }
577
+ },
578
+ 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];
584
+ };
585
+ });
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), {
590
+ prop: a.name,
591
+ label: a.label,
592
+ "label-width": a.labelWidth,
593
+ required: a.required,
594
+ rules: e(s)
595
+ }, {
596
+ default: t(() => [
597
+ h(e(C), {
598
+ ref_key: "fileRef",
599
+ ref: n,
600
+ modelValue: u.value,
601
+ "onUpdate:modelValue": i[0] || (i[0] = (b) => u.value = b),
602
+ disabled: a.disabled,
603
+ type: "file"
604
+ }, null, 8, ["modelValue", "disabled"])
605
+ ]),
606
+ _: 1
607
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
608
+ ]),
609
+ _: 1
610
+ }, 8, ["span"]));
611
+ }
612
+ }), qe = /* @__PURE__ */ v({
613
+ name: "OFormButtongroup",
614
+ __name: "ButtonGroup",
615
+ props: {
616
+ span: {},
617
+ gutter: { type: [Boolean, String] },
618
+ align: { default: "right" }
619
+ },
620
+ setup(o) {
621
+ const p = B(() => ({
622
+ textAlign: o.align
623
+ })), s = y();
624
+ return (u, n) => (m(), f(e(c), {
625
+ span: e(s),
626
+ style: J(p.value)
627
+ }, {
628
+ default: t(() => [
629
+ h(e(te), {
630
+ gutter: u.gutter,
631
+ style: { "margin-bottom": "18px" }
632
+ }, {
633
+ default: t(() => [
634
+ D(u.$slots, "default")
635
+ ]),
636
+ _: 3
637
+ }, 8, ["gutter"])
638
+ ]),
639
+ _: 3
640
+ }, 8, ["span", "style"]));
641
+ }
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,
651
+ Switch: ce,
652
+ DateInput: ye,
653
+ FileInput: ge,
654
+ ButtonGroup: qe
189
655
  });
190
656
  export {
191
- K as default,
192
- I as formContextKey
657
+ Me as default,
658
+ re as formContextKey
193
659
  };
194
660
  //# sourceMappingURL=index.js.map