secullum-react-native-ui 4.17.5 → 4.17.6
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/lib/components/Button.d.ts +2 -0
- package/lib/components/Button.js +4 -1
- package/lib/components/DropDown.d.ts +0 -1
- package/lib/components/DropDown.js +2 -2
- package/lib/components/Message.d.ts +0 -1
- package/lib/components/Message.js +2 -2
- package/lib/components/Modal.d.ts +0 -1
- package/lib/components/Modal.js +2 -2
- package/lib/components/Question.js +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,7 @@ export interface ButtonProperties {
|
|
|
10
10
|
disabledBackgroundColor?: string;
|
|
11
11
|
disabledLabelColor?: string;
|
|
12
12
|
nativeID?: string;
|
|
13
|
+
loading?: boolean;
|
|
13
14
|
}
|
|
14
15
|
export declare class Button extends React.Component<ButtonProperties> {
|
|
15
16
|
static defaultProps: {
|
|
@@ -17,6 +18,7 @@ export declare class Button extends React.Component<ButtonProperties> {
|
|
|
17
18
|
};
|
|
18
19
|
getStyles: () => {
|
|
19
20
|
touchable: {
|
|
21
|
+
flexDirection: "row";
|
|
20
22
|
backgroundColor: string;
|
|
21
23
|
borderColor: string;
|
|
22
24
|
borderWidth: number;
|
package/lib/components/Button.js
CHANGED
|
@@ -14,6 +14,7 @@ class Button extends React.Component {
|
|
|
14
14
|
const theme = (0, theme_1.getTheme)();
|
|
15
15
|
const styles = react_native_1.StyleSheet.create({
|
|
16
16
|
touchable: {
|
|
17
|
+
flexDirection: 'row',
|
|
17
18
|
backgroundColor: theme.backgroundColor1,
|
|
18
19
|
borderColor: theme.borderColor1,
|
|
19
20
|
borderWidth: 1,
|
|
@@ -48,14 +49,16 @@ class Button extends React.Component {
|
|
|
48
49
|
};
|
|
49
50
|
}
|
|
50
51
|
render() {
|
|
51
|
-
const { text, primary, style, textStyle, onPress, disabled, nativeID } = this.props;
|
|
52
|
+
const { text, primary, style, textStyle, onPress, disabled, nativeID, loading } = this.props;
|
|
52
53
|
const styles = this.getStyles();
|
|
54
|
+
const theme = (0, theme_1.getTheme)();
|
|
53
55
|
return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.7, style: [
|
|
54
56
|
styles.touchable,
|
|
55
57
|
primary && styles.touchablePrimary,
|
|
56
58
|
style,
|
|
57
59
|
disabled && styles.disabled
|
|
58
60
|
], onPress: onPress, disabled: disabled, testID: (0, test_1.getTestID)(nativeID) },
|
|
61
|
+
loading && React.createElement(react_native_1.ActivityIndicator, { color: theme.borderColor1 }),
|
|
59
62
|
React.createElement(react_native_1.Text, { nativeID: nativeID, style: [
|
|
60
63
|
styles.text,
|
|
61
64
|
primary && styles.textPrimary,
|
|
@@ -305,7 +305,7 @@ class DropDown extends React.Component {
|
|
|
305
305
|
}
|
|
306
306
|
render() {
|
|
307
307
|
const { modalOpen, searchText } = this.state;
|
|
308
|
-
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable, useKeyboardAvoidingView
|
|
308
|
+
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable, useKeyboardAvoidingView } = this.props;
|
|
309
309
|
const selectedItem = items.find(x => x.value === value);
|
|
310
310
|
const styles = this.getStyles();
|
|
311
311
|
const theme = (0, theme_1.getTheme)();
|
|
@@ -345,7 +345,7 @@ class DropDown extends React.Component {
|
|
|
345
345
|
] },
|
|
346
346
|
icon ? (React.createElement(FontAwesome_1.default, { name: icon, style: styles.iconOnLine })) : (React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, label)),
|
|
347
347
|
this.renderClosedDropDown(selectedItem, inputStyle),
|
|
348
|
-
React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay
|
|
348
|
+
React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay }, useKeyboardAvoidingView ? (React.createElement(react_native_1.KeyboardAvoidingView, { behavior: react_native_1.Platform.OS === 'ios' ? 'padding' : 'height' }, conteudoModal)) : (conteudoModal)))));
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
351
|
exports.DropDown = DropDown;
|
|
@@ -7,7 +7,6 @@ export interface MessageProperties {
|
|
|
7
7
|
onRequestClose?: () => void;
|
|
8
8
|
nativeID?: string;
|
|
9
9
|
textStyle?: StyleProp<TextStyle>;
|
|
10
|
-
animation?: 'none' | 'fade' | 'slide';
|
|
11
10
|
}
|
|
12
11
|
export declare class Message extends React.Component<MessageProperties> {
|
|
13
12
|
static defaultProps: {
|
|
@@ -37,10 +37,10 @@ class Message extends React.Component {
|
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
render() {
|
|
40
|
-
const { message, visible, type, onRequestClose, nativeID, textStyle
|
|
40
|
+
const { message, visible, type, onRequestClose, nativeID, textStyle } = this.props;
|
|
41
41
|
const styles = this.getStyles();
|
|
42
42
|
const theme = (0, theme_1.getTheme)();
|
|
43
|
-
return (React.createElement(Modal_1.Modal, { visible: visible, onRequestClose: onRequestClose, overlayStyle: styles.overlay
|
|
43
|
+
return (React.createElement(Modal_1.Modal, { visible: visible, onRequestClose: onRequestClose, overlayStyle: styles.overlay },
|
|
44
44
|
React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.container },
|
|
45
45
|
React.createElement(FontAwesome_1.default, { name: type === 'warning' ? 'warning' : 'check-circle', color: type === 'warning' ? theme.warningColor : theme.successColor, size: (0, layout_1.isTablet)() ? 52 : 42 }),
|
|
46
46
|
React.createElement(react_native_1.Text, { style: [styles.text, textStyle], testID: (0, test_1.getTestID)(nativeID) }, message))));
|
package/lib/components/Modal.js
CHANGED
|
@@ -19,9 +19,9 @@ class Modal extends React.Component {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
render() {
|
|
22
|
-
const { children, visible, overlayStyle, onRequestClose
|
|
22
|
+
const { children, visible, overlayStyle, onRequestClose } = this.props;
|
|
23
23
|
const { isMounted } = this.state;
|
|
24
|
-
return (React.createElement(react_native_1.Modal, { animationType:
|
|
24
|
+
return (React.createElement(react_native_1.Modal, { animationType: react_native_1.Platform.OS === 'ios' ? 'none' : 'fade', transparent: true, visible: visible, supportedOrientations: ['landscape', 'portrait'], onRequestClose: onRequestClose, onShow: this.handleShow },
|
|
25
25
|
React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: onRequestClose },
|
|
26
26
|
React.createElement(react_native_1.View, { style: [styles.overlay, overlayStyle] }, react_native_1.Platform.OS !== 'android' || isMounted ? children : React.createElement(react_native_1.View, null)))));
|
|
27
27
|
}
|
|
@@ -56,7 +56,7 @@ class Question extends React.Component {
|
|
|
56
56
|
const [leftButtonProps, rightButtonProps] = buttonOrder === 'ok,cancel'
|
|
57
57
|
? [okButton, cancelButton]
|
|
58
58
|
: [cancelButton, okButton];
|
|
59
|
-
return (React.createElement(react_native_1.Modal, { animationType:
|
|
59
|
+
return (React.createElement(react_native_1.Modal, { animationType: react_native_1.Platform.OS === 'ios' ? 'none' : 'fade', transparent: true, visible: visible },
|
|
60
60
|
React.createElement(react_native_1.View, { style: [styles.overlay], nativeID: nativeID },
|
|
61
61
|
React.createElement(react_native_1.View, { style: styles.container },
|
|
62
62
|
React.createElement(FontAwesome_1.default, { name: 'question-circle', style: styles.icon }),
|