sapo-components-ui-rn 1.1.16 → 1.1.17

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
@@ -1,4 +1,4 @@
1
- import { useWindowDimensions, Platform, StyleSheet, Dimensions, useColorScheme, TouchableOpacity, View as View$1, Text as Text$2, Animated as Animated$1, Pressable, I18nManager, TextInput as TextInput$1, Modal, Keyboard, ActivityIndicator, ImageBackground, Image as Image$2 } from 'react-native';
1
+ import { Dimensions, Platform, StyleSheet, useColorScheme, TouchableOpacity, View as View$1, Text as Text$2, Animated as Animated$1, Pressable, I18nManager, useWindowDimensions, TextInput as TextInput$1, Modal, Keyboard, ActivityIndicator, ImageBackground, Image as Image$2 } from 'react-native';
2
2
  import * as React$3 from 'react';
3
3
  import React__default, { memo, useCallback, forwardRef as forwardRef$1, useMemo, useState, useEffect, useRef, useImperativeHandle } from 'react';
4
4
  import require$$1 from 'deepmerge';
@@ -215,7 +215,8 @@ var yellow = {
215
215
  YELLOW_STATUS: YELLOW_STATUS,
216
216
  };
217
217
 
218
- var _a$1 = useWindowDimensions(), height = _a$1.height, width = _a$1.width;
218
+ var DEVICE_HEIGHT = Dimensions.get("window").height;
219
+ var DEVICE_WIDTH = Dimensions.get("window").width;
219
220
  var ref = {
220
221
  palette: {
221
222
  dark: {
@@ -572,8 +573,8 @@ var typescale = {
572
573
  };
573
574
  var ThemeColors = ref.palette;
574
575
  var CONSTANTS = {
575
- DEVICE_HEIGHT: height,
576
- DEVICE_WIDTH: width,
576
+ DEVICE_HEIGHT: DEVICE_HEIGHT,
577
+ DEVICE_WIDTH: DEVICE_WIDTH,
577
578
  HEADER_HEIGHT: 50,
578
579
  BUTTON_HEIGHT: 48,
579
580
  BUTTON_HEIGHT_SMALL: 36,
@@ -5758,6 +5759,7 @@ var TextInputNumber = function (_a) {
5758
5759
  }
5759
5760
  setIsFirstInput(false);
5760
5761
  }
5762
+ // Nếu type là float, không cho phép nhập "000" ở đầu
5761
5763
  }
5762
5764
  else if (key === ".") {
5763
5765
  if (!inputValue.includes(".")) {
@@ -5773,6 +5775,10 @@ var TextInputNumber = function (_a) {
5773
5775
  }
5774
5776
  else {
5775
5777
  if (isFirstInput) {
5778
+ // Nếu type là float và key là "0", không cho phép nhập số 0 đầu tiên
5779
+ if (type === "float" && (key === "0" || key === "000")) {
5780
+ return;
5781
+ }
5776
5782
  setInputValue(key);
5777
5783
  setIsFirstInput(false);
5778
5784
  }