@zat-design/sisyphus-react 4.5.0 → 4.5.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 (290) hide show
  1. package/dist/index.esm.css +1 -1
  2. package/dist/less.esm.css +1 -1
  3. package/es/ProDrawerForm/components/ProDrawer/index.js +58 -86
  4. package/es/ProDrawerForm/components/ProModal/index.js +44 -20
  5. package/es/ProDrawerForm/hooks/useConfirmClose.js +70 -0
  6. package/es/ProDrawerForm/index.js +7 -11
  7. package/es/ProDrawerForm/utils/index.js +36 -0
  8. package/es/ProEditTable/components/RcTable/BaseTable.js +10 -0
  9. package/es/ProEditTable/components/Summary/index.js +3 -2
  10. package/es/ProEditTable/utils/tools.js +1 -1
  11. package/es/ProEnum/index.js +6 -3
  12. package/es/ProForm/components/combination/FormList/components/ActionButton.js +7 -6
  13. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +4 -3
  14. package/es/ProForm/components/combination/ProModalSelect/index.js +7 -2
  15. package/es/ProForm/components/combination/ProModalSelect/utils/mergeSelectedRows.js +26 -0
  16. package/es/ProForm/components/render/RenderFields.js +3 -1
  17. package/es/ProForm/hooks/useWatch.js +8 -10
  18. package/es/ProLayout/components/ProHeader/index.js +28 -15
  19. package/es/ProSelect/index.js +77 -178
  20. package/es/ProSelect/utils/index.js +174 -0
  21. package/es/ProTree/components/ProTreeSelect/index.js +41 -14
  22. package/es/ProTree/components/ProTreeSelect/style/index.less +13 -4
  23. package/es/ProTree/style/index.less +20 -9
  24. package/es/ProTree/utils.js +26 -0
  25. package/es/ProTreeModal/style/index.less +1 -1
  26. package/es/ProUpload/components/DragRender.js +2 -1
  27. package/es/ProUpload/index.js +1 -1
  28. package/es/ProViewer/propsType.js +3 -1
  29. package/es/index.js +10 -0
  30. package/package.json +7 -13
  31. package/es/FormsProvider/index.d.ts +0 -18
  32. package/es/ProAction/components/CheckModalContent/index.d.ts +0 -8
  33. package/es/ProAction/index.d.ts +0 -7
  34. package/es/ProAction/propsType.d.ts +0 -45
  35. package/es/ProConfigProvider/index.d.ts +0 -9
  36. package/es/ProConfigProvider/propsType.d.ts +0 -78
  37. package/es/ProDownload/index.d.ts +0 -6
  38. package/es/ProDownload/propsType.d.ts +0 -71
  39. package/es/ProDownload/utils.d.ts +0 -60
  40. package/es/ProDrawerForm/components/ProDrawer/index.d.ts +0 -7
  41. package/es/ProDrawerForm/components/ProModal/index.d.ts +0 -7
  42. package/es/ProDrawerForm/components/index.d.ts +0 -2
  43. package/es/ProDrawerForm/index.d.ts +0 -6
  44. package/es/ProDrawerForm/propsType.d.ts +0 -100
  45. package/es/ProDrawerForm/utils/index.d.ts +0 -6
  46. package/es/ProEditLabel/components/RenderProForm.d.ts +0 -4
  47. package/es/ProEditLabel/index.d.ts +0 -4
  48. package/es/ProEditLabel/propsType.d.ts +0 -163
  49. package/es/ProEditLabel/utils/index.d.ts +0 -7
  50. package/es/ProEditTable/components/ActionButton/index.d.ts +0 -2
  51. package/es/ProEditTable/components/RcTable/BaseTable.d.ts +0 -6
  52. package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +0 -7
  53. package/es/ProEditTable/components/RcTable/index.d.ts +0 -4
  54. package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +0 -4
  55. package/es/ProEditTable/components/RenderField/index.d.ts +0 -3
  56. package/es/ProEditTable/components/RenderField/propsType.d.ts +0 -30
  57. package/es/ProEditTable/components/RenderField/tools.d.ts +0 -22
  58. package/es/ProEditTable/components/RenderToolbar/index.d.ts +0 -2
  59. package/es/ProEditTable/components/Summary/index.d.ts +0 -12
  60. package/es/ProEditTable/components/Validator/index.d.ts +0 -19
  61. package/es/ProEditTable/components/index.d.ts +0 -5
  62. package/es/ProEditTable/index.d.ts +0 -4
  63. package/es/ProEditTable/propsType.d.ts +0 -437
  64. package/es/ProEditTable/utils/config.d.ts +0 -25
  65. package/es/ProEditTable/utils/diffOriginal.d.ts +0 -22
  66. package/es/ProEditTable/utils/getDefaultProps.d.ts +0 -1
  67. package/es/ProEditTable/utils/index.d.ts +0 -23
  68. package/es/ProEditTable/utils/tools.d.ts +0 -128
  69. package/es/ProEditTable/utils/transform.d.ts +0 -13
  70. package/es/ProEditTable/utils/useEditTableError.d.ts +0 -7
  71. package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +0 -16
  72. package/es/ProEditTable/utils/validateAll.d.ts +0 -89
  73. package/es/ProEnum/components/Group.d.ts +0 -10
  74. package/es/ProEnum/components/Tag.d.ts +0 -7
  75. package/es/ProEnum/hooks/useEnum.d.ts +0 -29
  76. package/es/ProEnum/hooks/useEnumRequest.d.ts +0 -4
  77. package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +0 -14
  78. package/es/ProEnum/index.d.ts +0 -10
  79. package/es/ProEnum/propsType.d.ts +0 -310
  80. package/es/ProEnum/utils/eventCenter.d.ts +0 -1
  81. package/es/ProEnum/utils/frequentEnum.d.ts +0 -39
  82. package/es/ProEnum/utils/getEnum.d.ts +0 -47
  83. package/es/ProEnum/utils/getEnumLabel.d.ts +0 -2
  84. package/es/ProEnum/utils/index.d.ts +0 -84
  85. package/es/ProForm/components/Container.d.ts +0 -9
  86. package/es/ProForm/components/FormFooter/index.d.ts +0 -5
  87. package/es/ProForm/components/FormFooter/propsType.d.ts +0 -22
  88. package/es/ProForm/components/base/Checkbox/index.d.ts +0 -14
  89. package/es/ProForm/components/base/DatePicker/index.d.ts +0 -11
  90. package/es/ProForm/components/base/Input/index.d.ts +0 -3
  91. package/es/ProForm/components/base/Input/propsType.d.ts +0 -21
  92. package/es/ProForm/components/base/InputNumber/index.d.ts +0 -11
  93. package/es/ProForm/components/base/Radio/index.d.ts +0 -15
  94. package/es/ProForm/components/base/RangePicker/index.d.ts +0 -19
  95. package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +0 -15
  96. package/es/ProForm/components/base/Select/index.d.ts +0 -11
  97. package/es/ProForm/components/base/Switch/index.d.ts +0 -10
  98. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +0 -10
  99. package/es/ProForm/components/base/TextArea/index.d.ts +0 -11
  100. package/es/ProForm/components/base/TimePicker/index.d.ts +0 -13
  101. package/es/ProForm/components/combination/Container/index.d.ts +0 -4
  102. package/es/ProForm/components/combination/Container/propsType.d.ts +0 -13
  103. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +0 -24
  104. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +0 -23
  105. package/es/ProForm/components/combination/FormList/components/Empty.d.ts +0 -13
  106. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +0 -20
  107. package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +0 -12
  108. package/es/ProForm/components/combination/FormList/index.d.ts +0 -4
  109. package/es/ProForm/components/combination/FormList/propsType.d.ts +0 -69
  110. package/es/ProForm/components/combination/FormList/utils.d.ts +0 -18
  111. package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +0 -9
  112. package/es/ProForm/components/combination/Group/component/ComRender.d.ts +0 -28
  113. package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +0 -10
  114. package/es/ProForm/components/combination/Group/hooks/index.d.ts +0 -34
  115. package/es/ProForm/components/combination/Group/index.d.ts +0 -9
  116. package/es/ProForm/components/combination/Group/propsType.d.ts +0 -99
  117. package/es/ProForm/components/combination/Group/utils/index.d.ts +0 -154
  118. package/es/ProForm/components/combination/ProCascader/index.d.ts +0 -4
  119. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +0 -48
  120. package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +0 -14
  121. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +0 -33
  122. package/es/ProForm/components/combination/ProModalSelect/index.d.ts +0 -4
  123. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +0 -106
  124. package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +0 -1
  125. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +0 -4
  126. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +0 -85
  127. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +0 -4
  128. package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +0 -23
  129. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +0 -9
  130. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +0 -33
  131. package/es/ProForm/components/index.d.ts +0 -29
  132. package/es/ProForm/components/render/ChangedWrapper.d.ts +0 -17
  133. package/es/ProForm/components/render/ConfirmWrapper.d.ts +0 -10
  134. package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +0 -30
  135. package/es/ProForm/components/render/Render.d.ts +0 -4
  136. package/es/ProForm/components/render/RenderFields.d.ts +0 -26
  137. package/es/ProForm/components/render/propsType.d.ts +0 -279
  138. package/es/ProForm/hooks/useControlled.d.ts +0 -1
  139. package/es/ProForm/hooks/useDeepCompareMemo.d.ts +0 -2
  140. package/es/ProForm/hooks/useFieldProps.d.ts +0 -4
  141. package/es/ProForm/hooks/useForm.d.ts +0 -8
  142. package/es/ProForm/hooks/useRules.d.ts +0 -16
  143. package/es/ProForm/hooks/useShouldUpdate.d.ts +0 -31
  144. package/es/ProForm/hooks/useWatch.d.ts +0 -22
  145. package/es/ProForm/index.d.ts +0 -6
  146. package/es/ProForm/propsType.d.ts +0 -143
  147. package/es/ProForm/utils/buildFormItemProps.d.ts +0 -25
  148. package/es/ProForm/utils/diffOriginal.d.ts +0 -10
  149. package/es/ProForm/utils/getDefaultProps.d.ts +0 -1
  150. package/es/ProForm/utils/index.d.ts +0 -109
  151. package/es/ProForm/utils/processDependencies.d.ts +0 -29
  152. package/es/ProForm/utils/reactiveValues.d.ts +0 -34
  153. package/es/ProForm/utils/rulesCreator.d.ts +0 -7
  154. package/es/ProForm/utils/transformNames.d.ts +0 -10
  155. package/es/ProForm/utils/transformValue.d.ts +0 -6
  156. package/es/ProForm/utils/valueType.d.ts +0 -70
  157. package/es/ProIcon/config/index.d.ts +0 -19
  158. package/es/ProIcon/index.d.ts +0 -4
  159. package/es/ProIcon/propsTypes.d.ts +0 -175
  160. package/es/ProIcon/utils/index.d.ts +0 -6
  161. package/es/ProLayout/components/Layout/Header/index.d.ts +0 -4
  162. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +0 -3
  163. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +0 -3
  164. package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +0 -15
  165. package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +0 -3
  166. package/es/ProLayout/components/Layout/Menu/index.d.ts +0 -4
  167. package/es/ProLayout/components/Layout/Notice/index.d.ts +0 -4
  168. package/es/ProLayout/components/Layout/index.d.ts +0 -3
  169. package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +0 -98
  170. package/es/ProLayout/components/ProCollapse/index.d.ts +0 -3
  171. package/es/ProLayout/components/ProFooter/PropTypes.d.ts +0 -27
  172. package/es/ProLayout/components/ProFooter/index.d.ts +0 -4
  173. package/es/ProLayout/components/ProHeader/PropTypes.d.ts +0 -206
  174. package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +0 -4
  175. package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +0 -9
  176. package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +0 -4
  177. package/es/ProLayout/components/ProHeader/components/index.d.ts +0 -2
  178. package/es/ProLayout/components/ProHeader/index.d.ts +0 -4
  179. package/es/ProLayout/components/ProHeader/utils/index.d.ts +0 -5
  180. package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +0 -7
  181. package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +0 -26
  182. package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +0 -6
  183. package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +0 -10
  184. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +0 -6
  185. package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +0 -25
  186. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +0 -18
  187. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +0 -31
  188. package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +0 -5
  189. package/es/ProLayout/components/TabsManager/index.d.ts +0 -7
  190. package/es/ProLayout/components/TabsManager/propTypes.d.ts +0 -89
  191. package/es/ProLayout/components/TabsManager/utils/index.d.ts +0 -47
  192. package/es/ProLayout/components/index.d.ts +0 -3
  193. package/es/ProLayout/index.d.ts +0 -20
  194. package/es/ProLayout/propTypes.d.ts +0 -533
  195. package/es/ProLayout/utils/index.d.ts +0 -43
  196. package/es/ProSelect/components/AdaptiveTooltip.d.ts +0 -4
  197. package/es/ProSelect/index.d.ts +0 -5
  198. package/es/ProSelect/propsType.d.ts +0 -160
  199. package/es/ProSelect/utils/index.d.ts +0 -4
  200. package/es/ProStep/components/Anchor/index.d.ts +0 -4
  201. package/es/ProStep/components/Item/index.d.ts +0 -3
  202. package/es/ProStep/components/LazyLoad/index.d.ts +0 -19
  203. package/es/ProStep/components/Listener/index.d.ts +0 -4
  204. package/es/ProStep/components/Step/index.d.ts +0 -5
  205. package/es/ProStep/index.d.ts +0 -11
  206. package/es/ProStep/propsType.d.ts +0 -224
  207. package/es/ProStep/utils/index.d.ts +0 -22
  208. package/es/ProStepTab/index.d.ts +0 -22
  209. package/es/ProStepTab/propsType.d.ts +0 -114
  210. package/es/ProTable/components/EditableCell/EditIcon.d.ts +0 -6
  211. package/es/ProTable/components/EditableCell/index.d.ts +0 -4
  212. package/es/ProTable/components/EditableCell/propsType.d.ts +0 -24
  213. package/es/ProTable/components/FormatColumn/index.d.ts +0 -22
  214. package/es/ProTable/components/FormatColumn/propsType.d.ts +0 -29
  215. package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +0 -3
  216. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +0 -18
  217. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +0 -8
  218. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +0 -61
  219. package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +0 -3
  220. package/es/ProTable/components/RcTable/index.d.ts +0 -4
  221. package/es/ProTable/components/RenderColumn/index.d.ts +0 -22
  222. package/es/ProTable/components/RenderEmptyText/index.d.ts +0 -3
  223. package/es/ProTable/components/RenderFooter/index.d.ts +0 -2
  224. package/es/ProTable/components/RenderSummary/index.d.ts +0 -3
  225. package/es/ProTable/components/RenderTableHeader/index.d.ts +0 -2
  226. package/es/ProTable/components/RenderTabs/index.d.ts +0 -4
  227. package/es/ProTable/components/TableResizable/index.d.ts +0 -13
  228. package/es/ProTable/components/TooltipTitle/index.d.ts +0 -11
  229. package/es/ProTable/components/index.d.ts +0 -31
  230. package/es/ProTable/hooks/useAntdTable.d.ts +0 -7
  231. package/es/ProTable/index.d.ts +0 -17
  232. package/es/ProTable/propsType.d.ts +0 -792
  233. package/es/ProTable/utils/columnStorage.d.ts +0 -35
  234. package/es/ProTable/utils/index.d.ts +0 -52
  235. package/es/ProTabs/components/Card/index.d.ts +0 -3
  236. package/es/ProTabs/components/index.d.ts +0 -1
  237. package/es/ProTabs/index.d.ts +0 -4
  238. package/es/ProTabs/propType.d.ts +0 -94
  239. package/es/ProThemeTools/component/ProTools/index.d.ts +0 -3
  240. package/es/ProThemeTools/component/index.d.ts +0 -1
  241. package/es/ProThemeTools/context/ThemeContext.d.ts +0 -43
  242. package/es/ProThemeTools/index.d.ts +0 -9
  243. package/es/ProThemeTools/propsType.d.ts +0 -170
  244. package/es/ProThemeTools/utils/index.d.ts +0 -51
  245. package/es/ProTooltip/index.d.ts +0 -3
  246. package/es/ProTooltip/propsType.d.ts +0 -57
  247. package/es/ProTree/components/AdaptiveTooltip.d.ts +0 -4
  248. package/es/ProTree/components/CloseIcon.d.ts +0 -2
  249. package/es/ProTree/components/List.d.ts +0 -17
  250. package/es/ProTree/components/ProTree.d.ts +0 -3
  251. package/es/ProTree/components/ProTreeSelect/index.d.ts +0 -5
  252. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +0 -439
  253. package/es/ProTree/components/SearchTitle.d.ts +0 -11
  254. package/es/ProTree/components/Tree.d.ts +0 -27
  255. package/es/ProTree/components/index.d.ts +0 -4
  256. package/es/ProTree/index.d.ts +0 -3
  257. package/es/ProTree/propsType.d.ts +0 -812
  258. package/es/ProTree/utils.d.ts +0 -52
  259. package/es/ProTreeModal/components/Cascader.d.ts +0 -14
  260. package/es/ProTreeModal/components/CloseIcon.d.ts +0 -2
  261. package/es/ProTreeModal/components/List.d.ts +0 -21
  262. package/es/ProTreeModal/components/SearchTitle.d.ts +0 -7
  263. package/es/ProTreeModal/components/SortableItem.d.ts +0 -12
  264. package/es/ProTreeModal/components/Tree.d.ts +0 -25
  265. package/es/ProTreeModal/components/Trigger.d.ts +0 -21
  266. package/es/ProTreeModal/components/index.d.ts +0 -6
  267. package/es/ProTreeModal/index.d.ts +0 -4
  268. package/es/ProTreeModal/propsType.d.ts +0 -298
  269. package/es/ProTreeModal/utils.d.ts +0 -39
  270. package/es/ProUpload/components/ButtonRender.d.ts +0 -20
  271. package/es/ProUpload/components/DragRender.d.ts +0 -21
  272. package/es/ProUpload/components/DraggableUploadListItem.d.ts +0 -2
  273. package/es/ProUpload/components/Example.d.ts +0 -10
  274. package/es/ProUpload/components/FileItem.d.ts +0 -33
  275. package/es/ProUpload/components/ImageRender.d.ts +0 -19
  276. package/es/ProUpload/index.d.ts +0 -4
  277. package/es/ProUpload/propsType.d.ts +0 -264
  278. package/es/ProUpload/uitls.d.ts +0 -3
  279. package/es/ProUtils/utils/index.d.ts +0 -6
  280. package/es/ProViewer/index.d.ts +0 -4
  281. package/es/ProViewer/propsType.d.ts +0 -35
  282. package/es/ProWaterMark/index.d.ts +0 -4
  283. package/es/ProWaterMark/propsType.d.ts +0 -6
  284. package/es/hooks/useDraggableRow.d.ts +0 -34
  285. package/es/index.d.ts +0 -47
  286. package/es/locale/en_US.d.ts +0 -176
  287. package/es/locale/index.d.ts +0 -15
  288. package/es/locale/zh_CN.d.ts +0 -176
  289. package/es/tokens.d.ts +0 -83
  290. package/es/utils/index.d.ts +0 -20
