@zat-design/sisyphus-react 3.6.4-beta.9 → 3.6.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/ProEditTable/components/RenderField/index.js +122 -119
- package/es/ProForm/components/FormFooter/index.js +1 -1
- package/es/ProForm/components/combination/FormList/index.js +0 -5
- package/es/ProForm/components/combination/ProModalSelect/index.js +2 -1
- package/lib/ProEditTable/components/RenderField/index.js +121 -118
- package/lib/ProForm/components/FormFooter/index.js +1 -1
- package/lib/ProForm/components/combination/FormList/index.js +0 -5
- package/lib/ProForm/components/combination/ProModalSelect/index.js +2 -1
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-run
|
|
|
17
17
|
/* eslint-disable prefer-const */
|
|
18
18
|
import React, { useCallback, useEffect } from 'react';
|
|
19
19
|
import classNames from 'classnames';
|
|
20
|
-
import { cloneDeep, isEqual, omit, isFunction } from 'lodash';
|
|
20
|
+
import { cloneDeep, isEqual, debounce, omit, isFunction } from 'lodash';
|
|
21
21
|
import valueTypeMap from '../../../ProForm/utils/valueType';
|
|
22
22
|
import transformMap from '../../utils/transform';
|
|
23
23
|
import { getNamePath, difference, getDisabled } from '../../utils/tools';
|
|
@@ -296,108 +296,107 @@ var RenderField = function RenderField(_ref) {
|
|
|
296
296
|
}, 100);
|
|
297
297
|
};
|
|
298
298
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
|
299
|
-
var _onChange = /*#__PURE__*/function () {
|
|
300
|
-
var
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
args[_key2] = _args2[_key2];
|
|
324
|
-
}
|
|
325
|
-
_args = [].concat(args);
|
|
326
|
-
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
|
327
|
-
row = form.getFieldValue(rowPath, true);
|
|
328
|
-
orgRow = cloneDeep(row);
|
|
329
|
-
if (!onFieldChange) {
|
|
330
|
-
_context.next = 18;
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
_args = formatArgs(args);
|
|
334
|
-
_args[1] = row;
|
|
335
|
-
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
|
336
|
-
if (!_context.t0) {
|
|
337
|
-
_context.next = 12;
|
|
338
|
-
break;
|
|
339
|
-
}
|
|
340
|
-
_context.next = 12;
|
|
341
|
-
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
|
|
342
|
-
case 12:
|
|
343
|
-
_context.t1 = onFieldChange;
|
|
344
|
-
if (!_context.t1) {
|
|
345
|
-
_context.next = 16;
|
|
346
|
-
break;
|
|
347
|
-
}
|
|
348
|
-
_context.next = 16;
|
|
349
|
-
return onFieldChange.apply(void 0, _toConsumableArray(_args));
|
|
350
|
-
case 16:
|
|
351
|
-
_context.next = 27;
|
|
299
|
+
var _onChange = debounce( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
300
|
+
var _len2,
|
|
301
|
+
args,
|
|
302
|
+
_key2,
|
|
303
|
+
_args,
|
|
304
|
+
rowPath,
|
|
305
|
+
row,
|
|
306
|
+
orgRow,
|
|
307
|
+
_TargetComponent,
|
|
308
|
+
_TargetComponent$prop,
|
|
309
|
+
_TargetComponent$prop2,
|
|
310
|
+
_TargetComponent2,
|
|
311
|
+
_TargetComponent2$pro,
|
|
312
|
+
_TargetComponent$prop3,
|
|
313
|
+
_Object$keys,
|
|
314
|
+
_Object$keys$map,
|
|
315
|
+
diff,
|
|
316
|
+
validateFieldKeys,
|
|
317
|
+
_args2 = arguments;
|
|
318
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
319
|
+
while (1) switch (_context.prev = _context.next) {
|
|
320
|
+
case 0:
|
|
321
|
+
if (!(!onFieldChange && !onChange)) {
|
|
322
|
+
_context.next = 2;
|
|
352
323
|
break;
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
324
|
+
}
|
|
325
|
+
return _context.abrupt("return", null);
|
|
326
|
+
case 2:
|
|
327
|
+
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
328
|
+
args[_key2] = _args2[_key2];
|
|
329
|
+
}
|
|
330
|
+
_args = [].concat(args);
|
|
331
|
+
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
|
332
|
+
row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
|
|
333
|
+
orgRow = cloneDeep(row);
|
|
334
|
+
if (!onFieldChange) {
|
|
335
|
+
_context.next = 20;
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
_args = formatArgs(args);
|
|
339
|
+
_args[1] = row;
|
|
340
|
+
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
|
341
|
+
if (!_context.t0) {
|
|
342
|
+
_context.next = 14;
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
_context.next = 14;
|
|
346
|
+
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
|
|
347
|
+
case 14:
|
|
348
|
+
_context.t1 = onFieldChange;
|
|
349
|
+
if (!_context.t1) {
|
|
350
|
+
_context.next = 18;
|
|
351
|
+
break;
|
|
352
|
+
}
|
|
353
|
+
_context.next = 18;
|
|
354
|
+
return onFieldChange.apply(void 0, _toConsumableArray(_args));
|
|
355
|
+
case 18:
|
|
356
|
+
_context.next = 29;
|
|
357
|
+
break;
|
|
358
|
+
case 20:
|
|
359
|
+
_args = _args.concat([row, index, form]);
|
|
360
|
+
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
|
|
361
|
+
if (!_context.t2) {
|
|
362
|
+
_context.next = 25;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
_context.next = 25;
|
|
366
|
+
return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
|
|
367
|
+
case 25:
|
|
368
|
+
_context.t3 = onChange;
|
|
369
|
+
if (!_context.t3) {
|
|
370
|
+
_context.next = 29;
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
_context.next = 29;
|
|
374
|
+
return onChange.apply(void 0, _toConsumableArray(_args));
|
|
375
|
+
case 29:
|
|
376
|
+
// 判断属性是否变动
|
|
377
|
+
form.setFieldValue(rowPath, row);
|
|
378
|
+
if (!isEqual(orgRow, row)) {
|
|
379
|
+
diff = difference(row, orgRow) || {};
|
|
380
|
+
validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
|
381
|
+
return [].concat(_toConsumableArray(rowPath), [key]);
|
|
382
|
+
});
|
|
383
|
+
if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
|
|
384
|
+
setTimeout(function () {
|
|
385
|
+
form.validateFields(validateFieldKeys);
|
|
386
|
+
}, 100);
|
|
383
387
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
});
|
|
388
|
+
}
|
|
389
|
+
setState({
|
|
390
|
+
forceUpdate: {
|
|
391
|
+
d: Date.now()
|
|
390
392
|
}
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
}
|
|
396
|
-
})
|
|
397
|
-
|
|
398
|
-
return _ref2.apply(this, arguments);
|
|
399
|
-
};
|
|
400
|
-
}();
|
|
393
|
+
});
|
|
394
|
+
case 32:
|
|
395
|
+
case "end":
|
|
396
|
+
return _context.stop();
|
|
397
|
+
}
|
|
398
|
+
}, _callee);
|
|
399
|
+
})), 300);
|
|
401
400
|
var _onblur = /*#__PURE__*/function () {
|
|
402
401
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
403
402
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
|
@@ -416,6 +415,12 @@ var RenderField = function RenderField(_ref) {
|
|
|
416
415
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
417
416
|
while (1) switch (_context2.prev = _context2.next) {
|
|
418
417
|
case 0:
|
|
418
|
+
if (onBlur) {
|
|
419
|
+
_context2.next = 2;
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
return _context2.abrupt("return", null);
|
|
423
|
+
case 2:
|
|
419
424
|
for (_len3 = _args3.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
420
425
|
args[_key3] = _args3[_key3];
|
|
421
426
|
}
|
|
@@ -426,22 +431,22 @@ var RenderField = function RenderField(_ref) {
|
|
|
426
431
|
_args[1] = row;
|
|
427
432
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
428
433
|
if (!_context2.t0) {
|
|
429
|
-
_context2.next =
|
|
434
|
+
_context2.next = 12;
|
|
430
435
|
break;
|
|
431
436
|
}
|
|
432
|
-
_context2.next =
|
|
437
|
+
_context2.next = 12;
|
|
433
438
|
return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, _toConsumableArray(_args));
|
|
434
|
-
case
|
|
439
|
+
case 12:
|
|
435
440
|
_context2.t1 = onBlur;
|
|
436
441
|
if (!_context2.t1) {
|
|
437
|
-
_context2.next =
|
|
442
|
+
_context2.next = 16;
|
|
438
443
|
break;
|
|
439
444
|
}
|
|
440
|
-
_context2.next =
|
|
445
|
+
_context2.next = 16;
|
|
441
446
|
return onBlur.apply(void 0, _toConsumableArray(_args));
|
|
442
|
-
case
|
|
447
|
+
case 16:
|
|
443
448
|
// 判断属性是否变动
|
|
444
|
-
form.setFieldValue(rowPath,
|
|
449
|
+
form.setFieldValue(rowPath, row);
|
|
445
450
|
if (!isEqual(orgRow, row)) {
|
|
446
451
|
diff = difference(row, orgRow) || {};
|
|
447
452
|
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
|
@@ -452,25 +457,23 @@ var RenderField = function RenderField(_ref) {
|
|
|
452
457
|
}
|
|
453
458
|
}
|
|
454
459
|
if (!isCell) {
|
|
455
|
-
_context2.next =
|
|
460
|
+
_context2.next = 22;
|
|
456
461
|
break;
|
|
457
462
|
}
|
|
458
|
-
_context2.next =
|
|
463
|
+
_context2.next = 21;
|
|
459
464
|
return form.validateFields([cellName]);
|
|
460
|
-
case
|
|
465
|
+
case 21:
|
|
461
466
|
setState({
|
|
462
467
|
cellNamePath: []
|
|
463
468
|
});
|
|
464
|
-
case
|
|
469
|
+
case 22:
|
|
465
470
|
// 单行编辑时需要 强制更新视图
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
case 21:
|
|
471
|
+
setState({
|
|
472
|
+
forceUpdate: {
|
|
473
|
+
d: Date.now()
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
case 23:
|
|
474
477
|
case "end":
|
|
475
478
|
return _context2.stop();
|
|
476
479
|
}
|
|
@@ -5,7 +5,6 @@ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { forwardRef, useCallback, useImperativeHandle } from 'react';
|
|
7
7
|
import { DndContext } from '@dnd-kit/core';
|
|
8
|
-
import { cloneDeep, isFunction } from 'lodash';
|
|
9
8
|
import { SortableContext, verticalListSortingStrategy } from '@dnd-kit/sortable';
|
|
10
9
|
import { toArray } from '../../../utils';
|
|
11
10
|
import { namesPathTransform } from './utils';
|
|
@@ -56,10 +55,6 @@ var FormList = function FormList(props, ref) {
|
|
|
56
55
|
listName: [].concat(_toConsumableArray(namePath), [item.name]),
|
|
57
56
|
label: mode === 'less' ? undefined : item.label
|
|
58
57
|
});
|
|
59
|
-
// 可编辑表格的columns需要消除引用关系,防止串数据
|
|
60
|
-
if (column.type === 'ProEditTable' && !isFunction(column.fieldProps)) {
|
|
61
|
-
column.fieldProps.columns = cloneDeep(column.fieldProps.columns);
|
|
62
|
-
}
|
|
63
58
|
return column;
|
|
64
59
|
});
|
|
65
60
|
}, [columns]);
|
|
@@ -160,7 +160,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
160
160
|
var defaultOptionRender = function defaultOptionRender(rowData) {
|
|
161
161
|
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
|
162
162
|
};
|
|
163
|
-
var handleFormat =
|
|
163
|
+
var handleFormat = onFormat || defaultOptionRender;
|
|
164
164
|
if (showCodeName) {
|
|
165
165
|
handleFormat = function handleFormat(_ref5) {
|
|
166
166
|
var value = _ref5.value,
|
|
@@ -681,6 +681,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
681
681
|
showCodeName: showCodeName,
|
|
682
682
|
labelInValue: labelInValue,
|
|
683
683
|
dataSource: options,
|
|
684
|
+
optionRender: optionRender,
|
|
684
685
|
scrollFollowParent: false,
|
|
685
686
|
mode: isMultiple ? 'multiple' : undefined,
|
|
686
687
|
onFocus: function onFocus() {
|
|
@@ -299,108 +299,107 @@ var RenderField = function RenderField(_ref) {
|
|
|
299
299
|
}, 100);
|
|
300
300
|
};
|
|
301
301
|
// 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
|
|
302
|
-
var _onChange = /*#__PURE__*/function () {
|
|
303
|
-
var
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
args[_key2] = _args2[_key2];
|
|
327
|
-
}
|
|
328
|
-
_args = [].concat(args);
|
|
329
|
-
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
330
|
-
row = form.getFieldValue(rowPath, true);
|
|
331
|
-
orgRow = (0, _lodash.cloneDeep)(row);
|
|
332
|
-
if (!onFieldChange) {
|
|
333
|
-
_context.next = 18;
|
|
334
|
-
break;
|
|
335
|
-
}
|
|
336
|
-
_args = formatArgs(args);
|
|
337
|
-
_args[1] = row;
|
|
338
|
-
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
|
339
|
-
if (!_context.t0) {
|
|
340
|
-
_context.next = 12;
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
_context.next = 12;
|
|
344
|
-
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, (0, _toConsumableArray2.default)(_args));
|
|
345
|
-
case 12:
|
|
346
|
-
_context.t1 = onFieldChange;
|
|
347
|
-
if (!_context.t1) {
|
|
348
|
-
_context.next = 16;
|
|
349
|
-
break;
|
|
350
|
-
}
|
|
351
|
-
_context.next = 16;
|
|
352
|
-
return onFieldChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
353
|
-
case 16:
|
|
354
|
-
_context.next = 27;
|
|
302
|
+
var _onChange = (0, _lodash.debounce)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
|
|
303
|
+
var _len2,
|
|
304
|
+
args,
|
|
305
|
+
_key2,
|
|
306
|
+
_args,
|
|
307
|
+
rowPath,
|
|
308
|
+
row,
|
|
309
|
+
orgRow,
|
|
310
|
+
_TargetComponent,
|
|
311
|
+
_TargetComponent$prop,
|
|
312
|
+
_TargetComponent$prop2,
|
|
313
|
+
_TargetComponent2,
|
|
314
|
+
_TargetComponent2$pro,
|
|
315
|
+
_TargetComponent$prop3,
|
|
316
|
+
_Object$keys,
|
|
317
|
+
_Object$keys$map,
|
|
318
|
+
diff,
|
|
319
|
+
validateFieldKeys,
|
|
320
|
+
_args2 = arguments;
|
|
321
|
+
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
322
|
+
while (1) switch (_context.prev = _context.next) {
|
|
323
|
+
case 0:
|
|
324
|
+
if (!(!onFieldChange && !onChange)) {
|
|
325
|
+
_context.next = 2;
|
|
355
326
|
break;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
327
|
+
}
|
|
328
|
+
return _context.abrupt("return", null);
|
|
329
|
+
case 2:
|
|
330
|
+
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
331
|
+
args[_key2] = _args2[_key2];
|
|
332
|
+
}
|
|
333
|
+
_args = [].concat(args);
|
|
334
|
+
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
335
|
+
row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
|
|
336
|
+
orgRow = (0, _lodash.cloneDeep)(row);
|
|
337
|
+
if (!onFieldChange) {
|
|
338
|
+
_context.next = 20;
|
|
339
|
+
break;
|
|
340
|
+
}
|
|
341
|
+
_args = formatArgs(args);
|
|
342
|
+
_args[1] = row;
|
|
343
|
+
_context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
|
|
344
|
+
if (!_context.t0) {
|
|
345
|
+
_context.next = 14;
|
|
346
|
+
break;
|
|
347
|
+
}
|
|
348
|
+
_context.next = 14;
|
|
349
|
+
return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, (0, _toConsumableArray2.default)(_args));
|
|
350
|
+
case 14:
|
|
351
|
+
_context.t1 = onFieldChange;
|
|
352
|
+
if (!_context.t1) {
|
|
353
|
+
_context.next = 18;
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
_context.next = 18;
|
|
357
|
+
return onFieldChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
358
|
+
case 18:
|
|
359
|
+
_context.next = 29;
|
|
360
|
+
break;
|
|
361
|
+
case 20:
|
|
362
|
+
_args = _args.concat([row, index, form]);
|
|
363
|
+
_context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
|
|
364
|
+
if (!_context.t2) {
|
|
365
|
+
_context.next = 25;
|
|
366
|
+
break;
|
|
367
|
+
}
|
|
368
|
+
_context.next = 25;
|
|
369
|
+
return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, (0, _toConsumableArray2.default)(_args));
|
|
370
|
+
case 25:
|
|
371
|
+
_context.t3 = onChange;
|
|
372
|
+
if (!_context.t3) {
|
|
373
|
+
_context.next = 29;
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
_context.next = 29;
|
|
377
|
+
return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
378
|
+
case 29:
|
|
379
|
+
// 判断属性是否变动
|
|
380
|
+
form.setFieldValue(rowPath, row);
|
|
381
|
+
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
382
|
+
diff = (0, _tools.difference)(row, orgRow) || {};
|
|
383
|
+
validateFieldKeys = (_Object$keys = Object.keys(diff)) === null || _Object$keys === void 0 ? void 0 : (_Object$keys$map = _Object$keys.map) === null || _Object$keys$map === void 0 ? void 0 : _Object$keys$map.call(_Object$keys, function (key) {
|
|
384
|
+
return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
|
|
385
|
+
});
|
|
386
|
+
if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
|
|
387
|
+
setTimeout(function () {
|
|
388
|
+
form.validateFields(validateFieldKeys);
|
|
389
|
+
}, 100);
|
|
386
390
|
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
}
|
|
392
|
-
});
|
|
391
|
+
}
|
|
392
|
+
setState({
|
|
393
|
+
forceUpdate: {
|
|
394
|
+
d: Date.now()
|
|
393
395
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
})
|
|
400
|
-
|
|
401
|
-
return _ref2.apply(this, arguments);
|
|
402
|
-
};
|
|
403
|
-
}();
|
|
396
|
+
});
|
|
397
|
+
case 32:
|
|
398
|
+
case "end":
|
|
399
|
+
return _context.stop();
|
|
400
|
+
}
|
|
401
|
+
}, _callee);
|
|
402
|
+
})), 300);
|
|
404
403
|
var _onblur = /*#__PURE__*/function () {
|
|
405
404
|
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
406
405
|
var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
|
|
@@ -419,6 +418,12 @@ var RenderField = function RenderField(_ref) {
|
|
|
419
418
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
420
419
|
while (1) switch (_context2.prev = _context2.next) {
|
|
421
420
|
case 0:
|
|
421
|
+
if (onBlur) {
|
|
422
|
+
_context2.next = 2;
|
|
423
|
+
break;
|
|
424
|
+
}
|
|
425
|
+
return _context2.abrupt("return", null);
|
|
426
|
+
case 2:
|
|
422
427
|
for (_len3 = _args3.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
423
428
|
args[_key3] = _args3[_key3];
|
|
424
429
|
}
|
|
@@ -429,22 +434,22 @@ var RenderField = function RenderField(_ref) {
|
|
|
429
434
|
_args[1] = row;
|
|
430
435
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
431
436
|
if (!_context2.t0) {
|
|
432
|
-
_context2.next =
|
|
437
|
+
_context2.next = 12;
|
|
433
438
|
break;
|
|
434
439
|
}
|
|
435
|
-
_context2.next =
|
|
440
|
+
_context2.next = 12;
|
|
436
441
|
return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, (0, _toConsumableArray2.default)(_args));
|
|
437
|
-
case
|
|
442
|
+
case 12:
|
|
438
443
|
_context2.t1 = onBlur;
|
|
439
444
|
if (!_context2.t1) {
|
|
440
|
-
_context2.next =
|
|
445
|
+
_context2.next = 16;
|
|
441
446
|
break;
|
|
442
447
|
}
|
|
443
|
-
_context2.next =
|
|
448
|
+
_context2.next = 16;
|
|
444
449
|
return onBlur.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
445
|
-
case
|
|
450
|
+
case 16:
|
|
446
451
|
// 判断属性是否变动
|
|
447
|
-
form.setFieldValue(rowPath,
|
|
452
|
+
form.setFieldValue(rowPath, row);
|
|
448
453
|
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
449
454
|
diff = (0, _tools.difference)(row, orgRow) || {};
|
|
450
455
|
validateFieldKeys = (_Object$keys2 = Object.keys(diff)) === null || _Object$keys2 === void 0 ? void 0 : (_Object$keys2$map = _Object$keys2.map) === null || _Object$keys2$map === void 0 ? void 0 : _Object$keys2$map.call(_Object$keys2, function (key) {
|
|
@@ -455,25 +460,23 @@ var RenderField = function RenderField(_ref) {
|
|
|
455
460
|
}
|
|
456
461
|
}
|
|
457
462
|
if (!isCell) {
|
|
458
|
-
_context2.next =
|
|
463
|
+
_context2.next = 22;
|
|
459
464
|
break;
|
|
460
465
|
}
|
|
461
|
-
_context2.next =
|
|
466
|
+
_context2.next = 21;
|
|
462
467
|
return form.validateFields([cellName]);
|
|
463
|
-
case
|
|
468
|
+
case 21:
|
|
464
469
|
setState({
|
|
465
470
|
cellNamePath: []
|
|
466
471
|
});
|
|
467
|
-
case
|
|
472
|
+
case 22:
|
|
468
473
|
// 单行编辑时需要 强制更新视图
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
}
|
|
476
|
-
case 21:
|
|
474
|
+
setState({
|
|
475
|
+
forceUpdate: {
|
|
476
|
+
d: Date.now()
|
|
477
|
+
}
|
|
478
|
+
});
|
|
479
|
+
case 23:
|
|
477
480
|
case "end":
|
|
478
481
|
return _context2.stop();
|
|
479
482
|
}
|
|
@@ -11,7 +11,6 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _antd = require("antd");
|
|
13
13
|
var _core = require("@dnd-kit/core");
|
|
14
|
-
var _lodash = require("lodash");
|
|
15
14
|
var _sortable = require("@dnd-kit/sortable");
|
|
16
15
|
var _utils = require("../../../utils");
|
|
17
16
|
var _utils2 = require("./utils");
|
|
@@ -62,10 +61,6 @@ var FormList = function FormList(props, ref) {
|
|
|
62
61
|
listName: [].concat((0, _toConsumableArray2.default)(namePath), [item.name]),
|
|
63
62
|
label: mode === 'less' ? undefined : item.label
|
|
64
63
|
});
|
|
65
|
-
// 可编辑表格的columns需要消除引用关系,防止串数据
|
|
66
|
-
if (column.type === 'ProEditTable' && !(0, _lodash.isFunction)(column.fieldProps)) {
|
|
67
|
-
column.fieldProps.columns = (0, _lodash.cloneDeep)(column.fieldProps.columns);
|
|
68
|
-
}
|
|
69
64
|
return column;
|
|
70
65
|
});
|
|
71
66
|
}, [columns]);
|
|
@@ -157,7 +157,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
157
157
|
var defaultOptionRender = function defaultOptionRender(rowData) {
|
|
158
158
|
return rowData === null || rowData === void 0 ? void 0 : rowData[labelKey];
|
|
159
159
|
};
|
|
160
|
-
var handleFormat =
|
|
160
|
+
var handleFormat = onFormat || defaultOptionRender;
|
|
161
161
|
if (showCodeName) {
|
|
162
162
|
handleFormat = function handleFormat(_ref5) {
|
|
163
163
|
var value = _ref5.value,
|
|
@@ -678,6 +678,7 @@ var ProModalSelect = function ProModalSelect(props, ref) {
|
|
|
678
678
|
showCodeName: showCodeName,
|
|
679
679
|
labelInValue: labelInValue,
|
|
680
680
|
dataSource: options,
|
|
681
|
+
optionRender: optionRender,
|
|
681
682
|
scrollFollowParent: false,
|
|
682
683
|
mode: isMultiple ? 'multiple' : undefined,
|
|
683
684
|
onFocus: function onFocus() {
|