@zat-design/sisyphus-react 4.5.5 → 4.5.6-beta.1

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 (264) hide show
  1. package/es/FormsProvider/index.d.ts +18 -0
  2. package/es/ProAction/components/CheckModalContent/index.d.ts +8 -0
  3. package/es/ProAction/index.d.ts +7 -0
  4. package/es/ProAction/propsType.d.ts +45 -0
  5. package/es/ProConfigProvider/index.d.ts +9 -0
  6. package/es/ProConfigProvider/propsType.d.ts +82 -0
  7. package/es/ProDownload/index.d.ts +6 -0
  8. package/es/ProDownload/propsType.d.ts +71 -0
  9. package/es/ProDownload/utils.d.ts +60 -0
  10. package/es/ProDrawerForm/components/ProDrawer/index.d.ts +7 -0
  11. package/es/ProDrawerForm/components/ProModal/index.d.ts +7 -0
  12. package/es/ProDrawerForm/components/index.d.ts +2 -0
  13. package/es/ProDrawerForm/hooks/useConfirmClose.d.ts +24 -0
  14. package/es/ProDrawerForm/index.d.ts +6 -0
  15. package/es/ProDrawerForm/propsType.d.ts +111 -0
  16. package/es/ProDrawerForm/utils/index.d.ts +25 -0
  17. package/es/ProEditLabel/components/RenderProForm.d.ts +4 -0
  18. package/es/ProEditLabel/index.d.ts +4 -0
  19. package/es/ProEditLabel/propsType.d.ts +163 -0
  20. package/es/ProEditLabel/utils/index.d.ts +7 -0
  21. package/es/ProEditTable/components/ActionButton/index.d.ts +2 -0
  22. package/es/ProEditTable/components/RcTable/BaseTable.d.ts +5 -0
  23. package/es/ProEditTable/components/RcTable/DraggableTable.d.ts +7 -0
  24. package/es/ProEditTable/components/RcTable/index.d.ts +4 -0
  25. package/es/ProEditTable/components/RenderField/ListChangedWrapper.d.ts +4 -0
  26. package/es/ProEditTable/components/RenderField/index.d.ts +3 -0
  27. package/es/ProEditTable/components/RenderField/propsType.d.ts +30 -0
  28. package/es/ProEditTable/components/RenderField/tools.d.ts +22 -0
  29. package/es/ProEditTable/components/RenderToolbar/index.d.ts +2 -0
  30. package/es/ProEditTable/components/Summary/index.d.ts +12 -0
  31. package/es/ProEditTable/components/Validator/index.d.ts +18 -0
  32. package/es/ProEditTable/components/index.d.ts +5 -0
  33. package/es/ProEditTable/index.d.ts +4 -0
  34. package/es/ProEditTable/propsType.d.ts +437 -0
  35. package/es/ProEditTable/utils/config.d.ts +25 -0
  36. package/es/ProEditTable/utils/diffOriginal.d.ts +22 -0
  37. package/es/ProEditTable/utils/getDefaultProps.d.ts +1 -0
  38. package/es/ProEditTable/utils/index.d.ts +23 -0
  39. package/es/ProEditTable/utils/tools.d.ts +133 -0
  40. package/es/ProEditTable/utils/transform.d.ts +13 -0
  41. package/es/ProEditTable/utils/useEditTableError.d.ts +7 -0
  42. package/es/ProEditTable/utils/useShouldUpdateForTable.d.ts +16 -0
  43. package/es/ProEditTable/utils/validateAll.d.ts +89 -0
  44. package/es/ProEnum/components/Group.d.ts +10 -0
  45. package/es/ProEnum/components/Tag.d.ts +7 -0
  46. package/es/ProEnum/hooks/useEnum.d.ts +29 -0
  47. package/es/ProEnum/hooks/useEnumRequest.d.ts +4 -0
  48. package/es/ProEnum/hooks/useFrequentEnumRequest.d.ts +14 -0
  49. package/es/ProEnum/index.d.ts +10 -0
  50. package/es/ProEnum/index.js +1 -1
  51. package/es/ProEnum/propsType.d.ts +320 -0
  52. package/es/ProEnum/utils/eventCenter.d.ts +1 -0
  53. package/es/ProEnum/utils/frequentEnum.d.ts +39 -0
  54. package/es/ProEnum/utils/getEnum.d.ts +47 -0
  55. package/es/ProEnum/utils/getEnumLabel.d.ts +2 -0
  56. package/es/ProEnum/utils/index.d.ts +98 -0
  57. package/es/ProForm/components/Container.d.ts +9 -0
  58. package/es/ProForm/components/FormFooter/index.d.ts +5 -0
  59. package/es/ProForm/components/FormFooter/propsType.d.ts +21 -0
  60. package/es/ProForm/components/base/Checkbox/index.d.ts +14 -0
  61. package/es/ProForm/components/base/DatePicker/index.d.ts +11 -0
  62. package/es/ProForm/components/base/Input/index.d.ts +3 -0
  63. package/es/ProForm/components/base/Input/propsType.d.ts +21 -0
  64. package/es/ProForm/components/base/InputNumber/index.d.ts +11 -0
  65. package/es/ProForm/components/base/Radio/index.d.ts +15 -0
  66. package/es/ProForm/components/base/RangePicker/index.d.ts +19 -0
  67. package/es/ProForm/components/base/RangePicker/useDateRange.d.ts +15 -0
  68. package/es/ProForm/components/base/Select/index.d.ts +11 -0
  69. package/es/ProForm/components/base/Switch/index.d.ts +10 -0
  70. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +10 -0
  71. package/es/ProForm/components/base/TextArea/index.d.ts +11 -0
  72. package/es/ProForm/components/base/TimePicker/index.d.ts +13 -0
  73. package/es/ProForm/components/combination/Container/index.d.ts +4 -0
  74. package/es/ProForm/components/combination/Container/propsType.d.ts +13 -0
  75. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +24 -0
  76. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +23 -0
  77. package/es/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
  78. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +20 -0
  79. package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +12 -0
  80. package/es/ProForm/components/combination/FormList/index.d.ts +4 -0
  81. package/es/ProForm/components/combination/FormList/propsType.d.ts +69 -0
  82. package/es/ProForm/components/combination/FormList/utils.d.ts +18 -0
  83. package/es/ProForm/components/combination/Group/component/AddonWrapper/index.d.ts +9 -0
  84. package/es/ProForm/components/combination/Group/component/ComRender.d.ts +28 -0
  85. package/es/ProForm/components/combination/Group/component/FlexibleGroup.d.ts +10 -0
  86. package/es/ProForm/components/combination/Group/hooks/index.d.ts +34 -0
  87. package/es/ProForm/components/combination/Group/index.d.ts +9 -0
  88. package/es/ProForm/components/combination/Group/propsType.d.ts +99 -0
  89. package/es/ProForm/components/combination/Group/utils/index.d.ts +153 -0
  90. package/es/ProForm/components/combination/ProCascader/index.d.ts +3 -0
  91. package/es/ProForm/components/combination/ProCascader/propsType.d.ts +48 -0
  92. package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
  93. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.d.ts +33 -0
  94. package/es/ProForm/components/combination/ProModalSelect/index.d.ts +4 -0
  95. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +106 -0
  96. package/es/ProForm/components/combination/ProModalSelect/utils/index.d.ts +15 -0
  97. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +3 -0
  98. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +85 -0
  99. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +4 -0
  100. package/es/ProForm/components/combination/ProRangeLimit/propsType.d.ts +23 -0
  101. package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +8 -0
  102. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +33 -0
  103. package/es/ProForm/components/index.d.ts +29 -0
  104. package/es/ProForm/components/render/ChangedWrapper.d.ts +17 -0
  105. package/es/ProForm/components/render/ConfirmWrapper.d.ts +10 -0
  106. package/es/ProForm/components/render/CustomComponentViewWrapper.d.ts +30 -0
  107. package/es/ProForm/components/render/Render.d.ts +4 -0
  108. package/es/ProForm/components/render/RenderFields.d.ts +26 -0
  109. package/es/ProForm/components/render/propsType.d.ts +279 -0
  110. package/es/ProForm/hooks/useControlled.d.ts +1 -0
  111. package/es/ProForm/hooks/useDeepCompareMemo.d.ts +2 -0
  112. package/es/ProForm/hooks/useFieldProps.d.ts +4 -0
  113. package/es/ProForm/hooks/useForm.d.ts +8 -0
  114. package/es/ProForm/hooks/useRules.d.ts +16 -0
  115. package/es/ProForm/hooks/useShouldUpdate.d.ts +31 -0
  116. package/es/ProForm/hooks/useWatch.d.ts +22 -0
  117. package/es/ProForm/index.d.ts +6 -0
  118. package/es/ProForm/propsType.d.ts +143 -0
  119. package/es/ProForm/utils/buildFormItemProps.d.ts +25 -0
  120. package/es/ProForm/utils/diffOriginal.d.ts +10 -0
  121. package/es/ProForm/utils/getDefaultProps.d.ts +1 -0
  122. package/es/ProForm/utils/index.d.ts +109 -0
  123. package/es/ProForm/utils/processDependencies.d.ts +29 -0
  124. package/es/ProForm/utils/reactiveValues.d.ts +33 -0
  125. package/es/ProForm/utils/rulesCreator.d.ts +7 -0
  126. package/es/ProForm/utils/transformNames.d.ts +10 -0
  127. package/es/ProForm/utils/transformValue.d.ts +6 -0
  128. package/es/ProForm/utils/valueType.d.ts +70 -0
  129. package/es/ProIcon/config/index.d.ts +19 -0
  130. package/es/ProIcon/index.d.ts +4 -0
  131. package/es/ProIcon/propsTypes.d.ts +175 -0
  132. package/es/ProIcon/utils/index.d.ts +6 -0
  133. package/es/ProLayout/components/Layout/Header/index.d.ts +4 -0
  134. package/es/ProLayout/components/Layout/Menu/FoldMenu/index.d.ts +3 -0
  135. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.d.ts +3 -0
  136. package/es/ProLayout/components/Layout/Menu/OpenMenu/propsType.d.ts +15 -0
  137. package/es/ProLayout/components/Layout/Menu/SideMenu/index.d.ts +3 -0
  138. package/es/ProLayout/components/Layout/Menu/index.d.ts +4 -0
  139. package/es/ProLayout/components/Layout/Notice/index.d.ts +4 -0
  140. package/es/ProLayout/components/Layout/index.d.ts +3 -0
  141. package/es/ProLayout/components/ProCollapse/PropTypes.d.ts +98 -0
  142. package/es/ProLayout/components/ProCollapse/index.d.ts +3 -0
  143. package/es/ProLayout/components/ProFooter/PropTypes.d.ts +27 -0
  144. package/es/ProLayout/components/ProFooter/index.d.ts +3 -0
  145. package/es/ProLayout/components/ProHeader/PropTypes.d.ts +206 -0
  146. package/es/ProLayout/components/ProHeader/components/Copy/index.d.ts +4 -0
  147. package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.d.ts +9 -0
  148. package/es/ProLayout/components/ProHeader/components/ProBackBtn/propsType.d.ts +4 -0
  149. package/es/ProLayout/components/ProHeader/components/index.d.ts +2 -0
  150. package/es/ProLayout/components/ProHeader/index.d.ts +4 -0
  151. package/es/ProLayout/components/ProHeader/utils/index.d.ts +5 -0
  152. package/es/ProLayout/components/TabsManager/components/TabContextMenu.d.ts +7 -0
  153. package/es/ProLayout/components/TabsManager/components/TabItem.d.ts +26 -0
  154. package/es/ProLayout/components/TabsManager/components/TabsContext.d.ts +5 -0
  155. package/es/ProLayout/components/TabsManager/components/TabsHeader.d.ts +10 -0
  156. package/es/ProLayout/components/TabsManager/hooks/useActiveTab.d.ts +6 -0
  157. package/es/ProLayout/components/TabsManager/hooks/useIframeRoute.d.ts +25 -0
  158. package/es/ProLayout/components/TabsManager/hooks/useProLayoutTabs.d.ts +18 -0
  159. package/es/ProLayout/components/TabsManager/hooks/useTabsCache.d.ts +31 -0
  160. package/es/ProLayout/components/TabsManager/hooks/useTabsState.d.ts +5 -0
  161. package/es/ProLayout/components/TabsManager/index.d.ts +6 -0
  162. package/es/ProLayout/components/TabsManager/propTypes.d.ts +89 -0
  163. package/es/ProLayout/components/TabsManager/utils/index.d.ts +47 -0
  164. package/es/ProLayout/components/index.d.ts +3 -0
  165. package/es/ProLayout/index.d.ts +19 -0
  166. package/es/ProLayout/propTypes.d.ts +533 -0
  167. package/es/ProLayout/utils/index.d.ts +43 -0
  168. package/es/ProSelect/components/AdaptiveTooltip.d.ts +4 -0
  169. package/es/ProSelect/index.d.ts +5 -0
  170. package/es/ProSelect/propsType.d.ts +162 -0
  171. package/es/ProSelect/utils/index.d.ts +86 -0
  172. package/es/ProStep/components/Anchor/index.d.ts +4 -0
  173. package/es/ProStep/components/Item/index.d.ts +4 -0
  174. package/es/ProStep/components/LazyLoad/index.d.ts +19 -0
  175. package/es/ProStep/components/Listener/index.d.ts +4 -0
  176. package/es/ProStep/components/Step/index.d.ts +5 -0
  177. package/es/ProStep/index.d.ts +11 -0
  178. package/es/ProStep/propsType.d.ts +224 -0
  179. package/es/ProStep/utils/index.d.ts +22 -0
  180. package/es/ProStepTab/index.d.ts +22 -0
  181. package/es/ProStepTab/propsType.d.ts +114 -0
  182. package/es/ProTable/components/EditableCell/EditIcon.d.ts +6 -0
  183. package/es/ProTable/components/EditableCell/index.d.ts +4 -0
  184. package/es/ProTable/components/EditableCell/propsType.d.ts +24 -0
  185. package/es/ProTable/components/FormatColumn/index.d.ts +22 -0
  186. package/es/ProTable/components/FormatColumn/propsType.d.ts +29 -0
  187. package/es/ProTable/components/RcTable/components/BaseTable/index.d.ts +2 -0
  188. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/index.d.ts +18 -0
  189. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/index.d.ts +8 -0
  190. package/es/ProTable/components/RcTable/components/DraggableTable/components/DndWrapper/utils/propsType.d.ts +61 -0
  191. package/es/ProTable/components/RcTable/components/DraggableTable/index.d.ts +2 -0
  192. package/es/ProTable/components/RcTable/index.d.ts +4 -0
  193. package/es/ProTable/components/RenderColumn/index.d.ts +22 -0
  194. package/es/ProTable/components/RenderEmptyText/index.d.ts +3 -0
  195. package/es/ProTable/components/RenderFooter/index.d.ts +2 -0
  196. package/es/ProTable/components/RenderSummary/index.d.ts +3 -0
  197. package/es/ProTable/components/RenderTableHeader/index.d.ts +2 -0
  198. package/es/ProTable/components/RenderTabs/index.d.ts +3 -0
  199. package/es/ProTable/components/TableResizable/index.d.ts +13 -0
  200. package/es/ProTable/components/TooltipTitle/index.d.ts +11 -0
  201. package/es/ProTable/components/index.d.ts +31 -0
  202. package/es/ProTable/hooks/useAntdTable.d.ts +7 -0
  203. package/es/ProTable/index.d.ts +17 -0
  204. package/es/ProTable/propsType.d.ts +805 -0
  205. package/es/ProTable/utils/columnStorage.d.ts +35 -0
  206. package/es/ProTable/utils/index.d.ts +52 -0
  207. package/es/ProTabs/components/Card/index.d.ts +3 -0
  208. package/es/ProTabs/components/index.d.ts +1 -0
  209. package/es/ProTabs/index.d.ts +4 -0
  210. package/es/ProTabs/propType.d.ts +94 -0
  211. package/es/ProThemeTools/component/ProTools/index.d.ts +3 -0
  212. package/es/ProThemeTools/component/index.d.ts +1 -0
  213. package/es/ProThemeTools/context/ThemeContext.d.ts +43 -0
  214. package/es/ProThemeTools/index.d.ts +9 -0
  215. package/es/ProThemeTools/propsType.d.ts +170 -0
  216. package/es/ProThemeTools/utils/index.d.ts +51 -0
  217. package/es/ProTooltip/index.d.ts +3 -0
  218. package/es/ProTooltip/propsType.d.ts +57 -0
  219. package/es/ProTree/components/AdaptiveTooltip.d.ts +4 -0
  220. package/es/ProTree/components/CloseIcon.d.ts +2 -0
  221. package/es/ProTree/components/List.d.ts +17 -0
  222. package/es/ProTree/components/ProTree.d.ts +3 -0
  223. package/es/ProTree/components/ProTreeSelect/index.d.ts +5 -0
  224. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +445 -0
  225. package/es/ProTree/components/SearchTitle.d.ts +10 -0
  226. package/es/ProTree/components/Tree.d.ts +27 -0
  227. package/es/ProTree/components/index.d.ts +4 -0
  228. package/es/ProTree/index.d.ts +3 -0
  229. package/es/ProTree/propsType.d.ts +818 -0
  230. package/es/ProTree/utils.d.ts +62 -0
  231. package/es/ProTreeModal/components/Cascader.d.ts +14 -0
  232. package/es/ProTreeModal/components/CloseIcon.d.ts +2 -0
  233. package/es/ProTreeModal/components/List.d.ts +21 -0
  234. package/es/ProTreeModal/components/SearchTitle.d.ts +6 -0
  235. package/es/ProTreeModal/components/SortableItem.d.ts +12 -0
  236. package/es/ProTreeModal/components/Tree.d.ts +25 -0
  237. package/es/ProTreeModal/components/Trigger.d.ts +21 -0
  238. package/es/ProTreeModal/components/index.d.ts +6 -0
  239. package/es/ProTreeModal/index.d.ts +4 -0
  240. package/es/ProTreeModal/propsType.d.ts +298 -0
  241. package/es/ProTreeModal/utils.d.ts +39 -0
  242. package/es/ProUpload/components/ButtonRender.d.ts +20 -0
  243. package/es/ProUpload/components/DragRender.d.ts +21 -0
  244. package/es/ProUpload/components/DraggableUploadListItem.d.ts +2 -0
  245. package/es/ProUpload/components/Example.d.ts +10 -0
  246. package/es/ProUpload/components/FileItem.d.ts +33 -0
  247. package/es/ProUpload/components/ImageRender.d.ts +19 -0
  248. package/es/ProUpload/index.d.ts +4 -0
  249. package/es/ProUpload/propsType.d.ts +264 -0
  250. package/es/ProUpload/uitls.d.ts +3 -0
  251. package/es/ProUtils/utils/index.d.ts +6 -0
  252. package/es/ProViewer/index.d.ts +4 -0
  253. package/es/ProViewer/propsType.d.ts +37 -0
  254. package/es/ProWaterMark/index.d.ts +4 -0
  255. package/es/ProWaterMark/propsType.d.ts +6 -0
  256. package/es/hooks/useDraggableRow.d.ts +34 -0
  257. package/es/index.d.ts +57 -0
  258. package/es/index.js +0 -2
  259. package/es/locale/en_US.d.ts +176 -0
  260. package/es/locale/index.d.ts +15 -0
  261. package/es/locale/zh_CN.d.ts +176 -0
  262. package/es/tokens.d.ts +83 -0
  263. package/es/utils/index.d.ts +24 -0
  264. package/package.json +12 -2
