orion-design 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. package/README.md +5 -5
  2. package/dist/Throne/index.js +14 -30
  3. package/dist/Throne/index.js.map +1 -1
  4. package/dist/components/Button/index.js +33 -40
  5. package/dist/components/Button/index.js.map +1 -1
  6. package/dist/components/Flex/index.js +89 -122
  7. package/dist/components/Flex/index.js.map +1 -1
  8. package/dist/components/Form/Form.js +2 -2
  9. package/dist/components/Form/Form.js.map +1 -1
  10. package/dist/components/Form/LovInput/LovInput.js +2 -2
  11. package/dist/components/Form/LovInput/LovInput.js.map +1 -1
  12. package/dist/components/Form/LovInput/hooks/useLov.js +5 -5
  13. package/dist/components/Form/LovInput/hooks/useLov.js.map +1 -1
  14. package/dist/components/Form/LovInput/index.js +4 -4
  15. package/dist/components/Form/hooks/FormItemValidateTrigger.js +2 -2
  16. package/dist/components/Form/hooks/FormItemValidateTrigger.js.map +1 -1
  17. package/dist/components/Form/hooks/index.js +68 -127
  18. package/dist/components/Form/hooks/index.js.map +1 -1
  19. package/dist/components/Form/index.js +656 -836
  20. package/dist/components/Form/index.js.map +1 -1
  21. package/dist/components/Form/utils/index.js +18 -30
  22. package/dist/components/Form/utils/index.js.map +1 -1
  23. package/dist/components/LovTable/LovPagetable.vue.d.ts +492 -0
  24. package/dist/components/LovTable/index.d.ts +246 -0
  25. package/dist/components/LovTable/index.js +106 -179
  26. package/dist/components/LovTable/index.js.map +1 -1
  27. package/dist/components/Modal/index.js +56 -111
  28. package/dist/components/Modal/index.js.map +1 -1
  29. package/dist/components/Modal/types.d.ts +1 -1
  30. package/dist/components/Modal/types.js +3 -4
  31. package/dist/components/Modal/types.js.map +1 -1
  32. package/dist/components/Modal/useModal.js +5 -5
  33. package/dist/components/Modal/useModal.js.map +1 -1
  34. package/dist/components/Pagetable/Pagetable.d.ts +92 -1
  35. package/dist/components/Pagetable/columns/PagetableColumnButtongroup.d.ts +13 -0
  36. package/dist/components/Pagetable/columns/PagetableColumnDate.d.ts +13 -0
  37. package/dist/components/Pagetable/columns/PagetableColumnLink.d.ts +13 -0
  38. package/dist/components/Pagetable/columns/PagetableColumnMultiselect.d.ts +13 -0
  39. package/dist/components/Pagetable/columns/PagetableColumnNumber.d.ts +13 -0
  40. package/dist/components/Pagetable/columns/PagetableColumnSingleselect.d.ts +13 -0
  41. package/dist/components/Pagetable/columns/PagetableColumnString.d.ts +13 -0
  42. package/dist/components/Pagetable/hooks/useColumns.js +85 -88
  43. package/dist/components/Pagetable/hooks/useColumns.js.map +1 -1
  44. package/dist/components/Pagetable/index.d.ts +155 -0
  45. package/dist/components/Pagetable/index.js +596 -683
  46. package/dist/components/Pagetable/index.js.map +1 -1
  47. package/dist/components/Pagetable/utils/index.js +54 -92
  48. package/dist/components/Pagetable/utils/index.js.map +1 -1
  49. package/dist/components/Querytable/hooks/useColumns.js +74 -82
  50. package/dist/components/Querytable/hooks/useColumns.js.map +1 -1
  51. package/dist/components/Querytable/index.js +469 -579
  52. package/dist/components/Querytable/index.js.map +1 -1
  53. package/dist/components/Querytable/utils/index.js +54 -92
  54. package/dist/components/Querytable/utils/index.js.map +1 -1
  55. package/dist/components/RichTextEditor/index.js +74 -100
  56. package/dist/components/RichTextEditor/index.js.map +1 -1
  57. package/dist/components/Tabs/constants.js +2 -2
  58. package/dist/components/Tabs/constants.js.map +1 -1
  59. package/dist/components/Tabs/index.js +358 -603
  60. package/dist/components/Tabs/index.js.map +1 -1
  61. package/dist/components/Tabs/tab-bar.js +6 -6
  62. package/dist/components/Tabs/tab-bar.js.map +1 -1
  63. package/dist/components/Tabs/tab-pane.js +3 -3
  64. package/dist/components/Tabs/tab-pane.js.map +1 -1
  65. package/dist/components/_constants/aria.js +2 -2
  66. package/dist/components/_constants/aria.js.map +1 -1
  67. package/dist/components/_constants/event.js +4 -6
  68. package/dist/components/_constants/event.js.map +1 -1
  69. package/dist/components/_constants/index.js +6 -6
  70. package/dist/components/_hooks/index.js +7 -7
  71. package/dist/components/_hooks/use-namespace/index.js +39 -74
  72. package/dist/components/_hooks/use-namespace/index.js.map +1 -1
  73. package/dist/components/_hooks/use-ordered-children/index.js +19 -29
  74. package/dist/components/_hooks/use-ordered-children/index.js.map +1 -1
  75. package/dist/components/_util/arrays.js +5 -9
  76. package/dist/components/_util/arrays.js.map +1 -1
  77. package/dist/components/_util/browser.js +6 -6
  78. package/dist/components/_util/browser.js.map +1 -1
  79. package/dist/components/_util/classNames.js +17 -22
  80. package/dist/components/_util/classNames.js.map +1 -1
  81. package/dist/components/_util/dom/aria.js +39 -74
  82. package/dist/components/_util/dom/aria.js.map +1 -1
  83. package/dist/components/_util/dom/element.js +8 -9
  84. package/dist/components/_util/dom/element.js.map +1 -1
  85. package/dist/components/_util/dom/event.js +7 -14
  86. package/dist/components/_util/dom/event.js.map +1 -1
  87. package/dist/components/_util/dom/index.js +36 -36
  88. package/dist/components/_util/dom/position.js +25 -49
  89. package/dist/components/_util/dom/position.js.map +1 -1
  90. package/dist/components/_util/dom/scroll.js +61 -103
  91. package/dist/components/_util/dom/scroll.js.map +1 -1
  92. package/dist/components/_util/dom/style.js +50 -65
  93. package/dist/components/_util/dom/style.js.map +1 -1
  94. package/dist/components/_util/easings.js +4 -8
  95. package/dist/components/_util/easings.js.map +1 -1
  96. package/dist/components/_util/error.js +11 -12
  97. package/dist/components/_util/error.js.map +1 -1
  98. package/dist/components/_util/functions.js +3 -3
  99. package/dist/components/_util/i18n.js +2 -2
  100. package/dist/components/_util/i18n.js.map +1 -1
  101. package/dist/components/_util/index.js +137 -137
  102. package/dist/components/_util/isValid.js +2 -4
  103. package/dist/components/_util/isValid.js.map +1 -1
  104. package/dist/components/_util/objects.js +14 -18
  105. package/dist/components/_util/objects.js.map +1 -1
  106. package/dist/components/_util/props-util/index.js +20 -46
  107. package/dist/components/_util/props-util/index.js.map +1 -1
  108. package/dist/components/_util/props-util/initDefaultProps.js +10 -18
  109. package/dist/components/_util/props-util/initDefaultProps.js.map +1 -1
  110. package/dist/components/_util/raf.js +4 -5
  111. package/dist/components/_util/raf.js.map +1 -1
  112. package/dist/components/_util/rand.js +3 -4
  113. package/dist/components/_util/rand.js.map +1 -1
  114. package/dist/components/_util/strings.js +8 -9
  115. package/dist/components/_util/strings.js.map +1 -1
  116. package/dist/components/_util/throttleByRaf.js +10 -16
  117. package/dist/components/_util/throttleByRaf.js.map +1 -1
  118. package/dist/components/_util/type.js +38 -41
  119. package/dist/components/_util/type.js.map +1 -1
  120. package/dist/components/_util/types.js +22 -41
  121. package/dist/components/_util/types.js.map +1 -1
  122. package/dist/components/_util/typescript.js +2 -2
  123. package/dist/components/_util/typescript.js.map +1 -1
  124. package/dist/components/_util/util.js +43 -85
  125. package/dist/components/_util/util.js.map +1 -1
  126. package/dist/components/_util/vue/global-node.js +15 -27
  127. package/dist/components/_util/vue/global-node.js.map +1 -1
  128. package/dist/components/_util/vue/icon.js +25 -29
  129. package/dist/components/_util/vue/icon.js.map +1 -1
  130. package/dist/components/_util/vue/index.js +41 -41
  131. package/dist/components/_util/vue/install.js +18 -35
  132. package/dist/components/_util/vue/install.js.map +1 -1
  133. package/dist/components/_util/vue/props/index.js +6 -6
  134. package/dist/components/_util/vue/props/runtime.js +30 -46
  135. package/dist/components/_util/vue/props/runtime.js.map +1 -1
  136. package/dist/components/_util/vue/refs.js +6 -12
  137. package/dist/components/_util/vue/refs.js.map +1 -1
  138. package/dist/components/_util/vue/size.js +3 -5
  139. package/dist/components/_util/vue/size.js.map +1 -1
  140. package/dist/components/_util/vue/validator.js +4 -5
  141. package/dist/components/_util/vue/validator.js.map +1 -1
  142. package/dist/components/_util/vue/vnode.js +54 -100
  143. package/dist/components/_util/vue/vnode.js.map +1 -1
  144. package/dist/components/_util/vue-types/index.js +220 -231
  145. package/dist/components/_util/vue-types/index.js.map +1 -1
  146. package/dist/components/components.js +20 -20
  147. package/dist/components/index.js +35 -38
  148. package/dist/components/index.js.map +1 -1
  149. package/dist/error/OrionError.js +4 -8
  150. package/dist/error/OrionError.js.map +1 -1
  151. package/dist/index.css +1 -797
  152. package/dist/index.js +36 -36
  153. package/dist/print/LodopFuncs.js +43 -101
  154. package/dist/print/LodopFuncs.js.map +1 -1
  155. package/dist/print/index.js +108 -200
  156. package/dist/print/index.js.map +1 -1
  157. package/dist/request/ErrorHandlerChain.js +14 -17
  158. package/dist/request/ErrorHandlerChain.js.map +1 -1
  159. package/dist/request/RequestFilterChain.js +13 -16
  160. package/dist/request/RequestFilterChain.js.map +1 -1
  161. package/dist/request/ResponseParserChain.js +14 -17
  162. package/dist/request/ResponseParserChain.js.map +1 -1
  163. package/dist/request/disivion/DateSerializer.js +22 -47
  164. package/dist/request/disivion/DateSerializer.js.map +1 -1
  165. package/dist/request/disivion/DivisionErrorHandler.js +25 -40
  166. package/dist/request/disivion/DivisionErrorHandler.js.map +1 -1
  167. package/dist/request/disivion/DivisionResponseParser.js +10 -16
  168. package/dist/request/disivion/DivisionResponseParser.js.map +1 -1
  169. package/dist/request/disivion/index.js +201 -305
  170. package/dist/request/disivion/index.js.map +1 -1
  171. package/dist/request/error/BizExceptionResponseError.js +5 -11
  172. package/dist/request/error/BizExceptionResponseError.js.map +1 -1
  173. package/dist/request/error/ExceptionResponseError.js +5 -11
  174. package/dist/request/error/ExceptionResponseError.js.map +1 -1
  175. package/dist/request/error/ResponseError.js +4 -9
  176. package/dist/request/error/ResponseError.js.map +1 -1
  177. package/dist/request/error/SessionExceptionResponseError.js +5 -11
  178. package/dist/request/error/SessionExceptionResponseError.js.map +1 -1
  179. package/dist/request/index.js +11 -11
  180. package/dist/utils/DateUtil.js +33 -48
  181. package/dist/utils/DateUtil.js.map +1 -1
  182. package/dist/utils/NumberUtil.js +6 -6
  183. package/dist/utils/NumberUtil.js.map +1 -1
  184. package/dist/utils/cloneDeep.js +2 -2
  185. package/dist/utils/delay.js +3 -3
  186. package/dist/utils/delay.js.map +1 -1
  187. package/dist/utils/functions.js +3 -3
  188. package/dist/utils/index.js +12 -12
  189. package/dist/utils/md5.js +93 -191
  190. package/dist/utils/md5.js.map +1 -1
  191. package/dist/utils/uuid.js +25 -35
  192. package/dist/utils/uuid.js.map +1 -1
  193. package/dist/version/index.js +2 -2
  194. package/dist/version/version.d.ts +1 -1
  195. package/dist/version/version.js +2 -2
  196. package/dist/version/version.js.map +1 -1
  197. package/package.json +1 -1
  198. package/dist/_commonjsHelpers-DWwsNxpa.js +0 -9
  199. package/dist/_commonjsHelpers-DWwsNxpa.js.map +0 -1
  200. package/dist/components-B3d9m_tn.js +0 -27
  201. package/dist/components-B3d9m_tn.js.map +0 -1
  202. package/dist/functions-BeMkokbY.js +0 -63
  203. package/dist/functions-BeMkokbY.js.map +0 -1
  204. package/dist/index-BOKLZnqH.js +0 -54
  205. package/dist/index-BOKLZnqH.js.map +0 -1
  206. package/dist/index-D1m0KTpK.js +0 -69
  207. package/dist/index-D1m0KTpK.js.map +0 -1
  208. package/dist/index-DR5ZP7mD.js +0 -160
  209. package/dist/index-DR5ZP7mD.js.map +0 -1
  210. package/dist/index-DkwIULcN.js +0 -200
  211. package/dist/index-DkwIULcN.js.map +0 -1
