@zat-design/sisyphus-react 3.6.4-beta.1 → 3.6.4-beta.3

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.
@@ -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, debounce, omit, isFunction } from 'lodash';
20
+ import { cloneDeep, isEqual, 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,101 +296,108 @@ var RenderField = function RenderField(_ref) {
296
296
  }, 100);
297
297
  };
298
298
  // 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
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
- for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
322
- args[_key2] = _args2[_key2];
323
- }
324
- _args = [].concat(args);
325
- rowPath = [].concat(_toConsumableArray(namePath), [index]);
326
- row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
327
- orgRow = cloneDeep(row);
328
- if (!onFieldChange) {
329
- _context.next = 18;
330
- break;
331
- }
332
- _args = formatArgs(args);
333
- _args[1] = row;
334
- _context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
335
- if (!_context.t0) {
299
+ var _onChange = /*#__PURE__*/function () {
300
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
301
+ var _len2,
302
+ args,
303
+ _key2,
304
+ _args,
305
+ rowPath,
306
+ row,
307
+ orgRow,
308
+ _TargetComponent,
309
+ _TargetComponent$prop,
310
+ _TargetComponent$prop2,
311
+ _TargetComponent2,
312
+ _TargetComponent2$pro,
313
+ _TargetComponent$prop3,
314
+ _Object$keys,
315
+ _Object$keys$map,
316
+ diff,
317
+ validateFieldKeys,
318
+ _args2 = arguments;
319
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
320
+ while (1) switch (_context.prev = _context.next) {
321
+ case 0:
322
+ for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
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
+ }
336
340
  _context.next = 12;
337
- break;
338
- }
339
- _context.next = 12;
340
- return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, _toConsumableArray(_args));
341
- case 12:
342
- _context.t1 = onFieldChange;
343
- if (!_context.t1) {
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
+ }
344
348
  _context.next = 16;
349
+ return onFieldChange.apply(void 0, _toConsumableArray(_args));
350
+ case 16:
351
+ _context.next = 27;
345
352
  break;
346
- }
347
- _context.next = 16;
348
- return onFieldChange.apply(void 0, _toConsumableArray(_args));
349
- case 16:
350
- _context.next = 27;
351
- break;
352
- case 18:
353
- _args = _args.concat([row, index, form]);
354
- _context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
355
- if (!_context.t2) {
353
+ case 18:
354
+ _args = _args.concat([row, index, form]);
355
+ _context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
356
+ if (!_context.t2) {
357
+ _context.next = 23;
358
+ break;
359
+ }
356
360
  _context.next = 23;
357
- break;
358
- }
359
- _context.next = 23;
360
- return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
361
- case 23:
362
- _context.t3 = onChange;
363
- if (!_context.t3) {
361
+ return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, _toConsumableArray(_args));
362
+ case 23:
363
+ _context.t3 = onChange;
364
+ if (!_context.t3) {
365
+ _context.next = 27;
366
+ break;
367
+ }
364
368
  _context.next = 27;
365
- break;
366
- }
367
- _context.next = 27;
368
- return onChange.apply(void 0, _toConsumableArray(_args));
369
- case 27:
370
- // 判断属性是否变动
371
- form.setFieldValue(rowPath, row);
372
- if (!isEqual(orgRow, row)) {
373
- diff = difference(row, orgRow) || {};
374
- 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) {
375
- return [].concat(_toConsumableArray(rowPath), [key]);
376
- });
377
- if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
378
- setTimeout(function () {
379
- form.validateFields(validateFieldKeys);
380
- }, 100);
369
+ return onChange.apply(void 0, _toConsumableArray(_args));
370
+ case 27:
371
+ // 判断属性是否变动
372
+ form.setFieldValue(rowPath, _objectSpread({}, row));
373
+ if (!isEqual(orgRow, row)) {
374
+ diff = difference(row, orgRow) || {};
375
+ 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) {
376
+ return [].concat(_toConsumableArray(rowPath), [key]);
377
+ });
378
+ if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
379
+ setTimeout(function () {
380
+ form.validateFields(validateFieldKeys);
381
+ }, 100);
382
+ }
381
383
  }
