@signalplus/params-about 0.1.42 → 0.1.43
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/lib/es/index.js +4 -4
- package/package.json +1 -1
package/lib/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Bundle of @signalplus/params-about
|
|
3
3
|
* Generated: 2022-04-19
|
|
4
|
-
* Version: 0.1.
|
|
4
|
+
* Version: 0.1.43
|
|
5
5
|
* License: MIT
|
|
6
6
|
* Author: 2631541504@qq.com
|
|
7
7
|
*/
|
|
@@ -467,7 +467,7 @@ var NumCvt = /*#__PURE__*/function () {
|
|
|
467
467
|
}, {
|
|
468
468
|
key: "emit",
|
|
469
469
|
value: function emit(val, isPercentage) {
|
|
470
|
-
if (!val) return undefined;
|
|
470
|
+
if (!val || val === '-') return undefined;
|
|
471
471
|
if (!isPercentage) return +val;
|
|
472
472
|
return +Big(val).div(100);
|
|
473
473
|
}
|
|
@@ -514,7 +514,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
|
|
|
514
514
|
}, function () {
|
|
515
515
|
var _this$props$onChange, _this$props;
|
|
516
516
|
|
|
517
|
-
if (
|
|
517
|
+
if (value !== _this.props.value) (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
518
518
|
});
|
|
519
519
|
});
|
|
520
520
|
|
|
@@ -554,7 +554,7 @@ var Num = /*#__PURE__*/function (_PureComponent) {
|
|
|
554
554
|
}], [{
|
|
555
555
|
key: "getDerivedStateFromProps",
|
|
556
556
|
value: function getDerivedStateFromProps(props, state) {
|
|
557
|
-
if (props.value !== state.preProps.value &&
|
|
557
|
+
if (props.value !== state.preProps.value && NumCvt.emit(state.tempValue, props.isPercentage) !== props.value) {
|
|
558
558
|
state.tempValue = NumCvt.show(props.value, props.isPercentage);
|
|
559
559
|
}
|
|
560
560
|
|