@controleonline/ui-default 1.0.263
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/.github/agents/developer.agent.md +30 -0
- package/.github/agents/devops.agent.md +30 -0
- package/.github/agents/qa.agent.md +30 -0
- package/.github/agents/security.agent.md +30 -0
- package/.scrutinizer.yml +20 -0
- package/AGENTS.md +47 -0
- package/FUNDING.yml +1 -0
- package/package.json +21 -0
- package/src/react/components/errors/DefaultErrors.js +360 -0
- package/src/react/components/files/DefaultFile.js +46 -0
- package/src/react/components/filters/CompactFilterSelector.js +262 -0
- package/src/react/components/filters/CompactFilterSelector.styles.js +124 -0
- package/src/react/components/filters/DateShortcutFilter.js +264 -0
- package/src/react/components/filters/DateShortcutFilter.styles.js +82 -0
- package/src/react/components/filters/DefaultColumnFilter.js +97 -0
- package/src/react/components/filters/DefaultColumnFilter.styles.js +21 -0
- package/src/react/components/filters/DefaultExternalFilters.js +441 -0
- package/src/react/components/filters/DefaultExternalFilters.styles.js +177 -0
- package/src/react/components/filters/DefaultSearch.js +103 -0
- package/src/react/components/filters/DefaultSearch.styles.js +70 -0
- package/src/react/components/filters/dateFilterSelection.js +29 -0
- package/src/react/components/form/DefaultForm.js +198 -0
- package/src/react/components/form/DefaultForm.styles.js +70 -0
- package/src/react/components/help/DefaultTooltip.js +87 -0
- package/src/react/components/help/DefaultTooltip.styles.js +61 -0
- package/src/react/components/inputs/DefaultInput.js +160 -0
- package/src/react/components/inputs/DefaultInput.styles.js +93 -0
- package/src/react/components/inputs/DefaultSelect.js +192 -0
- package/src/react/components/inputs/DefaultSelect.styles.js +65 -0
- package/src/react/components/inputs/defaultInputUtils.js +230 -0
- package/src/react/components/map/DefaultGoogleMap.styles.js +9 -0
- package/src/react/components/map/DefaultGoogleMap.web.js +698 -0
- package/src/react/components/map/DefaultMap.native.js +71 -0
- package/src/react/components/map/DefaultMap.shared.js +762 -0
- package/src/react/components/map/DefaultMap.styles.js +16 -0
- package/src/react/components/map/DefaultMap.web.js +66 -0
- package/src/react/components/map/DefaultNativeMap.native.js +615 -0
- package/src/react/components/map/DefaultNativeMap.shared.js +532 -0
- package/src/react/components/map/DefaultNativeMap.styles.js +122 -0
- package/src/react/components/table/DefaultTable.js +1897 -0
- package/src/react/components/table/DefaultTable.styles.js +610 -0
- package/src/react/index.js +10 -0
- package/src/react/utils/tableVisibleColumnsPreferences.js +264 -0
- package/src/store/default/actions.js +444 -0
- package/src/store/default/getters.js +28 -0
- package/src/store/default/mutation_types.js +26 -0
- package/src/store/default/mutations.js +138 -0
- package/src/tests/react/components/DateShortcutFilter.test.js +96 -0
- package/src/tests/react/components/errors/DefaultErrors.test.js +162 -0
- package/src/tests/react/components/files/DefaultFile.test.js +80 -0
- package/src/tests/react/components/map/DefaultMap.shared.test.js +162 -0
- package/src/tests/react/filters/dateFilterSelection.test.js +46 -0
- package/src/tests/react/inputs/defaultInputUtils.test.js +45 -0
- package/src/tests/react/store/defaultActions.test.js +112 -0
- package/src/tests/react/utils/tableVisibleColumnsPreferences.test.js +223 -0
- package/src/utils/filters.js +56 -0
|
@@ -0,0 +1,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
|
+
}) {
|
|
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
|
+
<DefaultNativeMap
|
|
45
|
+
apiKey={resolvedPayload.apiKey}
|
|
46
|
+
markerPayloads={resolvedPayload.markerPayloads}
|
|
47
|
+
userCoordinates={resolvedPayload.userCoordinates}
|
|
48
|
+
paths={resolvedPayload.paths}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<View style={styles.mapContainer}>
|
|
55
|
+
<WebView
|
|
56
|
+
source={{
|
|
57
|
+
html: buildOpenStreetMapHtml({
|
|
58
|
+
markerPayloads: resolvedPayload.markerPayloads,
|
|
59
|
+
paths: resolvedPayload.paths,
|
|
60
|
+
userCoordinates: resolvedPayload.userCoordinates,
|
|
61
|
+
routeColor: '#0EA5E9',
|
|
62
|
+
}),
|
|
63
|
+
}}
|
|
64
|
+
style={styles.mapViewport}
|
|
65
|
+
originWhitelist={['*']}
|
|
66
|
+
javaScriptEnabled
|
|
67
|
+
domStorageEnabled
|
|
68
|
+
/>
|
|
69
|
+
</View>
|
|
70
|
+
);
|
|
71
|
+
}
|