382
- }
383
- setState({
384
- forceUpdate: {
385
- d: Date.now()
384
+ if (virtualKey) {
385
+ setState({
386
+ forceUpdate: {
387
+ d: Date.now()
388
+ }
389
+ });
386
390
  }
387
- });
388
- case 30:
389
- case "end":
390
- return _context.stop();
391
- }
392
- }, _callee);
393
- })), 300);
391
+ case 30:
392
+ case "end":
393
+ return _context.stop();
394
+ }
395
+ }, _callee);
396
+ }));
397
+ return function _onChange() {
398
+ return _ref2.apply(this, arguments);
399
+ };
400
+ }();
394
401
  var _onblur = /*#__PURE__*/function () {
395
402
  var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
396
403
  var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
@@ -415,26 +422,27 @@ var RenderField = function RenderField(_ref) {
415
422
  _args = formatArgs([].concat(args));
416
423
  rowPath = [].concat(_toConsumableArray(namePath), [index]);
417
424
  row = form.getFieldValue(rowPath, true);
425
+ if (type === 'InputNumber' && column.name) row[column.name] = args[0];
418
426
  orgRow = cloneDeep(row);
419
427
  _args[1] = row;
420
428
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
421
429
  if (!_context2.t0) {
422
- _context2.next = 10;
430
+ _context2.next = 11;
423
431
  break;
424
432
  }
425
- _context2.next = 10;
433
+ _context2.next = 11;
426
434
  return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, _toConsumableArray(_args));
427
- case 10:
435
+ case 11:
428
436
  _context2.t1 = onBlur;
429
437
  if (!_context2.t1) {
430
- _context2.next = 14;
438
+ _context2.next = 15;
431
439
  break;
432
440
  }
433
- _context2.next = 14;
441
+ _context2.next = 15;
434
442
  return onBlur.apply(void 0, _toConsumableArray(_args));
435
- case 14:
443
+ case 15:
436
444
  // 判断属性是否变动
437
- form.setFieldValue(rowPath, row);
445
+ form.setFieldValue(rowPath, _objectSpread({}, row));
438
446
  if (!isEqual(orgRow, row)) {
439
447
  diff = difference(row, orgRow) || {};
440
448
  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) {
@@ -445,23 +453,25 @@ var RenderField = function RenderField(_ref) {
445
453
  }
446
454
  }
447
455
  if (!isCell) {
448
- _context2.next = 20;
456
+ _context2.next = 21;
449
457
  break;
450
458
  }
451
- _context2.next = 19;
459
+ _context2.next = 20;
452
460
  return form.validateFields([cellName]);
453
- case 19:
454
- setState({
455
- cellNamePath: []
456
- });
457
461
  case 20:
458
- // 单行编辑时需要 强制更新视图
459
462
  setState({
460
- forceUpdate: {
461
- d: Date.now()
462
- }
463
+ cellNamePath: []
463
464
  });
464
465
  case 21:
466
+ // 单行编辑时需要 强制更新视图
467
+ if (virtualKey) {
468
+ setState({
469
+ forceUpdate: {
470
+ d: Date.now()
471
+ }
472
+ });
473
+ }
474
+ case 22:
465
475
  case "end":
466
476
  return _context2.stop();
467
477
  }
@@ -76,7 +76,7 @@ var InputNumber = function InputNumber(props) {
76
76
  var _parser = function parser(value, precision) {
77
77
  var num = Number(value.replace(/[\s,]+/g, ''));
78
78
  if (value === '') return value;
79
- return Number.isNaN(num) || !precision ? value : num.toFixed(precision);
79
+ return Number.isNaN(num) || !precision && precision !== 0 ? value : num.toFixed(precision);
80
80
  };
81
81
  if (valueType) {
82
82
  switch (valueType) {
@@ -172,7 +172,9 @@ var useShouldUpdate = function useShouldUpdate(props) {
172
172
  clearTimeout(timerRef.current);
173
173
  }
174
174
  }
175
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !isEqualWith(rulesRef.current, _rules, customEqualForFun) || !isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) ||
175
+ var equalRes = isEqualWith(rulesRef.current, _rules, customEqualForFun);
176
+ var proEqualRes = isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun);
177
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes ||
176
178
  // 值变更,需要同步更新函数式的fieldProps
177
179
  // (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
178
180
  // !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
@@ -299,101 +299,108 @@ var RenderField = function RenderField(_ref) {
299
299
  }, 100);
300
300
  };
