@zat-design/sisyphus-react 3.11.14-beta.9 → 3.12.0

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 (221) hide show
  1. package/dist/index.esm.css +4 -0
  2. package/dist/less.esm.css +4 -0
  3. package/es/ProConfigProvider/index.d.ts +4 -4
  4. package/es/ProDrawerForm/propsType.d.ts +1 -1
  5. package/es/ProEditLabel/propsType.d.ts +2 -2
  6. package/es/ProEditTable/components/Summary/index.d.ts +2 -2
  7. package/es/ProEditTable/index.js +12 -8
  8. package/es/ProEditTable/propsType.d.ts +40 -42
  9. package/es/ProEditTable/style/index.less +1 -0
  10. package/es/ProEditTable/utils/index.d.ts +1 -1
  11. package/es/ProEditTable/utils/index.js +6 -4
  12. package/es/ProEditTable/utils/tools.d.ts +57 -22
  13. package/es/ProEditTable/utils/tools.js +47 -21
  14. package/es/ProEnum/hooks/useEnum.d.ts +2 -2
  15. package/es/ProEnum/hooks/useEnum.js +46 -17
  16. package/es/ProEnum/propsType.d.ts +2 -2
  17. package/es/ProEnum/utils/index.d.ts +8 -1
  18. package/es/ProEnum/utils/index.js +9 -2
  19. package/es/ProForm/components/FormFooter/index.d.ts +1 -1
  20. package/es/ProForm/components/base/Checkbox/index.d.ts +1 -1
  21. package/es/ProForm/components/base/Input/propsType.d.ts +3 -3
  22. package/es/ProForm/components/base/InputNumber/index.d.ts +1 -1
  23. package/es/ProForm/components/base/Radio/index.d.ts +1 -1
  24. package/es/ProForm/components/base/RangePicker/index.d.ts +1 -1
  25. package/es/ProForm/components/base/Select/index.d.ts +1 -1
  26. package/es/ProForm/components/base/Switch/index.d.ts +1 -1
  27. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -1
  28. package/es/ProForm/components/base/TextArea/index.d.ts +1 -1
  29. package/es/ProForm/components/base/TimePicker/index.d.ts +1 -1
  30. package/es/ProForm/components/combination/Container/propsType.d.ts +3 -3
  31. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -1
  32. package/es/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  33. package/es/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -2
  34. package/es/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +1 -1
  35. package/es/ProForm/components/combination/FormList/propsType.d.ts +2 -2
  36. package/es/ProForm/components/combination/Group/index.d.ts +1 -1
  37. package/es/ProForm/components/combination/Group/propsType.d.ts +1 -1
  38. package/es/ProForm/components/combination/Group/utils.d.ts +3 -3
  39. package/es/ProForm/components/combination/ProCascader/index.d.ts +1 -1
  40. package/es/ProForm/components/combination/ProCombination/index.d.ts +1 -1
  41. package/es/ProForm/components/combination/ProCombination/propsType.d.ts +1 -1
  42. package/es/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
  43. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +5 -5
  44. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
  45. package/es/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -1
  46. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  47. package/es/ProForm/components/old/EnumSelect/index.d.ts +1 -1
  48. package/es/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
  49. package/es/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
  50. package/es/ProForm/components/old/ProAddress/index.d.ts +1 -1
  51. package/es/ProForm/components/old/ProCertNo/index.d.ts +1 -1
  52. package/es/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
  53. package/es/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
  54. package/es/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  55. package/es/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
  56. package/es/ProForm/components/render/RenderFields.d.ts +3 -3
  57. package/es/ProForm/components/render/propsType.d.ts +37 -41
  58. package/es/ProForm/index.d.ts +1 -1
  59. package/es/ProForm/propsType.d.ts +6 -4
  60. package/es/ProForm/propsType.js +0 -1
  61. package/es/ProForm/utils/transformValue.d.ts +1 -1
  62. package/es/ProForm/utils/useFieldProps.d.ts +1 -1
  63. package/es/ProForm/utils/useForm.d.ts +1 -1
  64. package/es/ProForm/utils/useRules.d.ts +1 -1
  65. package/es/ProForm/utils/useShouldUpdate.d.ts +3 -3
  66. package/es/ProIcon/index.d.ts +2 -2
  67. package/es/ProIcon/propsTypes.d.ts +120 -49
  68. package/es/ProSelect/propsType.d.ts +1 -1
  69. package/es/ProStep/components/Anchor/index.d.ts +2 -1
  70. package/es/ProStep/components/Item/index.d.ts +1 -1
  71. package/es/ProStep/components/Item/index.js +6 -2
  72. package/es/ProStep/components/Listener/index.d.ts +4 -3
  73. package/es/ProStep/components/Listener/index.js +18 -4
  74. package/es/ProStep/index.d.ts +7 -7
  75. package/es/ProStep/index.js +7 -3
  76. package/es/ProStep/propsType.d.ts +145 -5
  77. package/es/ProStep/utils/index.d.ts +16 -3
  78. package/es/ProStep/utils/index.js +11 -2
  79. package/es/ProTable/components/FormatColumn/index.d.ts +1 -1
  80. package/es/ProTable/components/FormatColumn/index.js +3 -6
  81. package/es/ProTable/components/RenderTabs/index.d.ts +4 -0
  82. package/es/ProTable/components/RenderTabs/index.js +78 -0
  83. package/es/ProTable/components/index.d.ts +25 -0
  84. package/es/ProTable/components/index.js +26 -1
  85. package/es/ProTable/hooks/useAntdTable.d.ts +2 -93
  86. package/es/ProTable/hooks/useAntdTable.js +6 -2
  87. package/es/ProTable/index.d.ts +1 -1
  88. package/es/ProTable/index.js +6 -3
  89. package/es/ProTable/propsType.d.ts +68 -28
  90. package/es/ProTooltip/propsType.d.ts +0 -3
  91. package/es/ProTree/components/List.d.ts +2 -2
  92. package/es/ProTree/components/List.js +2 -2
  93. package/es/ProTree/components/ProTree.d.ts +2 -2
  94. package/es/ProTree/components/ProTreeSelect/index.d.ts +3 -3
  95. package/es/ProTree/components/ProTreeSelect/propsType.d.ts +371 -33
  96. package/es/ProTree/components/SearchTitle.d.ts +1 -1
  97. package/es/ProTree/components/Tree.d.ts +3 -3
  98. package/es/ProTree/index.d.ts +2 -2
  99. package/es/ProTree/index.js +1 -1
  100. package/es/ProTree/propsType.d.ts +692 -101
  101. package/es/ProTree/utils.d.ts +7 -7
  102. package/es/ProTreeModal/components/Cascader.d.ts +3 -3
  103. package/es/ProTreeModal/components/List.d.ts +3 -3
  104. package/es/ProTreeModal/components/Tree.d.ts +2 -2
  105. package/es/ProTreeModal/index.d.ts +2 -2
  106. package/es/ProTreeModal/index.js +2 -2
  107. package/es/ProTreeModal/propsType.d.ts +257 -48
  108. package/es/ProTreeModal/utils.d.ts +7 -7
  109. package/es/index.d.ts +15 -7
  110. package/es/index.js +1 -8
  111. package/lib/ProConfigProvider/index.d.ts +4 -4
  112. package/lib/ProDrawerForm/propsType.d.ts +1 -1
  113. package/lib/ProEditLabel/propsType.d.ts +2 -2
  114. package/lib/ProEditTable/components/Summary/index.d.ts +2 -2
  115. package/lib/ProEditTable/index.js +12 -8
  116. package/lib/ProEditTable/propsType.d.ts +40 -42
  117. package/lib/ProEditTable/style/index.less +1 -0
  118. package/lib/ProEditTable/utils/index.d.ts +1 -1
  119. package/lib/ProEditTable/utils/index.js +6 -4
  120. package/lib/ProEditTable/utils/tools.d.ts +57 -22
  121. package/lib/ProEditTable/utils/tools.js +47 -21
  122. package/lib/ProEnum/hooks/useEnum.d.ts +2 -2
  123. package/lib/ProEnum/hooks/useEnum.js +48 -17
  124. package/lib/ProEnum/propsType.d.ts +2 -2
  125. package/lib/ProEnum/utils/index.d.ts +8 -1
  126. package/lib/ProEnum/utils/index.js +9 -2
  127. package/lib/ProForm/components/FormFooter/index.d.ts +1 -1
  128. package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -1
  129. package/lib/ProForm/components/base/Input/propsType.d.ts +3 -3
  130. package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -1
  131. package/lib/ProForm/components/base/Radio/index.d.ts +1 -1
  132. package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -1
  133. package/lib/ProForm/components/base/Select/index.d.ts +1 -1
  134. package/lib/ProForm/components/base/Switch/index.d.ts +1 -1
  135. package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -1
  136. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -1
  137. package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -1
  138. package/lib/ProForm/components/combination/Container/propsType.d.ts +3 -3
  139. package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -1
  140. package/lib/ProForm/components/combination/FormList/components/BlockFields.d.ts +1 -1
  141. package/lib/ProForm/components/combination/FormList/components/LineFields.d.ts +2 -2
  142. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.d.ts +1 -1
  143. package/lib/ProForm/components/combination/FormList/propsType.d.ts +2 -2
  144. package/lib/ProForm/components/combination/Group/index.d.ts +1 -1
  145. package/lib/ProForm/components/combination/Group/propsType.d.ts +1 -1
  146. package/lib/ProForm/components/combination/Group/utils.d.ts +3 -3
  147. package/lib/ProForm/components/combination/ProCascader/index.d.ts +1 -1
  148. package/lib/ProForm/components/combination/ProCombination/index.d.ts +1 -1
  149. package/lib/ProForm/components/combination/ProCombination/propsType.d.ts +1 -1
  150. package/lib/ProForm/components/combination/ProModalSelect/index.d.ts +1 -1
  151. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +5 -5
  152. package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +2 -2
  153. package/lib/ProForm/components/combination/ProNumberRange/propsType.d.ts +1 -1
  154. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
  155. package/lib/ProForm/components/old/EnumSelect/index.d.ts +1 -1
  156. package/lib/ProForm/components/old/EnumSelect/interface.d.ts +2 -2
  157. package/lib/ProForm/components/old/InputWithSuffix/index.d.ts +1 -1
  158. package/lib/ProForm/components/old/ProAddress/index.d.ts +1 -1
  159. package/lib/ProForm/components/old/ProCertNo/index.d.ts +1 -1
  160. package/lib/ProForm/components/old/ProCertValidity/index.d.ts +1 -1
  161. package/lib/ProForm/components/old/ProRangeBox/index.d.ts +1 -1
  162. package/lib/ProForm/components/render/ChangedWrapper.d.ts +1 -1
  163. package/lib/ProForm/components/render/ConfirmWrapper.d.ts +2 -2
  164. package/lib/ProForm/components/render/RenderFields.d.ts +3 -3
  165. package/lib/ProForm/components/render/propsType.d.ts +37 -41
  166. package/lib/ProForm/index.d.ts +1 -1
  167. package/lib/ProForm/propsType.d.ts +6 -4
  168. package/lib/ProForm/propsType.js +0 -15
  169. package/lib/ProForm/utils/transformValue.d.ts +1 -1
  170. package/lib/ProForm/utils/useFieldProps.d.ts +1 -1
  171. package/lib/ProForm/utils/useForm.d.ts +1 -1
  172. package/lib/ProForm/utils/useRules.d.ts +1 -1
  173. package/lib/ProForm/utils/useShouldUpdate.d.ts +3 -3
  174. package/lib/ProIcon/index.d.ts +2 -2
  175. package/lib/ProIcon/propsTypes.d.ts +120 -49
  176. package/lib/ProSelect/propsType.d.ts +1 -1
  177. package/lib/ProStep/components/Anchor/index.d.ts +2 -1
  178. package/lib/ProStep/components/Item/index.d.ts +1 -1
  179. package/lib/ProStep/components/Item/index.js +6 -2
  180. package/lib/ProStep/components/Listener/index.d.ts +4 -3
  181. package/lib/ProStep/components/Listener/index.js +18 -4
  182. package/lib/ProStep/index.d.ts +7 -7
  183. package/lib/ProStep/index.js +7 -3
  184. package/lib/ProStep/propsType.d.ts +145 -5
  185. package/lib/ProStep/utils/index.d.ts +16 -3
  186. package/lib/ProStep/utils/index.js +11 -2
  187. package/lib/ProTable/components/FormatColumn/index.d.ts +1 -1
  188. package/lib/ProTable/components/FormatColumn/index.js +3 -6
  189. package/lib/ProTable/components/RenderTabs/index.d.ts +4 -0
  190. package/lib/ProTable/components/RenderTabs/index.js +82 -0
  191. package/lib/ProTable/components/index.d.ts +25 -0
  192. package/lib/ProTable/components/index.js +8 -1
  193. package/lib/ProTable/hooks/useAntdTable.d.ts +2 -93
  194. package/lib/ProTable/hooks/useAntdTable.js +5 -1
  195. package/lib/ProTable/index.d.ts +1 -1
  196. package/lib/ProTable/index.js +5 -2
  197. package/lib/ProTable/propsType.d.ts +68 -28
  198. package/lib/ProTooltip/propsType.d.ts +0 -3
  199. package/lib/ProTree/components/List.d.ts +2 -2
  200. package/lib/ProTree/components/List.js +2 -2
  201. package/lib/ProTree/components/ProTree.d.ts +2 -2
  202. package/lib/ProTree/components/ProTreeSelect/index.d.ts +3 -3
  203. package/lib/ProTree/components/ProTreeSelect/propsType.d.ts +371 -33
  204. package/lib/ProTree/components/SearchTitle.d.ts +1 -1
  205. package/lib/ProTree/components/Tree.d.ts +3 -3
  206. package/lib/ProTree/index.d.ts +2 -2
  207. package/lib/ProTree/index.js +1 -1
  208. package/lib/ProTree/propsType.d.ts +692 -101
  209. package/lib/ProTree/utils.d.ts +7 -7
  210. package/lib/ProTreeModal/components/Cascader.d.ts +3 -3
  211. package/lib/ProTreeModal/components/List.d.ts +3 -3
  212. package/lib/ProTreeModal/components/Tree.d.ts +2 -2
  213. package/lib/ProTreeModal/index.d.ts +2 -2
  214. package/lib/ProTreeModal/index.js +2 -2
  215. package/lib/ProTreeModal/propsType.d.ts +257 -48
  216. package/lib/ProTreeModal/utils.d.ts +7 -7
  217. package/lib/index.d.ts +15 -7
  218. package/lib/index.js +7 -83
  219. package/package.json +1 -1
  220. package/test/__mocks__/fileMock.js +0 -0
  221. package/test/__mocks__/styleMock.js +0 -0
