@zat-design/sisyphus-react 3.1.5-beta.9 → 3.2.0-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 (151) hide show
  1. package/dist/index.esm.css +62 -4
  2. package/es/ProAction/index.js +7 -5
  3. package/es/ProConfigProvider/index.js +6 -1
  4. package/es/ProDownload/utils.js +4 -3
  5. package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
  6. package/es/ProDrawerForm/index.js +4 -4
  7. package/es/ProEditTable/components/ActionButton/index.js +3 -2
  8. package/es/ProEditTable/components/RenderField/index.js +2 -1
  9. package/es/ProEditTable/index.js +7 -6
  10. package/es/ProEditTable/utils/config.d.ts +8 -8
  11. package/es/ProEditTable/utils/config.js +9 -8
  12. package/es/ProEditTable/utils/index.js +3 -2
  13. package/es/ProEnum/hooks/useEnumRequest.js +17 -10
  14. package/es/ProEnum/index.js +9 -4
  15. package/es/ProForm/components/FormFooter/index.js +16 -20
  16. package/es/ProForm/components/base/Input/index.js +4 -3
  17. package/es/ProForm/components/base/InputNumber/index.js +4 -3
  18. package/es/ProForm/components/base/Select/index.js +2 -1
  19. package/es/ProForm/components/base/Switch/index.js +9 -5
  20. package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  21. package/es/ProForm/components/base/TextArea/index.js +4 -2
  22. package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  23. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  24. package/es/ProForm/components/combination/Group/index.js +2 -2
  25. package/es/ProForm/components/combination/ProAddressBar/index.js +5 -5
  26. package/es/ProForm/components/combination/ProModalSelect/index.js +3 -4
  27. package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
  28. package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  29. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  30. package/es/ProForm/components/combination/ProTimeLimit/style/index.less +17 -0
  31. package/es/ProForm/components/render/Render.js +4 -2
  32. package/es/ProForm/components/render/RenderFields.js +6 -4
  33. package/es/ProForm/index.js +14 -2
  34. package/es/ProForm/style/index.less +65 -35
  35. package/es/ProForm/utils/index.d.ts +1 -1
  36. package/es/ProForm/utils/index.js +7 -2
  37. package/es/ProForm/utils/rulesCreator.js +2 -1
  38. package/es/ProForm/utils/useRules.js +4 -3
  39. package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  40. package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +6 -7
  41. package/es/ProLayout/components/Layout/Notice/index.js +3 -2
  42. package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  43. package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -1
  44. package/es/ProLayout/components/ProHeader/index.js +5 -4
  45. package/es/ProLayout/components/ProHeader/style/index.less +1 -1
  46. package/es/ProLayout/utils/index.js +1 -1
  47. package/es/ProSelect/index.d.ts +3 -3
  48. package/es/ProSelect/index.js +4 -2
  49. package/es/ProStep/components/Step/index.js +3 -1
  50. package/es/ProTable/index.js +7 -6
  51. package/es/ProTable/useAntdTable.d.ts +12 -4
  52. package/es/ProTable/useAntdTable.js +18 -6
  53. package/es/ProTree/components/ProTree.js +5 -4
  54. package/es/ProTree/components/Tree.js +3 -1
  55. package/es/ProTreeModal/components/List.js +0 -14
  56. package/es/ProTreeModal/components/Trigger.js +9 -3
  57. package/es/ProTreeModal/index.js +29 -13
  58. package/es/ProUpload/components/ButtonRender.js +5 -2
  59. package/es/ProUpload/components/DragRender.js +8 -8
  60. package/es/ProUpload/components/Example.js +3 -1
  61. package/es/ProUpload/components/ImageRender.js +8 -6
  62. package/es/ProUpload/index.js +8 -6
  63. package/es/locale/en_US.d.ts +123 -54
  64. package/es/locale/en_US.js +130 -61
  65. package/es/locale/index.d.ts +6 -0
  66. package/es/locale/index.js +11 -0
  67. package/es/locale/zh_CN.d.ts +122 -54
  68. package/es/locale/zh_CN.js +128 -60
  69. package/es/style/core/normalize.less +0 -1
  70. package/lib/ProAction/index.js +7 -5
  71. package/lib/ProConfigProvider/index.js +6 -1
  72. package/lib/ProDownload/utils.js +4 -3
  73. package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
  74. package/lib/ProDrawerForm/index.js +4 -4
  75. package/lib/ProEditTable/components/ActionButton/index.js +3 -2
  76. package/lib/ProEditTable/components/RenderField/index.js +2 -1
  77. package/lib/ProEditTable/index.js +7 -6
  78. package/lib/ProEditTable/utils/config.d.ts +8 -8
  79. package/lib/ProEditTable/utils/config.js +9 -8
  80. package/lib/ProEditTable/utils/index.js +3 -2
  81. package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
  82. package/lib/ProEnum/index.js +9 -4
  83. package/lib/ProForm/components/FormFooter/index.js +16 -19
  84. package/lib/ProForm/components/base/Input/index.js +4 -3
  85. package/lib/ProForm/components/base/InputNumber/index.js +4 -3
  86. package/lib/ProForm/components/base/Select/index.js +2 -1
  87. package/lib/ProForm/components/base/Switch/index.js +8 -5
  88. package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
  89. package/lib/ProForm/components/base/TextArea/index.js +4 -2
  90. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
  91. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
  92. package/lib/ProForm/components/combination/Group/index.js +2 -2
  93. package/lib/ProForm/components/combination/ProAddressBar/index.js +5 -5
  94. package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -4
  95. package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
  96. package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
  97. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
  98. package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +17 -0
  99. package/lib/ProForm/components/render/Render.js +4 -2
  100. package/lib/ProForm/components/render/RenderFields.js +5 -3
  101. package/lib/ProForm/index.js +14 -2
  102. package/lib/ProForm/style/index.less +65 -35
  103. package/lib/ProForm/utils/index.d.ts +1 -1
  104. package/lib/ProForm/utils/index.js +7 -2
  105. package/lib/ProForm/utils/rulesCreator.js +2 -1
  106. package/lib/ProForm/utils/useRules.js +4 -3
  107. package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
  108. package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +6 -7
  109. package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
  110. package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
  111. package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +3 -1
  112. package/lib/ProLayout/components/ProHeader/index.js +5 -4
  113. package/lib/ProLayout/components/ProHeader/style/index.less +1 -1
  114. package/lib/ProLayout/utils/index.js +1 -1
  115. package/lib/ProSelect/index.d.ts +3 -3
  116. package/lib/ProSelect/index.js +4 -2
  117. package/lib/ProStep/components/Step/index.js +3 -1
  118. package/lib/ProTable/index.js +7 -6
  119. package/lib/ProTable/useAntdTable.d.ts +12 -4
  120. package/lib/ProTable/useAntdTable.js +19 -6
  121. package/lib/ProTree/components/ProTree.js +5 -4
  122. package/lib/ProTree/components/Tree.js +3 -1
  123. package/lib/ProTreeModal/components/List.js +0 -14
  124. package/lib/ProTreeModal/components/Trigger.js +10 -3
  125. package/lib/ProTreeModal/index.js +29 -13
  126. package/lib/ProUpload/components/ButtonRender.js +5 -2
  127. package/lib/ProUpload/components/DragRender.js +8 -8
  128. package/lib/ProUpload/components/Example.js +3 -1
  129. package/lib/ProUpload/components/ImageRender.js +8 -6
  130. package/lib/ProUpload/index.js +8 -6
  131. package/lib/locale/en_US.d.ts +123 -54
  132. package/lib/locale/en_US.js +130 -61
  133. package/lib/locale/index.d.ts +6 -0
  134. package/lib/locale/index.js +14 -1
  135. package/lib/locale/zh_CN.d.ts +122 -54
  136. package/lib/locale/zh_CN.js +128 -60
  137. package/lib/style/core/normalize.less +0 -1
  138. package/package.json +1 -1
  139. package/.dumi/theme/builtins/Alert.tsx +0 -19
  140. package/.dumi/theme/builtins/Previewer.tsx +0 -232
  141. package/.dumi/theme/builtins/SourceCode.tsx +0 -64
  142. package/.dumi/theme/hooks/useCodeSandbox.tsx +0 -197
  143. package/.dumi/theme/hooks/useTheme.tsx +0 -707
  144. package/.dumi/theme/layouts/BasicLayout.tsx +0 -88
  145. package/.dumi/theme/layouts/components/Dark.less +0 -157
  146. package/.dumi/theme/layouts/components/Dark.tsx +0 -78
  147. package/.dumi/theme/layouts/components/Navbar.tsx +0 -83
  148. package/.dumi/theme/layouts/components/SideMenu.tsx +0 -61
  149. package/.dumi/theme/layouts/index.tsx +0 -26
  150. package/.dumi/theme/layouts/layout.less +0 -87
  151. package/.dumi/theme/typings.d.ts +0 -7