301
301
  // 单元格更新数据时,加个防抖,防止更新频率过快,卡顿
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
- for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
325
- args[_key2] = _args2[_key2];
326
- }
327
- _args = [].concat(args);
328
- rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
329
- row = form.getFieldValue(rowPath, true); // if (type === 'InputNumber' && column.name) row[column.name] = args[0];
330
- orgRow = (0, _lodash.cloneDeep)(row);
331
- if (!onFieldChange) {
332
- _context.next = 18;
333
- break;
334
- }
335
- _args = formatArgs(args);
336
- _args[1] = row;
337
- _context.t0 = (_TargetComponent = TargetComponent) === null || _TargetComponent === void 0 ? void 0 : (_TargetComponent$prop = _TargetComponent.props) === null || _TargetComponent$prop === void 0 ? void 0 : _TargetComponent$prop.onFieldChange;
338
- if (!_context.t0) {
302
+ var _onChange = /*#__PURE__*/function () {
303
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee() {
304
+ var _len2,
305
+ args,
306
+ _key2,
307
+ _args,
308
+ rowPath,
309
+ row,
310
+ orgRow,
311
+ _TargetComponent,
312
+ _TargetComponent$prop,
313
+ _TargetComponent$prop2,
314
+ _TargetComponent2,
315
+ _TargetComponent2$pro,
316
+ _TargetComponent$prop3,
317
+ _Object$keys,
318
+ _Object$keys$map,
319
+ diff,
320
+ validateFieldKeys,
321
+ _args2 = arguments;
322
+ return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
323
+ while (1) switch (_context.prev = _context.next) {
324
+ case 0:
325
+ for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
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
+ }
339
343
  _context.next = 12;
340
- break;
341
- }
342
- _context.next = 12;
343
- return (_TargetComponent$prop2 = TargetComponent.props).onFieldChange.apply(_TargetComponent$prop2, (0, _toConsumableArray2.default)(_args));
344
- case 12:
345
- _context.t1 = onFieldChange;
346
- if (!_context.t1) {
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
+ }
347
351
  _context.next = 16;
352
+ return onFieldChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
353
+ case 16:
354
+ _context.next = 27;
348
355
  break;
349
- }
350
- _context.next = 16;
351
- return onFieldChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
352
- case 16:
353
- _context.next = 27;
354
- break;
355
- case 18:
356
- _args = _args.concat([row, index, form]);
357
- _context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
358
- if (!_context.t2) {
356
+ case 18:
357
+ _args = _args.concat([row, index, form]);
358
+ _context.t2 = (_TargetComponent2 = TargetComponent) === null || _TargetComponent2 === void 0 ? void 0 : (_TargetComponent2$pro = _TargetComponent2.props) === null || _TargetComponent2$pro === void 0 ? void 0 : _TargetComponent2$pro.onChange;
359
+ if (!_context.t2) {
360
+ _context.next = 23;
361
+ break;
362
+ }
359
363
  _context.next = 23;
360
- break;
361
- }
362
- _context.next = 23;
363
- return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, (0, _toConsumableArray2.default)(_args));
364
- case 23:
365
- _context.t3 = onChange;
366
- if (!_context.t3) {
364
+ return (_TargetComponent$prop3 = TargetComponent.props).onChange.apply(_TargetComponent$prop3, (0, _toConsumableArray2.default)(_args));
365
+ case 23:
366
+ _context.t3 = onChange;
367
+ if (!_context.t3) {
368
+ _context.next = 27;
369
+ break;
370
+ }
367
371
  _context.next = 27;
368
- break;
369
- }
370
- _context.next = 27;
371
- return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
372
- case 27:
373
- // 判断属性是否变动
374
- form.setFieldValue(rowPath, row);
375
- if (!(0, _lodash.isEqual)(orgRow, row)) {
376
- diff = (0, _tools.difference)(row, orgRow) || {};
377
- 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) {
378
- return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
379
- });
380
- if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
381
- setTimeout(function () {
382
- form.validateFields(validateFieldKeys);
383
- }, 100);
372
+ return onChange.apply(void 0, (0, _toConsumableArray2.default)(_args));
373
+ case 27:
374
+ // 判断属性是否变动
375
+ form.setFieldValue(rowPath, (0, _objectSpread2.default)({}, row));
376
+ if (!(0, _lodash.isEqual)(orgRow, row)) {
377
+ diff = (0, _tools.difference)(row, orgRow) || {};
378
+ 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) {
379
+ return [].concat((0, _toConsumableArray2.default)(rowPath), [key]);
380
+ });
381
+ if (validateFieldKeys === null || validateFieldKeys === void 0 ? void 0 : validateFieldKeys.length) {
382
+ setTimeout(function () {
383
+ form.validateFields(validateFieldKeys);
384
+ }, 100);
385
+ }
384
386
  }