@@ -1,14 +1,25 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
7
9
  var _ProConfigProvider = require("../../ProConfigProvider");
8
10
  var _utils = require("../utils");
9
- var _ref;
10
11
  /* eslint-disable no-redeclare */
11
- var baseEnumStorage = (_ref = window.localStorage.getItem('zat-design-pro-component-cacheKey') && JSON.parse(window.localStorage.getItem('zat-design-pro-component-cacheKey'))) !== null && _ref !== void 0 ? _ref : null;
12
+
13
+ var baseEnumStorage = null;
14
+ try {
15
+ var storedData = window.localStorage.getItem('zat-design-pro-component-cacheKey');
16
+ if (storedData) {
17
+ baseEnumStorage = JSON.parse(storedData);
18
+ }
19
+ } catch (error) {
20
+ console.error('解析枚举缓存数据失败', error);
21
+ baseEnumStorage = null;
22
+ }
12
23
  /**
13
24
  * 根据 code 从枚举缓存取出对应的 options 、以及回显
14
25
  * @param codes
@@ -17,24 +28,44 @@ var baseEnumStorage = (_ref = window.localStorage.getItem('zat-design-pro-compon
17
28
  * @returns
18
29
  */
19
30
  function useEnum(codes, value, compose) {
20
- var _ref2 = (0, _ProConfigProvider.useProConfig)('globalConfig') || {},
21
- _ref2$storage = _ref2.storage,
22
- storage = _ref2$storage === void 0 ? 'localStorage' : _ref2$storage;
23
- var _ref3 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
24
- _ref3$cacheKey = _ref3.cacheKey,
25
- cacheKey = _ref3$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref3$cacheKey,
26
- _ref3$fieldNames = _ref3.fieldNames,
27
- fieldNames = _ref3$fieldNames === void 0 ? {} : _ref3$fieldNames,
28
- _ref3$clear = _ref3.clear,
29
- clear = _ref3$clear === void 0 ? true : _ref3$clear;
30
- var catchData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage);
31
+ var _ref = (0, _ProConfigProvider.useProConfig)('globalConfig') || {},
32
+ _ref$storage = _ref.storage,
33
+ storage = _ref$storage === void 0 ? 'localStorage' : _ref$storage;
34
+ var _ref2 = (0, _ProConfigProvider.useProConfig)('ProEnum') || {},
35
+ _ref2$cacheKey = _ref2.cacheKey,
36
+ cacheKey = _ref2$cacheKey === void 0 ? 'zat-design-pro-component-cacheKey' : _ref2$cacheKey,
37
+ _ref2$fieldNames = _ref2.fieldNames,
38
+ fieldNames = _ref2$fieldNames === void 0 ? {} : _ref2$fieldNames,
39
+ _ref2$clear = _ref2.clear,
40
+ clear = _ref2$clear === void 0 ? true : _ref2$clear,
41
+ _ref2$dataSource = _ref2.dataSource,
42
+ dataSource = _ref2$dataSource === void 0 ? {} : _ref2$dataSource;
43
+ var catchData = (0, _utils.getEnumData)(storage, cacheKey, baseEnumStorage, dataSource);
31
44
  // 默认枚举缓存数据
