@dative-gpi/foundation-shared-components 1.0.136 → 1.0.137-maps1
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/FSCheckbox.vue +1 -0
- package/components/FSRadio.vue +1 -0
- package/components/FSSlider.vue +2 -1
- package/components/FSSwitch.vue +38 -44
- package/components/deviceOrganisations/FSStatusRichCard.vue +170 -0
- package/components/fields/FSBaseField.vue +1 -0
- package/components/fields/FSRichTextField.vue +2 -1
- package/components/map/FSMap.vue +16 -105
- package/components/map/FSMapMarker.vue +6 -6
- package/components/map/FSMapMarkerClusterGroup.vue +1 -1
- package/components/tiles/FSGroupTileUI.vue +14 -1
- package/models/map.ts +0 -10
- package/package.json +4 -4
- package/styles/components/fs_map.scss +37 -9
- package/styles/components/fs_status_rich_card.scss +13 -0
- package/styles/components/index.scss +1 -0
package/components/FSRadio.vue
CHANGED
package/components/FSSlider.vue
CHANGED
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
:elevation="0"
|
|
36
36
|
:tickSize="4"
|
|
37
37
|
:modelValue="$props.modelValue ?? undefined"
|
|
38
|
-
@update:modelValue="
|
|
38
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
39
39
|
v-bind="$attrs"
|
|
40
40
|
>
|
|
41
41
|
<template
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
v-if="$props.description"
|
|
56
56
|
class="fs-slider-description"
|
|
57
57
|
font="text-overline"
|
|
58
|
+
:lineClamp="2"
|
|
58
59
|
:style="style"
|
|
59
60
|
>
|
|
60
61
|
{{ $props.description }}
|
package/components/FSSwitch.vue
CHANGED
|
@@ -1,29 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
width="hug"
|
|
4
|
-
align="top-left"
|
|
5
|
-
gap="16px"
|
|
2
|
+
<FSCol
|
|
6
3
|
padding="8px 0px"
|
|
7
|
-
:wrap="false"
|
|
8
4
|
>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
>
|
|
5
|
+
<FSRow
|
|
6
|
+
gap="16px"
|
|
7
|
+
:wrap="false"
|
|
8
|
+
>
|
|
9
|
+
<v-switch
|
|
10
|
+
v-if="variant == 'left'"
|
|
11
|
+
class="fs-switch"
|
|
12
|
+
hide-details
|
|
13
|
+
inset
|
|
14
|
+
:validateOn="validateOn"
|
|
15
|
+
:rules="$props.rules"
|
|
16
|
+
:ripple="false"
|
|
17
|
+
:style="style"
|
|
18
|
+
:modelValue="$props.modelValue"
|
|
19
|
+
@update:modelValue="onToggle"
|
|
20
|
+
v-bind="$attrs"
|
|
21
|
+
/>
|
|
22
|
+
<FSCol>
|
|
27
23
|
<FSSpan
|
|
28
24
|
v-if="$props.label"
|
|
29
25
|
class="fs-switch-label"
|
|
@@ -41,33 +37,31 @@
|
|
|
41
37
|
class="fs-switch-description"
|
|
42
38
|
font="text-overline"
|
|
43
39
|
:style="style"
|
|
40
|
+
:lineClamp="2"
|
|
44
41
|
>
|
|
45
42
|
{{ $props.description }}
|
|
46
43
|
</FSSpan>
|
|
47
44
|
</slot>
|
|
48
|
-
<slot
|
|
49
|
-
name="footer"
|
|
50
|
-
/>
|
|
51
45
|
</FSCol>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
46
|
+
<FSRow
|
|
47
|
+
v-if="variant == 'right'"
|
|
48
|
+
align="center-right"
|
|
49
|
+
>
|
|
50
|
+
<v-switch
|
|
51
|
+
class="fs-switch"
|
|
52
|
+
hide-details
|
|
53
|
+
inset
|
|
54
|
+
:validateOn="validateOn"
|
|
55
|
+
:rules="$props.rules"
|
|
56
|
+
:ripple="false"
|
|
57
|
+
:style="style"
|
|
58
|
+
:modelValue="$props.modelValue"
|
|
59
|
+
@update:modelValue="onToggle"
|
|
60
|
+
v-bind="$attrs"
|
|
61
|
+
/>
|
|
62
|
+
</FSRow>
|
|
69
63
|
</FSRow>
|
|
70
|
-
</
|
|
64
|
+
</FSCol>
|
|
71
65
|
</template>
|
|
72
66
|
|
|
73
67
|
<script lang="ts">
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
v-if="$props.modelStatus"
|
|
4
|
+
class="fs-status-rich-card"
|
|
5
|
+
variant="standard"
|
|
6
|
+
:is="$attrs.onClick ? FSClickable : FSCard"
|
|
7
|
+
:padding="$props.padding"
|
|
8
|
+
:height="$props.height"
|
|
9
|
+
:width="$props.width"
|
|
10
|
+
:color="color"
|
|
11
|
+
:style="style"
|
|
12
|
+
>
|
|
13
|
+
<FSCol
|
|
14
|
+
align="center-center"
|
|
15
|
+
:gap="$props.gap"
|
|
16
|
+
>
|
|
17
|
+
<FSRow
|
|
18
|
+
align="top-center"
|
|
19
|
+
>
|
|
20
|
+
<FSIcon
|
|
21
|
+
v-if="icon"
|
|
22
|
+
>
|
|
23
|
+
{{ icon }}
|
|
24
|
+
</FSIcon>
|
|
25
|
+
<FSText
|
|
26
|
+
v-if="value"
|
|
27
|
+
font="text-button"
|
|
28
|
+
>
|
|
29
|
+
{{ value }}
|
|
30
|
+
</FSText>
|
|
31
|
+
</FSRow>
|
|
32
|
+
<FSText
|
|
33
|
+
font="text-overline"
|
|
34
|
+
align="center"
|
|
35
|
+
:lineClamp="$props.titleClamp"
|
|
36
|
+
>
|
|
37
|
+
{{ title }}
|
|
38
|
+
</FSText>
|
|
39
|
+
<slot
|
|
40
|
+
name="footer"
|
|
41
|
+
v-bind="{ color }"
|
|
42
|
+
/>
|
|
43
|
+
</FSCol>
|
|
44
|
+
<div
|
|
45
|
+
class="fs-status-rich-card-corner"
|
|
46
|
+
>
|
|
47
|
+
<slot
|
|
48
|
+
name="corner"
|
|
49
|
+
v-bind="{ color }"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</component>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts">
|
|
56
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
57
|
+
|
|
58
|
+
import { ColorEnum, type FSDeviceStatusGroup, type FSModelStatus } from "@dative-gpi/foundation-shared-components/models";
|
|
59
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
60
|
+
|
|
61
|
+
import FSClickable from "../FSClickable.vue";
|
|
62
|
+
import FSCard from "../FSCard.vue";
|
|
63
|
+
import FSIcon from "../FSChip.vue";
|
|
64
|
+
import FSText from "../FSText.vue";
|
|
65
|
+
import FSCol from "../FSCol.vue";
|
|
66
|
+
|
|
67
|
+
export default defineComponent({
|
|
68
|
+
name: "FSStatusRichCard",
|
|
69
|
+
components: {
|
|
70
|
+
FSClickable,
|
|
71
|
+
FSCard,
|
|
72
|
+
FSIcon,
|
|
73
|
+
FSText,
|
|
74
|
+
FSCol
|
|
75
|
+
},
|
|
76
|
+
props: {
|
|
77
|
+
height: {
|
|
78
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
79
|
+
required: false,
|
|
80
|
+
default: "100px"
|
|
81
|
+
},
|
|
82
|
+
width: {
|
|
83
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
84
|
+
required: false,
|
|
85
|
+
default: "160px"
|
|
86
|
+
},
|
|
87
|
+
padding: {
|
|
88
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
89
|
+
required: false,
|
|
90
|
+
default: "12px"
|
|
91
|
+
},
|
|
92
|
+
gap: {
|
|
93
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
94
|
+
required: false,
|
|
95
|
+
default: "8px"
|
|
96
|
+
},
|
|
97
|
+
title: {
|
|
98
|
+
type: [String, null] as PropType<string | null>,
|
|
99
|
+
required: false,
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
titleClamp: {
|
|
103
|
+
type: Number,
|
|
104
|
+
required: false,
|
|
105
|
+
default: 2
|
|
106
|
+
},
|
|
107
|
+
color: {
|
|
108
|
+
type: [String, null] as PropType<string | null>,
|
|
109
|
+
required: false,
|
|
110
|
+
default: null
|
|
111
|
+
},
|
|
112
|
+
fillBackground: {
|
|
113
|
+
type: Boolean,
|
|
114
|
+
required: false,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
modelStatus: {
|
|
118
|
+
type: Object as PropType<FSModelStatus | undefined>,
|
|
119
|
+
required: true
|
|
120
|
+
},
|
|
121
|
+
statusGroup: {
|
|
122
|
+
type: Object as PropType<FSDeviceStatusGroup | undefined>,
|
|
123
|
+
required: true
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
setup(props) {
|
|
127
|
+
const { getColors } = useColors();
|
|
128
|
+
|
|
129
|
+
const color = computed((): string => {
|
|
130
|
+
return props.color ?? props.statusGroup?.color ?? props.modelStatus?.colorDefault ?? ColorEnum.Primary;
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
const icon = computed((): string | null => {
|
|
134
|
+
return props.statusGroup?.icon ?? props.modelStatus?.iconDefault ?? null;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
const title = computed((): string => {
|
|
138
|
+
return props.title ?? props.modelStatus?.label;
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
const value = computed((): string | null => {
|
|
142
|
+
if (props.statusGroup?.label) {
|
|
143
|
+
return props.statusGroup.label;
|
|
144
|
+
}
|
|
145
|
+
if (props.statusGroup?.value && !isNaN(parseFloat(props.statusGroup?.value))) {
|
|
146
|
+
return `${parseFloat(props.statusGroup.value).toLocaleString("fullwide", { maximumFractionDigits: 2 })} ${props.statusGroup.unit}`;
|
|
147
|
+
}
|
|
148
|
+
if (props.statusGroup?.value) {
|
|
149
|
+
return `${props.statusGroup?.value} ${props.statusGroup?.unit}`;
|
|
150
|
+
}
|
|
151
|
+
return null;
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
const style = computed((): StyleValue => ({
|
|
155
|
+
"--fs-status-rich-card-background-color": props.fillBackground ? getColors(color.value).light : "transparent",
|
|
156
|
+
"--fs-status-rich-card-border-color": props.fillBackground ? getColors(color.value).base : getColors(ColorEnum.Light).dark
|
|
157
|
+
}));
|
|
158
|
+
|
|
159
|
+
return {
|
|
160
|
+
FSClickable,
|
|
161
|
+
FSCard,
|
|
162
|
+
color,
|
|
163
|
+
style,
|
|
164
|
+
title,
|
|
165
|
+
value,
|
|
166
|
+
icon
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
</script>
|
package/components/map/FSMap.vue
CHANGED
|
@@ -22,38 +22,7 @@
|
|
|
22
22
|
:color="ColorEnum.Primary"
|
|
23
23
|
:latlng="gpsPosition"
|
|
24
24
|
/>
|
|
25
|
-
|
|
26
|
-
<FSMapFeatureGroup
|
|
27
|
-
v-if="$props.areas"
|
|
28
|
-
:expected-layers="$props.areas.length"
|
|
29
|
-
@update:bounds="(bounds) => areaGroupBounds = bounds"
|
|
30
|
-
>
|
|
31
|
-
<FSMapPolygon
|
|
32
|
-
v-for="area in areas"
|
|
33
|
-
:key="area.id"
|
|
34
|
-
:color="area.color"
|
|
35
|
-
:latlngs="area.coordinates.map((coord) => ({lat: coord.latitude, lng: coord.longitude}))"
|
|
36
|
-
@click="$emit('update:selectedAreaId', area.id)"
|
|
37
|
-
/>
|
|
38
|
-
</FSMapFeatureGroup>
|
|
39
|
-
|
|
40
|
-
<FSMapMarkerClusterGroup
|
|
41
|
-
v-if="$props.locations"
|
|
42
|
-
:expected-layers="$props.locations.length"
|
|
43
|
-
:disableClusteringAtZoom="defaultZoom"
|
|
44
|
-
@update:bounds="(bounds) => locationGroupBounds = bounds"
|
|
45
|
-
>
|
|
46
|
-
<FSMapMarker
|
|
47
|
-
v-for="location in $props.locations"
|
|
48
|
-
:selected="location.id === $props.selectedLocationId"
|
|
49
|
-
:key="location.id"
|
|
50
|
-
:label="location.label"
|
|
51
|
-
:color="location.color ?? ColorEnum.Primary"
|
|
52
|
-
:icon="location.icon ?? 'mdi-map-marker'"
|
|
53
|
-
:latlng="{lat: location.address.latitude, lng: location.address.longitude}"
|
|
54
|
-
@click="$emit('update:selectedLocationId', location.id)"
|
|
55
|
-
/>
|
|
56
|
-
</FSMapMarkerClusterGroup>
|
|
25
|
+
<slot />
|
|
57
26
|
</template>
|
|
58
27
|
</div>
|
|
59
28
|
|
|
@@ -125,10 +94,9 @@ import type {} from "leaflet.markercluster";
|
|
|
125
94
|
import { map as createMap, control, tileLayer, latLngBounds, latLng, type LatLng, type FitBoundsOptions, type ZoomPanOptions, type LatLngBounds } from "leaflet";
|
|
126
95
|
|
|
127
96
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
128
|
-
import { type FSArea } from '@dative-gpi/foundation-shared-domain/models';
|
|
129
97
|
|
|
130
98
|
import { useBreakpoints, useColors, useSlots } from "../../composables";
|
|
131
|
-
import { ColorEnum, type
|
|
99
|
+
import { ColorEnum, type MapLayer } from "../../models";
|
|
132
100
|
|
|
133
101
|
import FSMapLayerButton from "./FSMapLayerButton.vue";
|
|
134
102
|
import FSMapOverlay from "./FSMapOverlay.vue";
|
|
@@ -138,19 +106,12 @@ import FSCol from "../FSCol.vue";
|
|
|
138
106
|
|
|
139
107
|
import FSMapMarker from "./FSMapMarker.vue";
|
|
140
108
|
import FSMapTileLayer from "./FSMapTileLayer.vue";
|
|
141
|
-
import FSMapFeatureGroup from "./FSMapFeatureGroup.vue";
|
|
142
|
-
import FSMapMarkerClusterGroup from "./FSMapMarkerClusterGroup.vue";
|
|
143
|
-
import FSMapPolygon from "./FSMapPolygon.vue";
|
|
144
109
|
|
|
145
110
|
export default defineComponent({
|
|
146
111
|
name: "FSMap",
|
|
147
112
|
components: {
|
|
148
113
|
FSMapMarker,
|
|
149
114
|
FSMapTileLayer,
|
|
150
|
-
FSMapFeatureGroup,
|
|
151
|
-
FSMapMarkerClusterGroup,
|
|
152
|
-
FSMapPolygon,
|
|
153
|
-
|
|
154
115
|
FSMapLayerButton,
|
|
155
116
|
FSMapOverlay,
|
|
156
117
|
FSButton,
|
|
@@ -194,19 +155,14 @@ export default defineComponent({
|
|
|
194
155
|
default: false
|
|
195
156
|
},
|
|
196
157
|
center: {
|
|
197
|
-
type: Array as PropType<number[]>,
|
|
158
|
+
type: Array as PropType<number[] | null>,
|
|
198
159
|
required: false,
|
|
199
|
-
default:
|
|
200
|
-
},
|
|
201
|
-
locations: {
|
|
202
|
-
type: Array as PropType<FSLocation[]>,
|
|
203
|
-
required: false,
|
|
204
|
-
default: () => [],
|
|
160
|
+
default: null
|
|
205
161
|
},
|
|
206
|
-
|
|
207
|
-
type:
|
|
162
|
+
bounds: {
|
|
163
|
+
type: Object as PropType<LatLngBounds | null>,
|
|
208
164
|
required: false,
|
|
209
|
-
default:
|
|
165
|
+
default: null
|
|
210
166
|
},
|
|
211
167
|
currentLayer: {
|
|
212
168
|
type: String as PropType<"map" | "imagery">,
|
|
@@ -217,16 +173,6 @@ export default defineComponent({
|
|
|
217
173
|
type: Array as PropType<string[]>,
|
|
218
174
|
required: false,
|
|
219
175
|
default: () => ["map", "imagery"]
|
|
220
|
-
},
|
|
221
|
-
selectedLocationId: {
|
|
222
|
-
type: String as PropType<string | null>,
|
|
223
|
-
required: false,
|
|
224
|
-
default: null
|
|
225
|
-
},
|
|
226
|
-
selectedAreaId: {
|
|
227
|
-
type: String as PropType<string | null>,
|
|
228
|
-
required: false,
|
|
229
|
-
default: null
|
|
230
176
|
}
|
|
231
177
|
},
|
|
232
178
|
emits: ["update:modelValue", "update:selectedLocationId", "update:selectedAreaId", 'update:overlayMode', 'update:currentLayer', "click:latlng"],
|
|
@@ -303,19 +249,6 @@ export default defineComponent({
|
|
|
303
249
|
return mapLayers.find((layer) => layer.name === props.currentLayer)?.layer ?? mapLayers[0].layer;
|
|
304
250
|
});
|
|
305
251
|
|
|
306
|
-
const bounds = computed<LatLngBounds | null>(() => {
|
|
307
|
-
if(!locationGroupBounds.value && !areaGroupBounds.value) {
|
|
308
|
-
return null;
|
|
309
|
-
}
|
|
310
|
-
let bounds = locationGroupBounds.value;
|
|
311
|
-
if(bounds && areaGroupBounds.value) {
|
|
312
|
-
bounds.extend(areaGroupBounds.value);
|
|
313
|
-
} else if(areaGroupBounds.value) {
|
|
314
|
-
bounds = areaGroupBounds.value;
|
|
315
|
-
}
|
|
316
|
-
return bounds as LatLngBounds;
|
|
317
|
-
});
|
|
318
|
-
|
|
319
252
|
const overlaySlots = computed(() => {
|
|
320
253
|
return Object.keys(slots).filter((slot) => slot.startsWith("overlay-")).reduce((acc, slot) => {
|
|
321
254
|
acc[slot.replace("overlay-", "")] = slots[slot];
|
|
@@ -394,11 +327,12 @@ export default defineComponent({
|
|
|
394
327
|
minZoom: 2,
|
|
395
328
|
maxZoom: 22,
|
|
396
329
|
maxBounds: latLngBounds(latLng(-90, -180), latLng(90, 180)),
|
|
397
|
-
maxBoundsViscosity: 1.0
|
|
330
|
+
maxBoundsViscosity: 1.0,
|
|
331
|
+
zoom: defaultZoom,
|
|
332
|
+
center: props.center ? latLng(props.center[0], props.center[1]) : latLng(48.85782, 2.29521)
|
|
398
333
|
};
|
|
399
334
|
|
|
400
335
|
map.value = markRaw(createMap(leafletContainer.value, mapOptions));
|
|
401
|
-
setView(props.center[0], props.center[1], defaultZoom);
|
|
402
336
|
|
|
403
337
|
map.value.on('click', (e: L.LeafletMouseEvent) => {
|
|
404
338
|
emit('click:latlng', e.latlng);
|
|
@@ -428,41 +362,18 @@ export default defineComponent({
|
|
|
428
362
|
mapResizeObserver.disconnect();
|
|
429
363
|
});
|
|
430
364
|
|
|
431
|
-
watch (() => props.center, (
|
|
432
|
-
if(!map.value) {
|
|
433
|
-
return;
|
|
434
|
-
}
|
|
435
|
-
setView(center[0], center[1], defaultZoom);
|
|
436
|
-
});
|
|
437
|
-
|
|
438
|
-
watch (() => props.selectedLocationId, (selectedLocationId) => {
|
|
439
|
-
if(!map.value) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
const selectedLocation = props.locations.find((location) => location.id === selectedLocationId);
|
|
443
|
-
if(!selectedLocation) {
|
|
444
|
-
return;
|
|
445
|
-
}
|
|
446
|
-
flyTo(selectedLocation?.address.latitude, selectedLocation?.address.longitude, defaultZoom, { animate: false });
|
|
447
|
-
}, { immediate: true });
|
|
448
|
-
|
|
449
|
-
watch(() => props.selectedAreaId, (selectedAreaId) => {
|
|
450
|
-
if(!map.value) {
|
|
451
|
-
return;
|
|
452
|
-
}
|
|
453
|
-
const selectedArea = props.areas.find((area) => area.id === selectedAreaId);
|
|
454
|
-
if(!selectedArea) {
|
|
365
|
+
watch ([() => props.center, () => map.value], () => {
|
|
366
|
+
if(!map.value || !props.center) {
|
|
455
367
|
return;
|
|
456
368
|
}
|
|
457
|
-
|
|
458
|
-
fitBounds(bounds);
|
|
369
|
+
setView(props.center[0], props.center[1], defaultZoom);
|
|
459
370
|
}, { immediate: true });
|
|
460
371
|
|
|
461
|
-
watch( () =>
|
|
462
|
-
if(!map.value || !bounds) {
|
|
372
|
+
watch([() => props.bounds, () => map.value], () => {
|
|
373
|
+
if(!map.value || !props.bounds) {
|
|
463
374
|
return;
|
|
464
375
|
}
|
|
465
|
-
fitBounds(bounds, { maxZoom: defaultZoom });
|
|
376
|
+
fitBounds(props.bounds, { maxZoom: defaultZoom });
|
|
466
377
|
});
|
|
467
378
|
|
|
468
379
|
return {
|
|
@@ -82,20 +82,20 @@ export default {
|
|
|
82
82
|
iconSize: [size, size],
|
|
83
83
|
iconAnchor: [size / 2, size / 2],
|
|
84
84
|
});
|
|
85
|
-
} else if(props.variant === 'location'
|
|
85
|
+
} else if(props.variant === 'location') {
|
|
86
86
|
const size = 36;
|
|
87
87
|
icon = divIcon({
|
|
88
|
-
html: locationMarkerHtml(props.icon, getColors(props.color).base, props.label),
|
|
88
|
+
html: locationMarkerHtml(props.icon ?? "mdi-map-marker", getColors(props.color).base, props.label),
|
|
89
89
|
iconSize: [size, size],
|
|
90
|
-
className: props.selected ? 'fs-map-location fs-map-location-selected' : 'fs-map-location',
|
|
90
|
+
className: props.selected ? 'fs-map-marker fs-map-location fs-map-location-selected' : 'fs-map-marker fs-map-location',
|
|
91
91
|
iconAnchor: [size / 2, size / 2],
|
|
92
92
|
});
|
|
93
93
|
} else {
|
|
94
|
-
const size =
|
|
94
|
+
const size = 16;
|
|
95
95
|
icon = divIcon({
|
|
96
|
-
html: pinMarkerHtml(getColors(props.color).base),
|
|
96
|
+
html: pinMarkerHtml(getColors(props.color).base, props.label),
|
|
97
97
|
iconSize: [size, size],
|
|
98
|
-
className: props.selected ? 'fs-map-
|
|
98
|
+
className: props.selected ? 'fs-map-marker fs-map-pin fs-map-pin-selected' : 'fs-map-marker fs-map-pin',
|
|
99
99
|
iconAnchor: [size / 2, size / 2],
|
|
100
100
|
});
|
|
101
101
|
}
|
|
@@ -45,7 +45,7 @@ export default {
|
|
|
45
45
|
|
|
46
46
|
return divIcon({
|
|
47
47
|
html: clusterMarkerHtml(cluster.getChildCount()),
|
|
48
|
-
className: 'fs-map-
|
|
48
|
+
className: 'fs-map-marker fs-map-cluster-marker',
|
|
49
49
|
iconSize: [size, size],
|
|
50
50
|
iconAnchor: [size / 2, size / 2],
|
|
51
51
|
});
|
|
@@ -97,6 +97,13 @@
|
|
|
97
97
|
:imageId="$props.imageId"
|
|
98
98
|
:width="imageSize"
|
|
99
99
|
/>
|
|
100
|
+
<FSIconCard
|
|
101
|
+
v-else-if="$props.icon"
|
|
102
|
+
backgroundVariant="standard"
|
|
103
|
+
:backgroundColor="ColorEnum.Background"
|
|
104
|
+
:icon="$props.icon"
|
|
105
|
+
:size="imageSize"
|
|
106
|
+
/>
|
|
100
107
|
</FSRow>
|
|
101
108
|
</FSCol>
|
|
102
109
|
</FSTile>
|
|
@@ -108,6 +115,7 @@ import { computed, defineComponent, type PropType } from "vue";
|
|
|
108
115
|
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
109
116
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
110
117
|
|
|
118
|
+
import FSIconCard from "../FSIconCard.vue";
|
|
111
119
|
import FSImage from "../FSImage.vue";
|
|
112
120
|
import FSColor from "../FSColor.vue";
|
|
113
121
|
import FSSpan from "../FSSpan.vue";
|
|
@@ -118,6 +126,7 @@ import FSRow from "../FSRow.vue";
|
|
|
118
126
|
export default defineComponent({
|
|
119
127
|
name: "FSGroupTileUI",
|
|
120
128
|
components: {
|
|
129
|
+
FSIconCard,
|
|
121
130
|
FSImage,
|
|
122
131
|
FSColor,
|
|
123
132
|
FSSpan,
|
|
@@ -131,6 +140,10 @@ export default defineComponent({
|
|
|
131
140
|
required: false,
|
|
132
141
|
default: null
|
|
133
142
|
},
|
|
143
|
+
icon: {
|
|
144
|
+
type: String,
|
|
145
|
+
required: false
|
|
146
|
+
},
|
|
134
147
|
label: {
|
|
135
148
|
type: String as PropType<string | null>,
|
|
136
149
|
required: false,
|
|
@@ -183,7 +196,7 @@ export default defineComponent({
|
|
|
183
196
|
});
|
|
184
197
|
|
|
185
198
|
const infoWidth = computed((): string => {
|
|
186
|
-
if (!props.imageId) {
|
|
199
|
+
if (!props.imageId && !props.icon) {
|
|
187
200
|
return "100%";
|
|
188
201
|
}
|
|
189
202
|
return `calc(100% - ${imageSize.value}px - 24px)`;
|
package/models/map.ts
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { type Layer } from "leaflet";
|
|
2
2
|
|
|
3
|
-
import { type Address } from "@dative-gpi/foundation-shared-domain/models";
|
|
4
|
-
|
|
5
3
|
export interface MapLayer {
|
|
6
4
|
name : string;
|
|
7
5
|
label: string;
|
|
8
6
|
image: string;
|
|
9
7
|
layer: Layer;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface FSLocation {
|
|
13
|
-
id: string;
|
|
14
|
-
label: string;
|
|
15
|
-
icon: string | null;
|
|
16
|
-
address: Address;
|
|
17
|
-
color: string | null;
|
|
18
8
|
}
|
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.137-maps1",
|
|
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.137-maps1",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "1.0.137-maps1"
|
|
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": "5bb28346fa20852b47a19c215fcebb6072bc5fcb"
|
|
39
39
|
}
|
|
@@ -77,17 +77,10 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
.fs-map-
|
|
81
|
-
background-color: var(--fs-map-point-pin-color);
|
|
82
|
-
border-radius: 100%;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.fs-map-location > div {
|
|
80
|
+
.fs-map-marker > div {
|
|
86
81
|
display: flex;
|
|
87
82
|
height: 100%;
|
|
88
|
-
color: var(--fs-map-location-pin-color);
|
|
89
83
|
border-radius: 50%;
|
|
90
|
-
background-color: white;
|
|
91
84
|
filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.4));
|
|
92
85
|
align-items: center;
|
|
93
86
|
justify-content: center;
|
|
@@ -103,7 +96,7 @@
|
|
|
103
96
|
}
|
|
104
97
|
}
|
|
105
98
|
|
|
106
|
-
.fs-map-
|
|
99
|
+
.fs-map-cluster-marker > div {
|
|
107
100
|
background-color: var(--fs-map-location-pin-color);
|
|
108
101
|
color: white;
|
|
109
102
|
}
|
|
@@ -126,6 +119,41 @@
|
|
|
126
119
|
}
|
|
127
120
|
}
|
|
128
121
|
|
|
122
|
+
.fs-map-location > div {
|
|
123
|
+
color: var(--fs-map-location-pin-color);
|
|
124
|
+
background-color: white;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.fs-map-pin > div {
|
|
128
|
+
background-color: var(--fs-map-point-pin-color);
|
|
129
|
+
position: relative;
|
|
130
|
+
|
|
131
|
+
transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.fs-map-pin > div::before {
|
|
135
|
+
content: "";
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: -4px;
|
|
138
|
+
left: -4px;
|
|
139
|
+
width: calc(100% + 8px);
|
|
140
|
+
height: calc(100% + 8px);
|
|
141
|
+
border-radius: 50%;
|
|
142
|
+
border: 2px solid var(--fs-map-point-pin-color);
|
|
143
|
+
opacity: 0.4;
|
|
144
|
+
|
|
145
|
+
@include clickscreen {
|
|
146
|
+
&:hover {
|
|
147
|
+
opacity: 1;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.fs-map-pin-selected > div {
|
|
153
|
+
transform: scale(1.35);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
|
|
129
157
|
.fs-map-site {
|
|
130
158
|
opacity: 0.6;
|
|
131
159
|
transition: opacity 0.28s cubic-bezier(0.4, 0, 0.2, 1);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
.fs-status-rich-card {
|
|
2
|
+
position: relative;
|
|
3
|
+
flex-grow: 1;
|
|
4
|
+
background-color: var(--fs-status-rich-card-background-color);
|
|
5
|
+
border-color: var(--fs-status-rich-card-border-color);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.fs-status-rich-card-corner {
|
|
9
|
+
position: absolute;
|
|
10
|
+
display: flex;
|
|
11
|
+
right: 2px;
|
|
12
|
+
top: 2px;
|
|
13
|
+
}
|