@dative-gpi/foundation-shared-components 0.0.229 → 0.1.68
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/FSAccordionPanel.vue +8 -10
- package/components/FSBadge.vue +2 -4
- package/components/FSBreadcrumbs.vue +9 -10
- package/components/FSButton.vue +81 -31
- package/components/FSCalendar.vue +35 -33
- package/components/FSCalendarTwin.vue +77 -84
- package/components/FSCard.vue +29 -16
- package/components/FSCardPlaceholder.vue +1 -2
- package/components/FSCheckbox.vue +5 -7
- package/components/FSChip.vue +9 -11
- package/components/FSClickable.vue +67 -57
- package/components/FSClock.vue +4 -4
- package/components/FSCol.vue +2 -3
- package/components/FSColor.vue +13 -31
- package/components/FSColorIcon.vue +25 -9
- package/components/FSDialog.vue +1 -2
- package/components/FSDialogFormBody.vue +4 -4
- package/components/FSDialogMenu.vue +2 -4
- package/components/FSDialogMultiFormBody.vue +63 -50
- package/components/FSDialogRemove.vue +1 -0
- package/components/FSDialogSubmit.vue +5 -7
- package/components/FSDivider.vue +7 -9
- package/components/FSEditImage.vue +27 -274
- package/components/FSEditImageUI.vue +303 -0
- package/components/FSErrorToast.vue +3 -4
- package/components/FSFadeOut.vue +18 -13
- package/components/FSGrid.vue +6 -9
- package/components/FSGridMosaic.vue +1 -2
- package/components/FSIcon.vue +7 -8
- package/components/FSIconCard.vue +23 -30
- package/components/FSIconCheck.vue +1 -2
- package/components/FSImage.vue +21 -193
- package/components/FSImageCard.vue +2 -2
- package/components/FSImageUI.vue +212 -0
- package/components/FSLabel.vue +18 -20
- package/components/FSLink.vue +19 -21
- package/components/FSLoader.vue +10 -14
- package/components/FSOptionGroup.vue +58 -12
- package/components/FSPagination.vue +3 -5
- package/components/FSRadio.vue +5 -7
- package/components/FSRadioGroup.vue +2 -4
- package/components/FSRow.vue +3 -4
- package/components/FSSlideGroup.vue +15 -4
- package/components/FSSlider.vue +9 -11
- package/components/FSSpan.vue +11 -9
- package/components/FSSwitch.vue +65 -37
- package/components/FSTab.vue +2 -4
- package/components/FSTabs.vue +36 -16
- package/components/FSTag.vue +23 -14
- package/components/FSTagGroup.vue +3 -5
- package/components/FSText.vue +8 -12
- package/components/FSWindow.vue +11 -5
- package/components/FSWrapGroup.vue +15 -4
- package/components/agenda/FSAgenda.vue +204 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +190 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +162 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +124 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +200 -0
- package/components/agenda/FSMonthAgenda.vue +257 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +328 -0
- package/components/autocompletes/FSAutocompleteLanguage.vue +18 -39
- package/components/autocompletes/FSAutocompleteTimeZone.vue +20 -38
- package/components/buttons/FSButtonCancelMini.vue +1 -0
- package/components/buttons/FSButtonCopy.vue +28 -0
- package/components/buttons/FSButtonCopyIcon.vue +28 -0
- package/components/buttons/FSButtonCopyLabel.vue +27 -0
- package/components/buttons/FSButtonCopyMini.vue +28 -0
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicateMini.vue +1 -0
- package/components/buttons/FSButtonEditMini.vue +1 -0
- package/components/buttons/FSButtonFileMini.vue +1 -0
- package/components/buttons/FSButtonNextMini.vue +1 -0
- package/components/buttons/FSButtonPreviousMini.vue +1 -0
- package/components/buttons/FSButtonRedoMini.vue +1 -0
- package/components/buttons/FSButtonRemoveMini.vue +1 -0
- package/components/buttons/FSButtonSaveMini.vue +1 -0
- package/components/buttons/FSButtonSearchMini.vue +1 -0
- package/components/buttons/FSButtonUndoMini.vue +1 -0
- package/components/buttons/FSButtonUpdateMini.vue +1 -0
- package/components/buttons/FSButtonValidateMini.vue +1 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +20 -49
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +40 -60
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +10 -5
- package/components/deviceOrganisations/FSWorstAlert.vue +19 -13
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -47
- package/components/fields/FSAutocompleteField.vue +501 -323
- package/components/fields/FSAutocompleteTag.vue +100 -0
- package/components/fields/FSBaseField.vue +26 -16
- package/components/fields/FSColorField.vue +63 -55
- package/components/fields/FSCommentField.vue +93 -0
- package/components/fields/FSDateField.vue +2 -2
- package/components/fields/FSDateRangeField.vue +2 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +7 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +2 -3
- package/components/fields/FSMagicConfigField.vue +28 -19
- package/components/fields/FSMagicField.vue +25 -17
- package/components/fields/FSNumberField.vue +9 -7
- package/components/fields/FSPasswordField.vue +2 -3
- package/components/fields/FSRichTextField.vue +32 -5
- package/components/fields/FSSearchField.vue +2 -2
- package/components/fields/FSSelectField.vue +483 -251
- package/components/fields/FSTagField.vue +4 -6
- package/components/fields/FSTermField.vue +25 -13
- package/components/fields/FSTextArea.vue +18 -6
- package/components/fields/FSTextField.vue +13 -10
- package/components/fields/FSTimeField.vue +1 -1
- package/components/fields/FSTimeSlotField.vue +3 -4
- package/components/fields/FSTimeStepField.vue +157 -0
- package/components/fields/FSTranslateField.vue +3 -2
- package/components/fields/FSTranslateRichTextField.vue +4 -3
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/FSTreeViewField.vue +7 -9
- package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicField.vue +131 -0
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
- package/components/lists/FSDataIteratorItem.vue +8 -10
- package/components/lists/FSDataTableUI.vue +47 -39
- package/components/lists/FSFilterButton.vue +20 -22
- package/components/lists/FSHiddenButton.vue +10 -12
- package/components/lists/FSLoadDataTable.vue +4 -6
- package/components/lists/FSSimpleList.vue +229 -0
- package/components/map/FSMap.vue +256 -405
- package/components/map/FSMapFeatureGroup.vue +51 -0
- package/components/map/FSMapLayerButton.vue +6 -3
- package/components/map/FSMapMarker.vue +116 -0
- package/components/map/FSMapMarkerClusterGroup.vue +72 -0
- package/components/map/FSMapOverlay.vue +69 -83
- package/components/map/FSMapPolygon.vue +81 -0
- package/components/map/FSMapTileLayer.vue +50 -0
- package/components/map/keys.ts +4 -0
- package/components/selects/FSSelectAutoRefresh.vue +1 -1
- package/components/selects/FSSelectDashboardVariableType.vue +1 -1
- package/components/selects/FSSelectDateSetting.vue +3 -3
- package/components/selects/FSSelectDays.vue +1 -1
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +67 -0
- package/components/tiles/FSChartTileUI.vue +116 -0
- package/components/tiles/FSCommentTileUI.vue +149 -0
- package/components/tiles/FSDashboardOrganisationTileUI.vue +6 -8
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +6 -8
- package/components/tiles/FSDashboardShallowTileUI.vue +6 -8
- package/components/tiles/FSDeviceOrganisationTileUI.vue +30 -18
- package/components/tiles/FSFolderTileUI.vue +6 -6
- package/components/tiles/FSGroupTileUI.vue +31 -22
- package/components/tiles/FSLoadTile.vue +5 -7
- package/components/tiles/FSLocationTileUI.vue +157 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +142 -0
- package/components/tiles/FSSimpleTileUI.vue +57 -36
- package/components/tiles/FSTile.vue +115 -55
- package/components/tiles/FSUserOrganisationTileUI.vue +25 -35
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSEntityHeader.vue +343 -0
- package/components/views/FSEntityView.vue +163 -0
- package/components/views/FSListHeader.vue +83 -0
- package/components/views/FSListView.vue +83 -0
- package/components/views/FSSkeletonView.vue +100 -0
- package/composables/useAddress.ts +2 -2
- package/composables/useColors.ts +15 -5
- package/composables/useMagicFieldProvider.ts +7 -6
- package/composables/useSlots.ts +51 -28
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +10 -5
- package/models/tables.ts +3 -1
- package/package.json +4 -4
- package/styles/components/fs_agenda.scss +32 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +13 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_clickable.scss +5 -3
- package/styles/components/fs_color_field.scss +1 -0
- package/styles/components/fs_data_table.scss +2 -0
- package/styles/components/fs_dialog.scss +11 -15
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +2 -1
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_magic_config_field.scss +2 -2
- package/styles/components/fs_map.scss +36 -30
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_radio.scss +11 -0
- package/styles/components/fs_rich_text_field.scss +2 -1
- package/styles/components/fs_search_field.scss +3 -0
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_slide_group.scss +5 -0
- package/styles/components/fs_span.scss +2 -1
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +9 -0
- package/styles/components/fs_text_area.scss +15 -1
- package/styles/components/fs_tile.scss +22 -6
- package/styles/components/fs_window.scss +5 -0
- package/styles/components/fs_wrap_group.scss +4 -0
- package/styles/components/index.scss +6 -1
- package/styles/globals/overrides.scss +22 -19
- package/styles/globals/text_fonts.scss +17 -55
- package/tools/alertsTools.ts +54 -0
- package/tools/chartsTools.ts +300 -0
- package/tools/index.ts +2 -0
- package/utils/badge.ts +9 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +8 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +27 -1
- package/components/autocompletes/FSAutocompleteTag.vue +0 -138
- package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
- package/styles/components/fs_map_overlay.scss +0 -38
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { inject, provide, ref, type Ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
import { type Map, FeatureGroup } from 'leaflet';
|
|
9
|
+
import { MAP } from './keys';
|
|
10
|
+
|
|
11
|
+
export default {
|
|
12
|
+
name: 'FSMapFeatureGroup',
|
|
13
|
+
props: {
|
|
14
|
+
expectedLayers: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 0,
|
|
17
|
+
required: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(props, { emit }) {
|
|
21
|
+
const map = inject<Ref<Map | null>>(MAP);
|
|
22
|
+
let added = false;
|
|
23
|
+
|
|
24
|
+
if(!map) {
|
|
25
|
+
throw new Error('FSMapFeatureGroup must be used inside a FSMap component');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if(!map.value) {
|
|
29
|
+
throw new Error('FSMapFeatureGroup must be used inside a FSMap component with a map');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const featureGroup = ref<FeatureGroup>(new FeatureGroup());
|
|
33
|
+
|
|
34
|
+
provide('featureGroup', featureGroup);
|
|
35
|
+
|
|
36
|
+
featureGroup.value.on("layeradd", () => {
|
|
37
|
+
if(!map.value) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const layers = featureGroup.value.getLayers();
|
|
42
|
+
|
|
43
|
+
if(layers.length === props.expectedLayers && !added) {
|
|
44
|
+
featureGroup.value.addTo(map.value);
|
|
45
|
+
added = true;
|
|
46
|
+
emit("update:bounds", featureGroup.value.getBounds());
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
</script>
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSButton
|
|
3
|
-
|
|
3
|
+
class="fs-map-layer-button"
|
|
4
|
+
icon="mdi-layers-outline"
|
|
4
5
|
:elevation="true"
|
|
5
6
|
@click="dialog = true"
|
|
6
7
|
/>
|
|
7
8
|
<FSDialog
|
|
8
9
|
v-model="dialog"
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
width="500px"
|
|
11
|
+
:title="$tr('ui.map.select-layer', 'Select layer')"
|
|
12
|
+
:contained="true"
|
|
11
13
|
>
|
|
12
14
|
<template
|
|
13
15
|
v-slot:body
|
|
14
16
|
>
|
|
15
17
|
<FSRow
|
|
16
18
|
align="center-center"
|
|
19
|
+
padding="0 16px 0 0"
|
|
17
20
|
>
|
|
18
21
|
<FSImageCard
|
|
19
22
|
v-for="layer in layers"
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { inject, type PropType, onMounted, type Ref, watch, ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
import { type Map, type DivIcon, divIcon, type LatLng, marker, type Marker, type MarkerClusterGroup, type Layer } from 'leaflet';
|
|
9
|
+
|
|
10
|
+
import { useColors } from "../../composables";
|
|
11
|
+
|
|
12
|
+
import { gpsMarkerHtml, locationMarkerHtml, pinMarkerHtml } from '../../utils/leafletMarkers';
|
|
13
|
+
import { MAP, MARKERCLUSTERGROUP } from './keys';
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
name: 'FSMapMarker',
|
|
17
|
+
props: {
|
|
18
|
+
variant: {
|
|
19
|
+
type: String as PropType<'gps' | 'location' | 'pin'>,
|
|
20
|
+
default: 'location',
|
|
21
|
+
required: false
|
|
22
|
+
},
|
|
23
|
+
color: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'primary',
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
latlng: {
|
|
29
|
+
type: Object as PropType<Pick<LatLng, "lat" | "lng"> | null>,
|
|
30
|
+
required: true
|
|
31
|
+
},
|
|
32
|
+
icon: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: false
|
|
35
|
+
},
|
|
36
|
+
selected: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
required: false
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
emits: ['click'],
|
|
43
|
+
setup(props, { emit }) {
|
|
44
|
+
const map = inject<Ref<Map | null>>(MAP);
|
|
45
|
+
const markerClusterGroup = inject<Ref<MarkerClusterGroup | null>>(MARKERCLUSTERGROUP, ref(null));
|
|
46
|
+
|
|
47
|
+
const { getColors } = useColors();
|
|
48
|
+
|
|
49
|
+
const lastMarker = ref<Marker | null>(null);
|
|
50
|
+
|
|
51
|
+
if(!map) {
|
|
52
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if(!map.value) {
|
|
56
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component with a map');
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const updateMarker = () => {
|
|
60
|
+
if(!map.value || !props.latlng) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if(lastMarker.value) {
|
|
65
|
+
if(markerClusterGroup && markerClusterGroup.value) {
|
|
66
|
+
markerClusterGroup.value.removeLayer(lastMarker.value);
|
|
67
|
+
} else {
|
|
68
|
+
map.value.removeLayer(lastMarker.value as Layer);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let icon: DivIcon | null = null;
|
|
73
|
+
if(props.variant === 'gps') {
|
|
74
|
+
const size = 16;
|
|
75
|
+
icon = divIcon({
|
|
76
|
+
html: gpsMarkerHtml(),
|
|
77
|
+
className: 'fs-map-mylocation',
|
|
78
|
+
iconSize: [size, size],
|
|
79
|
+
iconAnchor: [size / 2, size / 2],
|
|
80
|
+
});
|
|
81
|
+
} else if(props.variant === 'location' && props.icon) {
|
|
82
|
+
const size = 36;
|
|
83
|
+
icon = divIcon({
|
|
84
|
+
html: locationMarkerHtml(props.icon, getColors(props.color).base),
|
|
85
|
+
iconSize: [size, size],
|
|
86
|
+
className: props.selected ? 'fs-map-location fs-map-location-selected' : 'fs-map-location',
|
|
87
|
+
iconAnchor: [size / 2, size / 2],
|
|
88
|
+
});
|
|
89
|
+
} else {
|
|
90
|
+
const size = 20;
|
|
91
|
+
icon = divIcon({
|
|
92
|
+
html: pinMarkerHtml(getColors(props.color).base),
|
|
93
|
+
iconSize: [size, size],
|
|
94
|
+
className: props.selected ? 'fs-map-location fs-map-location-selected' : 'fs-map-location',
|
|
95
|
+
iconAnchor: [size / 2, size / 2],
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
lastMarker.value = marker(props.latlng, { icon });
|
|
100
|
+
lastMarker.value.on('click', (e) => {
|
|
101
|
+
emit('click', e);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
if(markerClusterGroup && markerClusterGroup.value) {
|
|
105
|
+
lastMarker.value.addTo(markerClusterGroup.value);
|
|
106
|
+
} else {
|
|
107
|
+
lastMarker.value.addTo(map.value);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
onMounted(updateMarker);
|
|
112
|
+
|
|
113
|
+
watch(() => [props.variant, props.color, props.latlng, props.selected], updateMarker);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
</script>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { inject, provide, ref, type Ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
import { type Map, MarkerClusterGroup, divIcon } from 'leaflet';
|
|
9
|
+
|
|
10
|
+
import { clusterMarkerHtml } from '../../utils/leafletMarkers';
|
|
11
|
+
import { MAP } from './keys';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'FSMapMarkerClusterGroup',
|
|
15
|
+
props: {
|
|
16
|
+
expectedLayers: {
|
|
17
|
+
type: Number,
|
|
18
|
+
default: 0,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
disableClusteringAtZoom: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 17,
|
|
24
|
+
required: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
setup(props, { emit }) {
|
|
28
|
+
const map = inject<Ref<Map | null>>(MAP);
|
|
29
|
+
let added = false;
|
|
30
|
+
|
|
31
|
+
if(!map) {
|
|
32
|
+
throw new Error('FSMapMarkerClusterGroup must be used inside a FSMap component');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if(!map.value) {
|
|
36
|
+
throw new Error('FSMapMarkerClusterGroup must be used inside a FSMap component with a map');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const markerClusterGroup = ref<MarkerClusterGroup>(new MarkerClusterGroup({
|
|
40
|
+
spiderfyOnMaxZoom: false,
|
|
41
|
+
showCoverageOnHover: false,
|
|
42
|
+
disableClusteringAtZoom: props.disableClusteringAtZoom,
|
|
43
|
+
iconCreateFunction: function (cluster: any) {
|
|
44
|
+
const size = 36;
|
|
45
|
+
|
|
46
|
+
return divIcon({
|
|
47
|
+
html: clusterMarkerHtml(cluster.getChildCount()),
|
|
48
|
+
className: 'fs-map-location fs-map-location-full',
|
|
49
|
+
iconSize: [size, size],
|
|
50
|
+
iconAnchor: [size / 2, size / 2],
|
|
51
|
+
});
|
|
52
|
+
}}
|
|
53
|
+
));
|
|
54
|
+
|
|
55
|
+
provide('markerClusterGroup', markerClusterGroup);
|
|
56
|
+
|
|
57
|
+
markerClusterGroup.value.on("layeradd", () => {
|
|
58
|
+
if(!map.value) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const layers = markerClusterGroup.value.getLayers();
|
|
63
|
+
|
|
64
|
+
if(layers.length === props.expectedLayers && !added) {
|
|
65
|
+
markerClusterGroup.value.addTo(map.value);
|
|
66
|
+
added = true;
|
|
67
|
+
emit("update:bounds", markerClusterGroup.value.getBounds());
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
</script>
|
|
@@ -1,92 +1,70 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<v-overlay
|
|
3
|
+
v-if="isExtraSmall"
|
|
4
|
+
:modelValue="$props.mode === 'expand'"
|
|
5
|
+
:contained="true"
|
|
6
|
+
@click="$emit('update:mode', 'collapse')"
|
|
7
|
+
zIndex="0"
|
|
8
|
+
/>
|
|
9
|
+
<div
|
|
3
10
|
v-show="isExtraSmall"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:style="
|
|
7
|
-
class="fs-map-overlay-left-mobile"
|
|
8
|
-
ref="mobileOverlayElement"
|
|
9
|
-
align="bottom-center"
|
|
10
|
-
width="hug"
|
|
11
|
-
gap="2px"
|
|
12
|
-
@click="$event.target === mobileOverlayElement?.$el ? $emit('update:mode', 'collapse') : null"
|
|
11
|
+
ref="mobileOverlayWrapper"
|
|
12
|
+
class="fs-map-overlay-mobile"
|
|
13
|
+
:style="{ height: $props.mode === 'expand' ? '90%' : ($props.mode === 'half' ? '50%' : '20px') }"
|
|
13
14
|
>
|
|
14
15
|
<FSCard
|
|
15
|
-
|
|
16
|
+
width="100%"
|
|
17
|
+
height="100%"
|
|
16
18
|
:elevation="true"
|
|
17
19
|
:border="false"
|
|
18
20
|
>
|
|
19
21
|
<FSCol
|
|
22
|
+
height="100%"
|
|
20
23
|
gap="0px"
|
|
21
|
-
height="fill"
|
|
22
24
|
>
|
|
23
25
|
<FSRow
|
|
24
26
|
align="center-center"
|
|
25
27
|
@touchstart="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
|
|
26
28
|
>
|
|
27
29
|
<FSButton
|
|
28
|
-
:icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
|
|
29
30
|
variant="icon"
|
|
31
|
+
:icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
|
|
30
32
|
@click="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
|
|
31
33
|
/>
|
|
32
34
|
</FSRow>
|
|
33
35
|
<FSCol
|
|
34
|
-
|
|
36
|
+
v-if="$props.mode !== 'collapse'"
|
|
35
37
|
height="fill"
|
|
38
|
+
style="min-height: 0;"
|
|
36
39
|
>
|
|
37
40
|
<slot
|
|
38
|
-
name="
|
|
41
|
+
name="body"
|
|
39
42
|
/>
|
|
40
|
-
<FSFadeOut
|
|
41
|
-
:height="$props.mode === 'collapse' ? '0px' : '100%'"
|
|
42
|
-
maskHeight="0px"
|
|
43
|
-
>
|
|
44
|
-
<slot
|
|
45
|
-
name="leftoverlay-body"
|
|
46
|
-
/>
|
|
47
|
-
</FSFadeOut>
|
|
48
43
|
</FSCol>
|
|
49
44
|
</FSCol>
|
|
50
45
|
</FSCard>
|
|
51
|
-
</
|
|
52
|
-
|
|
46
|
+
</div>
|
|
47
|
+
|
|
48
|
+
<FSCard
|
|
53
49
|
v-show="!isExtraSmall"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
gap="2px"
|
|
50
|
+
class="fs-map-overlay-desktop"
|
|
51
|
+
ref="desktopOverlay"
|
|
52
|
+
:elevation="true"
|
|
53
|
+
:border="false"
|
|
59
54
|
>
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
:elevation="true"
|
|
63
|
-
:border="false"
|
|
55
|
+
<FSCol
|
|
56
|
+
height="fill"
|
|
64
57
|
>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/>
|
|
71
|
-
<FSFadeOut
|
|
72
|
-
maskHeight="0"
|
|
73
|
-
height="100%"
|
|
74
|
-
>
|
|
75
|
-
<slot
|
|
76
|
-
name="leftoverlay-body"
|
|
77
|
-
/>
|
|
78
|
-
</FSFadeOut>
|
|
79
|
-
</FSCol>
|
|
80
|
-
</FSCard>
|
|
81
|
-
</FSCol>
|
|
58
|
+
<slot
|
|
59
|
+
name="body"
|
|
60
|
+
/>
|
|
61
|
+
</FSCol>
|
|
62
|
+
</FSCard>
|
|
82
63
|
</template>
|
|
83
64
|
|
|
84
65
|
<script lang="ts">
|
|
85
|
-
import {
|
|
86
|
-
|
|
66
|
+
import { defineComponent, type PropType, onUnmounted, onMounted, ref } from "vue";
|
|
87
67
|
import { useBreakpoints } from "../../composables";
|
|
88
|
-
|
|
89
|
-
import FSFadeOut from "../FSFadeOut.vue";
|
|
90
68
|
import FSButton from "../FSButton.vue";
|
|
91
69
|
import FSCard from "../FSCard.vue";
|
|
92
70
|
import FSCol from "../FSCol.vue";
|
|
@@ -95,55 +73,63 @@ import FSRow from "../FSRow.vue";
|
|
|
95
73
|
export default defineComponent({
|
|
96
74
|
name: "FSMapOverlay",
|
|
97
75
|
props: {
|
|
98
|
-
height: {
|
|
99
|
-
type: [String, Number] as PropType<string | number | null>,
|
|
100
|
-
required: false,
|
|
101
|
-
default: "100%"
|
|
102
|
-
},
|
|
103
76
|
mode: {
|
|
104
77
|
type: String as PropType<"collapse" | "half" | "expand">,
|
|
105
78
|
required: false,
|
|
106
79
|
default: "collapse"
|
|
107
|
-
},
|
|
108
|
-
mapId: {
|
|
109
|
-
type: String,
|
|
110
|
-
required: true
|
|
111
80
|
}
|
|
112
81
|
},
|
|
113
82
|
components: {
|
|
114
|
-
FSFadeOut,
|
|
115
83
|
FSButton,
|
|
116
84
|
FSCard,
|
|
117
85
|
FSCol,
|
|
118
86
|
FSRow
|
|
119
87
|
},
|
|
120
|
-
emits: ["update:mode"],
|
|
121
|
-
setup(
|
|
88
|
+
emits: ["update:mode", "update:height", "update:width"],
|
|
89
|
+
setup(_, { emit }) {
|
|
122
90
|
const { isExtraSmall } = useBreakpoints();
|
|
123
91
|
|
|
124
|
-
const
|
|
125
|
-
const
|
|
92
|
+
const mobileOverlayWrapper = ref<HTMLDivElement | null>(null);
|
|
93
|
+
const desktopOverlay = ref<InstanceType<typeof FSCard> | null>(null);
|
|
94
|
+
|
|
95
|
+
const mobileResizeObserver = ref<ResizeObserver | null>(null);
|
|
96
|
+
const desktopResizeObserver = ref<ResizeObserver | null>(null);
|
|
97
|
+
|
|
98
|
+
onMounted(() => {
|
|
99
|
+
mobileResizeObserver.value = new ResizeObserver(entries => {
|
|
100
|
+
entries.forEach((entry) => {
|
|
101
|
+
emit("update:height", entry.contentRect.height);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
desktopResizeObserver.value = new ResizeObserver(entries => {
|
|
106
|
+
entries.forEach((entry) => {
|
|
107
|
+
emit("update:width", entry.contentRect.width);
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
if (mobileOverlayWrapper.value) {
|
|
112
|
+
mobileResizeObserver.value.observe(mobileOverlayWrapper.value);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (desktopOverlay.value) {
|
|
116
|
+
desktopResizeObserver.value.observe(desktopOverlay.value.$el);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
126
119
|
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
"--fs-map-overlay-max-height": `calc(${props.height} - 40px)`,
|
|
131
|
-
"--fs-map-overlay-card-height": "95%",
|
|
132
|
-
};
|
|
120
|
+
onUnmounted((): void => {
|
|
121
|
+
if (mobileResizeObserver.value) {
|
|
122
|
+
mobileResizeObserver.value.disconnect();
|
|
133
123
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
"--fs-map-overlay-max-height": `calc(${props.height} - 40px)`,
|
|
137
|
-
"--fs-map-overlay-card-height": "100%",
|
|
138
|
-
};
|
|
124
|
+
if (desktopResizeObserver.value) {
|
|
125
|
+
desktopResizeObserver.value.disconnect();
|
|
139
126
|
}
|
|
140
127
|
});
|
|
141
128
|
|
|
142
129
|
return {
|
|
143
|
-
leftOverlayMenuMobile,
|
|
144
|
-
mobileOverlayElement,
|
|
145
130
|
isExtraSmall,
|
|
146
|
-
|
|
131
|
+
mobileOverlayWrapper,
|
|
132
|
+
desktopOverlay
|
|
147
133
|
};
|
|
148
134
|
}
|
|
149
135
|
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { inject, type PropType, onMounted, type Ref, watch, ref } from 'vue';
|
|
7
|
+
|
|
8
|
+
import { type Map, type LatLng, type Polygon, type FeatureGroup, polygon } from 'leaflet';
|
|
9
|
+
|
|
10
|
+
import { useColors } from "../../composables";
|
|
11
|
+
import { FEATUREGROUP, MAP } from './keys';
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
name: 'FSMapPolygon',
|
|
15
|
+
props: {
|
|
16
|
+
color: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: 'primary',
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
latlngs: {
|
|
22
|
+
type: Array as PropType<Pick<LatLng, "lat" | "lng">[] | null>,
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
emits: ['click'],
|
|
27
|
+
setup(props, { emit }) {
|
|
28
|
+
const map = inject<Ref<Map | null>>(MAP);
|
|
29
|
+
const featureGroup = inject<Ref<FeatureGroup | null>>(FEATUREGROUP, ref(null));
|
|
30
|
+
|
|
31
|
+
const { getColors } = useColors();
|
|
32
|
+
|
|
33
|
+
const lastPolygon = ref<Polygon | null>(null);
|
|
34
|
+
|
|
35
|
+
if(!map) {
|
|
36
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if(!map.value) {
|
|
40
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component with a map');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const updatePolygon = () => {
|
|
44
|
+
if(!map.value || !props.latlngs) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if(lastPolygon.value) {
|
|
49
|
+
if(featureGroup && featureGroup.value) {
|
|
50
|
+
featureGroup.value.removeLayer(lastPolygon.value);
|
|
51
|
+
} else {
|
|
52
|
+
map.value.removeLayer(lastPolygon.value);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const color = getColors(props.color).base;
|
|
57
|
+
lastPolygon.value = polygon(props.latlngs.map((coord) => [coord.lat, coord.lng]), {
|
|
58
|
+
color: color,
|
|
59
|
+
fillColor: color + "50",
|
|
60
|
+
fillOpacity: 0.5,
|
|
61
|
+
className: 'fs-map-area',
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
lastPolygon.value.on('click', (e) => {
|
|
65
|
+
emit('click', e);
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
if(featureGroup && featureGroup.value) {
|
|
69
|
+
lastPolygon.value.addTo(featureGroup.value);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
lastPolygon.value.addTo(map.value);
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
onMounted(updatePolygon);
|
|
77
|
+
|
|
78
|
+
watch(() => [props.color, props.latlngs], updatePolygon);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
</script>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<slot />
|
|
3
|
+
</template>
|
|
4
|
+
|
|
5
|
+
<script lang="ts">
|
|
6
|
+
import { inject, type PropType, onMounted, type Ref, watch } from 'vue';
|
|
7
|
+
|
|
8
|
+
import type { Map, Layer } from 'leaflet';
|
|
9
|
+
|
|
10
|
+
import { MAP } from './keys';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
name: 'FSMapTileLayer',
|
|
14
|
+
props: {
|
|
15
|
+
layer: {
|
|
16
|
+
type: Object as PropType<Layer>,
|
|
17
|
+
required: false
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
setup(props) {
|
|
21
|
+
const map = inject<Ref<Map | null>>(MAP);
|
|
22
|
+
|
|
23
|
+
const lastLayer = props.layer;
|
|
24
|
+
|
|
25
|
+
if(!map) {
|
|
26
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if(!map.value) {
|
|
30
|
+
throw new Error('FSMapTileLayer must be used inside a FSMap component with a map');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const updateLayer = () => {
|
|
34
|
+
if (!props.layer || !map.value) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if(lastLayer) {
|
|
39
|
+
map.value.removeLayer(lastLayer);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
props.layer.addTo(map.value);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
onMounted(updateLayer);
|
|
46
|
+
|
|
47
|
+
watch(() => props.layer, updateLayer);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { AutoRefresh } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { AutoRefresh } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { DashboardVariableType } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { DashboardVariableType } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSSelectField
|
|
3
|
+
class="fs-select-date-setting"
|
|
3
4
|
:items="dateSettings"
|
|
4
5
|
:clearable="false"
|
|
5
6
|
:modelValue="$props.modelValue"
|
|
@@ -9,11 +10,10 @@
|
|
|
9
10
|
</template>
|
|
10
11
|
|
|
11
12
|
<script lang="ts">
|
|
12
|
-
import type
|
|
13
|
-
import { computed, defineComponent } from "vue";
|
|
13
|
+
import { computed, defineComponent, type PropType } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { DateSetting } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { DateSetting } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|
|
@@ -13,7 +13,7 @@ import type { PropType} from "vue";
|
|
|
13
13
|
import { computed, defineComponent } from "vue";
|
|
14
14
|
|
|
15
15
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
16
|
-
import { Days } from "@dative-gpi/foundation-shared-domain/
|
|
16
|
+
import { Days } from "@dative-gpi/foundation-shared-domain/enums";
|
|
17
17
|
|
|
18
18
|
import FSSelectField from "../fields/FSSelectField.vue";
|
|
19
19
|
|