@dative-gpi/foundation-shared-components 1.0.128-fix-mobile-9 → 1.0.128-fix-mobile-12

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.
@@ -100,17 +100,18 @@
100
100
  </FSCol>
101
101
 
102
102
  <FSMapOverlay
103
- v-if="$slots['overlay']"
104
103
  :mode="$props.overlayMode"
105
104
  @update:mode="$emit('update:overlayMode', $event)"
106
105
  @update:height="(height) => overlayHeight = height"
107
106
  @update:width="(width) => overlayWidth = width"
108
107
  >
109
108
  <template
110
- #body
109
+ v-for="(_, name) in overlaySlots"
110
+ v-slot:[name]="slotData"
111
111
  >
112
112
  <slot
113
- name="overlay"
113
+ :name="'overlay-' + name"
114
+ v-bind="slotData"
114
115
  />
115
116
  </template>
116
117
  </FSMapOverlay>
@@ -126,7 +127,7 @@ import { map as createMap, control, tileLayer, latLngBounds, latLng, type LatLng
126
127
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
127
128
  import { type FSArea } from '@dative-gpi/foundation-shared-domain/models';
128
129
 
129
- import { useBreakpoints, useColors } from "../../composables";
130
+ import { useBreakpoints, useColors, useSlots } from "../../composables";
130
131
  import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
131
132
 
132
133
  import FSMapLayerButton from "./FSMapLayerButton.vue";
@@ -231,8 +232,9 @@ export default defineComponent({
231
232
  emits: ["update:modelValue", "update:selectedLocationId", "update:selectedAreaId", 'update:overlayMode', 'update:currentLayer', "click:latlng"],
232
233
  setup(props, { emit }) {
233
234
  const { $tr } = useTranslationsProvider();
234
- const { getColors } = useColors();
235
235
  const { isExtraSmall } = useBreakpoints();
236
+ const { getColors } = useColors();
237
+ const { slots } = useSlots();
236
238
 
237
239
  const leafletContainer = ref<HTMLElement>();
238
240
  const locationGroupBounds = ref<LatLngBounds>();
@@ -314,6 +316,13 @@ export default defineComponent({
314
316
  return bounds as LatLngBounds;
315
317
  });
316
318
 
319
+ const overlaySlots = computed(() => {
320
+ return Object.keys(slots).filter((slot) => slot.startsWith("overlay-")).reduce((acc, slot) => {
321
+ acc[slot.replace("overlay-", "")] = slots[slot];
322
+ return acc;
323
+ }, {} as Record<string, unknown>);
324
+ });
325
+
317
326
  const calculateTargetPosition = (target: L.LatLng, zoom?: number) => {
318
327
  if(!map.value) {
319
328
  return target;
@@ -468,7 +477,8 @@ export default defineComponent({
468
477
  actualLayer,
469
478
  mapLayers,
470
479
  gpsPosition,
471
- style
480
+ style,
481
+ overlaySlots
472
482
  };
473
483
  }
474
484
  });
@@ -10,7 +10,7 @@
10
10
  v-show="isExtraSmall"
11
11
  ref="mobileOverlayWrapper"
12
12
  class="fs-map-overlay-mobile"
13
- :style="{ height: $props.mode === 'expand' ? '90%' : ($props.mode === 'half' ? '60%' : '20px') }"
13
+ :style="{ height: $props.mode === 'expand' ? '90%' : ($props.mode === 'half' ? '60%' : 'auto') }"
14
14
  >
15
15
  <FSCard
16
16
  width="100%"
@@ -32,10 +32,11 @@
32
32
  <FSIcon>
33
33
  {{ $props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up' }}
34
34
  </FSIcon>
35
- <slot
36
- name="collapsed"
37
- />
38
35
  </FSRow>
36
+ <slot
37
+ v-if="$props.mode === 'collapse'"
38
+ name="collapsed"
39
+ />
39
40
  </template>
40
41
  <template
41
42
  v-else
@@ -48,10 +49,11 @@
48
49
  :icon="$props.mode === 'expand' ? 'mdi-chevron-down' : 'mdi-chevron-up'"
49
50
  @click="$props.mode === 'expand' ? $emit('update:mode', 'collapse') : $emit('update:mode', 'expand')"
50
51
  />
51
- <slot
52
- name="collapsed"
53
- />
54
52
  </FSRow>
53
+ <slot
54
+ v-if="$props.mode === 'collapse'"
55
+ name="collapsed"
56
+ />
55
57
  </template>
56
58
  <FSCol
57
59
  v-if="$props.mode !== 'collapse'"
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.128-fix-mobile-9",
4
+ "version": "1.0.128-fix-mobile-12",
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.128-fix-mobile-9",
14
- "@dative-gpi/foundation-shared-services": "1.0.128-fix-mobile-9"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.128-fix-mobile-12",
14
+ "@dative-gpi/foundation-shared-services": "1.0.128-fix-mobile-12"
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": "ae39c0118a3ed2d46752bfe37fb089d70e51e7ca"
38
+ "gitHead": "001b23c2ba55899cb9e93038c769289a1b20024b"
39
39
  }