secullum-react-native-ui 4.3.7 → 4.3.8-beta.2

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.
Files changed (95) hide show
  1. package/package.json +1 -1
  2. package/lib/components/AppShell.d.ts +0 -24
  3. package/lib/components/AppShell.js +0 -79
  4. package/lib/components/Button.d.ts +0 -47
  5. package/lib/components/Button.js +0 -65
  6. package/lib/components/Card.d.ts +0 -61
  7. package/lib/components/Card.js +0 -117
  8. package/lib/components/CheckBox.d.ts +0 -34
  9. package/lib/components/CheckBox.js +0 -46
  10. package/lib/components/DatePicker.d.ts +0 -63
  11. package/lib/components/DatePicker.js +0 -102
  12. package/lib/components/DatePicker.web.d.ts +0 -64
  13. package/lib/components/DatePicker.web.js +0 -105
  14. package/lib/components/Delay.d.ts +0 -12
  15. package/lib/components/Delay.js +0 -21
  16. package/lib/components/Details.d.ts +0 -66
  17. package/lib/components/Details.js +0 -94
  18. package/lib/components/DetailsHeader.d.ts +0 -37
  19. package/lib/components/DetailsHeader.js +0 -63
  20. package/lib/components/DimensionsMonitor.d.ts +0 -21
  21. package/lib/components/DimensionsMonitor.js +0 -35
  22. package/lib/components/DropDown.d.ts +0 -34
  23. package/lib/components/DropDown.js +0 -255
  24. package/lib/components/ErrorMessage.d.ts +0 -16
  25. package/lib/components/ErrorMessage.js +0 -29
  26. package/lib/components/FilePicker.d.ts +0 -28
  27. package/lib/components/FilePicker.js +0 -44
  28. package/lib/components/Header.d.ts +0 -56
  29. package/lib/components/Header.js +0 -89
  30. package/lib/components/HeaderDesktop.d.ts +0 -59
  31. package/lib/components/HeaderDesktop.js +0 -80
  32. package/lib/components/ImageButton.d.ts +0 -14
  33. package/lib/components/ImageButton.js +0 -32
  34. package/lib/components/KeyboardAvoidingView.d.ts +0 -33
  35. package/lib/components/KeyboardAvoidingView.js +0 -91
  36. package/lib/components/Link.d.ts +0 -17
  37. package/lib/components/Link.js +0 -28
  38. package/lib/components/Loading.d.ts +0 -4
  39. package/lib/components/Loading.js +0 -37
  40. package/lib/components/Menu.d.ts +0 -42
  41. package/lib/components/Menu.js +0 -112
  42. package/lib/components/MenuDesktop.d.ts +0 -24
  43. package/lib/components/MenuDesktop.js +0 -38
  44. package/lib/components/MenuMobile.d.ts +0 -47
  45. package/lib/components/MenuMobile.js +0 -85
  46. package/lib/components/Message.d.ts +0 -37
  47. package/lib/components/Message.js +0 -50
  48. package/lib/components/Modal.d.ts +0 -11
  49. package/lib/components/Modal.js +0 -20
  50. package/lib/components/MultiSelect.d.ts +0 -51
  51. package/lib/components/MultiSelect.js +0 -376
  52. package/lib/components/NoRecordMessage.d.ts +0 -23
  53. package/lib/components/NoRecordMessage.js +0 -35
  54. package/lib/components/Question.d.ts +0 -57
  55. package/lib/components/Question.js +0 -72
  56. package/lib/components/RadioButton.d.ts +0 -42
  57. package/lib/components/RadioButton.js +0 -53
  58. package/lib/components/RadioGroup.d.ts +0 -44
  59. package/lib/components/RadioGroup.js +0 -64
  60. package/lib/components/RangeDatePicker.d.ts +0 -57
  61. package/lib/components/RangeDatePicker.js +0 -126
  62. package/lib/components/RangeDatePicker.web.d.ts +0 -61
  63. package/lib/components/RangeDatePicker.web.js +0 -119
  64. package/lib/components/Space.d.ts +0 -11
  65. package/lib/components/Space.js +0 -14
  66. package/lib/components/StatusBar.d.ts +0 -11
  67. package/lib/components/StatusBar.js +0 -27
  68. package/lib/components/Switch.d.ts +0 -34
  69. package/lib/components/Switch.js +0 -49
  70. package/lib/components/Table.d.ts +0 -28
  71. package/lib/components/Table.js +0 -62
  72. package/lib/components/Table.web.d.ts +0 -18
  73. package/lib/components/Table.web.js +0 -108
  74. package/lib/components/Text.d.ts +0 -28
  75. package/lib/components/Text.js +0 -36
  76. package/lib/components/TextBox.d.ts +0 -96
  77. package/lib/components/TextBox.js +0 -103
  78. package/lib/components/TextBoxMask.d.ts +0 -12
  79. package/lib/components/TextBoxMask.js +0 -29
  80. package/lib/components/TimePicker.d.ts +0 -63
  81. package/lib/components/TimePicker.js +0 -111
  82. package/lib/components/TimePicker.web.d.ts +0 -48
  83. package/lib/components/TimePicker.web.js +0 -82
  84. package/lib/index.d.ts +0 -39
  85. package/lib/index.js +0 -44
  86. package/lib/modules/browser.d.ts +0 -2
  87. package/lib/modules/browser.js +0 -50
  88. package/lib/modules/format.d.ts +0 -6
  89. package/lib/modules/format.js +0 -99
  90. package/lib/modules/layout.d.ts +0 -1
  91. package/lib/modules/layout.js +0 -10
  92. package/lib/modules/theme.d.ts +0 -41
  93. package/lib/modules/theme.js +0 -49
  94. package/lib/modules/validation.d.ts +0 -3
  95. package/lib/modules/validation.js +0 -12
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
5
- const theme_1 = require("../modules/theme");
6
- const react_native_1 = require("react-native");
7
- class ImageButton extends React.Component {
8
- render() {
9
- const { icon, style, iconColor, onPress, iconSize, hitBoxSize, nativeID } = this.props;
10
- return (React.createElement(react_native_1.TouchableOpacity, { onPress: onPress, activeOpacity: 0.5, style: [styles.container, style], hitSlop: hitBoxSize
11
- ? {
12
- top: hitBoxSize,
13
- bottom: hitBoxSize,
14
- left: hitBoxSize,
15
- right: hitBoxSize
16
- }
17
- : undefined },
18
- React.createElement(FontAwesome_1.default, { nativeID: nativeID, name: icon, size: iconSize || 20, color: iconColor || theme.textColor1 })));
19
- }
20
- }
21
- exports.ImageButton = ImageButton;
22
- const theme = theme_1.getTheme();
23
- const styles = react_native_1.StyleSheet.create({
24
- container: {
25
- borderWidth: 1,
26
- borderColor: theme.borderColor1,
27
- alignItems: 'center',
28
- justifyContent: 'center',
29
- width: 40,
30
- height: 40
31
- }
32
- });
@@ -1,33 +0,0 @@
1
- import * as React from 'react';
2
- import { EmitterSubscription, KeyboardEvent, NativeScrollEvent, RefreshControlProps, ScrollView } from 'react-native';
3
- export interface KeyboardAvoidingViewProperties {
4
- extraFieldHeight: number;
5
- extraWindowHeight: number;
6
- refreshControl?: React.ReactElement<RefreshControlProps>;
7
- children: (options: {
8
- availableHeight: number;
9
- }) => JSX.Element;
10
- scrollEnabled?: boolean;
11
- onScroll?: (event: NativeScrollEvent) => void;
12
- }
13
- export interface KeyboardAvoidingViewState {
14
- keyboardHeight: number;
15
- }
16
- export declare class KeyboardAvoidingView extends React.Component<KeyboardAvoidingViewProperties, KeyboardAvoidingViewState> {
17
- static defaultProps: {
18
- extraFieldHeight: number;
19
- extraWindowHeight: number;
20
- scrollEnabled: boolean;
21
- };
22
- keyboardDidShowSubscription?: EmitterSubscription;
23
- keyboardDidHideSubscription?: EmitterSubscription;
24
- scrollViewRef: React.RefObject<ScrollView>;
25
- state: KeyboardAvoidingViewState;
26
- componentDidMount(): void;
27
- componentWillUnmount(): void;
28
- handleKeyboardShow: (event: KeyboardEvent) => void;
29
- handleKeyboardHide: () => void;
30
- scrollTo: (x: number, y: number) => void;
31
- scrollToEnd: () => void;
32
- render(): JSX.Element;
33
- }
@@ -1,91 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_1 = require("react-native");
5
- class KeyboardAvoidingView extends React.Component {
6
- constructor() {
7
- super(...arguments);
8
- this.scrollViewRef = React.createRef();
9
- this.state = {
10
- keyboardHeight: 0
11
- };
12
- this.handleKeyboardShow = (event) => {
13
- const keyboardHeight = event.endCoordinates.height;
14
- const keyboardPosition = event.endCoordinates.screenY;
15
- this.setState({
16
- keyboardHeight
17
- });
18
- const scrollView = this.scrollViewRef.current;
19
- if (!scrollView) {
20
- return;
21
- }
22
- //@ts-ignore
23
- const currentlyFocusedInput = react_native_1.TextInput.State.currentlyFocusedInput();
24
- if (!currentlyFocusedInput) {
25
- return;
26
- }
27
- const { extraFieldHeight, extraWindowHeight } = this.props;
28
- const currentlyFocusedInputNode = react_native_1.findNodeHandle(currentlyFocusedInput);
29
- // @ts-ignore: no types :(
30
- react_native_1.UIManager.viewIsDescendantOf(currentlyFocusedInputNode, react_native_1.findNodeHandle(scrollView), (isDescendant) => {
31
- if (!isDescendant) {
32
- return;
33
- }
34
- currentlyFocusedInput.measure((x, y, width, height, pageX, pageY) => {
35
- const fieldPosition = pageY + height + extraFieldHeight;
36
- if (fieldPosition <= keyboardPosition) {
37
- return;
38
- }
39
- scrollView.scrollResponderScrollNativeHandleToKeyboard(currentlyFocusedInputNode, extraWindowHeight + extraFieldHeight, true);
40
- });
41
- });
42
- };
43
- this.handleKeyboardHide = () => {
44
- this.setState({
45
- keyboardHeight: 0
46
- });
47
- };
48
- this.scrollTo = (x, y) => {
49
- if (!this.scrollViewRef.current) {
50
- return;
51
- }
52
- this.scrollViewRef.current.scrollTo({ x, y });
53
- };
54
- this.scrollToEnd = () => {
55
- if (!this.scrollViewRef.current) {
56
- return;
57
- }
58
- this.scrollViewRef.current.scrollToEnd();
59
- };
60
- }
61
- componentDidMount() {
62
- // Android doesn't have 'will' events, but we can use 'did' there without any problem
63
- // iOS on the other hand needs to use the 'will' events otherwise the screen would show some empty spaces during keyboard events
64
- this.keyboardDidShowSubscription = react_native_1.Keyboard.addListener(react_native_1.Platform.OS === 'ios' ? 'keyboardWillShow' : 'keyboardDidShow', this.handleKeyboardShow);
65
- this.keyboardDidHideSubscription = react_native_1.Keyboard.addListener(react_native_1.Platform.OS === 'ios' ? 'keyboardWillHide' : 'keyboardDidHide', this.handleKeyboardHide);
66
- }
67
- componentWillUnmount() {
68
- this.keyboardDidShowSubscription.remove();
69
- this.keyboardDidHideSubscription.remove();
70
- }
71
- render() {
72
- // Android devices with notch will report less `availableHeight` than it should
73
- // That's because of this: https://github.com/facebook/react-native/issues/23693
74
- // If I change it to 'screen', Android devices with virtual buttons will report more than it should
75
- const availableHeight = react_native_1.Dimensions.get('window').height -
76
- this.state.keyboardHeight -
77
- this.props.extraWindowHeight;
78
- return (React.createElement(react_native_1.View, { style: { height: availableHeight } },
79
- React.createElement(react_native_1.ScrollView, { ref: this.scrollViewRef, refreshControl: this.props.refreshControl, scrollEnabled: this.props.scrollEnabled, onScroll: (e) => {
80
- if (this.props.onScroll) {
81
- this.props.onScroll(e.nativeEvent);
82
- }
83
- } }, this.props.children({ availableHeight }))));
84
- }
85
- }
86
- KeyboardAvoidingView.defaultProps = {
87
- extraFieldHeight: 0,
88
- extraWindowHeight: 0,
89
- scrollEnabled: true
90
- };
91
- exports.KeyboardAvoidingView = KeyboardAvoidingView;
@@ -1,17 +0,0 @@
1
- import * as React from 'react';
2
- import { StyleProp, TextStyle } from 'react-native';
3
- export interface LinkProperties {
4
- text: string;
5
- style?: StyleProp<TextStyle>;
6
- onPress: () => void;
7
- }
8
- export declare class Link extends React.Component<LinkProperties> {
9
- getStyles: () => {
10
- link: {
11
- fontFamily: string;
12
- fontSize: number;
13
- color: string;
14
- };
15
- };
16
- render(): JSX.Element;
17
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const theme_1 = require("../modules/theme");
5
- const react_native_1 = require("react-native");
6
- class Link extends React.Component {
7
- constructor() {
8
- super(...arguments);
9
- this.getStyles = () => {
10
- const theme = theme_1.getTheme();
11
- const styles = react_native_1.StyleSheet.create({
12
- link: {
13
- fontFamily: theme.fontFamily2,
14
- fontSize: 14,
15
- color: theme.textColor2
16
- }
17
- });
18
- return styles;
19
- };
20
- }
21
- render() {
22
- const { text, style, onPress } = this.props;
23
- const styles = this.getStyles();
24
- return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.7, onPress: onPress },
25
- React.createElement(react_native_1.Text, { style: [styles.link, style] }, text)));
26
- }
27
- }
28
- exports.Link = Link;
@@ -1,4 +0,0 @@
1
- import * as React from 'react';
2
- export declare class Loading extends React.Component {
3
- render(): JSX.Element;
4
- }
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_1 = require("react-native");
5
- class Loading extends React.Component {
6
- render() {
7
- return (React.createElement(React.Fragment, null,
8
- React.createElement(react_native_1.View, { style: styles.backgroundView }),
9
- React.createElement(react_native_1.ActivityIndicator, { style: styles.indicator, size: "large", color: "#aaa" })));
10
- }
11
- }
12
- exports.Loading = Loading;
13
- const styles = react_native_1.StyleSheet.create({
14
- backgroundView: {
15
- zIndex: 9998,
16
- position: 'absolute',
17
- width: '100%',
18
- height: '100%',
19
- opacity: 0.6,
20
- backgroundColor: '#ccc',
21
- top: 0,
22
- bottom: 0,
23
- left: 0,
24
- right: 0 // IE fix
25
- },
26
- indicator: {
27
- zIndex: 9999,
28
- position: 'absolute',
29
- width: '100%',
30
- height: '100%',
31
- justifyContent: 'space-around',
32
- top: 0,
33
- bottom: 0,
34
- left: 0,
35
- right: 0 // IE fix
36
- }
37
- });
@@ -1,42 +0,0 @@
1
- import * as React from 'react';
2
- import { StyleProp, TextStyle } from 'react-native';
3
- export interface MenuItemData {
4
- path?: string;
5
- text: string;
6
- textStyle?: StyleProp<TextStyle>;
7
- subText?: string;
8
- subTextStyle?: StyleProp<TextStyle>;
9
- disabled?: boolean;
10
- nativeID?: string;
11
- }
12
- export interface MenuItemProperties {
13
- menuItem: MenuItemData;
14
- icon?: string;
15
- textStyle?: StyleProp<TextStyle>;
16
- onPress: () => void;
17
- isCurrentMenuPath?: (path: string) => boolean;
18
- }
19
- export declare function MenuItem(props: MenuItemProperties): JSX.Element;
20
- export interface MenuProperties {
21
- menu: Array<MenuItemData & {
22
- submenu?: Array<MenuItemData>;
23
- }>;
24
- onMenuPress: (path: string) => void;
25
- isCurrentMenuPath?: (path: string) => boolean;
26
- }
27
- export interface MenuState {
28
- indexMenuOpened: number;
29
- }
30
- export declare class Menu extends React.Component<MenuProperties, MenuState> {
31
- state: MenuState;
32
- componentDidMount(): void;
33
- handleParentMenuPress: (index: number) => void;
34
- handleMenuPress: (path?: string | undefined) => void;
35
- getStyles: () => {
36
- submenuText: {
37
- paddingLeft: number;
38
- paddingVertical: number;
39
- };
40
- };
41
- render(): JSX.Element;
42
- }
@@ -1,112 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
5
- const theme_1 = require("../modules/theme");
6
- const layout_1 = require("../modules/layout");
7
- const react_native_1 = require("react-native");
8
- function MenuItem(props) {
9
- const theme = theme_1.getTheme();
10
- const styles = react_native_1.StyleSheet.create({
11
- container: {
12
- flexDirection: 'row',
13
- justifyContent: 'space-between',
14
- width: '100%',
15
- paddingRight: 10
16
- },
17
- text: {
18
- color: theme.textColor1,
19
- fontFamily: theme.fontFamily1,
20
- fontSize: layout_1.isTablet() ? 20 : 16,
21
- paddingVertical: layout_1.isTablet() ? 15 : 14
22
- },
23
- textDisabled: {
24
- color: theme.borderColor1
25
- },
26
- textSelected: {
27
- color: theme.textColor2
28
- },
29
- subText: {
30
- fontSize: 12,
31
- marginLeft: 5
32
- },
33
- icon: {
34
- paddingTop: 12,
35
- paddingRight: 10,
36
- color: theme.textColor1
37
- }
38
- });
39
- const { menuItem, icon, textStyle, onPress, isCurrentMenuPath } = props;
40
- const selected = isCurrentMenuPath != undefined &&
41
- menuItem.path != undefined &&
42
- isCurrentMenuPath(menuItem.path);
43
- return (React.createElement(react_native_1.TouchableOpacity, { disabled: menuItem.disabled, style: styles.container, onPress: onPress },
44
- React.createElement(react_native_1.Text, { nativeID: menuItem.nativeID, style: [
45
- styles.text,
46
- menuItem.disabled && styles.textDisabled,
47
- selected && styles.textSelected,
48
- textStyle,
49
- menuItem.textStyle
50
- ] },
51
- menuItem.text,
52
- menuItem.subText && (React.createElement(react_native_1.Text, { style: [styles.subText, menuItem.subTextStyle] }, menuItem.subText))),
53
- icon && React.createElement(FontAwesome_1.default, { name: icon, style: styles.icon, size: 20 })));
54
- }
55
- exports.MenuItem = MenuItem;
56
- class Menu extends React.Component {
57
- constructor() {
58
- super(...arguments);
59
- this.state = {
60
- indexMenuOpened: -1
61
- };
62
- this.handleParentMenuPress = (index) => {
63
- this.setState({
64
- indexMenuOpened: this.state.indexMenuOpened === index ? -1 : index
65
- });
66
- };
67
- this.handleMenuPress = (path) => {
68
- if (path != undefined) {
69
- this.props.onMenuPress(path);
70
- }
71
- };
72
- this.getStyles = () => {
73
- const styles = react_native_1.StyleSheet.create({
74
- submenuText: {
75
- paddingLeft: 20,
76
- paddingVertical: layout_1.isTablet() ? 10 : 8
77
- }
78
- });
79
- return styles;
80
- };
81
- }
82
- componentDidMount() {
83
- const { menu, isCurrentMenuPath } = this.props;
84
- const indexMenuOpened = menu.findIndex(menuItem => menuItem.submenu != undefined &&
85
- menuItem.submenu.some(submenuItem => isCurrentMenuPath != undefined &&
86
- submenuItem.path != undefined &&
87
- isCurrentMenuPath(submenuItem.path)));
88
- this.setState({ indexMenuOpened });
89
- }
90
- render() {
91
- const { menu, isCurrentMenuPath } = this.props;
92
- const styles = this.getStyles();
93
- return (React.createElement(React.Fragment, null, menu.map((menuItem, menuItemIndex) => {
94
- const menuItemIsOpen = this.state.indexMenuOpened === menuItemIndex;
95
- const menuItemIcon = menuItem.submenu
96
- ? menuItemIsOpen
97
- ? 'caret-up'
98
- : 'caret-down'
99
- : undefined;
100
- const menuItemOnPress = () => menuItem.submenu
101
- ? this.handleParentMenuPress(menuItemIndex)
102
- : this.handleMenuPress(menuItem.path);
103
- return (React.createElement(react_native_1.View, { key: menuItemIndex },
104
- React.createElement(MenuItem, { menuItem: menuItem, icon: menuItemIcon, onPress: menuItemOnPress, isCurrentMenuPath: isCurrentMenuPath }),
105
- menuItem.submenu && (React.createElement(react_native_1.View, { style: {
106
- height: menuItemIsOpen ? 'auto' : 0,
107
- overflow: 'hidden'
108
- } }, menuItem.submenu.map((submenuItem, submenuItemIndex) => (React.createElement(MenuItem, { key: submenuItemIndex, menuItem: submenuItem, textStyle: styles.submenuText, onPress: () => this.handleMenuPress(submenuItem.path), isCurrentMenuPath: isCurrentMenuPath })))))));
109
- })));
110
- }
111
- }
112
- exports.Menu = Menu;
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- import { MenuProperties } from './Menu';
3
- export declare type MenuDesktopProperties = MenuProperties & {
4
- headerHeight: number;
5
- renderUserData?: () => React.ReactNode;
6
- };
7
- export declare class MenuDesktop extends React.Component<MenuDesktopProperties> {
8
- static defaultProps: {
9
- headerHeight: number;
10
- };
11
- getStyles: () => {
12
- container: {
13
- backgroundColor: string;
14
- height: number;
15
- width: number;
16
- paddingHorizontal: number;
17
- paddingVertical: number;
18
- shadowOpacity: number;
19
- shadowRadius: number;
20
- shadowColor: string;
21
- };
22
- };
23
- render(): JSX.Element;
24
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_1 = require("react-native");
5
- const theme_1 = require("../modules/theme");
6
- const Menu_1 = require("./Menu");
7
- class MenuDesktop extends React.Component {
8
- constructor() {
9
- super(...arguments);
10
- this.getStyles = () => {
11
- const theme = theme_1.getTheme();
12
- const styles = react_native_1.StyleSheet.create({
13
- container: {
14
- backgroundColor: theme.backgroundColor1,
15
- height: react_native_1.Dimensions.get('window').height - this.props.headerHeight,
16
- width: 250,
17
- paddingHorizontal: 15,
18
- paddingVertical: 15,
19
- shadowOpacity: 0.31,
20
- shadowRadius: 20,
21
- shadowColor: theme.shadowColor1
22
- }
23
- });
24
- return styles;
25
- };
26
- }
27
- render() {
28
- const { menu, onMenuPress, isCurrentMenuPath, renderUserData } = this.props;
29
- const styles = this.getStyles();
30
- return (React.createElement(react_native_1.View, { style: styles.container },
31
- renderUserData ? React.createElement(react_native_1.View, null, renderUserData()) : null,
32
- React.createElement(Menu_1.Menu, { menu: menu, isCurrentMenuPath: isCurrentMenuPath, onMenuPress: onMenuPress })));
33
- }
34
- }
35
- MenuDesktop.defaultProps = {
36
- headerHeight: 0
37
- };
38
- exports.MenuDesktop = MenuDesktop;
@@ -1,47 +0,0 @@
1
- import * as React from 'react';
2
- import DrawerLayout from 'react-native-drawer-layout';
3
- import { MenuProperties } from './Menu';
4
- export declare type MenuMobileProperties = MenuProperties & {
5
- children: React.ReactNode;
6
- drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open';
7
- renderLogo: () => React.ReactNode;
8
- renderUserData?: () => React.ReactNode;
9
- };
10
- export interface MenuMobileState {
11
- opened: boolean;
12
- }
13
- export declare class MenuMobile extends React.Component<MenuMobileProperties, MenuMobileState> {
14
- state: MenuMobileState;
15
- drawer: DrawerLayout | null;
16
- componentDidMount(): void;
17
- componentWillUnmount(): void;
18
- handleBackButton: () => boolean;
19
- handleMenuPress: (path: string) => void;
20
- open: () => void;
21
- close: () => void;
22
- getStyles: () => {
23
- container: {
24
- flex: number;
25
- };
26
- logoContainer: {
27
- paddingVertical: number;
28
- paddingLeft: number;
29
- borderBottomColor: string;
30
- borderBottomWidth: number;
31
- flexDirection: "row";
32
- };
33
- userContainer: {
34
- paddingVertical: number;
35
- paddingLeft: number;
36
- paddingRight: number;
37
- borderBottomColor: string;
38
- borderBottomWidth: number;
39
- };
40
- menuContainer: {
41
- paddingLeft: number;
42
- flex: number;
43
- };
44
- };
45
- renderNavigationView: () => JSX.Element;
46
- render(): JSX.Element;
47
- }
@@ -1,85 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_1 = require("react-native");
5
- const react_native_drawer_layout_1 = require("react-native-drawer-layout");
6
- const theme_1 = require("../modules/theme");
7
- const layout_1 = require("../modules/layout");
8
- const Menu_1 = require("./Menu");
9
- class MenuMobile extends React.Component {
10
- constructor() {
11
- super(...arguments);
12
- this.state = {
13
- opened: false
14
- };
15
- this.drawer = null;
16
- this.handleBackButton = () => {
17
- if (this.state.opened) {
18
- this.close();
19
- return true;
20
- }
21
- return false;
22
- };
23
- this.handleMenuPress = (path) => {
24
- this.close();
25
- this.props.onMenuPress(path);
26
- };
27
- this.open = () => {
28
- if (this.drawer) {
29
- this.drawer.openDrawer();
30
- }
31
- };
32
- this.close = () => {
33
- if (this.drawer) {
34
- this.drawer.closeDrawer();
35
- }
36
- };
37
- this.getStyles = () => {
38
- const theme = theme_1.getTheme();
39
- const styles = react_native_1.StyleSheet.create({
40
- container: {
41
- flex: 1
42
- },
43
- logoContainer: {
44
- paddingVertical: 5,
45
- paddingLeft: 10,
46
- borderBottomColor: theme.borderColor1,
47
- borderBottomWidth: 1,
48
- flexDirection: 'row'
49
- },
50
- userContainer: {
51
- paddingVertical: 10,
52
- paddingLeft: 20,
53
- paddingRight: 10,
54
- borderBottomColor: theme.borderColor1,
55
- borderBottomWidth: 1
56
- },
57
- menuContainer: {
58
- paddingLeft: 20,
59
- flex: 1
60
- }
61
- });
62
- return styles;
63
- };
64
- this.renderNavigationView = () => {
65
- const { renderLogo, renderUserData, menu, isCurrentMenuPath } = this.props;
66
- const styles = this.getStyles();
67
- return (React.createElement(react_native_1.View, { style: styles.container },
68
- React.createElement(react_native_1.View, { style: styles.logoContainer }, renderLogo()),
69
- renderUserData && (React.createElement(react_native_1.View, { style: styles.userContainer }, renderUserData())),
70
- React.createElement(react_native_1.ScrollView, { style: styles.menuContainer },
71
- React.createElement(Menu_1.Menu, { menu: menu, isCurrentMenuPath: isCurrentMenuPath, onMenuPress: this.handleMenuPress }))));
72
- };
73
- }
74
- componentDidMount() {
75
- react_native_1.BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
76
- }
77
- componentWillUnmount() {
78
- react_native_1.BackHandler.removeEventListener('hardwareBackPress', this.handleBackButton);
79
- }
80
- render() {
81
- const theme = theme_1.getTheme();
82
- return (React.createElement(react_native_drawer_layout_1.default, { ref: drawer => (this.drawer = drawer), drawerLockMode: this.props.drawerLockMode, drawerBackgroundColor: theme.backgroundColor1, drawerWidth: layout_1.isTablet() ? 450 : 300, drawerPosition: react_native_drawer_layout_1.default.positions.Left, renderNavigationView: this.renderNavigationView, onDrawerOpen: () => this.setState({ opened: true }), onDrawerClose: () => this.setState({ opened: false }) }, this.props.children));
83
- }
84
- }
85
- exports.MenuMobile = MenuMobile;
@@ -1,37 +0,0 @@
1
- import * as React from 'react';
2
- import { StyleProp, TextStyle } from 'react-native';
3
- export interface MessageProperties {
4
- message: string;
5
- visible: boolean;
6
- type?: 'info' | 'warning';
7
- onRequestClose?: () => void;
8
- nativeID?: string;
9
- textStyle?: StyleProp<TextStyle>;
10
- }
11
- export declare class Message extends React.Component<MessageProperties> {
12
- static defaultProps: {
13
- type: string;
14
- };
15
- getStyles: () => {
16
- overlay: {
17
- alignItems: "center";
18
- };
19
- container: {
20
- backgroundColor: string;
21
- borderRadius: number;
22
- padding: number;
23
- width: number;
24
- marginTop: number;
25
- alignItems: "center";
26
- };
27
- text: {
28
- color: string;
29
- fontFamily: string;
30
- fontSize: number;
31
- textAlign: "center";
32
- marginTop: number;
33
- width: string;
34
- };
35
- };
36
- render(): JSX.Element;
37
- }