sapo-components-ui-rn 1.0.26 → 1.0.28

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.
@@ -33,5 +33,5 @@ interface ViewProps {
33
33
  borderWidth?: number;
34
34
  borderColor?: string;
35
35
  }
36
- declare const _default: React.MemoExoticComponent<({ row, full, justifyCenter, justifyBetween, alignCenter, center, color, backgroundColor, width, height, padding, paddingHorizontal, paddingVertical, marginHorizontal, marginVertical, paddingLeft, paddingRight, paddingTop, alignEnd, wrap, borderBottomWidth, borderBottomColor, borderRadius, borderWidth, borderColor, style, onPress, activeOpacity, children, disabled, paddingBottom, }: ViewProps) => React.JSX.Element>;
36
+ declare const _default: React.MemoExoticComponent<({ row, full, justifyCenter, justifyBetween, alignCenter, center, color, backgroundColor, width, height, padding, paddingHorizontal, paddingVertical, marginHorizontal, marginVertical, paddingLeft, paddingRight, paddingTop, alignEnd, wrap, borderBottomWidth, borderBottomColor, borderRadius, borderWidth, borderColor, style, onPress, activeOpacity, children, disabled, }: ViewProps) => React.JSX.Element>;
37
37
  export default _default;
package/dist/index.esm.js CHANGED
@@ -1920,7 +1920,7 @@ var styles$h = StyleSheet.create({
1920
1920
  });
1921
1921
 
