@zat-design/sisyphus-react 3.1.5 → 3.2.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (256) hide show
  1. package/dist/index.esm.css +190 -265
  2. package/es/ProAction/index.js +7 -5
  3. package/es/ProAction/index.less +3 -2
  4. package/es/ProConfigProvider/index.d.ts +2 -0
  5. package/es/ProConfigProvider/index.js +23 -2
  6. package/es/ProDownload/utils.js +6 -3
  7. package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
  8. package/es/ProDrawerForm/index.js +5 -3
  9. package/es/ProDrawerForm/style/index.less +15 -11
  10. package/es/ProEditLabel/style/index.less +2 -2
  11. package/es/ProEditTable/components/ActionButton/index.js +3 -2
  12. package/es/ProEditTable/components/RenderField/index.js +2 -1
  13. package/es/ProEditTable/index.js +7 -6
  14. package/es/ProEditTable/style/index.less +15 -8
  15. package/es/ProEditTable/utils/config.d.ts +8 -8
  16. package/es/ProEditTable/utils/config.js +20 -12
  17. package/es/ProEditTable/utils/index.js +3 -2
  18. package/es/ProEnum/hooks/useEnumRequest.js +17 -10
  19. package/es/ProEnum/index.js +9 -4
  20. package/es/ProEnum/style/index.less +1 -1
  21. package/es/ProForm/components/FormFooter/index.js +16 -20
  22. package/es/ProForm/components/base/Input/index.js +4 -3
  23. package/es/ProForm/components/base/InputNumber/index.js +4 -3
  24. package/es/ProForm/components/base/RangePicker/index.js +0 -3
  25. package/es/ProForm/components/base/Select/index.js +2 -1
  26. package/es/ProForm/components/base/Switch/index.js +9 -5
  27. package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  28. package/es/ProForm/components/base/TextArea/index.js +4 -2
  29. package/es/ProForm/components/base/TextArea/index.less +1 -1
  30. package/es/ProForm/components/combination/Container/style/index.less +0 -1
  31. package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  32. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  33. package/es/ProForm/components/combination/FormList/style/index.less +20 -19
  34. package/es/ProForm/components/combination/Group/index.js +2 -2
  35. package/es/ProForm/components/combination/ProAddressBar/index.js +83 -63
  36. package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  37. package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
  38. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  39. package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  40. package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
  41. package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  42. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  43. package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  44. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  45. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  46. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  47. package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
  48. package/es/ProForm/components/render/Render.js +4 -2
  49. package/es/ProForm/components/render/RenderFields.js +10 -6
  50. package/es/ProForm/components/render/propsType.d.ts +5 -4
  51. package/es/ProForm/index.js +14 -2
  52. package/es/ProForm/style/index.less +76 -168
  53. package/es/ProForm/utils/index.d.ts +1 -1
  54. package/es/ProForm/utils/index.js +7 -2
  55. package/es/ProForm/utils/rulesCreator.js +2 -1
  56. package/es/ProForm/utils/useRules.js +4 -3
  57. package/es/ProForm/utils/useShouldUpdate.js +16 -16
  58. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  59. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  60. package/es/ProLayout/components/Layout/Notice/index.js +3 -2
  61. package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
  62. package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  63. package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
  64. package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  65. package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  66. package/es/ProLayout/components/ProHeader/components/index.js +2 -1
  67. package/es/ProLayout/components/ProHeader/index.js +9 -6
  68. package/es/ProLayout/components/ProHeader/style/index.less +16 -7
  69. package/es/ProLayout/utils/index.js +1 -1
  70. package/es/ProSelect/index.d.ts +3 -3
  71. package/es/ProSelect/index.js +4 -2
  72. package/es/ProStep/components/Step/index.js +3 -1
  73. package/es/ProStep/style/index.less +0 -1
  74. package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
  75. package/es/ProTable/components/RenderColumn/index.js +41 -25
  76. package/es/ProTable/index.js +10 -8
  77. package/es/ProTable/propsType.d.ts +2 -0
  78. package/es/ProTable/style/index.less +14 -1
  79. package/es/ProTable/useAntdTable.d.ts +12 -4
  80. package/es/ProTable/useAntdTable.js +18 -6
  81. package/es/ProTable/utils.d.ts +1 -1
  82. package/es/ProTable/utils.js +258 -201
  83. package/es/ProTabs/style/index.less +1 -1
  84. package/es/ProThemeTools/component/PrdTools/index.js +1 -1
  85. package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
  86. package/es/ProThemeTools/index.d.ts +2 -2
  87. package/es/ProThemeTools/index.js +24 -17
  88. package/es/ProThemeTools/propsType.d.ts +8 -6
  89. package/es/ProThemeTools/style/index.less +2 -2
  90. package/es/ProThemeTools/utils/index.d.ts +7 -0
  91. package/es/ProThemeTools/utils/index.js +19 -1
  92. package/es/ProTree/components/ProTree.js +6 -5
  93. package/es/ProTree/components/SearchTitle.d.ts +2 -2
  94. package/es/ProTree/components/SearchTitle.js +11 -1
  95. package/es/ProTree/components/Tree.js +9 -2
  96. package/es/ProTree/style/index.less +194 -142
  97. package/es/ProTreeModal/components/List.js +0 -14
  98. package/es/ProTreeModal/components/Trigger.js +9 -3
  99. package/es/ProTreeModal/index.js +29 -13
  100. package/es/ProTreeModal/style/index.less +15 -19
  101. package/es/ProUpload/components/ButtonRender.js +5 -2
  102. package/es/ProUpload/components/DragRender.js +8 -8
  103. package/es/ProUpload/components/Example.js +3 -1
  104. package/es/ProUpload/components/ImageRender.js +8 -6
  105. package/es/ProUpload/index.js +8 -6
  106. package/es/ProUpload/style/index.less +41 -39
  107. package/es/index.d.ts +2 -1
  108. package/es/index.js +2 -1
  109. package/es/locale/en_US.d.ts +138 -0
  110. package/es/locale/en_US.js +137 -0
  111. package/es/locale/index.d.ts +13 -0
  112. package/es/locale/index.js +32 -0
  113. package/es/locale/zh_CN.d.ts +137 -0
  114. package/es/locale/zh_CN.js +136 -0
  115. package/es/old/ProEditableTable/style/index.less +1 -2
  116. package/es/style/components.less +0 -1
  117. package/es/style/core/normalize.less +1 -2
  118. package/es/style/theme/antd.less +3 -4
  119. package/es/style/theme/index.less +80 -79
  120. package/es/style/theme/tokens.less +1 -0
  121. package/lib/ProAction/index.js +7 -5
  122. package/lib/ProAction/index.less +3 -2
  123. package/lib/ProConfigProvider/index.d.ts +2 -0
  124. package/lib/ProConfigProvider/index.js +22 -2
  125. package/lib/ProDownload/utils.js +4 -3
  126. package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
  127. package/lib/ProDrawerForm/index.js +5 -3
  128. package/lib/ProDrawerForm/style/index.less +15 -11
  129. package/lib/ProEditLabel/style/index.less +2 -2
  130. package/lib/ProEditTable/components/ActionButton/index.js +3 -2
  131. package/lib/ProEditTable/components/RenderField/index.js +4 -1
  132. package/lib/ProEditTable/index.js +7 -6
  133. package/lib/ProEditTable/style/index.less +15 -8
  134. package/lib/ProEditTable/utils/config.d.ts +8 -8
  135. package/lib/ProEditTable/utils/config.js +20 -12
  136. package/lib/ProEditTable/utils/index.js +3 -2
  137. package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
  138. package/lib/ProEnum/index.js +9 -4
  139. package/lib/ProEnum/style/index.less +1 -1
  140. package/lib/ProForm/components/FormFooter/index.js +16 -19
  141. package/lib/ProForm/components/base/Input/index.js +4 -3
  142. package/lib/ProForm/components/base/InputNumber/index.js +4 -3
  143. package/lib/ProForm/components/base/RangePicker/index.js +1 -4
  144. package/lib/ProForm/components/base/Select/index.js +2 -1
  145. package/lib/ProForm/components/base/Switch/index.js +8 -5
  146. package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  147. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  148. package/lib/ProForm/components/base/TextArea/index.less +1 -1
  149. package/lib/ProForm/components/combination/Container/style/index.less +0 -1
  150. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  151. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  152. package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
  153. package/lib/ProForm/components/combination/Group/index.js +2 -2
  154. package/lib/ProForm/components/combination/ProAddressBar/index.js +78 -60
  155. package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
  156. package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
  157. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
  158. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
  159. package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
  160. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  161. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
  162. package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  163. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
  164. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  165. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
  166. package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
  167. package/lib/ProForm/components/old/InputRange/index.js +0 -1
  168. package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
  169. package/lib/ProForm/components/render/Render.js +5 -2
  170. package/lib/ProForm/components/render/RenderFields.js +9 -5
  171. package/lib/ProForm/components/render/propsType.d.ts +5 -4
  172. package/lib/ProForm/index.js +14 -2
  173. package/lib/ProForm/style/index.less +76 -168
  174. package/lib/ProForm/utils/index.d.ts +1 -1
  175. package/lib/ProForm/utils/index.js +7 -2
  176. package/lib/ProForm/utils/rulesCreator.js +2 -1
  177. package/lib/ProForm/utils/useRules.js +4 -3
  178. package/lib/ProForm/utils/useShouldUpdate.js +16 -16
  179. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  180. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
  181. package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
  182. package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
  183. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  184. package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
  185. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
  186. package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
  187. package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
  188. package/lib/ProLayout/components/ProHeader/index.js +9 -6
  189. package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
  190. package/lib/ProLayout/utils/index.js +1 -1
  191. package/lib/ProSelect/index.d.ts +3 -3
  192. package/lib/ProSelect/index.js +4 -2
  193. package/lib/ProStep/components/Step/index.js +3 -1
  194. package/lib/ProStep/style/index.less +0 -1
  195. package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
  196. package/lib/ProTable/components/RenderColumn/index.js +38 -24
  197. package/lib/ProTable/components/TableResizable/index.js +8 -0
  198. package/lib/ProTable/index.js +10 -8
  199. package/lib/ProTable/propsType.d.ts +2 -0
  200. package/lib/ProTable/style/index.less +14 -1
  201. package/lib/ProTable/useAntdTable.d.ts +12 -4
  202. package/lib/ProTable/useAntdTable.js +19 -6
  203. package/lib/ProTable/utils.d.ts +1 -1
  204. package/lib/ProTable/utils.js +258 -201
  205. package/lib/ProTabs/index.js +1 -0
  206. package/lib/ProTabs/style/index.less +1 -1
  207. package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
  208. package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
  209. package/lib/ProThemeTools/index.d.ts +2 -2
  210. package/lib/ProThemeTools/index.js +24 -16
  211. package/lib/ProThemeTools/propsType.d.ts +8 -6
  212. package/lib/ProThemeTools/style/index.less +2 -2
  213. package/lib/ProThemeTools/utils/index.d.ts +7 -0
  214. package/lib/ProThemeTools/utils/index.js +20 -2
  215. package/lib/ProTree/components/ProTree.js +6 -5
  216. package/lib/ProTree/components/SearchTitle.d.ts +2 -2
  217. package/lib/ProTree/components/SearchTitle.js +11 -1
  218. package/lib/ProTree/components/Tree.js +16 -2
  219. package/lib/ProTree/index.js +0 -1
  220. package/lib/ProTree/style/index.less +194 -142
  221. package/lib/ProTreeModal/components/List.js +0 -14
  222. package/lib/ProTreeModal/components/Tree.js +1 -0
  223. package/lib/ProTreeModal/components/Trigger.js +10 -3
  224. package/lib/ProTreeModal/index.js +29 -13
  225. package/lib/ProTreeModal/style/index.less +15 -19
  226. package/lib/ProUpload/components/ButtonRender.js +5 -2
  227. package/lib/ProUpload/components/DragRender.js +8 -8
  228. package/lib/ProUpload/components/Example.js +3 -1
  229. package/lib/ProUpload/components/ImageRender.js +8 -6
  230. package/lib/ProUpload/index.js +14 -5
  231. package/lib/ProUpload/style/index.less +41 -39
  232. package/lib/index.d.ts +2 -1
  233. package/lib/index.js +13 -1
  234. package/lib/locale/en_US.d.ts +138 -0
  235. package/lib/locale/en_US.js +143 -0
  236. package/lib/locale/index.d.ts +13 -0
  237. package/lib/locale/index.js +41 -0
  238. package/lib/locale/zh_CN.d.ts +137 -0
  239. package/lib/locale/zh_CN.js +142 -0
  240. package/lib/old/ProCertValidity/index.js +1 -1
  241. package/lib/old/ProEditableTable/style/index.less +1 -2
  242. package/lib/style/components.less +0 -1
  243. package/lib/style/core/normalize.less +1 -2
  244. package/lib/style/theme/antd.less +3 -4
  245. package/lib/style/theme/index.less +80 -79
  246. package/lib/style/theme/tokens.less +1 -0
  247. package/package.json +1 -1
  248. package/typings.d.ts +2 -0
  249. package/es/old/ProBackBtn/style/index.less +0 -19
  250. package/lib/old/ProBackBtn/style/index.less +0 -19
  251. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  252. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  253. /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
  254. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
  255. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
  256. /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
