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,52 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { HeaderButton } from './Header';
|
|
3
|
+
import { GreetingMessage } from './HeaderDesktop';
|
|
4
|
+
import { MenuProperties } from './Menu';
|
|
5
|
+
import { MenuMobile } from './MenuMobile';
|
|
6
|
+
import { StyleSheet, StyleProp, TextStyle } from 'react-native';
|
|
7
|
+
export declare type AppShellProperties = MenuProperties & {
|
|
8
|
+
logoHeader: () => React.ReactNode;
|
|
9
|
+
logoMenu: () => React.ReactNode;
|
|
10
|
+
title?: string;
|
|
11
|
+
greeting?: GreetingMessage;
|
|
12
|
+
screenTitle: string;
|
|
13
|
+
renderUserData?: () => React.ReactNode;
|
|
14
|
+
rightButton?: HeaderButton;
|
|
15
|
+
headerStyle?: StyleProp<TextStyle>;
|
|
16
|
+
alwaysDesktop?: boolean;
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
export declare class AppShell extends React.Component<AppShellProperties> {
|
|
20
|
+
menu: MenuMobile | null;
|
|
21
|
+
getMobileStyles: () => StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
22
|
+
container: {
|
|
23
|
+
flex: number;
|
|
24
|
+
padding: number;
|
|
25
|
+
height: number;
|
|
26
|
+
overflow: "auto";
|
|
27
|
+
};
|
|
28
|
+
logoText: {
|
|
29
|
+
color: string;
|
|
30
|
+
fontFamily: string;
|
|
31
|
+
fontSize: number;
|
|
32
|
+
marginLeft: number;
|
|
33
|
+
display: "flex";
|
|
34
|
+
alignItems: "center";
|
|
35
|
+
};
|
|
36
|
+
}>;
|
|
37
|
+
getDesktopStyles: () => StyleSheet.NamedStyles<any> | StyleSheet.NamedStyles<{
|
|
38
|
+
container: {
|
|
39
|
+
flexDirection: "row";
|
|
40
|
+
flex: number;
|
|
41
|
+
};
|
|
42
|
+
content: {
|
|
43
|
+
flex: number;
|
|
44
|
+
padding: number;
|
|
45
|
+
height: number;
|
|
46
|
+
overflow: "auto";
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
renderMobile: () => JSX.Element;
|
|
50
|
+
renderDesktop: () => JSX.Element;
|
|
51
|
+
render(): JSX.Element;
|
|
52
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppShell = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const DimensionsMonitor_1 = require("./DimensionsMonitor");
|
|
6
|
+
const Header_1 = require("./Header");
|
|
7
|
+
const HeaderDesktop_1 = require("./HeaderDesktop");
|
|
8
|
+
const MenuMobile_1 = require("./MenuMobile");
|
|
9
|
+
const MenuDesktop_1 = require("./MenuDesktop");
|
|
10
|
+
const theme_1 = require("../modules/theme");
|
|
11
|
+
const react_native_1 = require("react-native");
|
|
12
|
+
class AppShell extends React.Component {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.menu = null;
|
|
16
|
+
this.getMobileStyles = () => {
|
|
17
|
+
const theme = (0, theme_1.getTheme)();
|
|
18
|
+
const styles = react_native_1.StyleSheet.create({
|
|
19
|
+
container: {
|
|
20
|
+
flex: 1,
|
|
21
|
+
padding: 16,
|
|
22
|
+
height: react_native_1.Dimensions.get('window').height - HeaderDesktop_1.HeaderDesktop.height,
|
|
23
|
+
// @ts-ignore: O react-native não tem auto, mas o react-native-web aceita
|
|
24
|
+
overflow: 'auto'
|
|
25
|
+
},
|
|
26
|
+
logoText: {
|
|
27
|
+
color: theme.textColor1,
|
|
28
|
+
fontFamily: theme.fontFamily3,
|
|
29
|
+
fontSize: 22,
|
|
30
|
+
marginLeft: 10,
|
|
31
|
+
display: 'flex',
|
|
32
|
+
alignItems: 'center'
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
return styles;
|
|
36
|
+
};
|
|
37
|
+
this.getDesktopStyles = () => {
|
|
38
|
+
const styles = react_native_1.StyleSheet.create({
|
|
39
|
+
container: {
|
|
40
|
+
flexDirection: 'row',
|
|
41
|
+
flex: 1
|
|
42
|
+
},
|
|
43
|
+
content: {
|
|
44
|
+
flex: 1,
|
|
45
|
+
padding: 16,
|
|
46
|
+
height: react_native_1.Dimensions.get('window').height - HeaderDesktop_1.HeaderDesktop.height,
|
|
47
|
+
// @ts-ignore: O react-native não tem auto, mas o react-native-web aceita
|
|
48
|
+
overflow: 'auto'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return styles;
|
|
52
|
+
};
|
|
53
|
+
this.renderMobile = () => {
|
|
54
|
+
const { title, logoMenu, screenTitle, renderUserData, menu, onMenuPress, isCurrentMenuPath, children, rightButton } = this.props;
|
|
55
|
+
const styles = this.getMobileStyles();
|
|
56
|
+
return (React.createElement(MenuMobile_1.MenuMobile, { ref: ref => (this.menu = ref), menu: menu, onMenuPress: onMenuPress, isCurrentMenuPath: isCurrentMenuPath, renderLogo: () => (React.createElement(React.Fragment, null,
|
|
57
|
+
logoMenu(),
|
|
58
|
+
title && React.createElement(react_native_1.Text, { style: styles.logoText }, title))), renderUserData: renderUserData },
|
|
59
|
+
React.createElement(Header_1.Header, { title: screenTitle, leftButton: {
|
|
60
|
+
nativeID: 'menu-hamburguer',
|
|
61
|
+
icon: 'bars',
|
|
62
|
+
onPress: () => this.menu.open()
|
|
63
|
+
}, rightButton: rightButton }),
|
|
64
|
+
React.createElement(react_native_1.View, { style: styles.container }, children)));
|
|
65
|
+
};
|
|
66
|
+
this.renderDesktop = () => {
|
|
67
|
+
const { title, logoHeader, greeting, menu, onMenuPress, isCurrentMenuPath, children, rightButton, renderUserData, headerStyle } = this.props;
|
|
68
|
+
const styles = this.getDesktopStyles();
|
|
69
|
+
return (React.createElement(React.Fragment, null,
|
|
70
|
+
React.createElement(HeaderDesktop_1.HeaderDesktop, { title: title, logo: logoHeader, greeting: greeting, rightButton: rightButton, headerStyle: headerStyle }),
|
|
71
|
+
React.createElement(react_native_1.View, { style: styles.container },
|
|
72
|
+
React.createElement(MenuDesktop_1.MenuDesktop, { menu: menu, headerHeight: HeaderDesktop_1.HeaderDesktop.height, onMenuPress: onMenuPress, isCurrentMenuPath: isCurrentMenuPath, renderUserData: renderUserData }),
|
|
73
|
+
React.createElement(react_native_1.View, { nativeID: "app-shell-desktop-content", style: styles.content }, children))));
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
render() {
|
|
77
|
+
return (React.createElement(DimensionsMonitor_1.DimensionsMonitor, null, ({ isDesktop }) => isDesktop || this.props.alwaysDesktop
|
|
78
|
+
? this.renderDesktop()
|
|
79
|
+
: this.renderMobile()));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.AppShell = AppShell;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
export interface ButtonProperties {
|
|
4
|
+
text: string;
|
|
5
|
+
primary?: boolean;
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
textStyle?: StyleProp<TextStyle>;
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
disabledBackgroundColor?: string;
|
|
11
|
+
disabledLabelColor?: string;
|
|
12
|
+
nativeID?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class Button extends React.Component<ButtonProperties> {
|
|
15
|
+
static defaultProps: {
|
|
16
|
+
primary: boolean;
|
|
17
|
+
};
|
|
18
|
+
getStyles: () => {
|
|
19
|
+
touchable: {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
borderColor: string;
|
|
22
|
+
borderWidth: number;
|
|
23
|
+
borderRadius: number;
|
|
24
|
+
height: number;
|
|
25
|
+
alignItems: "center";
|
|
26
|
+
justifyContent: "center";
|
|
27
|
+
};
|
|
28
|
+
touchablePrimary: {
|
|
29
|
+
backgroundColor: string;
|
|
30
|
+
borderWidth: number;
|
|
31
|
+
};
|
|
32
|
+
text: {
|
|
33
|
+
fontFamily: string;
|
|
34
|
+
fontSize: number;
|
|
35
|
+
paddingHorizontal: number;
|
|
36
|
+
color: string;
|
|
37
|
+
};
|
|
38
|
+
textPrimary: {
|
|
39
|
+
color: string;
|
|
40
|
+
};
|
|
41
|
+
disabled: {
|
|
42
|
+
backgroundColor: string;
|
|
43
|
+
};
|
|
44
|
+
textDisabled: {
|
|
45
|
+
color: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
render(): JSX.Element;
|
|
49
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Button = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const theme_1 = require("../modules/theme");
|
|
6
|
+
const test_1 = require("../modules/test");
|
|
7
|
+
const react_native_1 = require("react-native");
|
|
8
|
+
const layout_1 = require("../modules/layout");
|
|
9
|
+
class Button extends React.Component {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.getStyles = () => {
|
|
13
|
+
const { disabledBackgroundColor, disabledLabelColor } = this.props;
|
|
14
|
+
const theme = (0, theme_1.getTheme)();
|
|
15
|
+
const styles = react_native_1.StyleSheet.create({
|
|
16
|
+
touchable: {
|
|
17
|
+
backgroundColor: theme.backgroundColor1,
|
|
18
|
+
borderColor: theme.borderColor1,
|
|
19
|
+
borderWidth: 1,
|
|
20
|
+
borderRadius: 3,
|
|
21
|
+
height: (0, layout_1.isTablet)() ? 45 : 40,
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
justifyContent: 'center'
|
|
24
|
+
},
|
|
25
|
+
touchablePrimary: {
|
|
26
|
+
backgroundColor: theme.backgroundColor3,
|
|
27
|
+
borderWidth: 0
|
|
28
|
+
},
|
|
29
|
+
text: {
|
|
30
|
+
fontFamily: theme.fontFamily1,
|
|
31
|
+
fontSize: (0, layout_1.isTablet)() ? 18 : 13,
|
|
32
|
+
paddingHorizontal: 11,
|
|
33
|
+
color: theme.textColor1
|
|
34
|
+
},
|
|
35
|
+
textPrimary: {
|
|
36
|
+
color: theme.textColor4
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
backgroundColor: disabledBackgroundColor != null
|
|
40
|
+
? disabledBackgroundColor
|
|
41
|
+
: theme.backgroundColor2
|
|
42
|
+
},
|
|
43
|
+
textDisabled: {
|
|
44
|
+
color: disabledLabelColor != null ? disabledLabelColor : 'silver'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return styles;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const { text, primary, style, textStyle, onPress, disabled, nativeID } = this.props;
|
|
52
|
+
const styles = this.getStyles();
|
|
53
|
+
return (React.createElement(react_native_1.TouchableOpacity, { activeOpacity: 0.7, style: [
|
|
54
|
+
styles.touchable,
|
|
55
|
+
primary && styles.touchablePrimary,
|
|
56
|
+
style,
|
|
57
|
+
disabled && styles.disabled
|
|
58
|
+
], onPress: onPress, disabled: disabled, testID: (0, test_1.getTestID)(nativeID) },
|
|
59
|
+
React.createElement(react_native_1.Text, { nativeID: nativeID, style: [
|
|
60
|
+
styles.text,
|
|
61
|
+
primary && styles.textPrimary,
|
|
62
|
+
textStyle,
|
|
63
|
+
disabled && styles.textDisabled
|
|
64
|
+
] }, text)));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.Button = Button;
|
|
68
|
+
Button.defaultProps = {
|
|
69
|
+
primary: true
|
|
70
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewProps, ViewStyle } from 'react-native';
|
|
3
|
+
export interface CardHeaderProperties {
|
|
4
|
+
title: string;
|
|
5
|
+
titleStyle?: StyleProp<TextStyle>;
|
|
6
|
+
containerStyle?: StyleProp<TextStyle>;
|
|
7
|
+
nativeID?: string;
|
|
8
|
+
numberOfLines?: number;
|
|
9
|
+
onHelpPress?: () => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare class CardHeader extends React.Component<CardHeaderProperties> {
|
|
13
|
+
getStyles: () => {
|
|
14
|
+
container: {
|
|
15
|
+
padding: number;
|
|
16
|
+
};
|
|
17
|
+
title: {
|
|
18
|
+
color: string;
|
|
19
|
+
fontFamily: string;
|
|
20
|
+
fontSize: number;
|
|
21
|
+
marginRight: number;
|
|
22
|
+
};
|
|
23
|
+
help: {
|
|
24
|
+
position: "absolute";
|
|
25
|
+
right: number;
|
|
26
|
+
top: number;
|
|
27
|
+
};
|
|
28
|
+
helpIcon: {
|
|
29
|
+
fontSize: number;
|
|
30
|
+
color: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
render(): JSX.Element;
|
|
34
|
+
}
|
|
35
|
+
export declare class CardFooter extends React.Component<ViewProps> {
|
|
36
|
+
render(): JSX.Element;
|
|
37
|
+
}
|
|
38
|
+
export declare class CardSection extends React.Component<ViewProps> {
|
|
39
|
+
render(): JSX.Element;
|
|
40
|
+
}
|
|
41
|
+
export declare class CardModal extends React.Component<ViewProps> {
|
|
42
|
+
render(): JSX.Element;
|
|
43
|
+
}
|
|
44
|
+
export interface CardProperties extends ViewProps {
|
|
45
|
+
children: React.ReactNode;
|
|
46
|
+
style?: StyleProp<ViewStyle>;
|
|
47
|
+
}
|
|
48
|
+
export declare class Card extends React.Component<CardProperties> {
|
|
49
|
+
static Header: typeof CardHeader;
|
|
50
|
+
static Section: typeof CardSection;
|
|
51
|
+
static Footer: typeof CardFooter;
|
|
52
|
+
static Modal: typeof CardModal;
|
|
53
|
+
getStyles: () => {
|
|
54
|
+
container: {
|
|
55
|
+
borderRadius: number;
|
|
56
|
+
backgroundColor: string;
|
|
57
|
+
shadowOpacity: number;
|
|
58
|
+
shadowRadius: number;
|
|
59
|
+
};
|
|
60
|
+
cardChild: {
|
|
61
|
+
borderTopColor: string;
|
|
62
|
+
borderTopWidth: number;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
render(): JSX.Element;
|
|
66
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
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
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.Card = exports.CardModal = exports.CardSection = exports.CardFooter = exports.CardHeader = void 0;
|
|
15
|
+
const React = require("react");
|
|
16
|
+
const react_native_elevated_view_1 = require("react-native-elevated-view");
|
|
17
|
+
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
18
|
+
const theme_1 = require("../modules/theme");
|
|
19
|
+
const layout_1 = require("../modules/layout");
|
|
20
|
+
const test_1 = require("../modules/test");
|
|
21
|
+
const react_native_1 = require("react-native");
|
|
22
|
+
class CardHeader extends React.Component {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.getStyles = () => {
|
|
26
|
+
const theme = (0, theme_1.getTheme)();
|
|
27
|
+
const styles = react_native_1.StyleSheet.create({
|
|
28
|
+
container: {
|
|
29
|
+
padding: 16
|
|
30
|
+
},
|
|
31
|
+
title: {
|
|
32
|
+
color: theme.textColor1,
|
|
33
|
+
fontFamily: theme.fontFamily1,
|
|
34
|
+
fontSize: (0, layout_1.isTablet)() ? 22 : 18,
|
|
35
|
+
marginRight: 10
|
|
36
|
+
},
|
|
37
|
+
help: {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
right: 5,
|
|
40
|
+
top: 5
|
|
41
|
+
},
|
|
42
|
+
helpIcon: {
|
|
43
|
+
fontSize: (0, layout_1.isTablet)() ? 24 : 20,
|
|
44
|
+
color: '#6d819c'
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
return styles;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
render() {
|
|
51
|
+
const { title, titleStyle, onHelpPress, nativeID, containerStyle, numberOfLines } = this.props;
|
|
52
|
+
const styles = this.getStyles();
|
|
53
|
+
return (React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, containerStyle] },
|
|
54
|
+
React.createElement(react_native_1.Text, { testID: (0, test_1.getTestID)(nativeID), style: [styles.title, titleStyle], numberOfLines: numberOfLines }, title),
|
|
55
|
+
onHelpPress && (React.createElement(react_native_1.TouchableOpacity, { onPress: onHelpPress, style: styles.help },
|
|
56
|
+
React.createElement(FontAwesome_1.default, { name: "question-circle", style: styles.helpIcon })))));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.CardHeader = CardHeader;
|
|
60
|
+
class CardFooter extends React.Component {
|
|
61
|
+
render() {
|
|
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));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.CardFooter = CardFooter;
|
|
67
|
+
class CardSection extends React.Component {
|
|
68
|
+
render() {
|
|
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));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.CardSection = CardSection;
|
|
74
|
+
class CardModal extends React.Component {
|
|
75
|
+
render() {
|
|
76
|
+
const _a = this.props, { children, style } = _a, otherProps = __rest(_a, ["children", "style"]);
|
|
77
|
+
return (React.createElement(react_native_1.TouchableOpacity, Object.assign({ activeOpacity: 1, style: [{ padding: 16 }, style] }, otherProps), children));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
exports.CardModal = CardModal;
|
|
81
|
+
class Card extends React.Component {
|
|
82
|
+
constructor() {
|
|
83
|
+
super(...arguments);
|
|
84
|
+
this.getStyles = () => {
|
|
85
|
+
const theme = (0, theme_1.getTheme)();
|
|
86
|
+
const styles = react_native_1.StyleSheet.create({
|
|
87
|
+
container: {
|
|
88
|
+
borderRadius: 3,
|
|
89
|
+
backgroundColor: theme.backgroundColor1,
|
|
90
|
+
shadowOpacity: 0.15,
|
|
91
|
+
shadowRadius: 5
|
|
92
|
+
},
|
|
93
|
+
cardChild: {
|
|
94
|
+
borderTopColor: theme.borderColor1,
|
|
95
|
+
borderTopWidth: 1
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return styles;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
render() {
|
|
102
|
+
const _a = this.props, { children, style } = _a, otherProps = __rest(_a, ["children", "style"]);
|
|
103
|
+
const styles = this.getStyles();
|
|
104
|
+
const childrenMapped = React.Children.map(children, (child, index) => {
|
|
105
|
+
if (index === 0 || !child) {
|
|
106
|
+
return child;
|
|
107
|
+
}
|
|
108
|
+
return (React.createElement(React.Fragment, null,
|
|
109
|
+
React.createElement(react_native_1.View, { style: styles.cardChild }),
|
|
110
|
+
child));
|
|
111
|
+
});
|
|
112
|
+
return react_native_1.Platform.OS == 'web' ? (React.createElement(react_native_1.View, Object.assign({ style: [styles.container, style] }, otherProps), childrenMapped)) : (React.createElement(react_native_elevated_view_1.default, Object.assign({ elevation: 5,
|
|
113
|
+
// @ts-ignore : The component uses a different version of typing
|
|
114
|
+
style: [styles.container, style] }, otherProps), childrenMapped));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
exports.Card = Card;
|
|
118
|
+
Card.Header = CardHeader;
|
|
119
|
+
Card.Section = CardSection;
|
|
120
|
+
Card.Footer = CardFooter;
|
|
121
|
+
Card.Modal = CardModal;
|
|
122
|
+
const cardSectionStyles = react_native_1.StyleSheet.create({
|
|
123
|
+
container: {
|
|
124
|
+
padding: 16
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
const cardFooterStyles = react_native_1.StyleSheet.create({
|
|
128
|
+
container: {
|
|
129
|
+
padding: 16
|
|
130
|
+
}
|
|
131
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleProp, TextStyle, ViewStyle } from 'react-native';
|
|
3
|
+
interface Props {
|
|
4
|
+
label?: string;
|
|
5
|
+
value: boolean;
|
|
6
|
+
onChange?: (value: boolean) => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
style?: StyleProp<ViewStyle>;
|
|
9
|
+
renderLabel?: () => React.ReactNode;
|
|
10
|
+
labelStyle?: StyleProp<TextStyle>;
|
|
11
|
+
iconStyle?: StyleProp<TextStyle>;
|
|
12
|
+
nativeID?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class CheckBox extends React.Component<Props> {
|
|
15
|
+
getStyles: () => {
|
|
16
|
+
container: {
|
|
17
|
+
flexDirection: "row";
|
|
18
|
+
alignItems: "center";
|
|
19
|
+
};
|
|
20
|
+
icon: {
|
|
21
|
+
color: string;
|
|
22
|
+
width: number;
|
|
23
|
+
fontSize: number;
|
|
24
|
+
height: number;
|
|
25
|
+
lineHeight: number;
|
|
26
|
+
};
|
|
27
|
+
label: {
|
|
28
|
+
color: string;
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
fontSize: number;
|
|
31
|
+
flexShrink: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
render(): JSX.Element;
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckBox = void 0;
|
|
4
|
+
const React = require("react");
|
|
5
|
+
const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
|
|
6
|
+
const layout_1 = require("../modules/layout");
|
|
7
|
+
const theme_1 = require("../modules/theme");
|
|
8
|
+
const test_1 = require("../modules/test");
|
|
9
|
+
const react_native_1 = require("react-native");
|
|
10
|
+
class CheckBox extends React.Component {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.getStyles = () => {
|
|
14
|
+
const theme = (0, theme_1.getTheme)();
|
|
15
|
+
const { disabled } = this.props;
|
|
16
|
+
const iconSize = (0, layout_1.isTablet)() ? 24 : 20;
|
|
17
|
+
return react_native_1.StyleSheet.create({
|
|
18
|
+
container: {
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
alignItems: 'center'
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
color: disabled ? theme.disabledColor : theme.textColor1,
|
|
24
|
+
width: (0, layout_1.isTablet)() ? 28 : 24,
|
|
25
|
+
fontSize: iconSize,
|
|
26
|
+
height: iconSize,
|
|
27
|
+
lineHeight: iconSize
|
|
28
|
+
},
|
|
29
|
+
label: {
|
|
30
|
+
color: disabled ? theme.disabledColor : theme.textColor1,
|
|
31
|
+
fontFamily: theme.fontFamily3,
|
|
32
|
+
fontSize: (0, layout_1.isTablet)() ? 15 : 12,
|
|
33
|
+
flexShrink: 1
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const { label, value, onChange, disabled, style, labelStyle, iconStyle, renderLabel, nativeID } = this.props;
|
|
40
|
+
const styles = this.getStyles();
|
|
41
|
+
return (React.createElement(react_native_1.TouchableOpacity, { style: [styles.container, style], disabled: disabled, onPress: () => {
|
|
42
|
+
if (onChange) {
|
|
43
|
+
onChange(!value);
|
|
44
|
+
}
|
|
45
|
+
} },
|
|
46
|
+
React.createElement(FontAwesome_1.default, { nativeID: nativeID, testID: (0, test_1.getTestID)(nativeID), name: value ? 'check-square-o' : 'square-o', style: [styles.icon, iconStyle] }),
|
|
47
|
+
React.createElement(react_native_1.Text, { style: [styles.label, labelStyle] }, renderLabel ? renderLabel() : label)));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.CheckBox = CheckBox;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export interface DatePickerProperties {
|
|
4
|
+
label: string;
|
|
5
|
+
value?: Date;
|
|
6
|
+
clearable?: boolean;
|
|
7
|
+
onChange: (value?: Date) => void;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
style?: StyleProp<ViewStyle>;
|
|
10
|
+
nativeID?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DatePickerState {
|
|
14
|
+
showModal: boolean;
|
|
15
|
+
isDarkModeEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
export declare class DatePicker extends React.Component<DatePickerProperties, DatePickerState> {
|
|
18
|
+
static defaultProps: {
|
|
19
|
+
clearable: boolean;
|
|
20
|
+
};
|
|
21
|
+
state: DatePickerState;
|
|
22
|
+
appearanceSubscription: any;
|
|
23
|
+
componentDidMount(): void;
|
|
24
|
+
componentWillUnmount(): void;
|
|
25
|
+
handlePress: () => void;
|
|
26
|
+
handleConfirm: (value: Date) => void;
|
|
27
|
+
handleCancel: () => void;
|
|
28
|
+
handleClear: () => void;
|
|
29
|
+
getStyles: () => {
|
|
30
|
+
container: {
|
|
31
|
+
paddingLeft: number;
|
|
32
|
+
paddingRight: number;
|
|
33
|
+
paddingVertical: number;
|
|
34
|
+
borderWidth: number;
|
|
35
|
+
borderColor: string;
|
|
36
|
+
borderRadius: number;
|
|
37
|
+
flexDirection: "row";
|
|
38
|
+
alignItems: "center";
|
|
39
|
+
};
|
|
40
|
+
label: {
|
|
41
|
+
color: string;
|
|
42
|
+
fontFamily: string;
|
|
43
|
+
fontSize: number;
|
|
44
|
+
lineHeight: number;
|
|
45
|
+
};
|
|
46
|
+
value: {
|
|
47
|
+
color: string;
|
|
48
|
+
fontFamily: string;
|
|
49
|
+
fontSize: number;
|
|
50
|
+
lineHeight: number;
|
|
51
|
+
minHeight: number;
|
|
52
|
+
};
|
|
53
|
+
calendarIcon: {
|
|
54
|
+
marginLeft: string;
|
|
55
|
+
color: string;
|
|
56
|
+
fontSize: number;
|
|
57
|
+
};
|
|
58
|
+
clearIcon: {
|
|
59
|
+
borderWidth: number;
|
|
60
|
+
marginLeft: string;
|
|
61
|
+
};
|
|
62
|
+
readonly: {
|
|
63
|
+
backgroundColor: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
render(): JSX.Element;
|
|
67
|
+
}
|