1922
1922
  var ViewCustom = function (_a) {
1923
- var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, children = _a.children, disabled = _a.disabled, paddingBottom = _a.paddingBottom;
1923
+ var row = _a.row, full = _a.full, justifyCenter = _a.justifyCenter, justifyBetween = _a.justifyBetween, alignCenter = _a.alignCenter, center = _a.center, color = _a.color, backgroundColor = _a.backgroundColor, width = _a.width, height = _a.height, padding = _a.padding, paddingHorizontal = _a.paddingHorizontal, paddingVertical = _a.paddingVertical, marginHorizontal = _a.marginHorizontal, marginVertical = _a.marginVertical, paddingLeft = _a.paddingLeft, paddingRight = _a.paddingRight, paddingTop = _a.paddingTop, alignEnd = _a.alignEnd, wrap = _a.wrap, borderBottomWidth = _a.borderBottomWidth, borderBottomColor = _a.borderBottomColor, borderRadius = _a.borderRadius, borderWidth = _a.borderWidth, borderColor = _a.borderColor, style = _a.style, onPress = _a.onPress, _b = _a.activeOpacity, activeOpacity = _b === void 0 ? 0.8 : _b, children = _a.children, disabled = _a.disabled;
1924
1924
  var getStyle = function () {
1925
1925
  var styleCustom = {};
1926
1926
  if (row) {
@@ -1990,9 +1990,6 @@ var ViewCustom = function (_a) {
1990
1990
  if (borderBottomColor) {
1991
1991
  styleCustom.borderBottomColor = borderBottomColor;
1992
1992
  }
1993
- if (paddingBottom) {
1994
- styleCustom.paddingBottom = paddingBottom;
1995
- }
1996
1993
  if (borderRadius) {
1997
1994
  styleCustom.borderRadius = borderRadius;
1998
1995
  }
@@ -2611,7 +2608,7 @@ var InputLabel = function (props) {
2611
2608
  var commonStyles = [
2612
2609
  placeholderStyle,
2613
2610
  {
2614
- top: topPosition,
2611
+ top: topPosition - (Platform.OS === "android" ? 3 : 2),
2615
2612
  },
2616
2613
  {
2617
2614
  maxWidth: labelWidth,
@@ -2704,6 +2701,21 @@ var Spacer = function (_a) {
2704
2701
  return React__default.createElement(View, { width: width, height: height, style: [style] });
2705
2702
  };
2706
2703
 
2704
+ Dimensions.get("window").height;
2705
+ Dimensions.get("window").width;
2706
+ var BUTTON_HEIGHT = 48;
2707
+ var BUTTON_HEIGHT_SMALL = 40;
2708
+ var SPACE_4 = 4;
2709
+ var SPACE_6 = 6;
2710
+ var SPACE_8 = 8;
2711
+ var SPACE_12 = 12;
2712
+ var SPACE_16 = 16;
2713
+ //MARK: Border radius
2714
+ var BORDER_RADIUS_6 = 6;
2715
+ //MARK: Border width
2716
+ StyleSheet.hairlineWidth; //0.3-0.5
2717
+ var BORDER_WIDTH_1 = 1;
2718
+
2707
2719
  var SvgIcon = function (_a) {
2708
2720
  var name = _a.name, _b = _a.width, width = _b === void 0 ? 24 : _b, _c = _a.height, height = _c === void 0 ? 24 : _c, _d = _a.color, color = _d === void 0 ? colors.ink.INK40 : _d, style = _a.style, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e;
2709
2721
  // Kiểm tra kỹ hơn
@@ -2822,7 +2834,7 @@ var TextInputFlat = function (_a) {
2822
2834
  var font = theme.fonts.bodyLarge;
2823
2835
  var hasActiveOutline = parentState.focused || error;
2824
2836
  var _h = getConstants(), LABEL_PADDING_TOP = _h.LABEL_PADDING_TOP, FLAT_INPUT_OFFSET = _h.FLAT_INPUT_OFFSET, MIN_HEIGHT = _h.MIN_HEIGHT;
2825
- var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, lineHeightStyle = _j.lineHeight, fontWeight = _j.fontWeight, height = _j.height, paddingHorizontal = _j.paddingHorizontal, textAlign = _j.textAlign, viewStyle = __rest(_j, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
2837
+ var _j = (StyleSheet.flatten(style) || {}), fontSizeStyle = _j.fontSize, lineHeightStyle = _j.lineHeight, fontWeight = _j.fontWeight, height = _j.height, paddingHorizontal = _j.paddingHorizontal, textAlign = _j.textAlign; __rest(_j, ["fontSize", "lineHeight", "fontWeight", "height", "paddingHorizontal", "textAlign"]);
2826
2838
  var fontSize = fontSizeStyle || MAXIMIZED_LABEL_FONT_SIZE;
2827
2839
  var lineHeight = lineHeightStyle || (Platform.OS === "web" ? fontSize * 1.2 : undefined);
2828
2840
  var isPaddingHorizontalPassed = paddingHorizontal !== undefined && typeof paddingHorizontal === "number";
@@ -2846,11 +2858,11 @@ var TextInputFlat = function (_a) {
2846
2858
  error: error,
2847
2859
  theme: theme,
2848
2860
  }), inputTextColor = _l.inputTextColor, activeColor = _l.activeColor, placeholderColor = _l.placeholderColor, errorColor = _l.errorColor, backgroundColor = _l.backgroundColor, selectionColor = _l.selectionColor;
2849
- var containerStyle = {
2861
+ ({
2850
2862
  backgroundColor: backgroundColor,
2851
2863
  borderTopLeftRadius: theme.roundness,
2852
2864
  borderTopRightRadius: theme.roundness,
2853
- };
2865
+ });
2854
2866
  var labelScale = MINIMIZED_LABEL_FONT_SIZE / fontSize;
2855
2867
  var fontScale = MAXIMIZED_LABEL_FONT_SIZE / fontSize;
2856
2868
  var labelWidth = parentState.labelLayout.width;
@@ -2958,18 +2970,18 @@ var TextInputFlat = function (_a) {
2958
2970
  return (React$3.createElement(View$1, { style: {
2959
2971
  flexDirection: "row",
2960
2972
  alignItems: "center",
2961
- borderRadius: CONSTANTS.BORDER_RADIUS_6,
2973
+ borderRadius: BORDER_RADIUS_6,
2962
2974
  borderWidth: 1,
2963
2975
  borderColor: getBorderColor(),
2964
- height: 48,
2976
+ height: 44,
2965
2977
  overflow: "hidden",
2966
2978
  backgroundColor: disabled
2967
2979
  ? theme.colors.surfacePrimaryDisabled
2968
2980
  : theme.colors.surfacePrimaryDefault,
2969
2981
  } },
2970
2982
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
2971
- left && (React$3.createElement(View$1, { style: { paddingLeft: CONSTANTS.SPACE_12 } }, left)),
2972
- left ? (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 })) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 }))),
2983
+ left && React$3.createElement(View$1, { style: { paddingLeft: SPACE_12 } }, left),
2984
+ left ? React$3.createElement(Spacer, { width: SPACE_8 }) : React$3.createElement(Spacer, { width: SPACE_12 })),
2973
2985
  React$3.createElement(Outline, { style: outlineStyle, label: label, roundness: roundness, hasActiveOutline: hasActiveOutline, focused: parentState.focused, activeColor: activeColor, outlineColor: outlineColor, backgroundColor: backgroundColor }),
2974
2986
  React$3.createElement(View$1, { onLayout: onInputLayout, style: [
2975
2987
  styles$c.labelContainer,
@@ -2978,31 +2990,21 @@ var TextInputFlat = function (_a) {
2978
2990
  flex: 1,
2979
2991
  },
2980
2992
  ] },
2981
- !isAndroid && multiline && !!label && !disabled && (React$3.createElement(View$1, { pointerEvents: "none", style: [
2982
- StyleSheet.absoluteFill,
2983
- dense ? styles$c.densePatchContainer : styles$c.patchContainer,
2984
- {
2985
- backgroundColor: viewStyle.backgroundColor || containerStyle.backgroundColor,
2986
- left: paddingLeft,
2987
- right: paddingRight,
2988
- },
2989
- ] })),
2990
2993
  label ? (React$3.createElement(InputLabel$1, __assign({ labeled: parentState.labeled, error: parentState.error, focused: parentState.focused, scaledLabel: scaledLabel, wiggle: Boolean(parentState.value && labelProps.labelError), labelLayoutMeasured: parentState.labelLayout.measured, labelLayoutWidth: parentState.labelLayout.width, labelLayoutHeight: parentState.labelLayout.height }, labelProps))) : null, render === null || render === void 0 ? void 0 :
2991
2994
  render(__assign(__assign({}, rest), { ref: innerRef, onChangeText: handleChangeText, value: inputValue, placeholder: rest.placeholder, editable: !disabled && editable, selectionColor: selectionColor, cursorColor: typeof cursorColor === "undefined" ? activeColor : cursorColor, placeholderTextColor: placeholderTextColorBasedOnState, onFocus: onFocus, onBlur: onBlur, underlineColorAndroid: "transparent", multiline: multiline, style: [
2992
2995
  styles$c.input,
2993
- __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: CONSTANTS.SPACE_12 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
2996
+ __assign(__assign({ paddingLeft: paddingLeft, paddingRight: paddingRight, paddingTop: parentState.focused || parentState.value ? SPACE_12 : 0 }, font), { fontSize: fontSize, lineHeight: lineHeight, fontWeight: fontWeight, color: inputTextColor, textAlignVertical: multiline ? "top" : "center", textAlign: textAlign
2994
2997
  ? textAlign
2995
2998
  : I18nManager.getConstants().isRTL
2996
2999
  ? "right"
2997
- : "left" }),
2998
- Platform.OS === "web" && { outline: "none" },
3000
+ : "left", marginTop: Platform.OS === "android" ? SPACE_8 : 0 }),
2999
3001
  contentStyle,
3000
3002
  ] }))),
3001
3003
  !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$c.clearButton },
3002
- React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
3004
+ React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
3003
3005
  React$3.createElement(View$1, { style: { flexDirection: "row" } },
3004
- right && React$3.createElement(Spacer, { width: CONSTANTS.SPACE_8 }),
3005
- right && (React$3.createElement(View$1, { style: { paddingRight: CONSTANTS.SPACE_12 } }, right)))));
3006
+ right && React$3.createElement(Spacer, { width: SPACE_8 }),
3007
+ right && React$3.createElement(View$1, { style: { paddingRight: SPACE_12 } }, right))));
3006
3008
  };
