orion-design 0.1.5 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (156) hide show
  1. package/dist/Throne/index.d.ts +10 -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/Button.vue.d.ts +15 -1
  7. package/dist/components/Button/ButtonGroup/ButtonGroup.d.ts +4 -0
  8. package/dist/components/Button/ButtonGroup/ButtonGroup.js +2 -0
  9. package/dist/components/Button/ButtonGroup/ButtonGroup.js.map +1 -0
  10. package/dist/components/Button/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  11. package/dist/components/Button/ButtonGroup/index.d.ts +1 -0
  12. package/dist/components/Button/ButtonGroup/index.js +2 -0
  13. package/dist/components/Button/ButtonGroup/index.js.map +1 -0
  14. package/dist/components/Button/index.d.ts +21 -4
  15. package/dist/components/Button/index.js +37 -19
  16. package/dist/components/Button/index.js.map +1 -1
  17. package/dist/components/Form/ButtonGroup/ButtonGroup.d.ts +5 -0
  18. package/dist/components/Form/ButtonGroup/ButtonGroup.js +2 -0
  19. package/dist/components/Form/ButtonGroup/ButtonGroup.js.map +1 -0
  20. package/dist/components/Form/ButtonGroup/ButtonGroup.vue.d.ts +17 -0
  21. package/dist/components/Form/ButtonGroup/index.d.ts +1 -0
  22. package/dist/components/Form/ButtonGroup/index.js +2 -0
  23. package/dist/components/Form/ButtonGroup/index.js.map +1 -0
  24. package/dist/components/Form/Checkbox/Checkbox.d.ts +9 -0
  25. package/dist/components/Form/Checkbox/Checkbox.js +2 -0
  26. package/dist/components/Form/Checkbox/Checkbox.js.map +1 -0
  27. package/dist/components/Form/Checkbox/Checkbox.vue.d.ts +3 -0
  28. package/dist/components/Form/Checkbox/index.d.ts +1 -0
  29. package/dist/components/Form/Checkbox/index.js +2 -0
  30. package/dist/components/Form/Checkbox/index.js.map +1 -0
  31. package/dist/components/Form/CheckboxGroup/CheckboxGroup.d.ts +14 -0
  32. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +2 -0
  33. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js.map +1 -0
  34. package/dist/components/Form/CheckboxGroup/CheckboxGroup.vue.d.ts +3 -0
  35. package/dist/components/Form/CheckboxGroup/index.d.ts +1 -0
  36. package/dist/components/Form/CheckboxGroup/index.js +2 -0
  37. package/dist/components/Form/CheckboxGroup/index.js.map +1 -0
  38. package/dist/components/Form/DateInput/DateInput.d.ts +17 -0
  39. package/dist/components/Form/DateInput/DateInput.js +2 -0
  40. package/dist/components/Form/DateInput/DateInput.js.map +1 -0
  41. package/dist/components/Form/DateInput/DateInput.vue.d.ts +3 -0
  42. package/dist/components/Form/DateInput/index.d.ts +1 -0
  43. package/dist/components/Form/DateInput/index.js +2 -0
  44. package/dist/components/Form/DateInput/index.js.map +1 -0
  45. package/dist/components/Form/DiyItem/DiyItem.d.ts +9 -0
  46. package/dist/components/Form/DiyItem/DiyItem.js +2 -0
  47. package/dist/components/Form/DiyItem/DiyItem.js.map +1 -0
  48. package/dist/components/Form/DiyItem/DiyItem.vue.d.ts +17 -0
  49. package/dist/components/Form/DiyItem/index.d.ts +1 -0
  50. package/dist/components/Form/DiyItem/index.js +2 -0
  51. package/dist/components/Form/DiyItem/index.js.map +1 -0
  52. package/dist/components/Form/FileInput/FileInput.d.ts +10 -0
  53. package/dist/components/Form/FileInput/FileInput.js +2 -0
  54. package/dist/components/Form/FileInput/FileInput.js.map +1 -0
  55. package/dist/components/Form/FileInput/FileInput.vue.d.ts +451 -0
  56. package/dist/components/Form/FileInput/index.d.ts +1 -0
  57. package/dist/components/Form/FileInput/index.js +2 -0
  58. package/dist/components/Form/FileInput/index.js.map +1 -0
  59. package/dist/components/Form/Form.d.ts +1 -0
  60. package/dist/components/Form/Form.js.map +1 -1
  61. package/dist/components/Form/Form.vue.d.ts +10 -10
  62. package/dist/components/Form/MultiSelect/MultiSelect.d.ts +15 -0
  63. package/dist/components/Form/MultiSelect/MultiSelect.js +2 -0
  64. package/dist/components/Form/MultiSelect/MultiSelect.js.map +1 -0
  65. package/dist/components/Form/MultiSelect/MultiSelect.vue.d.ts +3 -0
  66. package/dist/components/Form/MultiSelect/index.d.ts +1 -0
  67. package/dist/components/Form/MultiSelect/index.js +2 -0
  68. package/dist/components/Form/MultiSelect/index.js.map +1 -0
  69. package/dist/components/Form/PasswordInput/PasswordInput.d.ts +0 -2
  70. package/dist/components/Form/RadioGroup/RadioGroup.d.ts +14 -0
  71. package/dist/components/Form/RadioGroup/RadioGroup.js +2 -0
  72. package/dist/components/Form/RadioGroup/RadioGroup.js.map +1 -0
  73. package/dist/components/Form/RadioGroup/RadioGroup.vue.d.ts +3 -0
  74. package/dist/components/Form/RadioGroup/index.d.ts +1 -0
  75. package/dist/components/Form/RadioGroup/index.js +2 -0
  76. package/dist/components/Form/RadioGroup/index.js.map +1 -0
  77. package/dist/components/Form/SingleSelect/SingleSelect.d.ts +17 -0
  78. package/dist/components/Form/SingleSelect/SingleSelect.js +2 -0
  79. package/dist/components/Form/SingleSelect/SingleSelect.js.map +1 -0
  80. package/dist/components/Form/SingleSelect/SingleSelect.vue.d.ts +3 -0
  81. package/dist/components/Form/SingleSelect/index.d.ts +1 -0
  82. package/dist/components/Form/SingleSelect/index.js +2 -0
  83. package/dist/components/Form/SingleSelect/index.js.map +1 -0
  84. package/dist/components/Form/StringInput/StringInput.d.ts +0 -2
  85. package/dist/components/Form/Switch/Switch.d.ts +9 -0
  86. package/dist/components/Form/Switch/Switch.js +2 -0
  87. package/dist/components/Form/Switch/Switch.js.map +1 -0
  88. package/dist/components/Form/Switch/Switch.vue.d.ts +3 -0
  89. package/dist/components/Form/Switch/index.d.ts +1 -0
  90. package/dist/components/Form/Switch/index.js +2 -0
  91. package/dist/components/Form/Switch/index.js.map +1 -0
  92. package/dist/components/Form/Textarea/Textarea.d.ts +0 -2
  93. package/dist/components/Form/hooks/useForm.d.ts +5 -3
  94. package/dist/components/Form/hooks/useForm.js +40 -17
  95. package/dist/components/Form/hooks/useForm.js.map +1 -1
  96. package/dist/components/Form/index.d.ts +37 -6
  97. package/dist/components/Form/index.js +612 -100
  98. package/dist/components/Form/index.js.map +1 -1
  99. package/dist/components/Form/utils/index.d.ts +8 -0
  100. package/dist/components/Form/utils/index.js +26 -0
  101. package/dist/components/Form/utils/index.js.map +1 -0
  102. package/dist/components/Modal/index.d.ts +1 -1
  103. package/dist/components/Pagetable/Pagetable.d.ts +29 -17
  104. package/dist/components/Pagetable/columns/PagetableCellButton.d.ts +24 -0
  105. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +78 -0
  106. package/dist/components/Pagetable/columns/{PagetableDatecolumn.d.ts → PagetableColumnDate.d.ts} +17 -4
  107. package/dist/components/Pagetable/columns/PagetableColumnDiy.d.ts +78 -0
  108. package/dist/components/Pagetable/columns/PagetableColumnIndex.d.ts +5 -0
  109. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +109 -0
  110. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +114 -0
  111. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +109 -0
  112. package/dist/components/Pagetable/columns/{PagetableStringcolumn.d.ts → PagetableColumnString.d.ts} +17 -4
  113. package/dist/components/Pagetable/columns/PagetableColumngroup.d.ts +35 -0
  114. package/dist/components/Pagetable/hooks/useColumns.d.ts +1 -0
  115. package/dist/components/Pagetable/hooks/useColumns.js +96 -0
  116. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -0
  117. package/dist/components/Pagetable/index.d.ts +42 -17
  118. package/dist/components/Pagetable/index.js +496 -119
  119. package/dist/components/Pagetable/index.js.map +1 -1
  120. package/dist/components/Pagetable/utils/index.d.ts +15 -0
  121. package/dist/components/Pagetable/utils/index.js +169 -0
  122. package/dist/components/Pagetable/utils/index.js.map +1 -0
  123. package/dist/components/Space/index.d.ts +3 -3
  124. package/dist/components/_util/type.d.ts +4 -0
  125. package/dist/components/_util/type.js +8 -4
  126. package/dist/components/_util/type.js.map +1 -1
  127. package/dist/components/_util/vue/size.d.ts +1 -1
  128. package/dist/components/components.js +15 -14
  129. package/dist/components/components.js.map +1 -1
  130. package/dist/components/index.js +20 -19
  131. package/dist/components/index.js.map +1 -1
  132. package/dist/components/types.d.ts +11 -0
  133. package/dist/components/types.js +2 -0
  134. package/dist/components/types.js.map +1 -0
  135. package/dist/components-CutWiB7Q.js +68 -0
  136. package/dist/components-CutWiB7Q.js.map +1 -0
  137. package/dist/index-BbsXWo7C.js +44 -0
  138. package/dist/index-BbsXWo7C.js.map +1 -0
  139. package/dist/index.css +1 -1
  140. package/dist/index.d.ts +1 -0
  141. package/dist/index.js +22 -19
  142. package/dist/index.js.map +1 -1
  143. package/dist/utils/md5.js +77 -79
  144. package/dist/utils/md5.js.map +1 -1
  145. package/dist/version/version.d.ts +1 -1
  146. package/dist/version/version.js +1 -1
  147. package/dist/version/version.js.map +1 -1
  148. package/package.json +7 -3
  149. package/dist/components-BZukhWDk.js +0 -106
  150. package/dist/components-BZukhWDk.js.map +0 -1
  151. package/dist/utils/vue/install.d.ts +0 -6
  152. package/dist/utils/vue/install.js +0 -21
  153. package/dist/utils/vue/install.js.map +0 -1
  154. package/dist/utils/vue/typescript.d.ts +0 -5
  155. package/dist/utils/vue/typescript.js +0 -2
  156. package/dist/utils/vue/typescript.js.map +0 -1
