secullum-react-native-ui 4.17.0 → 4.17.2-beta.1
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/DropDown.d.ts +1 -0
- package/lib/components/DropDown.js +2 -2
- package/lib/components/Message.d.ts +11 -1
- package/lib/components/Message.js +12 -3
- package/lib/components/Modal.d.ts +1 -0
- package/lib/components/Modal.js +2 -2
- package/lib/components/TextBox.js +5 -3
- package/package.json +1 -1
|
@@ -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 } = this.props;
|
|
308
|
+
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, nativeID, onPress, icon, searchable, useKeyboardAvoidingView, animation } = 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 }, useKeyboardAvoidingView ? (React.createElement(react_native_1.KeyboardAvoidingView, { behavior: react_native_1.Platform.OS === 'ios' ? 'padding' : 'height' }, conteudoModal)) : (conteudoModal)))));
|
|
348
|
+
React.createElement(Modal_1.Modal, { visible: modalOpen, onRequestClose: () => this.setState({ modalOpen: false }), overlayStyle: styles.modalOverlay, animation: animation !== null && animation !== void 0 ? animation : 'fade' }, 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;
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { StyleProp, TextStyle } from 'react-native';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
export interface MessageButtonProperties {
|
|
4
|
+
text: string;
|
|
5
|
+
onPress: () => void;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
textStyle?: StyleProp<TextStyle>;
|
|
8
|
+
nativeID?: string;
|
|
9
|
+
}
|
|
3
10
|
export interface MessageProperties {
|
|
4
11
|
message: string;
|
|
5
12
|
visible: boolean;
|
|
@@ -7,6 +14,9 @@ export interface MessageProperties {
|
|
|
7
14
|
onRequestClose?: () => void;
|
|
8
15
|
nativeID?: string;
|
|
9
16
|
textStyle?: StyleProp<TextStyle>;
|
|
17
|
+
animation?: 'none' | 'fade' | 'slide';
|
|
18
|
+
firstButton?: MessageButtonProperties;
|
|
19
|
+
secondButton?: MessageButtonProperties;
|
|
10
20
|
}
|
|
11
21
|
export declare class Message extends React.Component<MessageProperties> {
|
|
12
22
|
static defaultProps: {
|
|
@@ -8,6 +8,8 @@ const Modal_1 = require("./Modal");
|
|
|
8
8
|
const theme_1 = require("../modules/theme");
|
|
9
9
|
const layout_1 = require("../modules/layout");
|
|
10
10
|
const test_1 = require("../modules/test");
|
|
11
|
+
const Space_1 = require("./Space");
|
|
12
|
+
const Button_1 = require("./Button");
|
|
11
13
|
class Message extends React.Component {
|
|
12
14
|
constructor() {
|
|
13
15
|
super(...arguments);
|
|
@@ -37,13 +39,20 @@ class Message extends React.Component {
|
|
|
37
39
|
};
|
|
38
40
|
}
|
|
39
41
|
render() {
|
|
40
|
-
const { message, visible, type, onRequestClose, nativeID, textStyle } = this.props;
|
|
42
|
+
const { message, visible, type, onRequestClose, nativeID, textStyle, animation, firstButton, secondButton } = this.props;
|
|
41
43
|
const styles = this.getStyles();
|
|
42
44
|
const theme = (0, theme_1.getTheme)();
|
|
43
|
-
return (React.createElement(Modal_1.Modal, { visible: visible, onRequestClose: onRequestClose, overlayStyle: styles.overlay },
|
|
45
|
+
return (React.createElement(Modal_1.Modal, { visible: visible, onRequestClose: onRequestClose, overlayStyle: styles.overlay, animation: animation !== null && animation !== void 0 ? animation : 'fade' },
|
|
44
46
|
React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.container },
|
|
45
47
|
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
|
-
React.createElement(react_native_1.Text, { style: [styles.text, textStyle], testID: (0, test_1.getTestID)(nativeID) }, message)
|
|
48
|
+
React.createElement(react_native_1.Text, { style: [styles.text, textStyle], testID: (0, test_1.getTestID)(nativeID) }, message),
|
|
49
|
+
React.createElement(react_native_1.View, null,
|
|
50
|
+
firstButton && (React.createElement(React.Fragment, null,
|
|
51
|
+
React.createElement(Space_1.Space, null),
|
|
52
|
+
React.createElement(Button_1.Button, { text: firstButton.text, textStyle: firstButton.textStyle, onPress: firstButton.onPress, style: firstButton.style, nativeID: firstButton.nativeID }))),
|
|
53
|
+
secondButton && (React.createElement(React.Fragment, null,
|
|
54
|
+
React.createElement(Space_1.Space, null),
|
|
55
|
+
React.createElement(Button_1.Button, { text: secondButton.text, textStyle: secondButton.textStyle, onPress: secondButton.onPress, style: secondButton.style, nativeID: secondButton.nativeID })))))));
|
|
47
56
|
}
|
|
48
57
|
}
|
|
49
58
|
exports.Message = 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 } = this.props;
|
|
22
|
+
const { children, visible, overlayStyle, onRequestClose, animation } = 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: animation !== null && animation !== void 0 ? animation : '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
|
}
|
|
@@ -58,8 +58,10 @@ class TextBox extends React.Component {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
render() {
|
|
61
|
-
const { label, style, labelStyle, editable, inputRef, renderInput, icon, onPress } = this.props;
|
|
61
|
+
const { label, style, labelStyle, editable, inputRef, renderInput, icon, onPress, autoCapitalize, secureTextEntry } = this.props;
|
|
62
62
|
const styles = this.getStyles();
|
|
63
|
+
// Força primeira letra minúscula em campos de senha, a menos que autoCapitalize seja definido explicitamente.
|
|
64
|
+
const capitalize = secureTextEntry && !autoCapitalize ? 'none' : autoCapitalize;
|
|
63
65
|
const incomingProps = {
|
|
64
66
|
nativeID: this.props.nativeID,
|
|
65
67
|
testID: (0, test_1.getTestID)(this.props.nativeID),
|
|
@@ -79,13 +81,13 @@ class TextBox extends React.Component {
|
|
|
79
81
|
// We set a fixed color for the placeholder to prevent it from being affected by the device's theme.
|
|
80
82
|
// Related issue on GitLab: 12074
|
|
81
83
|
placeholderTextColor: (0, theme_1.getTheme)().textColor3,
|
|
82
|
-
secureTextEntry:
|
|
84
|
+
secureTextEntry: secureTextEntry,
|
|
83
85
|
multiline: this.props.multiline,
|
|
84
86
|
editable: this.props.editable,
|
|
85
87
|
keyboardType: this.props.keyboardType,
|
|
86
88
|
maxLength: this.props.maxLength,
|
|
87
89
|
onSubmitEditing: this.props.onSubmitEditing,
|
|
88
|
-
autoCapitalize:
|
|
90
|
+
autoCapitalize: capitalize,
|
|
89
91
|
autoCorrect: this.props.autoCorrect,
|
|
90
92
|
returnKeyType: react_native_1.Platform.OS === 'ios' &&
|
|
91
93
|
this.props.keyboardType === 'numeric' &&
|