@para-ui/core 2.2.4 → 2.2.5-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/AutoBox/index.d.ts +12 -6
  2. package/AutoBox/index.js +203 -15
  3. package/AutoTips/index.d.ts +12 -6
  4. package/AutoTips/index.js +84 -15
  5. package/Breadcrumbs/index.d.ts +13 -7
  6. package/Breadcrumbs/index.js +227 -15
  7. package/Button/index.d.ts +92 -11
  8. package/Button/index.js +348 -14
  9. package/ButtonGroup/index.d.ts +21 -9
  10. package/ButtonGroup/index.js +128 -14
  11. package/Carousel/index.d.ts +17 -11
  12. package/Carousel/index.js +74 -15
  13. package/Cascader/index.d.ts +12 -7
  14. package/Cascader/index.js +166 -15
  15. package/Checkbox/index.d.ts +13 -7
  16. package/Checkbox/index.js +105 -14
  17. package/CheckboxGroup/index.d.ts +15 -9
  18. package/CheckboxGroup/index.js +138 -14
  19. package/Collapse/index.d.ts +49 -14
  20. package/Collapse/index.js +171 -15
  21. package/CollapseBox/index.d.ts +11 -5
  22. package/CollapseBox/index.js +164 -15
  23. package/ColorPicker/index.d.ts +4 -4
  24. package/ColorPicker/index.js +4 -1
  25. package/ComboSelect/index.d.ts +306 -6
  26. package/ComboSelect/index.js +1803 -14
  27. package/Container/index.d.ts +13 -8
  28. package/Container/index.js +239 -15
  29. package/DatePicker/index.d.ts +30 -17
  30. package/DatePicker/index.js +733 -14
  31. package/Desktop/index.d.ts +14 -6
  32. package/Desktop/index.js +853 -14
  33. package/Drawer/index.d.ts +92 -6
  34. package/Drawer/index.js +186 -14
  35. package/Dropdown/index.d.ts +29 -0
  36. package/Dropdown/index.js +67 -0
  37. package/Empty/index.d.ts +16 -10
  38. package/Empty/index.js +644 -14
  39. package/Form/index.d.ts +11 -9
  40. package/Form/index.js +384 -14
  41. package/FormItem/index.d.ts +5 -152
  42. package/FormItem/index.js +81 -14
  43. package/FunctionModal/index.d.ts +14 -3
  44. package/FunctionModal/index.js +39 -14
  45. package/GlobalContext/index.d.ts +38 -8
  46. package/GlobalContext/index.js +41 -16
  47. package/Help/index.d.ts +16 -10
  48. package/Help/index.js +39 -15
  49. package/HelperText/index.d.ts +11 -5
  50. package/HelperText/index.js +29 -15
  51. package/InputLang/index.d.ts +13 -7
  52. package/InputLang/index.js +270 -14
  53. package/InputNumber/index.d.ts +16 -10
  54. package/InputNumber/index.js +308 -14
  55. package/Label/index.d.ts +12 -6
  56. package/Label/index.js +81 -14
  57. package/Loading/index.d.ts +12 -6
  58. package/Loading/index.js +47 -15
  59. package/Menu/index.d.ts +123 -5
  60. package/Menu/index.js +1232 -14
  61. package/Message/index.d.ts +11 -5
  62. package/Message/index.js +222 -15
  63. package/Modal/index.d.ts +142 -40
  64. package/Modal/index.js +443 -14
  65. package/MultiBox/index.d.ts +13 -7
  66. package/MultiBox/index.js +231 -14
  67. package/Notification/index.d.ts +22 -16
  68. package/Notification/index.js +266 -15
  69. package/OperateBtn/index.d.ts +16 -10
  70. package/OperateBtn/index.js +260 -14
  71. package/PageHeader/index.d.ts +178 -5
  72. package/PageHeader/index.js +1171 -14
  73. package/Pagination/index.d.ts +12 -6
  74. package/Pagination/index.js +469 -14
  75. package/ParauiProvider/index.d.ts +9 -8
  76. package/ParauiProvider/index.js +53 -15
  77. package/PopConfirm/index.d.ts +23 -10
  78. package/PopConfirm/index.js +189 -14
  79. package/Popover/index.d.ts +18 -11
  80. package/Popover/index.js +66 -15
  81. package/Progress/index.d.ts +18 -12
  82. package/Progress/index.js +358 -20
  83. package/Querying/index.d.ts +15 -9
  84. package/Querying/index.js +762 -14
  85. package/Radio/index.d.ts +13 -7
  86. package/Radio/index.js +94 -14
  87. package/RadioGroup/index.d.ts +15 -9
  88. package/RadioGroup/index.js +128 -14
  89. package/Search/index.d.ts +18 -12
  90. package/Search/index.js +220 -14
  91. package/Select/index.d.ts +13 -7
  92. package/Select/index.js +1288 -14
  93. package/SelectInput/index.d.ts +11 -5
  94. package/SelectInput/index.js +51 -14
  95. package/SingleBox/index.d.ts +13 -7
  96. package/SingleBox/index.js +194 -14
  97. package/Slider/index.d.ts +104 -7
  98. package/Slider/index.js +125 -15
  99. package/Split/index.d.ts +8 -3
  100. package/Split/index.js +134 -15
  101. package/Stepper/index.d.ts +41 -25
  102. package/Stepper/index.js +99 -15
  103. package/Switch/index.d.ts +16 -10
  104. package/Switch/index.js +73 -14
  105. package/Table/index.d.ts +12 -4
  106. package/Table/index.js +2725 -14
  107. package/Tabs/index.d.ts +64 -29
  108. package/Tabs/index.js +218 -14
  109. package/Tag/index.d.ts +78 -12
  110. package/Tag/index.js +286 -14
  111. package/Test/index.d.ts +3 -2
  112. package/Test/index.js +9 -16
  113. package/TextField/index.d.ts +22 -16
  114. package/TextField/index.js +686 -14
  115. package/TimePicker/index.d.ts +20 -10
  116. package/TimePicker/index.js +77 -14
  117. package/Timeline/index.d.ts +49 -13
  118. package/Timeline/index.js +150 -15
  119. package/ToggleButton/index.d.ts +61 -10
  120. package/ToggleButton/index.js +200 -14
  121. package/Tooltip/index.d.ts +12 -10
  122. package/Tooltip/index.js +335 -15
  123. package/Transfer/index.d.ts +8 -3
  124. package/Transfer/index.js +343 -14
  125. package/Tree/index.d.ts +8 -5
  126. package/Tree/index.js +35 -14
  127. package/Upload/index.d.ts +179 -8
  128. package/Upload/index.js +1542 -14
  129. package/_verture/defineProperty-0590dc61.js +16 -0
  130. package/_verture/index-0d8e1d07.js +4 -0
  131. package/_verture/index-14a47097.js +4 -0
  132. package/_verture/index-342379c6.js +391 -0
  133. package/_verture/index-458032d7.js +10 -0
  134. package/_verture/index-46bfb2f0.js +778 -0
  135. package/_verture/index-50401de7.js +4 -0
  136. package/_verture/index-5b08df83.js +4 -0
  137. package/_verture/index-6190b129.js +4 -0
  138. package/_verture/index-7ef1e3b6.js +1553 -0
  139. package/_verture/index-a369ca3f.js +4 -0
  140. package/_verture/index-c60911dc.js +39 -0
  141. package/_verture/index-e2881a53.js +16 -0
  142. package/_verture/index-ff4c2a27.js +200 -0
  143. package/{Tree/interface.d.ts → _verture/interface-128abdd3.js} +15 -25
  144. package/_verture/interface-a77a851e.js +25 -0
  145. package/{Table/interface.d.ts → _verture/interface-a9b7c716.js} +20 -28
  146. package/_verture/intl-336570e4.js +65 -0
  147. package/_verture/modalContext-25890584.js +228 -0
  148. package/_verture/modalContext-639f2787.js +58 -0
  149. package/_verture/slicedToArray-d7722f4b.js +62 -0
  150. package/_verture/style-inject.es-300983ab.js +28 -0
  151. package/_verture/toConsumableArray-f8047a75.js +19 -0
  152. package/_verture/tslib.es6-55ed4bd2.js +38 -0
  153. package/_verture/typeof-498dd2b1.js +11 -0
  154. package/_verture/useFormatMessage-ac9d6acf.js +20 -0
  155. package/_verture/useGlobalProps-af9a2af6.js +12 -0
  156. package/index.d.ts +88 -128
  157. package/index.js +160 -19
  158. package/package.json +59 -22
  159. package/Button/SplitButton.d.ts +0 -61
  160. package/Button/lang/en_US.d.ts +0 -4
  161. package/Button/lang/index.d.ts +0 -9
  162. package/Button/lang/zh_CN.d.ts +0 -4
  163. package/Cascader/lang/en_US.d.ts +0 -4
  164. package/Cascader/lang/index.d.ts +0 -9
  165. package/Cascader/lang/zh_CN.d.ts +0 -4
  166. package/Collapse/collapsePanel.d.ts +0 -30
  167. package/Collapse/motion.d.ts +0 -5
  168. package/Collapse/util.d.ts +0 -11
  169. package/CollapseBox/util.d.ts +0 -5
  170. package/ComboSelect/WithTabsCombo/index.d.ts +0 -11
  171. package/ComboSelect/WithTabsCombo/interface.d.ts +0 -141
  172. package/ComboSelect/interface.d.ts +0 -143
  173. package/ComboSelect/lang/en_US.d.ts +0 -8
  174. package/ComboSelect/lang/index.d.ts +0 -17
  175. package/ComboSelect/lang/zh_CN.d.ts +0 -8
  176. package/ComboSelect/utils.d.ts +0 -12
  177. package/DatePicker/PickerButton.d.ts +0 -3
  178. package/DatePicker/PickerTag.d.ts +0 -3
  179. package/DatePicker/generatePicker/generateRangePicker.d.ts +0 -4
  180. package/DatePicker/generatePicker/generateSinglePicker.d.ts +0 -11
  181. package/DatePicker/generatePicker/index.d.ts +0 -77
  182. package/DatePicker/lang/en_US.d.ts +0 -3
  183. package/DatePicker/lang/index.d.ts +0 -7
  184. package/DatePicker/lang/zh_CN.d.ts +0 -3
  185. package/DatePicker/util.d.ts +0 -20
  186. package/Drawer/interface.d.ts +0 -83
  187. package/Drawer/lang/en_US.d.ts +0 -5
  188. package/Drawer/lang/index.d.ts +0 -11
  189. package/Drawer/lang/zh_CN.d.ts +0 -5
  190. package/Empty/images/index.d.ts +0 -2
  191. package/Empty/lang/en_US.d.ts +0 -6
  192. package/Empty/lang/index.d.ts +0 -13
  193. package/Empty/lang/zh_CN.d.ts +0 -6
  194. package/FormItem/compoments/defaultCompoments/index.d.ts +0 -19
  195. package/FormItem/compoments/formCheckboxGroup/index.d.ts +0 -8
  196. package/FormItem/compoments/formFile/index.d.ts +0 -38
  197. package/FormItem/compoments/formRadioGroup/index.d.ts +0 -8
  198. package/FormItem/compoments/formSelect/index.d.ts +0 -18
  199. package/FormItem/errorTips.d.ts +0 -12
  200. package/FormItem/itemType.d.ts +0 -42
  201. package/FormItem/validateFunction.d.ts +0 -15
  202. package/FunctionModal/dialog.d.ts +0 -58
  203. package/FunctionModal/modalContext.d.ts +0 -14
  204. package/GlobalContext/componentsProps.d.ts +0 -19
  205. package/GlobalContext/confirmLocale.d.ts +0 -7
  206. package/GlobalContext/intl.d.ts +0 -34
  207. package/GlobalContext/useFormatMessage.d.ts +0 -3
  208. package/Hooks/useGlobalProps.d.ts +0 -1
  209. package/Menu/footerExpansion.d.ts +0 -9
  210. package/Menu/interface.d.ts +0 -139
  211. package/Menu/logo.d.ts +0 -9
  212. package/Menu/verticalMenuList.d.ts +0 -14
  213. package/Modal/Confirm/index.d.ts +0 -66
  214. package/Modal/lang/en_US.d.ts +0 -5
  215. package/Modal/lang/index.d.ts +0 -11
  216. package/Modal/lang/zh_CN.d.ts +0 -5
  217. package/OperateBtn/lang/en_US.d.ts +0 -4
  218. package/OperateBtn/lang/index.d.ts +0 -9
  219. package/OperateBtn/lang/zh_CN.d.ts +0 -4
  220. package/PageHeader/horizontalMeun.d.ts +0 -9
  221. package/PageHeader/horizontalMeunRight.d.ts +0 -9
  222. package/PageHeader/interface.d.ts +0 -167
  223. package/Pagination/lang/en_US.d.ts +0 -8
  224. package/Pagination/lang/index.d.ts +0 -17
  225. package/Pagination/lang/zh_CN.d.ts +0 -8
  226. package/PopConfirm/lang/en_US.d.ts +0 -5
  227. package/PopConfirm/lang/index.d.ts +0 -11
  228. package/PopConfirm/lang/zh_CN.d.ts +0 -5
  229. package/Popper/index.d.ts +0 -13
  230. package/Popper/index.js +0 -16
  231. package/Progress/Line.d.ts +0 -47
  232. package/Progress/Steps.d.ts +0 -17
  233. package/Progress/utils.d.ts +0 -6
  234. package/Querying/images/index.d.ts +0 -2
  235. package/Querying/lang/en_US.d.ts +0 -4
  236. package/Querying/lang/index.d.ts +0 -9
  237. package/Querying/lang/zh_CN.d.ts +0 -4
  238. package/README.md +0 -489
  239. package/Select/lang/en_US.d.ts +0 -5
  240. package/Select/lang/index.d.ts +0 -11
  241. package/Select/lang/zh_CN.d.ts +0 -5
  242. package/Slider/interface.d.ts +0 -102
  243. package/Stepper/icons.d.ts +0 -5
  244. package/Table/lang/en_US.d.ts +0 -6
  245. package/Table/lang/index.d.ts +0 -13
  246. package/Table/lang/zh_CN.d.ts +0 -6
  247. package/Table/tableBody.d.ts +0 -9
  248. package/Table/tableBodyElement/index.d.ts +0 -15
  249. package/Table/tableBodyInterface.d.ts +0 -67
  250. package/Table/tableContainer/index.d.ts +0 -16
  251. package/Table/tableElement/index.d.ts +0 -17
  252. package/Table/tableHead.d.ts +0 -9
  253. package/Table/tableHeadElement/index.d.ts +0 -15
  254. package/Table/tableHeadInterface.d.ts +0 -30
  255. package/Table/tablePagination.d.ts +0 -9
  256. package/Table/tablePaginationInterFace.d.ts +0 -24
  257. package/Table/tdElement/index.d.ts +0 -15
  258. package/Table/thElement/index.d.ts +0 -15
  259. package/Table/trElement/index.d.ts +0 -15
  260. package/Table/util.d.ts +0 -16
  261. package/Tag/TagGroup.d.ts +0 -66
  262. package/TimePicker/locale/en_US.d.ts +0 -3
  263. package/TimePicker/locale/zh_CN.d.ts +0 -3
  264. package/TimePicker/style/index.d.ts +0 -1
  265. package/ToggleButton/ToggleButtonGroup.d.ts +0 -49
  266. package/Transfer/lang/en_US.d.ts +0 -6
  267. package/Transfer/lang/index.d.ts +0 -13
  268. package/Transfer/lang/zh_CN.d.ts +0 -6
  269. package/Tree/OperateBar/index.d.ts +0 -13
  270. package/Tree/Tree.d.ts +0 -4
  271. package/Tree/lang/en_US.d.ts +0 -8
  272. package/Tree/lang/index.d.ts +0 -17
  273. package/Tree/lang/zh_CN.d.ts +0 -8
  274. package/Tree/utils/closestPolyfill.d.ts +0 -0
  275. package/Tree/utils/tools.d.ts +0 -26
  276. package/Tree/utils/treeUtil.d.ts +0 -15
  277. package/Upload/Dragger/index.d.ts +0 -10
  278. package/Upload/ErroTip/index.d.ts +0 -13
  279. package/Upload/ImageUpload/index.d.ts +0 -14
  280. package/Upload/ImgCrop/EasyCrop.d.ts +0 -17
  281. package/Upload/ImgCrop/constants.d.ts +0 -7
  282. package/Upload/ImgCrop/index.d.ts +0 -6
  283. package/Upload/ImgCrop/interface.d.ts +0 -24
  284. package/Upload/UploadList/index.d.ts +0 -5
  285. package/Upload/interface.d.ts +0 -134
  286. package/Upload/lang/en_US.d.ts +0 -12
  287. package/Upload/lang/index.d.ts +0 -25
  288. package/Upload/lang/zh_CN.d.ts +0 -12
  289. package/cdn/AutoBox/index.js +0 -29
  290. package/cdn/AutoTips/index.js +0 -40
  291. package/cdn/Breadcrumbs/index.js +0 -53
  292. package/cdn/Button/index.js +0 -79
  293. package/cdn/ButtonGroup/index.js +0 -79
  294. package/cdn/Carousel/index.js +0 -6
  295. package/cdn/Cascader/index.js +0 -42
  296. package/cdn/Checkbox/index.js +0 -53
  297. package/cdn/CheckboxGroup/index.js +0 -53
  298. package/cdn/Collapse/index.js +0 -27
  299. package/cdn/CollapseBox/index.js +0 -1
  300. package/cdn/ColorPicker/index.js +0 -1
  301. package/cdn/ComboSelect/index.js +0 -438
  302. package/cdn/Container/index.js +0 -1
  303. package/cdn/DatePicker/index.js +0 -185
  304. package/cdn/Desktop/index.js +0 -24
  305. package/cdn/Drawer/index.js +0 -84
  306. package/cdn/Empty/index.js +0 -1
  307. package/cdn/Form/index.js +0 -477
  308. package/cdn/FormItem/index.js +0 -477
  309. package/cdn/FunctionModal/index.js +0 -144
  310. package/cdn/GlobalContext/index.js +0 -1
  311. package/cdn/Help/index.js +0 -53
  312. package/cdn/HelperText/index.js +0 -1
  313. package/cdn/InputLang/index.js +0 -144
  314. package/cdn/InputNumber/index.js +0 -118
  315. package/cdn/Label/index.js +0 -53
  316. package/cdn/Loading/index.js +0 -14
  317. package/cdn/Menu/index.js +0 -40
  318. package/cdn/Message/index.js +0 -53
  319. package/cdn/Modal/index.js +0 -144
  320. package/cdn/MultiBox/index.js +0 -131
  321. package/cdn/Notification/index.js +0 -66
  322. package/cdn/OperateBtn/index.js +0 -92
  323. package/cdn/PageHeader/index.js +0 -92
  324. package/cdn/Pagination/index.js +0 -214
  325. package/cdn/ParauiProvider/index.js +0 -9
  326. package/cdn/PopConfirm/index.js +0 -131
  327. package/cdn/Popover/index.js +0 -16
  328. package/cdn/Popper/index.js +0 -26
  329. package/cdn/Progress/index.js +0 -58
  330. package/cdn/Querying/index.js +0 -1
  331. package/cdn/Radio/index.js +0 -53
  332. package/cdn/RadioGroup/index.js +0 -53
  333. package/cdn/Search/index.js +0 -144
  334. package/cdn/Select/index.js +0 -131
  335. package/cdn/SelectInput/index.js +0 -131
  336. package/cdn/SingleBox/index.js +0 -131
  337. package/cdn/Slider/index.js +0 -16
  338. package/cdn/Split/index.js +0 -1
  339. package/cdn/Stepper/index.js +0 -154
  340. package/cdn/Switch/index.js +0 -71
  341. package/cdn/Table/index.js +0 -292
  342. package/cdn/Tabs/index.js +0 -165
  343. package/cdn/Tag/index.js +0 -27
  344. package/cdn/Test/index.js +0 -1
  345. package/cdn/TextField/index.js +0 -105
  346. package/cdn/TimePicker/index.js +0 -185
  347. package/cdn/Timeline/index.js +0 -16
  348. package/cdn/ToggleButton/index.js +0 -79
  349. package/cdn/Tooltip/index.js +0 -40
  350. package/cdn/Transfer/index.js +0 -170
  351. package/cdn/Tree/index.js +0 -170
  352. package/cdn/Upload/index.js +0 -252
  353. package/style.css +0 -72
