datastake-daf 0.6.264 β 0.6.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/.env +8 -0
- package/.vscode/settings.json +13 -0
- package/dist/components/index.js +64 -117
- package/package.json +2 -2
- package/src/@daf/core/components/Dashboard/Globe/Globe.stories.js +5 -30
- package/src/@daf/core/components/Dashboard/Globe/hook.js +7 -63
- package/src/@daf/core/components/Dashboard/Globe/index.jsx +6 -24
- package/src/@daf/core/components/Dashboard/Map/helper.js +7 -0
- package/src/@daf/core/components/Dashboard/Map/hook.js +2 -0
- package/src/@daf/core/components/Dashboard/Map/index.jsx +159 -165
- package/src/@daf/core/components/Dashboard/Map/storyConfig3.js +6 -0
- package/src/@daf/core/components/EditForm/form.jsx +621 -551
- package/src/@daf/core/components/EditForm/storyConfig2.js +28 -33
- package/src/@daf/core/components/Dashboard/Globe/storyConfig.js +0 -243
- package/src/@daf/core/components/Dashboard/Globe/storyConfig1.js +0 -354
|
@@ -48,30 +48,15 @@ export const useGlobe = ({
|
|
|
48
48
|
const isMounted = useRef(true);
|
|
49
49
|
|
|
50
50
|
const addAllDataToMap = useCallback(() => {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
console.log('π [GLOBE HOOK] mapRef exists:', !!mapRef);
|
|
54
|
-
console.log('π [GLOBE HOOK] style loaded:', mapRef?.isStyleLoaded());
|
|
55
|
-
|
|
56
|
-
if (!data || !mapRef) {
|
|
57
|
-
console.log('β [GLOBE HOOK] addAllDataToMap early return - missing data or mapRef');
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
if (!mapRef.isStyleLoaded()) {
|
|
62
|
-
console.log('β³ [GLOBE HOOK] Style not loaded yet, retrying in 100ms...');
|
|
63
|
-
setTimeout(() => {
|
|
64
|
-
addAllDataToMap();
|
|
65
|
-
}, 100);
|
|
51
|
+
|
|
52
|
+
if (!data || !mapRef || !mapRef.isStyleLoaded()) {
|
|
66
53
|
return;
|
|
67
54
|
}
|
|
68
55
|
|
|
56
|
+
// Prevent multiple calls with empty data
|
|
69
57
|
if (data.length === 0) {
|
|
70
|
-
console.log('β [GLOBE HOOK] addAllDataToMap early return - no data');
|
|
71
58
|
return;
|
|
72
59
|
}
|
|
73
|
-
|
|
74
|
-
console.log('β
[GLOBE HOOK] Starting to add markers to map...');
|
|
75
60
|
|
|
76
61
|
// Clear existing markers using functional update to avoid dependency issues
|
|
77
62
|
setMapMarkers(currentMarkers => {
|
|
@@ -123,14 +108,8 @@ export const useGlobe = ({
|
|
|
123
108
|
const newMarkers = [];
|
|
124
109
|
const maxTotal = Math.max(...(data || []).map((d) => d.total || 0));
|
|
125
110
|
|
|
126
|
-
console.log('π― [GLOBE HOOK] Processing data items:', data.length);
|
|
127
111
|
data.forEach((d, i) => {
|
|
128
|
-
console.log(`π― [GLOBE HOOK] Processing item ${i}:`, d);
|
|
129
|
-
console.log(`π― [GLOBE HOOK] Item ${i} marker:`, d?.marker);
|
|
130
|
-
console.log(`π― [GLOBE HOOK] Item ${i} lat/lng:`, d?.marker?.lat, d?.marker?.lng);
|
|
131
|
-
|
|
132
112
|
if (d?.marker?.lat && d?.marker?.lng) {
|
|
133
|
-
console.log(`β
[GLOBE HOOK] Item ${i} has valid coordinates, creating marker...`);
|
|
134
113
|
let marker;
|
|
135
114
|
let iconClassName = "";
|
|
136
115
|
let innerHtml = "";
|
|
@@ -233,8 +212,6 @@ export const useGlobe = ({
|
|
|
233
212
|
.setLngLat([d.marker.lng, d.marker.lat])
|
|
234
213
|
.setPopup(new mapboxgl.Popup().setDOMContent(div))
|
|
235
214
|
.addTo(mapRef);
|
|
236
|
-
|
|
237
|
-
console.log(`π [GLOBE HOOK] Marker ${i} added to map at:`, [d.marker.lng, d.marker.lat]);
|
|
238
215
|
|
|
239
216
|
} else if (type === "territory") {
|
|
240
217
|
// Handle territory polygons
|
|
@@ -320,8 +297,6 @@ export const useGlobe = ({
|
|
|
320
297
|
.setLngLat([d.marker.lng, d.marker.lat])
|
|
321
298
|
.setPopup(new mapboxgl.Popup().setDOMContent(div))
|
|
322
299
|
.addTo(mapRef);
|
|
323
|
-
|
|
324
|
-
console.log(`π [GLOBE HOOK] Default marker ${i} added to map at:`, [d.marker.lng, d.marker.lat]);
|
|
325
300
|
}
|
|
326
301
|
|
|
327
302
|
// Add click handler
|
|
@@ -355,7 +330,6 @@ export const useGlobe = ({
|
|
|
355
330
|
mapboxgl.accessToken = MAP_TOKEN;
|
|
356
331
|
|
|
357
332
|
// Create the map with Mapbox GL JS - 3D globe
|
|
358
|
-
console.log('πΊοΈ [GLOBE HOOK] Creating map with style:', STYLE_URL);
|
|
359
333
|
const map = new mapboxgl.Map({
|
|
360
334
|
container: container.current,
|
|
361
335
|
style: STYLE_URL,
|
|
@@ -374,13 +348,9 @@ export const useGlobe = ({
|
|
|
374
348
|
|
|
375
349
|
// Configure the map when style loads
|
|
376
350
|
map.on('style.load', () => {
|
|
377
|
-
console.log('π¨ [GLOBE HOOK] Style loaded event triggered');
|
|
378
|
-
console.log('π¨ [GLOBE HOOK] Map style loaded:', map.isStyleLoaded());
|
|
379
351
|
|
|
380
352
|
// Wait a bit for the style to fully load
|
|
381
353
|
setTimeout(() => {
|
|
382
|
-
console.log('π¨ [GLOBE HOOK] After timeout - Map style loaded:', map.isStyleLoaded());
|
|
383
|
-
|
|
384
354
|
// Set fog for the space background effect with stars - simplified to avoid errors
|
|
385
355
|
try {
|
|
386
356
|
map.setFog({
|
|
@@ -475,10 +445,9 @@ export const useGlobe = ({
|
|
|
475
445
|
// Add navigation controls
|
|
476
446
|
map.addControl(new mapboxgl.NavigationControl(), 'top-right');
|
|
477
447
|
|
|
478
|
-
console.log('πΊοΈ [GLOBE HOOK] Map created successfully');
|
|
479
448
|
return map;
|
|
480
449
|
} catch (error) {
|
|
481
|
-
console.error('
|
|
450
|
+
console.error('Error creating Mapbox GL JS globe:', error);
|
|
482
451
|
return null;
|
|
483
452
|
}
|
|
484
453
|
}, []);
|
|
@@ -491,13 +460,10 @@ export const useGlobe = ({
|
|
|
491
460
|
// }, [initialMarkerSetIsDone]);
|
|
492
461
|
|
|
493
462
|
useEffect(() => {
|
|
494
|
-
console.log('π [GLOBE HOOK] useEffect for map creation - mapRef:', !!mapRef);
|
|
495
463
|
|
|
496
464
|
if (!mapRef) {
|
|
497
|
-
console.log('π [GLOBE HOOK] Creating map instance...');
|
|
498
465
|
const instance = createInstance();
|
|
499
466
|
if (instance) {
|
|
500
|
-
console.log('π [GLOBE HOOK] Map instance created, setting mapRef');
|
|
501
467
|
setMapRef(instance);
|
|
502
468
|
|
|
503
469
|
// Add comprehensive resize detection for Mapbox GL JS responsiveness
|
|
@@ -586,24 +552,15 @@ export const useGlobe = ({
|
|
|
586
552
|
}, [polygon, mapRef]);
|
|
587
553
|
|
|
588
554
|
useEffect(() => {
|
|
589
|
-
|
|
590
|
-
console.log('π₯ [GLOBE HOOK] allData length:', allData?.length);
|
|
591
|
-
|
|
555
|
+
|
|
592
556
|
if (allData) {
|
|
593
557
|
if (allData.length === 0) {
|
|
594
|
-
console.log('β οΈ [GLOBE HOOK] Empty data array');
|
|
595
558
|
setEmptyStateIsVisible(true);
|
|
596
559
|
} else if (emptyStateIsVisible) {
|
|
597
560
|
setEmptyStateIsVisible(false);
|
|
598
561
|
}
|
|
599
|
-
|
|
600
|
-
console.log('π [GLOBE HOOK] Filtering data with filterValidGPS...');
|
|
601
|
-
const filteredData = filterValidGPS(allData);
|
|
602
|
-
console.log('π [GLOBE HOOK] filtered data result:', filteredData);
|
|
603
|
-
console.log('π [GLOBE HOOK] filtered data length:', filteredData.length);
|
|
604
|
-
setData(filteredData);
|
|
562
|
+
setData(filterValidGPS(allData));
|
|
605
563
|
} else {
|
|
606
|
-
console.log('β [GLOBE HOOK] No allData provided');
|
|
607
564
|
setData(null);
|
|
608
565
|
}
|
|
609
566
|
}, [allData, emptyStateIsVisible]);
|
|
@@ -634,20 +591,7 @@ export const useGlobe = ({
|
|
|
634
591
|
}, [user, mapRef, allData]);
|
|
635
592
|
|
|
636
593
|
useEffect(() => {
|
|
637
|
-
|
|
638
|
-
mapRef: !!mapRef,
|
|
639
|
-
data: !!data,
|
|
640
|
-
dataLength: data?.length,
|
|
641
|
-
initialMarkerSetIsDone,
|
|
642
|
-
styleLoaded: mapRef?.isStyleLoaded()
|
|
643
|
-
});
|
|
644
|
-
|
|
645
|
-
if (mapRef && data && !initialMarkerSetIsDone) {
|
|
646
|
-
console.log('π [GLOBE HOOK] Attempting to add markers...');
|
|
647
|
-
console.log('π [GLOBE HOOK] Style loaded check:', mapRef.isStyleLoaded());
|
|
648
|
-
|
|
649
|
-
// Try to add markers immediately, and if style isn't loaded,
|
|
650
|
-
// the addAllDataToMap function will handle it
|
|
594
|
+
if (mapRef && data && !initialMarkerSetIsDone && mapRef.isStyleLoaded()) {
|
|
651
595
|
setInitialMarkerSetIsDone(true);
|
|
652
596
|
addAllDataToMap();
|
|
653
597
|
}
|
|
@@ -111,7 +111,7 @@ function Globe({
|
|
|
111
111
|
renderSider = null,
|
|
112
112
|
renderMarker = null,
|
|
113
113
|
type = "default",
|
|
114
|
-
showSider =
|
|
114
|
+
showSider = true,
|
|
115
115
|
filtersConfig,
|
|
116
116
|
onFilterChange = () => { },
|
|
117
117
|
isSatellite = false,
|
|
@@ -122,29 +122,11 @@ function Globe({
|
|
|
122
122
|
}) {
|
|
123
123
|
// Map data to include marker coordinates
|
|
124
124
|
const mappedData = useMemo(
|
|
125
|
-
() =>
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
console.log('β [GLOBE COMPONENT] No data to map');
|
|
131
|
-
return [];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const mapped = data.map((d, i) => {
|
|
135
|
-
console.log(`π [GLOBE COMPONENT] Mapping item ${i}:`, d);
|
|
136
|
-
console.log(`π [GLOBE COMPONENT] Item ${i} GPS:`, d?.gps);
|
|
137
|
-
const result = {
|
|
138
|
-
...d,
|
|
139
|
-
marker: { lat: d?.gps?.latitude, lng: d?.gps?.longitude },
|
|
140
|
-
};
|
|
141
|
-
console.log(`π [GLOBE COMPONENT] Item ${i} mapped result:`, result);
|
|
142
|
-
return result;
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
console.log('π [GLOBE COMPONENT] Final mapped data:', mapped);
|
|
146
|
-
return mapped;
|
|
147
|
-
},
|
|
125
|
+
() =>
|
|
126
|
+
data.map((d) => ({
|
|
127
|
+
...d,
|
|
128
|
+
marker: { lat: d?.gps?.latitude, lng: d?.gps?.longitude },
|
|
129
|
+
})),
|
|
148
130
|
[data],
|
|
149
131
|
);
|
|
150
132
|
|
|
@@ -20,6 +20,7 @@ export function useMapHelper({
|
|
|
20
20
|
mapCenter,
|
|
21
21
|
allData,
|
|
22
22
|
renderTooltip,
|
|
23
|
+
renderTooltipTags,
|
|
23
24
|
onClickLink,
|
|
24
25
|
link,
|
|
25
26
|
tooltipAsText,
|
|
@@ -158,6 +159,7 @@ export function useMapHelper({
|
|
|
158
159
|
title: data.name,
|
|
159
160
|
subTitle: data.type,
|
|
160
161
|
items: renderTooltip({ ...data, totals }),
|
|
162
|
+
tags: renderTooltipTags(data),
|
|
161
163
|
link,
|
|
162
164
|
total: data.sources,
|
|
163
165
|
onClickLink: () => onClickLink(data),
|
|
@@ -194,6 +196,7 @@ export function useMapHelper({
|
|
|
194
196
|
{renderTooltipHtml({
|
|
195
197
|
title: data.name,
|
|
196
198
|
items: renderTooltip(data),
|
|
199
|
+
tags: renderTooltipTags(data),
|
|
197
200
|
link,
|
|
198
201
|
total: data.sources,
|
|
199
202
|
onClickLink: () => onClickLink(data),
|
|
@@ -230,6 +233,7 @@ export function useMapHelper({
|
|
|
230
233
|
data={data}
|
|
231
234
|
title={data.name}
|
|
232
235
|
renderTooltip={renderTooltip}
|
|
236
|
+
renderTooltipTags={renderTooltipTags}
|
|
233
237
|
link={link}
|
|
234
238
|
onClickLink={onClickLink}
|
|
235
239
|
activeStakeholder={activeStakeholder}
|
|
@@ -270,6 +274,7 @@ export function useMapHelper({
|
|
|
270
274
|
link,
|
|
271
275
|
onClickLink: () => onClickLink(data),
|
|
272
276
|
items: renderTooltip(data),
|
|
277
|
+
tags: renderTooltipTags(data),
|
|
273
278
|
})}
|
|
274
279
|
</>,
|
|
275
280
|
);
|
|
@@ -336,6 +341,7 @@ export function useMapHelper({
|
|
|
336
341
|
link,
|
|
337
342
|
onClickLink: () => onClickLink(data),
|
|
338
343
|
items: renderTooltip(data),
|
|
344
|
+
tags: renderTooltipTags(data),
|
|
339
345
|
})}
|
|
340
346
|
</>,
|
|
341
347
|
);
|
|
@@ -370,6 +376,7 @@ export function useMapHelper({
|
|
|
370
376
|
[
|
|
371
377
|
mapRef,
|
|
372
378
|
renderTooltip,
|
|
379
|
+
renderTooltipTags,
|
|
373
380
|
tooltipAsText,
|
|
374
381
|
onClickLink,
|
|
375
382
|
zoom,
|
|
@@ -18,6 +18,7 @@ export const useMap = ({
|
|
|
18
18
|
polygon,
|
|
19
19
|
app,
|
|
20
20
|
renderTooltip,
|
|
21
|
+
renderTooltipTags,
|
|
21
22
|
mapConfig,
|
|
22
23
|
tooltipAsText,
|
|
23
24
|
renderMarker,
|
|
@@ -136,6 +137,7 @@ export const useMap = ({
|
|
|
136
137
|
allData,
|
|
137
138
|
mapCenter,
|
|
138
139
|
renderTooltip,
|
|
140
|
+
renderTooltipTags,
|
|
139
141
|
onClickLink,
|
|
140
142
|
link,
|
|
141
143
|
tooltipAsText,
|
|
@@ -92,180 +92,174 @@ import Filters from "../../Filters/FloatingFilters/index.js";
|
|
|
92
92
|
*/
|
|
93
93
|
|
|
94
94
|
function Map({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
95
|
+
isPdf = false,
|
|
96
|
+
data = [],
|
|
97
|
+
user = null,
|
|
98
|
+
app = "sbg",
|
|
99
|
+
polygon = null,
|
|
100
|
+
t = (s) => s,
|
|
101
|
+
onClickLink = () => {},
|
|
102
|
+
link,
|
|
103
|
+
siderTitle = "Mine Description",
|
|
104
|
+
renderTooltip = () => [],
|
|
105
|
+
renderTooltipTags = () => {},
|
|
106
|
+
mapConfig = {},
|
|
107
|
+
emptyDescriptionText = "No description provided",
|
|
108
|
+
tooltipAsText = false,
|
|
109
|
+
primaryLink = false,
|
|
110
|
+
renderSider = null,
|
|
111
|
+
renderMarker = null,
|
|
112
|
+
type = "default",
|
|
113
|
+
showSider = true,
|
|
114
|
+
filtersConfig,
|
|
115
|
+
onFilterChange = () => {},
|
|
116
|
+
isSatellite = false,
|
|
117
|
+
nameAsSiderTitle = false,
|
|
117
118
|
}) {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
// Map data to include marker coordinates
|
|
120
|
+
const mappedData = useMemo(
|
|
121
|
+
() =>
|
|
122
|
+
data.map((d) => ({
|
|
123
|
+
...d,
|
|
124
|
+
marker: { lat: d?.gps?.latitude, lng: d?.gps?.longitude },
|
|
125
|
+
})),
|
|
126
|
+
[data],
|
|
127
|
+
);
|
|
127
128
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
// Use custom hook to configure map functionality
|
|
130
|
+
const { container, activeMarker, mapOptionsButtonsConfig } = useMap({
|
|
131
|
+
data: mappedData,
|
|
132
|
+
user,
|
|
133
|
+
polygon,
|
|
134
|
+
t,
|
|
135
|
+
app,
|
|
136
|
+
renderTooltip,
|
|
137
|
+
renderTooltipTags,
|
|
138
|
+
onClickLink,
|
|
139
|
+
link,
|
|
140
|
+
mapConfig,
|
|
141
|
+
tooltipAsText,
|
|
142
|
+
renderMarker,
|
|
143
|
+
type,
|
|
144
|
+
isSatellite,
|
|
145
|
+
});
|
|
144
146
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<Filters
|
|
152
|
-
t={t}
|
|
153
|
-
filtersConfig={filtersConfig}
|
|
154
|
-
onFilterChange={onFilterChange}
|
|
155
|
-
/>
|
|
156
|
-
) : null}
|
|
147
|
+
return (
|
|
148
|
+
<ComponentWithFocus>
|
|
149
|
+
<Style className={formatClassname([showSider && activeMarker && "with-sider"])}>
|
|
150
|
+
{filtersConfig ? (
|
|
151
|
+
<Filters t={t} filtersConfig={filtersConfig} onFilterChange={onFilterChange} />
|
|
152
|
+
) : null}
|
|
157
153
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
</div>
|
|
197
|
-
</div>
|
|
154
|
+
{/* Map container */}
|
|
155
|
+
<div
|
|
156
|
+
id="map"
|
|
157
|
+
className={tooltipAsText ? "tooltip-text" : "tooltip-daf"}
|
|
158
|
+
ref={container}
|
|
159
|
+
/>
|
|
160
|
+
{/* Control buttons */}
|
|
161
|
+
{isPdf ? null : (
|
|
162
|
+
<div className="map-control-buttons">
|
|
163
|
+
{mapOptionsButtonsConfig.map((c, i) => (
|
|
164
|
+
<button onClick={c.handler} key={i.toString()}>
|
|
165
|
+
{c.icon}
|
|
166
|
+
</button>
|
|
167
|
+
))}
|
|
168
|
+
</div>
|
|
169
|
+
)}
|
|
170
|
+
{/* Sidebar for active marker */}
|
|
171
|
+
{activeMarker && showSider ? (
|
|
172
|
+
<div className="sider">
|
|
173
|
+
<div className="sider-header flex">
|
|
174
|
+
<div className="flex flex-column justify-center">
|
|
175
|
+
<h2>{nameAsSiderTitle ? activeMarker.data.name : t(siderTitle)}</h2>
|
|
176
|
+
</div>
|
|
177
|
+
<div className="flex flex-column justify-center">
|
|
178
|
+
<Button
|
|
179
|
+
type={primaryLink ? "primary" : "default"}
|
|
180
|
+
size="sm"
|
|
181
|
+
onClick={() => onClickLink(activeMarker.data)}
|
|
182
|
+
>
|
|
183
|
+
<CustomIcon
|
|
184
|
+
name="ArrowUpRight"
|
|
185
|
+
width={20}
|
|
186
|
+
height={20}
|
|
187
|
+
color={primaryLink ? "white" : "#6C737F"}
|
|
188
|
+
/>
|
|
189
|
+
</Button>
|
|
190
|
+
</div>
|
|
191
|
+
</div>
|
|
198
192
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
193
|
+
{/* Render custom sider or default content */}
|
|
194
|
+
{typeof renderSider === "function" ? (
|
|
195
|
+
<div className="sider-body">{renderSider(activeMarker)}</div>
|
|
196
|
+
) : (
|
|
197
|
+
<div className="sider-body">
|
|
198
|
+
{/* Documents Carousel */}
|
|
199
|
+
{activeMarker?.data?.documents?.length ? (
|
|
200
|
+
<Carousel className="carousel">
|
|
201
|
+
{activeMarker.data.documents.map((v, i) => (
|
|
202
|
+
<div key={i}>
|
|
203
|
+
<Image height={169} width="100%" src={v.url} />
|
|
204
|
+
</div>
|
|
205
|
+
))}
|
|
206
|
+
</Carousel>
|
|
207
|
+
) : (
|
|
208
|
+
<div className="placeholder flex justify-center">
|
|
209
|
+
<div className="flex flex-column justify-center">
|
|
210
|
+
<svg
|
|
211
|
+
width="106"
|
|
212
|
+
height="94"
|
|
213
|
+
viewBox="0 0 106 94"
|
|
214
|
+
fill="none"
|
|
215
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
216
|
+
>
|
|
217
|
+
<path
|
|
218
|
+
d="M88.0001 92.165H93.0519C97.9078 92.165 100.336 92.165 101.674 91.1525C102.84 90.2705 103.561 88.9224 103.649 87.463C103.749 85.7878 102.402 83.7676 99.7083 79.7274L84.6565 57.1496C82.4309 53.8111 81.318 52.1419 79.9154 51.5603C78.6892 51.0517 77.311 51.0517 76.0847 51.5603C74.6821 52.1419 73.5693 53.8111 71.3437 57.1496L67.6227 62.731M88.0001 92.165L49.5776 36.6659C47.3679 33.4741 46.2631 31.8782 44.883 31.3172C43.6757 30.8264 42.3245 30.8264 41.1172 31.3172C39.7371 31.8782 38.6323 33.4741 36.4225 36.6659L6.69109 79.6113C3.87596 83.6776 2.46839 85.7108 2.54853 87.4017C2.61832 88.8743 3.33442 90.241 4.50545 91.1366C5.8501 92.165 8.32294 92.165 13.2686 92.165H88.0001ZM98.0001 17.165C98.0001 25.4492 91.2843 32.165 83.0001 32.165C74.7158 32.165 68.0001 25.4492 68.0001 17.165C68.0001 8.88071 74.7158 2.16498 83.0001 2.16498C91.2843 2.16498 98.0001 8.88071 98.0001 17.165Z"
|
|
219
|
+
stroke="#F3F4F6"
|
|
220
|
+
strokeWidth="3.5"
|
|
221
|
+
strokeLinecap="round"
|
|
222
|
+
strokeLinejoin="round"
|
|
223
|
+
/>
|
|
224
|
+
</svg>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
)}
|
|
234
228
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
229
|
+
<div className="p-cont">
|
|
230
|
+
<p className="mt-4">
|
|
231
|
+
{activeMarker?.data?.description || t(emptyDescriptionText)}
|
|
232
|
+
</p>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
)}
|
|
236
|
+
</div>
|
|
237
|
+
) : null}
|
|
238
|
+
</Style>
|
|
239
|
+
</ComponentWithFocus>
|
|
240
|
+
);
|
|
247
241
|
}
|
|
248
242
|
|
|
249
243
|
Map.propTypes = {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
244
|
+
data: PropTypes.object,
|
|
245
|
+
user: PropTypes.any,
|
|
246
|
+
app: PropTypes.string,
|
|
247
|
+
polygon: PropTypes.any,
|
|
248
|
+
t: PropTypes.func,
|
|
249
|
+
onClickLink: PropTypes.func,
|
|
250
|
+
siderTitle: PropTypes.string,
|
|
251
|
+
emptyDescriptionText: PropTypes.string,
|
|
252
|
+
isPdf: PropTypes.any,
|
|
253
|
+
mapConfig: PropTypes.any,
|
|
254
|
+
tooltipAsText: PropTypes.any,
|
|
255
|
+
primaryLink: PropTypes.any,
|
|
256
|
+
renderSider: PropTypes.any,
|
|
257
|
+
renderMarker: PropTypes.any,
|
|
258
|
+
type: PropTypes.any,
|
|
259
|
+
showSider: PropTypes.any,
|
|
260
|
+
filtersConfig: PropTypes.any,
|
|
261
|
+
onFilterChange: PropTypes.any,
|
|
262
|
+
nameAsSiderTitle: PropTypes.bool,
|
|
269
263
|
};
|
|
270
264
|
|
|
271
265
|
export default Map;
|