@@ -1,84 +1,71 @@
1
- import { difference, isEmpty, isDate, isString, isNumber, toNumber } from "lodash-es";
2
- import { defineComponent, useTemplateRef, provide, reactive, toRef, openBlock, createBlock, unref, withCtx, createVNode, renderSlot, isRef, useAttrs, computed, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, watch, ref, onMounted, normalizeStyle } from "vue";
3
- import { withInstall } from "../_util/vue/install.js";
4
- import { ElForm, ElRow, ElCol, ElFormItem, ElInput, ElSelect, ElOption, ElRadioGroup, ElRadio, ElCheckboxGroup, ElCheckbox, ElSwitch, dayjs, ElTimePicker, ElDatePicker, ElDropdown, ElInputNumber } from "element-plus";
5
- import { formContextKey } from "./Form.js";
6
- import OrionError from "../../error/OrionError.js";
7
- import { useFormItemSpan, useFormItemRules, useFormItemStringModel, useFormItemDisabled, useFormItemCode, useFormItemMultiModel, useFormContext, useFormItemBooleanModel } from "./hooks/index.js";
8
- import { getSingleCodeContent, getMultiCodeContent } from "./utils/index.js";
9
- import { S as Space } from "../../index-BOKLZnqH.js";
10
- import { g as search_default } from "../../index-DkwIULcN.js";
11
- import { lovContextKey } from "./LovInput/LovInput.js";
12
- import { default as default2 } from "./LovInput/hooks/useLov.js";
13
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
14
- ...{ name: "OForm", inheritAttrs: false },
1
+ import { difference as oe, isEmpty as re, isDate as te, isString as A, isNumber as ne, toNumber as de } from "lodash-es";
2
+ import { defineComponent as y, useTemplateRef as Y, provide as L, reactive as j, toRef as R, openBlock as p, createBlock as h, unref as e, withCtx as d, createVNode as f, renderSlot as $, isRef as q, useAttrs as H, computed as F, createElementBlock as D, Fragment as E, renderList as I, createTextVNode as ue, toDisplayString as se, watch as ie, ref as P, onMounted as pe, normalizeStyle as me } from "vue";
3
+ import { withInstall as be } from "../_util/vue/install.js";
4
+ import { ElForm as fe, ElRow as he, ElCol as g, ElFormItem as w, ElInput as O, ElSelect as K, ElOption as J, ElRadioGroup as ce, ElRadio as ye, ElCheckboxGroup as ge, ElCheckbox as Q, ElSwitch as ve, dayjs as G, ElTimePicker as we, ElDatePicker as Ve, ElDropdown as Se, ElInputNumber as qe } from "element-plus";
5
+ import { formContextKey as Be } from "./Form.js";
6
+ import W from "../../error/OrionError.js";
7
+ import { useFormItemSpan as v, useFormItemRules as V, useFormItemStringModel as z, useFormItemDisabled as X, useFormItemCode as U, useFormItemMultiModel as Z, useFormContext as T, useFormItemBooleanModel as x } from "./hooks/index.js";
8
+ import { getSingleCodeContent as Me, getMultiCodeContent as Ce } from "./utils/index.js";
9
+ import { S as Fe } from "../../index-BbsXWo7C.js";
10
+ import { g as Oe } from "../../index-C6P_0wAy.js";
11
+ import { lovContextKey as ze } from "./LovInput/LovInput.js";
12
+ import { default as dl } from "./LovInput/hooks/useLov.js";
13
+ const We = /* @__PURE__ */ y({
14
+ name: "OForm",
15
+ inheritAttrs: !1,
15
16
  __name: "Form",
16
17
  props: {
17
18
  rules: {},
18
19
  itemSpan: { default: 6 },
19
20
  itemLabelWidth: { default: "auto" },
20
- disabled: { type: Boolean, default: false },
21
+ disabled: { type: Boolean, default: !1 },
21
22
  modelValue: {}
22
23
  },
23
24
  emits: ["update:modelValue"],
24
- setup(__props, { expose: __expose, emit: __emit }) {
25
- const emit = __emit;
26
- const updateModelValue = (name, value) => {
27
- if (!Object.keys(__props.modelValue).includes(name)) {
28
- throw new OrionError(`modelValue中不存在[${name}]`);
29
- }
30
- emit("update:modelValue", { ...__props.modelValue, [name]: value });
31
- };
32
- const updateModelValueMulti = (data) => {
33
- const modelKeys = Object.keys(__props.modelValue);
34
- const dataKeys = Object.keys(data);
35
- const diff = difference(dataKeys, modelKeys);
36
- if (!isEmpty(diff)) {
37
- throw new OrionError(`modelValue中不存在[${diff.join(",")}]`);
38
- }
39
- emit("update:modelValue", { ...__props.modelValue, ...data });
40
- };
41
- const formRef = useTemplateRef("form");
42
- const validate = async () => {
43
- return await formRef.value.validate();
44
- };
45
- __expose({
46
- validate
47
- });
48
- provide(
49
- formContextKey,
50
- reactive({
51
- modelValue: toRef(() => __props.modelValue),
52
- updateModelValue,
53
- updateModelValueMulti,
54
- rules: toRef(() => __props.rules),
55
- itemSpan: toRef(() => __props.itemSpan),
56
- disabled: toRef(() => __props.disabled)
25
+ setup(t, { expose: i, emit: u }) {
26
+ const o = u, l = (r, m) => {
27
+ if (!Object.keys(t.modelValue).includes(r))
28
+ throw new W(`modelValue中不存在[${r}]`);
29
+ o("update:modelValue", { ...t.modelValue, [r]: m });
30
+ }, a = (r) => {
31
+ const m = Object.keys(t.modelValue), c = Object.keys(r), S = oe(c, m);
32
+ if (!re(S))
33
+ throw new W(`modelValue中不存在[${S.join(",")}]`);
34
+ o("update:modelValue", { ...t.modelValue, ...r });
35
+ }, n = Y("form");
36
+ return i({
37
+ validate: async () => await n.value.validate()
38
+ }), L(
39
+ Be,
40
+ j({
41
+ modelValue: R(() => t.modelValue),
42
+ updateModelValue: l,
43
+ updateModelValueMulti: a,
44
+ rules: R(() => t.rules),
45
+ itemSpan: R(() => t.itemSpan),
46
+ disabled: R(() => t.disabled)
57
47
  })
58
- );
59
- return (_ctx, _cache) => {
60
- return openBlock(), createBlock(unref(ElForm), {
61
- ref: "form",
62
- model: _ctx.modelValue,
63
- rules: _ctx.rules,
64
- "label-width": _ctx.itemLabelWidth,
65
- disabled: _ctx.disabled
66
- }, {
67
- default: withCtx(() => [
68
- createVNode(unref(ElRow), { gutter: 16 }, {
69
- default: withCtx(() => [
70
- renderSlot(_ctx.$slots, "default")
71
- ]),
72
- _: 3
73
- })
74
- ]),
75
- _: 3
76
- }, 8, ["model", "rules", "label-width", "disabled"]);
77
- };
48
+ ), (r, m) => (p(), h(e(fe), {
49
+ ref: "form",
50
+ model: r.modelValue,
51
+ rules: r.rules,
52
+ "label-width": r.itemLabelWidth,
53
+ disabled: r.disabled
54
+ }, {
55
+ default: d(() => [
56
+ f(e(he), { gutter: 16 }, {
57
+ default: d(() => [
58
+ $(r.$slots, "default")
59
+ ]),
60
+ _: 3
61
+ })
62
+ ]),
63
+ _: 3
64
+ }, 8, ["model", "rules", "label-width", "disabled"]));
78
65
  }
79
- });
80
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
81
- ...{ name: "OFormString", inheritAttrs: false },
66
+ }), ke = /* @__PURE__ */ y({
67
+ name: "OFormString",
68
+ inheritAttrs: !1,
82
69
  __name: "StringInput",
83
70
  props: {
84
71
  name: {},
@@ -92,40 +79,36 @@ const _sfc_main$e = /* @__PURE__ */ defineComponent({
92
79
  disabled: { type: Boolean },
93
80
  readonly: { type: Boolean }
94
81
  },
95
- setup(__props) {
96
- const normalizedSpan = useFormItemSpan();
97
- const normalizedRules = useFormItemRules();
98
- const elModel = useFormItemStringModel();
99
- return (_ctx, _cache) => {
100
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
101
- default: withCtx(() => [
102
- createVNode(unref(ElFormItem), {
103
- prop: _ctx.name,
104
- label: _ctx.label,
105
- "label-width": _ctx.labelWidth,
106
- required: _ctx.required,
107
- rules: unref(normalizedRules)
108
- }, {
109
- default: withCtx(() => [
110
- createVNode(unref(ElInput), {
111
- modelValue: unref(elModel),
112
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
113
- maxlength: _ctx.maxlength,
114
- placeholder: _ctx.placeholder,
115
- disabled: _ctx.disabled,
116
- readonly: _ctx.readonly
117
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
118
- ]),
119
- _: 1
120
- }, 8, ["prop", "label", "label-width", "required", "rules"])
121
- ]),
122
- _: 1
123
- }, 8, ["span"]);
124
- };
82
+ setup(t) {
83
+ const i = v(), u = V(), o = z();
84
+ return (l, a) => (p(), h(e(g), { span: e(i) }, {
85
+ default: d(() => [
86
+ f(e(w), {
87
+ prop: l.name,
88
+ label: l.label,
89
+ "label-width": l.labelWidth,
90
+ required: l.required,
91
+ rules: e(u)
92
+ }, {
93
+ default: d(() => [
94
+ f(e(O), {
95
+ modelValue: e(o),
96
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
97
+ maxlength: l.maxlength,
98
+ placeholder: l.placeholder,
99
+ disabled: l.disabled,
100
+ readonly: l.readonly
101
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
102
+ ]),
103
+ _: 1
104
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
105
+ ]),
106
+ _: 1
107
+ }, 8, ["span"]));
125
108
  }
126
- });
127
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
128
- ...{ name: "OFormPassword", inheritAttrs: false },
109
+ }), Re = /* @__PURE__ */ y({
110
+ name: "OFormPassword",
111
+ inheritAttrs: !1,
129
112
  __name: "PasswordInput",
130
113
  props: {
131
114
  name: {},
@@ -139,41 +122,37 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
139
122
  disabled: { type: Boolean },
140
123
  readonly: { type: Boolean }
141
124
  },
142
- setup(__props) {
143
- const normalizedSpan = useFormItemSpan();
144
- const normalizedRules = useFormItemRules();
145
- const elModel = useFormItemStringModel();
146
- return (_ctx, _cache) => {
147
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
148
- default: withCtx(() => [
149
- createVNode(unref(ElFormItem), {
150
- prop: _ctx.name,
151
- label: _ctx.label,
152
- "label-width": _ctx.labelWidth,
153
- required: _ctx.required,
154
- rules: unref(normalizedRules)
155
- }, {
156
- default: withCtx(() => [
157
- createVNode(unref(ElInput), {
158
- modelValue: unref(elModel),
159
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
160
- maxlength: _ctx.maxlength,
161
- placeholder: _ctx.placeholder,
162
- disabled: _ctx.disabled,
163
- readonly: _ctx.readonly,
164
- type: "password"
165
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
166
- ]),
167
- _: 1
168
- }, 8, ["prop", "label", "label-width", "required", "rules"])
169
- ]),
170
- _: 1
171
- }, 8, ["span"]);
172
- };
125
+ setup(t) {
126
+ const i = v(), u = V(), o = z();
127
+ return (l, a) => (p(), h(e(g), { span: e(i) }, {
128
+ default: d(() => [
129
+ f(e(w), {
130
+ prop: l.name,
131
+ label: l.label,
132
+ "label-width": l.labelWidth,
133
+ required: l.required,
134
+ rules: e(u)
135
+ }, {
136
+ default: d(() => [
137
+ f(e(O), {
138
+ modelValue: e(o),
139
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
140
+ maxlength: l.maxlength,
141
+ placeholder: l.placeholder,
142
+ disabled: l.disabled,
143
+ readonly: l.readonly,
144
+ type: "password"
145
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly"])
146
+ ]),
147
+ _: 1
148
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
149
+ ]),
150
+ _: 1
151
+ }, 8, ["span"]));
173
152
  }
174
- });
175
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
176
- ...{ name: "OFormTextarea", inheritAttrs: false },
153
+ }), Ae = /* @__PURE__ */ y({
154
+ name: "OFormTextarea",
155
+ inheritAttrs: !1,
177
156
  __name: "Textarea",
178
157
  props: {
179
158
  name: {},
@@ -188,43 +167,39 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
188
167
  readonly: { type: Boolean },
189
168
  rows: {}
190
169
  },
191
- setup(__props) {
192
- const normalizedSpan = useFormItemSpan();
193
- const normalizedRules = useFormItemRules();
194
- const elModel = useFormItemStringModel();
195
- return (_ctx, _cache) => {
196
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
197
- default: withCtx(() => [
198
- createVNode(unref(ElFormItem), {
199
- prop: _ctx.name,
200
- label: _ctx.label,
201
- "label-width": _ctx.labelWidth,
202
- required: _ctx.required,
203
- rules: unref(normalizedRules)
204
- }, {
205
- default: withCtx(() => [
206
- createVNode(unref(ElInput), {
207
- modelValue: unref(elModel),
208
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
209
- maxlength: _ctx.maxlength,
210
- placeholder: _ctx.placeholder,
211
- disabled: _ctx.disabled,
212
- readonly: _ctx.readonly,
213
- type: "textarea",
214
- rows: _ctx.rows,
215
- resize: "none"
216
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "rows"])
217
- ]),
218
- _: 1
219
- }, 8, ["prop", "label", "label-width", "required", "rules"])
220
- ]),
221
- _: 1
222
- }, 8, ["span"]);
223
- };
170
+ setup(t) {
171
+ const i = v(), u = V(), o = z();
172
+ return (l, a) => (p(), h(e(g), { span: e(i) }, {
173
+ default: d(() => [
174
+ f(e(w), {
175
+ prop: l.name,
176
+ label: l.label,
177
+ "label-width": l.labelWidth,
178
+ required: l.required,
179
+ rules: e(u)
180
+ }, {
181
+ default: d(() => [
182
+ f(e(O), {
183
+ modelValue: e(o),
184
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => q(o) ? o.value = n : null),
185
+ maxlength: l.maxlength,
186
+ placeholder: l.placeholder,
187
+ disabled: l.disabled,
188
+ readonly: l.readonly,
189
+ type: "textarea",
190
+ rows: l.rows,
191
+ resize: "none"
192
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "rows"])
193
+ ]),
194
+ _: 1
195
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
196
+ ]),
197
+ _: 1
198
+ }, 8, ["span"]));
224
199
  }
225
- });
226
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
227
- ...{ name: "OFormSingleselect", inheritAttrs: false },
200
+ }), $e = /* @__PURE__ */ y({
201
+ name: "OFormSingleselect",
202
+ inheritAttrs: !1,
228
203
  __name: "SingleSelect",
229
204
  props: {
230
205
  name: {},
@@ -239,62 +214,52 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
239
214
  clearable: { type: Boolean },
240
215
  filterable: { type: Boolean }
241
216
  },
242
- setup(__props) {
243
- const attrs = useAttrs();
244
- const normalizedSpan = useFormItemSpan();
245
- const normalizedRules = useFormItemRules();
246
- const normalizedDisabled = useFormItemDisabled();
247
- const normalizedCode = useFormItemCode();
248
- const elModel = useFormItemStringModel();
249
- const content = computed(() => getSingleCodeContent(normalizedCode.value, elModel.value));
250
- return (_ctx, _cache) => {
251
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
252
- default: withCtx(() => [
253
- createVNode(unref(ElFormItem), {
254
- prop: _ctx.name,
255
- label: _ctx.label,
256
- "label-width": _ctx.labelWidth,
257
- required: _ctx.required,
258
- rules: unref(normalizedRules)
259
- }, {
260
- default: withCtx(() => [
261
- unref(normalizedDisabled) ? (openBlock(), createBlock(unref(ElInput), {
262
- key: 0,
263
- "model-value": content.value,
264
- placeholder: _ctx.placeholder,
265
- disabled: true,
266
- readonly: true
267
- }, null, 8, ["model-value", "placeholder"])) : (openBlock(), createBlock(unref(ElSelect), {
268
- key: 1,
269
- modelValue: unref(elModel),
270
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
271
- placeholder: _ctx.placeholder,
272
- clearable: _ctx.clearable,
273
- filterable: _ctx.filterable,
274
- onChange: unref(attrs).onChange
275
- }, {
276
- default: withCtx(() => [
277
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(normalizedCode), (codeItem) => {
278
- return openBlock(), createBlock(unref(ElOption), {
279
- key: codeItem.value,
280
- label: codeItem.content,
281
- value: codeItem.value
282
- }, null, 8, ["label", "value"]);
283
- }), 128))
284
- ]),
285
- _: 1
286
- }, 8, ["modelValue", "placeholder", "clearable", "filterable", "onChange"]))
287
- ]),
288
- _: 1
289
- }, 8, ["prop", "label", "label-width", "required", "rules"])
290
- ]),
291
- _: 1
292
- }, 8, ["span"]);
293
- };
217
+ setup(t) {
218
+ const i = H(), u = v(), o = V(), l = X(), a = U(), n = z(), s = F(() => Me(a.value, n.value));
219
+ return (r, m) => (p(), h(e(g), { span: e(u) }, {
220
+ default: d(() => [
221
+ f(e(w), {
222
+ prop: r.name,
223
+ label: r.label,
224
+ "label-width": r.labelWidth,
225
+ required: r.required,
226
+ rules: e(o)
227
+ }, {
228
+ default: d(() => [
229
+ e(l) ? (p(), h(e(O), {
230
+ key: 0,
231
+ "model-value": s.value,
232
+ placeholder: r.placeholder,
233
+ disabled: !0,
234
+ readonly: !0
235
+ }, null, 8, ["model-value", "placeholder"])) : (p(), h(e(K), {
236
+ key: 1,
237
+ modelValue: e(n),
238
+ "onUpdate:modelValue": m[0] || (m[0] = (c) => q(n) ? n.value = c : null),
239
+ placeholder: r.placeholder,
240
+ clearable: r.clearable,
241
+ filterable: r.filterable,
242
+ onChange: e(i).onChange
243
+ }, {
244
+ default: d(() => [
245
+ (p(!0), D(E, null, I(e(a), (c) => (p(), h(e(J), {
246
+ key: c.value,
247
+ label: c.content,
248
+ value: c.value
249
+ }, null, 8, ["label", "value"]))), 128))
250
+ ]),
251
+ _: 1
252
+ }, 8, ["modelValue", "placeholder", "clearable", "filterable", "onChange"]))
253
+ ]),
254
+ _: 1
255
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
256
+ ]),
257
+ _: 1
258
+ }, 8, ["span"]));
294
259
  }
295
- });
296
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
297
- ...{ name: "OFormMultiselect", inheritAttrs: false },
260
+ }), De = /* @__PURE__ */ y({
261
+ name: "OFormMultiselect",
262
+ inheritAttrs: !1,
298
263
  __name: "MultiSelect",
299
264
  props: {
300
265
  name: {},
@@ -309,64 +274,53 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
309
274
  collapseTags: { type: Boolean },
310
275
  collapseTagsTooltip: { type: Boolean }
311
276
  },
312
- setup(__props) {
313
- const attrs = useAttrs();
314
- const normalizedSpan = useFormItemSpan();
315
- const normalizedRules = useFormItemRules();
316
- const normalizedDisabled = useFormItemDisabled();
317
- const normalizedCode = useFormItemCode();
318
- const elModel = useFormItemMultiModel();
319
- const formContext = useFormContext();
320
- const content = computed(() => getMultiCodeContent(normalizedCode.value, formContext.modelValue[__props.name]));
321
- return (_ctx, _cache) => {
322
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
323
- default: withCtx(() => [
324
- createVNode(unref(ElFormItem), {
325
- prop: _ctx.name,
326
- label: _ctx.label,
327
- "label-width": _ctx.labelWidth,
328
- required: _ctx.required,
329
- rules: unref(normalizedRules)
330
- }, {
331
- default: withCtx(() => [
332
- unref(normalizedDisabled) ? (openBlock(), createBlock(unref(ElInput), {
333
- key: 0,
334
- "model-value": content.value,
335
- placeholder: _ctx.placeholder,
336
- disabled: true,
337
- readonly: true
338
- }, null, 8, ["model-value", "placeholder"])) : (openBlock(), createBlock(unref(ElSelect), {
339
- key: 1,
340
- modelValue: unref(elModel),
341
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
342
- placeholder: _ctx.placeholder,
343
- multiple: "",
344
- "collapse-tags": _ctx.collapseTags,
345
- "collapse-tags-tooltip": _ctx.collapseTagsTooltip,
346
- onChange: unref(attrs).onChange
347
- }, {
348
- default: withCtx(() => [
349
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(normalizedCode), (codeItem) => {
350
- return openBlock(), createBlock(unref(ElOption), {
351
- key: codeItem.value,
352
- label: codeItem.content,
353
- value: codeItem.value
354
- }, null, 8, ["label", "value"]);
355
- }), 128))
356
- ]),
357
- _: 1
358
- }, 8, ["modelValue", "placeholder", "collapse-tags", "collapse-tags-tooltip", "onChange"]))
359
- ]),
360
- _: 1
361
- }, 8, ["prop", "label", "label-width", "required", "rules"])
362
- ]),
363
- _: 1
364
- }, 8, ["span"]);
365
- };
277
+ setup(t) {
278
+ const i = H(), u = v(), o = V(), l = X(), a = U(), n = Z(), s = T(), r = F(() => Ce(a.value, s.modelValue[t.name]));
279
+ return (m, c) => (p(), h(e(g), { span: e(u) }, {
280
+ default: d(() => [
281
+ f(e(w), {
282
+ prop: m.name,
283
+ label: m.label,
284
+ "label-width": m.labelWidth,
285
+ required: m.required,
286
+ rules: e(o)
287
+ }, {
288
+ default: d(() => [
289
+ e(l) ? (p(), h(e(O), {
290
+ key: 0,
291
+ "model-value": r.value,
292
+ placeholder: m.placeholder,
293
+ disabled: !0,
294
+ readonly: !0
295
+ }, null, 8, ["model-value", "placeholder"])) : (p(), h(e(K), {
296
+ key: 1,
297
+ modelValue: e(n),
298
+ "onUpdate:modelValue": c[0] || (c[0] = (S) => q(n) ? n.value = S : null),
299
+ placeholder: m.placeholder,
300
+ multiple: "",
301
+ "collapse-tags": m.collapseTags,
302
+ "collapse-tags-tooltip": m.collapseTagsTooltip,
303
+ onChange: e(i).onChange
304
+ }, {
305
+ default: d(() => [
306
+ (p(!0), D(E, null, I(e(a), (S) => (p(), h(e(J), {
307
+ key: S.value,
308
+ label: S.content,
309
+ value: S.value
310
+ }, null, 8, ["label", "value"]))), 128))
311
+ ]),
312
+ _: 1
313
+ }, 8, ["modelValue", "placeholder", "collapse-tags", "collapse-tags-tooltip", "onChange"]))
314
+ ]),
315
+ _: 1
316
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
317
+ ]),
318
+ _: 1
319
+ }, 8, ["span"]));
366
320
  }
367
- });
368
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
369
- ...{ name: "OFormRadiogroup", inheritAttrs: false },
321
+ }), Ee = /* @__PURE__ */ y({
322
+ name: "OFormRadiogroup",
323
+ inheritAttrs: !1,
370
324
  __name: "RadioGroup",
371
325
  props: {
372
326
  name: {},
@@ -378,53 +332,46 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
378
332
  disabled: { type: Boolean },
379
333
  code: {}
380
334
  },
381
- setup(__props) {
382
- const normalizedSpan = useFormItemSpan();
383
- const normalizedRules = useFormItemRules();
384
- const normalizedCode = useFormItemCode();
385
- const elModel = useFormItemStringModel();
386
- return (_ctx, _cache) => {
387
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
388
- default: withCtx(() => [
389
- createVNode(unref(ElFormItem), {
390
- prop: _ctx.name,
391
- label: _ctx.label,
392
- "label-width": _ctx.labelWidth,
393
- required: _ctx.required,
394
- rules: unref(normalizedRules)
395
- }, {
396
- default: withCtx(() => [
397
- createVNode(unref(ElRadioGroup), {
398
- modelValue: unref(elModel),
399
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
400
- disabled: _ctx.disabled
401
- }, {
402
- default: withCtx(() => [
403
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(normalizedCode), (codeItem) => {
404
- return openBlock(), createBlock(unref(ElRadio), {
405
- key: codeItem.value,
406
- value: codeItem.value
407
- }, {
408
- default: withCtx(() => [
409
- createTextVNode(toDisplayString(codeItem.content), 1)
410
- ]),
411
- _: 2
412
- }, 1032, ["value"]);
413
- }), 128))
414
- ]),
415
- _: 1
416
- }, 8, ["modelValue", "disabled"])
417
- ]),
418
- _: 1
419
- }, 8, ["prop", "label", "label-width", "required", "rules"])
420
- ]),
421
- _: 1
422
- }, 8, ["span"]);
423
- };
335
+ setup(t) {
336
+ const i = v(), u = V(), o = U(), l = z();
337
+ return (a, n) => (p(), h(e(g), { span: e(i) }, {
338
+ default: d(() => [
339
+ f(e(w), {
340
+ prop: a.name,
341
+ label: a.label,
342
+ "label-width": a.labelWidth,
343
+ required: a.required,
344
+ rules: e(u)
345
+ }, {
346
+ default: d(() => [
347
+ f(e(ce), {
348
+ modelValue: e(l),
349
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
350
+ disabled: a.disabled
351
+ }, {
352
+ default: d(() => [
353
+ (p(!0), D(E, null, I(e(o), (s) => (p(), h(e(ye), {
354
+ key: s.value,
355
+ value: s.value
356
+ }, {
357
+ default: d(() => [
358
+ ue(se(s.content), 1)
359
+ ]),
360
+ _: 2
361
+ }, 1032, ["value"]))), 128))
362
+ ]),
363
+ _: 1
364
+ }, 8, ["modelValue", "disabled"])
365
+ ]),
366
+ _: 1
367
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
368
+ ]),
369
+ _: 1
370
+ }, 8, ["span"]));
424
371
  }
425
- });
426
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
427
- ...{ name: "OFormCheckboxgroup", inheritAttrs: false },
372
+ }), Ie = /* @__PURE__ */ y({
373
+ name: "OFormCheckboxgroup",
374
+ inheritAttrs: !1,
428
375
  __name: "CheckboxGroup",
429
376
  props: {
430
377
  name: {},
@@ -436,49 +383,42 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
436
383
  disabled: { type: Boolean },
437
384
  code: {}
438
385
  },
439
- setup(__props) {
440
- const normalizedSpan = useFormItemSpan();
441
- const normalizedRules = useFormItemRules();
442
- const normalizedCode = useFormItemCode();
443
- const elModel = useFormItemMultiModel();
444
- return (_ctx, _cache) => {
445
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
446
- default: withCtx(() => [
447
- createVNode(unref(ElFormItem), {
448
- prop: _ctx.name,
449
- label: _ctx.label,
450
- "label-width": _ctx.labelWidth,
451
- required: _ctx.required,
452
- rules: unref(normalizedRules)
453
- }, {
454
- default: withCtx(() => [
455
- createVNode(unref(ElCheckboxGroup), {
456
- modelValue: unref(elModel),
457
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
458
- disabled: _ctx.disabled
459
- }, {
460
- default: withCtx(() => [
461
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(normalizedCode), (codeItem) => {
462
- return openBlock(), createBlock(unref(ElCheckbox), {
463
- key: codeItem.value,
464
- label: codeItem.content,
465
- value: codeItem.value
466
- }, null, 8, ["label", "value"]);
467
- }), 128))
468
- ]),
469
- _: 1
470
- }, 8, ["modelValue", "disabled"])
471
- ]),
472
- _: 1
473
- }, 8, ["prop", "label", "label-width", "required", "rules"])
474
- ]),
475
- _: 1
476
- }, 8, ["span"]);
477
- };
386
+ setup(t) {
387
+ const i = v(), u = V(), o = U(), l = Z();
388
+ return (a, n) => (p(), h(e(g), { span: e(i) }, {
389
+ default: d(() => [
390
+ f(e(w), {
391
+ prop: a.name,
392
+ label: a.label,
393
+ "label-width": a.labelWidth,
394
+ required: a.required,
395
+ rules: e(u)
396
+ }, {
397
+ default: d(() => [
398
+ f(e(ge), {
399
+ modelValue: e(l),
400
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => q(l) ? l.value = s : null),
401
+ disabled: a.disabled
402
+ }, {
403
+ default: d(() => [
404
+ (p(!0), D(E, null, I(e(o), (s) => (p(), h(e(Q), {
405
+ key: s.value,
406
+ label: s.content,
407
+ value: s.value
408
+ }, null, 8, ["label", "value"]))), 128))
409
+ ]),
410
+ _: 1
411
+ }, 8, ["modelValue", "disabled"])
412
+ ]),
413
+ _: 1
414
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
415
+ ]),
416
+ _: 1
417
+ }, 8, ["span"]));
478
418
  }
479
- });
480
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
481
- ...{ name: "OFormCheckbox", inheritAttrs: false },
419
+ }), Ue = /* @__PURE__ */ y({
420
+ name: "OFormCheckbox",
421
+ inheritAttrs: !1,
482
422
  __name: "Checkbox",
483
423
  props: {
484
424
  name: {},
@@ -488,35 +428,32 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
488
428
  rules: {},
489
429
  disabled: { type: Boolean }
490
430
  },
491
- setup(__props) {
492
- const normalizedSpan = useFormItemSpan();
493
- const elModel = useFormItemBooleanModel();
494
- return (_ctx, _cache) => {
495
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
496
- default: withCtx(() => [
497
- createVNode(unref(ElFormItem), {
498
- prop: _ctx.name,
499
- label: _ctx.label,
500
- "label-width": _ctx.labelWidth,
501
- rules: _ctx.rules
502
- }, {
503
- default: withCtx(() => [
504
- createVNode(unref(ElCheckbox), {
505
- modelValue: unref(elModel),
506
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
507
- disabled: _ctx.disabled
508
- }, null, 8, ["modelValue", "disabled"])
509
- ]),
510
- _: 1
511
- }, 8, ["prop", "label", "label-width", "rules"])
512
- ]),
513
- _: 1
514
- }, 8, ["span"]);
515
- };
431
+ setup(t) {
432
+ const i = v(), u = x();
433
+ return (o, l) => (p(), h(e(g), { span: e(i) }, {
434
+ default: d(() => [
435
+ f(e(w), {
436
+ prop: o.name,
437
+ label: o.label,
438
+ "label-width": o.labelWidth,
439
+ rules: o.rules
440
+ }, {
441
+ default: d(() => [
442
+ f(e(Q), {
443
+ modelValue: e(u),
444
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
445
+ disabled: o.disabled
446
+ }, null, 8, ["modelValue", "disabled"])
447
+ ]),
448
+ _: 1
449
+ }, 8, ["prop", "label", "label-width", "rules"])
450
+ ]),
451
+ _: 1
452
+ }, 8, ["span"]));
516
453
  }
517
- });
518
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
519
- ...{ name: "OFormSwitch", inheritAttrs: false },
454
+ }), Te = /* @__PURE__ */ y({
455
+ name: "OFormSwitch",
456
+ inheritAttrs: !1,
520
457
  __name: "Switch",
521
458
  props: {
522
459
  name: {},
@@ -526,35 +463,32 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
526
463
  rules: {},
527
464
  disabled: { type: Boolean }
528
465
  },
529
- setup(__props) {
530
- const normalizedSpan = useFormItemSpan();
531
- const elModel = useFormItemBooleanModel();
532
- return (_ctx, _cache) => {
533
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
534
- default: withCtx(() => [
535
- createVNode(unref(ElFormItem), {
536
- prop: _ctx.name,
537
- label: _ctx.label,
538
- "label-width": _ctx.labelWidth,
539
- rules: _ctx.rules
540
- }, {
541
- default: withCtx(() => [
542
- createVNode(unref(ElSwitch), {
543
- modelValue: unref(elModel),
544
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
545
- disabled: _ctx.disabled
546
- }, null, 8, ["modelValue", "disabled"])
547
- ]),
548
- _: 1
549
- }, 8, ["prop", "label", "label-width", "rules"])
550
- ]),
551
- _: 1
552
- }, 8, ["span"]);
553
- };
466
+ setup(t) {
467
+ const i = v(), u = x();
468
+ return (o, l) => (p(), h(e(g), { span: e(i) }, {
469
+ default: d(() => [
470
+ f(e(w), {
471
+ prop: o.name,
472
+ label: o.label,
473
+ "label-width": o.labelWidth,
474
+ rules: o.rules
475
+ }, {
476
+ default: d(() => [
477
+ f(e(ve), {
478
+ modelValue: e(u),
479
+ "onUpdate:modelValue": l[0] || (l[0] = (a) => q(u) ? u.value = a : null),
480
+ disabled: o.disabled
481
+ }, null, 8, ["modelValue", "disabled"])
482
+ ]),
483
+ _: 1
484
+ }, 8, ["prop", "label", "label-width", "rules"])
485
+ ]),
486
+ _: 1
487
+ }, 8, ["span"]));
554
488
  }
555
- });
556
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
557
- ...{ name: "OFormDate", inheritAttrs: false },
489
+ }), Ne = /* @__PURE__ */ y({
490
+ name: "OFormDate",
491
+ inheritAttrs: !1,
558
492
  __name: "DateInput",
559
493
  props: {
560
494
  name: {},
@@ -567,123 +501,79 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
567
501
  placeholder: {},
568
502
  disabled: { type: Boolean },
569
503
  readonly: { type: Boolean },
570
- editable: { type: Boolean, default: true },
571
- clearable: { type: Boolean, default: true },
504
+ editable: { type: Boolean, default: !0 },
505
+ clearable: { type: Boolean, default: !0 },
572
506
  format: { default: "YYYY-MM-DD" },
573
507
  sourceFormat: {}
574
508
  },
575
- setup(__props) {
576
- const normalizedSpan = useFormItemSpan();
577
- const normalizedRules = useFormItemRules();
578
- const isTimePicker = computed(() => __props.format.startsWith("H") || __props.format.startsWith("h") || __props.format.startsWith("m") || __props.format.startsWith("s"));
579
- const normalizedSourceFormat = computed(() => {
580
- if (__props.sourceFormat) {
581
- return __props.sourceFormat;
582
- }
583
- if (isTimePicker.value) {
584
- return "HH:mm:ss";
585
- } else {
586
- return "YYYY-MM-DD";
587
- }
588
- });
589
- const dateType = computed(() => {
590
- let picker = "date";
591
- if (__props.format.indexOf("y") > -1 || __props.format.indexOf("Y") > -1) {
592
- picker = "year";
593
- }
594
- if (__props.format.indexOf("M") > -1) {
595
- picker = "month";
596
- }
597
- if (__props.format.indexOf("d") > -1 || __props.format.indexOf("D") > -1) {
598
- picker = "date";
599
- }
600
- if (__props.format.indexOf("H") > -1 || __props.format.indexOf("h") > -1 || __props.format.indexOf("k") > -1 || __props.format.indexOf("m") > -1 || __props.format.indexOf("s") > -1 || __props.format.indexOf("S") > -1) {
601
- picker = "datetime";
602
- }
603
- return picker;
604
- });
605
- const formContext = useFormContext();
606
- const elModel = computed({
509
+ setup(t) {
510
+ const i = v(), u = V(), o = F(() => t.format.startsWith("H") || t.format.startsWith("h") || t.format.startsWith("m") || t.format.startsWith("s")), l = F(() => t.sourceFormat ? t.sourceFormat : o.value ? "HH:mm:ss" : "YYYY-MM-DD"), a = F(() => {
511
+ let r = "date";
512
+ return (t.format.indexOf("y") > -1 || t.format.indexOf("Y") > -1) && (r = "year"), t.format.indexOf("M") > -1 && (r = "month"), (t.format.indexOf("d") > -1 || t.format.indexOf("D") > -1) && (r = "date"), (t.format.indexOf("H") > -1 || t.format.indexOf("h") > -1 || t.format.indexOf("k") > -1 || t.format.indexOf("m") > -1 || t.format.indexOf("s") > -1 || t.format.indexOf("S") > -1) && (r = "datetime"), r;
513
+ }), n = T(), s = F({
607
514
  get: () => {
608
- const value = formContext.modelValue[__props.name];
609
- if (!value) {
610
- return void 0;
611
- }
612
- if (isDate(value)) {
613
- return value;
614
- } else if (isString(value)) {
615
- const dayjsObj = dayjs(value, normalizedSourceFormat.value, true);
616
- if (!dayjsObj.isValid()) {
617
- throw new OrionError(`日期输入框的值无效,不符合${normalizedSourceFormat.value}格式`);
618
- }
619
- return dayjsObj.toDate();
620
- } else {
621
- throw new OrionError("日期输入框的值只能为字符串或日期类型");
515
+ const r = n.modelValue[t.name];
516
+ if (r) {
517
+ if (te(r))
518
+ return r;
519
+ if (A(r)) {
520
+ const m = G(r, l.value, !0);
521
+ if (!m.isValid())
522
+ throw new W(`日期输入框的值无效,不符合${l.value}格式`);
523
+ return m.toDate();
524
+ } else
525
+ throw new W("日期输入框的值只能为字符串或日期类型");
622
526
  }
623
527
  },
624
- set: (newValue) => {
625
- if (__props.sourceFormat) {
626
- if (!newValue) {
627
- formContext.updateModelValue(__props.name, "");
628
- } else {
629
- formContext.updateModelValue(__props.name, dayjs(newValue).format(normalizedSourceFormat.value));
630
- }
631
- } else {
632
- if (!newValue) {
633
- formContext.updateModelValue(__props.name, void 0);
634
- } else {
635
- formContext.updateModelValue(__props.name, newValue);
636
- }
637
- }
528
+ set: (r) => {
529
+ t.sourceFormat ? r ? n.updateModelValue(t.name, G(r).format(l.value)) : n.updateModelValue(t.name, "") : r ? n.updateModelValue(t.name, r) : n.updateModelValue(t.name, void 0);
638
530
  }
639
531
  });
640
- return (_ctx, _cache) => {
641
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
642
- default: withCtx(() => [
643
- createVNode(unref(ElFormItem), {
644
- prop: _ctx.name,
645
- label: _ctx.label,
646
- "label-width": _ctx.labelWidth,
647
- required: _ctx.required,
648
- rules: unref(normalizedRules)
649
- }, {
650
- default: withCtx(() => [
651
- isTimePicker.value ? (openBlock(), createBlock(unref(ElTimePicker), {
652
- key: 0,
653
- modelValue: elModel.value,
654
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => elModel.value = $event),
655
- placeholder: _ctx.placeholder,
656
- disabled: _ctx.disabled,
657
- readonly: _ctx.readonly,
658
- editable: _ctx.editable,
659
- clearable: _ctx.clearable,
660
- format: normalizedSourceFormat.value,
661
- "arrow-control": "",
662
- style: { "width": "100%" }
663
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (openBlock(), createBlock(unref(ElDatePicker), {
664
- key: 1,
665
- modelValue: elModel.value,
666
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => elModel.value = $event),
667
- placeholder: _ctx.placeholder,
668
- disabled: _ctx.disabled,
669
- readonly: _ctx.readonly,
670
- editable: _ctx.editable,
671
- clearable: _ctx.clearable,
672
- type: dateType.value,
673
- format: normalizedSourceFormat.value,
674
- style: { "width": "100%" }
675
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
676
- ]),
677
- _: 1
678
- }, 8, ["prop", "label", "label-width", "required", "rules"])
679
- ]),
680
- _: 1
681
- }, 8, ["span"]);
682
- };
532
+ return (r, m) => (p(), h(e(g), { span: e(i) }, {
533
+ default: d(() => [
534
+ f(e(w), {
535
+ prop: r.name,
536
+ label: r.label,
537
+ "label-width": r.labelWidth,
538
+ required: r.required,
539
+ rules: e(u)
540
+ }, {
541
+ default: d(() => [
542
+ o.value ? (p(), h(e(we), {
543
+ key: 0,
544
+ modelValue: s.value,
545
+ "onUpdate:modelValue": m[0] || (m[0] = (c) => s.value = c),
546
+ placeholder: r.placeholder,
547
+ disabled: r.disabled,
548
+ readonly: r.readonly,
549
+ editable: r.editable,
550
+ clearable: r.clearable,
551
+ format: l.value,
552
+ "arrow-control": "",
553
+ style: { width: "100%" }
554
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "format"])) : (p(), h(e(Ve), {
555
+ key: 1,
556
+ modelValue: s.value,
557
+ "onUpdate:modelValue": m[1] || (m[1] = (c) => s.value = c),
558
+ placeholder: r.placeholder,
559
+ disabled: r.disabled,
560
+ readonly: r.readonly,
561
+ editable: r.editable,
562
+ clearable: r.clearable,
563
+ type: a.value,
564
+ format: l.value,
565
+ style: { width: "100%" }
566
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "editable", "clearable", "type", "format"]))
567
+ ]),
568
+ _: 1
569
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
570
+ ]),
571
+ _: 1
572
+ }, 8, ["span"]));
683
573
  }
684
- });
685
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
686
- ...{ name: "OFormFile", inheritAttrs: false },
574
+ }), Pe = /* @__PURE__ */ y({
575
+ name: "OFormFile",
576
+ inheritAttrs: !1,
687
577
  __name: "FileInput",
688
578
  props: {
689
579
  name: {},
@@ -694,90 +584,76 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
694
584
  rules: {},
695
585
  disabled: { type: Boolean }
696
586
  },
697
- setup(__props) {
698
- const normalizedSpan = useFormItemSpan();
699
- const normalizedRules = useFormItemRules();
700
- const elModel = useFormItemStringModel();
701
- watch(elModel, () => {
702
- if (!elModel.value) {
703
- file.value = "";
704
- }
587
+ setup(t) {
588
+ const i = v(), u = V(), o = z();
589
+ ie(o, () => {
590
+ o.value || (l.value = "");
705
591
  });
706
- const file = ref("");
707
- const fileRef = useTemplateRef("inputRef");
708
- onMounted(() => {
709
- fileRef.value.input.onchange = (event) => {
710
- var _a;
711
- elModel.value = (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.files[0];
712
- };
713
- file.value = "";
714
- });
715
- return (_ctx, _cache) => {
716
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
717
- default: withCtx(() => [
718
- createVNode(unref(ElFormItem), {
719
- prop: _ctx.name,
720
- label: _ctx.label,
721
- "label-width": _ctx.labelWidth,
722
- required: _ctx.required,
723
- rules: unref(normalizedRules)
724
- }, {
725
- default: withCtx(() => [
726
- createVNode(unref(ElInput), {
727
- ref: "inputRef",
728
- modelValue: file.value,
729
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => file.value = $event),
730
- disabled: _ctx.disabled,
731
- type: "file",
732
- "validate-event": false
733
- }, null, 8, ["modelValue", "disabled"])
734
- ]),
735
- _: 1
736
- }, 8, ["prop", "label", "label-width", "required", "rules"])
737
- ]),
738
- _: 1
739
- }, 8, ["span"]);
740
- };
592
+ const l = P(""), a = Y("inputRef");
593
+ return pe(() => {
594
+ a.value.input.onchange = (n) => {
595
+ var s;
596
+ o.value = (s = n == null ? void 0 : n.target) == null ? void 0 : s.files[0];
597
+ }, l.value = "";
598
+ }), (n, s) => (p(), h(e(g), { span: e(i) }, {
599
+ default: d(() => [
600
+ f(e(w), {
601
+ prop: n.name,
602
+ label: n.label,
603
+ "label-width": n.labelWidth,
604
+ required: n.required,
605
+ rules: e(u)
606
+ }, {
607
+ default: d(() => [
608
+ f(e(O), {
609
+ ref: "inputRef",
610
+ modelValue: l.value,
611
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
612
+ disabled: n.disabled,
613
+ type: "file",
614
+ "validate-event": !1
615
+ }, null, 8, ["modelValue", "disabled"])
616
+ ]),
617
+ _: 1
618
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
619
+ ]),
620
+ _: 1
621
+ }, 8, ["span"]));
741
622
  }
742
- });
743
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
744
- ...{ name: "OFormButtongroup", inheritAttrs: false },
623
+ }), Ye = /* @__PURE__ */ y({
624
+ name: "OFormButtongroup",
625
+ inheritAttrs: !1,
745
626
  __name: "ButtonGroup",
746
627
  props: {
747
628
  span: {},
748
629
  gutter: { type: [Boolean, String] },
749
630
  align: { default: "right" }
750
631
  },
751
- setup(__props) {
752
- const style = computed(() => {
753
- return {
754
- textAlign: __props.align
755
- };
756
- });
757
- const normalizedSpan = useFormItemSpan();
758
- return (_ctx, _cache) => {
759
- return openBlock(), createBlock(unref(ElCol), {
760
- span: unref(normalizedSpan),
761
- style: normalizeStyle(style.value)
762
- }, {
763
- default: withCtx(() => [
764
- createVNode(unref(Space), {
765
- gutter: _ctx.gutter,
766
- style: { "margin-bottom": "18px" }
767
- }, {
768
- default: withCtx(() => [
769
- renderSlot(_ctx.$slots, "default")
770
- ]),
771
- _: 3
772
- }, 8, ["gutter"])
773
- ]),
774
- _: 3
775
- }, 8, ["span", "style"]);
776
- };
632
+ setup(t) {
633
+ const i = F(() => ({
634
+ textAlign: t.align
635
+ })), u = v();
636
+ return (o, l) => (p(), h(e(g), {
637
+ span: e(u),
638
+ style: me(i.value)
639
+ }, {
640
+ default: d(() => [
641
+ f(e(Fe), {
642
+ gutter: o.gutter,
643
+ style: { "margin-bottom": "18px" }
644
+ }, {
645
+ default: d(() => [
646
+ $(o.$slots, "default")
647
+ ]),
648
+ _: 3
649
+ }, 8, ["gutter"])
650
+ ]),
651
+ _: 3
652
+ }, 8, ["span", "style"]));
777
653
  }
778
- });
779
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
780
- ...{ name: "OFormDiy", inheritAttrs: false },
654
+ }), Ge = /* @__PURE__ */ y({
655
+ name: "OFormDiy",
656
+ inheritAttrs: !1,
781
657
  __name: "DiyItem",
782
658
  props: {
783
659
  name: {},
@@ -787,32 +663,29 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
787
663
  required: { type: Boolean },
788
664
  rules: {}
789
665
  },
790
- setup(__props) {
791
- const normalizedSpan = useFormItemSpan();
792
- const normalizedRules = useFormItemRules();
793
- return (_ctx, _cache) => {
794
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
795
- default: withCtx(() => [
796
- createVNode(unref(ElFormItem), {
797
- prop: _ctx.name,
798
- label: _ctx.label,
799
- "label-width": _ctx.labelWidth,
800
- required: _ctx.required,
801
- rules: unref(normalizedRules)
802
- }, {
803
- default: withCtx(() => [
804
- renderSlot(_ctx.$slots, "default")
805
- ]),
806
- _: 3
807
- }, 8, ["prop", "label", "label-width", "required", "rules"])
808
- ]),
809
- _: 3
810
- }, 8, ["span"]);
811
- };
666
+ setup(t) {
667
+ const i = v(), u = V();
668
+ return (o, l) => (p(), h(e(g), { span: e(i) }, {
669
+ default: d(() => [
670
+ f(e(w), {
671
+ prop: o.name,
672
+ label: o.label,
673
+ "label-width": o.labelWidth,
674
+ required: o.required,
675
+ rules: e(u)
676
+ }, {
677
+ default: d(() => [
678
+ $(o.$slots, "default")
679
+ ]),
680
+ _: 3
681
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
682
+ ]),
683
+ _: 3
684
+ }, 8, ["span"]));
812
685
  }
813
- });
814
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
815
- ...{ name: "OFormLov", inheritAttrs: false },
686
+ }), Le = /* @__PURE__ */ y({
687
+ name: "OFormLov",
688
+ inheritAttrs: !1,
816
689
  __name: "LovInput",
817
690
  props: {
818
691
  name: {},
@@ -827,133 +700,93 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
827
700
  readonly: { type: Boolean },
828
701
  fillMapping: { type: [String, Function] }
829
702
  },
830
- setup(__props) {
831
- const normalizedSpan = useFormItemSpan();
832
- const normalizedRules = useFormItemRules();
833
- const elModel = useFormItemStringModel();
834
- const formContext = useFormContext();
835
- const visible = ref(false);
836
- const onVisibleChange = (val) => {
837
- visible.value = val;
838
- };
839
- const changed = ref(false);
840
- const onInput = () => {
841
- var _a;
842
- if (!changed.value) {
843
- changed.value = true;
844
- }
845
- if (!visible.value) {
846
- (_a = dropdownRef.value) == null ? void 0 : _a.handleOpen();
847
- }
848
- };
849
- let keydownHandler;
850
- const registerKeydownHandler = (handler) => {
851
- keydownHandler = handler;
703
+ setup(t) {
704
+ const i = v(), u = V(), o = z(), l = T(), a = P(!1), n = (b) => {
705
+ a.value = b;
706
+ }, s = P(!1), r = () => {
707
+ var b;
708
+ s.value || (s.value = !0), a.value || (b = N.value) == null || b.handleOpen();
852
709
  };
853
- const onKeydown = (e) => {
854
- var _a;
855
- const fallthroughCodes = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Space"];
856
- if (fallthroughCodes.indexOf(e.code) > -1) {
857
- if (visible.value) {
858
- keydownHandler && keydownHandler(e.code);
710
+ let m;
711
+ const c = (b) => {
712
+ m = b;
713
+ }, S = (b) => {
714
+ var C;
715
+ ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Enter", "Space"].indexOf(b.code) > -1 && (a.value && m && m(b.code), b.stopPropagation()), ["ArrowUp", "ArrowDown"].indexOf(b.code) > -1 && !a.value && ((C = N.value) == null || C.handleOpen());
716
+ }, _ = () => {
717
+ if (s.value && A(t.fillMapping)) {
718
+ const b = {}, B = t.fillMapping.split(",");
719
+ for (let M = 0; M < B.length; M++) {
720
+ const C = B[M].split(":")[0].trim();
721
+ b[C] = void 0;
859
722
  }
860
- e.stopPropagation();
723
+ l.updateModelValueMulti(b);
861
724
  }
862
- const triggerCodes = ["ArrowUp", "ArrowDown"];
863
- if (triggerCodes.indexOf(e.code) > -1 && !visible.value) {
864
- (_a = dropdownRef.value) == null ? void 0 : _a.handleOpen();
865
- }
866
- };
867
- const onChange = () => {
868
- if (!changed.value) {
869
- return;
870
- }
871
- if (isString(__props.fillMapping)) {
872
- const data = {};
873
- const pairs = __props.fillMapping.split(",");
874
- for (let i = 0; i < pairs.length; i++) {
875
- const dstName = pairs[i].split(":")[0].trim();
876
- data[dstName] = void 0;
877
- }
878
- formContext.updateModelValueMulti(data);
879
- }
880
- };
881
- const dropdownRef = useTemplateRef("dropdown");
882
- const backfill = (params) => {
883
- var _a;
884
- (_a = dropdownRef.value) == null ? void 0 : _a.handleClose();
885
- if (isString(__props.fillMapping)) {
886
- const data = {};
887
- const pairs = __props.fillMapping.split(",");
888
- for (let i = 0; i < pairs.length; i++) {
889
- const dstName = pairs[i].split(":")[0].trim();
890
- const srcName = pairs[i].split(":")[1].trim();
891
- const srcValue = params[srcName];
892
- data[dstName] = srcValue;
893
- }
894
- formContext.updateModelValueMulti(data);
895
- } else {
896
- __props.fillMapping && __props.fillMapping(params);
897
- }
898
- if (changed.value) {
899
- changed.value = false;
900
- }
901
- };
902
- provide(
903
- lovContextKey,
904
- reactive({
905
- lovValue: elModel,
906
- backfill,
907
- registerKeydownHandler
725
+ }, N = Y("dropdown");
726
+ return L(
727
+ ze,
728
+ j({
729
+ lovValue: o,
730
+ backfill: (b) => {
731
+ var B;
732
+ if ((B = N.value) == null || B.handleClose(), A(t.fillMapping)) {
733
+ const M = {}, C = t.fillMapping.split(",");
734
+ for (let k = 0; k < C.length; k++) {
735
+ const ee = C[k].split(":")[0].trim(), le = C[k].split(":")[1].trim(), ae = b[le];
736
+ M[ee] = ae;
737
+ }
738
+ l.updateModelValueMulti(M);
739
+ } else
740
+ t.fillMapping && t.fillMapping(b);
741
+ s.value && (s.value = !1);
742
+ },
743
+ registerKeydownHandler: c
908
744
  })
909
- );
910
- return (_ctx, _cache) => {
911
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
912
- default: withCtx(() => [
913
- createVNode(unref(ElFormItem), {
914
- prop: _ctx.name,
915
- label: _ctx.label,
916
- "label-width": _ctx.labelWidth,
917
- required: _ctx.required,
918
- rules: unref(normalizedRules)
919
- }, {
920
- default: withCtx(() => [
921
- createVNode(unref(ElDropdown), {
922
- ref: "dropdown",
923
- trigger: "click",
924
- onVisibleChange,
925
- style: { "width": "100%" }
926
- }, {
927
- dropdown: withCtx(() => [
928
- renderSlot(_ctx.$slots, "default")
929
- ]),
930
- default: withCtx(() => [
931
- createVNode(unref(ElInput), {
932
- modelValue: unref(elModel),
933
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(elModel) ? elModel.value = $event : null),
934
- maxlength: _ctx.maxlength,
935
- placeholder: _ctx.placeholder,
936
- disabled: _ctx.disabled,
937
- readonly: _ctx.readonly,
938
- onInput,
939
- onKeydown,
940
- onChange,
941
- "suffix-icon": unref(search_default)
942
- }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "suffix-icon"])
943
- ]),
944
- _: 3
945
- }, 512)
946
- ]),
947
- _: 3
948
- }, 8, ["prop", "label", "label-width", "required", "rules"])
949
- ]),
950
- _: 3
951
- }, 8, ["span"]);
952
- };
745
+ ), (b, B) => (p(), h(e(g), { span: e(i) }, {
746
+ default: d(() => [
747
+ f(e(w), {
748
+ prop: b.name,
749
+ label: b.label,
750
+ "label-width": b.labelWidth,
751
+ required: b.required,
752
+ rules: e(u)
753
+ }, {
754
+ default: d(() => [
755
+ f(e(Se), {
756
+ ref: "dropdown",
757
+ trigger: "click",
758
+ onVisibleChange: n,
759
+ style: { width: "100%" }
760
+ }, {
761
+ dropdown: d(() => [
762
+ $(b.$slots, "default")
763
+ ]),
764
+ default: d(() => [
765
+ f(e(O), {
766
+ modelValue: e(o),
767
+ "onUpdate:modelValue": B[0] || (B[0] = (M) => q(o) ? o.value = M : null),
768
+ maxlength: b.maxlength,
769
+ placeholder: b.placeholder,
770
+ disabled: b.disabled,
771
+ readonly: b.readonly,
772
+ onInput: r,
773
+ onKeydown: S,
774
+ onChange: _,
775
+ "suffix-icon": e(Oe)
776
+ }, null, 8, ["modelValue", "maxlength", "placeholder", "disabled", "readonly", "suffix-icon"])
777
+ ]),
778
+ _: 3
779
+ }, 512)
780
+ ]),
781
+ _: 3
782
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
783
+ ]),
784
+ _: 3
785
+ }, 8, ["span"]));
953
786
  }
954
- });
955
- const _sfc_main = /* @__PURE__ */ defineComponent({
956
- ...{ name: "OFormNumber", inheritAttrs: false },
787
+ }), je = /* @__PURE__ */ y({
788
+ name: "OFormNumber",
789
+ inheritAttrs: !1,
957
790
  __name: "NumberInput",
958
791
  props: {
959
792
  name: {},
@@ -970,91 +803,78 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
970
803
  step: {},
971
804
  stepStrictly: { type: Boolean },
972
805
  precision: {},
973
- controls: { type: Boolean, default: true },
806
+ controls: { type: Boolean, default: !0 },
974
807
  controlsPosition: {}
975
808
  },
976
- setup(__props) {
977
- const normalizedSpan = useFormItemSpan();
978
- const normalizedRules = useFormItemRules();
979
- const formContext = useFormContext();
980
- const elModel = computed({
809
+ setup(t) {
810
+ const i = v(), u = V(), o = T(), l = F({
981
811
  get: () => {
982
- const value = formContext.modelValue[__props.name];
983
- if (!value) {
984
- return void 0;
985
- }
986
- if (isNumber(value)) {
987
- return value;
988
- } else if (isString(value)) {
989
- return toNumber(value);
990
- } else {
991
- throw new OrionError("数字输入框的值只能为字符串或数字类型");
812
+ const a = o.modelValue[t.name];
813
+ if (a) {
814
+ if (ne(a))
815
+ return a;
816
+ if (A(a))
817
+ return de(a);
818
+ throw new W("数字输入框的值只能为字符串或数字类型");
992
819
  }
993
820
  },
994
- set: (newValue) => {
995
- if (!newValue) {
996
- formContext.updateModelValue(__props.name, void 0);
997
- } else {
998
- formContext.updateModelValue(__props.name, newValue);
999
- }
821
+ set: (a) => {
822
+ a ? o.updateModelValue(t.name, a) : o.updateModelValue(t.name, void 0);
1000
823
  }
1001
824
  });
1002
- return (_ctx, _cache) => {
1003
- return openBlock(), createBlock(unref(ElCol), { span: unref(normalizedSpan) }, {
1004
- default: withCtx(() => [
1005
- createVNode(unref(ElFormItem), {
1006
- prop: _ctx.name,
1007
- label: _ctx.label,
1008
- "label-width": _ctx.labelWidth,
1009
- required: _ctx.required,
1010
- rules: unref(normalizedRules)
1011
- }, {
1012
- default: withCtx(() => [
1013
- createVNode(unref(ElInputNumber), {
1014
- modelValue: elModel.value,
1015
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => elModel.value = $event),
1016
- placeholder: _ctx.placeholder,
1017
- disabled: _ctx.disabled,
1018
- readonly: _ctx.readonly,
1019
- min: _ctx.min,
1020
- max: _ctx.max,
1021
- step: _ctx.step,
1022
- "step-strictly": _ctx.stepStrictly,
1023
- precision: _ctx.precision,
1024
- controls: _ctx.controls,
1025
- "controls-position": _ctx.controlsPosition,
1026
- style: { "width": "100%" }
1027
- }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "min", "max", "step", "step-strictly", "precision", "controls", "controls-position"])
1028
- ]),
1029
- _: 1
1030
- }, 8, ["prop", "label", "label-width", "required", "rules"])
1031
- ]),
1032
- _: 1
1033
- }, 8, ["span"]);
1034
- };
825
+ return (a, n) => (p(), h(e(g), { span: e(i) }, {
826
+ default: d(() => [
827
+ f(e(w), {
828
+ prop: a.name,
829
+ label: a.label,
830
+ "label-width": a.labelWidth,
831
+ required: a.required,
832
+ rules: e(u)
833
+ }, {
834
+ default: d(() => [
835
+ f(e(qe), {
836
+ modelValue: l.value,
837
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => l.value = s),
838
+ placeholder: a.placeholder,
839
+ disabled: a.disabled,
840
+ readonly: a.readonly,
841
+ min: a.min,
842
+ max: a.max,
843
+ step: a.step,
844
+ "step-strictly": a.stepStrictly,
845
+ precision: a.precision,
846
+ controls: a.controls,
847
+ "controls-position": a.controlsPosition,
848
+ style: { width: "100%" }
849
+ }, null, 8, ["modelValue", "placeholder", "disabled", "readonly", "min", "max", "step", "step-strictly", "precision", "controls", "controls-position"])
850
+ ]),
851
+ _: 1
852
+ }, 8, ["prop", "label", "label-width", "required", "rules"])
853
+ ]),
854
+ _: 1
855
+ }, 8, ["span"]));
1035
856
  }
1036
- });
1037
- const index = withInstall(_sfc_main$f, {
1038
- StringInput: _sfc_main$e,
1039
- PasswordInput: _sfc_main$d,
1040
- Textarea: _sfc_main$c,
1041
- SingleSelect: _sfc_main$b,
1042
- MultiSelect: _sfc_main$a,
1043
- RadioGroup: _sfc_main$9,
1044
- CheckboxGroup: _sfc_main$8,
1045
- Checkbox: _sfc_main$7,
1046
- Switch: _sfc_main$6,
1047
- DateInput: _sfc_main$5,
1048
- FileInput: _sfc_main$4,
1049
- ButtonGroup: _sfc_main$3,
1050
- DiyItem: _sfc_main$2,
1051
- LovInput: _sfc_main$1,
1052
- NumberInput: _sfc_main
857
+ }), rl = be(We, {
858
+ StringInput: ke,
859
+ PasswordInput: Re,
860
+ Textarea: Ae,
861
+ SingleSelect: $e,
862
+ MultiSelect: De,
863
+ RadioGroup: Ee,
864
+ CheckboxGroup: Ie,
865
+ Checkbox: Ue,
866
+ Switch: Te,
867
+ DateInput: Ne,
868
+ FileInput: Pe,
869
+ ButtonGroup: Ye,
870
+ DiyItem: Ge,
871
+ LovInput: Le,
872
+ NumberInput: je
1053
873
  });
1054
874
  export {
1055
- index as default,
1056
- formContextKey,
1057
- lovContextKey,
1058
- default2 as useLov
875
+ rl as default,
876
+ Be as formContextKey,
877
+ ze as lovContextKey,
878
+ dl as useLov
1059
879
  };
1060
880
  //# sourceMappingURL=index.js.map