@dative-gpi/foundation-shared-components 1.0.194-sandbox2 → 1.1.0-fix01

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.
@@ -134,6 +134,10 @@ export default defineComponent({
134
134
  disabled: {
135
135
  type: Boolean,
136
136
  default: false
137
+ },
138
+ disableHoverStyle: {
139
+ type: Boolean,
140
+ default: false
137
141
  }
138
142
  },
139
143
  setup(props, { emit }) {
@@ -224,7 +228,7 @@ export default defineComponent({
224
228
  ...baseStyle,
225
229
  "--fs-card-background-color": lights.light,
226
230
  "--fs-card-border-color" : lights.dark,
227
- "--fs-card-color" : lights.lightContrast!
231
+ "--fs-card-color" : props.clickable ? lights.dark : lights.lightContrast!
228
232
  };
229
233
  }
230
234
 
@@ -295,6 +299,9 @@ export default defineComponent({
295
299
  if (actualClickable.value) {
296
300
  classNames.push("fs-card-clickable");
297
301
  }
302
+ if (props.disableHoverStyle) {
303
+ classNames.push("fs-card-disable-hover-style");
304
+ }
298
305
  if (props.disabled) {
299
306
  classNames.push("fs-card-disabled");
300
307
  }
@@ -14,7 +14,7 @@
14
14
  <script lang="ts">
15
15
  import { computed, defineComponent, type PropType } from "vue";
16
16
 
17
- import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
17
+ import { type CardVariant, CardVariants, type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
18
18
  import { useColors } from "@dative-gpi/foundation-shared-components/composables";
19
19
 
20
20
  import FSCard from "./FSCard.vue";
@@ -26,9 +26,9 @@ export default defineComponent({
26
26
  },
27
27
  props: {
28
28
  variant: {
29
- type: String as PropType<"standard" | "full">,
29
+ type: String as PropType<CardVariant>,
30
30
  required: false,
31
- default: "standard"
31
+ default: CardVariants.Standard
32
32
  },
33
33
  color: {
34
34
  type: String as PropType<ColorBase>,
@@ -5,6 +5,7 @@
5
5
  :border="false"
6
6
  :height="actualSize"
7
7
  :width="actualSize"
8
+ :disableHoverStyle="true"
8
9
  >
9
10
  <FSRow
10
11
  align="center-center"
@@ -47,30 +47,26 @@ export default {
47
47
  to: {
48
48
  type: Object as PropType<RouteLocation | null>,
49
49
  required: false
50
- },
51
- html: {
52
- type: String,
53
- required: false
54
50
  }
55
51
  },
56
52
  emits: ['click', 'auxclick'],
57
53
  setup(props, { emit }) {
58
54
  const map = inject<Ref<Map | null>>(MAP);
59
55
  const markerClusterGroup = inject<Ref<MarkerClusterGroup | null>>(MARKERCLUSTERGROUP, ref(null));
60
-
56
+
61
57
  const { getColors } = useColors();
62
58
  const { handleRoutingEvent } = useRouting();
63
59
 
64
- if (!map) {
60
+ if(!map) {
65
61
  throw new Error('FSMapTileLayer must be used inside a FSMap component');
66
62
  }
67
63
 
68
- if (!map.value) {
64
+ if(!map.value) {
69
65
  throw new Error('FSMapTileLayer must be used inside a FSMap component with a map');
70
66
  }
71
-
67
+
72
68
  const getMarkerIcon = () => {
73
- if (props.variant === 'gps') {
69
+ if(props.variant === 'gps') {
74
70
  const size = 16;
75
71
  return divIcon({
76
72
  html: gpsMarkerHtml(),
@@ -80,7 +76,7 @@ export default {
80
76
  });
81
77
  }
82
78
 
83
- if (props.variant === 'location') {
79
+ if(props.variant === 'location') {
84
80
  const size = 36;
85
81
  return divIcon({
86
82
  html: locationMarkerHtml(props.icon ?? "mdi-map-marker", getColors(props.color).base, props.label),
@@ -92,7 +88,7 @@ export default {
92
88
 
93
89
  const size = 16;
94
90
  return divIcon({
95
- html: props.html ?? pinMarkerHtml(getColors(props.color).base, props.label),
91
+ html: pinMarkerHtml(getColors(props.color).base, props.label),
96
92
  iconSize: [size, size],
97
93
  className: props.selected ? 'fs-map-marker fs-map-pin fs-map-pin-selected' : 'fs-map-marker fs-map-pin',
98
94
  iconAnchor: [size / 2, size / 2],
@@ -106,11 +102,11 @@ export default {
106
102
  });
107
103
 
108
104
  const onClick = (event: MouseEvent) => {
109
- if (props.to) {
105
+ if(props.to) {
110
106
  handleRoutingEvent(event, props.to, true);
111
107
  return;
112
108
  }
113
-
109
+
114
110
  emit('click', {
115
111
  ...event,
116
112
  latlng: props.latlng
@@ -118,7 +114,7 @@ export default {
118
114
  }
119
115
 
120
116
  const onAuxClick = (event: MouseEvent) => {
121
- if (props.to) {
117
+ if(props.to) {
122
118
  handleRoutingEvent(event, props.to);
123
119
  return;
124
120
  }
@@ -130,11 +126,11 @@ export default {
130
126
  }
131
127
 
132
128
  watch(map, () => {
133
- if (!map.value) {
129
+ if(!map.value) {
134
130
  return;
135
131
  }
136
132
 
137
- if (markerClusterGroup && markerClusterGroup.value) {
133
+ if(markerClusterGroup && markerClusterGroup.value) {
138
134
  actualMarker.value.addTo(markerClusterGroup.value);
139
135
  } else {
140
136
  actualMarker.value.addTo(map.value);
@@ -142,7 +138,7 @@ export default {
142
138
  }, { immediate: true });
143
139
 
144
140
  watch([() => props.variant, () => props.color, () => props.selected], () => {
145
- if (!actualMarker.value || !map.value) {
141
+ if(!actualMarker.value || !map.value) {
146
142
  return;
147
143
  }
148
144
 
@@ -151,7 +147,7 @@ export default {
151
147
  });
152
148
 
153
149
  watch([() => props.latlng?.lat, () => props.latlng?.lng], () => {
154
- if (!actualMarker.value || !map.value || !props.latlng) {
150
+ if(!actualMarker.value || !map.value || !props.latlng) {
155
151
  return;
156
152
  }
157
153
 
@@ -159,7 +155,7 @@ export default {
159
155
  });
160
156
 
161
157
  watch(markerElement, (newMarkerElement) => {
162
- if (!newMarkerElement) {
158
+ if(!newMarkerElement) {
163
159
  return;
164
160
  }
165
161
 
@@ -168,8 +164,8 @@ export default {
168
164
  }, { immediate: true });
169
165
 
170
166
  onUnmounted(() => {
171
- if (actualMarker.value && map.value) {
172
- if (markerClusterGroup && markerClusterGroup.value) {
167
+ if(actualMarker.value && map.value) {
168
+ if(markerClusterGroup && markerClusterGroup.value) {
173
169
  markerClusterGroup.value.removeLayer(actualMarker.value as Marker);
174
170
  } else {
175
171
  map.value.removeLayer(actualMarker.value as Marker);
@@ -5,7 +5,6 @@ export * from "./useBreakpoints";
5
5
  export * from "./useColors";
6
6
  export * from "./useCountUp";
7
7
  export * from "./useDebounce";
8
- export * from "./useDynamicVNode";
9
8
  export * from "./useElementVisibility";
10
9
  export * from "./useMapLayers";
11
10
  export * from "./useRules";
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "url": "https://github.com/Dative-GPI/foundation-shared-ui.git"
5
5
  },
6
6
  "sideEffects": false,
7
- "version": "1.0.194-sandbox2",
7
+ "version": "1.1.0-fix01",
8
8
  "description": "",
9
9
  "publishConfig": {
10
10
  "access": "public"
@@ -13,8 +13,8 @@
13
13
  "author": "",
14
14
  "license": "ISC",
15
15
  "dependencies": {
16
- "@dative-gpi/foundation-shared-domain": "1.0.194-sandbox2",
17
- "@dative-gpi/foundation-shared-services": "1.0.194-sandbox2"
16
+ "@dative-gpi/foundation-shared-domain": "1.1.0-fix01",
17
+ "@dative-gpi/foundation-shared-services": "1.1.0-fix01"
18
18
  },
19
19
  "peerDependencies": {
20
20
  "@dative-gpi/bones-ui": "^1.0.0",
@@ -30,7 +30,6 @@
30
30
  "@mdi/font": "^7.4.47",
31
31
  "blurhash": "2.0.5",
32
32
  "color": "^4.2.3",
33
- "echarts": "6.0.0",
34
33
  "leaflet": "1.9.4",
35
34
  "leaflet.markercluster": "1.5.3"
36
35
  },
@@ -39,5 +38,5 @@
39
38
  "sass": "1.71.1",
40
39
  "sass-loader": "13.3.2"
41
40
  },
42
- "gitHead": "5df5719c976317438c5031ce8f3e30ff0f9f24c6"
41
+ "gitHead": "278e797abb199f1bf32f7758b2eec5e101537874"
43
42
  }
@@ -9,7 +9,6 @@
9
9
 
10
10
  @include clickscreen {
11
11
  &:not(.fs-button-disabled, :has(.fs-button-load)):hover {
12
- filter: brightness(0.8) !important;
13
12
  cursor: pointer !important;
14
13
  }
15
14
  }
@@ -44,19 +44,19 @@
44
44
  border-color: var(--fs-card-active-border-color) !important;
45
45
  color: var(--fs-card-active-color) !important;
46
46
 
47
- & .fs-card-clickable {
47
+ & .fs-card-clickable:not(.fs-card-disable-hover-style) {
48
48
  transition: background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
49
49
  background-color: var(--fs-card-active-background-color);
50
50
  }
51
51
  }
52
52
 
53
53
  @include clickscreen {
54
- &:not(.fs-card-disabled):hover:not(:has( .fs-stopclick:hover)) {
54
+ &:not(.fs-card-disabled):not(.fs-card-disable-hover-style):hover:not(:has( .fs-stopclick:hover)) {
55
55
  background-color: var(--fs-card-hover-background-color) !important;
56
56
  border-color: var(--fs-card-hover-border-color) !important;
57
57
  color: var(--fs-card-hover-color) !important;
58
58
 
59
- & .fs-card-clickable {
59
+ & .fs-card-clickable:not(.fs-card-disable-hover-style) {
60
60
  transition: background-color 0.28s cubic-bezier(0.4, 0, 0.2, 1);
61
61
  background-color: var(--fs-card-hover-background-color);
62
62
  }
@@ -16,7 +16,6 @@
16
16
  @import "fs_col.scss";
17
17
  @import "fs_color_field.scss";
18
18
  @import "fs_color.scss";
19
- @import "fs_color_icon.scss";
20
19
  @import "fs_data_table.scss";
21
20
  @import "fs_dialog_menu.scss";
22
21
  @import "fs_dialog.scss";
@@ -1,61 +0,0 @@
1
- import { uuidv4 } from "@dative-gpi/bones-ui";
2
- import { h, render, nextTick, getCurrentInstance, onBeforeUnmount, type Component, type VNode } from "vue";
3
-
4
- export function useDynamicVNode<TProps extends Record<string, any>>(component: Component) {
5
- const id = uuidv4();
6
-
7
- let vnode: VNode | null = null;
8
- let container: HTMLElement | null = null;
9
-
10
- const instance = getCurrentInstance();
11
- if (!instance) {
12
- throw new Error("useDynamicVNode must be used inside setup()");
13
- }
14
-
15
- const appContext = instance.appContext;
16
-
17
- const mount = async (props: TProps) => {
18
- await nextTick();
19
-
20
- const mountPoint = document.getElementById(id);
21
- if (!mountPoint) {
22
- return;
23
- }
24
-
25
- if (!container) {
26
- container = document.createElement("div");
27
- mountPoint.appendChild(container);
28
- }
29
-
30
- vnode = h(component, props);
31
- vnode.appContext = appContext;
32
-
33
- render(vnode, container);
34
- };
35
-
36
- const unmount = () => {
37
- if (container) {
38
- render(null, container);
39
- }
40
- vnode = null;
41
- container = null;
42
- };
43
-
44
- const sanitizeStyle = (style?: string): string =>
45
- style
46
- ? style.replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
47
- : "";
48
-
49
- const getHtml = (style?: string) => {
50
- const safeStyle = sanitizeStyle(style);
51
- return `<div id="${id}"${safeStyle ? ` style="${safeStyle}"` : ""}></div>`;
52
- };
53
-
54
- onBeforeUnmount(unmount);
55
-
56
- return {
57
- mount,
58
- unmount,
59
- getHtml
60
- };
61
- }
@@ -1,35 +0,0 @@
1
- import { onMounted, onBeforeUnmount, type Ref } from 'vue';
2
- import type * as echarts from 'echarts';
3
-
4
- export function useChartResize(chartInstance: Ref<echarts.ECharts | null>) {
5
- let resizeObserver: ResizeObserver | null = null;
6
-
7
- const resizeChart = () => {
8
- if (chartInstance.value) {
9
- chartInstance.value.resize();
10
- }
11
- };
12
-
13
- onMounted(() => {
14
- resizeObserver = new ResizeObserver(() => {
15
- resizeChart();
16
- });
17
-
18
- const chartElement = chartInstance.value?.getDom();
19
- if (chartElement) {
20
- resizeObserver.observe(chartElement);
21
- }
22
-
23
- window.addEventListener('resize', resizeChart);
24
- });
25
-
26
- onBeforeUnmount(() => {
27
- window.removeEventListener('resize', resizeChart);
28
- resizeObserver?.disconnect();
29
- resizeObserver = null;
30
- });
31
-
32
- return {
33
- resizeChart
34
- };
35
- }
@@ -1,3 +0,0 @@
1
- .fs-color-icon {
2
- cursor: pointer;
3
- }