@@ -0,0 +1,778 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import React__default from 'react';
3
+ import { _ as _slicedToArray } from './slicedToArray-d7722f4b.js';
4
+ import { TextField } from '../TextField/index.js';
5
+ import { RadioGroup } from '../RadioGroup/index.js';
6
+ import Select from '../Select/index.js';
7
+ import { CheckboxGroup } from '../CheckboxGroup/index.js';
8
+ import { _ as _typeof } from './typeof-498dd2b1.js';
9
+ import { Switch } from '../Switch/index.js';
10
+ import Delete from '@para-ui/icons/Delete';
11
+ import ParaLinkGroup from '@para-ui/icons/LinkGroup';
12
+ import AutoTips from '../AutoTips/index.js';
13
+ import { Button } from '../Button/index.js';
14
+ import { s as styleInject } from './style-inject.es-300983ab.js';
15
+ import { InputNumber } from '../InputNumber/index.js';
16
+ import ComboSelect from '../ComboSelect/index.js';
17
+ import HelperText from '../HelperText/index.js';
18
+ import clsx from 'clsx';
19
+ import Label from '../Label/index.js';
20
+
21
+ var FormRadioGroup = function FormRadioGroup(props) {
22
+ var defaultValue = props.defaultValue,
23
+ change = props.change;
24
+ /**
25
+ * 选中的值
26
+ */
27
+
28
+ var _React$useState = React__default.useState(defaultValue || ''),
29
+ _React$useState2 = _slicedToArray(_React$useState, 2),
30
+ selectValue = _React$useState2[0],
31
+ setSelectValue = _React$useState2[1];
32
+ /**
33
+ * 选中值改变
34
+ */
35
+
36
+
37
+ var changeValue = function changeValue(value) {
38
+ setSelectValue(value);
39
+ change && change(value);
40
+ };
41
+
42
+ return jsx(RadioGroup, Object.assign({
43
+ value: selectValue,
44
+ onChange: changeValue
45
+ }, props));
46
+ };
47
+
48
+ var FormSelect = function FormSelect(props) {
49
+ var _props$defaultValue = props.defaultValue,
50
+ defaultValue = _props$defaultValue === void 0 ? '' : _props$defaultValue,
51
+ change = props.change,
52
+ value = props.value;
53
+ /**
54
+ * 选中的值
55
+ */
56
+
57
+ var _React$useState = React__default.useState(value !== undefined ? value : defaultValue),
58
+ _React$useState2 = _slicedToArray(_React$useState, 2),
59
+ selectValue = _React$useState2[0],
60
+ setSelectValue = _React$useState2[1];
61
+ /**
62
+ * 选中值改变
63
+ */
64
+
65
+
66
+ var changeValue = function changeValue(value) {
67
+ setSelectValue(value);
68
+ change && change(value);
69
+ };
70
+
71
+ React__default.useEffect(function () {
72
+ setSelectValue(value);
73
+ }, [value]);
74
+ return jsx(Select, Object.assign({
75
+ labelMode: "inside",
76
+ onChange: changeValue
77
+ }, props, {
78
+ value: selectValue
79
+ }));
80
+ };
81
+
82
+ var FormCheckboxGroup = function FormCheckboxGroup(props) {
83
+ var defaultValue = props.defaultValue,
84
+ change = props.change;
85
+ /**
86
+ * 选中的值
87
+ */
88
+
89
+ var _React$useState = React__default.useState(defaultValue || []),
90
+ _React$useState2 = _slicedToArray(_React$useState, 2),
91
+ selectValue = _React$useState2[0],
92
+ setSelectValue = _React$useState2[1];
93
+ /**
94
+ * 选中值改变
95
+ */
96
+
97
+
98
+ var changeValue = function changeValue(value) {
99
+ setSelectValue(value);
100
+ change && change(value);
101
+ };
102
+
103
+ return jsx(CheckboxGroup, Object.assign({
104
+ value: selectValue,
105
+ onChange: changeValue
106
+ }, props));
107
+ };
108
+
109
+ /**
110
+ * 表单默认的校验方法
111
+ * @type {{[name: string]: validateFunctionType}}
112
+ */
113
+ var fixedValidateFunction = {
114
+ 'required': function required(item, val) {
115
+ var _a, _b, _c, _d;
116
+
117
+ var vtype = _typeof(val);
118
+
119
+ var error = ((_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.required) || "".concat(item.label, "\u4E0D\u80FD\u4E3A\u7A7A");
120
+ var jude = false;
121
+
122
+ switch (vtype) {
123
+ case 'string':
124
+ var disOnlySpace = item.disOnlySpace !== undefined ? item.disOnlySpace : (_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.validate) === null || _d === void 0 ? void 0 : _d.disOnlySpace;
125
+
126
+ if (!disOnlySpace) {
127
+ jude = !!val;
128
+ } else {
129
+ var space = /^[\s]+$/;
130
+ jude = !!val && !space.test(val);
131
+ }
132
+
133
+ break;
134
+
135
+ case 'number':
136
+ jude = val + 1 > val;
137
+ break;
138
+
139
+ case 'object':
140
+ var str = JSON.stringify(val);
141
+ jude = str !== 'null' && str !== '[]' && str !== '{}';
142
+ break;
143
+
144
+ case 'boolean':
145
+ jude = val !== undefined;
146
+ break;
147
+
148
+ default:
149
+ jude = !!val;
150
+ break;
151
+ }
152
+
153
+ return jude || error;
154
+ },
155
+ 'maxlength': function maxlength(item, val) {
156
+ var _a, _b, _c, _d, _e, _f;
157
+
158
+ var vtype = _typeof(val);
159
+
160
+ var error = ((_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.maxlength) || "\u6700\u5927\u957F\u5EA6\u4E0D\u80FD\u8D85\u8FC7".concat((_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.validate) === null || _d === void 0 ? void 0 : _d.maxlength);
161
+ var jude = false;
162
+
163
+ if (vtype === 'string' || vtype === 'number' && val + 1 > val) {
164
+ jude = !("".concat(val).length > (((_f = (_e = item.rules) === null || _e === void 0 ? void 0 : _e.validate) === null || _f === void 0 ? void 0 : _f.maxlength) || NaN));
165
+ } else {
166
+ jude = !val;
167
+ }
168
+
169
+ return jude || error;
170
+ },
171
+ 'minLength': function minLength(item, val) {
172
+ var _a, _b, _c, _d, _e, _f;
173
+
174
+ var vtype = _typeof(val);
175
+
176
+ var error = ((_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.minLength) || "\u6700\u5C0F\u957F\u5EA6\u4E3A".concat((_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.validate) === null || _d === void 0 ? void 0 : _d.minLength);
177
+ var jude = false;
178
+
179
+ if (vtype === 'string' || vtype === 'number' && val + 1 > val) {
180
+ jude = "".concat(val).length >= (((_f = (_e = item.rules) === null || _e === void 0 ? void 0 : _e.validate) === null || _f === void 0 ? void 0 : _f.minLength) || -1);
181
+ } else {
182
+ jude = !val;
183
+ }
184
+
185
+ return jude || error;
186
+ },
187
+ 'pattern': function pattern(item, val) {
188
+ var _a, _b, _c, _d;
189
+
190
+ var testReg = (_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.validate) === null || _b === void 0 ? void 0 : _b.pattern;
191
+ var error = ((_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.message) === null || _d === void 0 ? void 0 : _d.pattern) || "\u53C2\u6570\u4E0D\u7B26\u5408\u6821\u9A8C\u89C4\u5219: ".concat(testReg);
192
+ var jude = !val;
193
+
194
+ if (testReg && val && typeof testReg !== 'function') {
195
+ jude = testReg.test(val);
196
+ }
197
+
198
+ return jude || error;
199
+ },
200
+ 'min': function min(item, val) {
201
+ var _a, _b, _c, _d, _e, _f, _g, _h;
202
+
203
+ var vtype = _typeof(val);
204
+
205
+ var error = ((_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.min) || "\u6700\u5C0F\u503C\u4E3A".concat((_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.validate) === null || _d === void 0 ? void 0 : _d.min);
206
+ var jude = !val;
207
+
208
+ if (vtype === 'string' || vtype === 'number') {
209
+ jude = val >= (((_f = (_e = item.rules) === null || _e === void 0 ? void 0 : _e.validate) === null || _f === void 0 ? void 0 : _f.min) === undefined ? -Infinity : (_h = (_g = item.rules) === null || _g === void 0 ? void 0 : _g.validate) === null || _h === void 0 ? void 0 : _h.min);
210
+ }
211
+
212
+ return jude || error;
213
+ },
214
+ 'max': function max(item, val) {
215
+ var _a, _b, _c, _d, _e, _f, _g, _h;
216
+
217
+ var vtype = _typeof(val);
218
+
219
+ var error = ((_b = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.message) === null || _b === void 0 ? void 0 : _b.max) || "\u6700\u5927\u503C\u4E3A".concat((_d = (_c = item.rules) === null || _c === void 0 ? void 0 : _c.validate) === null || _d === void 0 ? void 0 : _d.max);
220
+ var jude = !val;
221
+
222
+ if (vtype === 'string' || vtype === 'number') {
223
+ jude = val <= (((_f = (_e = item.rules) === null || _e === void 0 ? void 0 : _e.validate) === null || _f === void 0 ? void 0 : _f.max) === undefined ? Infinity : (_h = (_g = item.rules) === null || _g === void 0 ? void 0 : _g.validate) === null || _h === void 0 ? void 0 : _h.max);
224
+ }
225
+
226
+ return jude || error;
227
+ }
228
+ };
229
+ /**
230
+ * 表单rules校验方法
231
+ * @type {validateFunctionType}
232
+ */
233
+
234
+ var validate = function validate(item, val) {
235
+ var _a, _b;
236
+
237
+ var validateObj = (_a = item.rules) === null || _a === void 0 ? void 0 : _a.validate;
238
+
239
+ if (validateObj) {
240
+ var messageObj = (_b = item.rules) === null || _b === void 0 ? void 0 : _b.message;
241
+ console.log('validateObj');
242
+
243
+ for (var key in validateObj) {
244
+ var tempFuc = validateObj[key];
245
+ var tmsg = '';
246
+
247
+ if (typeof tempFuc === 'function') {
248
+ tmsg = tempFuc(item, val);
249
+ if (tmsg === false && messageObj) tmsg = messageObj[key];
250
+ } else if (!!tempFuc && fixedValidateFunction[key]) {
251
+ tmsg = fixedValidateFunction[key](item, val);
252
+ } else if (!!!tempFuc) {
253
+ tmsg = true;
254
+ } else {
255
+ console.log("\u9879\u76EE: ".concat(item.label, ", \u81EA\u5B9A\u4E49\u6821\u9A8C\u89C4\u5219: ").concat(key, ", \u65B9\u6CD5\u672A\u5B9A\u4E49"));
256
+ tmsg = true;
257
+ }
258
+
259
+ if (tmsg !== true) return tmsg || '';
260
+ }
261
+ }
262
+
263
+ return false;
264
+ };
265
+
266
+ var css_248z$1 = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-file-box {\n padding: 6px;\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n}\n.paraui-file-box .para-file-tips {\n min-height: 20px;\n position: relative;\n padding: 6px;\n}\n.paraui-file-box .para-file-tips .file-tips-item {\n position: relative;\n height: 20px;\n line-height: 16px;\n padding-right: 20px;\n}\n.paraui-file-box .para-file-tips .file-tips-item > [data-name=LinkGroup] {\n vertical-align: middle;\n margin-right: 9px;\n}\n.paraui-file-box .para-file-tips .file-tips-item .file-tips-context {\n display: inline-block;\n vertical-align: middle;\n width: calc(100% - 45px);\n color: rgba(46, 55, 67, 0.7);\n}\n.paraui-file-box .para-file-tips .file-tips-item > [data-name=Delete] {\n display: none;\n vertical-align: middle;\n cursor: pointer;\n position: absolute;\n right: 3px;\n top: 2px;\n}\n.paraui-file-box .para-file-tips .file-tips-item > [data-name=Delete]:hover {\n opacity: 0.8;\n}\n.paraui-file-box .para-file-tips .file-tips-item:hover {\n backgroundColor: #f5f5f5;\n}\n.paraui-file-box .para-file-tips .file-tips-item:hover > [data-name=Delete] {\n display: inline-block;\n}";
267
+ styleInject(css_248z$1);
268
+
269
+ /**
270
+ * 文件组件
271
+ */
272
+
273
+ var FormFile = function FormFile(props) {
274
+ var _props$fileType = props.fileType,
275
+ fileType = _props$fileType === void 0 ? '' : _props$fileType,
276
+ defaultValue = props.defaultValue,
277
+ onChange = props.onChange,
278
+ disabled = props.disabled,
279
+ buttonLabel = props.buttonLabel,
280
+ inputProps = props.inputProps,
281
+ buttonProps = props.buttonProps;
282
+ /**
283
+ * 存储文件输入框真实dom
284
+ * @type {HTMLInputElement}
285
+ */
286
+
287
+ var inputFileEl = React__default.useRef(null);
288
+ /**
289
+ * 模拟点击选择文件
290
+ */
291
+
292
+ var inputFileClick = function inputFileClick() {
293
+ var _a;
294
+
295
+ console.log('inputFileClick', inputFileEl.current);
296
+ (_a = inputFileEl.current) === null || _a === void 0 ? void 0 : _a.click();
297
+ };
298
+ /**
299
+ * 文件改变
300
+ */
301
+
302
+
303
+ var fileChange = function fileChange(value) {
304
+ var val = value !== undefined ? value : inputFileEl.current.files;
305
+ setSelectedFile(val);
306
+ onChange && onChange(val);
307
+ if (value === null) inputFileEl.current.value = null;
308
+ };
309
+ /**
310
+ * @type {string}
311
+ * 已选择的文件
312
+ */
313
+
314
+
315
+ var _React$useState = React__default.useState(),
316
+ _React$useState2 = _slicedToArray(_React$useState, 2),
317
+ selectedFile = _React$useState2[0],
318
+ setSelectedFile = _React$useState2[1];
319
+ /**
320
+ * 初始化操作
321
+ */
322
+
323
+
324
+ React__default.useEffect(function () {
325
+ if (defaultValue) {
326
+ if (typeof defaultValue === 'string') {
327
+ setSelectedFile(defaultValue);
328
+ } else {
329
+ setSelectedFile(defaultValue);
330
+ }
331
+ }
332
+ }, [defaultValue]);
333
+ return jsxs("div", Object.assign({
334
+ className: 'para-file-box paraui-file-box'
335
+ }, {
336
+ children: [!disabled && jsx(Button, Object.assign({
337
+ variant: "outlined"
338
+ }, buttonProps, {
339
+ onClick: inputFileClick
340
+ }, {
341
+ children: buttonLabel || '选择文件'
342
+ })), jsx("input", Object.assign({}, inputProps, {
343
+ ref: inputFileEl,
344
+ type: "file",
345
+ onInput: function onInput() {
346
+ return fileChange();
347
+ },
348
+ hidden: true,
349
+ accept: typeof fileType === 'string' ? fileType : fileType.join(',')
350
+ })), selectedFile && selectedFile[0] && jsx("div", Object.assign({
351
+ className: "para-file-tips ".concat(disabled && 'para-file-tips-disabled' || '')
352
+ }, {
353
+ children: jsxs("div", Object.assign({
354
+ className: "file-tips-item"
355
+ }, {
356
+ children: [jsx(ParaLinkGroup, {}), jsx("span", Object.assign({
357
+ className: "file-tips-context"
358
+ }, {
359
+ children: jsx(AutoTips, {
360
+ children: typeof selectedFile === 'string' ? selectedFile : selectedFile[0].name
361
+ })
362
+ })), !disabled && jsx(Delete, {
363
+ onClick: function onClick() {
364
+ return fileChange(null);
365
+ }
366
+ })]
367
+ }))
368
+ }))]
369
+ }));
370
+ };
371
+
372
+ /**
373
+ * @module src\FormItem\compoments\defaultCompoments\index.tsx
374
+ * @author zhanzl
375
+ * @date 2022/06/02
376
+ */
377
+
378
+ var DefaultCompoments = function DefaultCompoments(props) {
379
+ var error = props.error,
380
+ placeholder = props.placeholder,
381
+ defaultValue = props.defaultValue,
382
+ disabled = props.disabled,
383
+ _onChange = props.onChange,
384
+ inputProps = props.inputProps,
385
+ moudle = props.moudle;
386
+
387
+ var _React$useState = React__default.useState(defaultValue),
388
+ _React$useState2 = _slicedToArray(_React$useState, 2),
389
+ dValue = _React$useState2[0],
390
+ setDvalue = _React$useState2[1]; // 监听defaultValue改变
391
+
392
+
393
+ React__default.useEffect(function () {
394
+ setDvalue(defaultValue);
395
+ }, [defaultValue]);
396
+ return moudle(Object.assign(Object.assign({
397
+ error: error,
398
+ placeholder: placeholder,
399
+ value: dValue,
400
+ disabled: disabled
401
+ }, inputProps), {
402
+ onChange: function onChange(e) {
403
+ var _a;
404
+
405
+ var tVal = ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.value) || e;
406
+ setDvalue(tVal);
407
+
408
+ _onChange(tVal);
409
+ }
410
+ }));
411
+ };
412
+
413
+ /**
414
+ * form 表单操作项 类型
415
+ */
416
+
417
+ var ItemType = function ItemType(props) {
418
+ var ItemType = props.ItemType,
419
+ error = props.error,
420
+ placeholder = props.placeholder,
421
+ label = props.label,
422
+ inputProps = props.inputProps,
423
+ name = props.name,
424
+ rules = props.rules,
425
+ setValue = props.setValue,
426
+ setError = props.setError,
427
+ backData = props.backData,
428
+ disabled = props.disabled,
429
+ change = props.change;
430
+ var tipsStr = placeholder || "".concat(label);
431
+ /**
432
+ * 报错信息
433
+ * @type {boolean}
434
+ */
435
+
436
+ var _React$useState = React__default.useState(!!error),
437
+ _React$useState2 = _slicedToArray(_React$useState, 2),
438
+ errorStatus = _React$useState2[0],
439
+ setErrorStatus = _React$useState2[1];
440
+ /**
441
+ * 校验方法
442
+ */
443
+
444
+
445
+ var validateFunction = function validateFunction(val) {
446
+ setValue && setValue(name, 'value', val);
447
+ change && change(val); // 没有校验规则直接退出
448
+
449
+ if (!rules) return;
450
+ var item = Object.assign(Object.assign({}, props), {
451
+ setErrorMsg: setErrorMsg,
452
+ setAndValidateValue: setAndValidateValue
453
+ });
454
+ var errorMessage = validate(item, val) || '';
455
+ setErrorMsg(errorMessage);
456
+ };
457
+ /**
458
+ * 存储和校验数据
459
+ */
460
+
461
+
462
+ var setAndValidateValue = validateFunction;
463
+ /**
464
+ * 合并设置Error状态方法
465
+ */
466
+
467
+ var setErrorMsg = React__default.useCallback(function (msg) {
468
+ setError && setError(msg);
469
+ setErrorStatus(!!msg);
470
+ setValue && setValue(name, 'message', msg);
471
+ }, [name, setError, setValue]);
472
+ /**
473
+ * 传出最后的 item 对象
474
+ */
475
+
476
+ React__default.useEffect(function () {
477
+ var item = Object.assign(Object.assign({}, props), {
478
+ setErrorMsg: setErrorMsg,
479
+ setAndValidateValue: setAndValidateValue
480
+ });
481
+ setValue && setValue(name, 'item', item);
482
+ }, [name, props, setErrorMsg, setValue]);
483
+ /**
484
+ * 判断显示那个
485
+ */
486
+
487
+ var selectType = function selectType() {
488
+ if (ItemType && typeof ItemType !== 'string' && (!ItemType.name || ItemType.name === 'InputType')) {
489
+ var item = Object.assign(Object.assign({}, props), {
490
+ setErrorMsg: setErrorMsg,
491
+ setAndValidateValue: setAndValidateValue
492
+ });
493
+ return ItemType(item);
494
+ }
495
+
496
+ switch (ItemType) {
497
+ case 'file':
498
+ return jsx(FormFile, Object.assign({}, props, {
499
+ defaultValue: backData[name],
500
+ disabled: disabled,
501
+ onChange: function onChange(value) {
502
+ validateFunction(value);
503
+ }
504
+ }));
505
+
506
+ case 'switch':
507
+ if (backData[name] === undefined) setValue && setValue(name, 'initValue', !!backData[name]);
508
+ return jsx(Switch, Object.assign({
509
+ compact: true,
510
+ defaultChecked: !!backData[name],
511
+ onChange: function onChange(checked) {
512
+ validateFunction(checked);
513
+ }
514
+ }, Object.assign(Object.assign({}, inputProps), {
515
+ disabled: disabled
516
+ })));
517
+
518
+ case 'checkGroup':
519
+ return jsx(FormCheckboxGroup, Object.assign({
520
+ error: errorStatus,
521
+ defaultValue: backData[name],
522
+ change: function change(value) {
523
+ validateFunction(value);
524
+ },
525
+ list: props.list
526
+ }, Object.assign(Object.assign({}, inputProps), {
527
+ disabled: disabled
528
+ })));
529
+
530
+ case 'select':
531
+ return jsx(FormSelect, Object.assign({
532
+ placeholder: tipsStr,
533
+ defaultValue: backData[name],
534
+ error: errorStatus,
535
+ change: function change(value) {
536
+ validateFunction(value);
537
+ },
538
+ list: props.list
539
+ }, Object.assign({
540
+ disabled: disabled
541
+ }, inputProps)));
542
+
543
+ case 'radioGroup':
544
+ return jsx(FormRadioGroup, Object.assign({
545
+ error: errorStatus,
546
+ defaultValue: backData[name],
547
+ change: function change(value) {
548
+ validateFunction(value);
549
+ },
550
+ list: props.list
551
+ }, Object.assign({
552
+ disabled: disabled
553
+ }, inputProps)));
554
+
555
+ case 'textarea':
556
+ return jsx(TextField, Object.assign({
557
+ error: errorStatus,
558
+ placeholder: tipsStr,
559
+ defaultValue: backData[name] || '',
560
+ disabled: disabled,
561
+ multiline: true,
562
+ rows: 3,
563
+ name: name,
564
+ onChange: function onChange(e) {
565
+ validateFunction(e.target.value);
566
+ }
567
+ }, inputProps));
568
+
569
+ case 'number':
570
+ return jsx(InputNumber, Object.assign({
571
+ error: errorStatus,
572
+ placeholder: tipsStr,
573
+ defaultValue: backData[name],
574
+ disabled: disabled,
575
+ name: name,
576
+ onChange: function onChange(val) {
577
+ validateFunction(val);
578
+ }
579
+ }, inputProps));
580
+
581
+ case 'comboSelect':
582
+ return jsx(ComboSelect, Object.assign({
583
+ error: errorStatus,
584
+ placeholder: tipsStr,
585
+ defaultValue: backData[name],
586
+ disabled: disabled,
587
+ onChange: function onChange(options) {
588
+ validateFunction(options);
589
+ }
590
+ }, inputProps));
591
+
592
+ default:
593
+ if (ItemType && typeof ItemType !== 'string') {
594
+ return jsx(DefaultCompoments, {
595
+ moudle: ItemType,
596
+ error: errorStatus,
597
+ placeholder: tipsStr,
598
+ defaultValue: backData[name],
599
+ disabled: disabled,
600
+ onChange: function onChange(val) {
601
+ validateFunction(val);
602
+ },
603
+ inputProps: inputProps
604
+ });
605
+ }
606
+
607
+ return jsx(TextField, Object.assign({
608
+ defaultValue: backData[name] || '',
609
+ error: errorStatus,
610
+ placeholder: tipsStr,
611
+ onChange: function onChange(e) {
612
+ validateFunction(e.target.value);
613
+ },
614
+ name: name,
615
+ disabled: disabled
616
+ }, inputProps));
617
+ }
618
+ };
619
+
620
+ return selectType();
621
+ };
622
+
623
+ /**
624
+ * 报错信息组件
625
+ * @description 为了解决,在主组件设置state,导致输入框中内容刷新,且失去焦点
626
+ */
627
+
628
+ var ErrorTips = function ErrorTips(props) {
629
+ var getSetError = props.getSetError,
630
+ errorMessage = props.errorMessage,
631
+ helperTextProps = props.helperTextProps;
632
+ /**
633
+ * 报错信息
634
+ * @type {string}
635
+ */
636
+
637
+ var _React$useState = React__default.useState(errorMessage || ''),
638
+ _React$useState2 = _slicedToArray(_React$useState, 2),
639
+ errorTips = _React$useState2[0],
640
+ setErrorTips = _React$useState2[1];
641
+ /**
642
+ * 初始化传出, 设置错误信息方法
643
+ */
644
+
645
+
646
+ React__default.useEffect(function () {
647
+ setErrorTips(errorMessage || '');
648
+ }, [errorMessage]);
649
+ React__default.useEffect(function () {
650
+ getSetError && getSetError(setErrorTips);
651
+ }, [getSetError]);
652
+ return jsx(HelperText, Object.assign({
653
+ className: "para-error-tips",
654
+ error: true,
655
+ helperText: errorTips
656
+ }, helperTextProps));
657
+ };
658
+
659
+ var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-form-item {\n font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n font-size: 14px;\n font-weight: 400;\n}\n.paraui-form-item .para-form-label {\n display: inline-block;\n}\n.paraui-form-item .para-form-edit > div {\n padding: 0;\n width: 100%;\n}\n.paraui-form-item .para-form-edit > div .paraui-helper-text {\n display: none;\n}\n.paraui-form-item .para-form-edit-snack > div .paraui-helper-text {\n display: block;\n}\n.paraui-form-item .para-form-edit .paraui-input-number .paraui-text-field {\n padding: 0px;\n}\n.paraui-form-item .para-form-edit .paraui-check-box-group > label,\n.paraui-form-item .para-form-edit .paraui-radio-group > label {\n display: none;\n}\n.paraui-form-item .para-form-edit .paraui-check-box-group > div,\n.paraui-form-item .para-form-edit .paraui-radio-group > div {\n margin-top: 4px;\n}\n.paraui-form-item .para-form-content-vertical {\n display: inline-block;\n width: 100%;\n}";
660
+ styleInject(css_248z);
661
+
662
+ /**
663
+ * form 表单单行组件
664
+ * @author zhanzl
665
+ * @description 用于根据配置自动生成表单
666
+ */
667
+
668
+ var FormItem = function FormItem(props) {
669
+ var _a, _b;
670
+
671
+ var _props$type = props.type,
672
+ type = _props$type === void 0 ? 'horizontal' : _props$type,
673
+ labelWidth = props.labelWidth,
674
+ tips = props.tips,
675
+ label = props.label,
676
+ InputType = props.InputType,
677
+ setValue = props.setValue,
678
+ errorMessage = props.errorMessage,
679
+ hideLabel = props.hideLabel,
680
+ _props$backData = props.backData,
681
+ backData = _props$backData === void 0 ? {} : _props$backData,
682
+ defaultValue = props.defaultValue,
683
+ name = props.name,
684
+ _props$hideError = props.hideError,
685
+ hideError = _props$hideError === void 0 ? false : _props$hideError,
686
+ _props$className = props.className,
687
+ className = _props$className === void 0 ? '' : _props$className,
688
+ labelProps = props.labelProps,
689
+ helperTextProps = props.helperTextProps,
690
+ requiredElement = props.requiredElement,
691
+ _props$disRequiredEle = props.disRequiredElement,
692
+ disRequiredElement = _props$disRequiredEle === void 0 ? false : _props$disRequiredEle;
693
+
694
+ if (backData[name] === undefined) {
695
+ backData[name] = defaultValue;
696
+ }
697
+ /**
698
+ * 接受设置报错信息方法
699
+ * @type {Function}
700
+ */
701
+
702
+
703
+ var setErrorTips = React__default.useRef();
704
+ /**
705
+ * 设置错误信息
706
+ */
707
+
708
+ var setError = function setError(error) {
709
+ setErrorTips.current && setErrorTips.current(error);
710
+ };
711
+ /**
712
+ * 用于判断是否是 vertical 模式如果是则添加相应的外层
713
+ */
714
+
715
+
716
+ var TypeLayout = function TypeLayout(props) {
717
+ return type === 'vertical' ? jsx("div", Object.assign({
718
+ className: "para-form-content-vertical para-form-content-vertical-".concat(name),
719
+ style: {
720
+ width: "calc(100% - ".concat(labelWidth, "px)")
721
+ }
722
+ }, {
723
+ children: props.children
724
+ })) : props.children;
725
+ };
726
+ /**
727
+ * 展示label
728
+ */
729
+
730
+
731
+ var showLabel = React__default.useCallback(function () {
732
+ if (!label) return '';
733
+ return typeof label === 'string' ? label : label(props);
734
+ }, [label]);
735
+ return jsxs("div", Object.assign({
736
+ className: "para-form-item paraui-form-item paraui-form-item-".concat(name, " ").concat(className)
737
+ }, {
738
+ children: [!hideLabel && jsx("div", Object.assign({
739
+ className: clsx("para-form-label para-form-label-".concat(name), type === 'vertical' && 'para-form-label-vertical'),
740
+ style: {
741
+ width: type === 'vertical' ? "".concat(labelWidth, "px") : ''
742
+ }
743
+ }, {
744
+ children: jsx(Label, Object.assign({
745
+ className: clsx('para-form-labe-text', tips && 'para-form-labe-text-hastips'),
746
+ label: showLabel(),
747
+ required: !!((_b = (_a = props === null || props === void 0 ? void 0 : props.rules) === null || _a === void 0 ? void 0 : _a.validate) === null || _b === void 0 ? void 0 : _b.required),
748
+ tooltip: tips,
749
+ tooltipIcon: disRequiredElement ? '' : requiredElement
750
+ }, labelProps))
751
+ })), jsxs(TypeLayout, {
752
+ children: [jsx("div", Object.assign({
753
+ className: "para-form-edit para-form-edit-".concat(name)
754
+ }, {
755
+ children: !props.children ? jsx(ItemType, Object.assign({
756
+ setError: setError,
757
+ error: !!errorMessage,
758
+ ItemType: InputType,
759
+ backData: backData
760
+ }, props, {
761
+ setValue: setValue
762
+ })) : props.children
763
+ })), !hideError && jsx("div", Object.assign({
764
+ className: "para-form-error para-form-error-".concat(name)
765
+ }, {
766
+ children: jsx(ErrorTips, {
767
+ getSetError: function getSetError(fuc) {
768
+ return setErrorTips.current = fuc;
769
+ },
770
+ helperTextProps: helperTextProps,
771
+ errorMessage: errorMessage
772
+ })
773
+ }))]
774
+ })]
775
+ }));
776
+ };
777
+
778
+ export { FormItem as F, validate as v };