secullum-react-native-ui 4.3.13-beta.1 → 4.4.0-beta.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 +29 -3
- package/lib/components/AppShell.js +2 -1
- package/lib/components/Button.js +5 -4
- package/lib/components/Card.d.ts +5 -5
- package/lib/components/Card.js +13 -8
- package/lib/components/CheckBox.js +3 -2
- package/lib/components/DatePicker.js +8 -8
- package/lib/components/DatePicker.web.js +7 -6
- package/lib/components/Delay.d.ts +1 -1
- package/lib/components/Delay.js +1 -0
- package/lib/components/Details.js +4 -3
- package/lib/components/DetailsHeader.d.ts +1 -1
- package/lib/components/DetailsHeader.js +8 -7
- package/lib/components/DimensionsMonitor.d.ts +1 -1
- package/lib/components/DimensionsMonitor.js +1 -0
- package/lib/components/DropDown.js +10 -9
- package/lib/components/ErrorMessage.js +2 -1
- package/lib/components/FilePicker.d.ts +1 -0
- package/lib/components/FilePicker.js +7 -6
- package/lib/components/Header.d.ts +2 -2
- package/lib/components/Header.js +14 -11
- package/lib/components/HeaderDesktop.js +11 -8
- package/lib/components/ImageButton.js +2 -1
- package/lib/components/KeyboardAvoidingView.d.ts +1 -1
- package/lib/components/KeyboardAvoidingView.js +7 -4
- package/lib/components/Link.js +2 -1
- package/lib/components/Loading.js +1 -0
- package/lib/components/Menu.d.ts +1 -1
- package/lib/components/Menu.js +5 -4
- package/lib/components/MenuDesktop.js +3 -2
- package/lib/components/MenuMobile.js +4 -3
- package/lib/components/Message.js +10 -9
- package/lib/components/Modal.js +1 -0
- package/lib/components/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect.js +10 -9
- package/lib/components/NoRecordMessage.js +3 -2
- package/lib/components/Question.js +10 -9
- package/lib/components/RadioButton.js +2 -1
- package/lib/components/RadioGroup.js +5 -4
- package/lib/components/RangeDatePicker.js +7 -7
- package/lib/components/RangeDatePicker.web.js +7 -6
- package/lib/components/Space.js +2 -1
- package/lib/components/StatusBar.js +3 -2
- package/lib/components/Switch.js +3 -2
- package/lib/components/Table.js +5 -2
- package/lib/components/Table.web.d.ts +1 -1
- package/lib/components/Table.web.js +7 -4
- package/lib/components/Text.d.ts +1 -1
- package/lib/components/Text.js +4 -3
- package/lib/components/TextBox.d.ts +3 -35
- package/lib/components/TextBox.js +6 -5
- package/lib/components/TextBoxMask.js +8 -3
- package/lib/components/TimePicker.js +8 -8
- package/lib/components/TimePicker.web.js +7 -6
- package/lib/index.js +53 -42
- package/lib/modules/browser.js +1 -0
- package/lib/modules/format.js +14 -8
- package/lib/modules/layout.js +3 -1
- package/lib/modules/theme.js +7 -4
- package/lib/modules/validation.js +7 -3
- package/package.json +3 -4
package/lib/modules/format.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatDate = exports.getDateFnsLocale = exports.parseDate = exports.getLocale = exports.setLocale = void 0;
|
|
3
4
|
const date_fns_1 = require("date-fns");
|
|
4
5
|
const dfnslocales = {
|
|
5
6
|
pt: require('date-fns/locale/pt'),
|
|
@@ -7,16 +8,19 @@ const dfnslocales = {
|
|
|
7
8
|
es: require('date-fns/locale/es')
|
|
8
9
|
};
|
|
9
10
|
let currentLocale = 'pt';
|
|
10
|
-
|
|
11
|
+
const setLocale = (locale) => {
|
|
11
12
|
currentLocale = locale;
|
|
12
13
|
};
|
|
13
|
-
exports.
|
|
14
|
+
exports.setLocale = setLocale;
|
|
15
|
+
const getLocale = () => {
|
|
14
16
|
return currentLocale;
|
|
15
17
|
};
|
|
16
|
-
exports.
|
|
17
|
-
|
|
18
|
+
exports.getLocale = getLocale;
|
|
19
|
+
const parseDate = (date, format) => {
|
|
20
|
+
return (0, date_fns_1.parse)(date, format, new Date());
|
|
18
21
|
};
|
|
19
|
-
exports.
|
|
22
|
+
exports.parseDate = parseDate;
|
|
23
|
+
const getDateFnsLocale = () => {
|
|
20
24
|
switch (currentLocale) {
|
|
21
25
|
case 'pt':
|
|
22
26
|
return dfnslocales.pt;
|
|
@@ -26,6 +30,7 @@ exports.getDateFnsLocale = () => {
|
|
|
26
30
|
return dfnslocales.en;
|
|
27
31
|
}
|
|
28
32
|
};
|
|
33
|
+
exports.getDateFnsLocale = getDateFnsLocale;
|
|
29
34
|
const fixPortugueseLowercase = (formattedDate) => {
|
|
30
35
|
formattedDate = formattedDate.replace('segunda-feira', 'Segunda-Feira');
|
|
31
36
|
formattedDate = formattedDate.replace('terça-feira', 'Terça-Feira');
|
|
@@ -84,9 +89,9 @@ const fixSpanishLowercase = (formattedDate) => {
|
|
|
84
89
|
formattedDate = formattedDate.replace('diciembre', 'Diciembre');
|
|
85
90
|
return formattedDate;
|
|
86
91
|
};
|
|
87
|
-
|
|
88
|
-
const formattedDate = date_fns_1.format(date, format, {
|
|
89
|
-
locale: exports.getDateFnsLocale()
|
|
92
|
+
const formatDate = (date, format) => {
|
|
93
|
+
const formattedDate = (0, date_fns_1.format)(date, format, {
|
|
94
|
+
locale: (0, exports.getDateFnsLocale)()
|
|
90
95
|
});
|
|
91
96
|
switch (currentLocale) {
|
|
92
97
|
case 'pt':
|
|
@@ -97,3 +102,4 @@ exports.formatDate = (date, format) => {
|
|
|
97
102
|
return formattedDate;
|
|
98
103
|
}
|
|
99
104
|
};
|
|
105
|
+
exports.formatDate = formatDate;
|
package/lib/modules/layout.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTablet = void 0;
|
|
3
4
|
const react_native_1 = require("react-native");
|
|
4
|
-
|
|
5
|
+
const isTablet = () => {
|
|
5
6
|
if (react_native_1.Platform.OS === 'web') {
|
|
6
7
|
return false;
|
|
7
8
|
}
|
|
8
9
|
return (react_native_1.Dimensions.get('window').height >= 800 &&
|
|
9
10
|
react_native_1.Dimensions.get('window').width >= 500);
|
|
10
11
|
};
|
|
12
|
+
exports.isTablet = isTablet;
|
package/lib/modules/theme.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTheme = exports.setTheme = exports.RED = exports.GREEN_LIGHT = exports.GREEN = exports.YELLOW = exports.BLUE_LIGHT_2 = exports.BLUE_LIGHT = exports.BLUE = exports.GRAY_4 = exports.GRAY_3 = exports.GRAY_2 = exports.GRAY_1 = exports.GRAY = exports.WHITE = exports.BLACK = void 0;
|
|
3
4
|
const browser_1 = require("./browser");
|
|
4
5
|
exports.BLACK = '#282c37';
|
|
5
6
|
exports.WHITE = '#ffffff';
|
|
@@ -40,10 +41,12 @@ let theme = {
|
|
|
40
41
|
fontFamily2: 'Roboto',
|
|
41
42
|
fontFamily3: 'Roboto-Light'
|
|
42
43
|
};
|
|
43
|
-
|
|
44
|
-
theme = Object.assign({}, theme, newTheme);
|
|
45
|
-
browser_1.setDatePickerColor(theme.datePickerColor);
|
|
44
|
+
const setTheme = (newTheme) => {
|
|
45
|
+
theme = Object.assign(Object.assign({}, theme), newTheme);
|
|
46
|
+
(0, browser_1.setDatePickerColor)(theme.datePickerColor);
|
|
46
47
|
};
|
|
47
|
-
exports.
|
|
48
|
+
exports.setTheme = setTheme;
|
|
49
|
+
const getTheme = () => {
|
|
48
50
|
return theme;
|
|
49
51
|
};
|
|
52
|
+
exports.getTheme = getTheme;
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isHour = exports.validateCNPJ = exports.validateCPF = void 0;
|
|
3
4
|
const react_native_masked_text_1 = require("react-native-masked-text");
|
|
4
|
-
|
|
5
|
+
const validateCPF = (value) => {
|
|
5
6
|
return react_native_masked_text_1.MaskService.isValid('cpf', value, {});
|
|
6
7
|
};
|
|
7
|
-
exports.
|
|
8
|
+
exports.validateCPF = validateCPF;
|
|
9
|
+
const validateCNPJ = (value) => {
|
|
8
10
|
return react_native_masked_text_1.MaskService.isValid('cnpj', value, {});
|
|
9
11
|
};
|
|
10
|
-
exports.
|
|
12
|
+
exports.validateCNPJ = validateCNPJ;
|
|
13
|
+
const isHour = (value) => {
|
|
11
14
|
return /^(0[0-9]|1[0-9]|2[0-3]|[0-9]):[0-5][0-9]$/.test(value);
|
|
12
15
|
};
|
|
16
|
+
exports.isHour = isHour;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "secullum-react-native-ui",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-beta.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"@react-native-community/datetimepicker": "^3.0.9",
|
|
23
23
|
"date-fns": "2.0.0-alpha.7",
|
|
24
24
|
"react-date-range": "^1.0.0-beta",
|
|
25
|
-
"react-native-appearance": "^0.3.4",
|
|
26
25
|
"react-native-drawer-layout": "^2.0.0",
|
|
27
26
|
"react-native-elevated-view": "^0.0.6",
|
|
28
27
|
"react-native-masked-text": "^1.7.2",
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
"devDependencies": {
|
|
34
33
|
"@types/react": "^16.4.11",
|
|
35
34
|
"@types/react-dom": "^16.0.11",
|
|
36
|
-
"@types/react-native": "^0.
|
|
35
|
+
"@types/react-native": "^0.63.64",
|
|
37
36
|
"@types/react-native-drawer-layout": "^1.3.3",
|
|
38
37
|
"@types/react-native-elevated-view": "^0.0.2",
|
|
39
38
|
"@types/react-native-vector-icons": "^6.4.6",
|
|
@@ -45,7 +44,7 @@
|
|
|
45
44
|
"react": "^16.2.0",
|
|
46
45
|
"react-native": "^0.52 || ^0.53 || ^0.54 || ^0.55 || ^0.63",
|
|
47
46
|
"rimraf": "^2.6.2",
|
|
48
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^4.8.3"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"react": "^16.2.0",
|