@zat-design/sisyphus-react 4.5.9 → 4.5.10-beta.2

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 (280) hide show
  1. package/dist/index.esm.css +1 -1
  2. package/dist/less.esm.css +1 -1
  3. package/es/FormsProvider/index.js +14 -21
  4. package/es/ProAction/components/CheckModalContent/index.js +12 -26
  5. package/es/ProAction/index.js +79 -83
  6. package/es/ProAction/propsType.js +0 -1
  7. package/es/ProConfigProvider/index.js +63 -110
  8. package/es/ProConfigProvider/propsType.js +0 -1
  9. package/es/ProDownload/index.d.ts +2 -1
  10. package/es/ProDownload/index.js +74 -69
  11. package/es/ProDownload/propsType.js +0 -1
  12. package/es/ProDownload/utils.d.ts +10 -5
  13. package/es/ProDownload/utils.js +63 -95
  14. package/es/ProDrawerForm/components/ProDrawer/index.js +83 -113
  15. package/es/ProDrawerForm/components/ProModal/index.js +77 -108
  16. package/es/ProDrawerForm/components/index.js +6 -2
  17. package/es/ProDrawerForm/hooks/useConfirmClose.js +20 -39
  18. package/es/ProDrawerForm/index.js +29 -38
  19. package/es/ProDrawerForm/propsType.js +0 -1
  20. package/es/ProDrawerForm/utils/index.js +18 -36
  21. package/es/ProEditLabel/components/RenderProForm.js +45 -49
  22. package/es/ProEditLabel/index.js +126 -163
  23. package/es/ProEditLabel/propsType.js +0 -1
  24. package/es/ProEditLabel/utils/index.js +5 -8
  25. package/es/ProEditTable/components/ActionButton/index.js +111 -119
  26. package/es/ProEditTable/components/RcTable/BaseTable.js +38 -51
  27. package/es/ProEditTable/components/RcTable/DraggableTable.js +97 -129
  28. package/es/ProEditTable/components/RcTable/index.js +6 -4
  29. package/es/ProEditTable/components/RenderField/ListChangedWrapper.js +77 -95
  30. package/es/ProEditTable/components/RenderField/index.js +490 -587
  31. package/es/ProEditTable/components/RenderField/propsType.js +0 -1
  32. package/es/ProEditTable/components/RenderField/tools.js +115 -112
  33. package/es/ProEditTable/components/RenderToolbar/index.js +47 -73
  34. package/es/ProEditTable/components/Summary/index.js +38 -64
  35. package/es/ProEditTable/components/Validator/index.js +46 -46
  36. package/es/ProEditTable/components/index.js +12 -5
  37. package/es/ProEditTable/index.js +456 -378
  38. package/es/ProEditTable/propsType.js +0 -1
  39. package/es/ProEditTable/utils/config.js +60 -122
  40. package/es/ProEditTable/utils/diffOriginal.js +45 -82
  41. package/es/ProEditTable/utils/getDefaultProps.js +19 -24
  42. package/es/ProEditTable/utils/index.js +154 -235
  43. package/es/ProEditTable/utils/tools.js +149 -286
  44. package/es/ProEditTable/utils/transform.js +25 -30
  45. package/es/ProEditTable/utils/useEditTableError.js +30 -43
  46. package/es/ProEditTable/utils/useShouldUpdateForTable.js +42 -72
  47. package/es/ProEditTable/utils/validateAll.js +87 -154
  48. package/es/ProEnum/components/Group.js +38 -30
  49. package/es/ProEnum/components/Tag.js +22 -26
  50. package/es/ProEnum/hooks/useEnum.js +48 -116
  51. package/es/ProEnum/hooks/useEnumRequest.js +182 -212
  52. package/es/ProEnum/hooks/useFrequentEnumRequest.js +40 -48
  53. package/es/ProEnum/index.js +162 -172
  54. package/es/ProEnum/propsType.js +0 -1
  55. package/es/ProEnum/utils/eventCenter.js +10 -12
  56. package/es/ProEnum/utils/frequentEnum.js +35 -92
  57. package/es/ProEnum/utils/getEnum.js +32 -90
  58. package/es/ProEnum/utils/getEnumLabel.js +44 -49
  59. package/es/ProEnum/utils/index.js +93 -207
  60. package/es/ProForm/components/Container.js +13 -28
  61. package/es/ProForm/components/FormFooter/index.js +36 -44
  62. package/es/ProForm/components/FormFooter/propsType.js +0 -1
  63. package/es/ProForm/components/base/Checkbox/index.js +32 -59
  64. package/es/ProForm/components/base/DatePicker/index.js +49 -71
  65. package/es/ProForm/components/base/Input/index.js +63 -97
  66. package/es/ProForm/components/base/Input/propsType.js +0 -1
  67. package/es/ProForm/components/base/InputNumber/index.js +118 -172
  68. package/es/ProForm/components/base/Radio/index.js +39 -52
  69. package/es/ProForm/components/base/RangePicker/index.js +109 -127
  70. package/es/ProForm/components/base/RangePicker/useDateRange.js +20 -17
  71. package/es/ProForm/components/base/Select/index.js +63 -89
  72. package/es/ProForm/components/base/Switch/index.js +27 -35
  73. package/es/ProForm/components/base/SwitchCheckbox/index.js +36 -54
  74. package/es/ProForm/components/base/TextArea/index.js +30 -41
  75. package/es/ProForm/components/base/TimePicker/index.js +27 -37
  76. package/es/ProForm/components/combination/Container/index.js +37 -47
  77. package/es/ProForm/components/combination/Container/propsType.js +0 -1
  78. package/es/ProForm/components/combination/FormList/components/ActionButton.js +165 -237
  79. package/es/ProForm/components/combination/FormList/components/BlockFields.js +98 -102
  80. package/es/ProForm/components/combination/FormList/components/Empty.js +28 -55
  81. package/es/ProForm/components/combination/FormList/components/LineFields.js +57 -54
  82. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +61 -109
  83. package/es/ProForm/components/combination/FormList/index.js +151 -161
  84. package/es/ProForm/components/combination/FormList/propsType.js +0 -1
  85. package/es/ProForm/components/combination/FormList/style/index.less +6 -0
  86. package/es/ProForm/components/combination/FormList/utils.js +22 -38
  87. package/es/ProForm/components/combination/Group/component/AddonWrapper/index.js +12 -28
  88. package/es/ProForm/components/combination/Group/component/ComRender.js +50 -111
  89. package/es/ProForm/components/combination/Group/component/FlexibleGroup.js +106 -213
  90. package/es/ProForm/components/combination/Group/hooks/index.js +69 -129
  91. package/es/ProForm/components/combination/Group/index.js +87 -126
  92. package/es/ProForm/components/combination/Group/propsType.js +0 -1
  93. package/es/ProForm/components/combination/Group/utils/index.js +124 -239
  94. package/es/ProForm/components/combination/ProCascader/index.js +156 -199
  95. package/es/ProForm/components/combination/ProCascader/propsType.js +0 -1
  96. package/es/ProForm/components/combination/ProCascader/utils/index.js +12 -21
  97. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +72 -70
  98. package/es/ProForm/components/combination/ProModalSelect/index.js +309 -347
  99. package/es/ProForm/components/combination/ProModalSelect/propsType.js +0 -1
  100. package/es/ProForm/components/combination/ProModalSelect/utils/index.js +32 -39
  101. package/es/ProForm/components/combination/ProNumberRange/index.js +100 -156
  102. package/es/ProForm/components/combination/ProNumberRange/propsType.js +0 -1
  103. package/es/ProForm/components/combination/ProRangeLimit/index.js +104 -115
  104. package/es/ProForm/components/combination/ProRangeLimit/propsType.js +0 -1
  105. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +16 -16
  106. package/es/ProForm/components/combination/ProTimeLimit/index.js +75 -109
  107. package/es/ProForm/components/index.js +56 -34
  108. package/es/ProForm/components/render/ChangedWrapper.js +85 -94
  109. package/es/ProForm/components/render/ConfirmWrapper.js +27 -39
  110. package/es/ProForm/components/render/CustomComponentViewWrapper.js +65 -82
  111. package/es/ProForm/components/render/Render.js +223 -329
  112. package/es/ProForm/components/render/RenderFields.js +76 -113
  113. package/es/ProForm/components/render/propsType.js +0 -1
  114. package/es/ProForm/hooks/useControlled.js +8 -10
  115. package/es/ProForm/hooks/useDeepCompareMemo.js +11 -11
  116. package/es/ProForm/hooks/useFieldProps.js +8 -4
  117. package/es/ProForm/hooks/useForm.js +50 -110
  118. package/es/ProForm/hooks/useRules.js +17 -33
  119. package/es/ProForm/hooks/useShouldUpdate.js +77 -152
  120. package/es/ProForm/hooks/useWatch.js +62 -134
  121. package/es/ProForm/index.js +157 -194
  122. package/es/ProForm/propsType.js +15 -7
  123. package/es/ProForm/utils/buildFormItemProps.js +51 -58
  124. package/es/ProForm/utils/diffOriginal.js +43 -73
  125. package/es/ProForm/utils/getDefaultProps.js +18 -24
  126. package/es/ProForm/utils/index.js +160 -235
  127. package/es/ProForm/utils/processDependencies.js +21 -60
  128. package/es/ProForm/utils/reactiveValues.js +20 -34
  129. package/es/ProForm/utils/rulesCreator.js +42 -40
  130. package/es/ProForm/utils/transformNames.js +10 -13
  131. package/es/ProForm/utils/transformValue.js +16 -29
  132. package/es/ProForm/utils/valueType.js +96 -178
  133. package/es/ProIcon/config/index.js +340 -274
  134. package/es/ProIcon/index.js +135 -209
  135. package/es/ProIcon/propsTypes.js +0 -1
  136. package/es/ProIcon/utils/index.js +24 -39
  137. package/es/ProLayout/components/Layout/Header/index.js +108 -141
  138. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.js +134 -190
  139. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +113 -139
  140. package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.js +0 -1
  141. package/es/ProLayout/components/Layout/Menu/SideMenu/index.js +23 -31
  142. package/es/ProLayout/components/Layout/Menu/index.js +92 -89
  143. package/es/ProLayout/components/Layout/Notice/index.js +13 -27
  144. package/es/ProLayout/components/Layout/index.js +8 -3
  145. package/es/ProLayout/components/ProCollapse/PropTypes.js +0 -1
  146. package/es/ProLayout/components/ProCollapse/index.js +89 -111
  147. package/es/ProLayout/components/ProFooter/PropTypes.js +0 -1
  148. package/es/ProLayout/components/ProFooter/index.js +27 -24
  149. package/es/ProLayout/components/ProHeader/PropTypes.js +0 -1
  150. package/es/ProLayout/components/ProHeader/components/Copy/index.js +23 -21
  151. package/es/ProLayout/components/ProHeader/components/Describe/index.js +67 -84
  152. package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +18 -21
  153. package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.js +0 -1
  154. package/es/ProLayout/components/ProHeader/components/index.js +6 -2
  155. package/es/ProLayout/components/ProHeader/index.js +216 -356
  156. package/es/ProLayout/components/ProHeader/utils/index.js +19 -26
  157. package/es/ProLayout/components/TabsManager/components/TabContextMenu.js +92 -85
  158. package/es/ProLayout/components/TabsManager/components/TabItem.js +53 -63
  159. package/es/ProLayout/components/TabsManager/components/TabsContext.js +5 -5
  160. package/es/ProLayout/components/TabsManager/components/TabsHeader.js +42 -52
  161. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.js +8 -9
  162. package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.js +19 -32
  163. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.js +6 -20
  164. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.js +25 -42
  165. package/es/ProLayout/components/TabsManager/hooks/useTabsState.js +320 -350
  166. package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.d.ts +19 -0
  167. package/es/ProLayout/components/TabsManager/hooks/useTabsUrlSync.js +332 -0
  168. package/es/ProLayout/components/TabsManager/index.js +407 -351
  169. package/es/ProLayout/components/TabsManager/propTypes.d.ts +4 -0
  170. package/es/ProLayout/components/TabsManager/propTypes.js +7 -15
  171. package/es/ProLayout/components/TabsManager/style/index.less +1 -1
  172. package/es/ProLayout/components/TabsManager/utils/historyObserver.d.ts +7 -0
  173. package/es/ProLayout/components/TabsManager/utils/historyObserver.js +65 -0
  174. package/es/ProLayout/components/TabsManager/utils/index.d.ts +15 -2
  175. package/es/ProLayout/components/TabsManager/utils/index.js +156 -159
  176. package/es/ProLayout/components/index.js +8 -3
  177. package/es/ProLayout/index.js +173 -228
  178. package/es/ProLayout/propTypes.d.ts +28 -1
  179. package/es/ProLayout/propTypes.js +12 -52
  180. package/es/ProLayout/utils/index.js +48 -128
  181. package/es/ProSelect/components/AdaptiveTooltip.js +26 -25
  182. package/es/ProSelect/index.js +187 -223
  183. package/es/ProSelect/propsType.js +0 -1
  184. package/es/ProSelect/style/index.less +13 -0
  185. package/es/ProSelect/utils/index.js +100 -146
  186. package/es/ProStep/components/Anchor/index.js +71 -82
  187. package/es/ProStep/components/Item/index.js +49 -56
  188. package/es/ProStep/components/LazyLoad/index.js +23 -29
  189. package/es/ProStep/components/Listener/index.js +20 -33
  190. package/es/ProStep/components/Step/index.js +31 -38
  191. package/es/ProStep/constants.js +4 -1
  192. package/es/ProStep/index.js +166 -153
  193. package/es/ProStep/propsType.js +0 -1
  194. package/es/ProStep/style/index.less +1 -1
  195. package/es/ProStep/utils/index.js +29 -55
  196. package/es/ProStepTab/index.js +83 -138
  197. package/es/ProStepTab/propsType.js +0 -1
  198. package/es/ProTable/components/EditableCell/EditIcon.js +10 -14
  199. package/es/ProTable/components/EditableCell/index.js +37 -71
  200. package/es/ProTable/components/EditableCell/propsType.js +0 -1
  201. package/es/ProTable/components/FormatColumn/index.js +209 -340
  202. package/es/ProTable/components/FormatColumn/propsType.js +0 -1
  203. package/es/ProTable/components/RcTable/components/BaseTable/index.js +35 -39
  204. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.js +80 -107
  205. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.js +54 -48
  206. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.js +0 -1
  207. package/es/ProTable/components/RcTable/components/DraggableTable/index.js +47 -54
  208. package/es/ProTable/components/RcTable/index.js +6 -4
  209. package/es/ProTable/components/RenderColumn/index.js +158 -186
  210. package/es/ProTable/components/RenderEmptyText/index.js +12 -21
  211. package/es/ProTable/components/RenderFooter/index.js +15 -15
  212. package/es/ProTable/components/RenderSummary/index.js +33 -50
  213. package/es/ProTable/components/RenderTableHeader/index.js +44 -46
  214. package/es/ProTable/components/RenderTabs/index.js +47 -51
  215. package/es/ProTable/components/TableResizable/index.js +56 -72
  216. package/es/ProTable/components/TooltipTitle/index.js +13 -21
  217. package/es/ProTable/components/index.js +16 -36
  218. package/es/ProTable/hooks/useAntdTable.js +191 -224
  219. package/es/ProTable/index.js +232 -249
  220. package/es/ProTable/propsType.js +0 -1
  221. package/es/ProTable/utils/columnStorage.js +63 -88
  222. package/es/ProTable/utils/index.js +57 -90
  223. package/es/ProTabs/components/Card/index.js +20 -48
  224. package/es/ProTabs/components/index.js +4 -1
  225. package/es/ProTabs/index.js +41 -58
  226. package/es/ProTabs/propType.js +0 -1
  227. package/es/ProThemeTools/component/ProTools/index.js +106 -158
  228. package/es/ProThemeTools/component/index.js +4 -1
  229. package/es/ProThemeTools/context/ThemeContext.js +67 -146
  230. package/es/ProThemeTools/index.js +103 -156
  231. package/es/ProThemeTools/propsType.js +0 -1
  232. package/es/ProThemeTools/utils/index.js +60 -109
  233. package/es/ProTooltip/index.js +132 -168
  234. package/es/ProTooltip/propsType.js +0 -1
  235. package/es/ProTree/components/AdaptiveTooltip.js +15 -17
  236. package/es/ProTree/components/CloseIcon.js +18 -26
  237. package/es/ProTree/components/List.js +28 -47
  238. package/es/ProTree/components/ProTree.js +152 -211
  239. package/es/ProTree/components/ProTreeSelect/index.js +255 -459
  240. package/es/ProTree/components/ProTreeSelect/propsType.js +0 -1
  241. package/es/ProTree/components/SearchTitle.js +23 -42
  242. package/es/ProTree/components/Tree.js +147 -195
  243. package/es/ProTree/components/index.js +10 -5
  244. package/es/ProTree/index.js +12 -16
  245. package/es/ProTree/propsType.js +0 -1
  246. package/es/ProTree/utils.js +46 -118
  247. package/es/ProTreeModal/components/Cascader.js +56 -64
  248. package/es/ProTreeModal/components/CloseIcon.js +18 -26
  249. package/es/ProTreeModal/components/List.js +114 -180
  250. package/es/ProTreeModal/components/SearchTitle.js +15 -18
  251. package/es/ProTreeModal/components/SortableItem.js +29 -58
  252. package/es/ProTreeModal/components/Tree.js +99 -113
  253. package/es/ProTreeModal/components/Trigger.js +87 -121
  254. package/es/ProTreeModal/components/index.js +14 -6
  255. package/es/ProTreeModal/index.js +397 -438
  256. package/es/ProTreeModal/propsType.js +0 -1
  257. package/es/ProTreeModal/utils.js +52 -95
  258. package/es/ProUpload/components/ButtonRender.js +44 -54
  259. package/es/ProUpload/components/DragRender.js +94 -148
  260. package/es/ProUpload/components/DraggableUploadListItem.js +12 -25
  261. package/es/ProUpload/components/Example.js +27 -31
  262. package/es/ProUpload/components/FileItem.js +69 -163
  263. package/es/ProUpload/components/ImageRender.js +134 -170
  264. package/es/ProUpload/index.js +68 -100
  265. package/es/ProUpload/propsType.js +0 -1
  266. package/es/ProUpload/uitls.js +8 -4
  267. package/es/ProUtils/utils/index.js +17 -13
  268. package/es/ProViewer/index.js +154 -175
  269. package/es/ProViewer/propsType.js +0 -5
  270. package/es/ProWaterMark/index.js +9 -16
  271. package/es/ProWaterMark/propsType.js +0 -1
  272. package/es/hooks/useDraggableRow.js +25 -53
  273. package/es/index.js +57 -77
  274. package/es/locale/en_US.js +153 -142
  275. package/es/locale/index.js +23 -36
  276. package/es/locale/zh_CN.js +145 -142
  277. package/es/tokens.js +84 -83
  278. package/es/utils/index.js +24 -51
  279. package/package.json +4 -2
  280. package/es/ProConfigProvider/demo/locale.js +0 -58
