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

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/lib/components/AppShell.d.ts +24 -0
  2. package/lib/components/AppShell.js +79 -0
  3. package/lib/components/Button.d.ts +47 -0
  4. package/lib/components/Button.js +65 -0
  5. package/lib/components/Card.d.ts +65 -0
  6. package/lib/components/Card.js +125 -0
  7. package/lib/components/CheckBox.d.ts +34 -0
  8. package/lib/components/CheckBox.js +46 -0
  9. package/lib/components/DatePicker.d.ts +67 -0
  10. package/lib/components/DatePicker.js +105 -0
  11. package/lib/components/DatePicker.web.d.ts +64 -0
  12. package/lib/components/DatePicker.web.js +105 -0
  13. package/lib/components/Delay.d.ts +12 -0
  14. package/lib/components/Delay.js +21 -0
  15. package/lib/components/Details.d.ts +66 -0
  16. package/lib/components/Details.js +94 -0
  17. package/lib/components/DetailsHeader.d.ts +37 -0
  18. package/lib/components/DetailsHeader.js +63 -0
  19. package/lib/components/DimensionsMonitor.d.ts +21 -0
  20. package/lib/components/DimensionsMonitor.js +35 -0
  21. package/lib/components/DropDown.d.ts +35 -0
  22. package/lib/components/DropDown.js +263 -0
  23. package/lib/components/ErrorMessage.d.ts +16 -0
  24. package/lib/components/ErrorMessage.js +29 -0
  25. package/lib/components/FilePicker.d.ts +28 -0
  26. package/lib/components/FilePicker.js +44 -0
  27. package/lib/components/Header.d.ts +56 -0
  28. package/lib/components/Header.js +89 -0
  29. package/lib/components/HeaderDesktop.d.ts +59 -0
  30. package/lib/components/HeaderDesktop.js +80 -0
  31. package/lib/components/ImageButton.d.ts +14 -0
  32. package/lib/components/ImageButton.js +32 -0
  33. package/lib/components/KeyboardAvoidingView.d.ts +34 -0
  34. package/lib/components/KeyboardAvoidingView.js +92 -0
  35. package/lib/components/Link.d.ts +17 -0
  36. package/lib/components/Link.js +28 -0
  37. package/lib/components/Loading.d.ts +4 -0
  38. package/lib/components/Loading.js +37 -0
  39. package/lib/components/Menu.d.ts +42 -0
  40. package/lib/components/Menu.js +112 -0
  41. package/lib/components/MenuDesktop.d.ts +24 -0
  42. package/lib/components/MenuDesktop.js +38 -0
  43. package/lib/components/MenuMobile.d.ts +47 -0
  44. package/lib/components/MenuMobile.js +85 -0
  45. package/lib/components/Message.d.ts +37 -0
  46. package/lib/components/Message.js +50 -0
  47. package/lib/components/Modal.d.ts +11 -0
  48. package/lib/components/Modal.js +20 -0
  49. package/lib/components/MultiSelect.d.ts +51 -0
  50. package/lib/components/MultiSelect.js +376 -0
  51. package/lib/components/NoRecordMessage.d.ts +23 -0
  52. package/lib/components/NoRecordMessage.js +35 -0
  53. package/lib/components/Question.d.ts +57 -0
  54. package/lib/components/Question.js +72 -0
  55. package/lib/components/RadioButton.d.ts +42 -0
  56. package/lib/components/RadioButton.js +53 -0
  57. package/lib/components/RadioGroup.d.ts +44 -0
  58. package/lib/components/RadioGroup.js +64 -0
  59. package/lib/components/RangeDatePicker.d.ts +57 -0
  60. package/lib/components/RangeDatePicker.js +126 -0
  61. package/lib/components/RangeDatePicker.web.d.ts +61 -0
  62. package/lib/components/RangeDatePicker.web.js +119 -0
  63. package/lib/components/Space.d.ts +11 -0
  64. package/lib/components/Space.js +14 -0
  65. package/lib/components/StatusBar.d.ts +11 -0
  66. package/lib/components/StatusBar.js +27 -0
  67. package/lib/components/Switch.d.ts +34 -0
  68. package/lib/components/Switch.js +49 -0
  69. package/lib/components/Table.d.ts +28 -0
  70. package/lib/components/Table.js +62 -0
  71. package/lib/components/Table.web.d.ts +18 -0
  72. package/lib/components/Table.web.js +108 -0
  73. package/lib/components/Text.d.ts +28 -0
  74. package/lib/components/Text.js +36 -0
  75. package/lib/components/TextBox.d.ts +115 -0
  76. package/lib/components/TextBox.js +103 -0
  77. package/lib/components/TextBoxMask.d.ts +12 -0
  78. package/lib/components/TextBoxMask.js +29 -0
  79. package/lib/components/TimePicker.d.ts +63 -0
  80. package/lib/components/TimePicker.js +111 -0
  81. package/lib/components/TimePicker.web.d.ts +48 -0
  82. package/lib/components/TimePicker.web.js +82 -0
  83. package/lib/index.d.ts +39 -0
  84. package/lib/index.js +44 -0
  85. package/lib/modules/browser.d.ts +2 -0
  86. package/lib/modules/browser.js +50 -0
  87. package/lib/modules/format.d.ts +6 -0
  88. package/lib/modules/format.js +99 -0
  89. package/lib/modules/layout.d.ts +1 -0
  90. package/lib/modules/layout.js +10 -0
  91. package/lib/modules/theme.d.ts +41 -0
  92. package/lib/modules/theme.js +49 -0
  93. package/lib/modules/validation.d.ts +3 -0
  94. package/lib/modules/validation.js +12 -0
  95. package/package.json +1 -1
