sapo-components-ui-rn 1.1.89 → 1.1.91
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/assets/icon-checkbox-indeterminate.svg +20 -0
- package/dist/assets/index.ts +29 -7
- package/dist/assets/svg/icon-checkbox-indeterminate.svg +20 -0
- package/dist/assets/svg/index.d.ts +1 -0
- package/dist/assets/svg/index.ts +2 -0
- package/dist/components/Avatar/index.d.ts +2 -1
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/ButtonIcon/index.d.ts +1 -0
- package/dist/components/Checkbox/index.d.ts +3 -2
- package/dist/components/ChipBar/index.d.ts +2 -1
- package/dist/components/CountingDot/index.d.ts +2 -1
- package/dist/components/FloatingButton/index.d.ts +1 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/IconSvg/index.d.ts +1 -0
- package/dist/components/RadioButton/index.d.ts +2 -1
- package/dist/components/SearchInput/index.d.ts +2 -1
- package/dist/components/SelectionField/index.d.ts +1 -1
- package/dist/components/Spacer/index.d.ts +2 -1
- package/dist/components/Switch/Switch.d.ts +2 -1
- package/dist/components/Tag/index.d.ts +2 -1
- package/dist/components/ViewVisibleAnimated/index.d.ts +1 -0
- package/dist/index.esm.js +47 -40
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +48 -40
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect
|
|
3
|
+
x="2.75"
|
|
4
|
+
y="2.75"
|
|
5
|
+
width="18.5"
|
|
6
|
+
height="18.5"
|
|
7
|
+
rx="5.25"
|
|
8
|
+
fill="#0088FF"
|
|
9
|
+
stroke="#0088FF"
|
|
10
|
+
stroke-width="1.5"
|
|
11
|
+
/>
|
|
12
|
+
<rect
|
|
13
|
+
x="7"
|
|
14
|
+
y="11"
|
|
15
|
+
width="10"
|
|
16
|
+
height="2"
|
|
17
|
+
rx="1"
|
|
18
|
+
fill="white"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
package/dist/assets/index.ts
CHANGED
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import IconClose from "./icon-close.svg";
|
|
2
|
+
import IconCheckbox from "./icon-checkbox.svg";
|
|
3
|
+
import IconCheckboxActive from "./icon-checkbox-active.svg";
|
|
4
|
+
import IconCheckboxIndeterminate from "./icon-checkbox-indeterminate.svg";
|
|
5
|
+
import IconRadio from "./icon-radio.svg";
|
|
6
|
+
import IconRadioActive from "./icon-radio-active.svg";
|
|
7
|
+
import IconSearch from "./icon-search.svg";
|
|
8
|
+
import IconInfo from "./icon-info.svg";
|
|
9
|
+
import IconSuccess from "./icon-success.svg";
|
|
10
|
+
import IconWarning from "./icon-warning.svg";
|
|
11
|
+
import IconArrowDown from "./icon-arrow-down.svg";
|
|
12
|
+
import IconError from "./icon-error.svg";
|
|
13
|
+
import IconClearText from "./icon-clear-text.svg";
|
|
14
|
+
import IconDelNumber from './icon-del-number.svg'
|
|
3
15
|
|
|
4
|
-
export const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
16
|
+
export const Svg = {
|
|
17
|
+
IconClose,
|
|
18
|
+
IconCheckbox,
|
|
19
|
+
IconCheckboxActive,
|
|
20
|
+
IconCheckboxIndeterminate,
|
|
21
|
+
IconRadio,
|
|
22
|
+
IconRadioActive,
|
|
23
|
+
IconSearch,
|
|
24
|
+
IconInfo,
|
|
25
|
+
IconSuccess,
|
|
26
|
+
IconWarning,
|
|
27
|
+
IconArrowDown,
|
|
28
|
+
IconError,
|
|
29
|
+
IconClearText,
|
|
30
|
+
IconDelNumber,
|
|
9
31
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<rect
|
|
3
|
+
x="2.75"
|
|
4
|
+
y="2.75"
|
|
5
|
+
width="18.5"
|
|
6
|
+
height="18.5"
|
|
7
|
+
rx="5.25"
|
|
8
|
+
fill="#0088FF"
|
|
9
|
+
stroke="#0088FF"
|
|
10
|
+
stroke-width="1.5"
|
|
11
|
+
/>
|
|
12
|
+
<rect
|
|
13
|
+
x="7"
|
|
14
|
+
y="11"
|
|
15
|
+
width="10"
|
|
16
|
+
height="2"
|
|
17
|
+
rx="1"
|
|
18
|
+
fill="white"
|
|
19
|
+
/>
|
|
20
|
+
</svg>
|
|
@@ -2,6 +2,7 @@ export declare const Svg: {
|
|
|
2
2
|
IconClose: import("react").FC<import("react-native-svg").SvgProps>;
|
|
3
3
|
IconCheckbox: import("react").FC<import("react-native-svg").SvgProps>;
|
|
4
4
|
IconCheckboxActive: import("react").FC<import("react-native-svg").SvgProps>;
|
|
5
|
+
IconCheckboxIndeterminate: import("react").FC<import("react-native-svg").SvgProps>;
|
|
5
6
|
IconRadio: import("react").FC<import("react-native-svg").SvgProps>;
|
|
6
7
|
IconRadioActive: import("react").FC<import("react-native-svg").SvgProps>;
|
|
7
8
|
IconSearch: import("react").FC<import("react-native-svg").SvgProps>;
|
package/dist/assets/svg/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import IconClose from "./icon-close.svg";
|
|
2
2
|
import IconCheckbox from "./icon-checkbox.svg";
|
|
3
3
|
import IconCheckboxActive from "./icon-checkbox-active.svg";
|
|
4
|
+
import IconCheckboxIndeterminate from "./icon-checkbox-indeterminate.svg";
|
|
4
5
|
import IconRadio from "./icon-radio.svg";
|
|
5
6
|
import IconRadioActive from "./icon-radio-active.svg";
|
|
6
7
|
import IconSearch from "./icon-search.svg";
|
|
@@ -16,6 +17,7 @@ export const Svg = {
|
|
|
16
17
|
IconClose,
|
|
17
18
|
IconCheckbox,
|
|
18
19
|
IconCheckboxActive,
|
|
20
|
+
IconCheckboxIndeterminate,
|
|
19
21
|
IconRadio,
|
|
20
22
|
IconRadioActive,
|
|
21
23
|
IconSearch,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle, ImageStyle } from "react-native";
|
|
3
3
|
interface AvatarProps {
|
|
4
|
+
testID?: string;
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
name?: string;
|
|
6
7
|
borderColor?: string;
|
|
@@ -13,5 +14,5 @@ interface AvatarProps {
|
|
|
13
14
|
textStyle?: StyleProp<TextStyle>;
|
|
14
15
|
imageStyle?: StyleProp<ImageStyle>;
|
|
15
16
|
}
|
|
16
|
-
declare const Avatar: ({ children, name, backgroundColor, style, textColor, size, source, onPress, textStyle, imageStyle, }: AvatarProps) => React.JSX.Element;
|
|
17
|
+
declare const Avatar: ({ testID, children, name, backgroundColor, style, textColor, size, source, onPress, textStyle, imageStyle, }: AvatarProps) => React.JSX.Element;
|
|
17
18
|
export default Avatar;
|
|
@@ -5,6 +5,7 @@ export type BadgeSize = 'large' | 'medium' | 'small';
|
|
|
5
5
|
export type BadgeMode = 'default' | 'outline';
|
|
6
6
|
export type ProgressType = 'full' | 'half' | 'empty' | 'none';
|
|
7
7
|
interface BadgeProps {
|
|
8
|
+
testID?: string;
|
|
8
9
|
value?: string;
|
|
9
10
|
borderColor?: string;
|
|
10
11
|
backgroundColor?: string;
|
|
@@ -13,6 +13,7 @@ export interface ButtonIconProps {
|
|
|
13
13
|
backgroundColor?: string;
|
|
14
14
|
borderColor?: string;
|
|
15
15
|
mode?: "normal" | "small";
|
|
16
|
+
testID?: string;
|
|
16
17
|
}
|
|
17
18
|
declare const _default: React.MemoExoticComponent<React.ComponentType<ButtonIconProps>>;
|
|
18
19
|
export default _default;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
3
3
|
interface CheckboxProps {
|
|
4
|
+
testID?: string;
|
|
4
5
|
style?: StyleProp<ViewStyle>;
|
|
5
6
|
content: string;
|
|
6
7
|
onPress?: () => void;
|
|
7
8
|
textStyle?: StyleProp<TextStyle>;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
leftIcon?: React.ReactNode;
|
|
10
|
-
checked?: boolean;
|
|
11
|
+
checked?: boolean | "indeterminate";
|
|
11
12
|
iconSize?: number;
|
|
12
13
|
}
|
|
13
|
-
declare const Checkbox: ({ style, content, textStyle, onPress, disabled, leftIcon, checked, iconSize, }: CheckboxProps) => React.JSX.Element;
|
|
14
|
+
declare const Checkbox: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, iconSize, }: CheckboxProps) => React.JSX.Element;
|
|
14
15
|
export default Checkbox;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
3
3
|
interface ChipBarProps {
|
|
4
|
+
testID?: string;
|
|
4
5
|
style?: StyleProp<ViewStyle>;
|
|
5
6
|
title: string;
|
|
6
7
|
borderRadius?: number;
|
|
@@ -14,5 +15,5 @@ interface ChipBarProps {
|
|
|
14
15
|
ellipsizeMode?: "head" | "middle" | "tail" | "clip";
|
|
15
16
|
numberOfLines?: number;
|
|
16
17
|
}
|
|
17
|
-
declare const ChipBar: ({ style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, badge, checked, ellipsizeMode, numberOfLines, }: ChipBarProps) => React.JSX.Element;
|
|
18
|
+
declare const ChipBar: ({ testID, style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, badge, checked, ellipsizeMode, numberOfLines, }: ChipBarProps) => React.JSX.Element;
|
|
18
19
|
export default ChipBar;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
3
3
|
interface CountingDotProps {
|
|
4
|
+
testID?: string;
|
|
4
5
|
children?: React.ReactNode;
|
|
5
6
|
value: string | number;
|
|
6
7
|
borderColor?: string;
|
|
@@ -9,5 +10,5 @@ interface CountingDotProps {
|
|
|
9
10
|
textColor?: string;
|
|
10
11
|
textStyle?: StyleProp<TextStyle>;
|
|
11
12
|
}
|
|
12
|
-
declare const CountingDot: ({ children, value, backgroundColor, style, textColor, textStyle, }: CountingDotProps) => React.JSX.Element;
|
|
13
|
+
declare const CountingDot: ({ testID, children, value, backgroundColor, style, textColor, textStyle, }: CountingDotProps) => React.JSX.Element;
|
|
13
14
|
export default CountingDot;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { StyleProp, ViewStyle, TextStyle } from "react-native";
|
|
3
3
|
interface RadioButtonProps {
|
|
4
|
+
testID?: string;
|
|
4
5
|
style?: StyleProp<ViewStyle>;
|
|
5
6
|
content: string;
|
|
6
7
|
onPress?: (value: boolean) => void;
|
|
@@ -9,5 +10,5 @@ interface RadioButtonProps {
|
|
|
9
10
|
leftIcon?: React.ReactNode;
|
|
10
11
|
checked?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare const RadioButton: ({ style, content, textStyle, onPress, disabled, leftIcon, checked, }: RadioButtonProps) => React.JSX.Element;
|
|
13
|
+
declare const RadioButton: ({ testID, style, content, textStyle, onPress, disabled, leftIcon, checked, }: RadioButtonProps) => React.JSX.Element;
|
|
13
14
|
export default RadioButton;
|
|
@@ -16,6 +16,7 @@ interface SearchInputProps {
|
|
|
16
16
|
debounceTime?: number;
|
|
17
17
|
autoFocus?: boolean;
|
|
18
18
|
ref?: React.RefObject<TextInputNative | null>;
|
|
19
|
+
testID?: string;
|
|
19
20
|
}
|
|
20
|
-
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, height, debounceTime, autoFocus, textStyle, ref, }: SearchInputProps) => React.JSX.Element;
|
|
21
|
+
declare const SearchInput: ({ value, disabled, rightIcon, clearButton, placeholder, onFocus, onBlur, onChangeText, style, height, debounceTime, autoFocus, textStyle, ref, testID, }: SearchInputProps) => React.JSX.Element;
|
|
21
22
|
export default SearchInput;
|
|
@@ -21,5 +21,5 @@ export interface SelectionFieldProps extends TouchableOpacityProps {
|
|
|
21
21
|
required?: boolean;
|
|
22
22
|
height?: number;
|
|
23
23
|
}
|
|
24
|
-
declare const _default: React.MemoExoticComponent<({ style, content, label, error, borderColor, left, right, textStyle, labelStyle, textProps, onPress, disabled, textColor, labelColor, theme: themeOverrides, required, height, ...props }: SelectionFieldProps) => React.JSX.Element>;
|
|
24
|
+
declare const _default: React.MemoExoticComponent<({ style, content, label, error, borderColor, left, right, textStyle, labelStyle, textProps, onPress, disabled, textColor, labelColor, theme: themeOverrides, required, height, testID, ...props }: SelectionFieldProps) => React.JSX.Element>;
|
|
25
25
|
export default _default;
|
|
@@ -5,6 +5,7 @@ interface SpacerProps {
|
|
|
5
5
|
height?: number;
|
|
6
6
|
style?: StyleProp<ViewStyle>;
|
|
7
7
|
backgroundColor?: string;
|
|
8
|
+
testID?: string;
|
|
8
9
|
}
|
|
9
|
-
declare const Spacer: ({ style, width, height, backgroundColor, }: SpacerProps) => React.JSX.Element;
|
|
10
|
+
declare const Spacer: ({ style, width, height, backgroundColor, testID, }: SpacerProps) => React.JSX.Element;
|
|
10
11
|
export default Spacer;
|
|
@@ -13,6 +13,7 @@ export type Props = {
|
|
|
13
13
|
* Callback called with the new value when it changes.
|
|
14
14
|
*/
|
|
15
15
|
onValueChange?: (value: boolean) => void;
|
|
16
|
+
testID?: string;
|
|
16
17
|
};
|
|
17
|
-
declare const Switch: React.MemoExoticComponent<({ value, disabled, onValueChange, size }: Props) => React.JSX.Element>;
|
|
18
|
+
declare const Switch: React.MemoExoticComponent<({ testID, value, disabled, onValueChange, size }: Props) => React.JSX.Element>;
|
|
18
19
|
export default Switch;
|
|
@@ -14,6 +14,7 @@ interface TagProps {
|
|
|
14
14
|
numberOfLines?: number;
|
|
15
15
|
hideRightIcon?: boolean;
|
|
16
16
|
height?: number;
|
|
17
|
+
testID?: string;
|
|
17
18
|
}
|
|
18
|
-
declare const Tag: ({ style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, checked, ellipsizeMode, numberOfLines, hideRightIcon, height, }: TagProps) => React.JSX.Element;
|
|
19
|
+
declare const Tag: ({ style, borderRadius, title, textStyle, onPress, disabled, leftIcon, rightIcon, checked, ellipsizeMode, numberOfLines, hideRightIcon, height, testID, }: TagProps) => React.JSX.Element;
|
|
19
20
|
export default Tag;
|
|
@@ -17,6 +17,7 @@ export type ViewVisibleAnimatedProps = {
|
|
|
17
17
|
renderHiddenContent?: React.ReactNode;
|
|
18
18
|
children?: React.ReactNode;
|
|
19
19
|
disableHiddenContent?: boolean;
|
|
20
|
+
testID?: string;
|
|
20
21
|
};
|
|
21
22
|
declare const ViewVisibleAnimated: React.NamedExoticComponent<ViewVisibleAnimatedProps & React.RefAttributes<{
|
|
22
23
|
show: () => void;
|
package/dist/index.esm.js
CHANGED
|
@@ -7,6 +7,7 @@ import color from 'color';
|
|
|
7
7
|
import IconClose from './assets/svg/icon-close.svg';
|
|
8
8
|
import IconCheckbox from './assets/svg/icon-checkbox.svg';
|
|
9
9
|
import IconCheckboxActive from './assets/svg/icon-checkbox-active.svg';
|
|
10
|
+
import IconCheckboxIndeterminate from './assets/svg/icon-checkbox-indeterminate.svg';
|
|
10
11
|
import IconRadio from './assets/svg/icon-radio.svg';
|
|
11
12
|
import IconRadioActive from './assets/svg/icon-radio-active.svg';
|
|
12
13
|
import IconSearch from './assets/svg/icon-search.svg';
|
|
@@ -1526,12 +1527,12 @@ var ViewCustom = forwardRef$1(function (_a, ref) {
|
|
|
1526
1527
|
};
|
|
1527
1528
|
var defaultStyle = getStyle();
|
|
1528
1529
|
var Component = onPress ? TouchableOpacity : View$1;
|
|
1529
|
-
return (React__default.createElement(Component, __assign({ ref: ref, activeOpacity: activeOpacity, onPress: onPress, disabled: disabled, style: [defaultStyle, style], onLayout: onLayout, onMagicTap: onMagicTap, onMoveShouldSetResponder: onMoveShouldSetResponder, onMoveShouldSetResponderCapture: onMoveShouldSetResponderCapture, onResponderGrant: onResponderGrant, onResponderMove: onResponderMove, onResponderReject: onResponderReject, onResponderRelease: onResponderRelease, onResponderTerminate: onResponderTerminate, onResponderTerminationRequest: onResponderTerminationRequest, onStartShouldSetResponder: onStartShouldSetResponder, onStartShouldSetResponderCapture: onStartShouldSetResponderCapture, testID: testID, nativeID: nativeID, collapsable: collapsable, needsOffscreenAlphaCompositing: needsOffscreenAlphaCompositing, renderToHardwareTextureAndroid: renderToHardwareTextureAndroid, shouldRasterizeIOS: shouldRasterizeIOS }, restProps), children));
|
|
1530
|
+
return (React__default.createElement(Component, __assign({ ref: ref, activeOpacity: activeOpacity, onPress: onPress, disabled: disabled, style: [defaultStyle, style], onLayout: onLayout, onMagicTap: onMagicTap, onMoveShouldSetResponder: onMoveShouldSetResponder, onMoveShouldSetResponderCapture: onMoveShouldSetResponderCapture, onResponderGrant: onResponderGrant, onResponderMove: onResponderMove, onResponderReject: onResponderReject, onResponderRelease: onResponderRelease, onResponderTerminate: onResponderTerminate, onResponderTerminationRequest: onResponderTerminationRequest, onStartShouldSetResponder: onStartShouldSetResponder, onStartShouldSetResponderCapture: onStartShouldSetResponderCapture, testID: testID, nativeID: nativeID, collapsable: collapsable !== null && collapsable !== void 0 ? collapsable : (testID ? false : undefined), needsOffscreenAlphaCompositing: needsOffscreenAlphaCompositing, renderToHardwareTextureAndroid: renderToHardwareTextureAndroid, shouldRasterizeIOS: shouldRasterizeIOS }, restProps), children));
|
|
1530
1531
|
});
|
|
1531
1532
|
var View = React__default.memo(ViewCustom);
|
|
1532
1533
|
|
|
1533
1534
|
var Switch = memo(function (_a) {
|
|
1534
|
-
var value = _a.value, disabled = _a.disabled, onValueChange = _a.onValueChange, _b = _a.size, size = _b === void 0 ? "normal" : _b;
|
|
1535
|
+
var testID = _a.testID, value = _a.value, disabled = _a.disabled, onValueChange = _a.onValueChange, _b = _a.size, size = _b === void 0 ? "normal" : _b;
|
|
1535
1536
|
var theme = useInternalTheme();
|
|
1536
1537
|
var colors = theme.colors;
|
|
1537
1538
|
var progress = useSharedValue(value ? 1 : 0);
|
|
@@ -1604,7 +1605,7 @@ var Switch = memo(function (_a) {
|
|
|
1604
1605
|
}
|
|
1605
1606
|
}, [size, colors]);
|
|
1606
1607
|
return (React$3.createElement(View, { row: true },
|
|
1607
|
-
React$3.createElement(TouchableOpacity, { activeOpacity: 1, onPress: handleSwitch, disabled: disabled, style: disabled ? { opacity: 0.6 } : {} },
|
|
1608
|
+
React$3.createElement(TouchableOpacity, { testID: testID, activeOpacity: 1, onPress: handleSwitch, disabled: disabled, style: disabled ? { opacity: 0.6 } : {} },
|
|
1608
1609
|
React$3.createElement(Animated.View, { style: [styles$j.vSegment, backgroundColor, getSizeSwitch()] },
|
|
1609
1610
|
React$3.createElement(Animated.View, { style: [styles$j.animated, animatedStyle, getSizeCircle()] })))));
|
|
1610
1611
|
});
|
|
@@ -4577,7 +4578,7 @@ var Text = function (props) {
|
|
|
4577
4578
|
};
|
|
4578
4579
|
var defaultStyle = _getStyle();
|
|
4579
4580
|
var Component = Text$2;
|
|
4580
|
-
return (React__default.createElement(Component, __assign({ onPress: onPress, style: [defaultStyle, props.style], allowFontScaling: false }, rest), children));
|
|
4581
|
+
return (React__default.createElement(Component, __assign({ onPress: onPress, style: [defaultStyle, props.style], allowFontScaling: false, accessible: true }, rest), children));
|
|
4581
4582
|
};
|
|
4582
4583
|
var Text$1 = memoDeepEqual(Text);
|
|
4583
4584
|
|
|
@@ -4728,8 +4729,8 @@ var styles$f = StyleSheet.create({
|
|
|
4728
4729
|
});
|
|
4729
4730
|
|
|
4730
4731
|
var Spacer = function (_a) {
|
|
4731
|
-
var style = _a.style, _b = _a.width, width = _b === void 0 ? CONSTANTS.SPACE_16 : _b, _c = _a.height, height = _c === void 0 ? CONSTANTS.SPACE_12 : _c, backgroundColor = _a.backgroundColor;
|
|
4732
|
-
return (React__default.createElement(View, { backgroundColor: backgroundColor || "transparent", width: width, height: height, style: [style] }));
|
|
4732
|
+
var style = _a.style, _b = _a.width, width = _b === void 0 ? CONSTANTS.SPACE_16 : _b, _c = _a.height, height = _c === void 0 ? CONSTANTS.SPACE_12 : _c, backgroundColor = _a.backgroundColor, testID = _a.testID;
|
|
4733
|
+
return (React__default.createElement(View, { testID: testID, backgroundColor: backgroundColor || "transparent", width: width, height: height, style: [style] }));
|
|
4733
4734
|
};
|
|
4734
4735
|
|
|
4735
4736
|
Dimensions.get("window").height;
|
|
@@ -4796,6 +4797,7 @@ var Svg = {
|
|
|
4796
4797
|
IconClose: IconClose,
|
|
4797
4798
|
IconCheckbox: IconCheckbox,
|
|
4798
4799
|
IconCheckboxActive: IconCheckboxActive,
|
|
4800
|
+
IconCheckboxIndeterminate: IconCheckboxIndeterminate,
|
|
4799
4801
|
IconRadio: IconRadio,
|
|
4800
4802
|
IconRadioActive: IconRadioActive,
|
|
4801
4803
|
IconSearch: IconSearch,
|
|
@@ -4809,13 +4811,13 @@ var Svg = {
|
|
|
4809
4811
|
};
|
|
4810
4812
|
|
|
4811
4813
|
var SvgIcon = function (_a) {
|
|
4812
|
-
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;
|
|
4814
|
+
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, testID = _a.testID;
|
|
4813
4815
|
var IconComponent = Svg[name];
|
|
4814
4816
|
if (!IconComponent) {
|
|
4815
4817
|
console.warn("Icon \"".concat(name, "\" kh\u00F4ng t\u1ED3n t\u1EA1i trong Svg."));
|
|
4816
4818
|
return null;
|
|
4817
4819
|
}
|
|
4818
|
-
return (React__default.createElement(IconComponent, { width: width, height: height, color: disabled ? colors.ink.INK20 : color, style: style, onPress: disabled ? undefined : onPress }));
|
|
4820
|
+
return (React__default.createElement(IconComponent, { testID: testID, width: width, height: height, color: disabled ? colors.ink.INK20 : color, style: style, onPress: disabled ? undefined : onPress }));
|
|
4819
4821
|
};
|
|
4820
4822
|
|
|
4821
4823
|
var TextInputFlat = function (_a) {
|
|
@@ -6353,9 +6355,9 @@ var styles$b = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
|
|
|
6353
6355
|
var index$3 = React__default.memo(Button);
|
|
6354
6356
|
|
|
6355
6357
|
var FloatingButton = function (_a) {
|
|
6356
|
-
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;
|
|
6358
|
+
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, testID = _a.testID;
|
|
6357
6359
|
var colors = useInternalTheme().colors;
|
|
6358
|
-
return (React__default.createElement(TouchableOpacity, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
|
|
6360
|
+
return (React__default.createElement(TouchableOpacity, __assign({ testID: testID, activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || isLoading, style: [
|
|
6359
6361
|
styles$a.btn,
|
|
6360
6362
|
top > 0 && { top: top },
|
|
6361
6363
|
right > 0 && { right: right },
|
|
@@ -6390,7 +6392,7 @@ var styles$a = StyleSheet.create({
|
|
|
6390
6392
|
var index$2 = memoDeepEqual(FloatingButton);
|
|
6391
6393
|
|
|
6392
6394
|
var ViewVisibleAnimated = React__default.memo(React__default.forwardRef(function (_a, ref) {
|
|
6393
|
-
var onShowStart = _a.onShowStart, onShowDone = _a.onShowDone, onDone = _a.onDone, style = _a.style, children = _a.children, _b = _a.autoHide, autoHide = _b === void 0 ? false : _b, _c = _a.scaleEnable, scaleEnable = _c === void 0 ? true : _c, _d = _a.translateEnable, translateEnable = _d === void 0 ? true : _d, _e = _a.delay, delay = _e === void 0 ? 100 : _e, _f = _a.duration, duration = _f === void 0 ? 250 : _f, _g = _a.timeout, timeout = _g === void 0 ? 1000 : _g, _h = _a.autoShow, autoShow = _h === void 0 ? true : _h, _j = _a.pointerEvents, pointerEvents = _j === void 0 ? "auto" : _j, _k = _a.scaleType, scaleType = _k === void 0 ? "in" : _k, _l = _a.renderHiddenContent, renderHiddenContent = _l === void 0 ? null : _l, _m = _a.disableHiddenContent, disableHiddenContent = _m === void 0 ? false : _m;
|
|
6395
|
+
var onShowStart = _a.onShowStart, onShowDone = _a.onShowDone, onDone = _a.onDone, style = _a.style, children = _a.children, _b = _a.autoHide, autoHide = _b === void 0 ? false : _b, _c = _a.scaleEnable, scaleEnable = _c === void 0 ? true : _c, _d = _a.translateEnable, translateEnable = _d === void 0 ? true : _d, _e = _a.delay, delay = _e === void 0 ? 100 : _e, _f = _a.duration, duration = _f === void 0 ? 250 : _f, _g = _a.timeout, timeout = _g === void 0 ? 1000 : _g, _h = _a.autoShow, autoShow = _h === void 0 ? true : _h, _j = _a.pointerEvents, pointerEvents = _j === void 0 ? "auto" : _j, _k = _a.scaleType, scaleType = _k === void 0 ? "in" : _k, _l = _a.renderHiddenContent, renderHiddenContent = _l === void 0 ? null : _l, _m = _a.disableHiddenContent, disableHiddenContent = _m === void 0 ? false : _m, testID = _a.testID;
|
|
6394
6396
|
useImperativeHandle(ref, function () { return ({
|
|
6395
6397
|
hide: hide,
|
|
6396
6398
|
show: show,
|
|
@@ -6481,7 +6483,7 @@ var ViewVisibleAnimated = React__default.memo(React__default.forwardRef(function
|
|
|
6481
6483
|
callback === null || callback === void 0 ? void 0 : callback();
|
|
6482
6484
|
});
|
|
6483
6485
|
};
|
|
6484
|
-
return (React__default.createElement(Animated$1.View, { style: [
|
|
6486
|
+
return (React__default.createElement(Animated$1.View, { testID: testID, style: [
|
|
6485
6487
|
style,
|
|
6486
6488
|
{
|
|
6487
6489
|
opacity: visibleAnimation,
|
|
@@ -6509,7 +6511,8 @@ var SPACER = {
|
|
|
6509
6511
|
MEDIUM: 'medium',
|
|
6510
6512
|
LARGE: 'large',
|
|
6511
6513
|
};
|
|
6512
|
-
var Toast = memoWithRef(function (
|
|
6514
|
+
var Toast = memoWithRef(function (props, ref) {
|
|
6515
|
+
var testID = props.testID;
|
|
6513
6516
|
var _a = useState('Thông báo'), message = _a[0], setMessage = _a[1];
|
|
6514
6517
|
var viewVisibleAnimatedRef = useRef(null);
|
|
6515
6518
|
var _b = useSafeAreaInsets(), bottom = _b.bottom, top = _b.top;
|
|
@@ -6621,7 +6624,7 @@ var Toast = memoWithRef(function (_props, ref) {
|
|
|
6621
6624
|
return 0;
|
|
6622
6625
|
}
|
|
6623
6626
|
};
|
|
6624
|
-
return (React__default.createElement(ViewVisibleAnimated, { ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
|
|
6627
|
+
return (React__default.createElement(ViewVisibleAnimated, { testID: testID, ref: viewVisibleAnimatedRef, autoShow: false, scaleEnable: true, style: [
|
|
6625
6628
|
styles$9.container,
|
|
6626
6629
|
options.position === POSITION.BOTTOM && {
|
|
6627
6630
|
bottom: bottom
|
|
@@ -6820,7 +6823,7 @@ var ProgressCircle = function (_a) {
|
|
|
6820
6823
|
} }));
|
|
6821
6824
|
};
|
|
6822
6825
|
var Badge = React__default.memo(function (_a) {
|
|
6823
|
-
var _b = _a.value, value = _b === void 0 ? '1' : _b, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle, _c = _a.type, type = _c === void 0 ? 'default' : _c, _d = _a.badgeSize, badgeSize = _d === void 0 ? 'large' : _d, _e = _a.mode, mode = _e === void 0 ? 'default' : _e, textSize = _a.textSize, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor, _f = _a.progressType, progressType = _f === void 0 ? 'none' : _f, leftIcon = _a.leftIcon;
|
|
6826
|
+
var testID = _a.testID, _b = _a.value, value = _b === void 0 ? '1' : _b, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle, _c = _a.type, type = _c === void 0 ? 'default' : _c, _d = _a.badgeSize, badgeSize = _d === void 0 ? 'large' : _d, _e = _a.mode, mode = _e === void 0 ? 'default' : _e, textSize = _a.textSize, borderColor = _a.borderColor, backgroundColor = _a.backgroundColor, _f = _a.progressType, progressType = _f === void 0 ? 'none' : _f, leftIcon = _a.leftIcon;
|
|
6824
6827
|
var theme = useInternalTheme();
|
|
6825
6828
|
var colors = theme.colors;
|
|
6826
6829
|
var sizeStyles = useMemo(function () {
|
|
@@ -6940,10 +6943,10 @@ var Badge = React__default.memo(function (_a) {
|
|
|
6940
6943
|
return textSize || ((_a = BADGE_CONFIGS.sizes[badgeSize]) === null || _a === void 0 ? void 0 : _a.textSize) || 12;
|
|
6941
6944
|
}, [textSize, badgeSize]);
|
|
6942
6945
|
if (badgeSize === 'small') {
|
|
6943
|
-
return (React__default.createElement(View, { row: true, style: style },
|
|
6946
|
+
return (React__default.createElement(View, { testID: testID, row: true, style: style },
|
|
6944
6947
|
React__default.createElement(ProgressCircle, { progress: progressType, color: typeStyles.backgroundColor })));
|
|
6945
6948
|
}
|
|
6946
|
-
return (React__default.createElement(View, { row: true },
|
|
6949
|
+
return (React__default.createElement(View, { testID: testID, row: true },
|
|
6947
6950
|
React__default.createElement(View, { row: true, center: true, borderRadius: 999, borderWidth: CONSTANTS.BORDER_WIDTH_1, style: [sizeStyles, typeStyles, style] },
|
|
6948
6951
|
leftIcon && React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_4 }, leftIcon),
|
|
6949
6952
|
progressType !== 'none' && (React__default.createElement(ProgressCircle, { progress: progressType, color: getColorProgress.color })),
|
|
@@ -6954,13 +6957,13 @@ Badge.displayName = 'Badge';
|
|
|
6954
6957
|
var styles$8 = StyleSheet.create(__assign({}, containerStyles));
|
|
6955
6958
|
|
|
6956
6959
|
var CountingDot = function (_a) {
|
|
6957
|
-
var children = _a.children, _b = _a.value, value = _b === void 0 ? "1" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle;
|
|
6960
|
+
var testID = _a.testID, children = _a.children, _b = _a.value, value = _b === void 0 ? "1" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, textStyle = _a.textStyle;
|
|
6958
6961
|
var theme = useInternalTheme();
|
|
6959
6962
|
var colors = theme.colors;
|
|
6960
6963
|
if (children) {
|
|
6961
|
-
return React__default.createElement(View, { style: style }, children);
|
|
6964
|
+
return React__default.createElement(View, { testID: testID, style: style }, children);
|
|
6962
6965
|
}
|
|
6963
|
-
return (React__default.createElement(View, { row: true },
|
|
6966
|
+
return (React__default.createElement(View, { testID: testID, row: true },
|
|
6964
6967
|
React__default.createElement(View, { center: true, borderRadius: CONSTANTS.BORDER_RADIUS_12, backgroundColor: backgroundColor || colors.surfaceCriticalDefault, paddingHorizontal: CONSTANTS.SPACE_4, paddingVertical: CONSTANTS.SPACE_2, style: [styles$7.container, style] },
|
|
6965
6968
|
React__default.createElement(Text$1, { size: 10, style: [styles$7.textMedium, textStyle], color: textColor || colors.textOnFillDefault }, value))));
|
|
6966
6969
|
};
|
|
@@ -6970,7 +6973,7 @@ var styles$7 = StyleSheet.create(__assign(__assign({}, containerStyles), { conta
|
|
|
6970
6973
|
} }));
|
|
6971
6974
|
|
|
6972
6975
|
var ChipBar = function (_a) {
|
|
6973
|
-
var style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.badge, badge = _e === void 0 ? 0 : _e, _f = _a.checked, checked = _f === void 0 ? false : _f, _g = _a.ellipsizeMode, ellipsizeMode = _g === void 0 ? "tail" : _g, _h = _a.numberOfLines, numberOfLines = _h === void 0 ? 1 : _h;
|
|
6976
|
+
var testID = _a.testID, style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.badge, badge = _e === void 0 ? 0 : _e, _f = _a.checked, checked = _f === void 0 ? false : _f, _g = _a.ellipsizeMode, ellipsizeMode = _g === void 0 ? "tail" : _g, _h = _a.numberOfLines, numberOfLines = _h === void 0 ? 1 : _h;
|
|
6974
6977
|
var theme = useInternalTheme();
|
|
6975
6978
|
var colors = theme.colors;
|
|
6976
6979
|
var handlePressChipBar = function () {
|
|
@@ -6978,7 +6981,7 @@ var ChipBar = function (_a) {
|
|
|
6978
6981
|
onPress === null || onPress === void 0 ? void 0 : onPress(!checked);
|
|
6979
6982
|
}
|
|
6980
6983
|
};
|
|
6981
|
-
return (React__default.createElement(View, { row: true },
|
|
6984
|
+
return (React__default.createElement(View, { testID: testID, row: true },
|
|
6982
6985
|
React__default.createElement(View, { row: true, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, borderWidth: 1, alignCenter: true, style: [
|
|
6983
6986
|
disabled && {
|
|
6984
6987
|
backgroundColor: colors.surfaceSecondaryDefault,
|
|
@@ -7023,20 +7026,27 @@ var useCheckboxColor = function (isActive, disabled) {
|
|
|
7023
7026
|
}, [isActive, disabled, colors]);
|
|
7024
7027
|
};
|
|
7025
7028
|
var Checkbox = function (_a) {
|
|
7026
|
-
var style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e;
|
|
7029
|
+
var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d, _e = _a.iconSize, iconSize = _e === void 0 ? 24 : _e;
|
|
7027
7030
|
var theme = useInternalTheme();
|
|
7028
7031
|
var colors = theme.colors;
|
|
7029
7032
|
var _f = useState(checked), isActive = _f[0], setActive = _f[1];
|
|
7030
7033
|
var checkboxColor = useCheckboxColor(isActive, disabled);
|
|
7034
|
+
var checkboxIconName = "IconCheckbox";
|
|
7035
|
+
if (isActive === "indeterminate") {
|
|
7036
|
+
checkboxIconName = "IconCheckboxIndeterminate";
|
|
7037
|
+
}
|
|
7038
|
+
else if (isActive) {
|
|
7039
|
+
checkboxIconName = "IconCheckboxActive";
|
|
7040
|
+
}
|
|
7031
7041
|
var handlePress = useCallback(function () {
|
|
7032
7042
|
onPress === null || onPress === void 0 ? void 0 : onPress();
|
|
7033
7043
|
}, [isActive, onPress]);
|
|
7034
7044
|
useEffect(function () {
|
|
7035
7045
|
setActive(checked);
|
|
7036
7046
|
}, [checked]);
|
|
7037
|
-
return (React__default.createElement(View, { row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
|
|
7047
|
+
return (React__default.createElement(View, { testID: testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
|
|
7038
7048
|
leftIcon ? (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 }, leftIcon)) : (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 },
|
|
7039
|
-
React__default.createElement(SvgIcon, { name:
|
|
7049
|
+
React__default.createElement(SvgIcon, { name: checkboxIconName, width: iconSize, height: iconSize, color: checkboxColor }))),
|
|
7040
7050
|
React__default.createElement(View, { full: true },
|
|
7041
7051
|
React__default.createElement(Text$1, { color: colors.textDefault, style: [
|
|
7042
7052
|
styles$5.text14,
|
|
@@ -7046,13 +7056,10 @@ var Checkbox = function (_a) {
|
|
|
7046
7056
|
textStyle,
|
|
7047
7057
|
] }, content))));
|
|
7048
7058
|
};
|
|
7049
|
-
var styles$5 = StyleSheet.create(__assign(
|
|
7050
|
-
width: 24,
|
|
7051
|
-
height: 24,
|
|
7052
|
-
} }));
|
|
7059
|
+
var styles$5 = StyleSheet.create(__assign({}, containerStyles));
|
|
7053
7060
|
|
|
7054
7061
|
var RadioButton = function (_a) {
|
|
7055
|
-
var style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d;
|
|
7062
|
+
var testID = _a.testID, style = _a.style, _b = _a.content, content = _b === void 0 ? "content" : _b, textStyle = _a.textStyle, onPress = _a.onPress, _c = _a.disabled, disabled = _c === void 0 ? false : _c, leftIcon = _a.leftIcon, _d = _a.checked, checked = _d === void 0 ? false : _d;
|
|
7056
7063
|
var theme = useInternalTheme();
|
|
7057
7064
|
var colors = theme.colors;
|
|
7058
7065
|
var handlePress = useCallback(function () {
|
|
@@ -7067,7 +7074,7 @@ var RadioButton = function (_a) {
|
|
|
7067
7074
|
}
|
|
7068
7075
|
return colors.surfacePrimaryDefault;
|
|
7069
7076
|
}, [checked, disabled]);
|
|
7070
|
-
return (React__default.createElement(View, { row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
|
|
7077
|
+
return (React__default.createElement(View, { testID: testID, row: true, disabled: disabled, alignCenter: true, style: [style], onPress: handlePress },
|
|
7071
7078
|
leftIcon ? (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 }, leftIcon)) : (React__default.createElement(View, { paddingRight: CONSTANTS.SPACE_8 },
|
|
7072
7079
|
React__default.createElement(SvgIcon, { name: checked ? "IconRadioActive" : "IconRadio", width: 24, height: 24, color: getColorCheckbox }))),
|
|
7073
7080
|
React__default.createElement(View, { full: true },
|
|
@@ -7085,7 +7092,7 @@ var styles$4 = StyleSheet.create(__assign(__assign({}, containerStyles), { icon:
|
|
|
7085
7092
|
} }));
|
|
7086
7093
|
|
|
7087
7094
|
var Avatar = function (_a) {
|
|
7088
|
-
var children = _a.children, _b = _a.name, name = _b === void 0 ? "N A" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 32 : _c, source = _a.source, onPress = _a.onPress, textStyle = _a.textStyle, imageStyle = _a.imageStyle;
|
|
7095
|
+
var testID = _a.testID, children = _a.children, _b = _a.name, name = _b === void 0 ? "N A" : _b, backgroundColor = _a.backgroundColor, style = _a.style, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? 32 : _c, source = _a.source, onPress = _a.onPress, textStyle = _a.textStyle, imageStyle = _a.imageStyle;
|
|
7089
7096
|
var theme = useInternalTheme();
|
|
7090
7097
|
var colors = theme.colors;
|
|
7091
7098
|
var getInitials = function (name) {
|
|
@@ -7096,7 +7103,7 @@ var Avatar = function (_a) {
|
|
|
7096
7103
|
return (words[0][0] + words[words.length - 1][0]).toUpperCase();
|
|
7097
7104
|
};
|
|
7098
7105
|
if (children) {
|
|
7099
|
-
return React__default.createElement(View, { style: style }, children);
|
|
7106
|
+
return React__default.createElement(View, { testID: testID, style: style }, children);
|
|
7100
7107
|
}
|
|
7101
7108
|
var getSize = function (size) {
|
|
7102
7109
|
switch (size) {
|
|
@@ -7122,7 +7129,7 @@ var Avatar = function (_a) {
|
|
|
7122
7129
|
return 24;
|
|
7123
7130
|
}
|
|
7124
7131
|
};
|
|
7125
|
-
return (React__default.createElement(View, { onPress: onPress, width: size, height: size, borderRadius: size / 2, center: true, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, style: [styles$3.container, style] }, source ? (React__default.createElement(Image$1, { resizeMode: "cover", source: source, style: [{ width: size, height: size }, imageStyle] })) : (React__default.createElement(Text$1, { size: getSize(size), lineHeight: getLineHeight(size), color: textColor || colors.textSecondary, style: textStyle || { fontWeight: "500" } }, getInitials(name)))));
|
|
7132
|
+
return (React__default.createElement(View, { testID: testID, onPress: onPress, width: size, height: size, borderRadius: size / 2, center: true, backgroundColor: backgroundColor || colors.surfaceSecondaryDefault, style: [styles$3.container, style] }, source ? (React__default.createElement(Image$1, { resizeMode: "cover", source: source, style: [{ width: size, height: size }, imageStyle] })) : (React__default.createElement(Text$1, { size: getSize(size), lineHeight: getLineHeight(size), color: textColor || colors.textSecondary, style: textStyle || { fontWeight: "500" } }, getInitials(name)))));
|
|
7126
7133
|
};
|
|
7127
7134
|
var styles$3 = StyleSheet.create({
|
|
7128
7135
|
container: {
|
|
@@ -7131,7 +7138,7 @@ var styles$3 = StyleSheet.create({
|
|
|
7131
7138
|
});
|
|
7132
7139
|
|
|
7133
7140
|
var SelectionField = function (_a) {
|
|
7134
|
-
var style = _a.style, _b = _a.content, content = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.error, error = _d === void 0 ? '' : _d, borderColor = _a.borderColor; _a.left; var right = _a.right, textStyle = _a.textStyle, labelStyle = _a.labelStyle, textProps = _a.textProps, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e, textColor = _a.textColor, labelColor = _a.labelColor; _a.theme; var _f = _a.required, required = _f === void 0 ? false : _f, _g = _a.height, height = _g === void 0 ? 48 : _g, props = __rest(_a, ["style", "content", "label", "error", "borderColor", "left", "right", "textStyle", "labelStyle", "textProps", "onPress", "disabled", "textColor", "labelColor", "theme", "required", "height"]);
|
|
7141
|
+
var style = _a.style, _b = _a.content, content = _b === void 0 ? '' : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.error, error = _d === void 0 ? '' : _d, borderColor = _a.borderColor; _a.left; var right = _a.right, textStyle = _a.textStyle, labelStyle = _a.labelStyle, textProps = _a.textProps, onPress = _a.onPress, _e = _a.disabled, disabled = _e === void 0 ? false : _e, textColor = _a.textColor, labelColor = _a.labelColor; _a.theme; var _f = _a.required, required = _f === void 0 ? false : _f, _g = _a.height, height = _g === void 0 ? 48 : _g, testID = _a.testID, props = __rest(_a, ["style", "content", "label", "error", "borderColor", "left", "right", "textStyle", "labelStyle", "textProps", "onPress", "disabled", "textColor", "labelColor", "theme", "required", "height", "testID"]);
|
|
7135
7142
|
var theme = useInternalTheme();
|
|
7136
7143
|
var colors = theme.colors;
|
|
7137
7144
|
var disabledTextStyle = {
|
|
@@ -7147,7 +7154,7 @@ var SelectionField = function (_a) {
|
|
|
7147
7154
|
}
|
|
7148
7155
|
return textColor || colors.textDefault;
|
|
7149
7156
|
};
|
|
7150
|
-
return (React__default.createElement(View,
|
|
7157
|
+
return (React__default.createElement(View, { testID: testID },
|
|
7151
7158
|
React__default.createElement(ScaleButton$1, __assign({ activeOpacity: 0.8, onPress: onPress }, props, { disabled: disabled || false }),
|
|
7152
7159
|
React__default.createElement(View, { style: [
|
|
7153
7160
|
styles$2.container,
|
|
@@ -7212,13 +7219,13 @@ var styles$2 = StyleSheet.create(__assign(__assign({}, containerStyles), { disab
|
|
|
7212
7219
|
var index$1 = React__default.memo(SelectionField);
|
|
7213
7220
|
|
|
7214
7221
|
var SearchInput = function (_a) {
|
|
7215
|
-
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 ? 500 : _f, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, textStyle = _a.textStyle, ref = _a.ref;
|
|
7222
|
+
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 ? 500 : _f, _g = _a.autoFocus, autoFocus = _g === void 0 ? false : _g, textStyle = _a.textStyle, ref = _a.ref, testID = _a.testID;
|
|
7216
7223
|
var theme = useInternalTheme();
|
|
7217
7224
|
var colors = theme.colors;
|
|
7218
7225
|
var debouncedOnChangeText = useDebouncedCallback(function (text) {
|
|
7219
7226
|
onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(text);
|
|
7220
7227
|
}, debounceTime);
|
|
7221
|
-
return (React__default.createElement(TextInput, { left: React__default.createElement(View, null,
|
|
7228
|
+
return (React__default.createElement(TextInput, { testID: testID, left: React__default.createElement(View, null,
|
|
7222
7229
|
React__default.createElement(SvgIcon, { name: "IconSearch", width: 24, height: 24 })), ref: ref, disabled: disabled, value: value, clearButton: clearButton, mode: "default", numberOfLines: 1, textBreakStrategy: "simple", multiline: false, placeholder: placeholder, placeholderTextColor: colors.textPlaceholder, right: rightIcon, onFocus: onFocus, autoFocus: autoFocus, onBlur: onBlur, allowFontScaling: false, onChangeText: debouncedOnChangeText, style: [
|
|
7223
7230
|
{
|
|
7224
7231
|
height: height || 36,
|
|
@@ -7236,13 +7243,13 @@ var SearchInput = function (_a) {
|
|
|
7236
7243
|
};
|
|
7237
7244
|
|
|
7238
7245
|
var Tag = function (_a) {
|
|
7239
|
-
var style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.ellipsizeMode, ellipsizeMode = _f === void 0 ? "tail" : _f, _g = _a.numberOfLines, numberOfLines = _g === void 0 ? 1 : _g, _h = _a.hideRightIcon, hideRightIcon = _h === void 0 ? false : _h, _j = _a.height, height = _j === void 0 ? 32 : _j;
|
|
7246
|
+
var style = _a.style, _b = _a.borderRadius, borderRadius = _b === void 0 ? CONSTANTS.BORDER_RADIUS_ROUNDED : _b, _c = _a.title, title = _c === void 0 ? "content" : _c, textStyle = _a.textStyle, onPress = _a.onPress, _d = _a.disabled, disabled = _d === void 0 ? false : _d, leftIcon = _a.leftIcon, rightIcon = _a.rightIcon, _e = _a.checked, checked = _e === void 0 ? false : _e, _f = _a.ellipsizeMode, ellipsizeMode = _f === void 0 ? "tail" : _f, _g = _a.numberOfLines, numberOfLines = _g === void 0 ? 1 : _g, _h = _a.hideRightIcon, hideRightIcon = _h === void 0 ? false : _h, _j = _a.height, height = _j === void 0 ? 32 : _j, testID = _a.testID;
|
|
7240
7247
|
var theme = useInternalTheme();
|
|
7241
7248
|
var colors = theme.colors;
|
|
7242
7249
|
var handlePressTag = useCallback(function () {
|
|
7243
7250
|
onPress === null || onPress === void 0 ? void 0 : onPress(!checked);
|
|
7244
7251
|
}, [checked]);
|
|
7245
|
-
return (React__default.createElement(View, { row: true, height: height, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, center: true, style: [
|
|
7252
|
+
return (React__default.createElement(View, { testID: testID, row: true, height: height, disabled: disabled, paddingHorizontal: CONSTANTS.SPACE_12, paddingVertical: CONSTANTS.SPACE_8, borderRadius: borderRadius, center: true, style: [
|
|
7246
7253
|
disabled && {
|
|
7247
7254
|
backgroundColor: colors.surfaceSecondaryDefault,
|
|
7248
7255
|
borderColor: colors.surfaceSecondaryDefault,
|