@dative-gpi/foundation-shared-components 0.0.215 → 0.0.217

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.
@@ -11,8 +11,7 @@
11
11
  </template>
12
12
 
13
13
  <script lang="ts">
14
- import type { PropType} from "vue";
15
- import { computed, defineComponent, onMounted, onUnmounted, ref, watch } from "vue";
14
+ import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, watch } from "vue";
16
15
 
17
16
  import { useBreakpoints, useColors, useDebounce } from "@dative-gpi/foundation-shared-components/composables";
18
17
  import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
@@ -14,9 +14,10 @@
14
14
  >
15
15
  <FSOptionItem
16
16
  v-for="(item, index) in props.values"
17
+ :padding="props.optionPadding"
18
+ :editable="props.editable"
17
19
  :prependIcon="item.prependIcon"
18
20
  :appendIcon="item.appendIcon"
19
- :editable="props.editable"
20
21
  :variant="getVariant(item)"
21
22
  :color="getColor(item)"
22
23
  :class="getClass(item)"
@@ -59,9 +60,10 @@
59
60
  >
60
61
  <FSOptionItem
61
62
  v-for="(item, index) in props.values"
63
+ :padding="props.optionPadding"
64
+ :editable="props.editable"
62
65
  :prependIcon="item.prependIcon"
63
66
  :appendIcon="item.appendIcon"
64
- :editable="props.editable"
65
67
  :variant="getVariant(item)"
66
68
  :color="getColor(item)"
67
69
  :class="getClass(item)"
@@ -92,14 +94,11 @@
92
94
  </template>
93
95
 
94
96
  <script lang="ts">
95
- import type { PropType } from "vue";
96
- import { computed, defineComponent } from "vue";
97
+ import { computed, defineComponent, type PropType } from "vue";
97
98
 
98
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
99
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
99
+ import { type ColorBase, ColorEnum, type FSToggle } from "@dative-gpi/foundation-shared-components/models";
100
100
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
101
101
  import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
102
- import type { FSToggle } from "@dative-gpi/foundation-shared-components/models";
103
102
 
104
103
  import FSOptionItem from "./FSOptionItem.vue";
105
104
  import FSSlideGroup from "./FSSlideGroup.vue";
