@zat-design/sisyphus-react 3.6.4-beta.6 → 3.6.4-beta.8
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.
|
@@ -422,25 +422,24 @@ var RenderField = function RenderField(_ref) {
|
|
|
422
422
|
_args = formatArgs([].concat(args));
|
|
423
423
|
rowPath = [].concat(_toConsumableArray(namePath), [index]);
|
|
424
424
|
row = form.getFieldValue(rowPath, true);
|
|
425
|
-
if (type === 'InputNumber' && column.name) row[column.name] = args[0];
|
|
426
425
|
orgRow = cloneDeep(row);
|
|
427
426
|
_args[1] = row;
|
|
428
427
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
429
428
|
if (!_context2.t0) {
|
|
430
|
-
_context2.next =
|
|
429
|
+
_context2.next = 10;
|
|
431
430
|
break;
|
|
432
431
|
}
|
|
433
|
-
_context2.next =
|
|
432
|
+
_context2.next = 10;
|
|
434
433
|
return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, _toConsumableArray(_args));
|
|
435
|
-
case
|
|
434
|
+
case 10:
|
|
436
435
|
_context2.t1 = onBlur;
|
|
437
436
|
if (!_context2.t1) {
|
|
438
|
-
_context2.next =
|
|
437
|
+
_context2.next = 14;
|
|
439
438
|
break;
|
|
440
439
|
}
|
|
441
|
-
_context2.next =
|
|
440
|
+
_context2.next = 14;
|
|
442
441
|
return onBlur.apply(void 0, _toConsumableArray(_args));
|
|
443
|
-
case
|
|
442
|
+
case 14:
|
|
444
443
|
// 判断属性是否变动
|
|
445
444
|
form.setFieldValue(rowPath, _objectSpread({}, row));
|
|
446
445
|
if (!isEqual(orgRow, row)) {
|
|
@@ -453,16 +452,16 @@ var RenderField = function RenderField(_ref) {
|
|
|
453
452
|
}
|
|
454
453
|
}
|
|
455
454
|
if (!isCell) {
|
|
456
|
-
_context2.next =
|
|
455
|
+
_context2.next = 20;
|
|
457
456
|
break;
|
|
458
457
|
}
|
|
459
|
-
_context2.next =
|
|
458
|
+
_context2.next = 19;
|
|
460
459
|
return form.validateFields([cellName]);
|
|
461
|
-
case
|
|
460
|
+
case 19:
|
|
462
461
|
setState({
|
|
463
462
|
cellNamePath: []
|
|
464
463
|
});
|
|
465
|
-
case
|
|
464
|
+
case 20:
|
|
466
465
|
// 单行编辑时需要 强制更新视图
|
|
467
466
|
if (virtualKey) {
|
|
468
467
|
setState({
|
|
@@ -471,7 +470,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
471
470
|
}
|
|
472
471
|
});
|
|
473
472
|
}
|
|
474
|
-
case
|
|
473
|
+
case 21:
|
|
475
474
|
case "end":
|
|
476
475
|
return _context2.stop();
|
|
477
476
|
}
|
|
@@ -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) {
|
|
@@ -242,6 +242,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
242
242
|
value = _min;
|
|
243
243
|
}
|
|
244
244
|
value = _parser(String(value), props.precision);
|
|
245
|
+
rest === null || rest === void 0 ? void 0 : rest.onChange(value);
|
|
245
246
|
var limit = {
|
|
246
247
|
min: Number(_min),
|
|
247
248
|
max: Number(_max)
|
|
@@ -425,25 +425,24 @@ var RenderField = function RenderField(_ref) {
|
|
|
425
425
|
_args = formatArgs([].concat(args));
|
|
426
426
|
rowPath = [].concat((0, _toConsumableArray2.default)(namePath), [index]);
|
|
427
427
|
row = form.getFieldValue(rowPath, true);
|
|
428
|
-
if (type === 'InputNumber' && column.name) row[column.name] = args[0];
|
|
429
428
|
orgRow = (0, _lodash.cloneDeep)(row);
|
|
430
429
|
_args[1] = row;
|
|
431
430
|
_context2.t0 = (_TargetComponent3 = TargetComponent) === null || _TargetComponent3 === void 0 ? void 0 : (_TargetComponent3$pro = _TargetComponent3.props) === null || _TargetComponent3$pro === void 0 ? void 0 : _TargetComponent3$pro.onBlur;
|
|
432
431
|
if (!_context2.t0) {
|
|
433
|
-
_context2.next =
|
|
432
|
+
_context2.next = 10;
|
|
434
433
|
break;
|
|
435
434
|
}
|
|
436
|
-
_context2.next =
|
|
435
|
+
_context2.next = 10;
|
|
437
436
|
return (_TargetComponent$prop4 = TargetComponent.props).onBlur.apply(_TargetComponent$prop4, (0, _toConsumableArray2.default)(_args));
|
|
438
|
-
case
|
|
437
|
+
case 10:
|
|
439
438
|
_context2.t1 = onBlur;
|
|
440
439
|
if (!_context2.t1) {
|
|
441
|
-
_context2.next =
|
|
440
|
+
_context2.next = 14;
|
|
442
441
|
break;
|
|
443
442
|
}
|
|
444
|
-
_context2.next =
|
|
443
|
+
_context2.next = 14;
|
|
445
444
|
return onBlur.apply(void 0, (0, _toConsumableArray2.default)(_args));
|
|
446
|
-
case
|
|
445
|
+
case 14:
|
|
447
446
|
// 判断属性是否变动
|
|
448
447
|
form.setFieldValue(rowPath, (0, _objectSpread2.default)({}, row));
|
|
449
448
|
if (!(0, _lodash.isEqual)(orgRow, row)) {
|
|
@@ -456,16 +455,16 @@ var RenderField = function RenderField(_ref) {
|
|
|
456
455
|
}
|
|
457
456
|
}
|
|
458
457
|
if (!isCell) {
|
|
459
|
-
_context2.next =
|
|
458
|
+
_context2.next = 20;
|
|
460
459
|
break;
|
|
461
460
|
}
|
|
462
|
-
_context2.next =
|
|
461
|
+
_context2.next = 19;
|
|
463
462
|
return form.validateFields([cellName]);
|
|
464
|
-
case
|
|
463
|
+
case 19:
|
|
465
464
|
setState({
|
|
466
465
|
cellNamePath: []
|
|
467
466
|
});
|
|
468
|
-
case
|
|
467
|
+
case 20:
|
|
469
468
|
// 单行编辑时需要 强制更新视图
|
|
470
469
|
if (virtualKey) {
|
|
471
470
|
setState({
|
|
@@ -474,7 +473,7 @@ var RenderField = function RenderField(_ref) {
|
|
|
474
473
|
}
|
|
475
474
|
});
|
|
476
475
|
}
|
|
477
|
-
case
|
|
476
|
+
case 21:
|
|
478
477
|
case "end":
|
|
479
478
|
return _context2.stop();
|
|
480
479
|
}
|
|
@@ -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) {
|
|
@@ -246,6 +246,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
246
246
|
value = _min;
|
|
247
247
|
}
|
|
248
248
|
value = _parser(String(value), props.precision);
|
|
249
|
+
rest === null || rest === void 0 ? void 0 : rest.onChange(value);
|
|
249
250
|
var limit = {
|
|
250
251
|
min: Number(_min),
|
|
251
252
|
max: Number(_max)
|