@@ -1,24 +1,18 @@
1
- import _isNaN from "lodash/isNaN";
2
- import _omit from "lodash/omit";
3
- import _set from "lodash/set";
4
- import _get from "lodash/get";
5
- import _isObject from "lodash/isObject";
6
- /* eslint-disable no-restricted-syntax */
7
- import dayjs from 'dayjs';
8
- export const getLayout = params => {
9
- const {
10
- span = 8,
11
- form
12
- } = params;
1
+ import dayjs from "dayjs";
2
+ import isObject from "lodash/isObject";
3
+ import get from "lodash/get";
4
+ import set from "lodash/set";
5
+ import omit from "lodash/omit";
6
+ import isNaN from "lodash/isNaN";
7
+ const getLayout = (params) => {
8
+ const { span = 8, form } = params;
13
9
  return {
14
10
  formProps: {
15
11
  colon: false,
16
- labelAlign: 'left',
12
+ labelAlign: "left",
17
13
  labelWrap: true
18
14
  },
19
- colProps: {
20
- span: span || 8
21
- },
15
+ colProps: { span: span || 8 },
22
16
  onCancel: () => {
23
17
  form.resetFields();
24
18
  },
@@ -27,144 +21,123 @@ export const getLayout = params => {
27
21
  }
28
22
  };
29
23
  };
30
- export const isSelect = props => {
31
- const {
32
- dataSource,
33
- type
34
- } = props;
35
- return dataSource?.length || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProCascader', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
24
+ const isSelect = (props) => {
25
+ const { dataSource, type } = props;
26
+ return (dataSource == null ? void 0 : dataSource.length) || [
27
+ "Select",
28
+ "ProSelect",
29
+ "ProEnum",
30
+ "DatePicker",
31
+ "RangePicker",
32
+ "ProCascader",
33
+ "ProTimeLimit",
34
+ "ProModalSelect",
35
+ "ProTreeModal",
36
+ "ProUpload",
37
+ "TimePicker"
38
+ ].includes(type);
36
39
  };
37
-
38
- /**
39
- * Input TextArea 移除前后空格
40
- * @param type 组件类型
41
- * @param trim 是否移除前后空格
42
- * @returns {}
43
- */
44
- export const isTrim = (type, trim, configData) => {
40
+ const isTrim = (type, trim, configData) => {
41
+ var _a;
45
42
  const result = {};
46
- const {
47
- state = {}
48
- } = configData || {};
49
- const _trim = trim || state?.[type]?.trim;
50
- if (['Input'].includes(type) && _trim) {
51
- result.getValueFromEvent = event => {
43
+ const { state = {} } = configData || {};
44
+ const _trim = trim || ((_a = state == null ? void 0 : state[type]) == null ? void 0 : _a.trim);
45
+ if (["Input"].includes(type) && _trim) {
46
+ result.getValueFromEvent = (event) => {
47
+ var _a2;
52
48
  if (Array.isArray(event)) {
53
- return event.map(value => value?.trim() || '');
49
+ return event.map((value) => (value == null ? void 0 : value.trim()) || "");
54
50
  }
55
- return event.target.value?.trim() || '';
51
+ return ((_a2 = event.target.value) == null ? void 0 : _a2.trim()) || "";
56
52
  };
57
53
  }
58
54
  return result;
59
55
  };
60
-
61
- /**
62
- * Input TextArea 小写自动转大写
63
- * @param type 组件类型
64
- * @param upperCase 是否小写转大写
65
- * @returns {}
66
- */
67
- export const isUpperCase = (type, upperCase) => {
56
+ const isUpperCase = (type, upperCase) => {
68
57
  const result = {};
69
- if (['Input'].includes(type) && upperCase) {
70
- result.getValueFromEvent = event => {
58
+ if (["Input"].includes(type) && upperCase) {
59
+ result.getValueFromEvent = (event) => {
60
+ var _a, _b;
71
61
  if (Array.isArray(event)) {
72
- return event.map(value => {
73
- const newValue = value?.replace(/[^a-zA-Z]/g, '');
74
- return newValue?.toUpperCase() || '';
62
+ return event.map((value) => {
63
+ const newValue2 = value == null ? void 0 : value.replace(/[^a-zA-Z]/g, "");
64
+ return (newValue2 == null ? void 0 : newValue2.toUpperCase()) || "";
75
65
  });
76
66
  }
77
- const newValue = event.target?.value?.replace(/[^a-zA-Z]/g, '');
78
- return newValue.toUpperCase() || '';
67
+ const newValue = (_b = (_a = event.target) == null ? void 0 : _a.value) == null ? void 0 : _b.replace(/[^a-zA-Z]/g, "");
68
+ return newValue.toUpperCase() || "";
79
69
  };
80
70
  }
81
71
  return result;
82
72
  };
83
-
84
- // 对比字段变化
85
- export const diffField = (prevValues, curValues, names) => {
86
- return names.some(name => {
87
- return _get(prevValues, name) !== _get(curValues, name);
73
+ const diffField = (prevValues, curValues, names) => {
74
+ return names.some((name) => {
75
+ return get(prevValues, name) !== get(curValues, name);
88
76
  });
89
77
  };
90
-
91
- // 表单name展开
92
- export const splitNameStr = name => {
93
- return name.split('-').map(keyStr => keyStr.split('_'));
78
+ const splitNameStr = (name) => {
79
+ return name.split("-").map((keyStr) => keyStr.split("_"));
94
80
  };
95
-
96
- // 过滤掉字段名中包含 '-' 的字段
97
- export const filterInternalFields = (values, optimize) => {
81
+ const filterInternalFields = (values, optimize) => {
98
82
  if (optimize) {
99
83
  return values;
100
84
  }
101
85
  const nextValues = values;
102
- // fix: braft-editor对象不可遍历 Dayjs不过滤
103
- if (values?._immutable || dayjs.isDayjs(values)) {
86
+ if ((values == null ? void 0 : values._immutable) || dayjs.isDayjs(values)) {
104
87
  return nextValues;
105
88
  }
106
89
  if (values instanceof File) {
107
90
  return nextValues;
108
91
  }
109
92
  if (Array.isArray(nextValues)) {
110
- return nextValues.map(item => {
93
+ return nextValues.map((item) => {
111
94
  return filterInternalFields(item);
112
95
  });
113
96
  }
114
- if (_isObject(nextValues)) {
97
+ if (isObject(nextValues)) {
115
98
  const result = {};
116
- Object.keys(nextValues).forEach(key => {
117
- if (key.includes('-') || key.startsWith('__')) return;
99
+ Object.keys(nextValues).forEach((key) => {
100
+ if (key.includes("-") || key.startsWith("__"))
101
+ return;
118
102
  result[key] = filterInternalFields(nextValues[key]);
119
103
  });
120
104
  return result;
121
105
  }
122
106
  return nextValues;
123
107
  };
124
- export const getAllNamePath = (object, currentPath = []) => {
108
+ const getAllNamePath = (object, currentPath = []) => {
125
109
  const keys = Object.keys(object);
126
110
  const resultKeys = [];
127
- keys.forEach(key => {
111
+ keys.forEach((key) => {
128
112
  const value = object[key];
129
-
130
- // 拆开组合key (组合key只可能存在于最外层)
131
- if (key.includes('-')) {
132
- resultKeys.concat(key.split('-').map(keyStr => keyStr.split('_')));
113
+ if (key.includes("-")) {
114
+ resultKeys.push(...key.split("-").map((keyStr) => keyStr.split("_")));
133
115
  }
134
-
135
- // 深度获取对象key
136
- if (_isObject(value)) {
137
- resultKeys.concat(getAllNamePath(value, [...currentPath, key]));
116
+ if (isObject(value)) {
117
+ resultKeys.push(...getAllNamePath(value, [...currentPath, key]));
138
118
  }
139
119
  resultKeys.push([...currentPath, key]);
140
120
  });
141
121
  return resultKeys;
142
122
  };
143
-
144
- // 判断一个字段值是否算空
145
- const nullList = [undefined, 'null', '""', '[]'];
146
- export const isNullValue = value => {
123
+ const nullList = [void 0, "null", '""', "[]"];
124
+ const isNullValue = (value) => {
147
125
  return nullList.includes(JSON.stringify(value));
148
126
  };
149
-
150
- /**
151
- * 判断数组中是否包含空值 一个为空则为true
152
- * @param arr 值
153
- * @returns boole
154
- */
155
- export const isNotFullArray = (arr, length, required) => {
127
+ const isNotFullArray = (arr, length, required) => {
156
128
  if (!Array.isArray(arr)) {
157
129
  return false;
158
130
  }
159
- if (Array.isArray(required) && required.some(item => item === false)) {
131
+ if (Array.isArray(required) && required.some((item) => item === false)) {
160
132
  return false;
161
133
  }
162
- if (arr.length < length) return true;
163
- return arr.some(item => {
164
- if (item === undefined || item === null) {
134
+ if (arr.length < length)
135
+ return true;
136
+ return arr.some((item) => {
137
+ if (item === void 0 || item === null) {
165
138
  return true;
166
139
  }
167
- if (typeof item === 'string' && item.trim().length === 0) {
140
+ if (typeof item === "string" && item.trim().length === 0) {
168
141
  return true;
169
142
  }
170
143
  if (Array.isArray(item) && item.length === 0) {
@@ -173,19 +146,14 @@ export const isNotFullArray = (arr, length, required) => {
173
146
  return false;
174
147
  });
175
148
  };
176
-
177
- /**
178
- * 判断数组中值是否都为空 全部为空则为true
179
- * @param arr 值
180
- * @returns boole
181
- */
182
- export const isNullArray = arr => {
183
- if (!Array.isArray(arr)) return !arr;
184
- return arr.every(item => {
185
- if (item === undefined || item === null) {
149
+ const isNullArray = (arr) => {
150
+ if (!Array.isArray(arr))
151
+ return !arr;
152
+ return arr.every((item) => {
153
+ if (item === void 0 || item === null) {
186
154
  return true;
187
155
  }
188
- if (typeof item === 'string' && item.trim().length === 0) {
156
+ if (typeof item === "string" && item.trim().length === 0) {
189
157
  return true;
190
158
  }
191
159
  if (Array.isArray(item) && item.length === 0) {
@@ -194,19 +162,14 @@ export const isNullArray = arr => {
194
162
  return false;
195
163
  });
196
164
  };
197
-
198
- /**
199
- * 判断数组中值是否全部为空 如果值不是数组返回false
200
- * @param arr 值
201
- * @returns boole
202
- */
203
- export const isEmptyArray = arr => {
204
- if (!Array.isArray(arr)) return false;
205
- return arr.every(item => {
206
- if (item === undefined || item === null) {
165
+ const isEmptyArray = (arr) => {
166
+ if (!Array.isArray(arr))
167
+ return false;
168
+ return arr.every((item) => {
169
+ if (item === void 0 || item === null) {
207
170
  return true;
208
171
  }
209
- if (typeof item === 'string' && item.trim().length === 0) {
172
+ if (typeof item === "string" && item.trim().length === 0) {
210
173
  return true;
211
174
  }
212
175
  if (Array.isArray(item) && item.length === 0) {
@@ -215,37 +178,30 @@ export const isEmptyArray = arr => {
215
178
  return false;
216
179
  });
217
180
  };
218
- export function toArray(value) {
219
- if (value === undefined || value === null) {
181
+ function toArray(value) {
182
+ if (value === void 0 || value === null) {
220
183
  return [];
221
184
  }
222
185
  return Array.isArray(value) ? value : [value];
223
186
  }
224
-
225
- /**
226
- * 初始化值names值合并
227
- * @param obj AnyObject
228
- * @returns AnyObject
229
- */
230
- export function initialValuesToNames(values = {}, columns) {
187
+ function initialValuesToNames(values = {}, columns) {
231
188
  const result = {};
232
189
  if (!Array.isArray(columns)) {
233
190
  return result;
234
191
  }
235
- columns.forEach(item => {
236
- if (Array.isArray(item?.names)) {
237
- const key = item.names?.map(name => {
238
- return Array.isArray(name) ? name.join('_') : name;
239
- }).join('-');
192
+ columns.forEach((item) => {
193
+ var _a;
194
+ if (Array.isArray(item == null ? void 0 : item.names)) {
195
+ const key = (_a = item.names) == null ? void 0 : _a.map((name) => {
196
+ return Array.isArray(name) ? name.join("_") : name;
197
+ }).join("-");
240
198
  const formInitialValue = item.names.map((name, index) => {
241
199
  if (item.initialValue) {
242
- _set(values, name, item.initialValue[index]);
200
+ set(values, name, item.initialValue[index]);
243
201
  }
244
- return _get(values, name);
202
+ return get(values, name);
245
203
  });
246
-
247
- // 过滤掉不存在的初始值 防止names字段值为空数组
248
- const namesInitialValue = formInitialValue.filter(item => item !== undefined);
204
+ const namesInitialValue = formInitialValue.filter((item2) => item2 !== void 0);
249
205
  if (namesInitialValue.length) {
250
206
  values[key] = formInitialValue;
251
207
  }
@@ -253,142 +209,94 @@ export function initialValuesToNames(values = {}, columns) {
253
209
  });
254
210
  return values;
255
211
  }
256
-
257
- /**
258
- * 获取数组含数字的新数组
259
- * @returns ['group-7x19no', 0, 'abc'] =>['group-7x19no', 0]
260
- */
261
- export function getArrayBeforeNumber(arr) {
262
- const index = arr.findIndex(item => typeof item === 'number');
212
+ function getArrayBeforeNumber(arr) {
213
+ const index = arr.findIndex((item) => typeof item === "number");
263
214
  return index !== -1 ? arr.slice(0, index + 1) : arr;
264
215
  }
265
-
266
- /**
267
- * 查询数据中是否包含rowKey
268
- */
269
- export const hasRowKey = obj => {
270
- if (typeof obj !== 'object' || obj === null) {
216
+ const hasRowKey = (obj) => {
217
+ if (typeof obj !== "object" || obj === null) {
271
218
  return false;
272
219
  }
273
220
  const keys = Object.keys(obj);
274
- const rowKeyExists = keys.includes('rowKey');
221
+ const rowKeyExists = keys.includes("rowKey");
275
222
  if (rowKeyExists) {
276
223
  return true;
277
224
  }
278
- return keys.some(key => hasRowKey(obj[key]));
225
+ return keys.some((key) => hasRowKey(obj[key]));
279
226
  };
280
-
281
- /**
282
- * 获取小数点后的位数
283
- * @param num 数字
284
- * @returns 位数
285
- */
286
- export const getDecimalDigits = num => {
227
+ const getDecimalDigits = (num) => {
287
228
  const match = num.toString().match(/\.(\d+)/);
288
229
  return match ? match[1].length : 0;
289
230
  };
290
-
291
- /**
292
- * 获取树状结构option
293
- * @param treeData 树数据源
294
- * @param value 选中值
295
- * @returns {}
296
- */
297
- export const findOptionByValue = (treeData, value, fieldNames) => {
298
- if (_isObject(value)) {
231
+ const findOptionByValue = (treeData, value, fieldNames) => {
232
+ if (isObject(value)) {
299
233
  return value;
300
234
  }
301
- for (let i = 0; i < treeData?.length; i++) {
235
+ for (let i = 0; i < (treeData == null ? void 0 : treeData.length); i++) {
302
236
  const node = treeData[i];
303
- if (node[fieldNames?.value || 'value'] === value) {
304
- return _omit(node, ['children', fieldNames?.children]);
237
+ if (node[(fieldNames == null ? void 0 : fieldNames.value) || "value"] === value) {
238
+ return omit(node, ["children", fieldNames == null ? void 0 : fieldNames.children]);
305
239
  }
306
240
  if (node.children) {
307
- const foundNode = findOptionByValue(node[fieldNames?.children || 'children'], value, fieldNames);
241
+ const foundNode = findOptionByValue(
242
+ node[(fieldNames == null ? void 0 : fieldNames.children) || "children"],
243
+ value,
244
+ fieldNames
245
+ );
308
246
  if (foundNode) {
309
- return _omit(foundNode, ['children', fieldNames?.children]);
247
+ return omit(foundNode, ["children", fieldNames == null ? void 0 : fieldNames.children]);
310
248
  }
311
249
  }
312
250
  }
313
251
  };
314
-
315
- /** 解析namePath */
316
- export const parseNamePath = input => {
317
- const parts = input.split('_');
318
- if (parts.every(item => _isNaN(Number(item)))) {
252
+ const parseNamePath = (input) => {
253
+ const parts = input.split("_");
254
+ if (parts.every((item) => isNaN(Number(item)))) {
319
255
  return [input];
320
256
  }
321
- const result = parts.map(item => {
322
- return _isNaN(Number(item)) ? item : Number(item);
257
+ const result = parts.map((item) => {
258
+ return isNaN(Number(item)) ? item : Number(item);
323
259
  });
324
260
  return [result];
325
261
  };
326
-
327
- /**
328
- * 获取表单所有字段路径的简化函数
329
- * @param form 表单实例
330
- * @returns 所有字段路径数组
331
- */
332
- export const getFormFieldPaths = form => {
262
+ const getFormFieldPaths = (form) => {
333
263
  try {
334
- // @ts-ignore
335
- const {
336
- getFields
337
- } = form.getInternalHooks('RC_FORM_INTERNAL_HOOKS');
264
+ const { getFields } = form.getInternalHooks("RC_FORM_INTERNAL_HOOKS");
338
265
  const allFields = getFields();
339
- return allFields.map(field => field.name);
266
+ return allFields.map((field) => field.name);
340
267
  } catch (error) {
341
- console.error('获取表单字段失败:', error);
268
+ console.error("获取表单字段失败:", error);
342
269
  return [];
343
270
  }
344
271
  };
345
- export function findNamesKeyInArray(arr, key) {
272
+ function findNamesKeyInArray(arr, key) {
346
273
  for (const item of arr) {
347
- if (!item.includes('_')) {
274
+ if (!item.includes("_")) {
348
275
  return null;
349
276
  }
350
- if (item.split('_')[0].includes(key)) {
277
+ if (item.split("_")[0].includes(key)) {
351
278
  return item;
352
279
  }
353
280
  }
354
281
  return null;
355
282
  }
356
-
357
- // 为内层数组定义一个类型别名,以增加代码清晰度
358
-
359
- /**
360
- * 根据特定规则合并两个数据源 (TypeScript 版本)
361
- * @param data1 第一个数据源
362
- * @param data2 第二个数据源
363
- * @returns 合并后的结果数组
364
- */
365
- export const mergeNames = (data1, data2) => {
366
- // 步骤 1: 将 data1 的最后一个元素存入 Set 以便快速查找
367
- const baseFields = new Set(data1.map(item => item[item.length - 1]));
283
+ const mergeNames = (data1, data2) => {
284
+ const baseFields = new Set(data1.map((item) => item[item.length - 1]));
368
285
  const finalResult = [];
369
- const coveredFields = new Set();
370
-
371
- // 步骤 2 & 3: 处理 data2,找出有效的合并项
372
- data2.forEach(item => {
373
- // 确保数组有可处理的合并字段,并且该字段是字符串类型
286
+ const coveredFields = /* @__PURE__ */ new Set();
287
+ data2.forEach((item) => {
374
288
  const combinedField = item[item.length - 1];
375
- if (item.length < 3 || typeof combinedField !== 'string') {
289
+ if (item.length < 3 || typeof combinedField !== "string") {
376
290
  return;
377
291
  }
378
- const subFields = combinedField.split('-');
379
-
380
- // 检查所有子字段是否都存在于 baseFields 中
381
- const allFieldsValid = subFields.every(field => baseFields.has(field));
382
-
383
- // 步骤 4: 如果有效,则添加到结果中,并记录已覆盖的字段
292
+ const subFields = combinedField.split("-");
293
+ const allFieldsValid = subFields.every((field) => baseFields.has(field));
384
294
  if (allFieldsValid) {
385
295
  finalResult.push(item);
386
- subFields.forEach(field => coveredFields.add(field));
296
+ subFields.forEach((field) => coveredFields.add(field));
387
297
  }
388
298
  });
389
-
390
- // 步骤 5: 处理 data1,添加未被覆盖的字段
391
- data1.forEach(item => {
299
+ data1.forEach((item) => {
392
300
  const field = item[item.length - 1];
393
301
  if (!coveredFields.has(field)) {
394
302
  finalResult.push(item);
@@ -396,20 +304,37 @@ export const mergeNames = (data1, data2) => {
396
304
  });
397
305
  return finalResult;
398
306
  };
399
-
400
- /**
401
- * 是否 formlist或者pro-edit-table 场景
402
- * 使用正则表达式判断一个由逗号分隔的字符串中,是否包含一个纯数字的片段。
403
- * @param {string} str - 输入的字符串。
404
- * @returns {boolean} - 如果匹配成功,返回 true;否则返回 false。
405
- */
406
- export const isListForm = str => {
307
+ const isListForm = (str) => {
407
308
  if (!str) {
408
309
  return false;
409
310
  }
410
- // 正则表达式:查找被逗号或字符串边界包围的数字
411
311
  const regex = /(?:^|,)\s*\d+\s*(?:,|$)/;
412
312
  return regex.test(str);
413
313
  };
414
314
  export * from "./buildFormItemProps";
415
- export * from "./reactiveValues";
315
+ export * from "./reactiveValues";
316
+ export {
317
+ diffField,
318
+ filterInternalFields,
319
+ findNamesKeyInArray,
320
+ findOptionByValue,
321
+ getAllNamePath,
322
+ getArrayBeforeNumber,
323
+ getDecimalDigits,
324
+ getFormFieldPaths,
325
+ getLayout,
326
+ hasRowKey,
327
+ initialValuesToNames,
328
+ isEmptyArray,
329
+ isListForm,
330
+ isNotFullArray,
331
+ isNullArray,
332
+ isNullValue,
333
+ isSelect,
334
+ isTrim,
335
+ isUpperCase,
336
+ mergeNames,
337
+ parseNamePath,
338
+ splitNameStr,
339
+ toArray
340
+ };
@@ -1,69 +1,30 @@
1
- /**
2
- * 定义支持多字段依赖的类型
3
- */
4
-
5
- /**
6
- * dependencies支持的类型
7
- */
8
-
9
- /**
10
- * 处理表单依赖项
11
- *
12
- * 将常规的依赖项数组与namesPaths类型的依赖项进行处理
13
- * 对于namesPaths类型,将其转换为特定格式的字符串:
14
- * - 同一路径内的多级通过下划线(_)连接
15
- * - 不同路径之间通过连字符(-)连接
16
- *
17
- * 例如:
18
- * { type: 'namesPaths', paths: [['a', 'b'], ['c', 'd']] }
19
- * 会被转换成: ['a_b-c_d']
20
- *
21
- * @param dependencies 依赖项配置
22
- * @returns 处理后的依赖项数组
23
- */
24
- export function processDependencies(dependencies) {
25
- /**
26
- * 1、没有 dependencies,直接返回
27
- */
28
- if (!dependencies) return undefined;
29
-
30
- /**
31
- * 2、如果是数组,处理可能包含多种类型的元素
32
- */
1
+ function processDependencies(dependencies) {
2
+ if (!dependencies)
3
+ return void 0;
33
4
  if (Array.isArray(dependencies)) {
34
- return dependencies.map(item => {
35
- // 处理数组中的namesPaths类型元素
36
- if (typeof item === 'object' && item !== null && 'type' in item && item.type === 'namesPaths') {
37
- // 安全类型转换
5
+ return dependencies.map((item) => {
6
+ if (typeof item === "object" && item !== null && "type" in item && item.type === "namesPaths") {
38
7
  const itemWithPaths = item;
39
- const {
40
- paths
41
- } = itemWithPaths;
42
- return paths.map(path => {
43
- return Array.isArray(path) ? path.join('_') : String(path);
44
- }).join('-');
8
+ const { paths } = itemWithPaths;
9
+ return paths.map((path) => {
10
+ return Array.isArray(path) ? path.join("_") : String(path);
11
+ }).join("-");
45
12
  }
46
- // 其他类型元素保持不变
47
13
  return item;
48
14
  });
49
15
  }
50
-
51
- /**
52
- * 3、如果是单个namesPaths对象,转换为特定的字符串形式
53
- * 例如:[['a','b','c'], ['a','b','d']] => 'a_b_c-a_b_d'
54
- */
55
- if ('type' in dependencies && dependencies.type === 'namesPaths') {
56
- const {
57
- paths
58
- } = dependencies;
59
- return [paths.map(path => {
60
- return Array.isArray(path) ? path.join('_') : String(path);
61
- }).join('-')];
16
+ if ("type" in dependencies && dependencies.type === "namesPaths") {
17
+ const { paths } = dependencies;
18
+ return [
19
+ paths.map((path) => {
20
+ return Array.isArray(path) ? path.join("_") : String(path);
21
+ }).join("-")
22
+ ];
62
23
  }
63
-
64
- /**
65
- * 4、如果是普通的 dependencies,直接返回
66
- */
67
24
  return dependencies;
68
25
  }
69
- export default processDependencies;
26
+ var processDependencies_default = processDependencies;
27
+ export {
28
+ processDependencies_default as default,
29
+ processDependencies
30
+ };