@@ -6,6 +6,7 @@ import _typeof from "@babel/runtime/helpers/esm/typeof";
6
6
  import { useEffect } from 'react';
7
7
  import { useDeepCompareEffect, useRequest as useRequestFunc } from 'ahooks';
8
8
  import { diffCode, getEnumData, setEnumData, cacheFieldNames } from '../utils';
9
+ import locale from '../../locale';
9
10
  import '../utils/eventCenter';
10
11
  var useEnumRequest = function useEnumRequest(props, dispatch) {
11
12
  var _ref = props || {},
@@ -34,7 +35,8 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
34
35
  _ref$dics = _ref.dics,
35
36
  dics = _ref$dics === void 0 ? {} : _ref$dics;
36
37
  if (_typeof(dataSource) === 'object' && dataSource === null) {
37
- throw new Error('请传入有效的数据源');
38
+ var _locale$ProEnum;
39
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum = locale.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorDataSource);
38
40
  }
39
41
  var logDebug = function logDebug(msg) {
40
42
  if (props.debugger) {
@@ -49,7 +51,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
49
51
  }, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
50
52
  setCache: function () {
51
53
  var _setCache = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
52
- var response, _useRequest$options, ignoreCodes, cacheData;
54
+ var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
53
55
  return _regeneratorRuntime().wrap(function _callee$(_context) {
54
56
  while (1) switch (_context.prev = _context.next) {
55
57
  case 0:
@@ -66,7 +68,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
66
68
  _context.next = 9;
67
69
  break;
68
70
  }
69
- throw new Error('请返回正确的数据类型!');
71
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
70
72
  case 9:
71
73
  res.data = response;
72
74
  case 10:
@@ -98,8 +100,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
98
100
  });
99
101
  if (main) {
100
102
  setTimeout(function () {
103
+ var _locale$ProEnum3;
101
104
  window.eventCenter.publish('zat-design-pro-component-event', res.data);
102
- logDebug('主应用初始化触发从接口读取数据更新');
105
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum3 = locale.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
103
106
  }, 10000);
104
107
  }
105
108
  return _context.abrupt("return", res);
@@ -124,8 +127,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
124
127
  });