385
- }
386
- setState({
387
- forceUpdate: {
388
- d: Date.now()
387
+ if (virtualKey) {
388
+ setState({
389
+ forceUpdate: {
390
+ d: Date.now()
391
+ }
392
+ });
389
393
  }
390
- });
391
- case 30:
392
- case "end":
393
- return _context.stop();
394
- }
395
- }, _callee);
396
- })), 300);
394
+ case 30:
395
+ case "end":
396
+ return _context.stop();
397
+ }
398
+ }, _callee);
399
+ }));
400
+ return function _onChange() {
401
+ return _ref2.apply(this, arguments);
402
+ };
403
+ }();
397
404
  var _onblur = /*#__PURE__*/function () {
398
405
  var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
399
406
  var _TargetComponent3, _TargetComponent3$pro, _TargetComponent$prop4;
@@ -418,26 +425,27 @@ var RenderField = function RenderField(_ref) {
418
425
  _args = formatArgs([].concat(args));
419
426
  rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
420
427
  row = form.getFieldValue(rowPath, true);
428
+ if (type === 'InputNumber' && column.name) row[column.name] = args[0];
421
429
  orgRow = (0, _lodash.cloneDeep)(row);
422
430
  _args[1] = row;
423
431
  _context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
424
432
  if (!_context2.t0) {
425
- _context2.next = 10;
433
+ _context2.next = 11;
426
434
  break;
427
435
  }
428
- _context2.next = 10;
436
+ _context2.next = 11;
429
437
  return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, (0, _toConsumableArray2.default)(_args));
430
- case 10:
438
+ case 11:
431
439
  _context2.t1 = onBlur;
432
440
  if (!_context2.t1) {
433
- _context2.next = 14;
441
+ _context2.next = 15;
434
442
  break;
435
443
  }
436
- _context2.next = 14;
444
+ _context2.next = 15;
437
445
  return onBlur.apply(void 0, (0, _toConsumableArray2.default)(_args));
438
- case 14:
446
+ case 15:
439
447
  // 判断属性是否变动
440
- form.setFieldValue(rowPath, row);
448
+ form.setFieldValue(rowPath, (0, _objectSpread2.default)({}, row));
441
449
  if (!(0, _lodash.isEqual)(orgRow, row)) {
442
450
  diff = (0, _tools.difference)(row, orgRow) || {};
443
451
  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) {
@@ -448,23 +456,25 @@ var RenderField = function RenderField(_ref) {
448
456
  }
449
457
  }
450
458
  if (!isCell) {
451
- _context2.next = 20;
459
+ _context2.next = 21;
452
460
  break;
453
461
  }
454
- _context2.next = 19;
462
+ _context2.next = 20;
455
463
  return form.validateFields([cellName]);
456
- case 19:
457
- setState({
458
- cellNamePath: []
459
- });
460
464
  case 20:
461
- // 单行编辑时需要 强制更新视图
462
465
  setState({
463
- forceUpdate: {
464
- d: Date.now()
465
- }
466
+ cellNamePath: []
466
467
  });
467
468
  case 21:
469
+ // 单行编辑时需要 强制更新视图
470
+ if (virtualKey) {
471
+ setState({
472
+ forceUpdate: {
473
+ d: Date.now()
474
+ }
475
+ });
476
+ }
477
+ case 22:
468
478
  case "end":
469
479
  return _context2.stop();
470
480
  }
@@ -80,7 +80,7 @@ var InputNumber = function InputNumber(props) {
80
80
  var _parser = function parser(value, precision) {
81
81
  var num = Number(value.replace(/[\s,]+/g, ''));
82
82
  if (value === '') return value;
83
- return Number.isNaN(num) || !precision ? value : num.toFixed(precision);
83
+ return Number.isNaN(num) || !precision && precision !== 0 ? value : num.toFixed(precision);
84
84
  };
85
85
  if (valueType) {
86
86
  switch (valueType) {
@@ -179,7 +179,9 @@ var useShouldUpdate = function useShouldUpdate(props) {
179
179
  clearTimeout(timerRef.current);
180
180
  }
181
181
  }
182
- if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !(0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun) || !(0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun) ||
182
+ var equalRes = (0, _lodash.isEqualWith)(rulesRef.current, _rules, _index.customEqualForFun);
183
+ var proEqualRes = (0, _lodash.isEqualWith)(fieldPropsRef.current, _fieldProps, _index.customEqualForFun);
184
+ if (_show !== showRef.current || _disabled !== disabledRef.current || _required !== requiredRef.current || !equalRes || !proEqualRes ||
183
185
  // 值变更,需要同步更新函数式的fieldProps
184
186
  // (isEqualWith(fieldPropsRef.current, _fieldProps, customEqualForFun) && !isEqual(prevValues, currentValues)) ||
185
187
  // !isEqualWith(originComponentRef.current, _component, customEqualForFun) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.6.4-beta.1",
3
+ "version": "3.6.4-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",