@@ -0,0 +1,39 @@
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;
@@ -0,0 +1,47 @@
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;
@@ -0,0 +1,2 @@
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;
@@ -0,0 +1,98 @@
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
+ /**
85
+ * 对枚举请求返回的数据按 clear/fieldNames 进行清洗
86
+ * @param response 枚举数据 { code: DataOption[] }
87
+ * @param options clear 是否清洗、ignoreCodes 忽略清洗的 code、fieldNames 字段映射
88
+ * @returns 清洗后的新对象(不修改入参)
89
+ * @remark 某个 code 的值非数组时(脏缓存/异常返回)跳过清洗并原样透传,避免展开非可迭代值报错
90
+ */
91
+ export declare function cleanEnumResponse(response: Record<string, any>, options: {
92
+ clear?: boolean;
93
+ ignoreCodes?: string[];
94
+ fieldNames: {
95
+ [key: string]: string;
96
+ };
97
+ }): Record<string, any>;
98
+ export {};
@@ -0,0 +1,9 @@
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;
@@ -0,0 +1,5 @@
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;
@@ -0,0 +1,21 @@
1
+ import { ButtonProps, ColProps, FormInstance } from 'antd';
2
+ import type { ModifiedFormInstanceType } from '../../propsType';
3
+ export interface ButtonItem extends ButtonProps {
4
+ children?: any;
5
+ }
6
+ export interface FooterButtonType {
7
+ okButtonProps?: ButtonItem;
8
+ cancelButtonProps?: ButtonItem;
9
+ }
10
+ export interface FooterRenderType {
11
+ okText?: string;
12
+ cancelText?: string;
13
+ onOk?: () => void;
14
+ onCancel?: () => void;
15
+ footerColProps?: ColProps;
16
+ footer?: FooterButtonType;
17
+ confirmLoading?: boolean;
18
+ formId?: string;
19
+ form: FormInstance | ModifiedFormInstanceType<any>;
20
+ children?: React.ReactNode;
21
+ }
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { CheckboxGroupProps } from 'antd/es/checkbox';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends Omit<CheckboxGroupProps, 'options'> {
5
+ dataSource: any[];
6
+ fieldNames?: {
7
+ label: string;
8
+ value: string;
9
+ };
10
+ otherProps?: ProFormOtherType;
11
+ isView?: boolean;
12
+ }
13
+ declare const Checkbox: React.FC<Props>;
14
+ export default Checkbox;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { DatePickerProps, TimePickerProps } from 'antd';
3
+ export type Props = DatePickerProps & TimePickerProps & {
4
+ isView?: boolean;
5
+ viewEmpty?: React.ReactNode;
6
+ format?: string;
7
+ showTime?: boolean | Record<string, any>;
8
+ showNow?: boolean;
9
+ };
10
+ declare const DatePicker: React.FC<Props>;
11
+ export default DatePicker;
@@ -0,0 +1,3 @@
1
+ import { Props } from './propsType';
2
+ declare const Input: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default Input;
@@ -0,0 +1,21 @@
1
+ import type { InputProps } from 'antd';
2
+ import type { FormInstance } from 'antd/es/form/Form';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface ProFieldType<T = any> {
5
+ from?: FormInstance<T>;
6
+ label?: string;
7
+ name?: string;
8
+ disabled?: boolean;
9
+ fieldName?: string;
10
+ placeholder?: string;
11
+ }
12
+ export interface Props extends InputProps, ProFieldType {
13
+ otherProps?: ProFormOtherType;
14
+ isView?: boolean;
15
+ /** 脱敏数据位置下标 */
16
+ desensitization?: [number, number];
17
+ }
18
+ /**
19
+ * 兼容旧命名导出
20
+ */
21
+ export type ProFieldProps<T = any> = ProFieldType<T>;
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { InputNumberProps } from 'antd';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends Omit<InputNumberProps, 'onBlur'> {
5
+ otherProps?: ProFormOtherType;
6
+ range?: string;
7
+ onBlur?: (value?: number, record?: any, object?: any) => void;
8
+ isView?: boolean;
9
+ }
10
+ declare const InputNumber: React.FC<Props>;
11
+ export default InputNumber;
@@ -0,0 +1,15 @@
1
+ import { RadioChangeEvent, RadioProps } from 'antd';
2
+ import React from 'react';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends Omit<RadioProps, 'options' | 'onChange'> {
5
+ dataSource: any[];
6
+ onChange: (value: any, e: RadioChangeEvent) => void;
7
+ fieldNames?: {
8
+ label: string;
9
+ value: string;
10
+ };
11
+ otherProps?: ProFormOtherType;
12
+ isView?: boolean;
13
+ }
14
+ declare const Radio: React.FC<Props>;
15
+ export default Radio;
@@ -0,0 +1,19 @@
1
+ import type { RangePickerProps } from 'antd/es/date-picker';
2
+ import dayjs from 'dayjs';
3
+ import React from 'react';
4
+ import type { ProFormOtherType } from '../../../propsType';
5
+ import { Props as RangeProps } from './useDateRange';
6
+ export type Props = {
7
+ otherProps?: ProFormOtherType;
8
+ separator?: any;
9
+ showTime?: any;
10
+ isView?: boolean;
11
+ range?: RangeProps['range'];
12
+ /** 预设日期范围快捷选项 */
13
+ presets?: Array<{
14
+ label: React.ReactNode;
15
+ value: [dayjs.Dayjs, dayjs.Dayjs] | (() => [dayjs.Dayjs, dayjs.Dayjs]);
16
+ }>;
17
+ } & Omit<RangePickerProps, 'separator'> & Omit<RangePickerProps, 'presets'>;
18
+ declare const RangePicker: React.FC<Props>;
19
+ export default RangePicker;
@@ -0,0 +1,15 @@
1
+ import type { Dayjs } from 'dayjs';
2
+ type unitOfTime = 'year' | 'years' | 'y' | 'month' | 'months' | 'M' | 'week' | 'weeks' | 'w' | 'day' | 'days' | 'd';
3
+ export interface Props {
4
+ value?: [Dayjs?, Dayjs?];
5
+ range: [number, unitOfTime];
6
+ disabledDate?: (date: Dayjs) => boolean;
7
+ }
8
+ /**
9
+ * 支持传入时间范围作为起止期的间隔时间
10
+ */
11
+ export declare const useDateRange: (props: Props) => {
12
+ onCalendarChange: (val?: [Dayjs?, Dayjs?]) => void;
13
+ disabledDate: (current: Dayjs) => boolean;
14
+ };
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { SelectProps } from 'antd';
2
+ import React from 'react';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends SelectProps {
5
+ dataSource?: any[];
6
+ scrollFollowParent?: boolean;
7
+ otherProps?: ProFormOtherType;
8
+ isView?: boolean;
9
+ }
10
+ declare const Select: React.FC<Props>;
11
+ export default Select;
@@ -0,0 +1,10 @@
1
+ import { SwitchProps } from 'antd';
2
+ import React from 'react';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends Omit<SwitchProps, 'value'> {
5
+ value: any;
6
+ otherProps?: ProFormOtherType;
7
+ isView?: boolean;
8
+ }
9
+ declare const Switch: React.FC<Props>;
10
+ export default Switch;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { CheckboxProps } from 'antd';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props extends CheckboxProps {
5
+ label?: string;
6
+ otherProps?: ProFormOtherType;
7
+ isView?: boolean;
8
+ }
9
+ declare const SwitchCheckbox: React.FC<Props>;
10
+ export default SwitchCheckbox;
@@ -0,0 +1,11 @@
1
+ import { TextAreaProps } from 'antd/es/input';
2
+ import React from 'react';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ import './index.less';
5
+ export interface Props extends TextAreaProps {
6
+ otherProps?: ProFormOtherType;
7
+ isView?: boolean;
8
+ tooltip?: boolean;
9
+ }
10
+ declare const TextAreaDef: React.FC<Props>;
11
+ export default TextAreaDef;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { TimePickerProps } from 'antd';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
+ export interface Props {
5
+ valueType?: string;
6
+ format?: string;
7
+ onChange?: (value: string) => void;
8
+ value?: string;
9
+ otherProps?: ProFormOtherType;
10
+ isView?: boolean;
11
+ }
12
+ declare const TimePicker: React.FC<Props & TimePickerProps>;
13
+ export default TimePicker;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ContainerType } from './propsType';
3
+ declare const Container: React.FC<ContainerType>;
4
+ export default Container;
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { RowProps } from 'antd';
3
+ import type { ProFormColumnType, ProFormOtherType, DiffConfigType } from '../../../propsType';
4
+ export interface ContainerType {
5
+ children?: ProFormColumnType[];
6
+ otherProps?: ProFormOtherType;
7
+ rowProps?: RowProps;
8
+ className?: string;
9
+ container?: string | React.ReactNode;
10
+ show?: boolean | (() => boolean);
11
+ diffConfig?: DiffConfigType;
12
+ clearNotShow?: boolean;
13
+ }
@@ -0,0 +1,24 @@
1
+ import { FormInstance, FormListFieldData, FormListOperation } from 'antd';
2
+ import { InternalNamePath } from 'antd/es/form/interface';
3
+ import React from 'react';
4
+ import type { FormListType, ActionType, FormListMode } from '../propsType';
5
+ export interface Props {
6
+ min?: FormListType['min'];
7
+ max?: FormListType['max'];
8
+ actionProps: ActionType[];
9
+ namePath: InternalNamePath;
10
+ form: FormInstance;
11
+ field: Omit<FormListFieldData, 'key'> & {
12
+ key: string;
13
+ };
14
+ operation: FormListOperation;
15
+ index: number;
16
+ length: number;
17
+ fields: FormListFieldData[];
18
+ mode: FormListMode;
19
+ disabled?: boolean;
20
+ isView?: boolean;
21
+ hideStartEndActionProps?: [boolean, boolean];
22
+ }
23
+ declare const ActionButton: React.FC<Props>;
24
+ export default ActionButton;
@@ -0,0 +1,23 @@
1
+ import { ColProps, FormListFieldData } from 'antd';
2
+ import React from 'react';
3
+ import { InternalNamePath } from 'antd/es/form/interface';
4
+ import type { levelType } from '../../../../../ProLayout/components/ProCollapse/PropTypes';
5
+ import type { FormListType } from '../propsType';
6
+ import type { DiffConfigType } from '../../../../propsType';
7
+ interface Props extends Omit<FormListType, 'toolbarProps'> {
8
+ index: number;
9
+ namePath: InternalNamePath;
10
+ disabled?: boolean;
11
+ isView?: boolean;
12
+ colProps: ColProps;
13
+ field: Omit<FormListFieldData, 'key'> & {
14
+ key: string;
15
+ };
16
+ level?: levelType;
17
+ towCollapse?: boolean;
18
+ diffConfig?: DiffConfigType;
19
+ hideStartEndActionProps?: [boolean, boolean];
20
+ titlePosition?: 'top' | 'left';
21
+ }
22
+ declare const BlockFields: React.FC<Props>;
23
+ export default BlockFields;
@@ -0,0 +1,13 @@
1
+ import type { FormInstance, FormListOperation } from 'antd';
2
+ import type { InternalNamePath } from 'antd/es/form/interface';
3
+ import type { ToolbarActionType } from '../propsType';
4
+ interface EmptyProps {
5
+ disabled?: boolean;
6
+ toolbarProps?: ToolbarActionType[] | false;
7
+ operation?: FormListOperation;
8
+ form?: FormInstance;
9
+ namePath?: InternalNamePath;
10
+ emptyBtnText?: string;
11
+ }
12
+ declare const Empty: ({ disabled, toolbarProps, operation, form, namePath, emptyBtnText }: EmptyProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default Empty;
@@ -0,0 +1,20 @@
1
+ import { ColProps, FormListFieldData } from 'antd';
2
+ import React from 'react';
3
+ import { InternalNamePath } from 'antd/es/form/interface';
4
+ import type { FormListType } from '../propsType';
5
+ import type { DiffConfigType } from '../../../../propsType';
6
+ interface Props extends Omit<FormListType, 'toolbarProps'> {
7
+ className?: string;
8
+ index: number;
9
+ namePath: InternalNamePath;
10
+ disabled?: boolean;
11
+ isView?: boolean;
12
+ colProps: ColProps;
13
+ field: Omit<FormListFieldData, 'key'> & {
14
+ key: string;
15
+ };
16
+ diffConfig?: DiffConfigType;
17
+ hideStartEndActionProps?: [boolean, boolean];
18
+ }
19
+ declare const LineFields: React.FC<Props>;
20
+ export default LineFields;
@@ -0,0 +1,12 @@
1
+ import { InternalNamePath } from 'antd/es/form/interface';
2
+ import React from 'react';
3
+ import type { ToolbarActionType } from '../propsType';
4
+ import { Props as ActionButtonProps } from './ActionButton';
5
+ interface Props extends Omit<ActionButtonProps, 'actionProps' | 'field' | 'index' | 'mode' | 'namePath'> {
6
+ toolbarProps: ToolbarActionType[];
7
+ namePath: InternalNamePath;
8
+ disabled?: boolean;
9
+ isView?: boolean;
10
+ }
11
+ declare const ToolbarButton: React.FC<Props>;
12
+ export default ToolbarButton;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { FormListRefType, FormListType } from './propsType';
3
+ declare const _default: React.ForwardRefExoticComponent<FormListType & React.RefAttributes<FormListRefType>>;
4
+ export default _default;
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import type { FormInstance } from 'antd/es/form/Form';
3
+ import type { ButtonProps, FormListFieldData, FormListOperation, PopconfirmProps } from 'antd';
4
+ import type { InternalNamePath } from 'antd/es/form/interface';
5
+ import type { levelType } from '../../../../ProLayout/components/ProCollapse/PropTypes';
6
+ import type { ProFormColumnType, ProFormOtherType } from '../../../propsType';
7
+ export type TitleRender = (record: Record<string, any>, index: number, form: FormInstance) => any;
8
+ export type TitleType = string | React.ReactNode | TitleRender;
9
+ type Callback = (record: any, option: Pick<Option, 'namePath' | 'index' | 'operation' | 'form'>) => any | void;
10
+ export type ToolbarCallback = (record: any, option: Pick<Option, 'index' | 'namePath' | 'form' | 'operation'>) => any | void;
11
+ export interface Option {
12
+ index: number | undefined;
13
+ namePath: InternalNamePath;
14
+ form: FormInstance;
15
+ operation: FormListOperation;
16
+ }
17
+ export interface ActionType extends Omit<ButtonProps, 'onClick' | 'type'> {
18
+ type?: 'add' | 'delete' | 'copy' | 'moveUp' | 'moveDown';
19
+ onHandle?: Callback;
20
+ onClick?: Callback;
21
+ label?: string;
22
+ needConfirm?: boolean;
23
+ confirmProps?: boolean | PopconfirmProps;
24
+ title?: string;
25
+ show?: boolean | ((record: any, option: Pick<Option, 'index' | 'form' | 'namePath'>) => boolean);
26
+ addIndex?: number | ((record: any, option: Pick<Option, 'index' | 'form' | 'namePath' | 'operation'>) => number);
27
+ }
28
+ export interface ToolbarActionType extends Omit<ActionType, 'actionType' | 'onHandle' | 'onClick' | 'show' | 'type'> {
29
+ type?: 'add';
30
+ onHandle?: ToolbarCallback;
31
+ onClick?: ToolbarCallback;
32
+ show?: boolean | ((record: any, option: Pick<Option, 'form' | 'namePath'>) => boolean);
33
+ addIndex?: number | ((record: any, option: Pick<Option, 'index' | 'form' | 'namePath' | 'operation'>) => number);
34
+ }
35
+ export type FormListMode = 'block' | 'line' | 'less';
36
+ export interface FormListType {
37
+ columns: ProFormColumnType[];
38
+ otherProps?: ProFormOtherType;
39
+ form?: FormInstance;
40
+ min?: number;
41
+ max?: number;
42
+ actionProps?: ActionType[] | false;
43
+ toolbarProps?: ToolbarActionType[] | false;
44
+ value?: any[];
45
+ onChange?: (record: any[], option: Pick<Option, 'namePath' | 'form'>) => void;
46
+ fields: FormListFieldData[];
47
+ operation: FormListOperation;
48
+ title?: string | TitleType;
49
+ mode?: FormListMode;
50
+ level?: levelType;
51
+ disabled?: boolean;
52
+ span?: number;
53
+ towCollapse?: boolean;
54
+ meta: {
55
+ errors: React.ReactNode[];
56
+ warnings: React.ReactNode[];
57
+ };
58
+ draggable?: boolean;
59
+ id?: string;
60
+ emptyBtnText?: string;
61
+ hideStartEndActionProps?: [boolean, boolean];
62
+ titlePosition?: 'top' | 'left';
63
+ className?: string;
64
+ }
65
+ export type TypeWithRef = FormListType & React.RefAttributes<FormListRefType>;
66
+ export interface FormListRefType {
67
+ operation: FormListOperation;
68
+ }
69
+ export {};
@@ -0,0 +1,18 @@
1
+ /**
2
+ * 判断 Group 组件是否为传统模式(LegacyMode)
3
+ * @param item column 配置项
4
+ * @returns true 表示传统模式,false 表示灵活模式
5
+ */
6
+ export declare const isLegacyMode: (item: any) => boolean;
7
+ /**
8
+ * namesPath生产 [['list', 0, 'min'], ['list', 0, 'max']] => list_0_min-list_0_max
9
+ * @param names name的集合
10
+ * @param prefixNamePath formList的name前缀
11
+ * @returns list_0_min-list_0_max
12
+ */
13
+ export declare const namesPathTransform: ({ names, prefixNamePath, type, }: {
14
+ names: any[];
15
+ prefixNamePath: any[];
16
+ type: string;
17
+ }) => string;
18
+ export declare const memoWith: (pre: any, next: any) => boolean;
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ interface Props {
4
+ before?: React.ReactNode;
5
+ after?: React.ReactNode;
6
+ children?: React.ReactNode;
7
+ }
8
+ declare const AddonWrapper: React.FC<Props>;
9
+ export default AddonWrapper;