diginet-core-ui 1.4.56-beta.2 → 1.4.56-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.
|
@@ -169,11 +169,13 @@ const NumberInput = /*#__PURE__*/forwardRef((inProps, reference) => {
|
|
|
169
169
|
return number;
|
|
170
170
|
}, [decimalSymbol]);
|
|
171
171
|
const _onInput = useCallback((e, flag) => {
|
|
172
|
-
var _e$target$value,
|
|
172
|
+
var _e$target$value, _limitValueT$toString, _limitValueT$toString2, _limitValueT$toString3, _limitValueT$toString4, _limitValueT$toString5, _limitValueT$toString6;
|
|
173
173
|
let valueT = (_e$target$value = e.target.value) !== null && _e$target$value !== void 0 ? _e$target$value : e.value;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
if (
|
|
174
|
+
// xóa các số "0" đứng trước giá trị ví dụ: 0100, 0200 để tránh lỗi Octal literals are not allowed in strict mode
|
|
175
|
+
let limitValueT = valueT.split(/([+\-*/])/).map(a => parseFloat(a) || a).join('');
|
|
176
|
+
if (disabledNegative && eval(((_limitValueT$toString = (_limitValueT$toString2 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString === void 0 ? void 0 : _limitValueT$toString.call(_limitValueT$toString2, decimalSymbol, '.')) || 0) <= 0 || limitValueT.includes('-')) valueT = 0;
|
|
177
|
+
if ((min || min === 0) && eval((_limitValueT$toString3 = (_limitValueT$toString4 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString3 === void 0 ? void 0 : _limitValueT$toString3.call(_limitValueT$toString4, decimalSymbol, '.')) <= min || min === 0 && limitValueT.includes('-')) valueT = min;
|
|
178
|
+
if ((max || max === 0) && eval((_limitValueT$toString5 = (_limitValueT$toString6 = limitValueT.toString().replaceAll(thousandSymbol, '')).replaceAll) === null || _limitValueT$toString5 === void 0 ? void 0 : _limitValueT$toString5.call(_limitValueT$toString6, decimalSymbol, '.')) >= max) valueT = max;
|
|
177
179
|
valueT = parseNumberToMoney(valueT);
|
|
178
180
|
const returnValue = convertMoneyToNumber(valueT);
|
|
179
181
|
e.value = globalRef.current.value = !isNaN(parseFloat(returnValue)) ? parseFloat(returnValue) : null;
|