diginet-core-ui 1.4.51-beta.3 → 1.4.51-beta.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.
|
@@ -137,8 +137,17 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
137
137
|
if (((_number3 = number) === null || _number3 === void 0 ? void 0 : _number3.indexOf(thousandSymbol)) > -1 && selectionStart !== number.length + 1) {
|
|
138
138
|
pos.current = selectionStart + (number.toString().length - 1 === vl.toString().length ? 1 : 0);
|
|
139
139
|
}
|
|
140
|
+
if (fixedDecimalDigit && !!decimalDigit) {
|
|
141
|
+
var _strVal$split;
|
|
142
|
+
const strVal = String(vl);
|
|
143
|
+
const isDecimalNum = strVal.indexOf('.') > -1 && (((_strVal$split = strVal.split('.')) === null || _strVal$split === void 0 ? void 0 : _strVal$split[1]) || '').length >= decimalDigit;
|
|
144
|
+
if (isDecimalNum) {
|
|
145
|
+
const val = Number(vl).toFixed(decimalDigit);
|
|
146
|
+
number = String(val);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
140
149
|
return number;
|
|
141
|
-
}, [decimalSymbol, max, value, decimalDigit]);
|
|
150
|
+
}, [decimalSymbol, max, value, decimalDigit, fixedDecimalDigit]);
|
|
142
151
|
|
|
143
152
|
/**
|
|
144
153
|
* Convert money to format number
|
|
@@ -170,7 +179,7 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
170
179
|
onInput === null || onInput === void 0 ? void 0 : onInput(e);
|
|
171
180
|
setValue(valueT);
|
|
172
181
|
if (flag) _onChange(e);
|
|
173
|
-
}, [min, max]);
|
|
182
|
+
}, [min, max, decimalDigit]);
|
|
174
183
|
const _onBlur = useCallback(e => {
|
|
175
184
|
var _e$value;
|
|
176
185
|
let value = (_e$value = e.value) !== null && _e$value !== void 0 ? _e$value : e.target.value;
|