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,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_web_modal_1 = require("react-native-web-modal");
5
- const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
6
- const theme_1 = require("../modules/theme");
7
- const layout_1 = require("../modules/layout");
8
- const Button_1 = require("./Button");
9
- const Space_1 = require("./Space");
10
- const react_native_1 = require("react-native");
11
- class Question extends React.Component {
12
- constructor() {
13
- super(...arguments);
14
- this.getStyles = () => {
15
- const theme = theme_1.getTheme();
16
- const styles = react_native_1.StyleSheet.create({
17
- botoesAcao: {
18
- flexDirection: 'row',
19
- alignItems: 'center',
20
- justifyContent: 'space-evenly',
21
- width: '100%'
22
- },
23
- overlay: {
24
- flex: 1,
25
- backgroundColor: 'rgba(33, 33, 33, 0.7)',
26
- alignItems: 'center'
27
- },
28
- text: {
29
- color: theme.questionTextColor,
30
- fontFamily: theme.fontFamily1,
31
- fontSize: layout_1.isTablet() ? 25 : 16,
32
- textAlign: 'center',
33
- marginTop: layout_1.isTablet() ? 15 : 5,
34
- width: '100%'
35
- },
36
- container: {
37
- backgroundColor: theme.backgroundColor1,
38
- borderRadius: 6,
39
- padding: layout_1.isTablet() ? 25 : 16,
40
- width: layout_1.isTablet() ? 350 : 250,
41
- marginTop: layout_1.isTablet() ? 250 : 140,
42
- alignItems: 'center'
43
- },
44
- icon: {
45
- color: theme.textColor3,
46
- fontSize: layout_1.isTablet() ? 52 : 42
47
- }
48
- });
49
- return styles;
50
- };
51
- }
52
- render() {
53
- const { message, visible, nativeID, okButton, cancelButton } = this.props;
54
- const styles = this.getStyles();
55
- return (React.createElement(react_native_web_modal_1.default, { animationType: "fade", transparent: true, visible: visible },
56
- React.createElement(react_native_1.View, { style: [styles.overlay], nativeID: nativeID },
57
- React.createElement(react_native_1.View, { style: styles.container },
58
- React.createElement(FontAwesome_1.default, { name: 'question-circle', style: styles.icon }),
59
- React.createElement(react_native_1.Text, { style: styles.text }, message),
60
- React.createElement(Space_1.Space, null),
61
- React.createElement(react_native_1.View, { style: styles.botoesAcao },
62
- React.createElement(Button_1.Button, { text: cancelButton.text, onPress: cancelButton.onPress, style: [
63
- { flex: 1, marginRight: layout_1.isTablet() ? 13 : 8 },
64
- cancelButton.style
65
- ], textStyle: cancelButton.textStyle, primary: false, nativeID: cancelButton.nativeID }),
66
- React.createElement(Button_1.Button, { text: okButton.text, onPress: okButton.onPress, style: [
67
- { flex: 1, marginLeft: layout_1.isTablet() ? 13 : 8 },
68
- okButton.style
69
- ], textStyle: okButton.textStyle, primary: true, nativeID: okButton.nativeID }))))));
70
- }
71
- }
72
- exports.Question = Question;
@@ -1,42 +0,0 @@
1
- import * as React from 'react';
2
- export interface RadioButtonProps {
3
- items: Array<{
4
- label: string;
5
- value: number;
6
- }>;
7
- value: number;
8
- onChange: (value: number) => void;
9
- }
10
- export declare class RadioButton extends React.Component<RadioButtonProps> {
11
- getStyles: () => {
12
- radioContainer: {
13
- flexDirection: "row";
14
- paddingVertical: number;
15
- };
16
- radioButtom: {
17
- height: number;
18
- width: number;
19
- borderRadius: number;
20
- borderWidth: number;
21
- borderColor: string;
22
- alignItems: "center";
23
- justifyContent: "center";
24
- top: number;
25
- };
26
- radioMark: {
27
- height: number;
28
- width: number;
29
- borderRadius: number;
30
- backgroundColor: string;
31
- };
32
- labelRadioButtom: {
33
- flex: number;
34
- fontSize: number;
35
- color: string;
36
- alignSelf: "flex-start";
37
- left: number;
38
- fontFamily: string;
39
- };
40
- };
41
- render(): JSX.Element;
42
- }
@@ -1,53 +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
- class RadioButton 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
- radioContainer: {
13
- flexDirection: 'row',
14
- paddingVertical: 5
15
- },
16
- radioButtom: {
17
- height: 14,
18
- width: 14,
19
- borderRadius: 12,
20
- borderWidth: 1.2,
21
- borderColor: '#cfcfcf',
22
- alignItems: 'center',
23
- justifyContent: 'center',
24
- top: 5
25
- },
26
- radioMark: {
27
- height: 8,
28
- width: 8,
29
- borderRadius: 6,
30
- backgroundColor: theme.textColor2
31
- },
32
- labelRadioButtom: {
33
- flex: 1,
34
- fontSize: 16,
35
- color: theme.textColor1,
36
- alignSelf: 'flex-start',
37
- left: 10,
38
- fontFamily: theme.fontFamily1
39
- }
40
- });
41
- return styles;
42
- };
43
- }
44
- render() {
45
- const { items, value, onChange } = this.props;
46
- const styles = this.getStyles();
47
- return (React.createElement(react_native_1.View, null, items.map(item => (React.createElement(react_native_1.TouchableWithoutFeedback, { key: item.value, onPress: () => onChange(item.value) },
48
- React.createElement(react_native_1.View, { style: styles.radioContainer },
49
- React.createElement(react_native_1.View, { style: styles.radioButtom }, item.value === value && React.createElement(react_native_1.View, { style: styles.radioMark })),
50
- React.createElement(react_native_1.Text, { style: styles.labelRadioButtom }, item.label)))))));
51
- }
52
- }
53
- exports.RadioButton = RadioButton;
@@ -1,44 +0,0 @@
1
- import * as React from 'react';
2
- export interface RadioGroupProperties {
3
- items: Array<{
4
- label: string;
5
- value: string;
6
- }>;
7
- value: string;
8
- onChange: (value: string) => void;
9
- disabled?: Array<string>;
10
- }
11
- export declare class RadioGroup extends React.Component<RadioGroupProperties> {
12
- getStyles: () => {
13
- container: {
14
- borderColor: string;
15
- borderWidth: number;
16
- borderRadius: number;
17
- backgroundColor: string;
18
- flexDirection: "row";
19
- justifyContent: "space-around";
20
- };
21
- item: {
22
- paddingVertical: number;
23
- borderColor: string;
24
- flex: number;
25
- alignItems: "center";
26
- };
27
- itemText: {
28
- fontFamily: string;
29
- fontSize: number;
30
- lineHeight: number;
31
- color: string;
32
- };
33
- selectedItem: {
34
- backgroundColor: string;
35
- };
36
- selectedItemText: {
37
- color: string;
38
- };
39
- readonly: {
40
- backgroundColor: string;
41
- };
42
- };
43
- render(): JSX.Element;
44
- }
@@ -1,64 +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 layout_1 = require("../modules/layout");
7
- class RadioGroup 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
- borderColor: theme.borderColor1,
15
- borderWidth: 1,
16
- borderRadius: 3,
17
- backgroundColor: theme.backgroundColor2,
18
- flexDirection: 'row',
19
- justifyContent: 'space-around'
20
- },
21
- item: {
22
- paddingVertical: layout_1.isTablet() ? 10 : 5,
23
- borderColor: theme.borderColor1,
24
- flex: 1,
25
- alignItems: 'center'
26
- },
27
- itemText: {
28
- fontFamily: theme.fontFamily1,
29
- fontSize: layout_1.isTablet() ? 16 : 12,
30
- lineHeight: layout_1.isTablet() ? 20 : 16,
31
- color: theme.textColor3
32
- },
33
- selectedItem: {
34
- backgroundColor: theme.backgroundColor3
35
- },
36
- selectedItemText: {
37
- color: theme.textColor4
38
- },
39
- readonly: {
40
- backgroundColor: theme.disabledColor
41
- }
42
- });
43
- return styles;
44
- };
45
- }
46
- render() {
47
- const { items, value, onChange, disabled } = this.props;
48
- const styles = this.getStyles();
49
- return (React.createElement(react_native_1.View, { style: styles.container }, items.map((item, index) => (React.createElement(react_native_1.TouchableWithoutFeedback, { key: index, disabled: disabled && disabled.includes(item.value), onPress: () => onChange(item.value) },
50
- React.createElement(react_native_1.View, { style: [
51
- styles.item,
52
- { borderRightWidth: index === items.length - 1 ? 0 : 1 },
53
- item.value === value ? styles.selectedItem : null,
54
- disabled && disabled.includes(item.value)
55
- ? styles.readonly
56
- : null
57
- ] },
58
- React.createElement(react_native_1.Text, { style: [
59
- styles.itemText,
60
- item.value === value ? styles.selectedItemText : null
61
- ] }, item.label)))))));
62
- }
63
- }
64
- exports.RadioGroup = RadioGroup;
@@ -1,57 +0,0 @@
1
- import * as React from 'react';
2
- import { StyleProp, ViewStyle } from 'react-native';
3
- export interface RangeDatePickerProperties {
4
- label: string;
5
- startDate: Date;
6
- endDate: Date;
7
- onStartDateChange: (date: Date) => void;
8
- onEndDateChange: (date: Date) => void;
9
- onEndDateCancel?: () => void;
10
- style?: StyleProp<ViewStyle>;
11
- nativeID?: string;
12
- }
13
- export interface RangeDatePickerState {
14
- showStartDateModal: boolean;
15
- showEndDateModal: boolean;
16
- isDarkModeEnabled: boolean;
17
- }
18
- export declare class RangeDatePicker extends React.Component<RangeDatePickerProperties, RangeDatePickerState> {
19
- state: RangeDatePickerState;
20
- appearanceSubscription: any;
21
- componentDidMount(): void;
22
- UNSAFE_componentWillUnmount(): void;
23
- handleDatePickerPress: () => void;
24
- handleStartDateConfirm: (date: Date) => void;
25
- handleStartDateCancel: () => void;
26
- handleEndDateConfirm: (date: Date) => void;
27
- handleEndDateCancel: () => void;
28
- getStyles: () => {
29
- container: {
30
- paddingHorizontal: number;
31
- paddingVertical: number;
32
- borderWidth: number;
33
- borderColor: string;
34
- borderRadius: number;
35
- flexDirection: "row";
36
- alignItems: "center";
37
- };
38
- label: {
39
- color: string;
40
- fontFamily: string;
41
- fontSize: number;
42
- lineHeight: number;
43
- };
44
- value: {
45
- color: string;
46
- fontFamily: string;
47
- fontSize: number;
48
- lineHeight: number;
49
- };
50
- icon: {
51
- marginLeft: string;
52
- color: string;
53
- fontSize: number;
54
- };
55
- };
56
- render(): JSX.Element;
57
- }
@@ -1,126 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const React = require("react");
4
- const react_native_appearance_1 = require("react-native-appearance");
5
- const react_native_modal_datetime_picker_1 = require("react-native-modal-datetime-picker");
6
- const FontAwesome_1 = require("react-native-vector-icons/FontAwesome");
7
- const format_1 = require("../modules/format");
8
- const layout_1 = require("../modules/layout");
9
- const theme_1 = require("../modules/theme");
10
- const Delay_1 = require("./Delay");
11
- const react_native_1 = require("react-native");
12
- class RangeDatePicker extends React.Component {
13
- constructor() {
14
- super(...arguments);
15
- this.state = {
16
- showStartDateModal: false,
17
- showEndDateModal: false,
18
- isDarkModeEnabled: react_native_appearance_1.Appearance.getColorScheme() === 'dark'
19
- };
20
- this.handleDatePickerPress = () => {
21
- this.setState({
22
- showStartDateModal: true
23
- });
24
- };
25
- this.handleStartDateConfirm = (date) => {
26
- this.setState({
27
- showStartDateModal: false,
28
- showEndDateModal: true
29
- }, () => {
30
- // When using RangeDatePicker on Android devices the end date modal were not being displayed, in order to avoid it,
31
- // the setTimeOut was implemented so as it will set a little delay (enough time to update the state) before execute other functions.
32
- // Related issue on gitlab: 3487
33
- setTimeout(() => {
34
- if (date > this.props.endDate) {
35
- this.props.onEndDateChange(date);
36
- }
37
- this.props.onStartDateChange(date);
38
- }, 1);
39
- });
40
- };
41
- this.handleStartDateCancel = () => {
42
- this.setState({
43
- showStartDateModal: false,
44
- showEndDateModal: true
45
- });
46
- };
47
- this.handleEndDateConfirm = (date) => {
48
- this.setState({
49
- showEndDateModal: false
50
- }, () => {
51
- this.props.onEndDateChange(date);
52
- });
53
- };
54
- this.handleEndDateCancel = () => {
55
- if (this.props.onEndDateCancel) {
56
- this.props.onEndDateCancel();
57
- }
58
- this.setState({
59
- showEndDateModal: false
60
- });
61
- };
62
- this.getStyles = () => {
63
- const theme = theme_1.getTheme();
64
- const styles = react_native_1.StyleSheet.create({
65
- container: {
66
- paddingHorizontal: 16,
67
- paddingVertical: 8,
68
- borderWidth: 1,
69
- borderColor: theme.borderColor1,
70
- borderRadius: 3,
71
- flexDirection: 'row',
72
- alignItems: 'center'
73
- },
74
- label: {
75
- color: theme.textColor2,
76
- fontFamily: theme.fontFamily3,
77
- fontSize: layout_1.isTablet() ? 15 : 12,
78
- lineHeight: 16
79
- },
80
- value: {
81
- color: theme.textColor1,
82
- fontFamily: theme.fontFamily1,
83
- fontSize: 16,
84
- lineHeight: 22
85
- },
86
- icon: {
87
- marginLeft: 'auto',
88
- color: theme.textColor2,
89
- fontSize: 22
90
- }
91
- });
92
- return styles;
93
- };
94
- }
95
- componentDidMount() {
96
- this.appearanceSubscription = react_native_appearance_1.Appearance.addChangeListener(({ colorScheme }) => {
97
- this.setState({ isDarkModeEnabled: colorScheme === 'dark' });
98
- });
99
- }
100
- UNSAFE_componentWillUnmount() {
101
- this.appearanceSubscription.remove();
102
- }
103
- render() {
104
- const { label, startDate, endDate, style, nativeID } = this.props;
105
- const { showStartDateModal, showEndDateModal, isDarkModeEnabled } = this.state;
106
- const displayFormat = 'MMM D, YYYY';
107
- const displayText = format_1.formatDate(startDate, displayFormat) +
108
- ' - ' +
109
- format_1.formatDate(endDate, displayFormat);
110
- const styles = this.getStyles();
111
- return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: this.handleDatePickerPress },
112
- React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, style] },
113
- React.createElement(react_native_1.View, null,
114
- React.createElement(react_native_1.Text, { style: styles.label }, label),
115
- React.createElement(react_native_1.Text, { style: styles.value }, displayText)),
116
- React.createElement(FontAwesome_1.default, { name: "calendar", style: styles.icon }),
117
- react_native_1.Platform.OS !== 'web' &&
118
- (showStartDateModal ? (React.createElement(react_native_modal_datetime_picker_1.default, { date: startDate, isVisible: true, onConfirm: this.handleStartDateConfirm, onCancel: this.handleStartDateCancel, isDarkModeEnabled: isDarkModeEnabled,
119
- //@ts-ignore
120
- display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' })) : showEndDateModal ? (React.createElement(Delay_1.Delay, { wait: 5 },
121
- React.createElement(react_native_modal_datetime_picker_1.default, { date: endDate, isVisible: true, onConfirm: this.handleEndDateConfirm, onCancel: this.handleEndDateCancel, isDarkModeEnabled: isDarkModeEnabled,
122
- //@ts-ignore
123
- display: react_native_1.Platform.OS == 'ios' ? 'inline' : 'default' }))) : null))));
124
- }
125
- }
126
- exports.RangeDatePicker = RangeDatePicker;
@@ -1,61 +0,0 @@
1
- import * as React from 'react';
2
- import { SelectedRanges } from 'react-date-range';
3
- import 'react-date-range/dist/styles.css';
4
- import { StyleProp, ViewStyle } from 'react-native';
5
- import '../../styles/RangeDatePicker.css';
6
- export interface RangeDatePickerProperties {
7
- label: string;
8
- startDate: Date;
9
- endDate: Date;
10
- onStartDateChange: (date: Date) => void;
11
- onEndDateChange: (date: Date) => void;
12
- onEndDateCancel?: () => void;
13
- style?: StyleProp<ViewStyle>;
14
- nativeID?: string;
15
- }
16
- export interface RangeDatePickerState {
17
- showStartDateModal: boolean;
18
- count: number;
19
- }
20
- export declare class RangeDatePicker extends React.Component<RangeDatePickerProperties, RangeDatePickerState> {
21
- state: RangeDatePickerState;
22
- private calendarRef;
23
- componentWillMount(): void;
24
- componentWillUnmount(): void;
25
- handleClick: (event: MouseEvent) => void;
26
- handleDatePickerPress: () => void;
27
- handleRangeDateConfirm: (ranges: SelectedRanges) => void;
28
- getStyles: () => {
29
- container: {
30
- paddingHorizontal: number;
31
- paddingVertical: number;
32
- borderWidth: number;
33
- borderColor: string;
34
- borderRadius: number;
35
- flexDirection: "row";
36
- alignItems: "center";
37
- };
38
- modalOverlay: {
39
- justifyContent: "center";
40
- alignItems: "center";
41
- };
42
- label: {
43
- color: string;
44
- fontFamily: string;
45
- fontSize: number;
46
- lineHeight: number;
47
- };
48
- value: {
49
- color: string;
50
- fontFamily: string;
51
- fontSize: number;
52
- lineHeight: number;
53
- };
54
- icon: {
55
- marginLeft: string;
56
- color: string;
57
- fontSize: number;
58
- };
59
- };
60
- render(): JSX.Element;
61
- }
@@ -1,119 +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 format_1 = require("../modules/format");
6
- const theme_1 = require("../modules/theme");
7
- const react_date_range_1 = require("react-date-range");
8
- const Modal_1 = require("./Modal");
9
- const layout_1 = require("../modules/layout");
10
- require("react-date-range/dist/styles.css");
11
- const react_native_1 = require("react-native");
12
- require("../../styles/RangeDatePicker.css");
13
- class RangeDatePicker extends React.Component {
14
- constructor() {
15
- super(...arguments);
16
- this.state = {
17
- showStartDateModal: false,
18
- count: 0
19
- };
20
- this.calendarRef = React.createRef();
21
- this.handleClick = (event) => {
22
- if (this.calendarRef.current &&
23
- !this.calendarRef.current.contains(event.target)) {
24
- this.setState({ showStartDateModal: false, count: 0 });
25
- }
26
- };
27
- this.handleDatePickerPress = () => {
28
- this.setState({
29
- showStartDateModal: true
30
- });
31
- };
32
- this.handleRangeDateConfirm = (ranges) => {
33
- if (this.state.count == 1) {
34
- this.props.onStartDateChange(ranges.selection.startDate);
35
- // Sometimes the parent component is not ready because the setState method
36
- // is async, so we wait a little.
37
- setTimeout(() => this.props.onEndDateChange(ranges.selection.endDate), 1);
38
- this.setState({ showStartDateModal: false, count: 0 });
39
- return;
40
- }
41
- this.props.onStartDateChange(ranges.selection.startDate);
42
- this.setState({ count: 1 });
43
- };
44
- this.getStyles = () => {
45
- const theme = theme_1.getTheme();
46
- const styles = react_native_1.StyleSheet.create({
47
- container: {
48
- paddingHorizontal: 16,
49
- paddingVertical: 8,
50
- borderWidth: 1,
51
- borderColor: theme.borderColor1,
52
- borderRadius: 3,
53
- flexDirection: 'row',
54
- alignItems: 'center'
55
- },
56
- modalOverlay: {
57
- justifyContent: 'center',
58
- alignItems: 'center'
59
- },
60
- label: {
61
- color: theme.textColor2,
62
- fontFamily: theme.fontFamily3,
63
- fontSize: layout_1.isTablet() ? 15 : 12,
64
- lineHeight: 16
65
- },
66
- value: {
67
- color: theme.textColor1,
68
- fontFamily: theme.fontFamily1,
69
- fontSize: 16,
70
- lineHeight: 22
71
- },
72
- icon: {
73
- marginLeft: 'auto',
74
- color: theme.textColor2,
75
- fontSize: 22
76
- }
77
- });
78
- return styles;
79
- };
80
- }
81
- componentWillMount() {
82
- document.addEventListener('mousedown', this.handleClick, false);
83
- }
84
- componentWillUnmount() {
85
- document.removeEventListener('mousedown', this.handleClick, false);
86
- }
87
- render() {
88
- const { label, startDate, endDate, style, nativeID } = this.props;
89
- const { showStartDateModal } = this.state;
90
- const displayFormat = 'MMM D, YYYY';
91
- const displayText = format_1.formatDate(startDate, displayFormat) +
92
- ' - ' +
93
- format_1.formatDate(endDate, displayFormat);
94
- const theme = theme_1.getTheme();
95
- const styles = this.getStyles();
96
- return (React.createElement(react_native_1.TouchableWithoutFeedback, { onPress: this.handleDatePickerPress },
97
- React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, style] },
98
- React.createElement(react_native_1.View, { ref: ref => ref && ref.setNativeProps({ id: 'range-date-picker' }) },
99
- React.createElement(react_native_1.Text, { style: styles.label }, label),
100
- React.createElement(react_native_1.Text, { style: styles.value }, displayText)),
101
- React.createElement(FontAwesome_1.default, { name: "calendar", style: styles.icon }),
102
- React.createElement(Modal_1.Modal, { visible: showStartDateModal, overlayStyle: styles.modalOverlay },
103
- React.createElement("div", { ref: this.calendarRef, style: {
104
- borderRadius: '5px',
105
- position: 'absolute',
106
- top: '50%',
107
- marginTop: '-150px',
108
- fontFamily: theme.fontFamily1
109
- } },
110
- React.createElement(react_date_range_1.DateRange, { locale: format_1.getDateFnsLocale(), showDateDisplay: false, ranges: [
111
- {
112
- startDate: startDate,
113
- endDate: endDate,
114
- key: 'selection'
115
- }
116
- ], rangeColors: [theme.backgroundColor3], onChange: this.handleRangeDateConfirm }))))));
117
- }
118
- }
119
- exports.RangeDatePicker = RangeDatePicker;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- export interface SpaceProperties {
3
- height?: number;
4
- width?: number;
5
- }
6
- export declare class Space extends React.Component<SpaceProperties> {
7
- static defaultProps: {
8
- height: number;
9
- };
10
- render(): JSX.Element;
11
- }
@@ -1,14 +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 Space extends React.Component {
6
- render() {
7
- const { height, width } = this.props;
8
- return React.createElement(react_native_1.View, { style: { height, width } });
9
- }
10
- }
11
- Space.defaultProps = {
12
- height: 16
13
- };
14
- exports.Space = Space;
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- export declare class StatusBar extends React.Component {
3
- static height: number;
4
- getStyles: () => {
5
- statusBar: {
6
- backgroundColor: string;
7
- height: number;
8
- };
9
- };
10
- render(): JSX.Element;
11
- }