@zat-design/sisyphus-react 3.1.5-beta.9 → 3.2.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.
- package/dist/index.esm.css +60 -1
- package/es/ProAction/index.js +7 -5
- package/es/ProConfigProvider/index.js +6 -1
- package/es/ProDownload/utils.js +4 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/es/ProDrawerForm/index.js +4 -4
- package/es/ProEditTable/components/ActionButton/index.js +3 -2
- package/es/ProEditTable/components/RenderField/index.js +2 -1
- package/es/ProEditTable/index.js +7 -6
- package/es/ProEditTable/utils/config.d.ts +8 -8
- package/es/ProEditTable/utils/config.js +9 -8
- package/es/ProEditTable/utils/index.js +3 -2
- package/es/ProEnum/hooks/useEnumRequest.js +17 -10
- package/es/ProEnum/index.js +9 -4
- package/es/ProForm/components/FormFooter/index.js +16 -20
- package/es/ProForm/components/base/Input/index.js +4 -3
- package/es/ProForm/components/base/InputNumber/index.js +4 -3
- package/es/ProForm/components/base/Select/index.js +2 -1
- package/es/ProForm/components/base/Switch/index.js +9 -5
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +5 -5
- package/es/ProForm/components/combination/ProModalSelect/index.js +3 -4
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +17 -0
- package/es/ProForm/components/render/Render.js +4 -2
- package/es/ProForm/components/render/RenderFields.js +6 -4
- package/es/ProForm/index.js +14 -2
- package/es/ProForm/style/index.less +65 -35
- package/es/ProForm/utils/index.d.ts +1 -1
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/es/ProLayout/components/Layout/Notice/index.js +3 -2
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +5 -4
- package/es/ProLayout/utils/index.js +1 -1
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/index.js +4 -2
- package/es/ProStep/components/Step/index.js +3 -1
- package/es/ProTable/index.js +7 -6
- package/es/ProTable/useAntdTable.d.ts +12 -4
- package/es/ProTable/useAntdTable.js +18 -6
- package/es/ProTree/components/ProTree.js +5 -4
- package/es/ProTree/components/Tree.js +3 -1
- package/es/ProTreeModal/components/List.js +0 -14
- package/es/ProTreeModal/components/Trigger.js +9 -3
- package/es/ProTreeModal/index.js +29 -13
- package/es/ProUpload/components/ButtonRender.js +5 -2
- package/es/ProUpload/components/DragRender.js +8 -8
- package/es/ProUpload/components/Example.js +3 -1
- package/es/ProUpload/components/ImageRender.js +8 -6
- package/es/ProUpload/index.js +8 -6
- package/es/locale/en_US.d.ts +123 -54
- package/es/locale/en_US.js +130 -61
- package/es/locale/index.d.ts +6 -0
- package/es/locale/index.js +11 -0
- package/es/locale/zh_CN.d.ts +122 -54
- package/es/locale/zh_CN.js +128 -60
- package/es/style/core/normalize.less +0 -1
- package/lib/ProAction/index.js +7 -5
- package/lib/ProConfigProvider/index.js +6 -1
- package/lib/ProDownload/utils.js +4 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/lib/ProDrawerForm/index.js +4 -4
- package/lib/ProEditTable/components/ActionButton/index.js +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +2 -1
- package/lib/ProEditTable/index.js +7 -6
- package/lib/ProEditTable/utils/config.d.ts +8 -8
- package/lib/ProEditTable/utils/config.js +9 -8
- package/lib/ProEditTable/utils/index.js +3 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
- package/lib/ProEnum/index.js +9 -4
- package/lib/ProForm/components/FormFooter/index.js +16 -19
- package/lib/ProForm/components/base/Input/index.js +4 -3
- package/lib/ProForm/components/base/InputNumber/index.js +4 -3
- package/lib/ProForm/components/base/Select/index.js +2 -1
- package/lib/ProForm/components/base/Switch/index.js +8 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +5 -5
- package/lib/ProForm/components/combination/ProModalSelect/index.js +3 -4
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +17 -0
- package/lib/ProForm/components/render/Render.js +4 -2
- package/lib/ProForm/components/render/RenderFields.js +5 -3
- package/lib/ProForm/index.js +14 -2
- package/lib/ProForm/style/index.less +65 -35
- package/lib/ProForm/utils/index.d.ts +1 -1
- package/lib/ProForm/utils/index.js +7 -2
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/index.js +3 -1
- package/lib/ProLayout/components/ProHeader/index.js +5 -4
- package/lib/ProLayout/utils/index.js +1 -1
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/index.js +4 -2
- package/lib/ProStep/components/Step/index.js +3 -1
- package/lib/ProTable/index.js +7 -6
- package/lib/ProTable/useAntdTable.d.ts +12 -4
- package/lib/ProTable/useAntdTable.js +19 -6
- package/lib/ProTree/components/ProTree.js +5 -4
- package/lib/ProTree/components/Tree.js +3 -1
- package/lib/ProTreeModal/components/List.js +0 -14
- package/lib/ProTreeModal/components/Trigger.js +10 -3
- package/lib/ProTreeModal/index.js +29 -13
- package/lib/ProUpload/components/ButtonRender.js +5 -2
- package/lib/ProUpload/components/DragRender.js +8 -8
- package/lib/ProUpload/components/Example.js +3 -1
- package/lib/ProUpload/components/ImageRender.js +8 -6
- package/lib/ProUpload/index.js +8 -6
- package/lib/locale/en_US.d.ts +123 -54
- package/lib/locale/en_US.js +130 -61
- package/lib/locale/index.d.ts +6 -0
- package/lib/locale/index.js +14 -1
- package/lib/locale/zh_CN.d.ts +122 -54
- package/lib/locale/zh_CN.js +128 -60
- package/lib/style/core/normalize.less +0 -1
- package/package.json +1 -1
- package/.dumi/theme/builtins/Alert.tsx +0 -19
- package/.dumi/theme/builtins/Previewer.tsx +0 -232
- package/.dumi/theme/builtins/SourceCode.tsx +0 -64
- package/.dumi/theme/hooks/useCodeSandbox.tsx +0 -197
- package/.dumi/theme/hooks/useTheme.tsx +0 -707
- package/.dumi/theme/layouts/BasicLayout.tsx +0 -88
- package/.dumi/theme/layouts/components/Dark.less +0 -157
- package/.dumi/theme/layouts/components/Dark.tsx +0 -78
- package/.dumi/theme/layouts/components/Navbar.tsx +0 -83
- package/.dumi/theme/layouts/components/SideMenu.tsx +0 -61
- package/.dumi/theme/layouts/index.tsx +0 -26
- package/.dumi/theme/layouts/layout.less +0 -87
- package/.dumi/theme/typings.d.ts +0 -7
package/dist/index.esm.css
CHANGED
|
@@ -1991,6 +1991,29 @@ div.pro-textarea-view::after {
|
|
|
1991
1991
|
-webkit-box-shadow: 0 0 0 2px var(--ant-error-color-outline);
|
|
1992
1992
|
box-shadow: 0 0 0 2px var(--ant-error-color-outline);
|
|
1993
1993
|
}
|
|
1994
|
+
span.ant-input-group-compact.pro-time-limit,
|
|
1995
|
+
span.ant-input-group-compact.pro-range-limit {
|
|
1996
|
+
display: -webkit-box;
|
|
1997
|
+
display: -webkit-flex;
|
|
1998
|
+
display: -ms-flexbox;
|
|
1999
|
+
display: flex;
|
|
2000
|
+
}
|
|
2001
|
+
span.ant-input-group-compact.pro-time-limit .ant-picker,
|
|
2002
|
+
span.ant-input-group-compact.pro-range-limit .ant-picker {
|
|
2003
|
+
-webkit-box-flex: 1;
|
|
2004
|
+
-webkit-flex: 1;
|
|
2005
|
+
-ms-flex: 1;
|
|
2006
|
+
flex: 1;
|
|
2007
|
+
}
|
|
2008
|
+
span.ant-input-group-compact.pro-time-limit .forever-checkbox,
|
|
2009
|
+
span.ant-input-group-compact.pro-range-limit .forever-checkbox {
|
|
2010
|
+
-webkit-box-flex: 0;
|
|
2011
|
+
-webkit-flex: 0;
|
|
2012
|
+
-ms-flex: 0;
|
|
2013
|
+
flex: 0;
|
|
2014
|
+
min-width: unset;
|
|
2015
|
+
white-space: nowrap;
|
|
2016
|
+
}
|
|
1994
2017
|
.pro-address {
|
|
1995
2018
|
display: -webkit-box;
|
|
1996
2019
|
display: -webkit-flex;
|
|
@@ -2382,6 +2405,31 @@ div.pro-textarea-view::after {
|
|
|
2382
2405
|
.pro-enum-select-modal .ant-modal-footer {
|
|
2383
2406
|
padding: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
|
|
2384
2407
|
}
|
|
2408
|
+
.pro-form.ant-form-vertical .ant-form-item .ant-form-item-label {
|
|
2409
|
+
-webkit-box-flex: 0 !important;
|
|
2410
|
+
-webkit-flex: none !important;
|
|
2411
|
+
-ms-flex: none !important;
|
|
2412
|
+
flex: none !important;
|
|
2413
|
+
}
|
|
2414
|
+
.pro-form.ant-form-vertical .pro-form-custom-footer {
|
|
2415
|
+
display: -webkit-box;
|
|
2416
|
+
display: -webkit-flex;
|
|
2417
|
+
display: -ms-flexbox;
|
|
2418
|
+
display: flex;
|
|
2419
|
+
-webkit-box-align: center;
|
|
2420
|
+
-webkit-align-items: center;
|
|
2421
|
+
-ms-flex-align: center;
|
|
2422
|
+
align-items: center;
|
|
2423
|
+
margin-bottom: 0;
|
|
2424
|
+
height: auto;
|
|
2425
|
+
padding-top: 6px;
|
|
2426
|
+
}
|
|
2427
|
+
.pro-form.ant-form-vertical .pro-form-custom-footer .ant-space-align-center {
|
|
2428
|
+
-webkit-box-align: normal;
|
|
2429
|
+
-webkit-align-items: normal;
|
|
2430
|
+
-ms-flex-align: normal;
|
|
2431
|
+
align-items: normal;
|
|
2432
|
+
}
|
|
2385
2433
|
.pro-form.ant-form {
|
|
2386
2434
|
margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
|
|
2387
2435
|
}
|
|
@@ -2437,6 +2485,18 @@ div.pro-textarea-view::after {
|
|
|
2437
2485
|
.pro-form .ant-form-item {
|
|
2438
2486
|
margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1)) !important;
|
|
2439
2487
|
}
|
|
2488
|
+
.pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input {
|
|
2489
|
+
-webkit-box-flex: inherit;
|
|
2490
|
+
-webkit-flex-grow: inherit;
|
|
2491
|
+
-ms-flex-positive: inherit;
|
|
2492
|
+
flex-grow: inherit;
|
|
2493
|
+
}
|
|
2494
|
+
.pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input-content {
|
|
2495
|
+
-webkit-box-flex: initial;
|
|
2496
|
+
-webkit-flex: initial;
|
|
2497
|
+
-ms-flex: initial;
|
|
2498
|
+
flex: initial;
|
|
2499
|
+
}
|
|
2440
2500
|
.pro-form .ant-form-item .ant-form-item-tooltip svg {
|
|
2441
2501
|
width: 14px;
|
|
2442
2502
|
height: 14px;
|
|
@@ -4692,7 +4752,6 @@ samp {
|
|
|
4692
4752
|
font-family: monospace, sans-serif;
|
|
4693
4753
|
}
|
|
4694
4754
|
.clickable,
|
|
4695
|
-
label,
|
|
4696
4755
|
input[type='button'],
|
|
4697
4756
|
input[type='submit'],
|
|
4698
4757
|
input[type='file'],
|
package/es/ProAction/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
|
70
|
+
locale: antdLangMap[lang],
|
|
66
71
|
children: _jsxs("div", {
|
|
67
72
|
children: [" ", props.children]
|
|
68
73
|
})
|
package/es/ProDownload/utils.js
CHANGED
|
@@ -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$
|
|
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$
|
|
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$
|
|
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$
|
|
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:
|
|
83
|
-
cancelText:
|
|
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) ? "
|
|
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;
|
package/es/ProEditTable/index.js
CHANGED
|
@@ -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') ?
|
|
175
|
-
children: ["\
|
|
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:
|
|
3
|
-
edit:
|
|
4
|
-
copy:
|
|
5
|
-
delete:
|
|
6
|
-
mulDelete:
|
|
7
|
-
save:
|
|
8
|
-
cancel:
|
|
9
|
-
custom:
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
package/es/ProEnum/index.js
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
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('
|
|
106
|
+
console.warn('When using [range], you must pass in [precision]');
|
|
106
107
|
} else if (!rangeReg.test(range)) {
|
|
107
|
-
console.warn('"range"
|
|
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 || "
|
|
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,
|