@@ -1,89 +0,0 @@
1
- import type { FormInstance } from 'antd';
2
- import type { NamePath } from 'antd/es/form/interface';
3
- /**
4
- * 单元格规则装配 + 全量数据真实校验(脱离 DOM)。
5
- *
6
- * 背景:antd6 虚拟表格滚动时视口外的行会被卸载,其 Form.Item 字段未注册,
7
- * form.validateFields 无法覆盖;本模块用 form store 里的全量数据 + 真实规则
8
- * 逐行逐列离屏校验,解决「统一校验」缺口,并产出可常驻的真实报错文案。
9
- */
10
- interface BuildCellRulesParams {
11
- column: any;
12
- rowData: any;
13
- index: number;
14
- form: FormInstance;
15
- name: (string | number)[];
16
- config: any;
17
- }
18
- interface BuiltCellRule {
19
- /** 单元格 Form.Item 的 namePath(用于定位/messageVariables) */
20
- namePath: (string | number)[];
21
- /** 列在行内的稳定标识(与 transformColumns 的 dataIndex/key 一致),用于错误存储归集 */
22
- cellKey: string;
23
- /** 待校验值(names 列为组合数组) */
24
- value: any;
25
- /** 真实规则集合 */
26
- rules: any[];
27
- /** 字段 label,供 ${label} 文案插值 */
28
- label: string;
29
- }
30
- /**
31
- * 为单行单列装配真实校验规则与取值。
32
- * 当该单元格处于查看/禁用态、或无任何规则时返回 null(跳过校验)。
33
- */
34
- export declare const buildCellRules: ({ column, rowData, index, form, name, config, }: BuildCellRulesParams) => BuiltCellRule | null;
35
- interface ValidateAllParams {
36
- form: FormInstance;
37
- name: NamePath;
38
- columns: any[];
39
- config: any;
40
- }
41
- export interface ValidateAllResult {
42
- hasError: boolean;
43
- /** rowKey -> { cellKey -> 错误文案数组 } */
44
- errorMap: Record<string, Record<string, string[]>>;
45
- /** 首个错误单元格的 namePath(用于滚动定位),无错误为 null */
46
- firstErrorPath: (string | number)[] | null;
47
- /** 首个错误行的 rowKey(用于横向滚动时定位错误行 DOM),无错误为 null */
48
- firstErrorRowKey: string | null;
49
- /** 首个错误列的 cellKey(names 列为 splitNames,普通列为列名),用于横向滚动定位列,无错误为 null */
50
- firstErrorColumnKey: string | null;
51
- }
52
- /**
53
- * 对 form store 中 name 路径下的全量数组数据,逐行逐列用真实规则校验(脱离 DOM)。
54
- */
55
- export declare const validateAllRows: ({ form, name, columns, config, }: ValidateAllParams) => Promise<ValidateAllResult>;
56
- /**
57
- * 外部错误存储:以 rowKey + cellKey 为键持久化真实报错文案。
58
- * 它是「报错常驻」的真实来源——脱离 antd Field 实体生命周期,
59
- * 行卸载后仍保留,重新挂载时回填显示。
60
- */
61
- export interface ErrorStore {
62
- /** 读取某单元格错误文案 */
63
- get(rowKey: string | number, cellKey: string): string[] | undefined;
64
- /** 读取整行错误 */
65
- getRow(rowKey: string | number): Record<string, string[]> | undefined;
66
- /** 全量替换(来自一次完整校验) */
67
- setAll(errorMap: Record<string, Record<string, string[]>>): void;
68
- /** 清理某单元格(用户修正后调用),整行清空时移除该行 */
69
- clearCell(rowKey: string | number, cellKey: string): void;
70
- /** 清空所有 */
71
- clearAll(): void;
72
- /** 是否为空 */
73
- isEmpty(): boolean;
74
- }
75
- export declare const createErrorStore: () => ErrorStore;
76
- interface RunUnifiedParams extends ValidateAllParams {
77
- errorStore: ErrorStore;
78
- }
79
- /**
80
- * 统一校验入口:对全量数据跑真实规则,写入 errorStore,返回是否有错与首个错误行索引。
81
- * 供隐藏聚合校验字段在 form.validateFields() 时调用,从而覆盖视口外未挂载的行。
82
- */
83
- export declare const runUnifiedValidation: ({ form, name, columns, config, errorStore, }: RunUnifiedParams) => Promise<{
84
- hasError: boolean;
85
- firstErrorIndex: number | null;
86
- firstErrorRowKey: string | null;
87
- firstErrorColumnKey: string | null;
88
- }>;
89
- export {};
@@ -1,10 +0,0 @@
1
- import type { ProEnumType } from '../propsType';
2
- interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
3
- fieldValue: string;
4
- fieldLabel: string;
5
- disabled?: boolean;
6
- allowClear?: boolean;
7
- button?: boolean;
8
- }
9
- declare const Group: (props: Props) => import("react/jsx-runtime").JSX.Element;
10
- export default Group;
@@ -1,7 +0,0 @@
1
- import type { ProEnumType } from '../propsType';
2
- interface Props extends Pick<ProEnumType, 'id' | 'value' | 'onChange' | 'dataSource'> {
3
- fieldValue: string;
4
- fieldLabel: string;
5
- }
6
- declare const ProEnumTag: (props: Props) => import("react/jsx-runtime").JSX.Element;
7
- export default ProEnumTag;
@@ -1,29 +0,0 @@
1
- import { DataOptionType } from '../propsType';
2
- /**
3
- * input code output [DataOption[],getEnumLabel]
4
- * @param code
5
- * const [options,fn] = useEnum("code")
6
- */
7
- declare function useEnum(code: string): [DataOptionType[], (val: string, showCodeName?: boolean) => string];
8
- /**
9
- * input codes output { code1:DataOption[],code2:DataOption[] }
10
- * @param codes
11
- * const dicsMap = useEnum(["code1","code2"])
12
- */
13
- declare function useEnum(codes: string[]): Record<string, DataOptionType[]>;
14
- /**
15
- * input code、value output label
16
- * @param code
17
- * @param value
18
- * @param compose 展示 value-label
19
- */
20
- declare function useEnum(code: string, value?: string, compose?: boolean): [string, DataOptionType];
21
- /**
22
- * input code、values array output [labels array, options array]
23
- * @param code
24
- * @param values 值数组
25
- * @param compose 展示 value-label
26
- * @returns [标签数组, 选项数组]
27
- */
28
- declare function useEnum(code: string, values: (string | number)[], compose?: boolean): [string[], DataOptionType[]];
29
- export default useEnum;
@@ -1,4 +0,0 @@
1
- import type { ProEnumConfigType } from '../propsType';
2
- import '../utils/eventCenter';
3
- declare const useEnumRequest: (props: ProEnumConfigType, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
4
- export default useEnumRequest;
@@ -1,14 +0,0 @@
1
- import type { FrequentEnumConfig } from '../propsType';
2
- type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB';
3
- interface UseFrequentEnumRequestProps {
4
- frequentEnums?: FrequentEnumConfig;
5
- fieldNames: any;
6
- clear: boolean;
7
- storage: StorageType;
8
- cacheKey: string;
9
- dispatch: any;
10
- dics: any;
11
- dataSource: any;
12
- }
13
- declare const useFrequentEnumRequest: (props: UseFrequentEnumRequestProps, dispatch: any) => import("ahooks/lib/useRequest/src/types").Result<any, any>;
14
- export default useFrequentEnumRequest;
@@ -1,10 +0,0 @@
1
- import useEnum from './hooks/useEnum';
2
- import getEnum from './utils/getEnum';
3
- import type { ProEnumType } from './propsType';
4
- declare const ProEnum: {
5
- (props: ProEnumType): import("react/jsx-runtime").JSX.Element;
6
- getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => import("react/jsx-runtime").JSX.Element;
7
- useEnum: typeof useEnum;
8
- getEnum: typeof getEnum;
9
- };
10
- export default ProEnum;
@@ -1,310 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { RadioProps, CheckboxProps } from 'antd';
3
- import { Service, Options } from 'ahooks/lib/useRequest/src/types';
4
- import type { ProFormOtherType } from '../ProForm/propsType';
5
- import type { PropSelectType } from '../ProSelect/propsType';
6
- /**
7
- * @description 数据选项类型
8
- */
9
- export interface DataOptionType {
10
- /**
11
- * @description 展示标签
12
- * @default -
13
- */
14
- label?: string;
15
- /**
16
- * @description 选项值
17
- * @default -
18
- */
19
- value?: string;
20
- /**
21
- * @description 是否禁用
22
- * @default false
23
- */
24
- disabled?: boolean;
25
- /**
26
- * @description 允许扩展字段
27
- */
28
- [key: string]: any;
29
- }
30
- /**
31
- * @description 频繁变动的枚举配置
32
- */
33
- export interface FrequentEnumConfig {
34
- /**
35
- * @description 需要替换的缓存枚举code列表
36
- */
37
- enums: string[];
38
- /**
39
- * @description 请求服务函数
40
- */
41
- service: Service<any, any>;
42
- /**
43
- * @description 请求选项配置
44
- */
45
- options?: Options<any, any>;
46
- /**
47
- * @description 对频繁枚举返回数据进行格式化(独立于全局transformResponse)
48
- * @param data 后台返回的数据
49
- * @returns 格式化后的枚举数据
50
- * @default -
51
- */
52
- transformResponse?: (data: any) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
53
- }
54
- /**
55
- * @description ProEnum配置类型
56
- */
57
- export interface ProEnumConfigType {
58
- /**
59
- * @description 是否枚举主入口
60
- * @default false
61
- */
62
- main?: boolean;
63
- /**
64
- * @description 是否使用主入口枚举
65
- * @default false
66
- */
67
- share?: boolean;
68
- /**
69
- * @description 是否开启调试 log
70
- * @default false
71
- */
72
- debugger?: boolean;
73
- /**
74
- * @description 是否对数据进行清洗
75
- * @default false
76
- */
77
- clear?: boolean;
78
- /**
79
- * @description 字段别名
80
- * @default { label: 'label', value: 'value', children: 'children' }
81
- */
82
- fieldNames?: {
83
- label?: string;
84
- value?: string;
85
- children?: string;
86
- [key: string]: string | undefined;
87
- };
88
- /**
89
- * @description 缓存的key、默认 zat-design-pro-component-cacheKey
90
- * @default "zat-design-pro-component-cacheKey"
91
- */
92
- cacheKey: string;
93
- /**
94
- * @description 刷新请求、设置后每次进入都会重新请求
95
- * @default false
96
- */
97
- requestRefresh: boolean;
98
- /**
99
- * @description 存储位置、不设置、默认读取 globalConfig 里面的
100
- * @default "localStorage"
101
- */
102
- storage: 'localStorage' | 'sessionStorage' | 'indexedDB';
103
- /**
104
- * @description 默认静态枚举数据
105
- * @default {}
106
- */
107
- dataSource: Record<string, DataOptionType[]>;
108
- /**
109
- * @description 对后台返回数据进行格式化
110
- * @param data 后台返回的数据
111
- * @returns 格式化后的枚举数据
112
- * @default -
113
- */
114
- transformResponse?: (data: {
115
- data: Record<string, DataOptionType[]>;
116
- }) => Record<string, DataOptionType[]> | Promise<Record<string, DataOptionType[]>>;
117
- /**
118
- * @description 批量请求枚举接口
119
- * @default -
120
- */
121
- useRequest?: {
122
- /**
123
- * @description 请求服务函数
124
- */
125
- service: Service<any, any>;
126
- /**
127
- * @description 请求选项配置
128
- */
129
- options?: Options<any, any> & {
130
- /**
131
- * @description 指定请求的枚举码
132
- */
133
- codes?: string[];
134
- /**
135
- * @description 忽略的枚举码
136
- */
137
- ignoreCodes?: string[];
138
- };
139
- };
140
- /**
141
- * @description 频繁变动的枚举配置
142
- * @default -
143
- */
144
- frequentEnums?: FrequentEnumConfig;
145
- /**
146
- * @description 字典数据
147
- * @default {}
148
- */
149
- dics: Record<string, DataOptionType[]>;
150
- }
151
- /**
152
- * @description 枚举组件类型枚举
153
- */
154
- type EnumComponentType = 'ProSelect' | 'Radio' | 'Checkbox' | 'Tag' | 'Group';
155
- /**
156
- * @description ProEnum基础属性类型
157
- */
158
- export interface ProEnumBaseType {
159
- /**
160
- * @description 组件展示类型、默认 ProSelect
161
- * @default "ProSelect"
162
- */
163
- type?: EnumComponentType;
164
- /**
165
- * @description 用于自定义组件
166
- * @default -
167
- */
168
- component?: ReactNode;
169
- /**
170
- * @description 用于提交 code
171
- * @default -
172
- */
173
- code?: string | string[];
174
- /**
175
- * @description 字段别名
176
- * @default -
177
- */
178
- fieldNames?: Record<string, string>;
179
- /**
180
- * @description 是否查看模式
181
- * @default false
182
- */
183
- isView?: boolean;
184
- /**
185
- * @description 数据源
186
- * @default -
187
- */
188
- dataSource?: DataOptionType[];
189
- /**
190
- * @description 当前值
191
- * @default -
192
- */
193
- value: any;
194
- /**
195
- * @description 值变化回调
196
- * @default -
197
- */
198
- onChange?: (value: any) => void;
199
- /**
200
- * @description 远程请求接口
201
- * @default -
202
- */
203
- useRequest?: {
204
- /**
205
- * @description 请求服务函数
206
- */
207
- service: Service<any, any>;
208
- /**
209
- * @description 请求选项
210
- */
211
- options?: Options<any, any>;
212
- };
213
- /**
214
- * @description 对后台返回数据进行格式化
215
- * @param data 后台返回的数据
216
- * @returns 格式化后的选项数据
217
- * @default -
218
- */
219
- transformResponse?: (data: any) => DataOptionType[];
220
- /**
221
- * @description 是否合并数据
222
- * @default false
223
- */
224
- merge?: boolean;
225
- /**
226
- * @description 查看模式下为空展示
227
- * @default "-"
228
- */
229
- viewEmpty?: React.ReactNode;
230
- /**
231
- * @description 自定义选项渲染
232
- * @default -
233
- */
234
- optionRender?: any;
235
- /**
236
- * @description 显示 code-value 形式
237
- * @default false
238
- */
239
- showCodeName?: boolean;
240
- /**
241
- * @description 支持 {label:xx, value: xx} 形式
242
- * @default false
243
- */
244
- labelInValue?: boolean;
245
- /**
246
- * @description 其他表单属性
247
- * @default -
248
- */
249
- otherProps?: ProFormOtherType;
250
- /**
251
- * @description 是否允许清除
252
- * @default false
253
- */
254
- allowClear?: boolean;
255
- /**
256
- * @description 组件ID
257
- * @default -
258
- */
259
- id?: string;
260
- /**
261
- * @description 默认值
262
- * @default -
263
- */
264
- defaultValue?: any;
265
- }
266
- /**
267
- * @description ProSelect类型映射
268
- */
269
- export type PropProSelectsMapType = {
270
- /**
271
- * @description 类型为ProSelect
272
- * @default "ProSelect"
273
- */
274
- type?: 'ProSelect';
275
- } & PropSelectType;
276
- /**
277
- * @description Radio类型映射
278
- */
279
- export type PropRadioPropsMapType = {
280
- /**
281
- * @description 类型为Radio
282
- * @default "Radio"
283
- */
284
- type?: 'Radio';
285
- } & RadioProps;
286
- /**
287
- * @description Checkbox类型映射
288
- */
289
- export type CheckboxPropsMapType = {
290
- /**
291
- * @description 类型为Checkbox
292
- * @default "Checkbox"
293
- */
294
- type?: 'Checkbox';
295
- } & CheckboxProps;
296
- /**
297
- * @description Tag类型映射
298
- */
299
- export interface TagPropsMapType {
300
- /**
301
- * @description 类型为Tag或Group
302
- * @default -
303
- */
304
- type?: 'Tag' | 'Group';
305
- }
306
- /**
307
- * @description ProEnum组件属性类型
308
- */
309
- export type ProEnumType = Omit<ProEnumBaseType, 'type'> & (PropProSelectsMapType | PropRadioPropsMapType | CheckboxPropsMapType | TagPropsMapType);
310
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,39 +0,0 @@
1
- import type { StorageType } from './index';
2
- import type { FrequentEnumConfig } from '../propsType';
3
- /**
4
- * 替换频繁枚举缓存数据的参数接口
5
- */
6
- export interface ReplaceFrequentEnumCacheParams {
7
- /** 存储类型 */
8
- storage: StorageType;
9
- /** 缓存key */
10
- cacheKey: string;
11
- /** 需要替换的枚举code列表 */
12
- enums: string[];
13
- /** 新的枚举数据 */
14
- newData: any;
15
- /** 字段映射 */
16
- fieldNames: any;
17
- /** 是否清洗数据 */
18
- clear: boolean;
19
- }
20
- /**
21
- * 替换频繁枚举缓存数据
22
- * @param params 参数对象
23
- * @returns 更新后的缓存数据
24
- */
25
- export declare function replaceFrequentEnumCache(params: ReplaceFrequentEnumCacheParams): any | Promise<any>;
26
- /**
27
- * 验证频繁枚举配置
28
- * @param config 频繁枚举配置
29
- * @returns 是否有效
30
- */
31
- export declare function validateFrequentEnumConfig(config: FrequentEnumConfig): boolean;
32
- /**
33
- * 合并频繁枚举数据到全局状态
34
- * @param cacheData 缓存数据
35
- * @param dics 现有字典数据
36
- * @param dataSource 数据源
37
- * @returns 合并后的数据
38
- */
39
- export declare function mergeFrequentEnumData(cacheData: any, dics: any, dataSource: any): any;
@@ -1,47 +0,0 @@
1
- import type { StorageType } from './index';
2
- export interface GetEnumParams {
3
- /** 单个枚举 code */
4
- code?: string;
5
- /** 多个枚举 code,与 code 互斥 */
6
- codes?: string[];
7
- /** 单值查询,返回 [label, option],与 values 互斥 */
8
- value?: string | number;
9
- /** 多值查询,返回 [labels[], options[]],与 value 互斥 */
10
- values?: (string | number)[];
11
- /** 为 true 时返回 value-label 组合形式 */
12
- compose?: boolean;
13
- /** 存储类型,默认 indexedDB */
14
- storage?: StorageType;
15
- /** 缓存 key,默认 zat-design-pro-component-cacheKey */
16
- cacheKey?: string;
17
- }
18
- /**
19
- * 在函数/回调中获取枚举数据,无需在 React 组件内使用。
20
- *
21
- * 枚举数据由 ProConfigProvider 初始化时写入 storage。
22
- *
23
- * **同步优先策略**:
24
- * - 内存缓存命中时直接返回值,无需 `await`
25
- * - localStorage/sessionStorage 首次调用同步读取并预热内存缓存
26
- * - indexedDB 首次调用(内存未命中)返回 Promise,需 `await` 兜底
27
- *
28
- * 典型用法:在 ProConfigProvider 初始化完成后,事件回调/工具函数中直接调用无需 await:
29
- *
30
- * @example
31
- * // 获取全部枚举(内存命中时同步返回)
32
- * const allEnums = getEnum(config);
33
- *
34
- * // 获取单个枚举 options
35
- * const [cityOptions, getLabel] = getEnum({ code: 'city', ...config });
36
- *
37
- * // 获取多个枚举
38
- * const { city, status } = getEnum({ codes: ['city', 'status'], ...config });
39
- *
40
- * // 根据值查询 label
41
- * const [label, option] = getEnum({ code: 'city', value: 'sh', ...config });
42
- *
43
- * // indexedDB 首次加载时兜底(数据未预热时需 await)
44
- * const allEnums = await getEnum(config);
45
- */
46
- declare function getEnum(params?: GetEnumParams): any;
47
- export default getEnum;
@@ -1,2 +0,0 @@
1
- declare const getEnumLabel: (code: string | string[], value: any, compose?: boolean, fieldNameLabel?: string, fieldNameValue?: string) => import("react/jsx-runtime").JSX.Element;
2
- export default getEnumLabel;
@@ -1,84 +0,0 @@
1
- import { DataOptionType } from '../propsType';
2
- export type StorageType = 'localStorage' | 'sessionStorage' | 'indexedDB';
3
- export declare const baseCacheKey = "zat-design-pro-component-cacheKey";
4
- /** v4 默认存储类型 */
5
- export declare const baseStorage: StorageType;
6
- /** 模块级内存缓存,key 为 cacheKey,替代原单例 baseEnumStorage 变量 */
7
- export declare const enumMemoryCache: Map<string, any>;
8
- /**
9
- * 从 IndexedDB 读取数据
10
- */
11
- interface EnumRes {
12
- data: Record<string, DataOptionType[]>;
13
- dataLength?: number;
14
- [key: string]: any;
15
- }
16
- export declare function normalizeEnumCacheData(cacheData: any): EnumRes;
17
- /**
18
- * 获取枚举数据
19
- * @param storage
20
- * @param cacheKey
21
- * @returns
22
- */
23
- export declare function getEnumData(storage: StorageType, cacheKey: string): EnumRes | Promise<EnumRes>;
24
- /**
25
- * 设置枚举数据
26
- * @param storage
27
- * @param cacheKey
28
- * @param data
29
- */
30
- export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): void | Promise<void>;
31
- /**
32
- * 删除枚举缓存数据
33
- * @param storage
34
- * @param cacheKey
35
- */
36
- export declare function removeEnumData(storage: StorageType, cacheKey: string): Promise<void>;
37
- /**
38
- * 从内存缓存或同步存储中同步读取枚举数据,不触发任何异步 I/O。
39
- * - 内存缓存命中时直接返回
40
- * - localStorage/sessionStorage 同步读取并预热内存缓存
41
- * - indexedDB 未命中时返回 undefined(需异步兜底)
42
- */
43
- export declare function getEnumDataSync(storage: StorageType, cacheKey: string): EnumRes | undefined;
44
- /**
45
- * 判断枚举列表是否存在
46
- * @param storage
47
- * @param cacheKey
48
- * @param code
49
- * @returns
50
- */
51
- export declare function hasEnumList(storage: StorageType, cacheKey: string, code: string): false | DataOptionType[];
52
- /**
53
- * 判断是否是对象
54
- * @param obj
55
- * @returns
56
- */
57
- export declare function isObject(obj: any): boolean;
58
- /**
59
- * 合并枚举数据
60
- * @param storage
61
- * @param code
62
- * @param cacheKey
63
- * @param responseData
64
- */
65
- export declare function mergeCacheData(storage: StorageType, code: string, cacheKey: string, responseData: any): Promise<void>;
66
- /**
67
- * diff code 差异
68
- * @param cacheCodes
69
- * @param codes
70
- * @returns
71
- */
72
- export declare function diffCode(cacheCodes: string[], codes: string[]): boolean;
73
- /**
74
- * 缓存fieldNames制定的值
75
- * @param fieldNames 保留映射值
76
- * @param dataSource 需要筛选的数据源
77
- * @returns {}
78
- */
79
- export declare function cacheFieldNames(fieldNames: {
80
- [key: string]: string;
81
- }, dataSource: {
82
- [key: string]: any;
83
- }): any;
84
- export {};
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- interface Props {
3
- tooltip?: boolean;
4
- nowrap?: boolean;
5
- viewEmpty?: React.ReactNode;
6
- children?: React.ReactNode;
7
- }
8
- declare const Container: React.FC<Props>;
9
- export default Container;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import type { FooterRenderType } from './propsType';
3
- export declare const PRO_FORM_CACHE = "PRO_FORM_CACHE";
4
- declare const FormFooter: React.FC<FooterRenderType>;
5
- export default FormFooter;