sapo-components-ui-rn 1.1.42 → 1.1.44
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 +7 -16
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/NumberKeyboard/index.tsx +4 -6
- package/src/components/TextInput/TextInputNumber.tsx +2 -7
- package/src/utils/toast-manager.tsx +3 -1
package/dist/index.esm.js
CHANGED
|
@@ -5927,14 +5927,8 @@ var TextInputNumber = function (_a) {
|
|
|
5927
5927
|
if (inputValue.endsWith(".")) {
|
|
5928
5928
|
finalValue = inputValue.slice(0, -1);
|
|
5929
5929
|
}
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
setNumberValue(finalValue);
|
|
5933
|
-
}
|
|
5934
|
-
else {
|
|
5935
|
-
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(formatNumberInput$1(finalValue, formatDecimal));
|
|
5936
|
-
setNumberValue(formatNumberInput$1(finalValue, formatDecimal));
|
|
5937
|
-
}
|
|
5930
|
+
// Luôn truyền giá trị gốc (không format) để giữ nguyên dạng số
|
|
5931
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(finalValue);
|
|
5938
5932
|
setIsShowModalKeyboard(false);
|
|
5939
5933
|
};
|
|
5940
5934
|
var checkValueEmpty = function () {
|
|
@@ -7751,14 +7745,10 @@ var NumberKeyboard = function (_a) {
|
|
|
7751
7745
|
if (inputValue.endsWith(".")) {
|
|
7752
7746
|
finalValue = inputValue.slice(0, -1);
|
|
7753
7747
|
}
|
|
7754
|
-
|
|
7755
|
-
|
|
7756
|
-
}
|
|
7757
|
-
else {
|
|
7758
|
-
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(formatNumberInput(finalValue, formatDecimal));
|
|
7759
|
-
}
|
|
7748
|
+
// Luôn truyền giá trị gốc (không format) để giữ nguyên dạng số
|
|
7749
|
+
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(finalValue);
|
|
7760
7750
|
onClose();
|
|
7761
|
-
}, [inputValue, onChangeText, onClose
|
|
7751
|
+
}, [inputValue, onChangeText, onClose]);
|
|
7762
7752
|
var handleClose = useCallback(function () {
|
|
7763
7753
|
onClose();
|
|
7764
7754
|
setTimeout(function () {
|
|
@@ -7866,7 +7856,8 @@ var index = React__default.memo(NumberKeyboard);
|
|
|
7866
7856
|
|
|
7867
7857
|
var toastRef = React__default.createRef();
|
|
7868
7858
|
var showToast = function (_a) {
|
|
7869
|
-
var message = _a.message, _b = _a.duration, duration = _b === void 0 ?
|
|
7859
|
+
var message = _a.message, _b = _a.duration, duration = _b === void 0 ? 3000 : _b, _c = _a.position, position = _c === void 0 ? "bottom" : _c, _d = _a.type, type = _d === void 0 ? "success" : _d, _e = _a.onPress, onPress = _e === void 0 ? function () { } : _e, title = _a.title, _f = _a.spacer, spacer = _f === void 0 ? "normal" : _f;
|
|
7860
|
+
Keyboard.dismiss();
|
|
7870
7861
|
if (!toastRef.current) {
|
|
7871
7862
|
console.warn("Toast component is not mounted. Make sure to add <ToastProvider> to your app.");
|
|
7872
7863
|
return;
|