3007
3009
  var styles$c = StyleSheet.create({
3008
3010
  placeholder: {
@@ -3017,7 +3019,7 @@ var styles$c = StyleSheet.create({
3017
3019
  input: {
3018
3020
  // margin: 0,
3019
3021
  flex: 1,
3020
- height: 48,
3022
+ height: 44,
3021
3023
  },
3022
3024
  inputFlat: {
3023
3025
  paddingTop: 24,
@@ -3036,7 +3038,7 @@ var styles$c = StyleSheet.create({
3036
3038
  zIndex: 2,
3037
3039
  },
3038
3040
  clearButton: {
3039
- padding: CONSTANTS.SPACE_8,
3041
+ padding: SPACE_8,
3040
3042
  },
3041
3043
  });
3042
3044
 
@@ -5640,7 +5642,7 @@ var TextInputDefault = function (_a) {
5640
5642
  ? multiline
5641
5643
  ? CONSTANTS.SPACE_2
5642
5644
  : CONSTANTS.SPACE_8
5643
- : CONSTANTS.SPACE_4 }),
5645
+ : 0 }),
5644
5646
  contentStyle,
5645
5647
  ] }))),
5646
5648
  !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$b.clearButtonMultiline : styles$b.clearButton },
@@ -6049,21 +6051,6 @@ var styles$9 = StyleSheet.create({
6049
6051
  });
