secullum-react-native-ui 4.16.2-beta.9 → 4.17.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/AppShell.d.ts +52 -0
- package/lib/components/AppShell.js +82 -0
- package/lib/components/Button.d.ts +49 -0
- package/lib/components/Button.js +70 -0
- package/lib/components/Card.d.ts +66 -0
- package/lib/components/Card.js +131 -0
- package/lib/components/CheckBox.d.ts +36 -0
- package/lib/components/CheckBox.js +50 -0
- package/lib/components/DatePicker.d.ts +67 -0
- package/lib/components/DatePicker.js +106 -0
- package/lib/components/DatePicker.web.d.ts +64 -0
- package/lib/components/DatePicker.web.js +106 -0
- package/lib/components/Delay.d.ts +12 -0
- package/lib/components/Delay.js +22 -0
- package/lib/components/Details.d.ts +67 -0
- package/lib/components/Details.js +96 -0
- package/lib/components/DetailsHeader.d.ts +41 -0
- package/lib/components/DetailsHeader.js +65 -0
- package/lib/components/DimensionsMonitor.d.ts +21 -0
- package/lib/components/DimensionsMonitor.js +37 -0
- package/lib/components/DropDown.d.ts +53 -0
- package/lib/components/DropDown.js +351 -0
- package/lib/components/ErrorMessage.d.ts +16 -0
- package/lib/components/ErrorMessage.js +31 -0
- package/lib/components/FilePicker.d.ts +29 -0
- package/lib/components/FilePicker.js +46 -0
- package/lib/components/Header.d.ts +58 -0
- package/lib/components/Header.js +94 -0
- package/lib/components/HeaderDesktop.d.ts +59 -0
- package/lib/components/HeaderDesktop.js +83 -0
- package/lib/components/ImageButton.d.ts +14 -0
- package/lib/components/ImageButton.js +34 -0
- package/lib/components/KeyboardAvoidingView.d.ts +34 -0
- package/lib/components/KeyboardAvoidingView.js +106 -0
- package/lib/components/Link.d.ts +18 -0
- package/lib/components/Link.js +30 -0
- package/lib/components/Loading.d.ts +13 -0
- package/lib/components/Loading.js +45 -0
- package/lib/components/Menu.d.ts +42 -0
- package/lib/components/Menu.js +114 -0
- package/lib/components/MenuDesktop.d.ts +24 -0
- package/lib/components/MenuDesktop.js +39 -0
- package/lib/components/MenuMobile.d.ts +49 -0
- package/lib/components/MenuMobile.js +94 -0
- package/lib/components/Message.d.ts +37 -0
- package/lib/components/Message.js +52 -0
- package/lib/components/Modal.d.ts +18 -0
- package/lib/components/Modal.js +35 -0
- package/lib/components/MultiSelect.d.ts +51 -0
- package/lib/components/MultiSelect.js +377 -0
- package/lib/components/NoRecordMessage.d.ts +23 -0
- package/lib/components/NoRecordMessage.js +36 -0
- package/lib/components/Question.d.ts +57 -0
- package/lib/components/Question.js +79 -0
- package/lib/components/RadioButton.d.ts +43 -0
- package/lib/components/RadioButton.js +55 -0
- package/lib/components/RadioGroup.d.ts +45 -0
- package/lib/components/RadioGroup.js +71 -0
- package/lib/components/RangeDatePicker.d.ts +57 -0
- package/lib/components/RangeDatePicker.js +127 -0
- package/lib/components/RangeDatePicker.web.d.ts +61 -0
- package/lib/components/RangeDatePicker.web.js +146 -0
- package/lib/components/Space.d.ts +11 -0
- package/lib/components/Space.js +15 -0
- package/lib/components/StatusBar.d.ts +18 -0
- package/lib/components/StatusBar.js +33 -0
- package/lib/components/Switch.d.ts +34 -0
- package/lib/components/Switch.js +50 -0
- package/lib/components/Table.d.ts +30 -0
- package/lib/components/Table.js +79 -0
- package/lib/components/Table.web.d.ts +18 -0
- package/lib/components/Table.web.js +111 -0
- package/lib/components/Text.d.ts +29 -0
- package/lib/components/Text.js +38 -0
- package/lib/components/TextBox.d.ts +84 -0
- package/lib/components/TextBox.js +126 -0
- package/lib/components/TextBoxMask.d.ts +12 -0
- package/lib/components/TextBoxMask.js +34 -0
- package/lib/components/TimePicker.d.ts +63 -0
- package/lib/components/TimePicker.js +112 -0
- package/lib/components/TimePicker.web.d.ts +48 -0
- package/lib/components/TimePicker.web.js +88 -0
- package/lib/index.d.ts +40 -0
- package/lib/index.js +56 -0
- package/lib/modules/browser.d.ts +2 -0
- package/lib/modules/browser.js +51 -0
- package/lib/modules/format.d.ts +6 -0
- package/lib/modules/format.js +127 -0
- package/lib/modules/layout.d.ts +1 -0
- package/lib/modules/layout.js +12 -0
- package/lib/modules/test.d.ts +2 -0
- package/lib/modules/test.js +18 -0
- package/lib/modules/theme.d.ts +41 -0
- package/lib/modules/theme.js +52 -0
- package/lib/modules/validation.d.ts +3 -0
- package/lib/modules/validation.js +16 -0
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { NativeEventSubscription } from 'react-native';
|
|
3
|
+
import DrawerLayout from 'react-native-drawer-layout';
|
|
4
|
+
import { MenuProperties } from './Menu';
|
|
5
|
+
export declare type MenuMobileProperties = MenuProperties & {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
drawerLockMode?: 'unlocked' | 'locked-closed' | 'locked-open';
|
|
8
|
+
renderLogo: () => React.ReactNode;
|
|
9
|
+
renderUserData?: () => React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export interface MenuMobileState {
|
|
12
|
+
opened: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class MenuMobile extends React.Component<MenuMobileProperties, MenuMobileState> {
|
|
15
|
+
state: MenuMobileState;
|
|
16
|
+
backButtonHandlerSubscription: NativeEventSubscription | null;
|
|
17
|
+
drawer: DrawerLayout | null;
|
|
18
|
+
componentDidMount(): void;
|
|
19
|
+
componentWillUnmount(): void;
|
|
20
|
+
handleBackButton: () => boolean;
|
|
21
|
+
handleMenuPress: (path: string) => void;
|
|
22
|
+
open: () => void;
|
|
23
|
+
close: () => void;
|
|
24
|
+
getStyles: () => {
|
|
25
|
+
container: {
|
|
26
|
+
flex: number;
|
|
27
|
+
};
|
|
28
|
+
logoContainer: {
|
|
29
|
+
paddingVertical: number;
|
|
30
|
+
paddingLeft: number;
|
|
31
|
+
borderBottomColor: string;
|
|
32
|
+
borderBottomWidth: number;
|
|
33
|
+
flexDirection: "row";
|
|
34
|
+
};
|
|
35
|
+
userContainer: {
|
|
36
|
+
paddingVertical: number;
|
|
37
|
+
paddingLeft: number;
|
|
38
|
+
paddingRight: number;
|
|
39
|
+
borderBottomColor: string;
|
|
40
|
+
borderBottomWidth: number;
|
|
41
|
+
};
|
|
42
|
+
menuContainer: {
|
|
43
|
+
paddingLeft: number;
|
|
44
|
+
flex: number;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
renderNavigationView: () => JSX.Element;
|
|
48
|
+
render(): JSX.Element;
|
|
49
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MenuMobile = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const react_native_drawer_layout_1 = require("react-native-drawer-layout");
|
|
7
|
+
const theme_1 = require("../modules/theme");
|
|
8
|
+
const layout_1 = require("../modules/layout");
|
|
9
|
+
const Menu_1 = require("./Menu");
|
|
10
|
+
class MenuMobile extends React.Component {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.state = {
|
|
14
|
+
opened: false
|
|
15
|
+
};
|
|
16
|
+
this.backButtonHandlerSubscription = null;
|
|
17
|
+
this.drawer = null;
|
|
18
|
+
this.handleBackButton = () => {
|
|
19
|
+
if (this.state.opened) {
|
|
20
|
+
this.close();
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
};
|
|
25
|
+
this.handleMenuPress = (path) => {
|
|
26
|
+
this.close();
|
|
27
|
+
this.props.onMenuPress(path);
|
|
28
|
+
};
|
|
29
|
+
this.open = () => {
|
|
30
|
+
if (this.drawer) {
|
|
31
|
+
this.drawer.openDrawer();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
this.close = () => {
|
|
35
|
+
if (this.drawer) {
|
|
36
|
+
this.drawer.closeDrawer();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.getStyles = () => {
|
|
40
|
+
const theme = (0, theme_1.getTheme)();
|
|
41
|
+
const styles = react_native_1.StyleSheet.create({
|
|
42
|
+
container: {
|
|
43
|
+
flex: 1
|
|
44
|
+
},
|
|
45
|
+
logoContainer: {
|
|
46
|
+
paddingVertical: 5,
|
|
47
|
+
paddingLeft: 10,
|
|
48
|
+
borderBottomColor: theme.borderColor1,
|
|
49
|
+
borderBottomWidth: 1,
|
|
50
|
+
flexDirection: 'row'
|
|
51
|
+
},
|
|
52
|
+
userContainer: {
|
|
53
|
+
paddingVertical: 10,
|
|
54
|
+
paddingLeft: 20,
|
|
55
|
+
paddingRight: 10,
|
|
56
|
+
borderBottomColor: theme.borderColor1,
|
|
57
|
+
borderBottomWidth: 1
|
|
58
|
+
},
|
|
59
|
+
menuContainer: {
|
|
60
|
+
paddingLeft: 20,
|
|
61
|
+
flex: 1
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return styles;
|
|
65
|
+
};
|
|
66
|
+
this.renderNavigationView = () => {
|
|
67
|
+
const { renderLogo, renderUserData, menu, isCurrentMenuPath } = this.props;
|
|
68
|
+
const styles = this.getStyles();
|
|
69
|
+
return (React.createElement(react_native_1.View, { style: styles.container },
|
|
70
|
+
React.createElement(react_native_1.View, { style: styles.logoContainer }, renderLogo()),
|
|
71
|
+
renderUserData && (React.createElement(react_native_1.View, { style: styles.userContainer }, renderUserData())),
|
|
72
|
+
React.createElement(react_native_1.ScrollView, { style: styles.menuContainer },
|
|
73
|
+
React.createElement(Menu_1.Menu, { menu: menu, isCurrentMenuPath: isCurrentMenuPath, onMenuPress: this.handleMenuPress }))));
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
componentDidMount() {
|
|
77
|
+
this.backButtonHandlerSubscription = react_native_1.BackHandler.addEventListener('hardwareBackPress', this.handleBackButton);
|
|
78
|
+
}
|
|
79
|
+
componentWillUnmount() {
|
|
80
|
+
if (this.backButtonHandlerSubscription) {
|
|
81
|
+
this.backButtonHandlerSubscription.remove();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
render() {
|
|
85
|
+
const theme = (0, theme_1.getTheme)();
|
|
86
|
+
return (React.createElement(react_native_drawer_layout_1.default, { ref: drawer => (this.drawer = drawer), drawerLockMode: this.props.drawerLockMode, drawerBackgroundColor: theme.backgroundColor1, drawerWidth: (0, layout_1.isTablet)() ? 450 : 300, drawerPosition: react_native_drawer_layout_1.default.positions.Left, renderNavigationView: this.renderNavigationView, onDrawerOpen: () => this.setState({ opened: true }),
|
|
87
|
+
// When closing the app, we encountered the error 'useInsertionEffect must not schedule updates',
|
|
88
|
+
// because we were trying to update the state during the component render cycle. To avoid this,
|
|
89
|
+
// a setTimeout was introduced with a small delay (enough time to complete the render) before executing other functions.
|
|
90
|
+
// Related issue on GitLab: 11635
|
|
91
|
+
onDrawerClose: () => setTimeout(() => this.setState({ opened: false }), 1) }, this.props.children));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.MenuMobile = MenuMobile;
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Message = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
7
|
+
const Modal_1 = require("./Modal");
|
|
8
|
+
const theme_1 = require("../modules/theme");
|
|
9
|
+
const layout_1 = require("../modules/layout");
|
|
10
|
+
const test_1 = require("../modules/test");
|
|
11
|
+
class Message extends React.Component {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.getStyles = () => {
|
|
15
|
+
const theme = (0, theme_1.getTheme)();
|
|
16
|
+
return react_native_1.StyleSheet.create({
|
|
17
|
+
overlay: {
|
|
18
|
+
alignItems: 'center'
|
|
19
|
+
},
|
|
20
|
+
container: {
|
|
21
|
+
backgroundColor: theme.backgroundColor1,
|
|
22
|
+
borderRadius: 6,
|
|
23
|
+
padding: (0, layout_1.isTablet)() ? 25 : 16,
|
|
24
|
+
width: (0, layout_1.isTablet)() ? 350 : 250,
|
|
25
|
+
marginTop: (0, layout_1.isTablet)() ? 250 : 140,
|
|
26
|
+
alignItems: 'center'
|
|
27
|
+
},
|
|
28
|
+
text: {
|
|
29
|
+
color: theme.textColor3,
|
|
30
|
+
fontFamily: theme.fontFamily1,
|
|
31
|
+
fontSize: (0, layout_1.isTablet)() ? 25 : 16,
|
|
32
|
+
textAlign: 'center',
|
|
33
|
+
marginTop: (0, layout_1.isTablet)() ? 15 : 5,
|
|
34
|
+
width: '100%'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
render() {
|
|
40
|
+
const { message, visible, type, onRequestClose, nativeID, textStyle } = this.props;
|
|
41
|
+
const styles = this.getStyles();
|
|
42
|
+
const theme = (0, theme_1.getTheme)();
|
|
43
|
+
return (React.createElement(Modal_1.Modal, { visible: visible, onRequestClose: onRequestClose, overlayStyle: styles.overlay },
|
|
44
|
+
React.createElement(react_native_1.View, { nativeID: nativeID, style: styles.container },
|
|
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
|
+
React.createElement(react_native_1.Text, { style: [styles.text, textStyle], testID: (0, test_1.getTestID)(nativeID) }, message))));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Message = Message;
|
|
50
|
+
Message.defaultProps = {
|
|
51
|
+
type: 'info'
|
|
52
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface ModalProperties {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
visible: boolean;
|
|
6
|
+
overlayStyle?: StyleProp<ViewStyle>;
|
|
7
|
+
onRequestClose?: () => void;
|
|
8
|
+
}
|
|
9
|
+
interface ModalState {
|
|
10
|
+
isMounted: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare class Modal extends React.Component<ModalProperties> {
|
|
13
|
+
state: ModalState;
|
|
14
|
+
componentDidUpdate(prevProps: ModalProperties): void;
|
|
15
|
+
handleShow: () => void;
|
|
16
|
+
render(): JSX.Element;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Modal = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
class Modal extends React.Component {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.state = {
|
|
10
|
+
isMounted: false
|
|
11
|
+
};
|
|
12
|
+
this.handleShow = () => {
|
|
13
|
+
this.setState({ isMounted: true });
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
componentDidUpdate(prevProps) {
|
|
17
|
+
if (prevProps.visible && !this.props.visible) {
|
|
18
|
+
this.setState({ isMounted: false });
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
const { children, visible, overlayStyle, onRequestClose } = this.props;
|
|
23
|
+
const { isMounted } = this.state;
|
|
24
|
+
return (React.createElement(react_native_1.Modal, { animationType: "fade", transparent: true, visible: visible, supportedOrientations: ['landscape', 'portrait'], onRequestClose: onRequestClose, onShow: this.handleShow },
|
|
25
|
+
React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: onRequestClose },
|
|
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
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.Modal = Modal;
|
|
30
|
+
const styles = react_native_1.StyleSheet.create({
|
|
31
|
+
overlay: {
|
|
32
|
+
flex: 1,
|
|
33
|
+
backgroundColor: 'rgba(33, 33, 33, 0.7)'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { IconProps } from 'react-native-vector-icons/Icon';
|
|
3
|
+
export interface MultiSelectProperties {
|
|
4
|
+
label: string;
|
|
5
|
+
items: Array<{
|
|
6
|
+
label: string;
|
|
7
|
+
value: any;
|
|
8
|
+
icon?: string;
|
|
9
|
+
}>;
|
|
10
|
+
values: any[] | null;
|
|
11
|
+
onChange: (value: any) => void;
|
|
12
|
+
selectedAllDescription?: string;
|
|
13
|
+
selectedManyDescription?: string;
|
|
14
|
+
selectedNoneDescription?: string;
|
|
15
|
+
okButtonDescription?: string;
|
|
16
|
+
cancelButtonDescription?: string;
|
|
17
|
+
emptyMessage?: string;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
iconComponent?: React.ComponentClass<IconProps>;
|
|
20
|
+
}
|
|
21
|
+
export interface MultiSelectState {
|
|
22
|
+
modalOpen: boolean;
|
|
23
|
+
selectedValues: any[];
|
|
24
|
+
selectedValuesInitial: any[];
|
|
25
|
+
}
|
|
26
|
+
export declare class MultiSelect extends React.Component<MultiSelectProperties, MultiSelectState> {
|
|
27
|
+
static defaultProps: {
|
|
28
|
+
emptyMessage: string;
|
|
29
|
+
selectedAllDescription: string;
|
|
30
|
+
selectedManyDescription: string;
|
|
31
|
+
selectedNoneDescription: string;
|
|
32
|
+
okButtonDescription: string;
|
|
33
|
+
cancelButtonDescription: string;
|
|
34
|
+
};
|
|
35
|
+
state: MultiSelectState;
|
|
36
|
+
componentDidMount: () => void;
|
|
37
|
+
componentDidUpdate: (prevProps: MultiSelectProperties) => void;
|
|
38
|
+
handleAddValue: (value: any) => void;
|
|
39
|
+
handleRemoveValue: (value: any) => void;
|
|
40
|
+
handleSave: () => void;
|
|
41
|
+
renderClosedWithNone: () => JSX.Element;
|
|
42
|
+
renderClosedWithAll: () => JSX.Element;
|
|
43
|
+
renderClosedWithOneLabel: (label: string) => JSX.Element;
|
|
44
|
+
renderClosedWithOneIcon: (icon: string) => JSX.Element;
|
|
45
|
+
renderClosedWithOneLabelAndIcon: (label: string, icon: string) => JSX.Element;
|
|
46
|
+
renderClosedWithOne: (label?: string, icon?: string) => JSX.Element | null;
|
|
47
|
+
renderClosedWithMany: () => JSX.Element;
|
|
48
|
+
renderClosedMultiSelect: (items: any, numOptions: number) => JSX.Element | null;
|
|
49
|
+
getStyles: () => any;
|
|
50
|
+
render(): JSX.Element;
|
|
51
|
+
}
|