@controleonline/ui-default 1.0.269 → 1.0.270
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/package.json +1 -1
- package/src/react/components/map/DefaultGoogleMap.styles.js +9 -2
- package/src/react/components/map/DefaultGoogleMap.web.js +49 -28
- package/src/react/components/table/DefaultDebug.js +1 -1
- package/src/react/components/table/DefaultTable.js +2 -2
- package/src/tests/react/components/table/DefaultTable.test.js +1 -0
package/package.json
CHANGED
|
@@ -38,8 +38,8 @@ export default StyleSheet.create({
|
|
|
38
38
|
},
|
|
39
39
|
popupLogoWrap: {
|
|
40
40
|
width: 58,
|
|
41
|
-
height:
|
|
42
|
-
borderRadius:
|
|
41
|
+
height: 54,
|
|
42
|
+
borderRadius: 10,
|
|
43
43
|
overflow: 'hidden',
|
|
44
44
|
borderWidth: 1,
|
|
45
45
|
alignItems: 'center',
|
|
@@ -52,6 +52,13 @@ export default StyleSheet.create({
|
|
|
52
52
|
width: '100%',
|
|
53
53
|
height: '100%',
|
|
54
54
|
},
|
|
55
|
+
popupLogoFallback: {
|
|
56
|
+
fontSize: 24,
|
|
57
|
+
lineHeight: 26,
|
|
58
|
+
fontWeight: '900',
|
|
59
|
+
letterSpacing: 0.04,
|
|
60
|
+
textTransform: 'uppercase',
|
|
61
|
+
},
|
|
55
62
|
popupTitleWrap: {
|
|
56
63
|
flex: 1,
|
|
57
64
|
minWidth: 0,
|
|
@@ -110,8 +110,20 @@ const extractCoordinates = address => {
|
|
|
110
110
|
return {latitude, longitude};
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
const buildPopupTitle = item =>
|
|
114
|
-
item?.unitAlias || item?.alias || item?.companyName || item?.title || 'Unidade';
|
|
113
|
+
const buildPopupTitle = item =>
|
|
114
|
+
item?.unitAlias || item?.alias || item?.companyName || item?.title || 'Unidade';
|
|
115
|
+
|
|
116
|
+
const buildLogoFallback = item => {
|
|
117
|
+
const title = buildPopupTitle(item);
|
|
118
|
+
|
|
119
|
+
return String(title || 'CO')
|
|
120
|
+
.trim()
|
|
121
|
+
.split(/\s+/)
|
|
122
|
+
.slice(0, 2)
|
|
123
|
+
.map(chunk => chunk[0] || '')
|
|
124
|
+
.join('')
|
|
125
|
+
.toUpperCase();
|
|
126
|
+
};
|
|
115
127
|
|
|
116
128
|
const loadGoogleMapsApi = apiKey => {
|
|
117
129
|
if (Platform.OS !== 'web' || typeof window === 'undefined') {
|
|
@@ -654,11 +666,12 @@ export default function DefaultGoogleMap({
|
|
|
654
666
|
return null;
|
|
655
667
|
}
|
|
656
668
|
|
|
657
|
-
const selectedTitle = buildPopupTitle(selectedMarker);
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
669
|
+
const selectedTitle = buildPopupTitle(selectedMarker);
|
|
670
|
+
const selectedLogoFallback = buildLogoFallback(selectedMarker);
|
|
671
|
+
const selectedTravelSummary = buildPopupTravelSummaryText(
|
|
672
|
+
selectedMarker,
|
|
673
|
+
selectedRouteSummary,
|
|
674
|
+
);
|
|
662
675
|
const selectedNavigationPosition = selectedMarker
|
|
663
676
|
? {
|
|
664
677
|
latitude: Number(selectedMarker.latitude),
|
|
@@ -688,19 +701,27 @@ export default function DefaultGoogleMap({
|
|
|
688
701
|
},
|
|
689
702
|
]}>
|
|
690
703
|
<View style={styles.popupHeaderRow}>
|
|
691
|
-
<View
|
|
692
|
-
style={[
|
|
693
|
-
styles.popupLogoWrap,
|
|
694
|
-
{borderColor: resolvedPopupTheme.dividerBorder},
|
|
695
|
-
]}>
|
|
696
|
-
{selectedMarker.companyLogoUrl ? (
|
|
697
|
-
<Image
|
|
698
|
-
source={{uri: selectedMarker.companyLogoUrl}}
|
|
699
|
-
style={styles.popupLogoImage}
|
|
700
|
-
resizeMode="cover"
|
|
701
|
-
/>
|
|
702
|
-
) :
|
|
703
|
-
|
|
704
|
+
<View
|
|
705
|
+
style={[
|
|
706
|
+
styles.popupLogoWrap,
|
|
707
|
+
{borderColor: resolvedPopupTheme.dividerBorder},
|
|
708
|
+
]}>
|
|
709
|
+
{selectedMarker.companyLogoUrl ? (
|
|
710
|
+
<Image
|
|
711
|
+
source={{uri: selectedMarker.companyLogoUrl}}
|
|
712
|
+
style={styles.popupLogoImage}
|
|
713
|
+
resizeMode="cover"
|
|
714
|
+
/>
|
|
715
|
+
) : (
|
|
716
|
+
<Text
|
|
717
|
+
style={[
|
|
718
|
+
styles.popupLogoFallback,
|
|
719
|
+
{color: resolvedPopupTheme.buttonBackground},
|
|
720
|
+
]}>
|
|
721
|
+
{selectedLogoFallback}
|
|
722
|
+
</Text>
|
|
723
|
+
)}
|
|
724
|
+
</View>
|
|
704
725
|
<View style={styles.popupTitleWrap}>
|
|
705
726
|
<Text
|
|
706
727
|
numberOfLines={1}
|
|
@@ -780,14 +801,14 @@ export default function DefaultGoogleMap({
|
|
|
780
801
|
styles.popupActionButton,
|
|
781
802
|
{backgroundColor: resolvedPopupTheme.buttonBackground},
|
|
782
803
|
]}>
|
|
783
|
-
<Text
|
|
784
|
-
style={[
|
|
785
|
-
styles.popupActionText,
|
|
786
|
-
{color: resolvedPopupTheme.buttonText},
|
|
787
|
-
]}>
|
|
788
|
-
Abrir no Maps
|
|
789
|
-
</Text>
|
|
790
|
-
</TouchableOpacity>
|
|
804
|
+
<Text
|
|
805
|
+
style={[
|
|
806
|
+
styles.popupActionText,
|
|
807
|
+
{color: resolvedPopupTheme.buttonText},
|
|
808
|
+
]}>
|
|
809
|
+
Abrir no Maps
|
|
810
|
+
</Text>
|
|
811
|
+
</TouchableOpacity>
|
|
791
812
|
<TouchableOpacity
|
|
792
813
|
activeOpacity={0.85}
|
|
793
814
|
onPress={() => openExternalUrl(selectedWazeUrl)}
|
|
@@ -70,7 +70,7 @@ const DefaultDebug = ({
|
|
|
70
70
|
const [isOpen, setIsOpen] = useState(false);
|
|
71
71
|
const store = useStore(storeName);
|
|
72
72
|
const configs = store?.getters?.configs || {};
|
|
73
|
-
const { showError, showSuccess } = useMessage();
|
|
73
|
+
const { showError, showSuccess } = useMessage() || {};
|
|
74
74
|
const { modalColors, resolvedAccentColor, tableButtonColors } = useDefaultTableTheme();
|
|
75
75
|
|
|
76
76
|
const resolvedDebug = isObject(store?.getters?.debug) ? store.getters.debug : {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
2
|
import { TouchableOpacity, View, useWindowDimensions } from 'react-native';
|
|
3
|
-
import {
|
|
3
|
+
import { NavigationRouteContext, useIsFocused } from '@react-navigation/native';
|
|
4
4
|
import { useStore } from '@store';
|
|
5
5
|
import { useMessage } from '@controleonline/ui-common/src/react/components/MessageService';
|
|
6
6
|
import Icon from 'react-native-vector-icons/Feather';
|
|
@@ -92,7 +92,7 @@ const DefaultTable = ({
|
|
|
92
92
|
visibleColumnsPreferenceKey = '',
|
|
93
93
|
}) => {
|
|
94
94
|
const { width } = useWindowDimensions();
|
|
95
|
-
const route =
|
|
95
|
+
const route = React.useContext(NavigationRouteContext);
|
|
96
96
|
const store = useStore(storeName);
|
|
97
97
|
const isFocused = useIsFocused();
|
|
98
98
|
const configsSignatureRef = useRef('');
|