@zat-design/sisyphus-react 3.4.5 → 3.4.6-beta.10
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 +151 -35
- package/dist/less.esm.css +151 -35
- package/es/ProConfigProvider/index.d.ts +2 -2
- package/es/ProConfigProvider/index.js +0 -3
- package/es/ProEditTable/components/RenderField/index.js +56 -48
- package/es/ProEditTable/index.js +3 -3
- package/es/ProEditTable/style/index.less +5 -7
- package/es/ProEditTable/utils/tools.d.ts +12 -0
- package/es/ProEditTable/utils/tools.js +79 -2
- package/es/ProForm/components/base/RangePicker/index.js +9 -9
- package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/combination/Container/index.js +3 -2
- package/es/ProForm/components/combination/Container/style/index.less +5 -1
- package/es/ProForm/components/combination/FormList/index.js +1 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProCascader/index.js +256 -0
- package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/es/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/es/ProForm/components/combination/ProCascader/utils/index.js +26 -0
- package/es/ProForm/components/combination/ProModalSelect/index.js +47 -33
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/es/ProForm/components/index.d.ts +1 -2
- package/es/ProForm/components/index.js +1 -4
- package/es/ProForm/components/render/Render.js +25 -20
- package/es/ProForm/components/render/RenderFields.js +4 -1
- package/es/ProForm/components/render/propsType.d.ts +5 -8
- package/es/ProForm/index.js +6 -2
- package/es/ProForm/propsType.d.ts +3 -0
- package/es/ProForm/style/index.less +2 -1
- package/es/ProForm/utils/index.d.ts +6 -1
- package/es/ProForm/utils/index.js +9 -6
- package/es/ProForm/utils/useChanged.js +1 -2
- package/es/ProForm/utils/useForm.js +19 -6
- package/es/ProForm/utils/useListChanged.js +1 -3
- package/es/ProIcon/config/index.d.ts +2 -0
- package/es/ProIcon/config/index.js +4 -2
- package/es/ProIcon/index.js +148 -81
- package/es/ProIcon/propsTypes.d.ts +6 -1
- package/es/ProIcon/utils/index.d.ts +5 -0
- package/es/ProIcon/utils/index.js +60 -0
- package/es/ProLayout/components/ProCollapse/index.js +6 -3
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProSelect/index.js +15 -3
- package/es/ProSelect/propsType.d.ts +2 -0
- package/es/ProSelect/utils/index.d.ts +9 -0
- package/es/ProSelect/utils/index.js +60 -0
- package/es/ProStep/components/Step/index.js +4 -3
- package/es/ProStep/style/index.less +37 -0
- package/es/ProTable/utils.js +6 -3
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +16 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/es/ProTree/components/ProTree.js +96 -74
- package/es/ProTree/components/ProTreeSelect/index.js +5 -9
- package/es/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/es/ProTree/components/Tree.js +63 -41
- package/es/ProTree/style/index.less +38 -16
- package/es/ProUpload/index.js +11 -13
- package/es/ProUpload/propsType.d.ts +8 -3
- package/es/assets/view.svg +2 -2
- package/es/global.less +37 -28
- package/lib/ProConfigProvider/index.d.ts +2 -2
- package/lib/ProConfigProvider/index.js +0 -3
- package/lib/ProEditTable/components/RenderField/index.js +54 -46
- package/lib/ProEditTable/index.js +3 -3
- package/lib/ProEditTable/style/index.less +5 -7
- package/lib/ProEditTable/utils/tools.d.ts +12 -0
- package/lib/ProEditTable/utils/tools.js +80 -2
- package/lib/ProForm/components/base/RangePicker/index.js +9 -9
- package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/combination/Container/index.js +3 -2
- package/lib/ProForm/components/combination/Container/style/index.less +5 -1
- package/lib/ProForm/components/combination/FormList/index.js +1 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProCascader/index.js +256 -0
- package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.d.ts +9 -6
- package/lib/ProForm/components/combination/ProCascader/utils/index.d.ts +14 -0
- package/lib/ProForm/components/combination/ProCascader/utils/index.js +33 -0
- package/lib/ProForm/components/combination/ProModalSelect/index.js +46 -32
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +23 -0
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +17 -10
- package/lib/ProForm/components/index.d.ts +1 -2
- package/lib/ProForm/components/index.js +1 -8
- package/lib/ProForm/components/render/Render.js +25 -20
- package/lib/ProForm/components/render/RenderFields.js +4 -1
- package/lib/ProForm/components/render/propsType.d.ts +5 -8
- package/lib/ProForm/index.js +5 -1
- package/lib/ProForm/propsType.d.ts +3 -0
- package/lib/ProForm/style/index.less +2 -1
- package/lib/ProForm/utils/index.d.ts +6 -1
- package/lib/ProForm/utils/index.js +9 -6
- package/lib/ProForm/utils/useChanged.js +1 -2
- package/lib/ProForm/utils/useForm.js +19 -6
- package/lib/ProForm/utils/useListChanged.js +1 -3
- package/lib/ProIcon/config/index.d.ts +2 -0
- package/lib/ProIcon/config/index.js +4 -2
- package/lib/ProIcon/index.js +144 -77
- package/lib/ProIcon/propsTypes.d.ts +6 -1
- package/lib/ProIcon/utils/index.d.ts +5 -0
- package/lib/ProIcon/utils/index.js +62 -1
- package/lib/ProLayout/components/ProCollapse/index.js +6 -3
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProSelect/index.js +15 -3
- package/lib/ProSelect/propsType.d.ts +2 -0
- package/lib/ProSelect/utils/index.d.ts +9 -0
- package/lib/ProSelect/utils/index.js +68 -0
- package/lib/ProStep/components/Step/index.js +4 -3
- package/lib/ProStep/style/index.less +37 -0
- package/lib/ProTable/utils.js +6 -3
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +16 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +56 -48
- package/lib/ProTree/components/ProTree.js +96 -74
- package/lib/ProTree/components/ProTreeSelect/index.js +5 -9
- package/lib/ProTree/components/ProTreeSelect/style/index.less +6 -8
- package/lib/ProTree/components/Tree.js +63 -41
- package/lib/ProTree/style/index.less +38 -16
- package/lib/ProUpload/index.js +10 -12
- package/lib/ProUpload/propsType.d.ts +8 -3
- package/lib/assets/view.svg +2 -2
- package/lib/global.less +37 -28
- package/package.json +2 -2
- package/es/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/es/ProForm/components/base/ProCascader/index.js +0 -72
- package/es/ProForm/components/combination/ProAddressBar/index.js +0 -437
- package/lib/ProForm/components/base/ProCascader/index.d.ts +0 -14
- package/lib/ProForm/components/base/ProCascader/index.js +0 -78
- package/lib/ProForm/components/combination/ProAddressBar/index.js +0 -437
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/es/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/propsType.js +0 -0
- /package/lib/ProForm/components/combination/{ProAddressBar → ProCascader}/style/index.less +0 -0
|
@@ -292,58 +292,64 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
292
292
|
};
|
|
293
293
|
var handleFinish = /*#__PURE__*/function () {
|
|
294
294
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
295
|
-
var
|
|
295
|
+
var _nextSelectedRows, _nextSelectedRows2, nextSelectedRows, record, flag, res;
|
|
296
296
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
297
297
|
while (1) switch (_context2.prev = _context2.next) {
|
|
298
298
|
case 0:
|
|
299
299
|
_context2.prev = 0;
|
|
300
|
-
if (
|
|
300
|
+
if (selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length) {
|
|
301
301
|
_context2.next = 4;
|
|
302
302
|
break;
|
|
303
303
|
}
|
|
304
304
|
_antd.message.error(_locale.default.ProModalSelect.checkMsg);
|
|
305
305
|
return _context2.abrupt("return", false);
|
|
306
306
|
case 4:
|
|
307
|
-
|
|
307
|
+
nextSelectedRows = selectedRows;
|
|
308
|
+
if (!((_nextSelectedRows = nextSelectedRows) === null || _nextSelectedRows === void 0 ? void 0 : _nextSelectedRows[0])) {
|
|
309
|
+
nextSelectedRows = data.filter(function (item) {
|
|
310
|
+
return selectedRowKeys.includes(item[valueKey]);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
record = isMultiple ? nextSelectedRows : (_nextSelectedRows2 = nextSelectedRows) === null || _nextSelectedRows2 === void 0 ? void 0 : _nextSelectedRows2[0];
|
|
308
314
|
if (!isMultiple) {
|
|
309
315
|
// @ts-ignore
|
|
310
|
-
|
|
316
|
+
record.value = record[valueKey];
|
|
311
317
|
// @ts-ignore
|
|
312
|
-
|
|
318
|
+
record.label = record[labelKey];
|
|
313
319
|
}
|
|
314
320
|
flag = true;
|
|
315
321
|
if (!onOk) {
|
|
316
|
-
_context2.next =
|
|
322
|
+
_context2.next = 14;
|
|
317
323
|
break;
|
|
318
324
|
}
|
|
319
|
-
_context2.next =
|
|
320
|
-
return onOk(
|
|
321
|
-
case
|
|
325
|
+
_context2.next = 12;
|
|
326
|
+
return onOk(record);
|
|
327
|
+
case 12:
|
|
322
328
|
res = _context2.sent;
|
|
323
329
|
if (res !== null && res !== undefined) {
|
|
324
330
|
// @ts-ignore
|
|
325
331
|
flag = res;
|
|
326
332
|
}
|
|
327
|
-
case
|
|
333
|
+
case 14:
|
|
328
334
|
if (flag) {
|
|
329
|
-
onChange === null || onChange === void 0 ? void 0 : onChange(labelInValue ?
|
|
335
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(labelInValue ? record : getNextValues(record), record);
|
|
330
336
|
// 更新内部展示值
|
|
331
337
|
setState({
|
|
332
|
-
_value:
|
|
333
|
-
options: (0, _lodash.isArray)(
|
|
338
|
+
_value: record,
|
|
339
|
+
options: (0, _lodash.isArray)(record) ? record : [record]
|
|
334
340
|
});
|
|
335
341
|
handleClose();
|
|
336
342
|
}
|
|
337
343
|
return _context2.abrupt("return", flag);
|
|
338
|
-
case
|
|
339
|
-
_context2.prev =
|
|
344
|
+
case 18:
|
|
345
|
+
_context2.prev = 18;
|
|
340
346
|
_context2.t0 = _context2["catch"](0);
|
|
341
|
-
console.
|
|
342
|
-
case
|
|
347
|
+
console.warn('error', _context2.t0);
|
|
348
|
+
case 21:
|
|
343
349
|
case "end":
|
|
344
350
|
return _context2.stop();
|
|
345
351
|
}
|
|
346
|
-
}, _callee2, null, [[0,
|
|
352
|
+
}, _callee2, null, [[0, 18]]);
|
|
347
353
|
}));
|
|
348
354
|
return function handleFinish() {
|
|
349
355
|
return _ref7.apply(this, arguments);
|
|
@@ -424,7 +430,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
424
430
|
// 初始化回显,当传入initParams时,前端用来回险
|
|
425
431
|
var getInitValues = /*#__PURE__*/function () {
|
|
426
432
|
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee4() {
|
|
427
|
-
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data2,
|
|
433
|
+
var _contentForm$getField, _useRequest$options2, _useRequest$options3, queryBean, page, params, res, _list, list, _res$data2, _data, nextSelectRowKeys;
|
|
428
434
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee4$(_context4) {
|
|
429
435
|
while (1) switch (_context4.prev = _context4.next) {
|
|
430
436
|
case 0:
|
|
@@ -455,15 +461,15 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
455
461
|
} else {
|
|
456
462
|
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.list : res === null || res === void 0 ? void 0 : res.data;
|
|
457
463
|
}
|
|
458
|
-
|
|
459
|
-
if (
|
|
464
|
+
_data = isMultiple ? list : (_list = list) === null || _list === void 0 ? void 0 : _list[0];
|
|
465
|
+
if (_data) {
|
|
460
466
|
nextSelectRowKeys = isMultiple ? value : [value];
|
|
461
467
|
if (labelInValue) {
|
|
462
|
-
onChange(
|
|
468
|
+
onChange(_data);
|
|
463
469
|
}
|
|
464
470
|
// 更新内部展示值
|
|
465
471
|
setState({
|
|
466
|
-
_value:
|
|
472
|
+
_value: _data,
|
|
467
473
|
isInit: false,
|
|
468
474
|
selectedRows: list,
|
|
469
475
|
selectedRowKeys: nextSelectRowKeys
|
|
@@ -490,7 +496,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
490
496
|
var getDefaultOneValues = /*#__PURE__*/function () {
|
|
491
497
|
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee5() {
|
|
492
498
|
var _useRequest$options4, _useRequest$options5;
|
|
493
|
-
var queryBean, page, params, res, _list2, list, _res$data3,
|
|
499
|
+
var queryBean, page, params, res, _list2, list, _res$data3, _data2, nextSelectRowKeys;
|
|
494
500
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee5$(_context5) {
|
|
495
501
|
while (1) switch (_context5.prev = _context5.next) {
|
|
496
502
|
case 0:
|
|
@@ -514,18 +520,18 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
514
520
|
} else {
|
|
515
521
|
list = withPagination ? res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.list : res === null || res === void 0 ? void 0 : res.data;
|
|
516
522
|
}
|
|
517
|
-
|
|
523
|
+
_data2 = isMultiple ? list : (_list2 = list) === null || _list2 === void 0 ? void 0 : _list2[0];
|
|
518
524
|
nextSelectRowKeys = isMultiple ? value : [value];
|
|
519
525
|
if (labelInValue) {
|
|
520
|
-
onChange(
|
|
526
|
+
onChange(_data2);
|
|
521
527
|
} else {
|
|
522
|
-
onChange(isMultiple ?
|
|
528
|
+
onChange(isMultiple ? _data2.map(function (item) {
|
|
523
529
|
return item[valueKey];
|
|
524
|
-
}) :
|
|
530
|
+
}) : _data2[valueKey]);
|
|
525
531
|
}
|
|
526
532
|
// 更新内部展示值
|
|
527
533
|
setState({
|
|
528
|
-
_value:
|
|
534
|
+
_value: _data2,
|
|
529
535
|
isInit: false,
|
|
530
536
|
selectedRows: list,
|
|
531
537
|
selectedRowKeys: nextSelectRowKeys
|
|
@@ -593,6 +599,9 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
593
599
|
});
|
|
594
600
|
nextState.selectedRows = value;
|
|
595
601
|
}
|
|
602
|
+
} else if (value) {
|
|
603
|
+
console.log('value', value);
|
|
604
|
+
nextState.selectedRowKeys = [value];
|
|
596
605
|
}
|
|
597
606
|
setState(nextState);
|
|
598
607
|
}
|
|
@@ -667,9 +676,8 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
667
676
|
labelInValue: labelInValue,
|
|
668
677
|
dataSource: options,
|
|
669
678
|
scrollFollowParent: false,
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
if (!value && isInit || !(options === null || options === void 0 ? void 0 : options.length)) {
|
|
679
|
+
onFocus: function onFocus() {
|
|
680
|
+
if (useRequest) {
|
|
673
681
|
var _useRequest$options9;
|
|
674
682
|
var queryBean = (useRequest === null || useRequest === void 0 ? void 0 : (_useRequest$options9 = useRequest.options) === null || _useRequest$options9 === void 0 ? void 0 : _useRequest$options9.defaultParams) || {};
|
|
675
683
|
var params = withPagination ? {
|
|
@@ -752,6 +760,11 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
752
760
|
};
|
|
753
761
|
}
|
|
754
762
|
}, [value, isTooltip]);
|
|
763
|
+
(0, _ahooks.useDeepCompareEffect)(function () {
|
|
764
|
+
setState({
|
|
765
|
+
options: tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource
|
|
766
|
+
});
|
|
767
|
+
}, [tableProps === null || tableProps === void 0 ? void 0 : tableProps.dataSource]);
|
|
755
768
|
// 当搜索条件只有一个时,且为输入框,默认设置suffix
|
|
756
769
|
if ((formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) === 1 && (formColumns === null || formColumns === void 0 ? void 0 : (_formColumns$ = formColumns[0]) === null || _formColumns$ === void 0 ? void 0 : _formColumns$.type) === 'Input') {
|
|
757
770
|
var _formColumns$2, _formColumns$3, _formColumns$3$fieldP;
|
|
@@ -797,6 +810,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
797
810
|
form: form,
|
|
798
811
|
columns: formColumns,
|
|
799
812
|
onFinish: handleSearch,
|
|
813
|
+
confirmLoading: loading,
|
|
800
814
|
footer: (formColumns === null || formColumns === void 0 ? void 0 : formColumns.length) > 1
|
|
801
815
|
}), (0, _jsxRuntime.jsx)(_index.ProTable, (0, _objectSpread3.default)({
|
|
802
816
|
onRow: function onRow(record) {
|
|
@@ -53,6 +53,20 @@
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// 新加适用于 readonly false
|
|
57
|
+
.@{ant-prefix}-input-affix-wrapper {
|
|
58
|
+
border-top-right-radius: 0;
|
|
59
|
+
border-bottom-right-radius: 0;
|
|
60
|
+
&.ant-input-affix-wrapper-status-error{
|
|
61
|
+
& + .@{ant-prefix}-btn{
|
|
62
|
+
border: 1px solid var(--ant-error-color);
|
|
63
|
+
>.viewSvg{
|
|
64
|
+
color: var(--ant-error-color);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
56
70
|
.pro-tree-modal-input-appoint {
|
|
57
71
|
.@{ant-prefix}-input {
|
|
58
72
|
border-top-left-radius: 0;
|
|
@@ -93,6 +107,15 @@
|
|
|
93
107
|
fill: #c5c7cd;
|
|
94
108
|
}
|
|
95
109
|
|
|
110
|
+
.@{ant-prefix}-select-status-error {
|
|
111
|
+
& + .@{ant-prefix}-btn{
|
|
112
|
+
border: 1px solid var(--ant-error-color);
|
|
113
|
+
>.viewSvg{
|
|
114
|
+
color: var(--ant-error-color);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
96
119
|
.@{ant-prefix}-input-group-addon {
|
|
97
120
|
padding: 0px var(--zaui-space-size-sm, 8px);
|
|
98
121
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
@@ -12,8 +12,8 @@ export type Props = Omit<RangePickerProps, 'value' | 'onChange' | 'format' | 'se
|
|
|
12
12
|
separator?: any;
|
|
13
13
|
isView?: boolean;
|
|
14
14
|
};
|
|
15
|
-
type Value = [Moment?, Moment?, boolean?];
|
|
16
|
-
type ValueStr = [string?, string?, string?];
|
|
15
|
+
type Value = [Moment?, Moment?, boolean?] | null;
|
|
16
|
+
type ValueStr = [string?, string?, string?] | null;
|
|
17
17
|
type HandleChange = (value: ValueStr | null, valueStr: Value | null) => void;
|
|
18
18
|
declare const ProRangeLimit: React.FC<Props>;
|
|
19
19
|
export default ProRangeLimit;
|
|
@@ -29,12 +29,16 @@ var useControlled = function useControlled(props) {
|
|
|
29
29
|
var _props$value, _props$value2;
|
|
30
30
|
var internalValue = [((_props$value = props.value) === null || _props$value === void 0 ? void 0 : _props$value[0]) && (0, _moment.default)(props.value[0], props.format), ((_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2[1]) && (0, _moment.default)(props.value[1], props.format)];
|
|
31
31
|
var handleChange = function handleChange(value, other) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
if (!value) {
|
|
33
|
+
props === null || props === void 0 ? void 0 : props.onChange(value, other);
|
|
34
|
+
} else {
|
|
35
|
+
var _value = (0, _slicedToArray2.default)(value, 2),
|
|
36
|
+
start = _value[0],
|
|
37
|
+
end = _value[1];
|
|
38
|
+
if (props === null || props === void 0 ? void 0 : props.onChange) {
|
|
39
|
+
var valueStr = [start === null || start === void 0 ? void 0 : start.format(props.format), end === null || end === void 0 ? void 0 : end.format(props.format)];
|
|
40
|
+
props === null || props === void 0 ? void 0 : props.onChange(valueStr, value);
|
|
41
|
+
}
|
|
38
42
|
}
|
|
39
43
|
};
|
|
40
44
|
return [internalValue, handleChange];
|
|
@@ -98,6 +102,10 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
|
98
102
|
}
|
|
99
103
|
// 时间范围change
|
|
100
104
|
var handleRangeChange = function handleRangeChange(date, dateStr) {
|
|
105
|
+
if (!date) {
|
|
106
|
+
onChange(date, dateStr);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
101
109
|
var _ref4 = date || [],
|
|
102
110
|
_ref5 = (0, _slicedToArray2.default)(_ref4, 2),
|
|
103
111
|
start = _ref5[0],
|
|
@@ -110,20 +118,19 @@ var ProRangeLimit = function ProRangeLimit(props) {
|
|
|
110
118
|
};
|
|
111
119
|
// 长期选择框change
|
|
112
120
|
var handleForeverChange = function handleForeverChange(e) {
|
|
113
|
-
var _start, _end;
|
|
114
121
|
var foreverStr = e.target.checked ? 'Y' : 'N';
|
|
115
122
|
var _ref8 = value || [],
|
|
116
123
|
_ref9 = (0, _slicedToArray2.default)(_ref8, 2),
|
|
117
124
|
start = _ref9[0],
|
|
118
125
|
end = _ref9[1];
|
|
119
126
|
if (e.target.checked) {
|
|
127
|
+
var _start, _end;
|
|
120
128
|
start = start || (0, _moment.default)().startOf('day');
|
|
121
129
|
end = foreverMoment;
|
|
130
|
+
onChange([start, end, e.target.checked], [(_start = start) === null || _start === void 0 ? void 0 : _start.format(format), (_end = end) === null || _end === void 0 ? void 0 : _end.format(format), foreverStr]);
|
|
122
131
|
} else {
|
|
123
|
-
|
|
124
|
-
end = undefined;
|
|
132
|
+
onChange(null);
|
|
125
133
|
}
|
|
126
|
-
onChange([start, end, e.target.checked], [(_start = start) === null || _start === void 0 ? void 0 : _start.format(format), (_end = end) === null || _end === void 0 ? void 0 : _end.format(format), foreverStr]);
|
|
127
134
|
};
|
|
128
135
|
return (0, _jsxRuntime.jsxs)(_antd.Input.Group, {
|
|
129
136
|
compact: true,
|
|
@@ -11,8 +11,7 @@ export { default as SwitchCheckbox } from './base/SwitchCheckbox';
|
|
|
11
11
|
export { default as TimePicker } from './base/TimePicker';
|
|
12
12
|
export { default as FormList } from './combination/FormList';
|
|
13
13
|
export { default as ProEditTable } from '../../ProEditTable';
|
|
14
|
-
export { default as ProCascader } from './
|
|
15
|
-
export { default as ProAddressBar } from './combination/ProAddressBar';
|
|
14
|
+
export { default as ProCascader } from './combination/ProCascader';
|
|
16
15
|
export { default as ProCombination } from './combination/ProCombination';
|
|
17
16
|
export { default as ProNumberRange } from './combination/ProNumberRange';
|
|
18
17
|
export { default as ProModalSelect } from './combination/ProModalSelect';
|
|
@@ -71,12 +71,6 @@ Object.defineProperty(exports, "ProAddress", {
|
|
|
71
71
|
return _ProAddress.default;
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
|
-
Object.defineProperty(exports, "ProAddressBar", {
|
|
75
|
-
enumerable: true,
|
|
76
|
-
get: function get() {
|
|
77
|
-
return _ProAddressBar.default;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
74
|
Object.defineProperty(exports, "ProCascader", {
|
|
81
75
|
enumerable: true,
|
|
82
76
|
get: function get() {
|
|
@@ -234,8 +228,7 @@ var _SwitchCheckbox = _interopRequireDefault(require("./base/SwitchCheckbox"));
|
|
|
234
228
|
var _TimePicker = _interopRequireDefault(require("./base/TimePicker"));
|
|
235
229
|
var _FormList = _interopRequireDefault(require("./combination/FormList"));
|
|
236
230
|
var _ProEditTable = _interopRequireDefault(require("../../ProEditTable"));
|
|
237
|
-
var _ProCascader = _interopRequireDefault(require("./
|
|
238
|
-
var _ProAddressBar = _interopRequireDefault(require("./combination/ProAddressBar"));
|
|
231
|
+
var _ProCascader = _interopRequireDefault(require("./combination/ProCascader"));
|
|
239
232
|
var _ProCombination = _interopRequireDefault(require("./combination/ProCombination"));
|
|
240
233
|
var _ProNumberRange = _interopRequireDefault(require("./combination/ProNumberRange"));
|
|
241
234
|
var _ProModalSelect = _interopRequireDefault(require("./combination/ProModalSelect"));
|
|
@@ -224,7 +224,7 @@ var Render = function Render(props) {
|
|
|
224
224
|
}
|
|
225
225
|
_args[2].option = args[1];
|
|
226
226
|
switch (type) {
|
|
227
|
-
case '
|
|
227
|
+
case 'ProCascader':
|
|
228
228
|
_args[2].selectedOptions = args[1];
|
|
229
229
|
break;
|
|
230
230
|
case 'DatePicker':
|
|
@@ -240,7 +240,7 @@ var Render = function Render(props) {
|
|
|
240
240
|
* onChange参数重置 (value, record, { form, index, namePath, option }) => void
|
|
241
241
|
*/
|
|
242
242
|
var handleChange = function handleChange() {
|
|
243
|
-
var
|
|
243
|
+
var _lastComponentProps$c2;
|
|
244
244
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
245
245
|
args[_key] = arguments[_key];
|
|
246
246
|
}
|
|
@@ -258,11 +258,11 @@ var Render = function Render(props) {
|
|
|
258
258
|
((_AutoComponent$props$ = (_AutoComponent$props = AutoComponent === null || AutoComponent === void 0 ? void 0 : AutoComponent.props)[changeKey]) === null || _AutoComponent$props$ === void 0 ? void 0 : _AutoComponent$props$.call.apply(_AutoComponent$props$, [_AutoComponent$props].concat((0, _toConsumableArray2.default)(_args)))) || ((_lastComponentProps$c = lastComponentProps[changeKey]) === null || _lastComponentProps$c === void 0 ? void 0 : _lastComponentProps$c.call.apply(_lastComponentProps$c, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args))));
|
|
259
259
|
return false;
|
|
260
260
|
}
|
|
261
|
-
|
|
262
|
-
// FormList 和 Group场景 对比值改变的话, 回显到表单上
|
|
263
|
-
if (inList) {
|
|
264
|
-
|
|
265
|
-
}
|
|
261
|
+
// const inList = _otherFormItemProps?.namePath?.length;
|
|
262
|
+
// // FormList 和 Group场景 对比值改变的话, 回显到表单上
|
|
263
|
+
// if (inList) {
|
|
264
|
+
// form.setFieldsValue(_args[1]);
|
|
265
|
+
// }
|
|
266
266
|
// Group默认校验, 延时与重新setFieldValue,为了解决校验值未同步最新的问题,
|
|
267
267
|
if (formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.parentNames) {
|
|
268
268
|
setTimeout(function () {
|
|
@@ -274,7 +274,7 @@ var Render = function Render(props) {
|
|
|
274
274
|
// ProTreeSelect返回option
|
|
275
275
|
if (['ProTree'].includes(type)) {
|
|
276
276
|
var _args2, _args2$;
|
|
277
|
-
_args[2].option = (0, _index.findOptionByValue)(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0]);
|
|
277
|
+
_args[2].option = (0, _index.findOptionByValue)(lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.dataSource, (_args2 = _args) === null || _args2 === void 0 ? void 0 : (_args2$ = _args2[0]) === null || _args2$ === void 0 ? void 0 : _args2$[0], (lastComponentProps === null || lastComponentProps === void 0 ? void 0 : lastComponentProps.fieldNames) || {});
|
|
278
278
|
}
|
|
279
279
|
(_lastComponentProps$c2 = lastComponentProps[changeKey]) === null || _lastComponentProps$c2 === void 0 ? void 0 : _lastComponentProps$c2.call.apply(_lastComponentProps$c2, [lastComponentProps].concat((0, _toConsumableArray2.default)(_args)));
|
|
280
280
|
};
|
|
@@ -421,17 +421,21 @@ var Render = function Render(props) {
|
|
|
421
421
|
var formItem = orgFormItem;
|
|
422
422
|
// 当存在shouldUpdate时捕获所有form变更(防止表单onchange设置form值时无法更新的问题)
|
|
423
423
|
if (_otherFormItemProps.shouldUpdate) {
|
|
424
|
-
formItem =
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
children:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
424
|
+
formItem =
|
|
425
|
+
// 空标签防止气泡不显示
|
|
426
|
+
(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
427
|
+
children: (0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
428
|
+
shouldUpdate: _otherFormItemProps.shouldUpdate,
|
|
429
|
+
noStyle: true,
|
|
430
|
+
children: function children() {
|
|
431
|
+
return (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
432
|
+
// @ts-ignore
|
|
433
|
+
_internalItemRender: internalItemRender,
|
|
434
|
+
className: _className,
|
|
435
|
+
children: child
|
|
436
|
+
}));
|
|
437
|
+
}
|
|
438
|
+
})
|
|
435
439
|
});
|
|
436
440
|
}
|
|
437
441
|
// 不渲染tooltip
|
|
@@ -447,7 +451,8 @@ var Render = function Render(props) {
|
|
|
447
451
|
});
|
|
448
452
|
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
449
453
|
title: title,
|
|
450
|
-
|
|
454
|
+
open: changed ? undefined : false,
|
|
455
|
+
// open={true}
|
|
451
456
|
getPopupContainer: function getPopupContainer(target) {
|
|
452
457
|
return target.parentElement;
|
|
453
458
|
},
|
|
@@ -186,7 +186,10 @@ var RenderFields = function RenderFields(props) {
|
|
|
186
186
|
hiddenNames: column.hiddenNames,
|
|
187
187
|
colProps: _colProps,
|
|
188
188
|
mode: componentProps.mode,
|
|
189
|
-
namePath: column.namePath
|
|
189
|
+
namePath: column.namePath,
|
|
190
|
+
listName: column.listName,
|
|
191
|
+
globalControl: globalControl,
|
|
192
|
+
formDisabled: formDisabled
|
|
190
193
|
};
|
|
191
194
|
if (outerClearNotShow !== false && show === false && (column === null || column === void 0 ? void 0 : column.name) && form.getFieldValue(column === null || column === void 0 ? void 0 : column.name)) {
|
|
192
195
|
setTimeout(function () {
|
|
@@ -16,8 +16,7 @@ import { Props as TimePickerProps } from '../base/TimePicker';
|
|
|
16
16
|
import { Props as SwitchProps } from '../base/Switch';
|
|
17
17
|
import { Props as SwitchCheckboxProps } from '../base/SwitchCheckbox';
|
|
18
18
|
import { Props as TextAreaProps } from '../base/TextArea';
|
|
19
|
-
import {
|
|
20
|
-
import { AddressProps } from '../combination/ProAddressBar/propsType';
|
|
19
|
+
import { ProCascaderProps } from '../combination/ProCascader/propsType';
|
|
21
20
|
import { ProCombinationProps } from '../combination/ProCombination/propsType';
|
|
22
21
|
import { ProModalSelectPropsType as ProModalSelectProps } from '../combination/ProModalSelect/propsType';
|
|
23
22
|
import { ProNumberRangeProps } from '../combination/ProNumberRange/propsType';
|
|
@@ -123,8 +122,8 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
123
122
|
type?: 'TextArea';
|
|
124
123
|
fieldProps?: FieldProps<TextAreaProps, Values, T>;
|
|
125
124
|
} | {
|
|
126
|
-
type?: '
|
|
127
|
-
fieldProps?: FieldProps<
|
|
125
|
+
type?: 'ProCascader';
|
|
126
|
+
fieldProps?: FieldProps<ProCascaderProps, Values, T>;
|
|
128
127
|
} | {
|
|
129
128
|
type?: 'ProCombination';
|
|
130
129
|
fieldProps?: FieldProps<ProCombinationProps, Values, T>;
|
|
@@ -155,9 +154,6 @@ export type ColumnPropsMap<Values = any, T = 'ProForm'> = {
|
|
|
155
154
|
} | {
|
|
156
155
|
type?: 'ProUpload';
|
|
157
156
|
fieldProps?: FieldProps<ProUploadProps, Values, T>;
|
|
158
|
-
} | {
|
|
159
|
-
type?: 'ProCascader';
|
|
160
|
-
fieldProps?: FieldProps<ProCascaderProps<any, any[], any>, Values, T>;
|
|
161
157
|
} | {
|
|
162
158
|
type?: 'ProTree';
|
|
163
159
|
fieldProps?: FieldProps<ProTreeProps, Values, T>;
|
|
@@ -212,6 +208,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
212
208
|
clearNotShow?: boolean;
|
|
213
209
|
index?: number;
|
|
214
210
|
namePath?: NamePath;
|
|
211
|
+
listName?: NamePath;
|
|
215
212
|
/** 表单前缀信息 */
|
|
216
213
|
before?: string | React.ReactNode;
|
|
217
214
|
/** 表单后缀信息 */
|
|
@@ -220,7 +217,7 @@ export interface ProFormColumnProps<Values = any> extends Omit<FormItemProps<Val
|
|
|
220
217
|
extra?: string | React.ReactNode;
|
|
221
218
|
/** 是否固定字段, 不隐藏 */
|
|
222
219
|
fixed?: boolean;
|
|
223
|
-
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps>;
|
|
220
|
+
confirm?: boolean | ModalFuncProps | FunctionArgs<Values, boolean | ModalFuncProps | void>;
|
|
224
221
|
}
|
|
225
222
|
export type ProColumnProps<T = any> = ProFormColumnProps<T> & ColumnPropsMap<T, 'ProForm'>;
|
|
226
223
|
/**
|
package/lib/ProForm/index.js
CHANGED
|
@@ -237,6 +237,10 @@ var ProForm = function ProForm(props, ref) {
|
|
|
237
237
|
onValuesChange: handleValuesChange,
|
|
238
238
|
onFinish: handleFinish,
|
|
239
239
|
initialValues: _initialValues,
|
|
240
|
+
scrollToFirstError: {
|
|
241
|
+
block: 'center',
|
|
242
|
+
behavior: 'smooth'
|
|
243
|
+
},
|
|
240
244
|
children: (0, _jsxRuntime.jsxs)(_antd.Row, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
241
245
|
gutter: 24
|
|
242
246
|
}, rowProps), {}, {
|
|
@@ -314,7 +318,7 @@ ProFormForward.Provider = ProFormProvider; // 包装Provider
|
|
|
314
318
|
ProFormForward.useFieldProps = _useFieldProps.useFieldProps; // 获取每个字段的其他参数 -otherProps
|
|
315
319
|
ProFormForward.useContextForms = _ProConfigProvider.useContextForms; // 获取 ProConfigProvider中的表单实例map
|
|
316
320
|
// 内置组合
|
|
317
|
-
ProFormForward.
|
|
321
|
+
ProFormForward.ProCascader = _components.ProCascader;
|
|
318
322
|
ProFormForward.ProCombination = _components.ProCombination;
|
|
319
323
|
ProFormForward.ProNumberRange = _components.ProNumberRange;
|
|
320
324
|
ProFormForward.ProModalSelect = _components.ProModalSelect;
|
|
@@ -41,6 +41,9 @@ export interface ProFormOtherProps {
|
|
|
41
41
|
required?: boolean | boolean[] | (() => boolean | boolean[]);
|
|
42
42
|
mode?: string;
|
|
43
43
|
namePath?: any[] | string | number;
|
|
44
|
+
listName?: any[] | string | number;
|
|
45
|
+
globalControl?: boolean;
|
|
46
|
+
formDisabled?: boolean;
|
|
44
47
|
}
|
|
45
48
|
export interface ProFormProps<Values = any> extends FormProps<Values> {
|
|
46
49
|
disabled?: boolean;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
@import '../components/base/TextArea/index.less';
|
|
5
5
|
@import '../components/combination/FormList/style/index.less';
|
|
6
6
|
@import '../components/combination/ProTimeLimit/style/index.less';
|
|
7
|
-
@import '../components/combination/
|
|
7
|
+
@import '../components/combination/ProCascader/style/index.less';
|
|
8
8
|
@import '../components/combination/ProNumberRange/style/index.less';
|
|
9
9
|
@import '../components/combination/ProModalSelect/style/index.less';
|
|
10
10
|
@import '../components/combination/Group/style/index.less';
|
|
@@ -338,6 +338,7 @@
|
|
|
338
338
|
overflow: hidden;
|
|
339
339
|
white-space: nowrap;
|
|
340
340
|
text-overflow: ellipsis;
|
|
341
|
+
width: 100%;
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
.full-form-item {
|
|
@@ -83,7 +83,12 @@ export declare const deleteForPath: (values: any, namePath: string | number | (s
|
|
|
83
83
|
* @param value 选中值
|
|
84
84
|
* @returns {}
|
|
85
85
|
*/
|
|
86
|
-
export declare const findOptionByValue: (treeData: any[], value: string | number
|
|
86
|
+
export declare const findOptionByValue: (treeData: any[], value: string | number, fieldNames: {
|
|
87
|
+
[key: string]: any;
|
|
88
|
+
label?: string;
|
|
89
|
+
value?: string;
|
|
90
|
+
children?: string;
|
|
91
|
+
}) => any;
|
|
87
92
|
/**
|
|
88
93
|
* 对比依赖列表中的 值是否变更
|
|
89
94
|
*/
|
|
@@ -59,7 +59,7 @@ var useControlled = exports.useControlled = function useControlled(props) {
|
|
|
59
59
|
var isSelect = exports.isSelect = function isSelect(props) {
|
|
60
60
|
var dataSource = props.dataSource,
|
|
61
61
|
type = props.type;
|
|
62
|
-
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', '
|
|
62
|
+
return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProCascader', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* Input TextArea 移除前后空格
|
|
@@ -143,6 +143,9 @@ var filterInternalFields = exports.filterInternalFields = function filterInterna
|
|
|
143
143
|
if ((values === null || values === void 0 ? void 0 : values._immutable) || _moment.default.isMoment(values)) {
|
|
144
144
|
return nextValues;
|
|
145
145
|
}
|
|
146
|
+
if (values instanceof File) {
|
|
147
|
+
return nextValues;
|
|
148
|
+
}
|
|
146
149
|
if (Array.isArray(nextValues)) {
|
|
147
150
|
return nextValues.map(function (item) {
|
|
148
151
|
return filterInternalFields(item);
|
|
@@ -405,19 +408,19 @@ var deleteForPath = exports.deleteForPath = function deleteForPath(values, nameP
|
|
|
405
408
|
* @param value 选中值
|
|
406
409
|
* @returns {}
|
|
407
410
|
*/
|
|
408
|
-
var findOptionByValue = exports.findOptionByValue = function findOptionByValue(treeData, value) {
|
|
411
|
+
var findOptionByValue = exports.findOptionByValue = function findOptionByValue(treeData, value, fieldNames) {
|
|
409
412
|
if ((0, _lodash.isObject)(value)) {
|
|
410
413
|
return value;
|
|
411
414
|
}
|
|
412
415
|
for (var i = 0; i < (treeData === null || treeData === void 0 ? void 0 : treeData.length); i++) {
|
|
413
416
|
var node = treeData[i];
|
|
414
|
-
if (node.value === value) {
|
|
415
|
-
return (0, _lodash.omit)(node, ['children']);
|
|
417
|
+
if (node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value) || 'value'] === value) {
|
|
418
|
+
return (0, _lodash.omit)(node, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
|
416
419
|
}
|
|
417
420
|
if (node.children) {
|
|
418
|
-
var foundNode = findOptionByValue(node.children, value);
|
|
421
|
+
var foundNode = findOptionByValue(node[(fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children) || 'children'], value, fieldNames);
|
|
419
422
|
if (foundNode) {
|
|
420
|
-
return (0, _lodash.omit)(foundNode, ['children']);
|
|
423
|
+
return (0, _lodash.omit)(foundNode, ['children', fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.children]);
|
|
421
424
|
}
|
|
422
425
|
}
|
|
423
426
|
}
|
|
@@ -18,9 +18,8 @@ var useChanged = exports.useChanged = function useChanged(_ref) {
|
|
|
18
18
|
return (0, _lodash.get)(originalValues, name);
|
|
19
19
|
}) : (0, _lodash.get)(originalValues, name);
|
|
20
20
|
var notWatch = !equalWith && (!originalValues || originalValue === undefined);
|
|
21
|
-
if (notWatch) form = [];
|
|
22
|
-
var value = _antd.Form.useWatch(namesStr || name, form);
|
|
23
21
|
if (notWatch) return [false];
|
|
22
|
+
var value = _antd.Form.useWatch(namesStr || name, form);
|
|
24
23
|
var changed = (0, _diffOriginal.diffOriginal)({
|
|
25
24
|
originalValue: originalValue,
|
|
26
25
|
value: value,
|
|
@@ -32,30 +32,43 @@ var useForm = exports.useForm = function useForm(originForm) {
|
|
|
32
32
|
_key,
|
|
33
33
|
values,
|
|
34
34
|
_values,
|
|
35
|
+
_error$errorFields,
|
|
36
|
+
_error$errorFields$,
|
|
35
37
|
_args = arguments;
|
|
36
38
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
37
39
|
while (1) switch (_context.prev = _context.next) {
|
|
38
40
|
case 0:
|
|
41
|
+
_context.prev = 0;
|
|
39
42
|
for (_len = _args.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
40
43
|
rest[_key - 1] = _args[_key];
|
|
41
44
|
}
|
|
42
|
-
_context.next =
|
|
45
|
+
_context.next = 4;
|
|
43
46
|
return validateFields.apply(void 0, [nameList].concat(rest));
|
|
44
|
-
case
|
|
47
|
+
case 4:
|
|
45
48
|
values = _context.sent;
|
|
46
49
|
if (!nameList) {
|
|
47
|
-
_context.next =
|
|
50
|
+
_context.next = 7;
|
|
48
51
|
break;
|
|
49
52
|
}
|
|
50
53
|
return _context.abrupt("return", values);
|
|
51
|
-
case
|
|
54
|
+
case 7:
|
|
52
55
|
_values = _getFieldsValue();
|
|
53
56
|
return _context.abrupt("return", _values);
|
|
54
|
-
case
|
|
57
|
+
case 11:
|
|
58
|
+
_context.prev = 11;
|
|
59
|
+
_context.t0 = _context["catch"](0);
|
|
60
|
+
if (_context.t0 && (_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.errorFields)) {
|
|
61
|
+
form === null || form === void 0 ? void 0 : form.scrollToField(_context.t0 === null || _context.t0 === void 0 ? void 0 : (_error$errorFields = _context.t0.errorFields) === null || _error$errorFields === void 0 ? void 0 : (_error$errorFields$ = _error$errorFields[0]) === null || _error$errorFields$ === void 0 ? void 0 : _error$errorFields$.name, {
|
|
62
|
+
block: 'center',
|
|
63
|
+
behavior: 'smooth'
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
throw _context.t0;
|
|
67
|
+
case 15:
|
|
55
68
|
case "end":
|
|
56
69
|
return _context.stop();
|
|
57
70
|
}
|
|
58
|
-
}, _callee);
|
|
71
|
+
}, _callee, null, [[0, 11]]);
|
|
59
72
|
}));
|
|
60
73
|
return function _validateFields(_x) {
|
|
61
74
|
return _ref.apply(this, arguments);
|