sapo-components-ui-rn 1.0.66 → 1.0.67

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 CHANGED
@@ -7319,12 +7319,19 @@ var NumberKeyboard = function (_a) {
7319
7319
  }, [inputValue, maxValue, type, formatDecimal]);
7320
7320
  var handleClear = useCallback(function () {
7321
7321
  setInputValue("");
7322
- }, []);
7322
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("0");
7323
+ }, [onChangeText]);
7323
7324
  var handleSave = useCallback(function () {
7324
7325
  var finalValue = inputValue;
7325
7326
  if (inputValue.endsWith(".")) {
7326
7327
  finalValue = inputValue.slice(0, -1);
7327
7328
  }
7329
+ // Nếu giá trị rỗng hoặc chỉ có dấu chấm, trả về "0"
7330
+ if (!finalValue || finalValue === ".") {
7331
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText("0");
7332
+ onClose();
7333
+ return;
7334
+ }
7328
7335
  // Ép kiểu kết quả thành số theo type
7329
7336
  if (type === "integer") {
7330
7337
  var intValue = parseInt(finalValue, 10);