6050
6052
  var index$2 = memoDeepEqual(ButtonIcon);
6051
6053
 
6052
- Dimensions.get("window").height;
6053
- Dimensions.get("window").width;
6054
- var BUTTON_HEIGHT = 48;
6055
- var BUTTON_HEIGHT_SMALL = 40;
6056
- var SPACE_4 = 4;
6057
- var SPACE_6 = 6;
6058
- var SPACE_8 = 8;
6059
- var SPACE_12 = 12;
6060
- var SPACE_16 = 16;
6061
- //MARK: Border radius
6062
- var BORDER_RADIUS_6 = 6;
6063
- //MARK: Border width
6064
- StyleSheet.hairlineWidth; //0.3-0.5
6065
- var BORDER_WIDTH_1 = 1;
6066
-
6067
6054
  var FloatingButton = function (_a) {
6068
6055
  var isLoading = _a.isLoading, disabled = _a.disabled, onPress = _a.onPress, style = _a.style, _b = _a.hiddenBackground, hiddenBackground = _b === void 0 ? false : _b, _c = _a.size, size = _c === void 0 ? BUTTON_HEIGHT : _c, children = _a.children, backgroundColor = _a.backgroundColor, props = _a.props, _d = _a.top, top = _d === void 0 ? 0 : _d, _e = _a.right, right = _e === void 0 ? 0 : _e, _f = _a.left, left = _f === void 0 ? 0 : _f, _g = _a.bottom, bottom = _g === void 0 ? 0 : _g;
6069
6056
  var colors = useInternalTheme().colors;
@@ -6831,7 +6818,7 @@ var index = React__default.memo(SelectionField);
6831
6818
  var SearchInput = function (_a) {
6832
6819
  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;
6833
6820
  return (React__default.createElement(TextInput, { left: React__default.createElement(View, { paddingRight: SPACE_8 },
6834
- React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 24 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText, style: [
6821
+ React__default.createElement(Icon$1, { name: "IconSearch", type: "Svg", size: 24 })), disabled: disabled, value: value, clearButton: clearButton, mode: "default", label: placeholder, placeholder: placeholder, right: rightIcon, onFocus: onFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: onChangeText, style: [
6835
6822
  {
6836
6823
  height: height || 40,
6837
6824
  },