@para-ui/core 2.2.5-beta → 2.2.7

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 +6 -12
  2. package/AutoBox/index.js +15 -203
  3. package/AutoTips/index.d.ts +6 -12
  4. package/AutoTips/index.js +15 -84
  5. package/Breadcrumbs/index.d.ts +7 -13
  6. package/Breadcrumbs/index.js +15 -227
  7. package/Button/SplitButton.d.ts +61 -0
  8. package/Button/index.d.ts +11 -92
  9. package/Button/index.js +14 -348
  10. package/Button/lang/en_US.d.ts +4 -0
  11. package/Button/lang/index.d.ts +9 -0
  12. package/Button/lang/zh_CN.d.ts +4 -0
  13. package/ButtonGroup/index.d.ts +9 -21
  14. package/ButtonGroup/index.js +14 -128
  15. package/Carousel/index.d.ts +11 -17
  16. package/Carousel/index.js +15 -74
  17. package/Cascader/index.d.ts +7 -12
  18. package/Cascader/index.js +15 -166
  19. package/Cascader/lang/en_US.d.ts +4 -0
  20. package/Cascader/lang/index.d.ts +9 -0
  21. package/Cascader/lang/zh_CN.d.ts +4 -0
  22. package/Checkbox/index.d.ts +7 -13
  23. package/Checkbox/index.js +14 -105
  24. package/CheckboxGroup/index.d.ts +9 -15
  25. package/CheckboxGroup/index.js +14 -138
  26. package/Collapse/collapsePanel.d.ts +30 -0
  27. package/Collapse/index.d.ts +14 -49
  28. package/Collapse/index.js +15 -171
  29. package/Collapse/motion.d.ts +5 -0
  30. package/Collapse/util.d.ts +11 -0
  31. package/CollapseBox/index.d.ts +5 -11
  32. package/CollapseBox/index.js +15 -164
  33. package/CollapseBox/util.d.ts +5 -0
  34. package/ColorPicker/index.d.ts +4 -4
  35. package/ColorPicker/index.js +1 -4
  36. package/ComboSelect/WithTabsCombo/index.d.ts +11 -0
  37. package/ComboSelect/WithTabsCombo/interface.d.ts +141 -0
  38. package/ComboSelect/index.d.ts +6 -306
  39. package/ComboSelect/index.js +14 -1803
  40. package/ComboSelect/interface.d.ts +143 -0
  41. package/ComboSelect/lang/en_US.d.ts +8 -0
  42. package/ComboSelect/lang/index.d.ts +17 -0
  43. package/ComboSelect/lang/zh_CN.d.ts +8 -0
  44. package/ComboSelect/utils.d.ts +12 -0
  45. package/Container/index.d.ts +8 -13
  46. package/Container/index.js +15 -239
  47. package/DatePicker/PickerButton.d.ts +3 -0
  48. package/DatePicker/PickerTag.d.ts +3 -0
  49. package/DatePicker/generatePicker/generateRangePicker.d.ts +4 -0
  50. package/DatePicker/generatePicker/generateSinglePicker.d.ts +11 -0
  51. package/DatePicker/generatePicker/index.d.ts +77 -0
  52. package/DatePicker/index.d.ts +17 -30
  53. package/DatePicker/index.js +14 -733
  54. package/DatePicker/lang/en_US.d.ts +3 -0
  55. package/DatePicker/lang/index.d.ts +7 -0
  56. package/DatePicker/lang/zh_CN.d.ts +3 -0
  57. package/DatePicker/util.d.ts +20 -0
  58. package/Desktop/index.d.ts +6 -14
  59. package/Desktop/index.js +14 -853
  60. package/Drawer/index.d.ts +6 -92
  61. package/Drawer/index.js +14 -186
  62. package/Drawer/interface.d.ts +83 -0
  63. package/Drawer/lang/en_US.d.ts +5 -0
  64. package/Drawer/lang/index.d.ts +11 -0
  65. package/Drawer/lang/zh_CN.d.ts +5 -0
  66. package/Empty/images/index.d.ts +2 -0
  67. package/Empty/index.d.ts +10 -16
  68. package/Empty/index.js +14 -644
  69. package/Empty/lang/en_US.d.ts +6 -0
  70. package/Empty/lang/index.d.ts +13 -0
  71. package/Empty/lang/zh_CN.d.ts +6 -0
  72. package/Form/index.d.ts +9 -11
  73. package/Form/index.js +14 -384
  74. package/FormItem/compoments/defaultCompoments/index.d.ts +19 -0
  75. package/FormItem/compoments/formCheckboxGroup/index.d.ts +8 -0
  76. package/FormItem/compoments/formFile/index.d.ts +38 -0
  77. package/FormItem/compoments/formRadioGroup/index.d.ts +8 -0
  78. package/FormItem/compoments/formSelect/index.d.ts +18 -0
  79. package/FormItem/errorTips.d.ts +12 -0
  80. package/FormItem/index.d.ts +152 -5
  81. package/FormItem/index.js +14 -81
  82. package/FormItem/itemType.d.ts +42 -0
  83. package/FormItem/validateFunction.d.ts +15 -0
  84. package/FunctionModal/dialog.d.ts +58 -0
  85. package/FunctionModal/index.d.ts +3 -14
  86. package/FunctionModal/index.js +14 -39
  87. package/FunctionModal/modalContext.d.ts +14 -0
  88. package/GlobalContext/componentsProps.d.ts +19 -0
  89. package/GlobalContext/confirmLocale.d.ts +7 -0
  90. package/GlobalContext/index.d.ts +8 -38
  91. package/GlobalContext/index.js +16 -41
  92. package/GlobalContext/intl.d.ts +34 -0
  93. package/GlobalContext/useFormatMessage.d.ts +3 -0
  94. package/Help/index.d.ts +10 -16
  95. package/Help/index.js +15 -39
  96. package/HelperText/index.d.ts +5 -11
  97. package/HelperText/index.js +15 -29
  98. package/Hooks/useGlobalProps.d.ts +1 -0
  99. package/InputLang/index.d.ts +7 -13
  100. package/InputLang/index.js +14 -270
  101. package/InputNumber/index.d.ts +10 -16
  102. package/InputNumber/index.js +14 -308
  103. package/Label/index.d.ts +6 -12
  104. package/Label/index.js +14 -81
  105. package/Loading/index.d.ts +6 -12
  106. package/Loading/index.js +15 -47
  107. package/Menu/footerExpansion.d.ts +9 -0
  108. package/Menu/index.d.ts +5 -123
  109. package/Menu/index.js +14 -1232
  110. package/Menu/interface.d.ts +139 -0
  111. package/Menu/logo.d.ts +9 -0
  112. package/Menu/verticalMenuList.d.ts +14 -0
  113. package/Message/index.d.ts +19 -11
  114. package/Message/index.js +15 -222
  115. package/Modal/Confirm/index.d.ts +66 -0
  116. package/Modal/index.d.ts +40 -142
  117. package/Modal/index.js +14 -443
  118. package/Modal/lang/en_US.d.ts +5 -0
  119. package/Modal/lang/index.d.ts +11 -0
  120. package/Modal/lang/zh_CN.d.ts +5 -0
  121. package/MultiBox/index.d.ts +7 -13
  122. package/MultiBox/index.js +14 -231
  123. package/Notification/index.d.ts +16 -22
  124. package/Notification/index.js +15 -266
  125. package/OperateBtn/index.d.ts +10 -16
  126. package/OperateBtn/index.js +14 -260
  127. package/OperateBtn/lang/en_US.d.ts +4 -0
  128. package/OperateBtn/lang/index.d.ts +9 -0
  129. package/OperateBtn/lang/zh_CN.d.ts +4 -0
  130. package/PageHeader/horizontalMeun.d.ts +9 -0
  131. package/PageHeader/horizontalMeunRight.d.ts +9 -0
  132. package/PageHeader/index.d.ts +5 -178
  133. package/PageHeader/index.js +14 -1171
  134. package/PageHeader/interface.d.ts +167 -0
  135. package/Pagination/index.d.ts +6 -12
  136. package/Pagination/index.js +14 -469
  137. package/Pagination/lang/en_US.d.ts +8 -0
  138. package/Pagination/lang/index.d.ts +17 -0
  139. package/Pagination/lang/zh_CN.d.ts +8 -0
  140. package/ParauiProvider/index.d.ts +8 -9
  141. package/ParauiProvider/index.js +15 -53
  142. package/PopConfirm/index.d.ts +10 -23
  143. package/PopConfirm/index.js +14 -189
  144. package/PopConfirm/lang/en_US.d.ts +5 -0
  145. package/PopConfirm/lang/index.d.ts +11 -0
  146. package/PopConfirm/lang/zh_CN.d.ts +5 -0
  147. package/Popover/index.d.ts +11 -18
  148. package/Popover/index.js +15 -66
  149. package/Popper/index.d.ts +13 -0
  150. package/Popper/index.js +16 -0
  151. package/Progress/Line.d.ts +47 -0
  152. package/Progress/Steps.d.ts +17 -0
  153. package/Progress/index.d.ts +12 -18
  154. package/Progress/index.js +20 -358
  155. package/Progress/utils.d.ts +6 -0
  156. package/Querying/images/index.d.ts +2 -0
  157. package/Querying/index.d.ts +9 -15
  158. package/Querying/index.js +14 -762
  159. package/Querying/lang/en_US.d.ts +4 -0
  160. package/Querying/lang/index.d.ts +9 -0
  161. package/Querying/lang/zh_CN.d.ts +4 -0
  162. package/README.md +506 -0
  163. package/Radio/index.d.ts +7 -13
  164. package/Radio/index.js +14 -94
  165. package/RadioGroup/index.d.ts +9 -15
  166. package/RadioGroup/index.js +14 -128
  167. package/Search/index.d.ts +12 -18
  168. package/Search/index.js +14 -220
  169. package/Select/index.d.ts +7 -13
  170. package/Select/index.js +14 -1288
  171. package/Select/lang/en_US.d.ts +5 -0
  172. package/Select/lang/index.d.ts +11 -0
  173. package/Select/lang/zh_CN.d.ts +5 -0
  174. package/SelectInput/index.d.ts +5 -11
  175. package/SelectInput/index.js +14 -51
  176. package/SingleBox/index.d.ts +7 -13
  177. package/SingleBox/index.js +14 -194
  178. package/Slider/index.d.ts +7 -104
  179. package/Slider/index.js +15 -125
  180. package/Slider/interface.d.ts +102 -0
  181. package/Split/index.d.ts +3 -8
  182. package/Split/index.js +15 -134
  183. package/Stepper/icons.d.ts +5 -0
  184. package/Stepper/index.d.ts +25 -41
  185. package/Stepper/index.js +15 -99
  186. package/Switch/index.d.ts +10 -16
  187. package/Switch/index.js +14 -73
  188. package/Table/index.d.ts +4 -12
  189. package/Table/index.js +14 -2725
  190. package/{_verture/interface-a9b7c716.js → Table/interface.d.ts} +28 -20
  191. package/Table/lang/en_US.d.ts +6 -0
  192. package/Table/lang/index.d.ts +13 -0
  193. package/Table/lang/zh_CN.d.ts +6 -0
  194. package/Table/tableBody.d.ts +9 -0
  195. package/Table/tableBodyElement/index.d.ts +15 -0
  196. package/Table/tableBodyInterface.d.ts +67 -0
  197. package/Table/tableContainer/index.d.ts +16 -0
  198. package/Table/tableElement/index.d.ts +17 -0
  199. package/Table/tableHead.d.ts +9 -0
  200. package/Table/tableHeadElement/index.d.ts +15 -0
  201. package/Table/tableHeadInterface.d.ts +30 -0
  202. package/Table/tablePagination.d.ts +9 -0
  203. package/Table/tablePaginationInterFace.d.ts +24 -0
  204. package/Table/tdElement/index.d.ts +15 -0
  205. package/Table/thElement/index.d.ts +15 -0
  206. package/Table/trElement/index.d.ts +15 -0
  207. package/Table/util.d.ts +16 -0
  208. package/Tabs/index.d.ts +29 -64
  209. package/Tabs/index.js +14 -218
  210. package/Tag/TagGroup.d.ts +66 -0
  211. package/Tag/index.d.ts +12 -78
  212. package/Tag/index.js +14 -286
  213. package/Test/index.d.ts +2 -3
  214. package/Test/index.js +16 -9
  215. package/TextField/index.d.ts +16 -22
  216. package/TextField/index.js +14 -686
  217. package/TimePicker/index.d.ts +10 -20
  218. package/TimePicker/index.js +14 -77
  219. package/TimePicker/locale/en_US.d.ts +3 -0
  220. package/TimePicker/locale/zh_CN.d.ts +3 -0
  221. package/TimePicker/style/index.d.ts +1 -0
  222. package/Timeline/index.d.ts +13 -49
  223. package/Timeline/index.js +15 -150
  224. package/ToggleButton/ToggleButtonGroup.d.ts +49 -0
  225. package/ToggleButton/index.d.ts +10 -61
  226. package/ToggleButton/index.js +14 -200
  227. package/Tooltip/index.d.ts +10 -12
  228. package/Tooltip/index.js +15 -335
  229. package/Transfer/index.d.ts +3 -8
  230. package/Transfer/index.js +14 -343
  231. package/Transfer/lang/en_US.d.ts +6 -0
  232. package/Transfer/lang/index.d.ts +13 -0
  233. package/Transfer/lang/zh_CN.d.ts +6 -0
  234. package/Tree/OperateBar/index.d.ts +13 -0
  235. package/Tree/Tree.d.ts +4 -0
  236. package/Tree/index.d.ts +5 -8
  237. package/Tree/index.js +14 -35
  238. package/{_verture/interface-128abdd3.js → Tree/interface.d.ts} +25 -15
  239. package/Tree/lang/en_US.d.ts +8 -0
  240. package/Tree/lang/index.d.ts +17 -0
  241. package/Tree/lang/zh_CN.d.ts +8 -0
  242. package/Tree/utils/closestPolyfill.d.ts +0 -0
  243. package/Tree/utils/tools.d.ts +26 -0
  244. package/Tree/utils/treeUtil.d.ts +15 -0
  245. package/Upload/Dragger/index.d.ts +10 -0
  246. package/Upload/ErroTip/index.d.ts +13 -0
  247. package/Upload/ImageUpload/index.d.ts +14 -0
  248. package/Upload/ImgCrop/EasyCrop.d.ts +17 -0
  249. package/Upload/ImgCrop/constants.d.ts +7 -0
  250. package/Upload/ImgCrop/index.d.ts +6 -0
  251. package/Upload/ImgCrop/interface.d.ts +24 -0
  252. package/Upload/UploadList/index.d.ts +5 -0
  253. package/Upload/index.d.ts +8 -179
  254. package/Upload/index.js +14 -1542
  255. package/Upload/interface.d.ts +134 -0
  256. package/Upload/lang/en_US.d.ts +12 -0
  257. package/Upload/lang/index.d.ts +25 -0
  258. package/Upload/lang/zh_CN.d.ts +12 -0
  259. package/cdn/AutoBox/index.js +29 -0
  260. package/cdn/AutoTips/index.js +40 -0
  261. package/cdn/Breadcrumbs/index.js +53 -0
  262. package/cdn/Button/index.js +79 -0
  263. package/cdn/ButtonGroup/index.js +79 -0
  264. package/cdn/Carousel/index.js +6 -0
  265. package/cdn/Cascader/index.js +42 -0
  266. package/cdn/Checkbox/index.js +53 -0
  267. package/cdn/CheckboxGroup/index.js +53 -0
  268. package/cdn/Collapse/index.js +27 -0
  269. package/cdn/CollapseBox/index.js +1 -0
  270. package/cdn/ColorPicker/index.js +1 -0
  271. package/cdn/ComboSelect/index.js +438 -0
  272. package/cdn/Container/index.js +1 -0
  273. package/cdn/DatePicker/index.js +185 -0
  274. package/cdn/Desktop/index.js +24 -0
  275. package/cdn/Drawer/index.js +84 -0
  276. package/cdn/Empty/index.js +1 -0
  277. package/cdn/Form/index.js +477 -0
  278. package/cdn/FormItem/index.js +477 -0
  279. package/cdn/FunctionModal/index.js +144 -0
  280. package/cdn/GlobalContext/index.js +1 -0
  281. package/cdn/Help/index.js +53 -0
  282. package/cdn/HelperText/index.js +1 -0
  283. package/cdn/InputLang/index.js +144 -0
  284. package/cdn/InputNumber/index.js +118 -0
  285. package/cdn/Label/index.js +53 -0
  286. package/cdn/Loading/index.js +14 -0
  287. package/cdn/Menu/index.js +40 -0
  288. package/cdn/Message/index.js +53 -0
  289. package/cdn/Modal/index.js +144 -0
  290. package/cdn/MultiBox/index.js +131 -0
  291. package/cdn/Notification/index.js +66 -0
  292. package/cdn/OperateBtn/index.js +92 -0
  293. package/cdn/PageHeader/index.js +92 -0
  294. package/cdn/Pagination/index.js +214 -0
  295. package/cdn/ParauiProvider/index.js +9 -0
  296. package/cdn/PopConfirm/index.js +131 -0
  297. package/cdn/Popover/index.js +16 -0
  298. package/cdn/Popper/index.js +26 -0
  299. package/cdn/Progress/index.js +58 -0
  300. package/cdn/Querying/index.js +1 -0
  301. package/cdn/Radio/index.js +53 -0
  302. package/cdn/RadioGroup/index.js +53 -0
  303. package/cdn/Search/index.js +144 -0
  304. package/cdn/Select/index.js +131 -0
  305. package/cdn/SelectInput/index.js +131 -0
  306. package/cdn/SingleBox/index.js +131 -0
  307. package/cdn/Slider/index.js +16 -0
  308. package/cdn/Split/index.js +1 -0
  309. package/cdn/Stepper/index.js +154 -0
  310. package/cdn/Switch/index.js +71 -0
  311. package/cdn/Table/index.js +292 -0
  312. package/cdn/Tabs/index.js +165 -0
  313. package/cdn/Tag/index.js +27 -0
  314. package/cdn/Test/index.js +1 -0
  315. package/cdn/TextField/index.js +105 -0
  316. package/cdn/TimePicker/index.js +185 -0
  317. package/cdn/Timeline/index.js +16 -0
  318. package/cdn/ToggleButton/index.js +79 -0
  319. package/cdn/Tooltip/index.js +40 -0
  320. package/cdn/Transfer/index.js +170 -0
  321. package/cdn/Tree/index.js +170 -0
  322. package/cdn/Upload/index.js +252 -0
  323. package/index.d.ts +128 -88
  324. package/index.js +19 -160
  325. package/package.json +22 -59
  326. package/style.css +72 -0
  327. package/Dropdown/index.d.ts +0 -29
  328. package/Dropdown/index.js +0 -67
  329. package/_verture/defineProperty-0590dc61.js +0 -16
  330. package/_verture/index-0d8e1d07.js +0 -4
  331. package/_verture/index-14a47097.js +0 -4
  332. package/_verture/index-342379c6.js +0 -391
  333. package/_verture/index-458032d7.js +0 -10
  334. package/_verture/index-46bfb2f0.js +0 -778
  335. package/_verture/index-50401de7.js +0 -4
  336. package/_verture/index-5b08df83.js +0 -4
  337. package/_verture/index-6190b129.js +0 -4
  338. package/_verture/index-7ef1e3b6.js +0 -1553
  339. package/_verture/index-a369ca3f.js +0 -4
  340. package/_verture/index-c60911dc.js +0 -39
  341. package/_verture/index-e2881a53.js +0 -16
  342. package/_verture/index-ff4c2a27.js +0 -200
  343. package/_verture/interface-a77a851e.js +0 -25
  344. package/_verture/intl-336570e4.js +0 -65
  345. package/_verture/modalContext-25890584.js +0 -228
  346. package/_verture/modalContext-639f2787.js +0 -58
  347. package/_verture/slicedToArray-d7722f4b.js +0 -62
  348. package/_verture/style-inject.es-300983ab.js +0 -28
  349. package/_verture/toConsumableArray-f8047a75.js +0 -19
  350. package/_verture/tslib.es6-55ed4bd2.js +0 -38
  351. package/_verture/typeof-498dd2b1.js +0 -11
  352. package/_verture/useFormatMessage-ac9d6acf.js +0 -20
  353. package/_verture/useGlobalProps-af9a2af6.js +0 -12
@@ -1,778 +0,0 @@
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 };