@@ -1,14 +1,18 @@
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 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
+ import { getSingleCodeContent as ne, getMultiCodeContent as de } from "./utils/index.js";
8
+ import D from "../../error/OrionError.js";
9
+ import { S as ue } from "../../index-BbsXWo7C.js";
10
+ const ie = /* @__PURE__ */ y({
7
11
  name: "OForm",
8
12
  __name: "Form",
9
- props: /* @__PURE__ */ S({
13
+ props: /* @__PURE__ */ j({
10
14
  rules: {},
11
- itemSpan: { default: 8 },
15
+ itemSpan: { default: 6 },
12
16
  itemLabelWidth: { default: "auto" },
13
17
  disabled: { type: Boolean, default: !1 }
14
18
  }, {
@@ -16,28 +20,32 @@ 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,
25
- rules: o.rules,
26
- itemSpan: o.itemSpan
27
- }), (e, l) => (b(), f(a(c), {
23
+ setup(o, { expose: p }) {
24
+ const i = I(o, "modelValue"), t = $("formRef");
25
+ return p({
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), {
28
36
  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,
34
- "label-width": o.itemLabelWidth,
35
- disabled: e.disabled
37
+ ref: t,
38
+ modelValue: i.value,
39
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => i.value = a),
40
+ model: i.value,
41
+ rules: l.rules,
42
+ "label-width": l.itemLabelWidth,
43
+ disabled: l.disabled
36
44
  }, {
37
- default: t(() => [
38
- m(a(z), { gutter: 16 }, {
39
- default: t(() => [
40
- W(e.$slots, "default")
45
+ default: d(() => [
46
+ h(e(x), { gutter: 16 }, {
47
+ default: d(() => [
48
+ M(l.$slots, "default")
41
49
  ]),
42
50
  _: 3
43
51
  })
@@ -45,8 +53,9 @@ const M = /* @__PURE__ */ p({
45
53
  _: 3
46
54
  }, 8, ["modelValue", "model", "rules", "label-width", "disabled"]));
47
55
  }
48
- }), E = /* @__PURE__ */ p({
56
+ }), se = /* @__PURE__ */ y({
49
57
  name: "OFormString",
58
+ extendOptions: { trigger: "blur" },
50
59
  __name: "StringInput",
51
60
  props: {
52
61
  name: {},
@@ -58,30 +67,28 @@ const M = /* @__PURE__ */ p({
58
67
  maxlength: {},
59
68
  placeholder: {},
60
69
  disabled: { type: Boolean },
61
- readonly: { type: Boolean },
62
- style: {}
70
+ readonly: { type: Boolean }
63
71
  },
64
72
  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 }, {
67
- 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
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), {
77
+ prop: l.name,
78
+ label: l.label,
79
+ "label-width": l.labelWidth,
80
+ required: l.required,
81
+ rules: e(i)
74
82
  }, {
75
- 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"])
83
+ default: d(() => [
84
+ h(e(B), {
85
+ modelValue: r.value,
86
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
87
+ maxlength: l.maxlength,
88
+ placeholder: l.placeholder,
89
+ disabled: l.disabled,
90
+ readonly: l.readonly
91
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
85
92
  ]),
86
93
  _: 1
87
94
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -89,8 +96,9 @@ const M = /* @__PURE__ */ p({
89
96
  _: 1
90
97
  }, 8, ["span"]));
91
98
  }
92
- }), O = /* @__PURE__ */ p({
99
+ }), me = /* @__PURE__ */ y({
93
100
  name: "OFormPassword",
101
+ extendOptions: { trigger: "blur" },
94
102
  __name: "PasswordInput",
95
103
  props: {
96
104
  name: {},
@@ -102,31 +110,29 @@ const M = /* @__PURE__ */ p({
102
110
  maxlength: {},
103
111
  placeholder: {},
104
112
  disabled: { type: Boolean },
105
- readonly: { type: Boolean },
106
- style: {}
113
+ readonly: { type: Boolean }
107
114
  },
108
115
  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 }, {
111
- 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
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), {
120
+ prop: l.name,
121
+ label: l.label,
122
+ "label-width": l.labelWidth,
123
+ required: l.required,
124
+ rules: e(i)
118
125
  }, {
119
- 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,
126
+ default: d(() => [
127
+ h(e(B), {
128
+ modelValue: r.value,
129
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
130
+ maxlength: l.maxlength,
131
+ placeholder: l.placeholder,
132
+ disabled: l.disabled,
133
+ readonly: l.readonly,
128
134
  type: "password"
129
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style"])
135
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
130
136
  ]),
131
137
  _: 1
132
138
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -134,8 +140,9 @@ const M = /* @__PURE__ */ p({
134
140
  _: 1
135
141
  }, 8, ["span"]));
136
142
  }
137
- }), T = /* @__PURE__ */ p({
143
+ }), pe = /* @__PURE__ */ y({
138
144
  name: "OFormTextarea",
145
+ extendOptions: { trigger: "blur" },
139
146
  __name: "Textarea",
140
147
  props: {
141
148
  name: {},
@@ -148,33 +155,202 @@ const M = /* @__PURE__ */ p({
148
155
  placeholder: {},
149
156
  disabled: { type: Boolean },
150
157
  readonly: { type: Boolean },
151
- style: {},
152
158
  rows: {}
153
159
  },
154
160
  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 }, {
157
- 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
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), {
165
+ prop: l.name,
166
+ label: l.label,
167
+ "label-width": l.labelWidth,
168
+ required: l.required,
169
+ rules: e(i)
164
170
  }, {
165
- 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,
171
+ default: d(() => [
172
+ h(e(B), {
173
+ modelValue: r.value,
174
+ "onUpdate:modelValue": u[0] || (u[0] = (a) => r.value = a),
175
+ maxlength: l.maxlength,
176
+ placeholder: l.placeholder,
177
+ disabled: l.disabled,
178
+ readonly: l.readonly,
174
179
  type: "textarea",
175
- rows: e.rows,
180
+ rows: l.rows,
176
181
  resize: "none"
177
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "input-style", "rows"])
182
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "rows"])
183
+ ]),
184
+ _: 1
185
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
186
+ ]),
187
+ _: 1
188
+ }, 8, ["span"]));
189
+ }
190
+ }), be = /* @__PURE__ */ y({
191
+ name: "OFormSingleselect",
192
+ extendOptions: {},
193
+ __name: "SingleSelect",
194
+ props: {
195
+ name: {},
196
+ label: {},
197
+ span: {},
198
+ labelWidth: {},
199
+ required: { type: Boolean },
200
+ rules: {},
201
+ placeholder: {},
202
+ disabled: { type: Boolean },
203
+ code: {},
204
+ clearable: { type: Boolean },
205
+ filterable: { type: Boolean }
206
+ },
207
+ setup(o) {
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)
217
+ }, {
218
+ default: d(() => [
219
+ e(t) ? (m(), f(e(B), {
220
+ key: 0,
221
+ "model-value": l.value,
222
+ placeholder: s.placeholder,
223
+ disabled: !0,
224
+ readonly: !0
225
+ }, null, 8, ["model-value", "placeholder"])) : (m(), f(e(E), {
226
+ key: 1,
227
+ modelValue: a.value,
228
+ "onUpdate:modelValue": b[0] || (b[0] = (n) => a.value = n),
229
+ placeholder: s.placeholder,
230
+ clearable: s.clearable,
231
+ filterable: s.filterable
232
+ }, {
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
238
+ }, null, 8, ["label", "value"]))), 128))
239
+ ]),
240
+ _: 1
241
+ }, 8, ["modelValue", "placeholder", "clearable", "filterable"]))
242
+ ]),
243
+ _: 1
244
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
245
+ ]),
246
+ _: 1
247
+ }, 8, ["span"]));
248
+ }
249
+ }), fe = /* @__PURE__ */ y({
250
+ name: "OFormMultiselect",
251
+ extendOptions: {},
252
+ __name: "MultiSelect",
253
+ props: {
254
+ name: {},
255
+ label: {},
256
+ span: {},
257
+ labelWidth: {},
258
+ required: { type: Boolean },
259
+ rules: {},
260
+ placeholder: {},
261
+ disabled: { type: Boolean },
262
+ code: {}
263
+ },
264
+ setup(o) {
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({
266
+ get: () => a.value ? a.value.split(",") : [],
267
+ set: (b) => {
268
+ b ? a.value = b.join(",") : a.value = "";
269
+ }
270
+ });
271
+ return (b, n) => (m(), f(e(c), { span: e(p) }, {
272
+ default: d(() => [
273
+ h(e(w), {
274
+ prop: b.name,
275
+ label: b.label,
276
+ "label-width": b.labelWidth,
277
+ required: b.required,
278
+ rules: e(i)
279
+ }, {
280
+ default: d(() => [
281
+ e(t) ? (m(), f(e(B), {
282
+ key: 0,
283
+ "model-value": l.value,
284
+ placeholder: b.placeholder,
285
+ disabled: !0,
286
+ readonly: !0
287
+ }, null, 8, ["model-value", "placeholder"])) : (m(), f(e(E), {
288
+ key: 1,
289
+ modelValue: s.value,
290
+ "onUpdate:modelValue": n[0] || (n[0] = (q) => s.value = q),
291
+ placeholder: b.placeholder,
292
+ multiple: ""
293
+ }, {
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
299
+ }, null, 8, ["label", "value"]))), 128))
300
+ ]),
301
+ _: 1
302
+ }, 8, ["modelValue", "placeholder"]))
303
+ ]),
304
+ _: 1
305
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
306
+ ]),
307
+ _: 1
308
+ }, 8, ["span"]));
309
+ }
310
+ }), he = /* @__PURE__ */ y({
311
+ name: "OFormRadiogroup",
312
+ extendOptions: {},
313
+ __name: "RadioGroup",
314
+ props: {
315
+ name: {},
316
+ label: {},
317
+ span: {},
318
+ labelWidth: {},
319
+ required: { type: Boolean },
320
+ rules: {},
321
+ disabled: { type: Boolean },
322
+ code: {}
323
+ },
324
+ setup(o) {
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)
334
+ }, {
335
+ default: d(() => [
336
+ h(e(_), {
337
+ modelValue: l.value,
338
+ "onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
339
+ disabled: u.disabled
340
+ }, {
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
345
+ }, {
346
+ default: d(() => [
347
+ N(A(s.content), 1)
348
+ ]),
349
+ _: 2
350
+ }, 1032, ["value"]))), 128))
351
+ ]),
352
+ _: 1
353
+ }, 8, ["modelValue", "disabled"])
178
354
  ]),