125
128
  if (main) {
126
129
  setTimeout(function () {
130
+ var _locale$ProEnum4;
127
131
  window.eventCenter.publish('zat-design-pro-component-event', res.data);
128
- logDebug('主应用初始化触发从缓存读取数据更新');
132
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
129
133
  }, 10000);
130
134
  }
131
135
  return res;
@@ -135,14 +139,15 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
135
139
  status = _res$status === void 0 ? 200 : _res$status,
136
140
  msg = res.message;
137
141
  if (status !== 200) {
138
- throw new Error('请求失败');
142
+ var _locale$ProEnum5;
143
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum5 = locale.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
139
144
  }
140
145
  }
141
146
  })),
142
147
  run = _useRequestFunc.run;
143
148
  var mergeData = /*#__PURE__*/function () {
144
149
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
145
- var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res;
150
+ var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
146
151
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
147
152
  while (1) switch (_context2.prev = _context2.next) {
148
153
  case 0:
@@ -182,7 +187,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
182
187
  _context2.next = 18;
183
188
  break;
184
189
  }
185
- throw new Error('请返回正确的数据类型!');
190
+ throw new Error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum6 = locale.ProEnum) === null || _locale$ProEnum6 === void 0 ? void 0 : _locale$ProEnum6.errorMessage);
186
191
  case 18:
