orion-design 0.1.31 → 0.1.33

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