@@ -0,0 +1,63 @@
1
+ import * as React from 'react';
2
+ import { StyleProp, ViewStyle } from 'react-native';
3
+ export interface TimePickerProperties {
4
+ label: string;
5
+ value: string;
6
+ clearable?: boolean;
7
+ disabled?: boolean;
8
+ onChange?: (value: string) => void;
9
+ onCancel?: () => void;
10
+ style?: StyleProp<ViewStyle>;
11
+ nativeID?: string;
12
+ }
13
+ export interface TimePickerState {
14
+ showModal: boolean;
15
+ isDarkModeEnabled: boolean;
16
+ }
17
+ export declare class TimePicker extends React.Component<TimePickerProperties, TimePickerState> {
18
+ static defaultProps: {
19
+ clearable: boolean;
20
+ };
21
+ state: TimePickerState;
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
+ paddingHorizontal: number;
32
+ paddingVertical: number;
33
+ borderWidth: number;
34
+ borderColor: string;
35
+ borderRadius: number;
36
+ flexDirection: "row";
37
+ alignItems: "center";
38
+ };
39
+ label: {
40
+ color: string;
41
+ fontFamily: string;
42
+ fontSize: number;
43
+ lineHeight: number;
44
+ };
45
+ value: {
46
+ color: string;
47
+ fontFamily: string;
48
+ fontSize: number;
49
+ lineHeight: number;
50
+ minHeight: number;
51
+ };
52
+ readonly: {
53
+ backgroundColor: string;
54
+ };
55
+ clearIcon: {
56
+ borderWidth: number;
57
+ marginLeft: string;
58
+ height: string;
59
+ width: string;
60
+ };
61
+ };
62
+ render(): JSX.Element;
63
+ }
@@ -0,0 +1,111 @@
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 ImageButton_1 = require("./ImageButton");
7
+ const format_1 = require("../modules/format");
8
+ const layout_1 = require("../modules/layout");
9
+ const theme_1 = require("../modules/theme");
10
+ const react_native_1 = require("react-native");
11
+ class TimePicker extends React.Component {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.state = {
15
+ showModal: false,
16
+ isDarkModeEnabled: react_native_appearance_1.Appearance.getColorScheme() === 'dark'
17
+ };
18
+ this.handlePress = () => {
19
+ this.setState({ showModal: true });
20
+ };
21
+ this.handleConfirm = (value) => {
22
+ this.setState({ showModal: false }, () => {
23
+ if (this.props.onChange) {
24
+ this.props.onChange(format_1.formatDate(value, 'HH:mm'));
25
+ }
26
+ });
27
+ };
28
+ this.handleCancel = () => {
29
+ this.setState({ showModal: false }, () => {
30
+ if (this.props.onCancel) {
31
+ this.props.onCancel();
32
+ }
33
+ });
34
+ };
35
+ this.handleClear = () => {
36
+ if (this.props.onChange) {
37
+ this.props.onChange('');
38
+ }
39
+ };
40
+ this.getStyles = () => {
41
+ const theme = theme_1.getTheme();
42
+ const styles = react_native_1.StyleSheet.create({
43
+ container: {
44
+ paddingHorizontal: 16,
45
+ paddingVertical: 8,
46
+ borderWidth: 1,
47
+ borderColor: theme.borderColor1,
48
+ borderRadius: 3,
49
+ flexDirection: 'row',
50
+ alignItems: 'center'
51
+ },
52
+ label: {
53
+ color: theme.textColor2,
54
+ fontFamily: theme.fontFamily3,
55
+ fontSize: layout_1.isTablet() ? 15 : 12,
56
+ lineHeight: 16
57
+ },
58
+ value: {
59
+ color: theme.textColor1,
60
+ fontFamily: theme.fontFamily1,
61
+ fontSize: 16,
62
+ lineHeight: 22,
63
+ minHeight: 22
64
+ },
65
+ readonly: {
66
+ backgroundColor: theme.disabledColor
67
+ },
68
+ clearIcon: {
69
+ borderWidth: 0,
70
+ marginLeft: 'auto',
71
+ height: 'auto',
72
+ width: 'auto'
73
+ }
74
+ });
75
+ return styles;
76
+ };
77
+ }
78
+ componentDidMount() {
79
+ this.appearanceSubscription = react_native_appearance_1.Appearance.addChangeListener(({ colorScheme }) => {
80
+ this.setState({ isDarkModeEnabled: colorScheme === 'dark' });
81
+ });
82
+ }
83
+ componentWillUnmount() {
84
+ this.appearanceSubscription.remove();
85
+ }
86
+ render() {
87
+ const { label, value, clearable, style, disabled, nativeID } = this.props;
88
+ const { showModal, isDarkModeEnabled } = this.state;
89
+ const date = new Date();
90
+ const hourRegex = /(\d{2}):(\d{2})/;
91
+ const matches = hourRegex.exec(value);
92
+ const styles = this.getStyles();
93
+ const theme = theme_1.getTheme();
94
+ if (matches) {
95
+ date.setHours(parseInt(matches[1], 10));
96
+ date.setMinutes(parseInt(matches[2], 10));
97
+ }
98
+ return (React.createElement(React.Fragment, null,
99
+ React.createElement(react_native_1.TouchableWithoutFeedback, { disabled: disabled, onPress: this.handlePress },
100
+ React.createElement(react_native_1.View, { nativeID: nativeID, style: [styles.container, style, disabled ? styles.readonly : null] },
101
+ React.createElement(react_native_1.View, null,
102
+ React.createElement(react_native_1.Text, { style: styles.label }, label),
103
+ React.createElement(react_native_1.Text, { style: styles.value }, value)),
104
+ !disabled && (React.createElement(ImageButton_1.ImageButton, { icon: value && clearable ? 'times' : 'clock-o', style: styles.clearIcon, iconColor: value && clearable ? theme.textColor1 : theme.textColor2, onPress: value && clearable ? this.handleClear : this.handlePress, hitBoxSize: 30 })),
105
+ react_native_1.Platform.OS !== 'web' && (React.createElement(react_native_modal_datetime_picker_1.default, { mode: "time", date: date, isVisible: showModal, onConfirm: this.handleConfirm, onCancel: this.handleCancel, isDarkModeEnabled: isDarkModeEnabled, display: react_native_1.Platform.OS == 'ios' ? 'spinner' : 'default' }))))));
106
+ }
107
+ }
108
+ TimePicker.defaultProps = {
109
+ clearable: true
110
+ };
111
+ exports.TimePicker = TimePicker;
@@ -0,0 +1,48 @@
1
+ import * as React from 'react';
2
+ import { StyleProp, TextInput, ViewStyle, TextInputProps } from 'react-native';
3
+ export interface TextBoxInputProps extends TextInputProps {
4
+ ref: (ref: TextInput) => void;
5
+ }
6
+ export interface TimePickerProperties {
7
+ label: string;
8
+ value: string;
9
+ clearable?: boolean;
10
+ disabled?: boolean;
11
+ onChange: (value: string) => void;
12
+ style?: StyleProp<ViewStyle>;
13
+ nativeID?: string;
14
+ }
15
+ export declare class TimePicker extends React.Component<TimePickerProperties> {
16
+ private backspace;
17
+ static defaultProps: {
18
+ disabled: boolean;
19
+ };
20
+ getStyles: () => {
21
+ container: {
22
+ paddingHorizontal: number;
23
+ paddingVertical: number;
24
+ borderWidth: number;
25
+ borderColor: string;
26
+ borderRadius: number;
27
+ };
28
+ label: {
29
+ color: string;
30
+ fontFamily: string;
31
+ fontSize: number;
32
+ lineHeight: number;
33
+ };
34
+ input: {
35
+ color: string;
36
+ fontFamily: string;
37
+ fontSize: number;
38
+ minHeight: number;
39
+ padding: number;
40
+ margin: number;
41
+ outlineStyle: string;
42
+ };
43
+ readonly: {
44
+ backgroundColor: string;
45
+ };
46
+ };
47
+ render(): JSX.Element;
48
+ }
@@ -0,0 +1,82 @@
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
+ const validation_1 = require("../modules/validation");
8
+ class TimePicker extends React.Component {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.backspace = false;
12
+ this.getStyles = () => {
13
+ const theme = theme_1.getTheme();
14
+ const styles = react_native_1.StyleSheet.create({
15
+ container: {
16
+ paddingHorizontal: 16,
17
+ paddingVertical: 8,
18
+ borderWidth: 1,
19
+ borderColor: theme.borderColor1,
20
+ borderRadius: 3
21
+ },
22
+ label: {
23
+ color: theme.textColor2,
24
+ fontFamily: theme.fontFamily3,
25
+ fontSize: layout_1.isTablet() ? 15 : 12,
26
+ lineHeight: 16
27
+ },
28
+ input: {
29
+ color: theme.textColor1,
30
+ fontFamily: theme.fontFamily1,
31
+ fontSize: 16,
32
+ minHeight: 22,
33
+ padding: 0,
34
+ margin: 0,
35
+ outlineStyle: 'none'
36
+ },
37
+ readonly: {
38
+ backgroundColor: theme.disabledColor
39
+ }
40
+ });
41
+ return styles;
42
+ };
43
+ }
44
+ render() {
45
+ const { label, style, disabled, value, nativeID } = this.props;
46
+ const styles = this.getStyles();
47
+ return (React.createElement(react_native_1.TouchableWithoutFeedback, { accessible: false, disabled: disabled },
48
+ React.createElement(react_native_1.View, { style: [styles.container, style, !disabled ? null : styles.readonly] },
49
+ React.createElement(react_native_1.Text, { style: styles.label }, label),
50
+ React.createElement(react_native_1.TextInput, { nativeID: nativeID, value: value, style: styles.input, maxLength: 5, onKeyPress: (nativeEvent) => {
51
+ if (nativeEvent.key === 'Backspace') {
52
+ this.backspace = true;
53
+ }
54
+ }, onChangeText: (text) => {
55
+ if (value.length > 0 && value.match(/[a-zA-Z]+/) == null) {
56
+ if (text.length === 2 && !this.backspace) {
57
+ text += ':';
58
+ }
59
+ if (text.length === 3 && !text.includes(':')) {
60
+ text = text.substr(0, 2) + ':' + text.substr(2);
61
+ }
62
+ if (text.length <= 2) {
63
+ this.backspace = false;
64
+ }
65
+ if (validation_1.isHour(text + '00:00'.substr(text.length))) {
66
+ this.props.onChange(text);
67
+ }
68
+ }
69
+ else {
70
+ this.props.onChange(text);
71
+ }
72
+ }, onBlur: () => {
73
+ if (value.length > 0 && value.match(/[a-zA-Z]+/) == null) {
74
+ this.props.onChange(value + '00:00'.substr(value.length));
75
+ }
76
+ } }))));
77
+ }
78
+ }
79
+ TimePicker.defaultProps = {
80
+ disabled: false
81
+ };
82
+ exports.TimePicker = TimePicker;
package/lib/index.d.ts ADDED
@@ -0,0 +1,39 @@
1
+ export * from './components/AppShell';
2
+ export * from './components/Button';
3
+ export * from './components/Card';
4
+ export * from './components/CheckBox';
5
+ export * from './components/DatePicker';
6
+ export * from './components/Details';
7
+ export * from './components/DetailsHeader';
8
+ export * from './components/DimensionsMonitor';
9
+ export * from './components/DropDown';
10
+ export * from './components/FilePicker';
11
+ export * from './components/Header';
12
+ export * from './components/HeaderDesktop';
13
+ export * from './components/ImageButton';
14
+ export * from './components/KeyboardAvoidingView';
15
+ export * from './components/Link';
16
+ export * from './components/Loading';
17
+ export * from './components/MenuMobile';
18
+ export * from './components/MenuDesktop';
19
+ export * from './components/Message';
20
+ export * from './components/Modal';
21
+ export * from './components/MultiSelect';
22
+ export * from './components/Question';
23
+ export * from './components/RadioButton';
24
+ export * from './components/RadioGroup';
25
+ export * from './components/RangeDatePicker';
26
+ export * from './components/Space';
27
+ export * from './components/StatusBar';
28
+ export * from './components/Switch';
29
+ export * from './components/Table';
30
+ export * from './components/Text';
31
+ export * from './components/TextBox';
32
+ export * from './components/TimePicker';
33
+ export * from './components/ErrorMessage';
34
+ export * from './components/TextBoxMask';
35
+ export * from './modules/format';
36
+ export * from './modules/layout';
37
+ export * from './modules/theme';
38
+ export * from './modules/validation';
39
+ export * from './components/NoRecordMessage';
package/lib/index.js ADDED
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ function __export(m) {
3
+ for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
+ }
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ __export(require("./components/AppShell"));
7
+ __export(require("./components/Button"));
8
+ __export(require("./components/Card"));
9
+ __export(require("./components/CheckBox"));
10
+ __export(require("./components/DatePicker"));
11
+ __export(require("./components/Details"));
12
+ __export(require("./components/DetailsHeader"));
13
+ __export(require("./components/DimensionsMonitor"));
14
+ __export(require("./components/DropDown"));
15
+ __export(require("./components/FilePicker"));
16
+ __export(require("./components/Header"));
17
+ __export(require("./components/HeaderDesktop"));
18
+ __export(require("./components/ImageButton"));
19
+ __export(require("./components/KeyboardAvoidingView"));
20
+ __export(require("./components/Link"));
21
+ __export(require("./components/Loading"));
22
+ __export(require("./components/MenuMobile"));
23
+ __export(require("./components/MenuDesktop"));
24
+ __export(require("./components/Message"));
25
+ __export(require("./components/Modal"));
26
+ __export(require("./components/MultiSelect"));
27
+ __export(require("./components/Question"));
28
+ __export(require("./components/RadioButton"));
29
+ __export(require("./components/RadioGroup"));
30
+ __export(require("./components/RangeDatePicker"));
31
+ __export(require("./components/Space"));
32
+ __export(require("./components/StatusBar"));
33
+ __export(require("./components/Switch"));
34
+ __export(require("./components/Table"));
35
+ __export(require("./components/Text"));
36
+ __export(require("./components/TextBox"));
37
+ __export(require("./components/TimePicker"));
38
+ __export(require("./components/ErrorMessage"));
39
+ __export(require("./components/TextBoxMask"));
40
+ __export(require("./modules/format"));
41
+ __export(require("./modules/layout"));
42
+ __export(require("./modules/theme"));
43
+ __export(require("./modules/validation"));
44
+ __export(require("./components/NoRecordMessage"));
@@ -0,0 +1,2 @@
1
+ export declare function ehIE(): boolean;
2
+ export declare function setDatePickerColor(color: string): void;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ function ehIE() {
5
+ return /MSIE|Trident\//.test(navigator.userAgent);
6
+ }
7
+ exports.ehIE = ehIE;
8
+ function setDatePickerColor(color) {
9
+ if (['ios', 'android'].includes(react_native_1.Platform.OS)) {
10
+ return;
11
+ }
12
+ const STYLE_ID = 'custom-datepicker-color';
13
+ removeElements(`style#${STYLE_ID}`);
14
+ const style = document.createElement('style');
15
+ style.id = STYLE_ID;
16
+ style.innerHTML = `
17
+ .rdrMonthAndYearWrapper {
18
+ background-color: ${color};
19
+ }
20
+
21
+ .rdrDayToday .rdrDayNumber span:after {
22
+ background: ${color}
23
+ }
24
+
25
+ .rdrSelected,
26
+ .rdrInRange,
27
+ .rdrStartEdge,
28
+ .rdrEndEdge {
29
+ background: ${color};
30
+ }
31
+
32
+ .rdrDay {
33
+ color: ${color} !important;
34
+ }
35
+
36
+ .rdrDayStartPreview,
37
+ .rdrDayInPreview,
38
+ .rdrDayEndPreview {
39
+ border: 0px solid ${color};
40
+ }
41
+ `;
42
+ document.body.appendChild(style);
43
+ }
44
+ exports.setDatePickerColor = setDatePickerColor;
45
+ function removeElements(query) {
46
+ const elements = document.querySelectorAll(query);
47
+ if (elements) {
48
+ elements.forEach(el => el.remove());
49
+ }
50
+ }
@@ -0,0 +1,6 @@
1
+ export declare type Locale = 'pt' | 'en' | 'es';
2
+ export declare const setLocale: (locale: Locale) => void;
3
+ export declare const getLocale: () => Locale;
4
+ export declare const parseDate: (date: string, format: string) => Date;
5
+ export declare const getDateFnsLocale: () => any;
6
+ export declare const formatDate: (date: Date, format: string) => string;
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const date_fns_1 = require("date-fns");
4
+ const dfnslocales = {
5
+ pt: require('date-fns/locale/pt'),
6
+ en: require('date-fns/locale/en-US'),
7
+ es: require('date-fns/locale/es')
8
+ };
9
+ let currentLocale = 'pt';
10
+ exports.setLocale = (locale) => {
11
+ currentLocale = locale;
12
+ };
13
+ exports.getLocale = () => {
14
+ return currentLocale;
15
+ };
16
+ exports.parseDate = (date, format) => {
17
+ return date_fns_1.parse(date, format, new Date());
18
+ };
19
+ exports.getDateFnsLocale = () => {
20
+ switch (currentLocale) {
21
+ case 'pt':
22
+ return dfnslocales.pt;
23
+ case 'es':
24
+ return dfnslocales.es;
25
+ default:
26
+ return dfnslocales.en;
27
+ }
28
+ };
29
+ const fixPortugueseLowercase = (formattedDate) => {
30
+ formattedDate = formattedDate.replace('segunda-feira', 'Segunda-Feira');
31
+ formattedDate = formattedDate.replace('terça-feira', 'Terça-Feira');
32
+ formattedDate = formattedDate.replace('quarta-feira', 'Quarta-Feira');
33
+ formattedDate = formattedDate.replace('quinta-feira', 'Quinta-Feira');
34
+ formattedDate = formattedDate.replace('sexta-feira', 'Sexta-Feira');
35
+ formattedDate = formattedDate.replace('sábado', 'Sábado');
36
+ formattedDate = formattedDate.replace('domingo', 'Domingo');
37
+ formattedDate = formattedDate.replace('seg', 'Seg');
38
+ formattedDate = formattedDate.replace('ter', 'Ter');
39
+ formattedDate = formattedDate.replace('qua', 'Qua');
40
+ formattedDate = formattedDate.replace('qui', 'Qui');
41
+ formattedDate = formattedDate.replace('sex', 'Sex');
42
+ formattedDate = formattedDate.replace('sáb', 'Sáb');
43
+ formattedDate = formattedDate.replace('dom', 'Dom');
44
+ formattedDate = formattedDate.replace('janeiro', 'Janeiro');
45
+ formattedDate = formattedDate.replace('fevereiro', 'Fevereiro');
46
+ formattedDate = formattedDate.replace('março', 'Março');
47
+ formattedDate = formattedDate.replace('abril', 'Abril');
48
+ formattedDate = formattedDate.replace('maio', 'Maio');
49
+ formattedDate = formattedDate.replace('junho', 'Junho');
50
+ formattedDate = formattedDate.replace('julho', 'Julho');
51
+ formattedDate = formattedDate.replace('agosto', 'Agosto');
52
+ formattedDate = formattedDate.replace('setembro', 'Setembro');
53
+ formattedDate = formattedDate.replace('outubro', 'Outubro');
54
+ formattedDate = formattedDate.replace('novembro', 'Novembro');
55
+ formattedDate = formattedDate.replace('dezembro', 'Dezembro');
56
+ return formattedDate;
57
+ };
58
+ const fixSpanishLowercase = (formattedDate) => {
59
+ formattedDate = formattedDate.replace('lunes', 'Lunes');
60
+ formattedDate = formattedDate.replace('martes', 'Martes');
61
+ formattedDate = formattedDate.replace('miércoles', 'Miércoles');
62
+ formattedDate = formattedDate.replace('jueves', 'Jueves');
63
+ formattedDate = formattedDate.replace('viernes', 'Viernes');
64
+ formattedDate = formattedDate.replace('sábado', 'Sábado');
65
+ formattedDate = formattedDate.replace('domingo', 'Domingo');
66
+ formattedDate = formattedDate.replace('lun', 'Lun');
67
+ formattedDate = formattedDate.replace('mar', 'Mar');
68
+ formattedDate = formattedDate.replace('mié', 'Mié');
69
+ formattedDate = formattedDate.replace('jue', 'Jue');
70
+ formattedDate = formattedDate.replace('vie', 'Vie');
71
+ formattedDate = formattedDate.replace('sáb', 'Sáb');
72
+ formattedDate = formattedDate.replace('dom', 'Dom');
73
+ formattedDate = formattedDate.replace('enero', 'Enero');
74
+ formattedDate = formattedDate.replace('febrero', 'Febrero');
75
+ formattedDate = formattedDate.replace('marzo', 'Marzo');
76
+ formattedDate = formattedDate.replace('abril', 'Abril');
77
+ formattedDate = formattedDate.replace('mayo', 'Mayo');
78
+ formattedDate = formattedDate.replace('junio', 'Junio');
79
+ formattedDate = formattedDate.replace('julio', 'Julio');
80
+ formattedDate = formattedDate.replace('agosto', 'Agosto');
81
+ formattedDate = formattedDate.replace('septiembre', 'Septiembre');
82
+ formattedDate = formattedDate.replace('octubre', 'Octubre');
83
+ formattedDate = formattedDate.replace('noviembre', 'Noviembre');
84
+ formattedDate = formattedDate.replace('diciembre', 'Diciembre');
85
+ return formattedDate;
86
+ };
87
+ exports.formatDate = (date, format) => {
88
+ const formattedDate = date_fns_1.format(date, format, {
89
+ locale: exports.getDateFnsLocale()
90
+ });
91
+ switch (currentLocale) {
92
+ case 'pt':
93
+ return fixPortugueseLowercase(formattedDate);
94
+ case 'es':
95
+ return fixSpanishLowercase(formattedDate);
96
+ default:
97
+ return formattedDate;
98
+ }
99
+ };
@@ -0,0 +1 @@
1
+ export declare const isTablet: () => boolean;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const react_native_1 = require("react-native");
4
+ exports.isTablet = () => {
5
+ if (react_native_1.Platform.OS === 'web') {
6
+ return false;
7
+ }
8
+ return (react_native_1.Dimensions.get('window').height >= 800 &&
9
+ react_native_1.Dimensions.get('window').width >= 500);
10
+ };
@@ -0,0 +1,41 @@
1
+ export declare const BLACK = "#282c37";
2
+ export declare const WHITE = "#ffffff";
3
+ export declare const GRAY = "#555";
4
+ export declare const GRAY_1 = "#eef1f6";
5
+ export declare const GRAY_2 = "#dddddd";
6
+ export declare const GRAY_3 = "#c2c2c2";
7
+ export declare const GRAY_4 = "#aabec6";
8
+ export declare const BLUE = "#0047a9";
9
+ export declare const BLUE_LIGHT = "#0c65c7";
10
+ export declare const BLUE_LIGHT_2 = "#59cbe8";
11
+ export declare const YELLOW = "#f5a623";
12
+ export declare const GREEN = "#34bf6d";
13
+ export declare const GREEN_LIGHT = "#2ec562";
14
+ export declare const RED = "#d62729";
15
+ export interface Theme {
16
+ textColor1: string;
17
+ textColor2: string;
18
+ textColor3: string;
19
+ textColor4: string;
20
+ messageTextColor: string;
21
+ counterTextColor: string;
22
+ dropDownTextColor: string;
23
+ questionTextColor: string;
24
+ datePickerColor: string;
25
+ backgroundColor1: string;
26
+ backgroundColor2: string;
27
+ backgroundColor3: string;
28
+ borderColor1: string;
29
+ shadowColor1: string;
30
+ statusBarColor: string;
31
+ successColor: string;
32
+ warningColor: string;
33
+ errorColor: string;
34
+ disabledColor: string;
35
+ counterBackgroundColor: string;
36
+ fontFamily1: string;
37
+ fontFamily2: string;
38
+ fontFamily3: string;
39
+ }
40
+ export declare const setTheme: (newTheme: Partial<Theme>) => void;
41
+ export declare const getTheme: () => Theme;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const browser_1 = require("./browser");
4
+ exports.BLACK = '#282c37';
5
+ exports.WHITE = '#ffffff';
6
+ exports.GRAY = '#555';
7
+ exports.GRAY_1 = '#eef1f6';
8
+ exports.GRAY_2 = '#dddddd';
9
+ exports.GRAY_3 = '#c2c2c2';
10
+ exports.GRAY_4 = '#aabec6';
11
+ exports.BLUE = '#0047a9';
12
+ exports.BLUE_LIGHT = '#0c65c7';
13
+ exports.BLUE_LIGHT_2 = '#59cbe8';
14
+ exports.YELLOW = '#f5a623';
15
+ exports.GREEN = '#34bf6d';
16
+ exports.GREEN_LIGHT = '#2ec562';
17
+ exports.RED = '#d62729';
18
+ let theme = {
19
+ textColor1: exports.BLACK,
20
+ textColor2: exports.BLUE_LIGHT,
21
+ textColor3: exports.GRAY,
22
+ textColor4: exports.WHITE,
23
+ messageTextColor: exports.BLACK,
24
+ counterTextColor: exports.WHITE,
25
+ dropDownTextColor: exports.BLACK,
26
+ questionTextColor: exports.BLACK,
27
+ datePickerColor: exports.BLUE_LIGHT_2,
28
+ backgroundColor1: exports.WHITE,
29
+ backgroundColor2: exports.GRAY_1,
30
+ backgroundColor3: exports.BLUE_LIGHT,
31
+ borderColor1: exports.GRAY_3,
32
+ shadowColor1: exports.GRAY_4,
33
+ statusBarColor: exports.BLUE,
34
+ successColor: exports.GREEN_LIGHT,
35
+ warningColor: exports.YELLOW,
36
+ errorColor: exports.RED,
37
+ disabledColor: exports.GRAY_2,
38
+ counterBackgroundColor: exports.GREEN,
39
+ fontFamily1: 'Roboto-Medium',
40
+ fontFamily2: 'Roboto',
41
+ fontFamily3: 'Roboto-Light'
42
+ };
43
+ exports.setTheme = (newTheme) => {
44
+ theme = Object.assign({}, theme, newTheme);
45
+ browser_1.setDatePickerColor(theme.datePickerColor);
46
+ };
47
+ exports.getTheme = () => {
48
+ return theme;
49
+ };
@@ -0,0 +1,3 @@
1
+ export declare const validateCPF: (value: any) => boolean;
2
+ export declare const validateCNPJ: (value: any) => boolean;
3
+ export declare const isHour: (value: string) => boolean;