@autobest-ui/components 2.7.2 → 2.7.4

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.
@@ -230,8 +230,10 @@ var InputNumberNotRef = /** @class */function (_super) {
230
230
  var nextState = {};
231
231
  // 判断是否为受控方式
232
232
  if ('value' in nextProps) {
233
- var fixedValueStr = toFixed(nextProps.value, nextProps.precision);
234
- if (nextProps.value !== prevStates.parserValue) {
233
+ if (nextProps.value !== prevStates.parserValue && (
234
+ // 兼容外部传入空string/null的情况, 只有当一个值非空时,才会重新重置State信息
235
+ !isBlank(nextProps.value) || !isBlank(prevStates.parserValue))) {
236
+ var fixedValueStr = toFixed(nextProps.value, nextProps.precision);
235
237
  nextState.parserValue = getNumberFromString(fixedValueStr);
236
238
  nextState.originalValueStr = fixedValueStr;
237
239
  }
@@ -237,8 +237,10 @@ var InputNumberNotRef = /** @class */function (_super) {
237
237
  var nextState = {};
238
238
  // 判断是否为受控方式
239
239
  if ('value' in nextProps) {
240
- var fixedValueStr = (0, _utils.toFixed)(nextProps.value, nextProps.precision);
241
- if (nextProps.value !== prevStates.parserValue) {
240
+ if (nextProps.value !== prevStates.parserValue && (
241
+ // 兼容外部传入空string/null的情况, 只有当一个值非空时,才会重新重置State信息
242
+ !(0, _utils.isBlank)(nextProps.value) || !(0, _utils.isBlank)(prevStates.parserValue))) {
243
+ var fixedValueStr = (0, _utils.toFixed)(nextProps.value, nextProps.precision);
242
244
  nextState.parserValue = (0, _utils.getNumberFromString)(fixedValueStr);
243
245
  nextState.originalValueStr = fixedValueStr;
244
246
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobest-ui/components",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "private": false,
5
5
  "description": "components common ui for React",
6
6
  "main": "lib/index.js",
@@ -52,5 +52,5 @@
52
52
  "dependencies": {
53
53
  "@autobest-ui/utils": "^2.1.1"
54
54
  },
55
- "gitHead": "14b9ede21e68b375c8cb7647aff360bdcbf9ef9d"
55
+ "gitHead": "ed3535b85c50ef0d318a0affc6e529cd45fe634f"
56
56
  }