secullum-react-native-ui 4.11.1 → 4.13.0
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/Card.js +6 -5
- package/lib/components/DropDown.d.ts +1 -0
- package/lib/components/DropDown.js +19 -2
- package/lib/components/Question.d.ts +13 -14
- package/lib/components/Question.js +13 -7
- package/lib/components/TextBox.js +15 -1
- package/lib/components/TimePicker.js +2 -1
- package/package.json +1 -1
package/lib/components/Card.js
CHANGED
|
@@ -17,6 +17,7 @@ const react_native_elevated_view_1 = require("react-native-elevated-view");
|
|
|
17
17
|
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
18
18
|
const theme_1 = require("../modules/theme");
|
|
19
19
|
const layout_1 = require("../modules/layout");
|
|
20
|
+
const test_1 = require("../modules/test");
|
|
20
21
|
const react_native_1 = require("react-native");
|
|
21
22
|
class CardHeader extends React.Component {
|
|
22
23
|
constructor() {
|
|
@@ -49,7 +50,7 @@ class CardHeader extends React.Component {
|
|
|
49
50
|
render() {
|
|
50
51
|
const { title, titleStyle, onHelpPress, nativeID, containerStyle, numberOfLines } = this.props;
|
|
51
52
|
const styles = this.getStyles();
|
|
52
|
-
return (React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, containerStyle] },
|
|
53
|
+
return (React.createElement(react_native_1.View, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [styles.container, containerStyle] },
|
|
53
54
|
React.createElement(react_native_1.Text, { style: [styles.title, titleStyle], numberOfLines: numberOfLines }, title),
|
|
54
55
|
onHelpPress && (React.createElement(react_native_1.TouchableOpacity, { onPress: onHelpPress, style: styles.help },
|
|
55
56
|
React.createElement(FontAwesome_1.default, { name: "question-circle", style: styles.helpIcon })))));
|
|
@@ -58,15 +59,15 @@ class CardHeader extends React.Component {
|
|
|
58
59
|
exports.CardHeader = CardHeader;
|
|
59
60
|
class CardFooter extends React.Component {
|
|
60
61
|
render() {
|
|
61
|
-
const _a = this.props, { children } = _a, otherProps = __rest(_a, ["children"]);
|
|
62
|
-
return (React.createElement(react_native_1.View, Object.assign({ style: [cardFooterStyles.container] }, otherProps), children));
|
|
62
|
+
const _a = this.props, { children, nativeID } = _a, otherProps = __rest(_a, ["children", "nativeID"]);
|
|
63
|
+
return (React.createElement(react_native_1.View, Object.assign({ nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [cardFooterStyles.container] }, otherProps), children));
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
66
|
exports.CardFooter = CardFooter;
|
|
66
67
|
class CardSection extends React.Component {
|
|
67
68
|
render() {
|
|
68
|
-
const _a = this.props, { children, style } = _a, otherProps = __rest(_a, ["children", "style"]);
|
|
69
|
-
return (React.createElement(react_native_1.View, Object.assign({ style: [cardSectionStyles.container, style] }, otherProps), children));
|
|
69
|
+
const _a = this.props, { children, style, nativeID } = _a, otherProps = __rest(_a, ["children", "style", "nativeID"]);
|
|
70
|
+
return (React.createElement(react_native_1.View, Object.assign({ nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [cardSectionStyles.container, style] }, otherProps), children));
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
exports.CardSection = CardSection;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.DropDown = void 0;
|
|
4
13
|
const React = require("react");
|
|
@@ -232,11 +241,19 @@ class DropDown extends React.Component {
|
|
|
232
241
|
}
|
|
233
242
|
render() {
|
|
234
243
|
const { modalOpen } = this.state;
|
|
235
|
-
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, iconComponent, nativeID, icon } = this.props;
|
|
244
|
+
const { label, items, value, emptyMessage, style, disabledStyle, disabled, labelStyle, inputStyle, iconComponent, nativeID, onPress, icon } = this.props;
|
|
236
245
|
const selectedItem = items.find(x => x.value === value);
|
|
237
246
|
const styles = this.getStyles();
|
|
238
247
|
const theme = (0, theme_1.getTheme)();
|
|
239
|
-
return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: () => this
|
|
248
|
+
return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: () => __awaiter(this, void 0, void 0, function* () {
|
|
249
|
+
if (onPress) {
|
|
250
|
+
const result = yield onPress();
|
|
251
|
+
if (result === false) {
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
this.setState({ modalOpen: true });
|
|
256
|
+
}), disabled: disabled },
|
|
240
257
|
React.createElement(react_native_1.View, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [
|
|
241
258
|
styles.container,
|
|
242
259
|
style,
|
|
@@ -5,22 +5,21 @@ export interface QuestionProperties {
|
|
|
5
5
|
visible: boolean;
|
|
6
6
|
nativeID?: string;
|
|
7
7
|
textStyle?: StyleProp<TextStyle>;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
style?: StyleProp<ViewStyle>;
|
|
19
|
-
textStyle?: StyleProp<TextStyle>;
|
|
20
|
-
nativeID?: string;
|
|
21
|
-
};
|
|
8
|
+
buttonOrder: 'ok,cancel' | 'cancel,ok';
|
|
9
|
+
okButton: QuestionButtonProperties;
|
|
10
|
+
cancelButton: QuestionButtonProperties;
|
|
11
|
+
}
|
|
12
|
+
export interface QuestionButtonProperties {
|
|
13
|
+
text: string;
|
|
14
|
+
onPress: () => void;
|
|
15
|
+
style?: StyleProp<ViewStyle>;
|
|
16
|
+
textStyle?: StyleProp<TextStyle>;
|
|
17
|
+
nativeID?: string;
|
|
22
18
|
}
|
|
23
19
|
export declare class Question extends React.Component<QuestionProperties> {
|
|
20
|
+
static defaultProps: {
|
|
21
|
+
buttonOrder: string;
|
|
22
|
+
};
|
|
24
23
|
getStyles: () => {
|
|
25
24
|
botoesAcao: {
|
|
26
25
|
flexDirection: "row";
|
|
@@ -50,8 +50,11 @@ class Question extends React.Component {
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
render() {
|
|
53
|
-
const { message, textStyle, visible, nativeID, okButton, cancelButton } = this.props;
|
|
53
|
+
const { message, textStyle, visible, nativeID, buttonOrder, okButton, cancelButton } = this.props;
|
|
54
54
|
const styles = this.getStyles();
|
|
55
|
+
const [leftButtonProps, rightButtonProps] = buttonOrder === 'ok,cancel'
|
|
56
|
+
? [okButton, cancelButton]
|
|
57
|
+
: [cancelButton, okButton];
|
|
55
58
|
return (React.createElement(react_native_1.Modal, { animationType: "fade", transparent: true, visible: visible },
|
|
56
59
|
React.createElement(react_native_1.View, { style: [styles.overlay], nativeID: nativeID },
|
|
57
60
|
React.createElement(react_native_1.View, { style: styles.container },
|
|
@@ -59,14 +62,17 @@ class Question extends React.Component {
|
|
|
59
62
|
React.createElement(react_native_1.Text, { style: [styles.text, textStyle] }, message),
|
|
60
63
|
React.createElement(Space_1.Space, null),
|
|
61
64
|
React.createElement(react_native_1.View, { style: styles.botoesAcao },
|
|
62
|
-
React.createElement(Button_1.Button, { text:
|
|
65
|
+
React.createElement(Button_1.Button, { text: leftButtonProps.text, onPress: leftButtonProps.onPress, style: [
|
|
63
66
|
{ flex: 1, marginRight: (0, layout_1.isTablet)() ? 13 : 8 },
|
|
64
|
-
|
|
65
|
-
], textStyle:
|
|
66
|
-
React.createElement(Button_1.Button, { text:
|
|
67
|
+
leftButtonProps.style
|
|
68
|
+
], textStyle: leftButtonProps.textStyle, primary: buttonOrder === 'ok,cancel', nativeID: leftButtonProps.nativeID }),
|
|
69
|
+
React.createElement(Button_1.Button, { text: rightButtonProps.text, onPress: rightButtonProps.onPress, style: [
|
|
67
70
|
{ flex: 1, marginLeft: (0, layout_1.isTablet)() ? 13 : 8 },
|
|
68
|
-
|
|
69
|
-
], textStyle:
|
|
71
|
+
rightButtonProps.style
|
|
72
|
+
], textStyle: rightButtonProps.textStyle, primary: buttonOrder === 'cancel,ok', nativeID: rightButtonProps.nativeID }))))));
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
exports.Question = Question;
|
|
76
|
+
Question.defaultProps = {
|
|
77
|
+
buttonOrder: 'cancel,ok'
|
|
78
|
+
};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.TextBox = void 0;
|
|
4
15
|
const React = require("react");
|
|
@@ -41,7 +52,10 @@ class TextBox extends React.Component {
|
|
|
41
52
|
this.input.focus();
|
|
42
53
|
}
|
|
43
54
|
};
|
|
44
|
-
this.renderInput = (props) =>
|
|
55
|
+
this.renderInput = (props) => {
|
|
56
|
+
const { nativeID } = props, otherProps = __rest(props, ["nativeID"]);
|
|
57
|
+
return (React.createElement(react_native_1.TextInput, Object.assign({ nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID) }, otherProps)));
|
|
58
|
+
};
|
|
45
59
|
}
|
|
46
60
|
render() {
|
|
47
61
|
const { label, style, labelStyle, editable, inputRef, renderInput, icon, onPress } = this.props;
|
|
@@ -7,6 +7,7 @@ const ImageButton_1 = require("./ImageButton");
|
|
|
7
7
|
const format_1 = require("../modules/format");
|
|
8
8
|
const layout_1 = require("../modules/layout");
|
|
9
9
|
const theme_1 = require("../modules/theme");
|
|
10
|
+
const test_1 = require("../modules/test");
|
|
10
11
|
const react_native_1 = require("react-native");
|
|
11
12
|
class TimePicker extends React.Component {
|
|
12
13
|
constructor() {
|
|
@@ -97,7 +98,7 @@ class TimePicker extends React.Component {
|
|
|
97
98
|
}
|
|
98
99
|
return (React.createElement(React.Fragment, null,
|
|
99
100
|
React.createElement(react_native_1.TouchableWithoutFeedback, { disabled: disabled, onPress: this.handlePress },
|
|
100
|
-
React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, style, disabled ? styles.readonly : null] },
|
|
101
|
+
React.createElement(react_native_1.View, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), style: [styles.container, style, disabled ? styles.readonly : null] },
|
|
101
102
|
React.createElement(react_native_1.View, null,
|
|
102
103
|
React.createElement(react_native_1.Text, { style: styles.label }, label),
|
|
103
104
|
React.createElement(react_native_1.Text, { style: styles.value }, value)),
|