32
45
  baseEnumStorage = catchData;
33
46
  if (!codes) {
47
+ if (!Object.keys(catchData).length) {
48
+ return [];
49
+ }
34
50
  return catchData;
35
51
  }
36
52
  var fieldLabel = '';
37
53
  var fieldValue = '';
54
+ // 获取枚举数据源
55
+ var enumDataSource = (catchData === null || catchData === void 0 ? void 0 : catchData.data) || {};
56
+ // 当dataSource有值时,检查是否需要合并
57
+ if (dataSource && Object.keys(dataSource).length > 0) {
58
+ // 创建合并后的数据源
59
+ var mergedDataSource = (0, _objectSpread2.default)({}, enumDataSource);
60
+ // 遍历dataSource中的每个键
61
+ Object.keys(dataSource).forEach(function (key) {
62
+ // 如果enumDataSource中不存在该键或者该键对应的值为空数组,则合并
63
+ if (!enumDataSource[key] || enumDataSource[key].length === 0) {
64
+ mergedDataSource[key] = dataSource[key];
65
+ }
66
+ });
67
+ enumDataSource = mergedDataSource;
68
+ }
38
69
  if (fieldNames && Object.keys(fieldNames).length) {
39
70
  fieldLabel = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label;
40
71
  fieldValue = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
@@ -44,8 +75,8 @@ function useEnum(codes, value, compose) {
44
75
  fieldValue = 'value';
45
76
  }
46
77
  if (typeof codes === 'string') {
47
- var _catchData$data;
48
- var options = (catchData === null || catchData === void 0 ? void 0 : (_catchData$data = catchData.data) === null || _catchData$data === void 0 ? void 0 : _catchData$data[codes]) || [];
78
+ var _enumDataSource;
79
+ var options = ((_enumDataSource = enumDataSource) === null || _enumDataSource === void 0 ? void 0 : _enumDataSource[codes]) || [];
49
80
  var getEnumLabel = function getEnumLabel(v, composezTow) {
50
81
  var option = options.find(function (item) {
51
82
  return item[fieldValue] === v;
@@ -68,8 +99,8 @@ function useEnum(codes, value, compose) {
68
99
  if (Array.isArray(codes)) {
69
100
  var _options = {};
70
101
  codes.forEach(function (code) {
71
- var _catchData$data2;
72
- var values = catchData === null || catchData === void 0 ? void 0 : (_catchData$data2 = catchData.data) === null || _catchData$data2 === void 0 ? void 0 : _catchData$data2[code];
102
+ var _enumDataSource2;
103
+ var values = (_enumDataSource2 = enumDataSource) === null || _enumDataSource2 === void 0 ? void 0 : _enumDataSource2[code];
73
104
  if (Array.isArray(values) && values.length) {
74
105
  _options[code] = values;
75
106
  }
@@ -1,8 +1,8 @@
1
1
  import React, { ReactNode } from 'react';
2
2
  import { RadioProps, CheckboxProps } from 'antd';
3
3
  import { Service, Options } from 'ahooks/lib/useRequest/src/types';
4
- import { ProFormOtherType } from '../index';
5
- import { PropSelectProps } from '../ProSelect/propsType';
4
+ import type { ProFormOtherType } from '../ProForm/propsType';
5
+ import type { PropSelectProps } from '../ProSelect/propsType';
6
6
  /**
7
7
  * @description 数据选项类型
8
8
  */
@@ -4,7 +4,14 @@ interface EnumRes {
4
4
  data: Record<string, DataOption[]>;
5
5
  [key: string]: any;
6
6
  }
7
- export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any): EnumRes;
7
+ /**
8
+ * 获取枚举数据
9
+ * @param storage
10
+ * @param cacheKey
11
+ * @param baseEnumStorage
12
+ * @returns
13
+ */
14
+ export declare function getEnumData(storage: StorageType, cacheKey: string, baseEnumStorage?: any, dataSource?: any[]): EnumRes;
8
15
  export declare function setEnumData(storage: StorageType, cacheKey: string, data: any): boolean;
9
16
  export declare function hasEnumList(storage: StorageType, cacheKey: any, code: string): import("../propsType").DataOptionType[];
10
17
  export declare function isObject(obj: any): boolean;
@@ -14,8 +14,15 @@ exports.setEnumData = setEnumData;
14
14
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
15
15
  var _lodash = require("lodash");
16
16
  var _excluded = ["children"];
17
- function getEnumData(storage, cacheKey, baseEnumStorage) {
18
- if (baseEnumStorage) {
17
+ /**
18
+ * 获取枚举数据
19
+ * @param storage
20
+ * @param cacheKey
21
+ * @param baseEnumStorage
22
+ * @returns
23
+ */
24
+ function getEnumData(storage, cacheKey, baseEnumStorage, dataSource) {
25
+ if (baseEnumStorage && cacheKey === 'zat-design-pro-component-cacheKey') {
19
26
  return baseEnumStorage;
20
27
  }
21
28
  if (storage === 'localStorage') {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { FooterRenderType } from './propsType';
2
+ import type { FooterRenderType } from './propsType';
3
3
  export declare const PRO_FORM_CACHE = "PRO_FORM_CACHE";
4
4
  declare const FormFooter: React.FC<FooterRenderType>;
5
5
  export default FormFooter;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { CheckboxGroupProps } from 'antd/es/checkbox';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<CheckboxGroupProps, 'options'> {
5
5
  dataSource: any[];
6
6
  fieldNames?: {
@@ -1,6 +1,6 @@
1
- import { InputProps } from 'antd';
2
- import { FormInstance } from 'antd/es/form/Form';
3
- import { ProFormOtherType } from '../../../propsType';
1
+ import type { InputProps } from 'antd';
2
+ import type { FormInstance } from 'antd/es/form/Form';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface ProFieldType<T = any> {
5
5
  from?: FormInstance<T>;
6
6
  label?: string;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { InputNumberProps } from 'antd';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<InputNumberProps, 'onBlur'> {
5
5
  otherProps?: ProFormOtherType;
6
6
  range?: string;
@@ -1,6 +1,6 @@
1
1
  import { RadioChangeEvent, RadioProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<RadioProps, 'options' | 'onChange'> {
5
5
  dataSource: any[];
6
6
  onChange: (value: any, e: RadioChangeEvent) => void;
@@ -1,6 +1,6 @@
1
1
  import type { RangePickerProps } from 'antd/es/date-picker';
2
2
  import React from 'react';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  import { Props as RangeProps } from './useDateRange';
5
5
  export type Props = {
6
6
  otherProps?: ProFormOtherType;
@@ -1,6 +1,6 @@
1
1
  import { SelectProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends SelectProps {
5
5
  dataSource?: any[];
6
6
  scrollFollowParent?: boolean;
@@ -1,6 +1,6 @@
1
1
  import { SwitchProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends Omit<SwitchProps, 'value'> {
5
5
  value: any;
6
6
  otherProps?: ProFormOtherType;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { CheckboxProps } from 'antd';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  export interface Props extends CheckboxProps {
5
5
  label?: string;
6
6
  otherProps?: ProFormOtherType;
@@ -1,6 +1,6 @@
1
1
  import { TextAreaProps } from 'antd/es/input';
2
2
  import React from 'react';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  import './index.less';
5
5
  export interface Props extends TextAreaProps {
6
6
  otherProps?: ProFormOtherType;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { TimePickerProps } from 'antd/es/time-picker';
3
- import { ProFormOtherType } from '../../../propsType';
3
+ import type { ProFormOtherType } from '../../../propsType';
4
4
  import './style/index.less';
5
5
  export interface Props {
6
6
  valueType?: string;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
- import { RowProps } from 'antd';
3
- import { ProColumnType, ProFormOtherType, DiffConfigType } from '../../../propsType';
2
+ import type { RowProps } from 'antd';
3
+ import type { ProFormColumnType, ProFormOtherType, DiffConfigType } from '../../../propsType';
4
4
  export interface ContainerType {
5
- children?: ProColumnType[];
5
+ children?: ProFormColumnType[];
6
6
  otherProps?: ProFormOtherType;
7
7
  rowProps?: RowProps;
8
8
  className?: string;
@@ -1,7 +1,7 @@
1
1
  import { FormInstance, FormListFieldData, FormListOperation } from 'antd';
2
2
  import { InternalNamePath } from 'antd/es/form/interface';
3
3
  import React from 'react';
4
- import { FormListType, ActionType, FormListMode } from '../propsType';
4
+ import type { FormListType, ActionType, FormListMode } from '../propsType';
5
5
  export interface Props {
6
6
  min?: FormListType['min'];
7
7
  max?: FormListType['max'];
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import { InternalNamePath } from 'antd/es/form/interface';
4
4
  import type { levelType } from '../../../../../ProLayout/components/ProCollapse/PropTypes';
5
5
  import type { FormListType } from '../propsType';
6
- import { DiffConfigType } from '../../../../propsType';
6
+ import type { DiffConfigType } from '../../../../propsType';
7
7
  interface Props extends Omit<FormListType, 'toolbarProps'> {
8
8
  index: number;
9
9
  namePath: InternalNamePath;
@@ -1,8 +1,8 @@
1
1
  import { ColProps, FormListFieldData } from 'antd';
2
2
  import React from 'react';
3
3
  import { InternalNamePath } from 'antd/es/form/interface';
4
- import { FormListType } from '../propsType';
5
- import { DiffConfigType } from '../../../../propsType';
4
+ import type { FormListType } from '../propsType';
5
+ import type { DiffConfigType } from '../../../../propsType';
6
6
  interface Props extends Omit<FormListType, 'toolbarProps'> {
7
7
  className?: string;
8
8
  index: number;
@@ -1,6 +1,6 @@
1
1
  import { InternalNamePath } from 'antd/es/form/interface';
2
2
  import React from 'react';
3
- import { ToolbarActionType } from '../propsType';
3
+ import type { ToolbarActionType } from '../propsType';
4
4
  import { Props as ActionButtonProps } from './ActionButton';
5
5
  interface Props extends Omit<ActionButtonProps, 'actionProps' | 'field' | 'index' | 'mode' | 'namePath'> {
6
6
  toolbarProps: ToolbarActionType[];
@@ -3,7 +3,7 @@ import type { FormInstance } from 'antd/es/form/Form';
3
3
  import type { ButtonProps, FormListFieldData, FormListOperation, PopconfirmProps } from 'antd';
4
4
  import type { InternalNamePath } from 'antd/es/form/interface';
5
5
  import type { levelType } from '../../../../ProLayout/components/ProCollapse/PropTypes';
6
- import type { ProColumnType, ProFormOtherType } from '../../../propsType';
6
+ import type { ProFormColumnType, ProFormOtherType } from '../../../propsType';
7
7
  export type TitleRender = (record: Record<string, any>, index: number, form: FormInstance) => any;
8
8
  export type TitleType = string | React.ReactNode | TitleRender;
9
9
  type Callback = (record: any, option: Pick<Option, 'namePath' | 'index' | 'operation' | 'form'>) => any | void;
@@ -32,7 +32,7 @@ export interface ToolbarActionType extends Omit<ActionType, 'actionType' | 'onHa
32
32
  }
33
33
  export type FormListMode = 'block' | 'line' | 'less';
34
34
  export interface FormListType {
35
- columns: ProColumnType[];
35
+ columns: ProFormColumnType[];
36
36
  otherProps?: ProFormOtherType;
37
37
  form?: FormInstance;
38
38
  min?: number;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { GroupType } from './propsType';
2
+ import type { GroupType } from './propsType';
3
3
  /**
4
4
  * 1. 外层过滤FormItem相关属性, 但是子元素上的 required [disabled] [show] rules [fieldProps] [component] 需要取到并
5
5
  * 2.
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { FormItemProps, ModalFuncProps, SpaceProps } from 'antd';
3
3
  import { FormInstance } from 'antd/es/form/Form';
4
4
  import { NamePath } from 'antd/lib/form/interface';
5
- import { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../../propsType';
5
+ import type { ColumnTypeMap, FunctionArgs, ProFormValueType, ReactiveFunction, ViewType } from '../../render/propsType';
6
6
  export interface SpaceType extends SpaceProps {
7
7
  /**
8
8
  * 是否紧凑合并
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { InternalNamePath, NamePath } from 'antd/lib/form/interface';
3
3
  import { FormInstance } from 'antd';
4
- import { GroupColumnType, GroupType, SpaceType } from './propsType';
5
- import { ProFormColumnProps, ReactiveFunction } from '../../render/propsType';
4
+ import type { GroupColumnType, GroupType, SpaceType } from './propsType';
5
+ import type { ProFormColumnType, ReactiveFunction } from '../../render/propsType';
6
6
  export type EventArgs = any[];
7
7
  /**
8
8
  * 插入间隔符
@@ -41,7 +41,7 @@ export declare const getReactiveProps: (params: Params) => {
41
41
  fieldProps: boolean;
42
42
  desensitization: [number, number];
43
43
  };
44
- type ValueTypeGetterParams = Pick<ProFormColumnProps, 'valueType' | 'switchValue' | 'toISOString' | 'toCSTString' | 'disabled' | 'desensitization'> & {
44
+ type ValueTypeGetterParams = Pick<ProFormColumnType, 'valueType' | 'switchValue' | 'toISOString' | 'toCSTString' | 'disabled' | 'desensitization'> & {
45
45
  type?: any;
46
46
  mode?: string;
47
47
  desensitizationKey?: string;
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
- import { ProCascaderType } from './propsType';
2
+ import type { ProCascaderType } from './propsType';
3
3
  declare const _default: import("react").MemoExoticComponent<(props: ProCascaderType) => import("react/jsx-runtime").JSX.Element>;
4
4
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { FC } from 'react';
2
- import { ProCombinationType, ChildPropsItemType } from './propsType';
2
+ import type { ProCombinationType, ChildPropsItemType } from './propsType';
3
3
  import './style/index.less';
4
4
  export declare const ProCombination: FC<ProCombinationType>;
5
5
  export declare const childPropsItemProps: FC<ChildPropsItemType>;
@@ -2,7 +2,7 @@ import { FieldNames } from 'rc-select/lib/Select';
2
2
  import { FormInstance } from 'antd';
3
3
  import React from 'react';
4
4
  import * as componentMap from '../../index';
5
- import { ProFormOtherType } from '../../../propsType';
5
+ import type { ProFormOtherType } from '../../../propsType';
6
6
  export interface ChildPropsItemType {
7
7
  /**
8
8
  * @description 要显示什么组件,支持Input/Select
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
- import { ProModalSelectType } from './propsType';
2
+ import type { ProModalSelectType } from './propsType';
3
3
  declare const _default: React.ForwardRefExoticComponent<Omit<ProModalSelectType, "ref"> & React.RefAttributes<unknown>>;
4
4
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import { FormInstance, InputProps, SelectProps, ModalProps } from 'antd';
2
2
  import { Service, Options } from 'ahooks/lib/useRequest/src/types';
3
3
  import React from 'react';
4
- import { ProColumnType } from '../../render/propsType';
5
- import { ProFormOtherType } from '../../../propsType';
4
+ import type { ProFormColumnType } from '../../render/propsType';
5
+ import type { ProFormOtherType } from '../../../propsType';
6
6
  /**
7
7
  * 模态框确认按钮回调函数类型
8
8
  * @param list 选中的数据列表
@@ -27,7 +27,7 @@ interface ConfigOption {
27
27
  initParams?: any;
28
28
  };
29
29
  /** 表单列配置项 */
30
- formColumns?: ProColumnType[];
30
+ formColumns?: ProFormColumnType[];
31
31
  /** 选择模式:单选(radio)或多选(checkbox) */
32
32
  type?: 'radio' | 'checkbox';
33
33
  /** 是否开启分页功能 */
@@ -92,10 +92,10 @@ interface ProModalPropsType {
92
92
  /** 模态框选择器属性类型(结合Select和Input属性) */
93
93
  export declare type ProModalSelectPropsType = SelectProps & InputProps & ProModalPropsType;
94
94
  /** 配置选项类型 */
95
- export type ConfigOptionType = ConfigOption;
95
+ export type ProModalSelectConfigType = ConfigOption;
96
96
  /** 模态框属性类型 */
97
97
  export type ProModalType = Omit<ProModalPropsType, 'configOption'> & {
98
- configOption: ConfigOptionType;
98
+ configOption: ProModalSelectConfigType;
99
99
  };
100
100
  /** 模态框选择器类型(结合Select和Input属性) */
101
101
  export type ProModalSelectType = SelectProps & InputProps & ProModalType;
@@ -1,3 +1,3 @@
1
- import { ProNumberRangeProps } from './propsType';
2
- declare const ProNumberRange: (props: ProNumberRangeProps) => any;
1
+ import type { ProNumberRangeType } from './propsType';
2
+ declare const ProNumberRange: (props: ProNumberRangeType) => any;
3
3
  export default ProNumberRange;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ProFormOtherType } from '../../../propsType';
2
+ import type { ProFormOtherType } from '../../../propsType';
3
3
  export interface ProNumberRangeType {
4
4
  /**
5
5
  * @description 组件的值,[最小值,最大值]
@@ -2,9 +2,9 @@ import { DatePickerProps, TimePickerProps } from 'antd';
2
2
  import { PickerPanelDateProps } from 'antd/lib/calendar/generateCalendar';
3
3
  import { Moment } from 'moment';
4
4
  import React from 'react';
5
- import { ProFormOtherType } from '../../../propsType';
5
+ import type { ProFormOtherType } from '../../../propsType';
6
6
  import { Props as ProRangeLimitType } from '../ProRangeLimit';
7
- import { DistributiveOmit } from '../../../../ProForm/propsType';
7
+ import type { DistributiveOmit } from '../../../../ProForm/propsType';
8
8
  export type DateType = DatePickerProps['value'];
9
9
  export type ProTimeLimitType = DistributiveOmit<DatePickerProps, 'value' | 'onChange' | 'mode'> & {
10
10
  value?: string;
@@ -1,4 +1,4 @@
1
1
  import { FC } from 'react';
2
- import { IProps } from './interface';
2
+ import type { IProps } from './interface';
3
3
  declare const EnumSelect: FC<IProps>;
4
4
  export default EnumSelect;
@@ -1,6 +1,6 @@
1
1
  import { InputProps, ModalProps } from 'antd';
2
2
  import React from 'react';
3
- import { ProColumnProps } from '../../render/propsType';
3
+ import type { ProFormColumnType } from '../../render/propsType';
4
4
  type RequestFunction<P = Record<string, any> | void, R = any> = (params: P, ...args: any[]) => Promise<R>;
5
5
  type OnOkFunction = (list: Record<string, any>[]) => boolean;
6
6
  interface IConfigOption {
@@ -8,7 +8,7 @@ interface IConfigOption {
8
8
  fetchOptions: RequestFunction;
9
9
  useRequestOptions: object;
10
10
  conditionKey: string;
11
- conditionColumns: ProColumnProps[];
11
+ conditionColumns: ProFormColumnType[];
12
12
  defaultParams: Record<string, any>;
13
13
  withPagination: boolean;
14
14
  paginationPosition: 'tableBottom' | 'modalBottom';
@@ -1,3 +1,3 @@
1
- import { comPropsType } from './propsTypes';
1
+ import type { comPropsType } from './propsTypes';
2
2
  declare const InputWithSuffix: (props: comPropsType) => import("react/jsx-runtime").JSX.Element;
3
3
  export default InputWithSuffix;
@@ -1,4 +1,4 @@
1
- import { ProAddressPropsType } from './propsTypes';
1
+ import type { ProAddressPropsType } from './propsTypes';
2
2
  export declare const transferAddressInfoToRegion: () => {
3
3
  normalize: (value: any) => {
4
4
  province: any;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { IProps } from './propsType';
2
+ import type { IProps } from './propsType';
3
3
  /**
4
4
  * 证件号码 + 证件类型
5
5
  * @date 2022-01-06
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ProCertValidityPropsType } from './propsType';
2
+ import type { ProCertValidityPropsType } from './propsType';
3
3
  /**
4
4
  * 继承了antd原本DatePicker 与 RangePicker接口,
5
5
  * 可以在这里使用所有原有antd DatePicker的属性和事件,
@@ -1,2 +1,2 @@
1
- import { ProRangeBoxPropsType } from './propsType';
1
+ import type { ProRangeBoxPropsType } from './propsType';
2
2
  export default function ProRangeBox({ configOption }: ProRangeBoxPropsType): import("react/jsx-runtime").JSX.Element;
@@ -2,7 +2,7 @@ import { FormInstance } from 'antd';
2
2
  import { NamePath } from 'antd/lib/form/interface';
3
3
  import React from 'react';
4
4
  import { DiffOriginalParams } from '../../utils/diffOriginal';
5
- import { DiffConfigType } from '../../propsType';
5
+ import type { DiffConfigType } from '../../propsType';
6
6
  interface Props {
7
7
  name?: NamePath;
8
8
  names?: NamePath[];
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { ProFormColumnProps } from '../../propsType';
2
+ import type { ProFormColumnType } from '../../propsType';
3
3
  interface Props<T = any> {
4
4
  value?: T;
5
5
  onChange?: (value: T, ...rest: any[]) => void;
6
- confirm: ProFormColumnProps['confirm'];
6
+ confirm: ProFormColumnType['confirm'];
7
7
  [K: string]: any;
8
8
  }
9
9
  declare const ConfirmWrapper: React.FC<Props>;
@@ -1,11 +1,11 @@
1
1
  import { ColProps } from 'antd';
2
2
  import { FormInstance } from 'antd/es/form/Form';
3
3
  import React from 'react';
4
- import { ProColumnType } from './propsType';
5
- import { DiffConfigType } from '../../propsType';
4
+ import type { ProFormColumnType } from './propsType';
5
+ import type { DiffConfigType } from '../../propsType';
6
6
  interface Props<T = any> {
7
7
  isView?: boolean;
8
- columns: ProColumnType[];
8
+ columns: ProFormColumnType[];
9
9
  disabled?: boolean;
10
10
  form: FormInstance<T>;
11
11
  expand?: boolean | number;