sapo-components-ui-rn 1.0.65 → 1.0.66
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/dist/index.esm.js +12 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/NumberKeyboard/index.tsx +12 -2
package/dist/index.esm.js
CHANGED
|
@@ -7325,9 +7325,19 @@ var NumberKeyboard = function (_a) {
|
|
|
7325
7325
|
if (inputValue.endsWith(".")) {
|
|
7326
7326
|
finalValue = inputValue.slice(0, -1);
|
|
7327
7327
|
}
|
|
7328
|
-
|
|
7328
|
+
// Ép kiểu kết quả thành số theo type
|
|
7329
|
+
if (type === "integer") {
|
|
7330
|
+
var intValue = parseInt(finalValue, 10);
|
|
7331
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(intValue.toString());
|
|
7332
|
+
}
|
|
7333
|
+
else {
|
|
7334
|
+
var floatValue = parseFloat(finalValue);
|
|
7335
|
+
// Giới hạn số chữ số thập phân theo formatDecimal
|
|
7336
|
+
var formattedFloat = floatValue.toFixed(formatDecimal);
|
|
7337
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(formattedFloat);
|
|
7338
|
+
}
|
|
7329
7339
|
onClose();
|
|
7330
|
-
}, [inputValue, onChangeText, onClose]);
|
|
7340
|
+
}, [inputValue, onChangeText, onClose, type, formatDecimal]);
|
|
7331
7341
|
var handleClose = useCallback(function () {
|
|
7332
7342
|
onClose();
|
|
7333
7343
|
setTimeout(function () {
|