sapo-components-ui-rn 1.0.84 → 1.0.86
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/components/Button/index.d.ts +3 -2
- package/dist/components/View/index.d.ts +2 -1
- package/dist/index.esm.js +21 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +21 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/index.tsx +45 -23
- package/src/components/TextInput/TextInputDefault.tsx +1 -1
- package/src/components/TextInput/TextInputFlat.tsx +1 -1
- package/src/components/View/index.tsx +5 -0
|
@@ -11,7 +11,7 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
11
11
|
isLoading?: boolean;
|
|
12
12
|
left?: React.ReactNode;
|
|
13
13
|
right?: React.ReactNode;
|
|
14
|
-
margin?:
|
|
14
|
+
margin?: number;
|
|
15
15
|
textProps?: IText;
|
|
16
16
|
textColor?: string;
|
|
17
17
|
bold?: boolean;
|
|
@@ -25,6 +25,7 @@ export interface ButtonProps extends TouchableOpacityProps {
|
|
|
25
25
|
theme?: ThemeProp;
|
|
26
26
|
buttonSize?: "normal" | "small";
|
|
27
27
|
critical?: boolean;
|
|
28
|
+
width?: number;
|
|
28
29
|
}
|
|
29
|
-
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, bold, medium, mode, transparent, full, theme: themeOverrides, buttonSize, size, critical, ...props }: ButtonProps) => React.JSX.Element>;
|
|
30
|
+
declare const _default: React.MemoExoticComponent<({ style, title, border, borderColor, isLoading, left, right, margin, textStyle, textProps, onPress, disabled, backgroundColor, textColor, bold, medium, mode, transparent, full, theme: themeOverrides, buttonSize, size, critical, width, ...props }: ButtonProps) => React.JSX.Element>;
|
|
30
31
|
export default _default;
|
|
@@ -27,6 +27,7 @@ interface ViewProps {
|
|
|
27
27
|
marginBottom?: number;
|
|
28
28
|
marginLeft?: number;
|
|
29
29
|
marginRight?: number;
|
|
30
|
+
margin?: number;
|
|
30
31
|
style?: StyleProp<ViewStyle>;
|
|
31
32
|
children?: React.ReactNode;
|
|
32
33
|
alignEnd?: boolean;
|
|
@@ -45,5 +46,5 @@ interface ViewProps {
|
|
|
45
46
|
pointerEvents?: "box-none" | "box-only" | "none" | "auto";
|
|
46
47
|
gap?: number;
|
|
47
48
|
}
|
|
48
|
-
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, marginTop, marginBottom, marginLeft, marginRight, borderTopWidth, borderTopColor, borderLeftWidth, borderLeftColor, borderRightWidth, borderRightColor, pointerEvents, gap, }: ViewProps) => React.JSX.Element>;
|
|
49
|
+
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, marginTop, marginBottom, marginLeft, marginRight, margin, borderTopWidth, borderTopColor, borderLeftWidth, borderLeftColor, borderRightWidth, borderRightColor, pointerEvents, gap, }: ViewProps) => React.JSX.Element>;
|
|
49
50
|
export default _default;
|
package/dist/index.esm.js
CHANGED
|
@@ -1628,7 +1628,7 @@ function adaptNavigationTheme(themes) {
|
|
|
1628
1628
|
}
|
|
1629
1629
|
|
|
1630
1630
|
var ViewCustom = function (_a) {
|
|
1631
|
-
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, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight, borderTopWidth = _a.borderTopWidth, borderTopColor = _a.borderTopColor, borderLeftWidth = _a.borderLeftWidth, borderLeftColor = _a.borderLeftColor, borderRightWidth = _a.borderRightWidth, borderRightColor = _a.borderRightColor, pointerEvents = _a.pointerEvents, gap = _a.gap;
|
|
1631
|
+
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, marginTop = _a.marginTop, marginBottom = _a.marginBottom, marginLeft = _a.marginLeft, marginRight = _a.marginRight, margin = _a.margin, borderTopWidth = _a.borderTopWidth, borderTopColor = _a.borderTopColor, borderLeftWidth = _a.borderLeftWidth, borderLeftColor = _a.borderLeftColor, borderRightWidth = _a.borderRightWidth, borderRightColor = _a.borderRightColor, pointerEvents = _a.pointerEvents, gap = _a.gap;
|
|
1632
1632
|
var getStyle = function () {
|
|
1633
1633
|
var styleCustom = {};
|
|
1634
1634
|
if (row) {
|
|
@@ -1677,6 +1677,9 @@ var ViewCustom = function (_a) {
|
|
|
1677
1677
|
if (marginVertical) {
|
|
1678
1678
|
styleCustom.marginVertical = marginVertical;
|
|
1679
1679
|
}
|
|
1680
|
+
if (margin) {
|
|
1681
|
+
styleCustom.margin = margin;
|
|
1682
|
+
}
|
|
1680
1683
|
if (paddingLeft) {
|
|
1681
1684
|
styleCustom.paddingLeft = paddingLeft;
|
|
1682
1685
|
}
|
|
@@ -5358,7 +5361,7 @@ var TextInputFlat = function (_a) {
|
|
|
5358
5361
|
contentStyle,
|
|
5359
5362
|
] })),
|
|
5360
5363
|
renderSuffix())),
|
|
5361
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$d.clearButton },
|
|
5364
|
+
parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: styles$d.clearButton },
|
|
5362
5365
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: SPACE_12 })),
|
|
5363
5366
|
checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: theme.colors.borderPrimaryDefault, style: {
|
|
5364
5367
|
marginRight: SPACE_8,
|
|
@@ -5608,7 +5611,7 @@ var TextInputDefault = function (_a) {
|
|
|
5608
5611
|
contentStyle,
|
|
5609
5612
|
] })),
|
|
5610
5613
|
!multiline && renderSuffix()))),
|
|
5611
|
-
!disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$c.clearButtonMultiline : styles$c.clearButton },
|
|
5614
|
+
parentState.focused && !disabled && clearButton && inputValue ? (React$3.createElement(TouchableOpacity, { onPress: handleClear, style: multiline ? styles$c.clearButtonMultiline : styles$c.clearButton },
|
|
5612
5615
|
React$3.createElement(Icon$1, { name: "IconClearText", type: "Svg", size: 24 }))) : (React$3.createElement(Spacer, { width: CONSTANTS.SPACE_12 })),
|
|
5613
5616
|
checkLineRightAction() && (React$3.createElement(Spacer, { width: 1, height: 24, backgroundColor: colors.borderPrimaryDefault, style: {
|
|
5614
5617
|
marginRight: CONSTANTS.SPACE_8,
|
|
@@ -6248,7 +6251,7 @@ var TextInput = forwardRef(function (_a, ref) {
|
|
|
6248
6251
|
TextInput.Affix = TextInputAffix;
|
|
6249
6252
|
|
|
6250
6253
|
var Button = function (_a) {
|
|
6251
|
-
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right
|
|
6254
|
+
var style = _a.style, title = _a.title; _a.border; var borderColor = _a.borderColor, isLoading = _a.isLoading, left = _a.left, right = _a.right, margin = _a.margin, textStyle = _a.textStyle, textProps = _a.textProps, onPress = _a.onPress, disabled = _a.disabled, backgroundColor = _a.backgroundColor, textColor = _a.textColor, _b = _a.bold, bold = _b === void 0 ? true : _b, _c = _a.medium, medium = _c === void 0 ? false : _c, _d = _a.mode, mode = _d === void 0 ? "contained" : _d; _a.transparent; var _f = _a.full, full = _f === void 0 ? false : _f; _a.theme; var _g = _a.buttonSize, buttonSize = _g === void 0 ? "normal" : _g, _h = _a.size, size = _h === void 0 ? buttonSize === "small" ? 14 : 16 : _h, _j = _a.critical, critical = _j === void 0 ? false : _j, width = _a.width, props = __rest(_a, ["style", "title", "border", "borderColor", "isLoading", "left", "right", "margin", "textStyle", "textProps", "onPress", "disabled", "backgroundColor", "textColor", "bold", "medium", "mode", "transparent", "full", "theme", "buttonSize", "size", "critical", "width"]);
|
|
6252
6255
|
var theme = useInternalTheme();
|
|
6253
6256
|
var colors = theme.colors;
|
|
6254
6257
|
var disabledTextStyle = {
|
|
@@ -6299,7 +6302,7 @@ var Button = function (_a) {
|
|
|
6299
6302
|
};
|
|
6300
6303
|
return (React__default.createElement(View, { row: !full },
|
|
6301
6304
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading }),
|
|
6302
|
-
React__default.createElement(View, { style: [
|
|
6305
|
+
React__default.createElement(View, { width: width, margin: margin, style: [
|
|
6303
6306
|
styles$a.button,
|
|
6304
6307
|
{
|
|
6305
6308
|
borderRadius: CONSTANTS.BORDER_RADIUS_6,
|
|
@@ -6321,24 +6324,28 @@ var Button = function (_a) {
|
|
|
6321
6324
|
],
|
|
6322
6325
|
isLoading && { justifyContent: "center" },
|
|
6323
6326
|
style,
|
|
6324
|
-
], disabled: isLoading },
|
|
6327
|
+
], disabled: isLoading }, isLoading ? (React__default.createElement(ActivityIndicator, { color: (textStyle === null || textStyle === void 0 ? void 0 : textStyle.color) || renderTextColor() })) : (React__default.createElement(View, { full: true, center: true, row: true },
|
|
6325
6328
|
React__default.createElement(Spacer, { width: left ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 }),
|
|
6326
6329
|
!isLoading && left,
|
|
6327
|
-
left && React__default.createElement(Spacer, { width:
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6330
|
+
left && (React__default.createElement(Spacer, { width: buttonSize === "small"
|
|
6331
|
+
? CONSTANTS.SPACE_4
|
|
6332
|
+
: CONSTANTS.SPACE_8 })),
|
|
6333
|
+
React__default.createElement(View, { full: true, center: true },
|
|
6334
|
+
React__default.createElement(Text$1, __assign({ numberOfLines: 1, color: textColor || renderTextColor(), size: size, bold: bold, medium: medium, style: [disabled && disabledTextStyle, textStyle] }, textProps), title)),
|
|
6335
|
+
right && (React__default.createElement(Spacer, { width: buttonSize === "small"
|
|
6336
|
+
? CONSTANTS.SPACE_4
|
|
6337
|
+
: CONSTANTS.SPACE_8 })),
|
|
6331
6338
|
!isLoading && right,
|
|
6332
|
-
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))));
|
|
6339
|
+
React__default.createElement(Spacer, { width: right ? CONSTANTS.SPACE_12 : CONSTANTS.SPACE_16 })))))));
|
|
6333
6340
|
};
|
|
6334
6341
|
var styles$a = StyleSheet.create({
|
|
6335
6342
|
disabled: { opacity: 0.6 },
|
|
6336
6343
|
button: {
|
|
6337
6344
|
height: CONSTANTS.BUTTON_HEIGHT,
|
|
6338
|
-
flexDirection: "row",
|
|
6345
|
+
// flexDirection: "row",
|
|
6339
6346
|
alignItems: "center",
|
|
6340
|
-
justifyContent: "
|
|
6341
|
-
minWidth: CONSTANTS.DEVICE_WIDTH / 4
|
|
6347
|
+
justifyContent: "center",
|
|
6348
|
+
minWidth: CONSTANTS.DEVICE_WIDTH / 4,
|
|
6342
6349
|
},
|
|
6343
6350
|
border: {
|
|
6344
6351
|
borderWidth: CONSTANTS.BORDER_WIDTH_1,
|