@@ -331,8 +331,7 @@
331
331
  line-height: initial !important;
332
332
  height: auto !important;
333
333
  margin: 0;
334
- padding-top: 12px;
335
- padding-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1) - var(--zaui-space-size-xs, 4px) * var(--zaui-size, 1));
334
+ padding-top: 12px 0;
336
335
  min-height: 48px;
337
336
  }
338
337
  .pro-layout-open-menu .ant-menu-title-content div {
@@ -818,7 +817,7 @@
818
817
  }
819
818
  .pro-header {
820
819
  background-color: var(--zaui-base-bg, #ffffff);
821
- padding: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1) + var(--zaui-space-size-sm, 8px) * var(--zaui-size, 1)) 0 0 0;
820
+ padding: 24px 0 0 0;
822
821
  }
823
822
  .pro-header.pro-header-no-back .pro-header-top {
824
823
  padding-left: 0;
@@ -1991,6 +1990,29 @@ div.pro-textarea-view::after {
1991
1990
  -webkit-box-shadow: 0 0 0 2px var(--ant-error-color-outline);
1992
1991
  box-shadow: 0 0 0 2px var(--ant-error-color-outline);
1993
1992
  }
1993
+ span.ant-input-group-compact.pro-time-limit,
1994
+ span.ant-input-group-compact.pro-range-limit {
1995
+ display: -webkit-box;
1996
+ display: -webkit-flex;
1997
+ display: -ms-flexbox;
1998
+ display: flex;
1999
+ }
2000
+ span.ant-input-group-compact.pro-time-limit .ant-picker,
2001
+ span.ant-input-group-compact.pro-range-limit .ant-picker {
2002
+ -webkit-box-flex: 1;
2003
+ -webkit-flex: 1;
2004
+ -ms-flex: 1;
2005
+ flex: 1;
2006
+ }
2007
+ span.ant-input-group-compact.pro-time-limit .forever-checkbox,
2008
+ span.ant-input-group-compact.pro-range-limit .forever-checkbox {
2009
+ -webkit-box-flex: 0;
2010
+ -webkit-flex: 0;
2011
+ -ms-flex: 0;
2012
+ flex: 0;
2013
+ min-width: unset;
2014
+ white-space: nowrap;
2015
+ }
1994
2016
  .pro-address {
1995
2017
  display: -webkit-box;
1996
2018
  display: -webkit-flex;
@@ -2382,6 +2404,31 @@ div.pro-textarea-view::after {
2382
2404
  .pro-enum-select-modal .ant-modal-footer {
2383
2405
  padding: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
2384
2406
  }
2407
+ .pro-form.ant-form-vertical .ant-form-item .ant-form-item-label {
2408
+ -webkit-box-flex: 0 !important;
2409
+ -webkit-flex: none !important;
2410
+ -ms-flex: none !important;
2411
+ flex: none !important;
2412
+ }
2413
+ .pro-form.ant-form-vertical .pro-form-custom-footer {
2414
+ display: -webkit-box;
2415
+ display: -webkit-flex;
2416
+ display: -ms-flexbox;
2417
+ display: flex;
2418
+ -webkit-box-align: center;
2419
+ -webkit-align-items: center;
2420
+ -ms-flex-align: center;
2421
+ align-items: center;
2422
+ margin-bottom: 0;
2423
+ height: auto;
2424
+ padding-top: 6px;
2425
+ }
2426
+ .pro-form.ant-form-vertical .pro-form-custom-footer .ant-space-align-center {
2427
+ -webkit-box-align: normal;
2428
+ -webkit-align-items: normal;
2429
+ -ms-flex-align: normal;
2430
+ align-items: normal;
2431
+ }
2385
2432
  .pro-form.ant-form {
2386
2433
  margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
2387
2434
  }
@@ -2437,6 +2484,18 @@ div.pro-textarea-view::after {
2437
2484
  .pro-form .ant-form-item {
2438
2485
  margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1)) !important;
2439
2486
  }
2487
+ .pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input {
2488
+ -webkit-box-flex: inherit;
2489
+ -webkit-flex-grow: inherit;
2490
+ -ms-flex-positive: inherit;
2491
+ flex-grow: inherit;
2492
+ }
2493
+ .pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input-content {
2494
+ -webkit-box-flex: initial;
2495
+ -webkit-flex: initial;
2496
+ -ms-flex: initial;
2497
+ flex: initial;
2498
+ }
2440
2499
  .pro-form .ant-form-item .ant-form-item-tooltip svg {
2441
2500
  width: 14px;
2442
2501
  height: 14px;
@@ -4692,7 +4751,6 @@ samp {
4692
4751
  font-family: monospace, sans-serif;
4693
4752
  }
4694
4753
  .clickable,
4695
- label,
4696
4754
  input[type='button'],
4697
4755
  input[type='submit'],
4698
4756
  input[type='file'],
@@ -11,9 +11,10 @@ import React from 'react';
11
11
  import { useSetState } from 'ahooks';
12
12
  import { isFunction } from 'lodash';
13
13
  import { ProDrawerForm } from '../index';
14
+ import locale from '../locale';
14
15
  import './index.less';
15
16
  var ProAction = function ProAction(props) {
16
- var _config$, _config$2, _config$index;
17
+ var _config$, _config$2, _locale$ProAction2, _config$index;
17
18
  var children = props.children,
18
19
  config = props.config;
19
20
  var _Form$useForm = _Form.useForm(),
@@ -29,7 +30,8 @@ var ProAction = function ProAction(props) {
29
30
  state = _useSetState2[0],
30
31
  setState = _useSetState2[1];
31
32
  if (!config || !Array.isArray(config)) {
32
- console.error('ProAction 配置 config 必须为数据');
33
+ var _locale$ProAction;
34
+ console.error(locale === null || locale === void 0 ? void 0 : (_locale$ProAction = locale.ProAction) === null || _locale$ProAction === void 0 ? void 0 : _locale$ProAction.errorMessage);
33
35
  return _jsx(_Fragment, {
34
36
  children: children
35
37
  });
@@ -66,7 +68,7 @@ var ProAction = function ProAction(props) {
66
68
  options = _ref2.options;
67
69
  transformResponse = _ref2.transformResponse;
68
70
  _context.next = 14;
69
- return service === null || service === void 0 ? void 0 : service(options);
71
+ return service === null || service === void 0 ? void 0 : service(options === null || options === void 0 ? void 0 : options.defaultParams);
70
72
  case 14:
71
73
  _context.t1 = _context.sent;
72
74
  if (_context.t1) {
@@ -92,7 +94,7 @@ var ProAction = function ProAction(props) {
92
94
  newServicesArray[currentIndex] = res.data;
93
95
  }
94
96
  case 26:
95
- options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, newServicesArray[currentIndex], options.defaultParams);
97
+ options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, newServicesArray[currentIndex], options === null || options === void 0 ? void 0 : options.defaultParams);
96
98
  if (!service) {
97
99
  newServicesArray[currentIndex] = null;
98
100
  }
@@ -166,7 +168,7 @@ var ProAction = function ProAction(props) {
166
168
  onConfirm: function onConfirm() {
167
169
  return onActionRun(0, []);
168
170
  },
169
- title: ((_config$2 = config[0]) === null || _config$2 === void 0 ? void 0 : _config$2.title) || '确认删除吗?',
171
+ title: ((_config$2 = config[0]) === null || _config$2 === void 0 ? void 0 : _config$2.title) || (locale === null || locale === void 0 ? void 0 : (_locale$ProAction2 = locale.ProAction) === null || _locale$ProAction2 === void 0 ? void 0 : _locale$ProAction2.defaultTitle),
170
172
  children: children
171
173
  }) : ChildContent, state.open ? _jsx(ProDrawerForm, {
172
174
  open: state.open,
@@ -22,6 +22,11 @@ export function useProConfig(name) {
22
22
  var config = useContext(ProConfigContext);
23
23
  return name ? config.state[name] : config;
24
24
  }
25
+ var antdLangMap = {
26
+ 'zh-CN': zhCN,
27
+ 'en-US': enUS // en-US
28
+ };
29
+
25
30
  var reducer = function reducer(state, action) {
26
31
  var _state$ProEnum;
27
32
  switch (action.type) {
@@ -62,7 +67,7 @@ export var ProConfigProvider = function ProConfigProvider(props) {
62
67
  dispatch: dispatch
63
68
  },
64
69
  children: _jsx(_ConfigProvider, {
65
- locale: lang === 'en-US' ? enUS : zhCN,
70
+ locale: antdLangMap[lang],
66
71
  children: _jsxs("div", {
67
72
  children: [" ", props.children]
68
73
  })
@@ -7,6 +7,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
7
7
  /* eslint-disable no-empty */
8
8
  /* eslint-disable prefer-promise-reject-errors */
9
9
  import { isFunction, get } from 'lodash';
10
+ import locale from '../locale';
10
11
  var stringify = function stringify(data) {
11
12
  var result = '';
12
13
  if (data && Object.keys(data).length) {
@@ -111,8 +112,8 @@ export var DownloadRequest = /*#__PURE__*/function () {
111
112
  _context.next = 7;
112
113
  break;
113
114
  }
114
- _message.error('请求失败!');
115
- return _context.abrupt("return", Promise.reject('请求失败!'));
115
+ _message.error("".concat(locale.ProDownload.errorMessage));
116
+ return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
116
117
  case 7:
117
118
  if (!((_data === null || _data === void 0 ? void 0 : _data.status) > 200 || (_data === null || _data === void 0 ? void 0 : _data.code) === 401)) {
118
119
  _context.next = 11;
@@ -140,7 +141,7 @@ export var DownloadRequest = /*#__PURE__*/function () {
140
141
  }
141
142
  return _context.abrupt("return", Promise.resolve(response));
142
143
  case 20:
143
- return _context.abrupt("return", Promise.reject('请求失败!'));
144
+ return _context.abrupt("return", Promise.reject("".concat(locale.ProDownload.errorMessage)));
144
145
  case 21:
145
146
  case "end":
146
147
  return _context.stop();
@@ -14,6 +14,7 @@ import { useScroll } from 'ahooks';
14
14
  import { isArray } from 'lodash';
15
15
  import { ReactSVG } from 'react-svg';
16
16
  import closeSvg from '../../../assets/close.svg';
17
+ import locale from '../../../locale';
17
18
  /**
18
19
  * 抽屉组件
19
20
  */
@@ -46,6 +47,7 @@ var ProDrawer = function ProDrawer(_ref) {
46
47
  toggleLoading = _useState2[1];
47
48
  var noRenderFooter = isView || footer === false || footer === null;
48
49
  var onConfirm = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
50
+ var _locale$ProDrawerForm, _locale$ProDrawerForm2, _locale$ProDrawerForm3, _locale$ProDrawerForm4;
49
51
  return _regeneratorRuntime().wrap(function _callee$(_context) {
50
52
  while (1) switch (_context.prev = _context.next) {
51
53
  case 0:
@@ -54,10 +56,10 @@ var ProDrawer = function ProDrawer(_ref) {
54
56
  } else if (!modalRef.current) {
55
57
  modalRef.current = _Modal.confirm(_objectSpread({
56
58
  className: 'width430',
57
- title: '确认关闭当前页面',
58
- okText: '确定',
59
- cancelText: '取消',
60
- content: '关闭当前页面内容不会被保存,需要点击“保存”按钮进行保存',
59
+ title: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.isSureClose,
60
+ okText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm,
61
+ cancelText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
62
+ content: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm4 = locale.ProDrawerForm) === null || _locale$ProDrawerForm4 === void 0 ? void 0 : _locale$ProDrawerForm4.secondTipsWhenSave,
61
63
  onOk: function onOk() {
62
64
  onCancel && onCancel();
63
65
  },
@@ -1,6 +1,6 @@
1
1
  import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
2
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
- var _locale$common2;
3
+ var _locale$ProDrawerForm3;
4
4
  import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
5
5
  import { forwardRef, useEffect, useImperativeHandle, useMemo } from 'react';
6
6
  import { ProDrawer, ProModal } from './components';
@@ -8,7 +8,7 @@ import ProForm from '../ProForm';
8
8
  import { transformBySize } from './utils';
9
9
  import locale from '../locale';
10
10
  var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
11
- var _okText, _locale$common;
11
+ var _okText, _locale$ProDrawerForm, _locale$ProDrawerForm2;
12
12
  var visible = props.visible,
13
13
  showType = props.showType,
14
14
  okText = props.okText,
@@ -23,7 +23,7 @@ var ProDrawerForm = /*#__PURE__*/forwardRef(function (props, ref) {
23
23
  children = props.children;
24
24
  showType = mode || showType;
25
25
  isView = isView || disabled;
26
- okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ? locale === null || locale === void 0 ? void 0 : (_locale$common = locale.common) === null || _locale$common === void 0 ? void 0 : _locale$common.save : locale === null || locale === void 0 ? void 0 : locale.dialog.confirm;
26
+ okText = (_okText = okText) !== null && _okText !== void 0 ? _okText : showType === 'Drawer' ? locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm = locale.ProDrawerForm) === null || _locale$ProDrawerForm === void 0 ? void 0 : _locale$ProDrawerForm.save : locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm2 = locale.ProDrawerForm) === null || _locale$ProDrawerForm2 === void 0 ? void 0 : _locale$ProDrawerForm2.confirm;
27
27
  visible = open !== null && open !== void 0 ? open : visible;
28
28
  var width = props.width;
29
29
  if (!width && size) {
@@ -85,7 +85,7 @@ ProDrawerForm.defaultProps = {
85
85
  size: 'middle',
86
86
  isConfirmClose: true,
87
87
  maskClosable: false,
88
- cancelText: locale === null || locale === void 0 ? void 0 : (_locale$common2 = locale.common) === null || _locale$common2 === void 0 ? void 0 : _locale$common2.cancel,
88
+ cancelText: locale === null || locale === void 0 ? void 0 : (_locale$ProDrawerForm3 = locale.ProDrawerForm) === null || _locale$ProDrawerForm3 === void 0 ? void 0 : _locale$ProDrawerForm3.cancel,
89
89
  proFormProps: {}
90
90
  };
91
91
  export default ProDrawerForm;
@@ -7,6 +7,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
7
7
  import React from 'react';
8
8
  import { isFunction, omit } from 'lodash';
9
9
  import { iconMap } from '../../utils/config';
10
+ import locale from '../../../locale';
10
11
  // 渲染操作按钮
11
12
  var ActionButton = function ActionButton(_ref) {
12
13
  var _editingKeys$includes, _btnConfig$buttonProp, _btnConfig$buttonProp2, _btnConfig$buttonProp3, _btnConfig$icon;
@@ -79,8 +80,8 @@ var ActionButton = function ActionButton(_ref) {
79
80
  btnConfig.onEvent(record, index);
80
81
  },
81
82
  disabled: isDisabled,
82
- okText: "\u786E\u8BA4",
83
- cancelText: "\u53D6\u6D88",
83
+ okText: locale.ProEditTable.confirm,
84
+ cancelText: locale.ProEditTable.cancel,
84
85
  children: /*#__PURE__*/React.isValidElement(btnConfig.label) ? /*#__PURE__*/React.cloneElement(btnConfig.label, _objectSpread(_objectSpread({}, omit(delBtnProps, ['buttonProps', 'isEditable'])), {}, {
85
86
  record: record,
86
87
  index: index,
@@ -20,6 +20,7 @@ import transformNames from '../../../ProForm/utils/transformNames';
20
20
  import { FieldProvider } from '../../../ProForm/utils/useFieldProps';
21
21
  import useRules from '../../../ProForm/utils/useRules';
22
22
  import { isSelect } from '../../../ProForm/utils';
23
+ import locale from '../../../locale';
23
24
  var RenderField = function RenderField(_ref) {
24
25
  var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
25
26
  var value = _ref.text,
@@ -218,7 +219,7 @@ var RenderField = function RenderField(_ref) {
218
219
  TargetComponent = viewRender;
219
220
  }
220
221
  }
221
- var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "\u8BF7\u9009\u62E9".concat(isString(label) ? label || title : '') : "\u8BF7\u8F93\u5165".concat(isString(label) ? label || title : '');
222
+ var defaultPlaceholder = ['Select', 'EnumSelect', 'DatePicker', 'RangePicker', 'Cascader', 'ProSelect', 'ProEnum', 'ProTimeLimit'].includes(type) ? "".concat(locale.ProEditTable.select).concat(isString(label) ? label || title : '') : "".concat(locale.ProEditTable.enter).concat(isString(label) ? label || title : '');
222
223
  var _placeholder = (_formItemChildProps$p = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.placeholder) !== null && _formItemChildProps$p !== void 0 ? _formItemChildProps$p : defaultPlaceholder;
223
224
  var onChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onChange;
224
225
  var onFieldChange = formItemChildProps === null || formItemChildProps === void 0 ? void 0 : formItemChildProps.onFieldChange;
@@ -20,6 +20,7 @@ import { transformColumns } from './utils';
20
20
  import { getRandom, getNamePath } from './utils/tools';
21
21
  import { DndWrapper, Row, Validator, Summary, RenderToolbar } from './components';
22
22
  import Empty from '../assets/empty.png';
23
+ import locale from '../locale';
23
24
  var ProEditTable = function ProEditTable(_ref, ref) {
24
25
  var _resetProps$id, _resetProps$id$split, _value$2;
25
26
  var value = _ref.value,
@@ -171,8 +172,8 @@ var ProEditTable = function ProEditTable(_ref, ref) {
171
172
  src: Empty
172
173
  }), _jsx("div", {
173
174
  className: "content",
174
- children: disabled || isForbiddenBtn('add') ? '暂无数据' : _jsxs(_Fragment, {
175
- children: ["\u6682\u65E0\u6570\u636E\uFF0C", _jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
175
+ children: disabled || isForbiddenBtn('add') ? locale.ProEditTable.noData : _jsxs(_Fragment, {
176
+ children: [locale.ProEditTable.noData, "\uFF0C", _jsx(RenderToolbar, _objectSpread({}, _objectSpread(_objectSpread({}, config), {}, {
176
177
  toolbarProps: toolbarProps === null || toolbarProps === void 0 ? void 0 : (_toolbarProps$filter = toolbarProps.filter) === null || _toolbarProps$filter === void 0 ? void 0 : _toolbarProps$filter.call(toolbarProps, function (item) {
177
178
  return item.type === 'add';
178
179
  }),
@@ -321,9 +322,9 @@ ForwardProEditTable.defaultProps = {
321
322
  disabled: false,
322
323
  draggable: false,
323
324
  stripe: true,
324
- emptyBtnText: '点击添加',
325
- onlyOneLineMsg: '请先保存数据',
326
- deletePoConfirmMsg: '您确定要删除该行数据吗?',
327
- mulDeletePoConfirmMsg: '您确定要删除选中的数据吗?'
325
+ emptyBtnText: locale.ProEditTable.clickAdd,
326
+ onlyOneLineMsg: locale.ProEditTable.onlyOneLineMsg,
327
+ deletePoConfirmMsg: locale.ProEditTable.deletePoConfirmMsg,
328
+ mulDeletePoConfirmMsg: locale.ProEditTable.mulDeletePoConfirmMsg
328
329
  };
329
330
  export default ForwardProEditTable;
@@ -1,12 +1,12 @@
1
1
  export declare const defaultBtnNameMap: {
2
- add: string;
3
- edit: string;
4
- copy: string;
5
- delete: string;
6
- mulDelete: string;
7
- save: string;
8
- cancel: string;
9
- custom: string;
2
+ add: any;
3
+ edit: any;
4
+ copy: any;
5
+ delete: any;
6
+ mulDelete: any;
7
+ save: any;
8
+ cancel: any;
9
+ custom: any;
10
10
  };
11
11
  export declare const iconMap: {
12
12
  add: JSX.Element;
@@ -9,15 +9,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
9
9
  import { PlusOutlined } from '@ant-design/icons';
10
10
  import { set } from 'lodash';
11
11
  import { onDelete, getRandom } from './tools';
12
+ import locale from '../../locale';
12
13
  export var defaultBtnNameMap = {
13
- add: '添加',
14
- edit: '编辑',
15
- copy: '复制',
16
- delete: '删除',
17
- mulDelete: '删除',
18
- save: '保存',
19
- cancel: '取消',
20
- custom: '自定义'
14
+ add: locale.ProEditTable.add,
15
+ edit: locale.ProEditTable.edit,
16
+ copy: locale.ProEditTable.copy,
17
+ delete: locale.ProEditTable.delete,
18
+ mulDelete: locale.ProEditTable.mulDelete,
19
+ save: locale.ProEditTable.save,
20
+ cancel: locale.ProEditTable.cancel,
21
+ custom: locale.ProEditTable.custom
21
22
  };
22
23
  // 默认按钮配置
23
24
  export var iconMap = {
@@ -22,6 +22,7 @@ import { customValidate, getNamePath, splitNames } from './tools';
22
22
  import ProTooltip from '../../ProTooltip';
23
23
  import { RenderField, ActionButton } from '../components';
24
24
  import tipSvg from '../../assets/tip.svg';
25
+ import locale from '../../locale';
25
26
  // 渲染操作栏
26
27
  var getActionColumn = function getActionColumn(config) {
27
28
  var disabled = config.disabled,
@@ -141,7 +142,7 @@ var getActionColumn = function getActionColumn(config) {
141
142
  return action;
142
143
  });
143
144
  return {
144
- title: '操作',
145
+ title: locale.ProEditTable.operation,
145
146
  key: 'action',
146
147
  fixed: 'right',
147
148
  width: actionWidth || (virtualKey ? '120px' : '60px'),
@@ -341,7 +342,7 @@ export var transformColumns = function transformColumns() {
341
342
  if (disabled || isView) {
342
343
  // 查看模式下过滤操作栏
343
344
  _columns = _columns.filter(function (item) {
344
- return item.title !== '操作';
345
+ return item.title !== locale.ProEditTable.operation;
345
346
  });
346
347
  } else {
347
348
  var validateKeys = _columns.filter(function (i) {
@@ -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) {
@@ -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;