secullum-react-native-ui 4.3.2 → 4.3.5
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/CheckBox.d.ts +1 -0
- package/lib/components/CheckBox.js +2 -2
- package/lib/components/Header.d.ts +3 -3
- package/lib/components/Header.js +11 -12
- package/lib/components/Message.js +1 -1
- package/lib/components/RangeDatePicker.js +5 -4
- package/lib/modules/theme.d.ts +1 -1
- package/lib/modules/theme.js +1 -1
- package/package.json +1 -2
|
@@ -32,7 +32,7 @@ class CheckBox extends React.Component {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
render() {
|
|
35
|
-
const { label, value, onChange, disabled, style, labelStyle, nativeID } = this.props;
|
|
35
|
+
const { label, value, onChange, disabled, style, labelStyle, renderLabel, nativeID } = this.props;
|
|
36
36
|
const styles = this.getStyles();
|
|
37
37
|
return (React.createElement(react_native_1.TouchableOpacity, { style: [styles.container, style], disabled: disabled, onPress: () => {
|
|
38
38
|
if (onChange) {
|
|
@@ -40,7 +40,7 @@ class CheckBox extends React.Component {
|
|
|
40
40
|
}
|
|
41
41
|
} },
|
|
42
42
|
React.createElement(FontAwesome_1.default, { nativeID: nativeID, name: value ? 'check-square-o' : 'square-o', style: styles.icon }),
|
|
43
|
-
React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, label)));
|
|
43
|
+
React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, renderLabel ? renderLabel() : label)));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
exports.CheckBox = CheckBox;
|
|
@@ -17,8 +17,8 @@ export declare class Header extends React.Component<HeaderProperties> {
|
|
|
17
17
|
static defaultProps: {
|
|
18
18
|
leftButtonType: string;
|
|
19
19
|
};
|
|
20
|
-
height: number;
|
|
21
|
-
getStyles: (
|
|
20
|
+
static height: number;
|
|
21
|
+
getStyles: () => {
|
|
22
22
|
header: {
|
|
23
23
|
backgroundColor: string;
|
|
24
24
|
height: number;
|
|
@@ -50,7 +50,7 @@ export declare class Header extends React.Component<HeaderProperties> {
|
|
|
50
50
|
fontSize: number;
|
|
51
51
|
};
|
|
52
52
|
};
|
|
53
|
-
renderButton: (button: HeaderButton, type: "left" | "right"
|
|
53
|
+
renderButton: (button: HeaderButton, type: "left" | "right") => JSX.Element;
|
|
54
54
|
renderButtonInvisible: (type: "left" | "right") => JSX.Element;
|
|
55
55
|
render(): JSX.Element;
|
|
56
56
|
}
|
package/lib/components/Header.js
CHANGED
|
@@ -5,17 +5,15 @@ const react_native_1 = require("react-native");
|
|
|
5
5
|
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
6
6
|
const theme_1 = require("../modules/theme");
|
|
7
7
|
const layout_1 = require("../modules/layout");
|
|
8
|
-
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
9
8
|
class Header extends React.Component {
|
|
10
9
|
constructor() {
|
|
11
10
|
super(...arguments);
|
|
12
|
-
this.
|
|
13
|
-
this.getStyles = (height) => {
|
|
11
|
+
this.getStyles = () => {
|
|
14
12
|
const theme = theme_1.getTheme();
|
|
15
13
|
const styles = react_native_1.StyleSheet.create({
|
|
16
14
|
header: {
|
|
17
15
|
backgroundColor: theme.backgroundColor3,
|
|
18
|
-
height:
|
|
16
|
+
height: layout_1.isTablet() ? 65 : 50,
|
|
19
17
|
flexDirection: 'row',
|
|
20
18
|
alignItems: 'center',
|
|
21
19
|
justifyContent: 'center'
|
|
@@ -46,8 +44,8 @@ class Header extends React.Component {
|
|
|
46
44
|
});
|
|
47
45
|
return styles;
|
|
48
46
|
};
|
|
49
|
-
this.renderButton = (button, type
|
|
50
|
-
const styles = this.getStyles(
|
|
47
|
+
this.renderButton = (button, type) => {
|
|
48
|
+
const styles = this.getStyles();
|
|
51
49
|
const theme = theme_1.getTheme();
|
|
52
50
|
const icon = (React.createElement(React.Fragment, null,
|
|
53
51
|
React.createElement(FontAwesome_1.default, { nativeID: button.nativeID, name: button.icon, size: layout_1.isTablet() ? 30 : 20, color: button.disabled ? theme.textColor1 : theme.textColor4, style: button.buttonStyle }),
|
|
@@ -63,7 +61,7 @@ class Header extends React.Component {
|
|
|
63
61
|
return (React.createElement(react_native_1.TouchableOpacity, { onPress: button.onPress, style: style }, icon));
|
|
64
62
|
};
|
|
65
63
|
this.renderButtonInvisible = (type) => {
|
|
66
|
-
const styles = this.getStyles(
|
|
64
|
+
const styles = this.getStyles();
|
|
67
65
|
const style = [
|
|
68
66
|
styles.button,
|
|
69
67
|
type === 'left' ? { marginRight: 'auto' } : { marginLeft: 'auto' }
|
|
@@ -73,18 +71,19 @@ class Header extends React.Component {
|
|
|
73
71
|
}
|
|
74
72
|
render() {
|
|
75
73
|
const { title, leftButton, rightButton } = this.props;
|
|
76
|
-
const styles = this.getStyles(
|
|
77
|
-
return (React.createElement(
|
|
74
|
+
const styles = this.getStyles();
|
|
75
|
+
return (React.createElement(react_native_1.View, { style: styles.header },
|
|
78
76
|
leftButton
|
|
79
|
-
? this.renderButton(leftButton, 'left'
|
|
77
|
+
? this.renderButton(leftButton, 'left')
|
|
80
78
|
: this.renderButtonInvisible('left'),
|
|
81
79
|
React.createElement(react_native_1.Text, { style: styles.title }, title),
|
|
82
80
|
rightButton
|
|
83
|
-
? this.renderButton(rightButton, 'right'
|
|
84
|
-
: this.renderButtonInvisible('right')))
|
|
81
|
+
? this.renderButton(rightButton, 'right')
|
|
82
|
+
: this.renderButtonInvisible('right')));
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
Header.defaultProps = {
|
|
88
86
|
leftButtonType: 'menu'
|
|
89
87
|
};
|
|
88
|
+
Header.height = layout_1.isTablet() ? 65 : 50;
|
|
90
89
|
exports.Header = Header;
|
|
@@ -113,12 +113,13 @@ class RangeDatePicker extends React.Component {
|
|
|
113
113
|
React.createElement(react_native_1.Text, { style: styles.label }, label),
|
|
114
114
|
React.createElement(react_native_1.Text, { style: styles.value }, displayText)),
|
|
115
115
|
React.createElement(FontAwesome_1.default, { name: "calendar", style: styles.icon }),
|
|
116
|
-
react_native_1.Platform.OS !== 'web' &&
|
|
117
|
-
|
|
116
|
+
react_native_1.Platform.OS !== 'web' && (React.createElement(React.Fragment, null,
|
|
117
|
+
React.createElement(react_native_modal_datetime_picker_1.default, { date: startDate, isVisible: showStartDateModal, onConfirm: this.handleStartDateConfirm, onCancel: this.handleStartDateCancel, isDarkModeEnabled: isDarkModeEnabled,
|
|
118
118
|
//@ts-ignore
|
|
119
|
-
display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' })
|
|
119
|
+
display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' }),
|
|
120
|
+
React.createElement(react_native_modal_datetime_picker_1.default, { date: endDate, isVisible: showEndDateModal, onConfirm: this.handleEndDateConfirm, onCancel: this.handleEndDateCancel, isDarkModeEnabled: isDarkModeEnabled,
|
|
120
121
|
//@ts-ignore
|
|
121
|
-
display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' }))
|
|
122
|
+
display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' }))))));
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
exports.RangeDatePicker = RangeDatePicker;
|
package/lib/modules/theme.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const BLACK = "#282c37";
|
|
2
2
|
export declare const WHITE = "#ffffff";
|
|
3
|
-
export declare const GRAY = "#
|
|
3
|
+
export declare const GRAY = "#555";
|
|
4
4
|
export declare const GRAY_1 = "#eef1f6";
|
|
5
5
|
export declare const GRAY_2 = "#dddddd";
|
|
6
6
|
export declare const GRAY_3 = "#c2c2c2";
|
package/lib/modules/theme.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const browser_1 = require("./browser");
|
|
4
4
|
exports.BLACK = '#282c37';
|
|
5
5
|
exports.WHITE = '#ffffff';
|
|
6
|
-
exports.GRAY = '#
|
|
6
|
+
exports.GRAY = '#555';
|
|
7
7
|
exports.GRAY_1 = '#eef1f6';
|
|
8
8
|
exports.GRAY_2 = '#dddddd';
|
|
9
9
|
exports.GRAY_3 = '#c2c2c2';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "secullum-react-native-ui",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.5",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,6 @@
|
|
|
27
27
|
"react-native-elevated-view": "^0.0.6",
|
|
28
28
|
"react-native-masked-text": "^1.7.2",
|
|
29
29
|
"react-native-modal-datetime-picker": "^9.1.0",
|
|
30
|
-
"react-native-safe-area-context": "^3.2.0",
|
|
31
30
|
"react-native-vector-icons": "^8.0.0",
|
|
32
31
|
"react-native-web-modal": "^1.0.1"
|
|
33
32
|
},
|