@controleonline/ui-default 1.0.263 → 1.0.265
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/AGENTS.md +47 -45
- package/package.json +20 -20
- package/src/react/components/errors/DefaultErrors.js +307 -325
- package/src/react/components/files/DefaultFile.js +46 -46
- package/src/react/components/filters/CompactFilterSelector.js +78 -24
- package/src/react/components/filters/CompactFilterSelector.styles.js +17 -5
- package/src/react/components/filters/DefaultColumnFilter.js +191 -57
- package/src/react/components/filters/DefaultExternalFilters.js +245 -182
- package/src/react/components/filters/DefaultSearch.js +131 -92
- package/src/react/components/filters/DefaultSearch.styles.js +65 -70
- package/src/react/components/form/DefaultForm.js +172 -151
- package/src/react/components/form/DefaultForm.styles.js +71 -66
- package/src/react/components/help/DefaultTooltip.js +87 -87
- package/src/react/components/help/DefaultTooltip.styles.js +61 -61
- package/src/react/components/inputs/DefaultDateInput.js +150 -0
- package/src/react/components/inputs/DefaultInput.js +162 -127
- package/src/react/components/inputs/DefaultInput.styles.js +6 -0
- package/src/react/components/inputs/DefaultSelect.js +320 -152
- package/src/react/components/inputs/defaultInputUtils.js +40 -19
- package/src/react/components/map/DefaultGoogleMap.styles.js +115 -9
- package/src/react/components/map/DefaultGoogleMap.web.js +560 -446
- package/src/react/components/map/DefaultMap.native.js +73 -71
- package/src/react/components/map/DefaultMap.styles.js +16 -16
- package/src/react/components/map/DefaultMap.web.js +68 -66
- package/src/react/components/map/DefaultNativeMap.native.js +307 -183
- package/src/react/components/map/DefaultNativeMap.shared.js +439 -340
- package/src/react/components/map/DefaultNativeMap.styles.js +156 -122
- package/src/react/components/table/DefaultColumnMenu.js +108 -0
- package/src/react/components/table/DefaultDebug.js +233 -0
- package/src/react/components/table/DefaultFiltersModal.js +142 -0
- package/src/react/components/table/DefaultModalButton.js +18 -0
- package/src/react/components/table/DefaultSearchModal.js +49 -0
- package/src/react/components/table/DefaultTable.js +345 -1846
- package/src/react/components/table/DefaultTable.styles.js +247 -136
- package/src/react/components/table/DefaultTable.utils.js +502 -0
- package/src/react/components/table/DefaultTableBody.js +26 -0
- package/src/react/components/table/DefaultTableCards.js +171 -0
- package/src/react/components/table/DefaultTableControls.js +208 -0
- package/src/react/components/table/DefaultTableEmptyState.js +22 -0
- package/src/react/components/table/DefaultTableFooter.js +172 -0
- package/src/react/components/table/DefaultTableInput.js +145 -0
- package/src/react/components/table/DefaultTableRows.js +340 -0
- package/src/react/components/table/DefaultTableSearch.js +100 -0
- package/src/react/components/table/DefaultTableToolbar.js +98 -0
- package/src/react/components/table/DefaultToolbarAction.js +56 -0
- package/src/react/components/table/useDefaultTablePagination.js +370 -0
- package/src/react/components/table/useDefaultTableSorting.js +126 -0
- package/src/react/components/table/useDefaultTableTheme.js +58 -0
- package/src/react/index.js +10 -10
- package/src/react/utils/tableVisibleColumnsPreferences.js +239 -211
- package/src/store/default/actions.js +51 -13
- package/src/store/default/getters.js +10 -8
- package/src/store/default/mutation_types.js +4 -2
- package/src/store/default/mutations.js +10 -1
- package/src/tests/react/components/errors/DefaultErrors.test.js +162 -162
- package/src/tests/react/components/files/DefaultFile.test.js +80 -80
- package/src/tests/react/components/form/DefaultForm.test.js +81 -0
- package/src/tests/react/components/inputs/DefaultSelect.test.js +185 -0
- package/src/tests/react/components/table/DefaultTable.test.js +1183 -0
- package/src/tests/react/store/defaultActions.test.js +59 -0
- package/src/tests/react/utils/tableVisibleColumnsPreferences.test.js +247 -168
|
@@ -1,71 +1,73 @@
|
|
|
1
|
-
import React, {useMemo} from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
import {WebView} from 'react-native-webview';
|
|
4
|
-
|
|
5
|
-
import DefaultNativeMap from './DefaultNativeMap.native';
|
|
6
|
-
|
|
7
|
-
import styles from './DefaultMap.styles';
|
|
8
|
-
import {
|
|
9
|
-
buildOpenStreetMapHtml,
|
|
10
|
-
resolveDefaultMapPayload,
|
|
11
|
-
} from './DefaultMap.shared';
|
|
12
|
-
|
|
13
|
-
export default function DefaultMap({
|
|
14
|
-
config = null,
|
|
15
|
-
addresses = null,
|
|
16
|
-
markerPayloads = [],
|
|
17
|
-
paths = [],
|
|
18
|
-
userCoordinates = null,
|
|
19
|
-
apiKey = '',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
resolvedPayload.
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
1
|
+
import React, {useMemo} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
import {WebView} from 'react-native-webview';
|
|
4
|
+
|
|
5
|
+
import DefaultNativeMap from './DefaultNativeMap.native';
|
|
6
|
+
|
|
7
|
+
import styles from './DefaultMap.styles';
|
|
8
|
+
import {
|
|
9
|
+
buildOpenStreetMapHtml,
|
|
10
|
+
resolveDefaultMapPayload,
|
|
11
|
+
} from './DefaultMap.shared';
|
|
12
|
+
|
|
13
|
+
export default function DefaultMap({
|
|
14
|
+
config = null,
|
|
15
|
+
addresses = null,
|
|
16
|
+
markerPayloads = [],
|
|
17
|
+
paths = [],
|
|
18
|
+
userCoordinates = null,
|
|
19
|
+
apiKey = '',
|
|
20
|
+
popupTheme = null,
|
|
21
|
+
}) {
|
|
22
|
+
const resolvedPayload = useMemo(
|
|
23
|
+
() =>
|
|
24
|
+
resolveDefaultMapPayload({
|
|
25
|
+
config,
|
|
26
|
+
addresses,
|
|
27
|
+
markerPayloads,
|
|
28
|
+
paths,
|
|
29
|
+
userCoordinates,
|
|
30
|
+
apiKey,
|
|
31
|
+
}),
|
|
32
|
+
[apiKey, addresses, config, markerPayloads, paths, userCoordinates],
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
if (
|
|
36
|
+
resolvedPayload.markerPayloads.length === 0 &&
|
|
37
|
+
!resolvedPayload.userCoordinates &&
|
|
38
|
+
resolvedPayload.paths.length === 0
|
|
39
|
+
) {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (resolvedPayload.apiKey) {
|
|
44
|
+
return (
|
|
45
|
+
<DefaultNativeMap
|
|
46
|
+
apiKey={resolvedPayload.apiKey}
|
|
47
|
+
markerPayloads={resolvedPayload.markerPayloads}
|
|
48
|
+
userCoordinates={resolvedPayload.userCoordinates}
|
|
49
|
+
paths={resolvedPayload.paths}
|
|
50
|
+
popupTheme={popupTheme}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return (
|
|
56
|
+
<View style={styles.mapContainer}>
|
|
57
|
+
<WebView
|
|
58
|
+
source={{
|
|
59
|
+
html: buildOpenStreetMapHtml({
|
|
60
|
+
markerPayloads: resolvedPayload.markerPayloads,
|
|
61
|
+
paths: resolvedPayload.paths,
|
|
62
|
+
userCoordinates: resolvedPayload.userCoordinates,
|
|
63
|
+
routeColor: '#0EA5E9',
|
|
64
|
+
}),
|
|
65
|
+
}}
|
|
66
|
+
style={styles.mapViewport}
|
|
67
|
+
originWhitelist={['*']}
|
|
68
|
+
javaScriptEnabled
|
|
69
|
+
domStorageEnabled
|
|
70
|
+
/>
|
|
71
|
+
</View>
|
|
72
|
+
);
|
|
73
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {StyleSheet} from 'react-native';
|
|
2
|
-
|
|
3
|
-
export default StyleSheet.create({
|
|
4
|
-
mapContainer: {
|
|
5
|
-
width: '100%',
|
|
6
|
-
height: '100%',
|
|
7
|
-
position: 'relative',
|
|
8
|
-
backgroundColor: '#E5EEF5',
|
|
9
|
-
},
|
|
10
|
-
mapViewport: {
|
|
11
|
-
width: '100%',
|
|
12
|
-
height: '100%',
|
|
13
|
-
borderWidth: 0,
|
|
14
|
-
backgroundColor: '#E5EEF5',
|
|
15
|
-
},
|
|
16
|
-
});
|
|
1
|
+
import {StyleSheet} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export default StyleSheet.create({
|
|
4
|
+
mapContainer: {
|
|
5
|
+
width: '100%',
|
|
6
|
+
height: '100%',
|
|
7
|
+
position: 'relative',
|
|
8
|
+
backgroundColor: '#E5EEF5',
|
|
9
|
+
},
|
|
10
|
+
mapViewport: {
|
|
11
|
+
width: '100%',
|
|
12
|
+
height: '100%',
|
|
13
|
+
borderWidth: 0,
|
|
14
|
+
backgroundColor: '#E5EEF5',
|
|
15
|
+
},
|
|
16
|
+
});
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
import React, {useMemo} from 'react';
|
|
2
|
-
import {View} from 'react-native';
|
|
3
|
-
|
|
4
|
-
import DefaultGoogleMap from './DefaultGoogleMap.web';
|
|
5
|
-
|
|
6
|
-
import styles from './DefaultMap.styles';
|
|
7
|
-
import {
|
|
8
|
-
buildOpenStreetMapHtml,
|
|
9
|
-
resolveDefaultMapPayload,
|
|
10
|
-
} from './DefaultMap.shared';
|
|
11
|
-
|
|
12
|
-
export default function DefaultMap({
|
|
13
|
-
config = null,
|
|
14
|
-
addresses = null,
|
|
15
|
-
markerPayloads = [],
|
|
16
|
-
paths = [],
|
|
17
|
-
userCoordinates = null,
|
|
18
|
-
apiKey = '',
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
resolvedPayload.
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
import React, {useMemo} from 'react';
|
|
2
|
+
import {View} from 'react-native';
|
|
3
|
+
|
|
4
|
+
import DefaultGoogleMap from './DefaultGoogleMap.web';
|
|
5
|
+
|
|
6
|
+
import styles from './DefaultMap.styles';
|
|
7
|
+
import {
|
|
8
|
+
buildOpenStreetMapHtml,
|
|
9
|
+
resolveDefaultMapPayload,
|
|
10
|
+
} from './DefaultMap.shared';
|
|
11
|
+
|
|
12
|
+
export default function DefaultMap({
|
|
13
|
+
config = null,
|
|
14
|
+
addresses = null,
|
|
15
|
+
markerPayloads = [],
|
|
16
|
+
paths = [],
|
|
17
|
+
userCoordinates = null,
|
|
18
|
+
apiKey = '',
|
|
19
|
+
popupTheme = null,
|
|
20
|
+
}) {
|
|
21
|
+
const resolvedPayload = useMemo(
|
|
22
|
+
() =>
|
|
23
|
+
resolveDefaultMapPayload({
|
|
24
|
+
config,
|
|
25
|
+
addresses,
|
|
26
|
+
markerPayloads,
|
|
27
|
+
paths,
|
|
28
|
+
userCoordinates,
|
|
29
|
+
apiKey,
|
|
30
|
+
}),
|
|
31
|
+
[apiKey, addresses, config, markerPayloads, paths, userCoordinates],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
if (
|
|
35
|
+
resolvedPayload.markerPayloads.length === 0 &&
|
|
36
|
+
!resolvedPayload.userCoordinates &&
|
|
37
|
+
resolvedPayload.paths.length === 0
|
|
38
|
+
) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (resolvedPayload.apiKey) {
|
|
43
|
+
return (
|
|
44
|
+
<DefaultGoogleMap
|
|
45
|
+
apiKey={resolvedPayload.apiKey}
|
|
46
|
+
markerPayloads={resolvedPayload.markerPayloads}
|
|
47
|
+
userCoordinates={resolvedPayload.userCoordinates}
|
|
48
|
+
paths={resolvedPayload.paths}
|
|
49
|
+
popupTheme={popupTheme}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<View style={styles.mapContainer}>
|
|
56
|
+
<iframe
|
|
57
|
+
title="Mapa"
|
|
58
|
+
srcDoc={buildOpenStreetMapHtml({
|
|
59
|
+
markerPayloads: resolvedPayload.markerPayloads,
|
|
60
|
+
paths: resolvedPayload.paths,
|
|
61
|
+
userCoordinates: resolvedPayload.userCoordinates,
|
|
62
|
+
routeColor: '#0EA5E9',
|
|
63
|
+
})}
|
|
64
|
+
style={{width: '100%', height: '100%', border: 0}}
|
|
65
|
+
/>
|
|
66
|
+
</View>
|
|
67
|
+
);
|
|
68
|
+
}
|