@dative-gpi/foundation-shared-components 1.0.146 → 1.0.147-maps
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/components/deviceOrganisations/FSWorstAlertCard.vue +1 -1
- package/components/map/FSMap.vue +47 -3
- package/components/map/FSMapLayerButton.vue +1 -0
- package/composables/useBreakpoints.ts +1 -1
- package/models/deviceAlerts.ts +1 -0
- package/package.json +4 -4
- package/styles/globals/scrollbars.scss +8 -10
- package/styles/globals/touchscreen.scss +2 -2
|
@@ -82,7 +82,7 @@ export default defineComponent({
|
|
|
82
82
|
|
|
83
83
|
const deviceTimestamp = computed((): string => {
|
|
84
84
|
if (props.deviceAlert.sourceTimestamp) {
|
|
85
|
-
return epochToLongTimeFormat(props.deviceAlert.
|
|
85
|
+
return epochToLongTimeFormat(props.deviceAlert.actualTimestamp);
|
|
86
86
|
}
|
|
87
87
|
return "";
|
|
88
88
|
});
|
package/components/map/FSMap.vue
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
<FSMapLayerButton
|
|
30
30
|
v-if="$props.allowedLayers?.length && $props.allowedLayers.length > 1"
|
|
31
|
+
:disabled="$props.disabled"
|
|
31
32
|
:layers="mapLayers.filter((layer) => $props.allowedLayers?.includes(layer.name) ?? true)"
|
|
32
33
|
:modelValue="$props.currentLayer"
|
|
33
34
|
@update:model-value="$emit('update:currentLayer', $event)"
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
>
|
|
40
41
|
<FSButton
|
|
41
42
|
v-if="$props.showMyLocation"
|
|
43
|
+
:disabled="$props.disabled"
|
|
42
44
|
icon="mdi-crosshairs-gps"
|
|
43
45
|
color="primary"
|
|
44
46
|
variant="full"
|
|
@@ -53,12 +55,14 @@
|
|
|
53
55
|
gap="0"
|
|
54
56
|
>
|
|
55
57
|
<FSButton
|
|
58
|
+
:disabled="$props.disabled"
|
|
56
59
|
class="fs-map-zoom-plus-button"
|
|
57
60
|
icon="mdi-plus"
|
|
58
61
|
@click="() => map!.zoomIn()"
|
|
59
62
|
:border="false"
|
|
60
63
|
/>
|
|
61
64
|
<FSButton
|
|
65
|
+
:disabled="$props.disabled"
|
|
62
66
|
class="fs-map-zoom-minus-button"
|
|
63
67
|
icon="mdi-minus"
|
|
64
68
|
@click="() => map!.zoomOut()"
|
|
@@ -130,6 +134,16 @@ export default defineComponent({
|
|
|
130
134
|
required: false,
|
|
131
135
|
default: '100%'
|
|
132
136
|
},
|
|
137
|
+
lockZoomOnFlyTo: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
required: false,
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
disabled: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
required: false,
|
|
145
|
+
default: false
|
|
146
|
+
},
|
|
133
147
|
grayscale: {
|
|
134
148
|
type: Boolean,
|
|
135
149
|
required: false,
|
|
@@ -353,14 +367,16 @@ export default defineComponent({
|
|
|
353
367
|
|
|
354
368
|
const mapOptions = {
|
|
355
369
|
zoomControl: false,
|
|
356
|
-
scrollWheelZoom: props.enableScrollWheelZoom,
|
|
370
|
+
scrollWheelZoom: props.enableScrollWheelZoom && !props.disabled,
|
|
371
|
+
dragging: !props.disabled,
|
|
372
|
+
doubleClickZoom: false,
|
|
357
373
|
minZoom: 2,
|
|
358
374
|
maxZoom: 22,
|
|
359
375
|
maxBounds: latLngBounds(latLng(-90, -180), latLng(90, 180)),
|
|
360
376
|
maxBoundsViscosity: 1.0,
|
|
361
377
|
zoom: defaultZoom.value,
|
|
362
378
|
center: props.center ? latLng(props.center[0], props.center[1]) : latLng(48.85782, 2.29521)
|
|
363
|
-
};
|
|
379
|
+
} satisfies L.MapOptions;
|
|
364
380
|
|
|
365
381
|
map.value = markRaw(createMap(leafletContainer.value, mapOptions));
|
|
366
382
|
|
|
@@ -396,7 +412,9 @@ export default defineComponent({
|
|
|
396
412
|
if(!map.value || !props.center) {
|
|
397
413
|
return;
|
|
398
414
|
}
|
|
399
|
-
|
|
415
|
+
const zoom = props.lockZoomOnFlyTo ? map.value.getZoom() : defaultZoom.value;
|
|
416
|
+
|
|
417
|
+
setView(props.center[0], props.center[1], zoom);
|
|
400
418
|
}, { immediate: true });
|
|
401
419
|
|
|
402
420
|
watch([() => props.bounds, () => map.value], () => {
|
|
@@ -413,6 +431,32 @@ export default defineComponent({
|
|
|
413
431
|
}
|
|
414
432
|
}, { immediate: true });
|
|
415
433
|
|
|
434
|
+
watch(() => props.enableScrollWheelZoom, (newValue) => {
|
|
435
|
+
if(!map.value) {
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
if(newValue) {
|
|
439
|
+
map.value.scrollWheelZoom.enable();
|
|
440
|
+
} else {
|
|
441
|
+
map.value.scrollWheelZoom.disable();
|
|
442
|
+
}
|
|
443
|
+
}, { immediate: true });
|
|
444
|
+
|
|
445
|
+
watch(() => props.disabled, (newValue) => {
|
|
446
|
+
if(!map.value) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if(newValue) {
|
|
450
|
+
map.value.dragging.disable();
|
|
451
|
+
map.value.scrollWheelZoom.disable();
|
|
452
|
+
} else {
|
|
453
|
+
map.value.dragging.enable();
|
|
454
|
+
if(props.enableScrollWheelZoom) {
|
|
455
|
+
map.value.scrollWheelZoom.enable();
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}, { immediate: true });
|
|
459
|
+
|
|
416
460
|
return {
|
|
417
461
|
ColorEnum,
|
|
418
462
|
defaultZoom,
|
|
@@ -21,7 +21,7 @@ export const useBreakpoints = () => {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
const isTouchScreenEnabled = computed((): boolean => {
|
|
24
|
-
return
|
|
24
|
+
return window.matchMedia('(hover: none), (pointer: coarse), (pointer: none)').matches;
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const isMobileSized = computed((): boolean => {
|
package/models/deviceAlerts.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.147-maps",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "1.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "1.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "1.0.147-maps",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.147-maps"
|
|
15
15
|
},
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@dative-gpi/bones-ui": "^1.0.0",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"sass": "1.71.1",
|
|
36
36
|
"sass-loader": "13.3.2"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "ae8bef1eca27c0f0c345f01c69bf851e12fec0df"
|
|
39
39
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
.fs-hide-x-scrollbar {
|
|
15
15
|
overflow-x: scroll !important;
|
|
16
16
|
|
|
17
|
+
// Styles pour WebKit (Chrome, Safari)
|
|
17
18
|
&::-webkit-scrollbar {
|
|
18
19
|
height: 8px;
|
|
19
20
|
}
|
|
@@ -25,11 +26,15 @@
|
|
|
25
26
|
&:hover {
|
|
26
27
|
--scrollbar-x-color: #00000022;
|
|
27
28
|
}
|
|
29
|
+
&:not(:hover) {
|
|
30
|
+
--scrollbar-y-color: #00000000;
|
|
31
|
+
}
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
.fs-hide-y-scrollbar {
|
|
31
35
|
overflow-y: scroll !important;
|
|
32
36
|
|
|
37
|
+
// Styles pour WebKit (Chrome, Safari)
|
|
33
38
|
&::-webkit-scrollbar {
|
|
34
39
|
width: 8px;
|
|
35
40
|
}
|
|
@@ -41,25 +46,18 @@
|
|
|
41
46
|
&:hover {
|
|
42
47
|
--scrollbar-y-color: #00000022;
|
|
43
48
|
}
|
|
49
|
+
&:not(:hover) {
|
|
50
|
+
--scrollbar-y-color: #00000000;
|
|
51
|
+
}
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
54
|
|
|
47
55
|
@include touchscreen {
|
|
48
56
|
.fs-hide-x-scrollbar {
|
|
49
57
|
overflow-x: scroll;
|
|
50
|
-
|
|
51
|
-
&::-webkit-scrollbar {
|
|
52
|
-
display: none;
|
|
53
|
-
}
|
|
54
|
-
scrollbar-width: none;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
60
|
.fs-hide-y-scrollbar {
|
|
58
61
|
overflow-y: scroll;
|
|
59
|
-
|
|
60
|
-
&::-webkit-scrollbar {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
63
|
-
scrollbar-width: none;
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
@mixin touchscreen {
|
|
2
|
-
@media (hover: none) {
|
|
2
|
+
@media (hover: none), (pointer: coarse), (pointer: none) {
|
|
3
3
|
@content;
|
|
4
4
|
}
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
@mixin clickscreen {
|
|
8
|
-
@media
|
|
8
|
+
@media (hover: hover), (pointer: fine) {
|
|
9
9
|
@content;
|
|
10
10
|
}
|
|
11
11
|
}
|