179
355
  _: 1
180
356
  }, 8, ["prop", "label", "label-width", "required", "rules"])
@@ -182,13 +358,349 @@ const M = /* @__PURE__ */ p({
182
358
  _: 1
183
359
  }, 8, ["span"]));
184
360
  }
185
- }), K = B(M, {
186
- StringInput: E,
187
- PasswordInput: O,
188
- Textarea: T
361
+ }), ve = /* @__PURE__ */ y({
362
+ name: "OFormCheckboxgroup",
363
+ extendOptions: {},
364
+ __name: "CheckboxGroup",
365
+ props: {
366
+ name: {},
367
+ label: {},
368
+ span: {},
369
+ labelWidth: {},
370
+ required: { type: Boolean },
371
+ rules: {},
372
+ disabled: { type: Boolean },
373
+ code: {}
374
+ },
375
+ setup(o) {
376
+ const p = g(), i = V(), t = W(), r = S(), l = v(r.model, o.name), u = O({
377
+ get: () => l.value ? l.value.split(",") : [],
378
+ set: (a) => {
379
+ a ? l.value = a.join(",") : l.value = "";
380
+ }
381
+ });
382
+ return (a, s) => (m(), f(e(c), { span: e(p) }, {
383
+ default: d(() => [
384
+ h(e(w), {
385
+ prop: a.name,
386
+ label: a.label,
387
+ "label-width": a.labelWidth,
388
+ required: a.required,
389
+ rules: e(i)
390
+ }, {
391
+ default: d(() => [
392
+ h(e(le), {
393
+ modelValue: u.value,
394
+ "onUpdate:modelValue": s[0] || (s[0] = (b) => u.value = b),
395
+ disabled: a.disabled
396
+ }, {
397
+ default: d(() => [
398
+ (m(!0), C(z, null, F(e(t), (b) => (m(), f(e(T), {
399
+ key: b.value,
400
+ label: b.content,
401
+ value: b.value
402
+ }, null, 8, ["label", "value"]))), 128))
403
+ ]),
404
+ _: 1
405
+ }, 8, ["modelValue", "disabled"])
406
+ ]),
407
+ _: 1
408
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
409
+ ]),
410
+ _: 1
411
+ }, 8, ["span"]));
412
+ }
413
+ }), ye = /* @__PURE__ */ y({
414
+ name: "OFormCheckbox",
415
+ extendOptions: {},
416
+ __name: "Checkbox",
417
+ props: {
418
+ name: {},
419
+ label: {},
420
+ span: {},
421
+ labelWidth: {},
422
+ rules: {},
423
+ disabled: { type: Boolean }
424
+ },
425
+ setup(o) {
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
434
+ }, {
435
+ default: d(() => [
436
+ h(e(T), {
437
+ modelValue: t.value,
438
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => t.value = u),
439
+ disabled: r.disabled,
440
+ "true-value": "1",
441
+ "false-value": "0"
442
+ }, null, 8, ["modelValue", "disabled"])
443
+ ]),
444
+ _: 1
445
+ }, 8, ["prop", "label", "label-width", "rules"])
446
+ ]),
447
+ _: 1
448
+ }, 8, ["span"]));
449
+ }
450
+ }), ce = /* @__PURE__ */ y({
451
+ name: "OFormSwitch",
452
+ extendOptions: {},
453
+ __name: "Switch",
454
+ props: {
455
+ name: {},
456
+ label: {},
457
+ span: {},
458
+ labelWidth: {},
459
+ rules: {},
460
+ disabled: { type: Boolean }
461
+ },
462
+ setup(o) {
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
471
+ }, {
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,
477
+ "active-value": "1",
478
+ "inactive-value": "0"
479
+ }, null, 8, ["modelValue", "disabled"])
480
+ ]),
481
+ _: 1
482
+ }, 8, ["prop", "label", "label-width", "rules"])
483
+ ]),
484
+ _: 1
485
+ }, 8, ["span"]));
486
+ }
487
+ }), ge = /* @__PURE__ */ y({
488
+ name: "OFormDate",
489
+ extendOptions: { trigger: "blur" },
490
+ __name: "DateInput",
491
+ props: {
492
+ name: {},
493
+ label: {},
494
+ span: {},
495
+ labelWidth: {},
496
+ required: { type: Boolean },
497
+ rules: {},
498
+ maxlength: {},
499
+ placeholder: {},
500
+ disabled: { type: Boolean },
501
+ readonly: { type: Boolean },
502
+ editable: { type: Boolean },
503
+ clearable: { type: Boolean },
504
+ format: { default: "YYYY-MM-DD" },
505
+ sourceFormat: {}
506
+ },
507
+ setup(o) {
508
+ const p = g(), i = V(), t = O(
509
+ () => o.format.startsWith("H") || o.format.startsWith("h") || o.format.startsWith("m") || o.format.startsWith("s")
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(() => {
514
+ if (G(a.value))
515
+ return "string";
516
+ if (P(a.value))
517
+ return "date";
518
+ throw new D("日期输入框的值只能为字符串或日期类型");
519
+ }), b = O({
520
+ get: () => {
521
+ if (a.value) {
522
+ if (s.value == "date")
523
+ return a.value;
524
+ {
525
+ const n = R(a.value, r.value, !0);
526
+ if (!n.isValid())
527
+ throw new D(`日期输入框的值无效,不符合${r.value}格式`);
528
+ return n.toDate();
529
+ }
530
+ }
531
+ },
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 = "";
534
+ }
535
+ });
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)
544
+ }, {
545
+ default: d(() => [
546
+ t.value ? (m(), f(e(oe), {
547
+ key: 0,
548
+ modelValue: b.value,
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), {
559
+ key: 1,
560
+ modelValue: b.value,
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,
567
+ type: l.value,
568
+ format: r.value,
569
+ style: { width: "100%" }
570
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
571
+ ]),
572
+ _: 1
573
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
574
+ ]),
575
+ _: 1
576
+ }, 8, ["span"]));
577
+ }
578
+ }), we = /* @__PURE__ */ y({
579
+ name: "OFormFile",
580
+ extendOptions: {},
581
+ __name: "FileInput",
582
+ props: {
583
+ name: {},
584
+ label: {},
585
+ span: {},
586
+ labelWidth: {},
587
+ required: { type: Boolean },
588
+ rules: {},
589
+ disabled: { type: Boolean }
590
+ },
591
+ setup(o) {
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];
597
+ };
598
+ });
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), {
603
+ prop: a.name,
604
+ label: a.label,
605
+ "label-width": a.labelWidth,
606
+ required: a.required,
607
+ rules: e(i)
608
+ }, {
609
+ default: d(() => [
610
+ h(e(B), {
611
+ ref_key: "fileRef",
612
+ ref: r,
613
+ modelValue: t.value,
614
+ "onUpdate:modelValue": s[0] || (s[0] = (b) => t.value = b),
615
+ disabled: a.disabled,
616
+ type: "file"
617
+ }, null, 8, ["modelValue", "disabled"])
618
+ ]),
619
+ _: 1
620
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
621
+ ]),
622
+ _: 1
623
+ }, 8, ["span"]));
624
+ }
625
+ }), Se = /* @__PURE__ */ y({
626
+ name: "OFormButtongroup",
627
+ __name: "ButtonGroup",
628
+ props: {
629
+ span: {},
630
+ gutter: { type: [Boolean, String] },
631
+ align: { default: "right" }
632
+ },
633
+ setup(o) {
634
+ const p = O(() => ({
635
+ textAlign: o.align
636
+ })), i = g();
637
+ return (t, r) => (m(), f(e(c), {
638
+ span: e(i),
639
+ style: Q(p.value)
640
+ }, {
641
+ default: d(() => [
642
+ h(e(ue), {
643
+ gutter: t.gutter,
644
+ style: { "margin-bottom": "18px" }
645
+ }, {
646
+ default: d(() => [
647
+ M(t.$slots, "default")
648
+ ]),
649
+ _: 3
650
+ }, 8, ["gutter"])
651
+ ]),
652
+ _: 3
653
+ }, 8, ["span", "style"]));
654
+ }
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,
696
+ Switch: ce,
697
+ DateInput: ge,
698
+ FileInput: we,
699
+ ButtonGroup: Se,
700
+ DiyItem: qe
189
701
  });
190
702
  export {
191
- K as default,
192
- I as formContextKey
703
+ Re as default,
704
+ te as formContextKey
193
705
  };
194
706
  //# sourceMappingURL=index.js.map