@@ -178,6 +177,11 @@ export default defineComponent({
178
177
  required: false,
179
178
  default: "3px"
180
179
  },
180
+ optionPadding: {
181
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
182
+ required: false,
183
+ default: "4px"
184
+ },
181
185
  gap: {
182
186
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
183
187
  required: false,
@@ -1,13 +1,12 @@
1
1
  <template>
2
2
  <FSClickable
3
- padding="4px"
4
3
  :editable="$props.editable"
5
4
  :height="['32px', '28px']"
5
+ :padding="$props.padding"
6
6
  :variant="$props.variant"
7
7
  :color="$props.color"
8
8
  :load="$props.load"
9
9
  :border="false"
10
- :width="width"
11
10
  @click.stop="onClick"
12
11
  v-bind="$attrs"
13
12
  >
@@ -52,12 +51,9 @@
52
51
  </template>
53
52
 
54
53
  <script lang="ts">
55
- import type { PropType } from "vue";
56
- import { computed, defineComponent } from "vue";
54
+ import { computed, defineComponent, type PropType } from "vue";
57
55
 
58
- import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
59
- import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
60
- import { sizeToVar, varToSize } from "@dative-gpi/foundation-shared-components/utils";
56
+ import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
61
57
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
62
58
 
63
59
  import FSClickable from "./FSClickable.vue";
@@ -99,16 +95,16 @@ export default defineComponent({
99
95
  required: false,
100
96
  default: "standard"
101
97
  },
102
- ItemWidth: {
103
- type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
104
- required: false,
105
- default: () => ["32px","28px"]
106
- },
107
98
  color: {
108
99
  type: String as PropType<ColorBase>,
109
100
  required: false,
110
101
  default: ColorEnum.Primary
111
102
  },
103
+ padding: {
104
+ type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
105
+ required: false,
106
+ default: "4px"
107
+ },
112
108
  load: {
113
109
  type: Boolean,
114
110
  required: false,
@@ -126,13 +122,6 @@ export default defineComponent({
126
122
 
127
123
  const colors = computed(() => getColors(props.color));
128
124
 
129
- const width = computed((): string => {
130
- if (props.label) {
131
- return "fit-content";
132
- }
133
- return sizeToVar(varToSize(props.ItemWidth));
134
- });
135
-
136
125
  const onClick = (event: MouseEvent) => {
137
126
  if (props.editable && !props.load) {
138
127
  emit("click", event);
@@ -141,7 +130,6 @@ export default defineComponent({
141
130
 
142
131
  return {
143
132
  colors,
144
- width,
145
133
  onClick
146
134
  };
147
135
  }
@@ -137,7 +137,7 @@ import "leaflet.markercluster";
137
137
  import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
138
138
  import { type Address, type FSArea } from '@dative-gpi/foundation-shared-domain/models';
139
139
 
140
- import { clusterMarker, locationMarker, myLocationMarker } from "../../utils";
140
+ import { clusterMarkerHtml, locationMarkerHtml, myLocationMarkerHtml } from "../../utils";
141
141
  import { ColorEnum, type FSLocation, type MapLayer } from "../../models";
142
142
  import { useColors, useAddress, useBreakpoints } from "../../composables";
143
143
 
@@ -323,7 +323,13 @@ export default defineComponent({
323
323
  const displayLocations = () => {
324
324
  markerLayerGroup.clearLayers();
325
325
  innerModelValue.value.forEach((location) => {
326
- const icon = locationMarker(location.icon, getColors(location.color).base, L);
326
+ const size = 36;
327
+ const icon = L.divIcon({
328
+ html: locationMarkerHtml(location.icon, getColors(location.color).base),
329
+ iconSize: [size, size],
330
+ className: 'fs-map-location',
331
+ iconAnchor: [size / 2, size / 2],
332
+ });
327
333
  const marker = LL.marker([location.address.latitude, location.address.longitude], { icon }).addTo(markerLayerGroup);
328
334
  markers[location.id] = marker;
329
335
  marker.on('click', () => emit('update:selectedLocationId', location.id));
@@ -369,7 +375,13 @@ export default defineComponent({
369
375
  showCoverageOnHover: false,
370
376
  disableClusteringAtZoom: 17,
371
377
  iconCreateFunction: function (cluster: any) {
372
- return clusterMarker(cluster.getChildCount(), L);
378
+ const size = 36;
379
+ return L.divIcon({
380
+ html: clusterMarkerHtml(cluster.getChildCount()),
381
+ className: 'fs-map-location fs-map-location-full',
382
+ iconSize: [size, size],
383
+ iconAnchor: [size / 2, size / 2],
384
+ });
373
385
  }
374
386
  });
375
387
  }
@@ -448,7 +460,13 @@ export default defineComponent({
448
460
  map.locate();
449
461
  map.on('locationfound', (e: L.LocationEvent) => {
450
462
  map.panTo(calculateTargetPosition(e.latlng));
451
- const icon = myLocationMarker(L);
463
+ const size= 16;
464
+ const icon = L.divIcon({
465
+ html: myLocationMarkerHtml(L),
466
+ className: 'fs-map-mylocation',
467
+ iconSize: [size, size],
468
+ iconAnchor: [size / 2, size / 2],
469
+ });
452
470
  myLocationLayerGroup.clearLayers();
453
471
  LL.marker(e.latlng, { icon }).addTo(myLocationLayerGroup);
454
472
  });
@@ -505,7 +523,7 @@ export default defineComponent({
505
523
  if (entry.target.id === `left-overlay-${mapId}`) {
506
524
  leftOverlayWidth.value = entry.contentRect.width;
507
525
  }
508
- if(entry.target.id === `left-overlay-mobile-${mapId}`) {
526
+ if (entry.target.id === `left-overlay-mobile-${mapId}`) {
509
527
  leftOverlayHeight.value = entry.contentRect.height;
510
528
  }
511
529
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.215",
4
+ "version": "0.0.217",
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": "0.0.215",
14
- "@dative-gpi/foundation-shared-services": "0.0.215"
13
+ "@dative-gpi/foundation-shared-domain": "0.0.217",
14
+ "@dative-gpi/foundation-shared-services": "0.0.217"
15
15
  },
16
16
  "peerDependencies": {
17
17
  "@dative-gpi/bones-ui": "^0.0.75",
@@ -35,5 +35,5 @@
35
35
  "sass": "1.71.1",
36
36
  "sass-loader": "13.3.2"
37
37
  },
38
- "gitHead": "0d0aafb99e7a818b3606c3ac8bea917213e389ad"
38
+ "gitHead": "fc671993afed7c9953bf4325f4788592d280cda7"
39
39
  }
@@ -1,38 +1,23 @@
1
- export const locationMarker = (icon: string, color: string, L: any, size = 36) => {
1
+ export const locationMarkerHtml = (icon: string, color: string) => {
2
2
  const iconHtml = `
3
3
  <div style="--fs-map-mylocation-pin-color-alpha:${color}50;--fs-map-location-pin-color: ${color}">
4
4
  <i class="${icon} mdi notranslate v-theme--DefaultTheme fs-icon" aria-hidden="true" style="--fs-icon-font-size: 22px;" />
5
5
  </div>`;
6
6
 
7
- return L.divIcon({
8
- html: iconHtml,
9
- iconSize: [size, size],
10
- className: 'fs-map-location',
11
- iconAnchor: [size / 2, size / 2],
12
- });
7
+ return iconHtml;
13
8
  }
14
9
 
15
- export const clusterMarker = (label: string, L: any, size = 36) => {
10
+ export const clusterMarkerHtml = (label: string) => {
16
11
  const iconHtml = `
17
12
  <div class="fs-map-cluster">
18
13
  <span>${label}</span>
19
14
  </div>`;
20
15
 
21
- return L.divIcon({
22
- html: iconHtml,
23
- className: 'fs-map-location fs-map-location-full',
24
- iconSize: [size, size],
25
- iconAnchor: [size / 2, size / 2],
26
- })
16
+ return iconHtml;
27
17
  }
28
18
 
29
- export const myLocationMarker = (L: any, size = 16) => {
19
+ export const myLocationMarkerHtml = () => {
30
20
  const iconHtml = `<div class="fs-map-mylocation-pin" />`;
31
21
 
32
- return L.divIcon({
33
- html: iconHtml,
34
- className: 'fs-map-mylocation',
35
- iconSize: [size, size],
36
- iconAnchor: [size / 2, size / 2],
37
- });
22
+ return iconHtml;
38
23
  }