@zat-design/sisyphus-react 3.1.5-beta.13 → 3.1.5-beta.14
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 +31 -0
- package/es/ProAction/index.js +5 -3
- package/es/ProDownload/utils.js +4 -3
- package/es/ProForm/components/FormFooter/index.js +16 -20
- package/es/ProForm/components/base/Input/index.js +2 -1
- 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 +4 -3
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/es/ProForm/components/base/TextArea/index.js +2 -1
- 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/ProAddressBar/index.js +5 -5
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/es/ProForm/components/render/Render.js +1 -1
- package/es/ProForm/components/render/RenderFields.js +2 -1
- package/es/ProForm/index.js +3 -2
- package/es/ProForm/style/index.less +22 -0
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +4 -3
- 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/ProTable/index.js +7 -6
- package/es/ProTree/components/ProTree.js +5 -4
- package/es/ProTree/components/Tree.js +3 -1
- package/es/locale/en_US.d.ts +49 -8
- package/es/locale/en_US.js +54 -13
- package/es/locale/zh_CN.d.ts +49 -8
- package/es/locale/zh_CN.js +50 -9
- package/lib/ProAction/index.js +5 -3
- package/lib/ProDownload/utils.js +4 -3
- package/lib/ProForm/components/FormFooter/index.js +16 -19
- package/lib/ProForm/components/base/Input/index.js +2 -1
- 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 +4 -3
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +2 -1
- 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/ProAddressBar/index.js +5 -5
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/lib/ProForm/components/render/Render.js +1 -1
- package/lib/ProForm/components/render/RenderFields.js +2 -1
- package/lib/ProForm/index.js +3 -2
- package/lib/ProForm/style/index.less +22 -0
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +4 -3
- 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/ProTable/index.js +7 -6
- package/lib/ProTree/components/ProTree.js +5 -4
- package/lib/ProTree/components/Tree.js +3 -1
- package/lib/locale/en_US.d.ts +49 -8
- package/lib/locale/en_US.js +54 -13
- package/lib/locale/zh_CN.d.ts +49 -8
- package/lib/locale/zh_CN.js +50 -9
- package/package.json +1 -1
package/dist/index.esm.css
CHANGED
|
@@ -2388,6 +2388,25 @@ div.pro-textarea-view::after {
|
|
|
2388
2388
|
-ms-flex: none;
|
|
2389
2389
|
flex: none;
|
|
2390
2390
|
}
|
|
2391
|
+
.pro-form.ant-form-vertical .pro-form-custom-footer {
|
|
2392
|
+
display: -webkit-box;
|
|
2393
|
+
display: -webkit-flex;
|
|
2394
|
+
display: -ms-flexbox;
|
|
2395
|
+
display: flex;
|
|
2396
|
+
-webkit-box-align: center;
|
|
2397
|
+
-webkit-align-items: center;
|
|
2398
|
+
-ms-flex-align: center;
|
|
2399
|
+
align-items: center;
|
|
2400
|
+
margin-bottom: 0;
|
|
2401
|
+
height: auto;
|
|
2402
|
+
padding-top: 6px;
|
|
2403
|
+
}
|
|
2404
|
+
.pro-form.ant-form-vertical .pro-form-custom-footer .ant-space-align-center {
|
|
2405
|
+
-webkit-box-align: normal;
|
|
2406
|
+
-webkit-align-items: normal;
|
|
2407
|
+
-ms-flex-align: normal;
|
|
2408
|
+
align-items: normal;
|
|
2409
|
+
}
|
|
2391
2410
|
.pro-form.ant-form {
|
|
2392
2411
|
margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1));
|
|
2393
2412
|
}
|
|
@@ -2443,6 +2462,18 @@ div.pro-textarea-view::after {
|
|
|
2443
2462
|
.pro-form .ant-form-item {
|
|
2444
2463
|
margin-bottom: calc(var(--zaui-space-size-md, 16px) * var(--zaui-size, 1)) !important;
|
|
2445
2464
|
}
|
|
2465
|
+
.pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input {
|
|
2466
|
+
-webkit-box-flex: inherit;
|
|
2467
|
+
-webkit-flex-grow: inherit;
|
|
2468
|
+
-ms-flex-positive: inherit;
|
|
2469
|
+
flex-grow: inherit;
|
|
2470
|
+
}
|
|
2471
|
+
.pro-form .ant-form-item.pro-form-item-width-auto .ant-form-item-control-input-content {
|
|
2472
|
+
-webkit-box-flex: initial;
|
|
2473
|
+
-webkit-flex: initial;
|
|
2474
|
+
-ms-flex: initial;
|
|
2475
|
+
flex: initial;
|
|
2476
|
+
}
|
|
2446
2477
|
.pro-form .ant-form-item .ant-form-item-tooltip svg {
|
|
2447
2478
|
width: 14px;
|
|
2448
2479
|
height: 14px;
|
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
|
});
|
|
@@ -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,
|
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();
|
|
@@ -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;
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { omit } from 'lodash';
|
|
8
8
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
9
9
|
import Container from '../../Container';
|
|
10
|
+
import locale from '../../../../locale';
|
|
10
11
|
// 参数优先级
|
|
11
12
|
// 组件内默认值 < config默认值 < props
|
|
12
13
|
var Input = function Input(props) {
|
|
@@ -29,7 +30,7 @@ var Input = function Input(props) {
|
|
|
29
30
|
return _jsx(_Input, _objectSpread(_objectSpread({
|
|
30
31
|
allowClear: true,
|
|
31
32
|
autoComplete: "off",
|
|
32
|
-
placeholder: placeholder ||
|
|
33
|
+
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder)
|
|
33
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,
|
|
@@ -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: "
|
|
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,13 @@ 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
31
|
return _jsx(_Switch, _objectSpread(_objectSpread({
|
|
31
32
|
disabled: disabled,
|
|
32
|
-
checkedChildren: "
|
|
33
|
-
unCheckedChildren: "
|
|
33
|
+
checkedChildren: "".concat(locale.ProForm.switchText[0]),
|
|
34
|
+
unCheckedChildren: "".concat(locale.ProForm.switchText[1])
|
|
34
35
|
}, config), res));
|
|
35
36
|
};
|
|
36
37
|
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
|
}
|
|
@@ -7,6 +7,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { omit } from 'lodash';
|
|
8
8
|
import classnames from 'classnames';
|
|
9
9
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
10
|
+
import locale from '../../../../locale';
|
|
10
11
|
import './index.less';
|
|
11
12
|
var TextArea = _Input.TextArea;
|
|
12
13
|
var TextAreaDef = function TextAreaDef(props) {
|
|
@@ -32,7 +33,7 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
|
32
33
|
return _jsx(TextArea, _objectSpread(_objectSpread(_objectSpread({
|
|
33
34
|
showCount: true,
|
|
34
35
|
autoComplete: "off",
|
|
35
|
-
placeholder: placeholder || "
|
|
36
|
+
placeholder: placeholder || "".concat(locale.ProForm.inputPlaceholder).concat(label || ''),
|
|
36
37
|
autoSize: {
|
|
37
38
|
minRows: 4
|
|
38
39
|
}
|
|
@@ -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
|
}
|
|
@@ -20,6 +20,7 @@ import { useSetState } from 'ahooks';
|
|
|
20
20
|
import { tools } from '@zat-design/utils';
|
|
21
21
|
import { useProConfig } from '../../../../ProConfigProvider';
|
|
22
22
|
import useEnum from '../../../../ProEnum/hooks/useEnum';
|
|
23
|
+
import locale from '../../../../locale';
|
|
23
24
|
var transformDataName = tools.transformDataName;
|
|
24
25
|
var Text = _Typography.Text;
|
|
25
26
|
var filterDataSource = function filterDataSource(dataSource, level) {
|
|
@@ -47,7 +48,7 @@ var levelMap = {
|
|
|
47
48
|
3: 'county'
|
|
48
49
|
};
|
|
49
50
|
var ProAddressBar = function ProAddressBar(props) {
|
|
50
|
-
var _otherProps$otherProp, _ref11, _ref11$filter;
|
|
51
|
+
var _otherProps$otherProp, _ref11, _ref11$filter, _locale$ProAddressBar, _locale$ProAddressBar2, _locale$ProAddressBar3;
|
|
51
52
|
var _ref = useProConfig('ProAddressBar') || {},
|
|
52
53
|
configUseRequest = _ref.useRequest,
|
|
53
54
|
configTransformResponse = _ref.transformResponse,
|
|
@@ -56,7 +57,6 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
56
57
|
configFieldNames = _ref.fieldNames,
|
|
57
58
|
configEnumCode = _ref.enumCode,
|
|
58
59
|
configCode = _ref.code;
|
|
59
|
-
// console.count('地址组件渲染次数');
|
|
60
60
|
var className = props.className,
|
|
61
61
|
getPopupContainer = props.getPopupContainer,
|
|
62
62
|
_props$hasDetail = props.hasDetail,
|
|
@@ -388,7 +388,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
388
388
|
className: "pro-address ".concat(className),
|
|
389
389
|
children: [dataSource || addressCode || !loadData ? _jsx(_Cascader, {
|
|
390
390
|
className: hasDetail ? '' : 'no-detail',
|
|
391
|
-
placeholder:
|
|
391
|
+
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar = locale.ProAddressBar) === null || _locale$ProAddressBar === void 0 ? void 0 : _locale$ProAddressBar.placeholder,
|
|
392
392
|
value: addressValue,
|
|
393
393
|
options: !loadData ? serviceData : realDataSource,
|
|
394
394
|
disabled: disabled,
|
|
@@ -403,7 +403,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
403
403
|
onChange: handleChange
|
|
404
404
|
}) : _jsx(_Cascader, {
|
|
405
405
|
className: hasDetail ? '' : 'no-detail',
|
|
406
|
-
placeholder:
|
|
406
|
+
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar2 = locale.ProAddressBar) === null || _locale$ProAddressBar2 === void 0 ? void 0 : _locale$ProAddressBar2.placeholder,
|
|
407
407
|
value: addressValue,
|
|
408
408
|
loadData: handleLoadData,
|
|
409
409
|
// @ts-ignore
|
|
@@ -428,7 +428,7 @@ var ProAddressBar = function ProAddressBar(props) {
|
|
|
428
428
|
disabled: disabled,
|
|
429
429
|
value: address,
|
|
430
430
|
maxLength: detailMaxLength,
|
|
431
|
-
placeholder:
|
|
431
|
+
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProAddressBar3 = locale.ProAddressBar) === null || _locale$ProAddressBar3 === void 0 ? void 0 : _locale$ProAddressBar3.detailPlaceholder,
|
|
432
432
|
// @ts-ignore
|
|
433
433
|
onChange: handleAddressChange
|
|
434
434
|
}))]
|
|
@@ -11,6 +11,7 @@ import { isEmpty } from 'lodash';
|
|
|
11
11
|
import classnames from 'classnames';
|
|
12
12
|
import { tools } from '@zat-design/utils';
|
|
13
13
|
import Container from '../../Container';
|
|
14
|
+
import locale from '../../../../locale';
|
|
14
15
|
var formatAmount = tools.formatAmount,
|
|
15
16
|
formatPercent = tools.formatPercent,
|
|
16
17
|
formatPerMill = tools.formatPerMill;
|
|
@@ -155,7 +156,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
155
156
|
children: [_jsx(_InputNumber, _objectSpread(_objectSpread({
|
|
156
157
|
className: "range-left",
|
|
157
158
|
value: (value === null || value === void 0 ? void 0 : value[0]) || range[0],
|
|
158
|
-
placeholder: "
|
|
159
|
+
placeholder: "".concat(locale.ProForm.inputPlaceholder),
|
|
159
160
|
min: min,
|
|
160
161
|
max: (value === null || value === void 0 ? void 0 : value[1]) || max || range[1],
|
|
161
162
|
precision: precision,
|
|
@@ -174,7 +175,7 @@ var ProNumberRange = function ProNumberRange(props) {
|
|
|
174
175
|
}), _jsx(_InputNumber, _objectSpread(_objectSpread({
|
|
175
176
|
className: "range-right",
|
|
176
177
|
value: (value === null || value === void 0 ? void 0 : value[1]) || range[1],
|
|
177
|
-
placeholder: "
|
|
178
|
+
placeholder: "".concat(locale.ProForm.inputPlaceholder),
|
|
178
179
|
min: (value === null || value === void 0 ? void 0 : value[0]) || min || range[0],
|
|
179
180
|
max: max,
|
|
180
181
|
precision: precision,
|
|
@@ -159,7 +159,7 @@ var Render = function Render(props) {
|
|
|
159
159
|
var lastComponentProps = _objectSpread(_objectSpread(_objectSpread({}, componentProps), _fieldProps), {}, {
|
|
160
160
|
disabled: lastDisabled
|
|
161
161
|
});
|
|
162
|
-
var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _classNames));
|
|
162
|
+
var _className = classNames((_classNames = {}, _defineProperty(_classNames, className, className), _defineProperty(_classNames, 'pro-form-item-changed', changed), _defineProperty(_classNames, 'pro-form-item-width-auto', ['Switch'].includes(type)), _classNames));
|
|
163
163
|
if (formItemProps.hidden === true || _show === false) {
|
|
164
164
|
// 为了监听shouldUpdate 必须存在一个FormItem, 空Input解决 【[antd: Form.Item] `name` is only used for validate React element】
|
|
165
165
|
return _jsx(_Form.Item, {
|
|
@@ -8,6 +8,7 @@ import Render from './Render';
|
|
|
8
8
|
import * as componentMap from '../index';
|
|
9
9
|
import { isSelect } from '../../utils';
|
|
10
10
|
import { FieldProvider } from '../../utils/useFieldProps';
|
|
11
|
+
import locale from '../../../locale';
|
|
11
12
|
var RenderFields = function RenderFields(props) {
|
|
12
13
|
var isView = props.isView,
|
|
13
14
|
_props$columns = props.columns,
|
|
@@ -128,7 +129,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
128
129
|
dataSource: dataSource,
|
|
129
130
|
type: _type
|
|
130
131
|
});
|
|
131
|
-
var _placeholder = placeholder || "".concat(_isSelect ?
|
|
132
|
+
var _placeholder = placeholder || "".concat(_isSelect ? "".concat(locale.ProForm.selectPlaceHolder) : "".concat(locale.ProForm.inputPlaceholder)).concat(label || formLabel || '');
|
|
132
133
|
// 表单组件Props 兼容2.0版本
|
|
133
134
|
var _fieldProps = _objectSpread(_objectSpread({
|
|
134
135
|
disabled: disabled
|
package/es/ProForm/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { useProConfig } from '../ProConfigProvider';
|
|
|
24
24
|
import { getLayout, splitNameStr, useControlled, initialValuesToNames } from './utils/index';
|
|
25
25
|
import { useForm } from './utils/useForm';
|
|
26
26
|
import { useFieldProps } from './utils/useFieldProps';
|
|
27
|
+
import locale from '../locale';
|
|
27
28
|
var ProForm = function ProForm(props, ref) {
|
|
28
29
|
var _localStorage;
|
|
29
30
|
var _props$mode = props.mode,
|
|
@@ -99,12 +100,12 @@ var ProForm = function ProForm(props, ref) {
|
|
|
99
100
|
onClick: expandHandle,
|
|
100
101
|
children: !openState ? _jsxs(_Space, {
|
|
101
102
|
align: "center",
|
|
102
|
-
children: [
|
|
103
|
+
children: [locale.ProForm.unfold, _jsx(DoubleLeftOutlined, {
|
|
103
104
|
className: "rotate-to-bottom"
|
|
104
105
|
})]
|
|
105
106
|
}) : _jsxs(_Space, {
|
|
106
107
|
align: "center",
|
|
107
|
-
children: [
|
|
108
|
+
children: [locale.ProForm.packUp, _jsx(DoubleLeftOutlined, {
|
|
108
109
|
className: "rotate-to-top"
|
|
109
110
|
})]
|
|
110
111
|
})
|
|
@@ -15,6 +15,18 @@
|
|
|
15
15
|
.ant-form-item .ant-form-item-label {
|
|
16
16
|
flex: none;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
.pro-form-custom-footer {
|
|
20
|
+
display : flex;
|
|
21
|
+
align-items : center;
|
|
22
|
+
margin-bottom: 0;
|
|
23
|
+
height : auto;
|
|
24
|
+
padding-top : 6px;
|
|
25
|
+
|
|
26
|
+
.ant-space-align-center {
|
|
27
|
+
align-items: normal;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
&.ant-form {
|
|
@@ -92,6 +104,16 @@
|
|
|
92
104
|
.ant-form-item {
|
|
93
105
|
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1)) !important;
|
|
94
106
|
|
|
107
|
+
&.pro-form-item-width-auto {
|
|
108
|
+
.ant-form-item-control-input {
|
|
109
|
+
flex-grow: inherit;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ant-form-item-control-input-content {
|
|
113
|
+
flex: initial;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
95
117
|
.ant-form-item-tooltip {
|
|
96
118
|
svg {
|
|
97
119
|
width : 14px;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import { validate, regExp } from '@zat-design/utils';
|
|
3
3
|
import { isNullValue } from './index';
|
|
4
|
+
import locale from '../../locale';
|
|
4
5
|
export var rulesCreator = function rulesCreator(rules, label, isSelect) {
|
|
5
6
|
var _result;
|
|
6
|
-
var message = "".concat(isSelect ?
|
|
7
|
+
var message = "".concat(isSelect ? "".concat(locale.ProForm.selectPlaceHolder) : "".concat(locale.ProForm.inputPlaceholder)).concat(locale.ProForm.ruleText).concat(label || '');
|
|
7
8
|
var result = [];
|
|
8
9
|
result = rules.map(function (ruleItem) {
|
|
9
10
|
var rule = _objectSpread({}, ruleItem);
|
|
@@ -3,6 +3,7 @@ import { useEffect, useMemo } from 'react';
|
|
|
3
3
|
import { isBoolean } from 'lodash';
|
|
4
4
|
import { rulesCreator } from './rulesCreator';
|
|
5
5
|
import { isNotFullArray, isNullArray } from './index';
|
|
6
|
+
import locale from '../../locale';
|
|
6
7
|
var useRules = function useRules(props) {
|
|
7
8
|
var rules = props.rules,
|
|
8
9
|
required = props.required,
|
|
@@ -21,7 +22,7 @@ var useRules = function useRules(props) {
|
|
|
21
22
|
return 'required' in rule;
|
|
22
23
|
}));
|
|
23
24
|
if (!requiredRule) {
|
|
24
|
-
var message = isSelect ? "
|
|
25
|
+
var message = isSelect ? "".concat(locale.ProForm.selectPlaceHolder).concat(label || '') : "".concat(locale.ProForm.inputPlaceholder).concat(label || '');
|
|
25
26
|
var rule = {
|
|
26
27
|
required: required,
|
|
27
28
|
message: message
|
|
@@ -30,7 +31,7 @@ var useRules = function useRules(props) {
|
|
|
30
31
|
if (names === null || names === void 0 ? void 0 : names.length) {
|
|
31
32
|
rule.validator = function (_, value) {
|
|
32
33
|
if (!value || isNullArray(value)) {
|
|
33
|
-
return Promise.reject(new Error("
|
|
34
|
+
return Promise.reject(new Error("".concat(locale.ProForm.inputPlaceholder).concat(label)));
|
|
34
35
|
}
|
|
35
36
|
return Promise.resolve();
|
|
36
37
|
};
|
|
@@ -49,7 +50,7 @@ var useRules = function useRules(props) {
|
|
|
49
50
|
validator: function validator(rules, value) {
|
|
50
51
|
// 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
|
|
51
52
|
if (Array.isArray(value) && !isNullArray(value) && isNotFullArray(value, names.length)) {
|
|
52
|
-
return Promise.reject(new Error("
|
|
53
|
+
return Promise.reject(new Error("".concat(locale.ProForm.completeText).concat(label || '')));
|
|
53
54
|
}
|
|
54
55
|
return Promise.resolve();
|
|
55
56
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import tipMsg from '../../../images/tipMsg.png';
|
|
3
3
|
import close from '../../../images/close.png';
|
|
4
|
+
import locale from '../../../../locale';
|
|
4
5
|
var Notice = function Notice(props) {
|
|
5
6
|
var headerHeight = props.headerHeight,
|
|
6
7
|
notice = props.notice,
|
|
@@ -15,13 +16,13 @@ var Notice = function Notice(props) {
|
|
|
15
16
|
},
|
|
16
17
|
children: [_jsx("img", {
|
|
17
18
|
src: tipMsg,
|
|
18
|
-
alt: "
|
|
19
|
+
alt: "".concat(locale.ProLayout.tipAlt)
|
|
19
20
|
}), " ", notice, _jsx("span", {
|
|
20
21
|
className: "pro-layout-header-notice-close",
|
|
21
22
|
onClick: onCancel,
|
|
22
23
|
children: _jsx("img", {
|
|
23
24
|
src: close,
|
|
24
|
-
alt: "
|
|
25
|
+
alt: "".concat(locale.ProLayout.closeAlt)
|
|
25
26
|
})
|
|
26
27
|
})]
|
|
27
28
|
});
|