@zat-design/sisyphus-react 3.13.13-beta.6 → 3.13.13-deta.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.
- package/dist/index.esm.css +38 -0
- package/dist/less.esm.css +38 -0
- package/es/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/es/ProForm/components/combination/FormList/components/Empty.js +90 -0
- package/es/ProForm/components/combination/FormList/index.js +11 -2
- package/es/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/style/index.less +23 -0
- package/es/ProForm/components/combination/ProTimeLimit/index.js +6 -1
- package/es/ProForm/utils/index.js +0 -4
- package/es/locale/en_US.d.ts +1 -0
- package/es/locale/en_US.js +3 -2
- package/es/locale/zh_CN.d.ts +1 -0
- package/es/locale/zh_CN.js +3 -2
- package/lib/ProForm/components/combination/FormList/components/Empty.d.ts +13 -0
- package/lib/ProForm/components/combination/FormList/components/Empty.js +97 -0
- package/lib/ProForm/components/combination/FormList/index.js +11 -2
- package/lib/ProForm/components/combination/FormList/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/style/index.less +23 -0
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +6 -1
- package/lib/ProForm/utils/index.js +0 -4
- package/lib/locale/en_US.d.ts +1 -0
- package/lib/locale/en_US.js +3 -2
- package/lib/locale/zh_CN.d.ts +1 -0
- package/lib/locale/zh_CN.js +3 -2
- package/package.json +2 -3
package/dist/index.esm.css
CHANGED
@@ -2405,6 +2405,44 @@ div.pro-textarea-view::after {
|
|
2405
2405
|
.pro-form-list-action .ant-btn-text:hover {
|
2406
2406
|
background: transparent;
|
2407
2407
|
}
|
2408
|
+
.pro-form-list-empty {
|
2409
|
+
display: -webkit-box;
|
2410
|
+
display: -webkit-flex;
|
2411
|
+
display: -ms-flexbox;
|
2412
|
+
display: flex;
|
2413
|
+
-webkit-box-orient: vertical;
|
2414
|
+
-webkit-box-direction: normal;
|
2415
|
+
-webkit-flex-direction: column;
|
2416
|
+
-ms-flex-direction: column;
|
2417
|
+
flex-direction: column;
|
2418
|
+
-webkit-box-align: center;
|
2419
|
+
-webkit-align-items: center;
|
2420
|
+
-ms-flex-align: center;
|
2421
|
+
align-items: center;
|
2422
|
+
-webkit-box-pack: center;
|
2423
|
+
-webkit-justify-content: center;
|
2424
|
+
-ms-flex-pack: center;
|
2425
|
+
justify-content: center;
|
2426
|
+
}
|
2427
|
+
.pro-form-list-empty .pro-form-list-empty-img {
|
2428
|
+
width: 80px;
|
2429
|
+
height: 80px;
|
2430
|
+
}
|
2431
|
+
.pro-form-list-empty .pro-form-list-empty-content {
|
2432
|
+
display: -webkit-box;
|
2433
|
+
display: -webkit-flex;
|
2434
|
+
display: -ms-flexbox;
|
2435
|
+
display: flex;
|
2436
|
+
-webkit-box-pack: center;
|
2437
|
+
-webkit-justify-content: center;
|
2438
|
+
-ms-flex-pack: center;
|
2439
|
+
justify-content: center;
|
2440
|
+
margin-top: var(--zaui-space-size-md, 16px);
|
2441
|
+
color: var(--zaui-aide-text, #909090);
|
2442
|
+
}
|
2443
|
+
.pro-form-list-empty .pro-form-list-empty-content .ant-btn-link {
|
2444
|
+
padding: 0;
|
2445
|
+
}
|
2408
2446
|
.ant-form-item-has-error .ant-picker-status-error ~ .forever-checkbox:not(.ant-input-disabled):not( .ant-input-borderless).ant-input {
|
2409
2447
|
border-color: var(--ant-error-color);
|
2410
2448
|
}
|
package/dist/less.esm.css
CHANGED
@@ -2405,6 +2405,44 @@ div.pro-textarea-view::after {
|
|
2405
2405
|
.pro-form-list-action .ant-btn-text:hover {
|
2406
2406
|
background: transparent;
|
2407
2407
|
}
|
2408
|
+
.pro-form-list-empty {
|
2409
|
+
display: -webkit-box;
|
2410
|
+
display: -webkit-flex;
|
2411
|
+
display: -ms-flexbox;
|
2412
|
+
display: flex;
|
2413
|
+
-webkit-box-orient: vertical;
|
2414
|
+
-webkit-box-direction: normal;
|
2415
|
+
-webkit-flex-direction: column;
|
2416
|
+
-ms-flex-direction: column;
|
2417
|
+
flex-direction: column;
|
2418
|
+
-webkit-box-align: center;
|
2419
|
+
-webkit-align-items: center;
|
2420
|
+
-ms-flex-align: center;
|
2421
|
+
align-items: center;
|
2422
|
+
-webkit-box-pack: center;
|
2423
|
+
-webkit-justify-content: center;
|
2424
|
+
-ms-flex-pack: center;
|
2425
|
+
justify-content: center;
|
2426
|
+
}
|
2427
|
+
.pro-form-list-empty .pro-form-list-empty-img {
|
2428
|
+
width: 80px;
|
2429
|
+
height: 80px;
|
2430
|
+
}
|
2431
|
+
.pro-form-list-empty .pro-form-list-empty-content {
|
2432
|
+
display: -webkit-box;
|
2433
|
+
display: -webkit-flex;
|
2434
|
+
display: -ms-flexbox;
|
2435
|
+
display: flex;
|
2436
|
+
-webkit-box-pack: center;
|
2437
|
+
-webkit-justify-content: center;
|
2438
|
+
-ms-flex-pack: center;
|
2439
|
+
justify-content: center;
|
2440
|
+
margin-top: var(--zaui-space-size-md, 16px);
|
2441
|
+
color: var(--zaui-aide-text, #909090);
|
2442
|
+
}
|
2443
|
+
.pro-form-list-empty .pro-form-list-empty-content .ant-btn-link {
|
2444
|
+
padding: 0;
|
2445
|
+
}
|
2408
2446
|
.ant-form-item-has-error .ant-picker-status-error ~ .forever-checkbox:not(.ant-input-disabled):not( .ant-input-borderless).ant-input {
|
2409
2447
|
border-color: var(--ant-error-color);
|
2410
2448
|
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { FormInstance, FormListOperation } from 'antd';
|
2
|
+
import type { InternalNamePath } from 'antd/es/form/interface';
|
3
|
+
import type { ToolbarActionType } from '../propsType';
|
4
|
+
interface EmptyProps {
|
5
|
+
disabled?: boolean;
|
6
|
+
toolbarProps?: ToolbarActionType[] | false;
|
7
|
+
operation?: FormListOperation;
|
8
|
+
form?: FormInstance;
|
9
|
+
namePath?: InternalNamePath;
|
10
|
+
emptyBtnText?: string;
|
11
|
+
}
|
12
|
+
declare const Empty: ({ disabled, toolbarProps, operation, form, namePath, emptyBtnText }: EmptyProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export default Empty;
|
@@ -0,0 +1,90 @@
|
|
1
|
+
import "antd/es/button/style";
|
2
|
+
import _Button from "antd/es/button";
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
4
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
5
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
6
|
+
import EmptyImg from '../../../../../assets/empty.png';
|
7
|
+
import locale from '../../../../../locale';
|
8
|
+
// 空列表状态
|
9
|
+
var Empty = function Empty(_ref) {
|
10
|
+
var disabled = _ref.disabled,
|
11
|
+
toolbarProps = _ref.toolbarProps,
|
12
|
+
operation = _ref.operation,
|
13
|
+
form = _ref.form,
|
14
|
+
namePath = _ref.namePath,
|
15
|
+
emptyBtnText = _ref.emptyBtnText;
|
16
|
+
// 找到type为'add'的配置
|
17
|
+
var addConfig = Array.isArray(toolbarProps) ? toolbarProps.find(function (item) {
|
18
|
+
return item.type === 'add';
|
19
|
+
}) : null;
|
20
|
+
var handleAddClick = /*#__PURE__*/function () {
|
21
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
22
|
+
var _addConfig$onClick;
|
23
|
+
var value, data;
|
24
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
25
|
+
while (1) switch (_context.prev = _context.next) {
|
26
|
+
case 0:
|
27
|
+
if (!(!operation || !form || !namePath)) {
|
28
|
+
_context.next = 2;
|
29
|
+
break;
|
30
|
+
}
|
31
|
+
return _context.abrupt("return");
|
32
|
+
case 2:
|
33
|
+
value = form.getFieldValue(namePath);
|
34
|
+
_context.next = 5;
|
35
|
+
return addConfig === null || addConfig === void 0 ? void 0 : (_addConfig$onClick = addConfig.onClick) === null || _addConfig$onClick === void 0 ? void 0 : _addConfig$onClick.call(addConfig, value, {
|
36
|
+
operation: operation,
|
37
|
+
form: form,
|
38
|
+
namePath: namePath
|
39
|
+
});
|
40
|
+
case 5:
|
41
|
+
data = _context.sent;
|
42
|
+
if (!(!(addConfig === null || addConfig === void 0 ? void 0 : addConfig.onClick) || data === true)) {
|
43
|
+
_context.next = 9;
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
operation.add({});
|
47
|
+
return _context.abrupt("return");
|
48
|
+
case 9:
|
49
|
+
if (data) {
|
50
|
+
operation.add(data);
|
51
|
+
}
|
52
|
+
case 10:
|
53
|
+
case "end":
|
54
|
+
return _context.stop();
|
55
|
+
}
|
56
|
+
}, _callee);
|
57
|
+
}));
|
58
|
+
return function handleAddClick() {
|
59
|
+
return _ref2.apply(this, arguments);
|
60
|
+
};
|
61
|
+
}();
|
62
|
+
// 获取按钮文案
|
63
|
+
var getBtnText = function getBtnText() {
|
64
|
+
return emptyBtnText || (addConfig === null || addConfig === void 0 ? void 0 : addConfig.label) || locale.ProForm.formListActions[6];
|
65
|
+
};
|
66
|
+
return _jsxs("div", {
|
67
|
+
className: "pro-form-list-empty",
|
68
|
+
children: [_jsx("img", {
|
69
|
+
className: "pro-form-list-empty-img",
|
70
|
+
src: EmptyImg,
|
71
|
+
alt: "Empty"
|
72
|
+
}), _jsx("div", {
|
73
|
+
className: "pro-form-list-empty-content",
|
74
|
+
children: disabled ? locale.ProForm.noData : _jsxs(_Fragment, {
|
75
|
+
children: [locale.ProForm.noData, !disabled && _jsxs(_Fragment, {
|
76
|
+
children: ["\uFF0C", _jsx(_Button, {
|
77
|
+
type: "link",
|
78
|
+
onClick: handleAddClick,
|
79
|
+
style: {
|
80
|
+
padding: 0,
|
81
|
+
height: 'auto'
|
82
|
+
},
|
83
|
+
children: getBtnText()
|
84
|
+
})]
|
85
|
+
})]
|
86
|
+
})
|
87
|
+
})]
|
88
|
+
});
|
89
|
+
};
|
90
|
+
export default Empty;
|
@@ -12,6 +12,7 @@ import { namesPathTransform } from './utils';
|
|
12
12
|
import ToolbarButton from './components/ToolbarButton';
|
13
13
|
import BlockFields from './components/BlockFields';
|
14
14
|
import LineFields from './components/LineFields';
|
15
|
+
import Empty from './components/Empty';
|
15
16
|
import ProForm from '../../../../ProForm';
|
16
17
|
import { useProConfig } from '../../../../ProConfigProvider';
|
17
18
|
var FormList = function FormList(props, ref) {
|
@@ -26,7 +27,8 @@ var FormList = function FormList(props, ref) {
|
|
26
27
|
meta = props.meta,
|
27
28
|
_props$span = props.span,
|
28
29
|
span = _props$span === void 0 ? 8 : _props$span,
|
29
|
-
disabled = props.disabled
|
30
|
+
disabled = props.disabled,
|
31
|
+
emptyBtnText = props.emptyBtnText;
|
30
32
|
var _fields = fields.map(function (item) {
|
31
33
|
return _objectSpread(_objectSpread({}, item), {}, {
|
32
34
|
key: String(item.key)
|
@@ -125,9 +127,16 @@ var FormList = function FormList(props, ref) {
|
|
125
127
|
form: form,
|
126
128
|
diffConfig: _diffConfig
|
127
129
|
}), field.key);
|
130
|
+
}), _fields.length === 0 && _jsx(Empty, {
|
131
|
+
disabled: disabled,
|
132
|
+
toolbarProps: toolbarProps,
|
133
|
+
operation: operation,
|
134
|
+
form: form,
|
135
|
+
namePath: _namePath,
|
136
|
+
emptyBtnText: emptyBtnText
|
128
137
|
}), _jsx(_Form.ErrorList, {
|
129
138
|
errors: errors
|
130
|
-
}), toolbarProps !== false && _jsx(ToolbarButton, {
|
139
|
+
}), toolbarProps !== false && _fields.length > 0 && _jsx(ToolbarButton, {
|
131
140
|
disabled: disabled,
|
132
141
|
isView: isView,
|
133
142
|
min: min,
|
@@ -70,3 +70,26 @@
|
|
70
70
|
background: transparent;
|
71
71
|
}
|
72
72
|
}
|
73
|
+
|
74
|
+
.pro-form-list-empty {
|
75
|
+
display: flex;
|
76
|
+
flex-direction: column;
|
77
|
+
align-items: center;
|
78
|
+
justify-content: center;
|
79
|
+
|
80
|
+
.pro-form-list-empty-img {
|
81
|
+
width: 80px;
|
82
|
+
height: 80px;
|
83
|
+
}
|
84
|
+
|
85
|
+
.pro-form-list-empty-content {
|
86
|
+
display: flex;
|
87
|
+
justify-content: center;
|
88
|
+
margin-top: var(--zaui-space-size-md, 16px);
|
89
|
+
color: @zaui-aide-text;
|
90
|
+
|
91
|
+
.@{ant-prefix}-btn-link {
|
92
|
+
padding: 0;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
@@ -93,7 +93,11 @@ export var ProTimeLimit = function ProTimeLimit(props) {
|
|
93
93
|
if (checkedForever) {
|
94
94
|
onChange(moment(foreverString, format));
|
95
95
|
} else {
|
96
|
-
|
96
|
+
// 防止长期选择后,时间面板还是9999-01-01
|
97
|
+
onChange(moment());
|
98
|
+
setTimeout(function () {
|
99
|
+
onChange(null);
|
100
|
+
}, 0);
|
97
101
|
}
|
98
102
|
};
|
99
103
|
if (isView) {
|
@@ -129,6 +133,7 @@ export var ProTimeLimit = function ProTimeLimit(props) {
|
|
129
133
|
compact: true,
|
130
134
|
className: "pro-time-limit",
|
131
135
|
children: [_jsx(_DatePicker, _objectSpread(_objectSpread(_objectSpread({
|
136
|
+
defaultPickerValue: moment(),
|
132
137
|
disabled: disabled || isForever
|
133
138
|
}, initialConfig), _omit(_rest, ['placeholder'])), {}, {
|
134
139
|
format: _format,
|
@@ -285,10 +285,6 @@ export function initialValuesToNames() {
|
|
285
285
|
values[key] = formInitialValue;
|
286
286
|
}
|
287
287
|
}
|
288
|
-
// 给FormList默认增加一行
|
289
|
-
if (item.type === 'FormList' && !item.initialValue && !_get(values, item.name)) {
|
290
|
-
item.initialValue = [{}];
|
291
|
-
}
|
292
288
|
});
|
293
289
|
return values;
|
294
290
|
}
|
package/es/locale/en_US.d.ts
CHANGED
package/es/locale/en_US.js
CHANGED
@@ -34,8 +34,9 @@ export default {
|
|
34
34
|
ruleText: 'correct',
|
35
35
|
completeText: 'enter in full',
|
36
36
|
halfRuleText: 'Enter the value of ({total})',
|
37
|
-
formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line'],
|
38
|
-
formListConfirmMessage: 'Are you sure delete it?'
|
37
|
+
formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line', 'Click add'],
|
38
|
+
formListConfirmMessage: 'Are you sure delete it?',
|
39
|
+
noData: 'No data'
|
39
40
|
},
|
40
41
|
ProAction: {
|
41
42
|
errorMessage: 'The configuration config for ProAction must be data',
|
package/es/locale/zh_CN.d.ts
CHANGED
package/es/locale/zh_CN.js
CHANGED
@@ -34,8 +34,9 @@ export default {
|
|
34
34
|
ruleText: '正确的',
|
35
35
|
completeText: '请完整输入',
|
36
36
|
halfRuleText: '请输入第({total})个表单的值',
|
37
|
-
formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行'],
|
38
|
-
formListConfirmMessage: '确认删除吗?'
|
37
|
+
formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行', '点击添加'],
|
38
|
+
formListConfirmMessage: '确认删除吗?',
|
39
|
+
noData: '暂无数据'
|
39
40
|
},
|
40
41
|
ProAction: {
|
41
42
|
errorMessage: 'ProAction 配置 config 必须为数据',
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import type { FormInstance, FormListOperation } from 'antd';
|
2
|
+
import type { InternalNamePath } from 'antd/es/form/interface';
|
3
|
+
import type { ToolbarActionType } from '../propsType';
|
4
|
+
interface EmptyProps {
|
5
|
+
disabled?: boolean;
|
6
|
+
toolbarProps?: ToolbarActionType[] | false;
|
7
|
+
operation?: FormListOperation;
|
8
|
+
form?: FormInstance;
|
9
|
+
namePath?: InternalNamePath;
|
10
|
+
emptyBtnText?: string;
|
11
|
+
}
|
12
|
+
declare const Empty: ({ disabled, toolbarProps, operation, form, namePath, emptyBtnText }: EmptyProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
export default Empty;
|
@@ -0,0 +1,97 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.default = void 0;
|
8
|
+
require("antd/es/button/style");
|
9
|
+
var _button = _interopRequireDefault(require("antd/es/button"));
|
10
|
+
var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
13
|
+
var _empty = _interopRequireDefault(require("../../../../../assets/empty.png"));
|
14
|
+
var _locale = _interopRequireDefault(require("../../../../../locale"));
|
15
|
+
// 空列表状态
|
16
|
+
var Empty = function Empty(_ref) {
|
17
|
+
var disabled = _ref.disabled,
|
18
|
+
toolbarProps = _ref.toolbarProps,
|
19
|
+
operation = _ref.operation,
|
20
|
+
form = _ref.form,
|
21
|
+
namePath = _ref.namePath,
|
22
|
+
emptyBtnText = _ref.emptyBtnText;
|
23
|
+
// 找到type为'add'的配置
|
24
|
+
var addConfig = Array.isArray(toolbarProps) ? toolbarProps.find(function (item) {
|
25
|
+
return item.type === 'add';
|
26
|
+
}) : null;
|
27
|
+
var handleAddClick = /*#__PURE__*/function () {
|
28
|
+
var _ref2 = (0, _asyncToGenerator2.default)(/*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
29
|
+
var _addConfig$onClick;
|
30
|
+
var value, data;
|
31
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
33
|
+
case 0:
|
34
|
+
if (!(!operation || !form || !namePath)) {
|
35
|
+
_context.next = 2;
|
36
|
+
break;
|
37
|
+
}
|
38
|
+
return _context.abrupt("return");
|
39
|
+
case 2:
|
40
|
+
value = form.getFieldValue(namePath);
|
41
|
+
_context.next = 5;
|
42
|
+
return addConfig === null || addConfig === void 0 ? void 0 : (_addConfig$onClick = addConfig.onClick) === null || _addConfig$onClick === void 0 ? void 0 : _addConfig$onClick.call(addConfig, value, {
|
43
|
+
operation: operation,
|
44
|
+
form: form,
|
45
|
+
namePath: namePath
|
46
|
+
});
|
47
|
+
case 5:
|
48
|
+
data = _context.sent;
|
49
|
+
if (!(!(addConfig === null || addConfig === void 0 ? void 0 : addConfig.onClick) || data === true)) {
|
50
|
+
_context.next = 9;
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
operation.add({});
|
54
|
+
return _context.abrupt("return");
|
55
|
+
case 9:
|
56
|
+
if (data) {
|
57
|
+
operation.add(data);
|
58
|
+
}
|
59
|
+
case 10:
|
60
|
+
case "end":
|
61
|
+
return _context.stop();
|
62
|
+
}
|
63
|
+
}, _callee);
|
64
|
+
}));
|
65
|
+
return function handleAddClick() {
|
66
|
+
return _ref2.apply(this, arguments);
|
67
|
+
};
|
68
|
+
}();
|
69
|
+
// 获取按钮文案
|
70
|
+
var getBtnText = function getBtnText() {
|
71
|
+
return emptyBtnText || (addConfig === null || addConfig === void 0 ? void 0 : addConfig.label) || _locale.default.ProForm.formListActions[6];
|
72
|
+
};
|
73
|
+
return (0, _jsxRuntime.jsxs)("div", {
|
74
|
+
className: "pro-form-list-empty",
|
75
|
+
children: [(0, _jsxRuntime.jsx)("img", {
|
76
|
+
className: "pro-form-list-empty-img",
|
77
|
+
src: _empty.default,
|
78
|
+
alt: "Empty"
|
79
|
+
}), (0, _jsxRuntime.jsx)("div", {
|
80
|
+
className: "pro-form-list-empty-content",
|
81
|
+
children: disabled ? _locale.default.ProForm.noData : (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
82
|
+
children: [_locale.default.ProForm.noData, !disabled && (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
83
|
+
children: ["\uFF0C", (0, _jsxRuntime.jsx)(_button.default, {
|
84
|
+
type: "link",
|
85
|
+
onClick: handleAddClick,
|
86
|
+
style: {
|
87
|
+
padding: 0,
|
88
|
+
height: 'auto'
|
89
|
+
},
|
90
|
+
children: getBtnText()
|
91
|
+
})]
|
92
|
+
})]
|
93
|
+
})
|
94
|
+
})]
|
95
|
+
});
|
96
|
+
};
|
97
|
+
var _default = exports.default = Empty;
|
@@ -19,6 +19,7 @@ var _utils2 = require("./utils");
|
|
19
19
|
var _ToolbarButton = _interopRequireDefault(require("./components/ToolbarButton"));
|
20
20
|
var _BlockFields = _interopRequireDefault(require("./components/BlockFields"));
|
21
21
|
var _LineFields = _interopRequireDefault(require("./components/LineFields"));
|
22
|
+
var _Empty = _interopRequireDefault(require("./components/Empty"));
|
22
23
|
var _ProForm = _interopRequireDefault(require("../../../../ProForm"));
|
23
24
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
24
25
|
var FormList = function FormList(props, ref) {
|
@@ -33,7 +34,8 @@ var FormList = function FormList(props, ref) {
|
|
33
34
|
meta = props.meta,
|
34
35
|
_props$span = props.span,
|
35
36
|
span = _props$span === void 0 ? 8 : _props$span,
|
36
|
-
disabled = props.disabled
|
37
|
+
disabled = props.disabled,
|
38
|
+
emptyBtnText = props.emptyBtnText;
|
37
39
|
var _fields = fields.map(function (item) {
|
38
40
|
return (0, _objectSpread2.default)((0, _objectSpread2.default)({}, item), {}, {
|
39
41
|
key: String(item.key)
|
@@ -132,9 +134,16 @@ var FormList = function FormList(props, ref) {
|
|
132
134
|
form: form,
|
133
135
|
diffConfig: _diffConfig
|
134
136
|
}), field.key);
|
137
|
+
}), _fields.length === 0 && (0, _jsxRuntime.jsx)(_Empty.default, {
|
138
|
+
disabled: disabled,
|
139
|
+
toolbarProps: toolbarProps,
|
140
|
+
operation: operation,
|
141
|
+
form: form,
|
142
|
+
namePath: _namePath,
|
143
|
+
emptyBtnText: emptyBtnText
|
135
144
|
}), (0, _jsxRuntime.jsx)(_form.default.ErrorList, {
|
136
145
|
errors: errors
|
137
|
-
}), toolbarProps !== false && (0, _jsxRuntime.jsx)(_ToolbarButton.default, {
|
146
|
+
}), toolbarProps !== false && _fields.length > 0 && (0, _jsxRuntime.jsx)(_ToolbarButton.default, {
|
138
147
|
disabled: disabled,
|
139
148
|
isView: isView,
|
140
149
|
min: min,
|
@@ -70,3 +70,26 @@
|
|
70
70
|
background: transparent;
|
71
71
|
}
|
72
72
|
}
|
73
|
+
|
74
|
+
.pro-form-list-empty {
|
75
|
+
display: flex;
|
76
|
+
flex-direction: column;
|
77
|
+
align-items: center;
|
78
|
+
justify-content: center;
|
79
|
+
|
80
|
+
.pro-form-list-empty-img {
|
81
|
+
width: 80px;
|
82
|
+
height: 80px;
|
83
|
+
}
|
84
|
+
|
85
|
+
.pro-form-list-empty-content {
|
86
|
+
display: flex;
|
87
|
+
justify-content: center;
|
88
|
+
margin-top: var(--zaui-space-size-md, 16px);
|
89
|
+
color: @zaui-aide-text;
|
90
|
+
|
91
|
+
.@{ant-prefix}-btn-link {
|
92
|
+
padding: 0;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
@@ -100,7 +100,11 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
100
100
|
if (checkedForever) {
|
101
101
|
onChange((0, _moment.default)(foreverString, format));
|
102
102
|
} else {
|
103
|
-
|
103
|
+
// 防止长期选择后,时间面板还是9999-01-01
|
104
|
+
onChange((0, _moment.default)());
|
105
|
+
setTimeout(function () {
|
106
|
+
onChange(null);
|
107
|
+
}, 0);
|
104
108
|
}
|
105
109
|
};
|
106
110
|
if (isView) {
|
@@ -136,6 +140,7 @@ var ProTimeLimit = exports.ProTimeLimit = function ProTimeLimit(props) {
|
|
136
140
|
compact: true,
|
137
141
|
className: "pro-time-limit",
|
138
142
|
children: [(0, _jsxRuntime.jsx)(_datePicker.default, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
143
|
+
defaultPickerValue: (0, _moment.default)(),
|
139
144
|
disabled: disabled || isForever
|
140
145
|
}, initialConfig), (0, _omit2.default)(_rest, ['placeholder'])), {}, {
|
141
146
|
format: _format,
|
@@ -299,10 +299,6 @@ function initialValuesToNames() {
|
|
299
299
|
values[key] = formInitialValue;
|
300
300
|
}
|
301
301
|
}
|
302
|
-
// 给FormList默认增加一行
|
303
|
-
if (item.type === 'FormList' && !item.initialValue && !(0, _get2.default)(values, item.name)) {
|
304
|
-
item.initialValue = [{}];
|
305
|
-
}
|
306
302
|
});
|
307
303
|
return values;
|
308
304
|
}
|
package/lib/locale/en_US.d.ts
CHANGED
package/lib/locale/en_US.js
CHANGED
@@ -40,8 +40,9 @@ var _default = exports.default = {
|
|
40
40
|
ruleText: 'correct',
|
41
41
|
completeText: 'enter in full',
|
42
42
|
halfRuleText: 'Enter the value of ({total})',
|
43
|
-
formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line'],
|
44
|
-
formListConfirmMessage: 'Are you sure delete it?'
|
43
|
+
formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line', 'Click add'],
|
44
|
+
formListConfirmMessage: 'Are you sure delete it?',
|
45
|
+
noData: 'No data'
|
45
46
|
},
|
46
47
|
ProAction: {
|
47
48
|
errorMessage: 'The configuration config for ProAction must be data',
|
package/lib/locale/zh_CN.d.ts
CHANGED
package/lib/locale/zh_CN.js
CHANGED
@@ -40,8 +40,9 @@ var _default = exports.default = {
|
|
40
40
|
ruleText: '正确的',
|
41
41
|
completeText: '请完整输入',
|
42
42
|
halfRuleText: '请输入第({total})个表单的值',
|
43
|
-
formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行'],
|
44
|
-
formListConfirmMessage: '确认删除吗?'
|
43
|
+
formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行', '点击添加'],
|
44
|
+
formListConfirmMessage: '确认删除吗?',
|
45
|
+
noData: '暂无数据'
|
45
46
|
},
|
46
47
|
ProAction: {
|
47
48
|
errorMessage: 'ProAction 配置 config 必须为数据',
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@zat-design/sisyphus-react",
|
3
|
-
"version": "3.13.13-
|
3
|
+
"version": "3.13.13-deta.1",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "lib/index.js",
|
6
6
|
"module": "es/index.js",
|
@@ -82,8 +82,7 @@
|
|
82
82
|
"peerDependencies": {
|
83
83
|
"antd": "^4.24.8",
|
84
84
|
"react": "^17.0.0 || ^18.0.0",
|
85
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
86
|
-
"react-router-dom": "^5.1.7"
|
85
|
+
"react-dom": "^17.0.0 || ^18.0.0"
|
87
86
|
},
|
88
87
|
"devDependencies": {
|
89
88
|
"@commitlint/cli": "^12.1.1",
|