@dative-gpi/foundation-shared-components 1.0.105 → 1.0.107

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.
@@ -4,7 +4,7 @@
4
4
  :class="classes"
5
5
  :modelValue="$props.modelValue"
6
6
  @update:modelValue="$emit('update:modelValue', $event)"
7
- @click="$emit('update:modelValue', false)"
7
+ :width="$props.width"
8
8
  v-bind="$attrs"
9
9
  >
10
10
  <slot>
@@ -14,7 +14,6 @@
14
14
  :width="$props.width"
15
15
  :modelValue="$props.modelValue"
16
16
  @update:modelValue="$emit('update:modelValue', $event)"
17
- @click.stop="$emit('click', $event)"
18
17
  >
19
18
  <template
20
19
  v-for="(_, name) in $slots"
@@ -327,7 +327,24 @@ export default defineComponent({
327
327
  if(!map.value) {
328
328
  return;
329
329
  }
330
- map.value.flyTo(calculateTargetPosition(latLng(lat, lng), zoom), zoom, options);
330
+
331
+ if(isExtraSmall.value) {
332
+ // We wait for bottom offset to be calculated and stable to focus on the right position
333
+ let tries = 0;
334
+ let oldBottomOffset = bottomOffset.value;
335
+ const interval = setInterval(() => {
336
+ if(oldBottomOffset === bottomOffset.value || tries >= 30) {
337
+ clearInterval(interval);
338
+ map.value!.flyTo(calculateTargetPosition(latLng(lat, lng), zoom), zoom, options);
339
+ }
340
+ oldBottomOffset = bottomOffset.value;
341
+ tries++;
342
+ }, 20);
343
+
344
+ } else {
345
+ map.value.flyTo(calculateTargetPosition(latLng(lat, lng), zoom), zoom, options);
346
+ }
347
+
331
348
  }
332
349
 
333
350
  const setView = (lat: number, lng: number, zoom: number) => {
@@ -338,23 +355,23 @@ export default defineComponent({
338
355
  }
339
356
 
340
357
  const fitBounds = (bounds: LatLngBounds, options?: FitBoundsOptions) => {
341
- if (!map.value) {
342
- return;
343
- }
344
-
345
- let paddingRatio = 1
346
- if(leftOffset.value) {
347
- paddingRatio = leftOffset.value / map.value.getSize().x
348
- }
349
- else if(bottomOffset.value) {
350
- paddingRatio = bottomOffset.value / map.value.getSize().y
351
- }
352
- if(paddingRatio > 0.5) {
353
- paddingRatio = 0.5;
354
- }
355
- const paddedBounds = bounds.pad(paddingRatio);
358
+ if (!map.value) {return;}
359
+ const paddingTopLeft: [number, number] = [
360
+ leftOffset.value,
361
+ 0
362
+ ];
363
+
364
+ const paddingBottomRight: [number, number] = [
365
+ 0,
366
+ bottomOffset.value
367
+ ];
368
+ const paddingOptions = {
369
+ paddingTopLeft,
370
+ paddingBottomRight,
371
+ ...options,
372
+ };
356
373
 
357
- map.value.fitBounds(paddedBounds, options);
374
+ map.value.fitBounds(bounds, paddingOptions);
358
375
  };
359
376
 
360
377
  onMounted(() => {
@@ -7,7 +7,6 @@
7
7
  />
8
8
  <FSDialog
9
9
  v-model="dialog"
10
- width="500px"
11
10
  :title="$tr('ui.map.select-layer', 'Select layer')"
12
11
  :contained="true"
13
12
  >
@@ -16,6 +15,7 @@
16
15
  >
17
16
  <FSRow
18
17
  align="center-center"
18
+ :wrap="false"
19
19
  >
20
20
  <FSImageCard
21
21
  v-for="layer in layers"
@@ -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' ? '50%' : '20px') }"
13
+ :style="{ height: $props.mode === 'expand' ? '90%' : ($props.mode === 'half' ? '60%' : '20px') }"
14
14
  >
15
15
  <FSCard
16
16
  width="100%"
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.105",
4
+ "version": "1.0.107",
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.105",
14
- "@dative-gpi/foundation-shared-services": "1.0.105"
13
+ "@dative-gpi/foundation-shared-domain": "1.0.107",
14
+ "@dative-gpi/foundation-shared-services": "1.0.107"
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": "10e4ece3df98871b0af99934e5aa86a0e7ae801b"
38
+ "gitHead": "eb566a0c7b51ca46c2d469196aa8e6e83b70bae3"
39
39
  }
@@ -1,16 +1,9 @@
1
1
  .fs-dialog-mobile > .v-overlay__content {
2
2
  flex-direction: column-reverse !important;
3
- }
4
-
5
- .fs-dialog > .v-overlay__content {
6
- justify-content: center !important;
7
- align-items: center !important;
8
- }
9
3
 
10
- .v-dialog > .v-overlay__content {
11
4
  max-height: 100vh !important;
12
5
  max-width: 100vw !important;
13
6
  height: 100% !important;
14
7
  width: 100% !important;
15
8
  margin: 0 !important;
16
- }
9
+ }
@@ -1,7 +1,7 @@
1
1
  .fs-image-card {
2
2
  > .fs-card {
3
3
  background-image: var(--fs-image-card-background);
4
- background-size: 100%;
4
+ background-size: cover;
5
5
  background-position: center;
6
6
  }
7
7
 
@@ -47,9 +47,10 @@ export const AlertTools = {
47
47
  },
48
48
  criticityLabel(value: Criticity): string {
49
49
  switch (value) {
50
- case Criticity.Warning: return $tr("ui.alert.warning", "Warning");
51
- case Criticity.Error: return $tr("ui.alert.error", "Error");
52
- default: return $tr("ui.alert.information", "Information");
50
+ case Criticity.Warning: return $tr("ui.criticity.warning", "Warning");
51
+ case Criticity.Error: return $tr("ui.criticity.error", "Error");
52
+ case Criticity.Information: return $tr("ui.criticity.information", "Information")
53
+ default: return $tr("ui.criticity.none", "None");
53
54
  }
54
55
  }
55
56
  }