sapo-components-ui-rn 1.1.13 → 1.1.14
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 +10 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/SearchInput/index.tsx +1 -1
- package/src/components/TextInput/TextInputNumber.tsx +5 -0
- package/src/styles/themes/tokens.tsx +4 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
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,6 +215,7 @@ 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
219
|
var ref = {
|
|
219
220
|
palette: {
|
|
220
221
|
dark: {
|
|
@@ -571,8 +572,8 @@ var typescale = {
|
|
|
571
572
|
};
|
|
572
573
|
var ThemeColors = ref.palette;
|
|
573
574
|
var CONSTANTS = {
|
|
574
|
-
DEVICE_HEIGHT:
|
|
575
|
-
DEVICE_WIDTH:
|
|
575
|
+
DEVICE_HEIGHT: height,
|
|
576
|
+
DEVICE_WIDTH: width,
|
|
576
577
|
HEADER_HEIGHT: 50,
|
|
577
578
|
BUTTON_HEIGHT: 48,
|
|
578
579
|
BUTTON_HEIGHT_SMALL: 36,
|
|
@@ -5757,6 +5758,7 @@ var TextInputNumber = function (_a) {
|
|
|
5757
5758
|
}
|
|
5758
5759
|
setIsFirstInput(false);
|
|
5759
5760
|
}
|
|
5761
|
+
// Nếu type là float, không cho phép nhập "000" ở đầu
|
|
5760
5762
|
}
|
|
5761
5763
|
else if (key === ".") {
|
|
5762
5764
|
if (!inputValue.includes(".")) {
|
|
@@ -5772,6 +5774,10 @@ var TextInputNumber = function (_a) {
|
|
|
5772
5774
|
}
|
|
5773
5775
|
else {
|
|
5774
5776
|
if (isFirstInput) {
|
|
5777
|
+
// Nếu type là float và key là "0", không cho phép nhập số 0 đầu tiên
|
|
5778
|
+
if (type === "float" && (key === "0" || key === "000")) {
|
|
5779
|
+
return;
|
|
5780
|
+
}
|
|
5775
5781
|
setInputValue(key);
|
|
5776
5782
|
setIsFirstInput(false);
|
|
5777
5783
|
}
|
|
@@ -7250,7 +7256,7 @@ var styles$2 = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
|
|
|
7250
7256
|
var index$1 = React__default.memo(SelectionField);
|
|
7251
7257
|
|
|
7252
7258
|
var SearchInput = function (_a) {
|
|
7253
|
-
var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rightIcon = _a.rightIcon, _d = _a.clearButton, clearButton = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "Tìm kiếm" : _e, onFocus = _a.onFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText, style = _a.style, height = _a.height, _f = _a.debounceTime, debounceTime = _f === void 0 ?
|
|
7259
|
+
var _b = _a.value, value = _b === void 0 ? "" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, rightIcon = _a.rightIcon, _d = _a.clearButton, clearButton = _d === void 0 ? false : _d, _e = _a.placeholder, placeholder = _e === void 0 ? "Tìm kiếm" : _e, onFocus = _a.onFocus, onBlur = _a.onBlur, onChangeText = _a.onChangeText, style = _a.style, height = _a.height, _f = _a.debounceTime, debounceTime = _f === void 0 ? 200 : _f, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g;
|
|
7254
7260
|
var theme = useInternalTheme();
|
|
7255
7261
|
var colors = theme.colors;
|
|
7256
7262
|
var debouncedOnChangeText = useDebouncedCallback(function (text) {
|