187
192
  _context2.next = 21;
188
193
  break;
@@ -272,12 +277,14 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
272
277
  };
273
278
  useEffect(function () {
274
279
  if (main) {
280
+ var _locale$ProEnum7;
275
281
  window.eventCenter.publish('zat-design-pro-component-event', {});
276
- logDebug('主应用初始化触发一次');
282
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum7 = locale.ProEnum) === null || _locale$ProEnum7 === void 0 ? void 0 : _locale$ProEnum7.mainInitOnce);
277
283
  }
278
284
  if (!main && share) {
285
+ var _locale$ProEnum8;
279
286
  window.eventCenter.subscribe('zat-design-pro-component-event', shareProEnumDic);
280
- logDebug('子应用初始化监听动作');
287
+ logDebug(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum8 = locale.ProEnum) === null || _locale$ProEnum8 === void 0 ? void 0 : _locale$ProEnum8.sonInitEvent);
281
288
  }
282
289
  return function () {
283
290
  window.eventCenter.unsubscribe('zat-design-pro-component-event', shareProEnumDic);
@@ -24,6 +24,7 @@ import Container from '../ProForm/components/Container';
24
24
  import { isObject } from './utils';
25
25
  import getEnumLabel from './utils/getEnumLabel';
26
26
  import useEnum from './hooks/useEnum';
27
+ import locale from '../locale';
27
28
  import './style/index.less';
28
29
  var ProEnum = function ProEnum(props) {
29
30
  var code = props.code,
@@ -87,7 +88,8 @@ var ProEnum = function ProEnum(props) {
87
88
  if (transformResponse && typeof transformResponse === 'function') {
88
89
  var responseData = transformResponse(res);
89
90
  if (_typeof(responseData) !== 'object') {
90
- return _message.error('请返回正确的数据类型');
91
+ var _locale$ProEnum;
92
+ return _message.error((_locale$ProEnum = locale.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
91
93
  }
92
94
  setData(responseData);
93
95
  } else {
@@ -97,7 +99,8 @@ var ProEnum = function ProEnum(props) {
97
99
  data = res.data;
98
100
  if (status === 200) {
99
101
  if (_typeof(data) !== 'object') {
100
- return _message.error('请返回正确的数组类型');
102
+ var _locale$ProEnum2;
103
+ return _message.error((_locale$ProEnum2 = locale.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
101
104
  }
102
105
  if (Array.isArray(data)) {
103
106
  setData(_toConsumableArray(data));
@@ -141,7 +144,8 @@ var ProEnum = function ProEnum(props) {
141
144
  if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service) && transformResponse) {
142
145
  list = transformResponse(list);
143
146
  if (!Array.isArray(list)) {
144
- console.error('请返回有效的数组');
147
+ var _locale$ProEnum3;
148
+ console.error((_locale$ProEnum3 = locale.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.errorArrayMessage);
145
149
  list = [];
146
150
  }
147
151
  }
@@ -203,7 +207,8 @@ var ProEnum = function ProEnum(props) {
203
207
  }
204
208
  };
205
209
  if (!code && !dataSource && !useRequest) {
206
- _message.error('请传入枚举类型');
210
+ var _locale$ProEnum4;
211
+ _message.error(locale === null || locale === void 0 ? void 0 : (_locale$ProEnum4 = locale.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
207
212
  return;
208
213
  }
209
214
  var transToLabel = function transToLabel(value) {
@@ -9,7 +9,7 @@
9
9
  align-items: center;
10
10
  justify-content: center;
11
11
  margin-right: var(--zaui-space-size-sm);
12
- margin-bottom: var(--zaui-space-size-sm);
12
+ margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
13
13
  padding: var(--zaui-space-size-xs) 10px;
14
14
  background-color: #f5f5f5;
15
15
  border-radius: var(--zaui-space-size-xs);
@@ -6,6 +6,7 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { useMemo } from 'react';
8
8
  import { useProConfig } from '../../../ProConfigProvider';
9
+ import locale from '../../../locale';
9
10
  export var PRO_FORM_CACHE = 'PRO_FORM_CACHE';
10
11
  var FormFooter = function FormFooter(props) {
11
12
  var initialConfig = useProConfig('FormFooter');
@@ -49,25 +50,20 @@ var FormFooter = function FormFooter(props) {
49
50
  }
50
51
  onCancel();
51
52
  };
52
- return (
53
- // <div className="ant-form-item">
54
- _jsxs(_Space, {
55
- children: [_jsx(_Button, _objectSpread(_objectSpread({
56
- type: "primary",
57
- htmlType: onOk ? 'button' : 'submit',
58
- onClick: _onOk,
59
- disabled: confirmLoading,
60
- loading: confirmLoading
61
- }, okButtonProps), {}, {
62
- children: okChildren || okText || '查询'
63
- })), _jsx(_Button, _objectSpread(_objectSpread({
64
- onClick: _onCancel
65
- }, cancelButtonProps), {}, {
66
- children: cancelChildren || cancelText || '重置'
67
- })), children]
68
- })
69
- // </div>
70
- );
53
+ return _jsxs(_Space, {
54
+ children: [_jsx(_Button, _objectSpread(_objectSpread({
55
+ type: "primary",
56
+ htmlType: onOk ? 'button' : 'submit',
57
+ onClick: _onOk,
58
+ disabled: confirmLoading,
59
+ loading: confirmLoading
60
+ }, okButtonProps), {}, {
61
+ children: okChildren || okText || "".concat(locale.ProForm.search)
62
+ })), _jsx(_Button, _objectSpread(_objectSpread({
63
+ onClick: _onCancel
64
+ }, cancelButtonProps), {}, {
65
+ children: cancelChildren || cancelText || "".concat(locale.ProForm.reset)
66
+ })), children]
67
+ });
71
68
  };
72
-
73
69
  export default FormFooter;
@@ -4,8 +4,10 @@ import _Input from "antd/es/input";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
5
  var _excluded = ["label", "form", "placeholder", "fieldName", "otherProps"];
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { omit } from 'lodash';
7
8
  import { useProConfig } from '../../../../ProConfigProvider';
8
9
  import Container from '../../Container';
10
+ import locale from '../../../../locale';
9
11
  // 参数优先级
10
12
  // 组件内默认值 < config默认值 < props
11
13
  var Input = function Input(props) {
@@ -28,8 +30,7 @@ var Input = function Input(props) {
28
30
  return _jsx(_Input, _objectSpread(_objectSpread({
29
31
  allowClear: true,
30
32
  autoComplete: "off",
31
- placeholder: placeholder || '请输入',
32
- title: rest.value
33
- }, initialConfig), rest));
33
+ placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder)
34
+ }, omit(initialConfig, ['trim'])), rest));
34
35
  };
35
36
  export default Input;
@@ -16,6 +16,7 @@ import { isNull, isNumber, isUndefined } from 'lodash';
16
16
  import { useProConfig } from '../../../../ProConfigProvider';
17
17
  import Container from '../../Container';
18
18
  import { getDecimalDigits } from '../../../utils/index';
19
+ import locale from '../../../../locale';
19
20
  var calc = tools.calc;
20
21
  var rangeReg = /^[([](-?\d+(\.\d+)?)?,\s*(-?\d+(\.\d+)?)?[)\]]$/;
21
22
  /**
@@ -102,9 +103,9 @@ var InputNumber = function InputNumber(props) {
102
103
  var _max;
103
104
  if (range) {
104
105
  if (rest.precision === undefined) {
105
- console.warn('使用 "range" 时, 必须传入 "precision"');
106
+ console.warn('When using [range], you must pass in [precision]');
106
107
  } else if (!rangeReg.test(range)) {
107
- console.warn('"range" 格式有误, 参考: "(a, b)", "[a, b]", "(a, b]", "[a, b)"');
108
+ console.warn('" range "format is wrong, the reference:" (a, b) ", "[a, b]", "(a, b] [a, b)", "');
108
109
  } else {
109
110
  var _range$replace$split = range.replace(' ', '').split(','),
110
111
  _range$replace$split2 = _slicedToArray(_range$replace$split, 2),
@@ -240,7 +241,7 @@ var InputNumber = function InputNumber(props) {
240
241
  };
241
242
  return _jsx(_InputNumber, _objectSpread(_objectSpread(_objectSpread(_objectSpread({
242
243
  autoComplete: "off",
243
- placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label !== null && label !== void 0 ? label : ''),
244
+ placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder).concat(label !== null && label !== void 0 ? label : ''),
244
245
  className: _className
245
246
  }, valueProps), initialConfig), rest), {}, {
246
247
  onBlur: handleBlur,
@@ -50,9 +50,6 @@ var RangePicker = function RangePicker(props) {
50
50
  var _res = _objectSpread(_objectSpread({}, rest), {}, {
51
51
  showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
52
52
  });
53
- if (_res === null || _res === void 0 ? void 0 : _res.placeholder) {
54
- _res === null || _res === void 0 ? true : delete _res.placeholder;
55
- }
56
53
  // 字符串时间格式兼容
57
54
  if (Array.isArray(_res.value) && isString(_res.value[0]) && isString(_res.value[1])) {
58
55
  _res.value = [moment(_res.value[0]), moment(_res.value[1])];
@@ -6,6 +6,7 @@ var _excluded = ["dataSource", "fieldNames", "otherProps", "scrollFollowParent"]
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
7
  import Container from '../../Container';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
+ import locale from '../../../../locale';
9
10
  var Select = function Select(props) {
10
11
  var _props$dataSource = props.dataSource,
11
12
  dataSource = _props$dataSource === void 0 ? [] : _props$dataSource,
@@ -59,7 +60,7 @@ var Select = function Select(props) {
59
60
  }
60
61
  }
61
62
  return _jsx(_Select, _objectSpread(_objectSpread(_objectSpread({
62
- placeholder: "\u8BF7\u9009\u62E9",
63
+ placeholder: "".concat(locale.ProForm.selectPlaceHolder),
63
64
  allowClear: true,
64
65
  getPopupContainer: function getPopupContainer(trigger) {
65
66
  return scrollFollowParent ? trigger.parentElement : document.body;
@@ -7,6 +7,7 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
7
7
  import { isNull, isUndefined } from 'lodash';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
9
  import Container from '../../Container';
10
+ import locale from '../../../../locale';
10
11
  var Switch = function Switch(props) {
11
12
  var disabled = props.disabled,
12
13
  otherProps = props.otherProps,
@@ -24,13 +25,16 @@ var Switch = function Switch(props) {
24
25
  }
25
26
  return _jsx(Container, {
26
27
  viewEmpty: viewEmpty,
27
- children: res.checked === true ? '是' : '否'
28
+ children: res.checked === true ? "".concat(locale.ProForm.switchText[0]) : "".concat(locale.ProForm.switchText[1])
28
29
  });
29
30
  }
30
- return _jsx(_Switch, _objectSpread(_objectSpread({
31
+ return _jsx(_Switch, _objectSpread(_objectSpread(_objectSpread({
31
32
  disabled: disabled,
32
- checkedChildren: "\u662F",
33
- unCheckedChildren: "\u5426"
34
- }, config), res));
33
+ checkedChildren: "".concat(locale.ProForm.switchText[0]),
34
+ unCheckedChildren: "".concat(locale.ProForm.switchText[1])
35
+ }, config), res), {}, {
36
+ id: "switch_only" // 解决点击label联动的问题
37
+ }));
35
38
  };
39
+
36
40
  export default Switch;
@@ -6,6 +6,7 @@ var _excluded = ["onChange", "disabled", "value", "otherProps"];
6
6
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
7
7
  import { isNull, isUndefined } from 'lodash';
8
8
  import { useProConfig } from '../../../../ProConfigProvider';
9
+ import locale from '../../../../locale';
9
10
  var SwitchCheckbox = function SwitchCheckbox(props) {
10
11
  var onChange = props.onChange,
11
12
  disabled = props.disabled,
@@ -40,7 +41,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
40
41
  children: restProps.label
41
42
  }), _jsx("span", {
42
43
  className: "switch-checkbox-view-value",
43
- children: restProps.checked === true ? '是' : '否'
44
+ children: restProps.checked === true ? "".concat(locale.ProForm.switchText[0]) : "".concat(locale.ProForm.switchText[1])
44
45
  })]
45
46
  });
46
47
  }
@@ -4,8 +4,10 @@ import "antd/es/input/style";
4
4
  import _Input from "antd/es/input";
5
5
  var _excluded = ["placeholder", "otherProps", "className"];
6
6
  import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { omit } from 'lodash';
7
8
  import classnames from 'classnames';
8
9
  import { useProConfig } from '../../../../ProConfigProvider';
10
+ import locale from '../../../../locale';
9
11
  import './index.less';
10
12
  var TextArea = _Input.TextArea;
11
13
  var TextAreaDef = function TextAreaDef(props) {
@@ -31,11 +33,11 @@ var TextAreaDef = function TextAreaDef(props) {
31
33
  return _jsx(TextArea, _objectSpread(_objectSpread(_objectSpread({
32
34
  showCount: true,
33
35
  autoComplete: "off",
34
- placeholder: placeholder || "\u8BF7\u8F93\u5165".concat(label || ''),
36
+ placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder).concat(label || ''),
35
37
  autoSize: {
36
38
  minRows: 4
37
39
  }
38
- }, initialConfig), rest), {}, {
40
+ }, omit(initialConfig, ['trim'])), rest), {}, {
39
41
  disabled: disabled,
40
42
  className: _className
41
43
  }));
@@ -6,6 +6,6 @@ div.pro-textarea-view {
6
6
  }
7
7
  &::after {
8
8
  display: none;
9
- padding-bottom: 11px;
9
+ padding-bottom: 12px;
10
10
  }
11
11
  }
@@ -23,7 +23,6 @@
23
23
  min-width : 0;
24
24
  margin-left : -12px;
25
25
  margin-right : -12px;
26
- // margin-bottom: -22px;
27
26
 
28
27
  &>.ant-col {
29
28
  padding-left : 12px;
@@ -15,32 +15,31 @@ import { isFunction } from 'lodash';
15
15
  import { useMemo } from 'react';
16
16
  import { CopyOutlined, DownSquareOutlined, PlusSquareOutlined, UpSquareOutlined } from '@ant-design/icons';
17
17
  import ProIcon from '../../../../../ProIcon';
18
+ import locale from '../../../../../locale';
18
19
  var getDefaultActions = function getDefaultActions(mode) {
19
20
  var originActions = {
20
21
  add: {
21
22
  onClick: function onClick(record, _ref) {
22
23
  var namePath = _ref.namePath,
23
24
  index = _ref.index,
24
- operation = _ref.operation,
25
- form = _ref.form;
25
+ operation = _ref.operation;
26
26
  var add = operation.add;
27
27
  add(undefined, index + 1);
28
28
  },
29
29
  type: 'text',
30
- label: '新增',
30
+ label: "".concat(locale.ProForm.formList_actions[0]),
31
31
  icon: _jsx(PlusSquareOutlined, {})
32
32
  },
33
33
  delete: {
34
34
  onClick: function onClick(record, _ref2) {
35
35
  var namePath = _ref2.namePath,
36
36
  index = _ref2.index,
37
- operation = _ref2.operation,
38
- form = _ref2.form;
37
+ operation = _ref2.operation;
39
38
  var remove = operation.remove;
40
39
  remove(index);
41
40
  },
42
41
  type: 'text',
43
- label: '删除',
42
+ label: "".concat(locale.ProForm.formList_actions[1]),
44
43
  icon: mode === 'less' ? _jsx(ProIcon, {
45
44
  type: "solid-close",
46
45
  className: "single-delete"
@@ -52,39 +51,36 @@ var getDefaultActions = function getDefaultActions(mode) {
52
51
  onClick: function onClick(record, _ref3) {
53
52
  var namePath = _ref3.namePath,
54
53
  index = _ref3.index,
55
- operation = _ref3.operation,
56
- form = _ref3.form;
54
+ operation = _ref3.operation;
57
55
  var add = operation.add;
58
56
  add(record, index + 1);
59
57
  },
60
58
  type: 'text',
61
- label: '复制',
59
+ label: "".concat(locale.ProForm.formList_actions[2]),
62
60
  icon: _jsx(CopyOutlined, {})
63
61
  },
64
62
  moveUp: {
65
63
  onClick: function onClick(record, _ref4) {
66
64
  var namePath = _ref4.namePath,
67
65
  index = _ref4.index,
68
- operation = _ref4.operation,
69
- form = _ref4.form;
66
+ operation = _ref4.operation;
70
67
  var move = operation.move;
71
68
  move(index, index - 1);
72
69
  },
73
70
  type: 'text',
74
- label: '上移',
71
+ label: "".concat(locale.ProForm.formList_actions[3]),
75
72
  icon: _jsx(UpSquareOutlined, {})
76
73
  },
77
74
  moveDown: {
78
75
  onClick: function onClick(record, _ref5) {
79
76
  var namePath = _ref5.namePath,
80
77
  index = _ref5.index,
81
- operation = _ref5.operation,
82
- form = _ref5.form;
78
+ operation = _ref5.operation;
83
79
  var move = operation.move;
84
80
  move(index, index + 1);
85
81
  },
86
82
  type: 'text',
87
- label: '下移',
83
+ label: "".concat(locale.ProForm.formList_actions[4]),
88
84
  icon: _jsx(DownSquareOutlined, {})
89
85
  }
90
86
  };
@@ -192,7 +188,7 @@ var ActionButton = function ActionButton(props) {
192
188
  return false;
193
189
  }
194
190
  return _needConfirm ? _jsx(_Popconfirm, _objectSpread(_objectSpread({
195
- title: title !== null && title !== void 0 ? title : '您确定要删除该条数据吗?',
191
+ title: title !== null && title !== void 0 ? title : "".concat(locale.ProForm.formList_confirmMessage),
196
192
  onCancel: function onCancel(e) {
197
193
  return e.stopPropagation();
198
194
  },
@@ -215,7 +211,7 @@ var ActionButton = function ActionButton(props) {
215
211
  }), "".concat(item === null || item === void 0 ? void 0 : item.actionType).concat(index));
216
212
  }
217
213
  return needConfirm ? _jsx(_Popconfirm, _objectSpread(_objectSpread({
218
- title: title !== null && title !== void 0 ? title : '您确定要删除该条数据吗?',
214
+ title: title !== null && title !== void 0 ? title : "".concat(locale.ProForm.formList_confirmMessage),
219
215
  onCancel: function onCancel(e) {
220
216
  return e.stopPropagation();
221
217
  },
@@ -11,6 +11,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
11
11
  import { PlusOutlined } from '@ant-design/icons';
12
12
  import { isFunction } from 'lodash';
13
13
  import { useMemo } from 'react';
14
+ import locale from '../../../../../locale';
14
15
  var actions = {
15
16
  add: {
16
17
  onClick: function onClick(value, _ref) {
@@ -19,7 +20,7 @@ var actions = {
19
20
  namePath = _ref.namePath;
20
21
  operation.add();
21
22
  },
22
- label: '新增一行',
23
+ label: "".concat(locale.ProForm.formList_actions[5]),
23
24
  type: 'link',
24
25
  icon: _jsx(PlusOutlined, {})
25
26
  }
@@ -1,17 +1,18 @@
1
1
  .pro-form-list-block-title {
2
- height: 14px;
3
- margin: 3px 0;
4
- padding-left: 7px;
5
- font-weight: 600;
6
- line-height: 14px;
7
- border-left: 4px solid #006aff;
2
+ height : 14px;
3
+ margin : @zaui-space-size-xs 0;
4
+ padding-left: @zaui-space-size-sm;
5
+ font-weight : 600;
6
+ line-height : 14px;
7
+ border-left : 4px solid @zaui-brand;
8
8
  }
9
9
 
10
10
  .pro-form-list {
11
- display: flex;
11
+ display : flex;
12
12
  padding-bottom: 0;
13
13
 
14
14
  &.pro-form-list-last {
15
+
15
16
  .pro-form-list-drag-handle,
16
17
  .ant-form-item {
17
18
  margin-bottom: 0 !important;
@@ -19,12 +20,12 @@
19
20
  }
20
21
 
21
22
  .single-delete {
22
- width: 14px !important;
23
+ width : 14px !important;
23
24
  height: 14px !important;
24
- color: #939599;
25
+ color : @zaui-placeholder;
25
26
 
26
27
  &:hover {
27
- color: #8f8c8c;
28
+ color: @zaui-aide-text;
28
29
  }
29
30
  }
30
31
 
@@ -35,19 +36,19 @@
35
36
  .pro-form-list-action {
36
37
  padding-bottom: var(--zaui-height-size-md, 16px);
37
38
 
38
- & > .ant-space-item:first-child > .ant-btn-link {
39
- margin-left: 8px;
39
+ &>.ant-space-item:first-child>.ant-btn-link {
40
+ margin-left: @zaui-space-size-sm;
40
41
  }
41
42
  }
42
43
 
43
44
  .pro-form-list-drag-handle {
44
- display: flex;
45
- align-items: center;
46
- height: @zaui-height-size-lg;
47
- margin-bottom: 22px;
48
- padding: 0;
45
+ display : flex;
46
+ align-items : center;
47
+ height : 32px;
48
+ margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
49
+ padding : 0;
49
50
  padding-right: @zaui-space-size-sm;
50
- border: none;
51
+ border : none;
51
52
  }
52
53
  }
53
54
 
@@ -62,7 +63,7 @@
62
63
  .pro-form-list-toolbar,
63
64
  .pro-form-list-action {
64
65
  .ant-btn-link {
65
- padding: 4px 0;
66
+ padding: @zaui-space-size-xs 0;
66
67
  }
67
68
 
68
69
  .ant-btn-text:hover {
@@ -29,7 +29,7 @@ var Group = function Group(props) {
29
29
  var fieldList = [];
30
30
  var result = columns.map(function (item) {
31
31
  return _objectSpread(_objectSpread({
32
- disabled: props === null || props === void 0 ? void 0 : props.disabled
32
+ disabled: Boolean(props === null || props === void 0 ? void 0 : props.disabled)
33
33
  }, item), {}, {
34
34
  noStyle: (space === null || space === void 0 ? void 0 : space.compact) || (space === null || space === void 0 ? void 0 : space.separator),
35
35
  parentNames: _parentNames
@@ -43,7 +43,7 @@ var Group = function Group(props) {
43
43
  columns: insertSeparator(result, space, node, otherProps),
44
44
  fieldList: fieldList
45
45
  };
46
- }, [name, columns, space]);
46
+ }, [name, columns, space, props]);
47
47
  var _className = classnames(_defineProperty({
48
48
  'pro-group': true,
49
49
  'pro-group-diy-width': columns.some(function (item) {