@dative-gpi/foundation-shared-components 1.0.194-sandbox → 1.0.194-sandbox-4

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.
@@ -8,6 +8,7 @@ export * from "./useDebounce";
8
8
  export * from "./useDynamicVNode";
9
9
  export * from "./useElementVisibility";
10
10
  export * from "./useMapLayers";
11
+ export * from "./useResize";
11
12
  export * from "./useRules";
12
13
  export * from "./useSlots";
13
14
  export * from "./useTables";
@@ -1,35 +1,31 @@
1
- import { onMounted, onBeforeUnmount, type Ref } from 'vue';
2
- import type * as echarts from 'echarts';
1
+ import { onMounted, onBeforeUnmount } from 'vue';
3
2
 
4
- export function useChartResize(chartInstance: Ref<echarts.ECharts | null>) {
3
+ export function useResize(
4
+ getElement: () => HTMLElement | null | undefined,
5
+ onResize: () => void
6
+ ) {
5
7
  let resizeObserver: ResizeObserver | null = null;
6
8
 
7
- const resizeChart = () => {
8
- if (chartInstance.value) {
9
- chartInstance.value.resize();
10
- }
11
- };
12
-
13
9
  onMounted(() => {
14
10
  resizeObserver = new ResizeObserver(() => {
15
- resizeChart();
11
+ onResize();
16
12
  });
17
13
 
18
- const chartElement = chartInstance.value?.getDom();
19
- if (chartElement) {
20
- resizeObserver.observe(chartElement);
14
+ const element = getElement();
15
+ if (element) {
16
+ resizeObserver.observe(element);
21
17
  }
22
18
 
23
- window.addEventListener('resize', resizeChart);
19
+ window.addEventListener('resize', onResize);
24
20
  });
25
21
 
26
22
  onBeforeUnmount(() => {
27
- window.removeEventListener('resize', resizeChart);
23
+ window.removeEventListener('resize', onResize);
28
24
  resizeObserver?.disconnect();
29
25
  resizeObserver = null;
30
26
  });
31
27
 
32
28
  return {
33
- resizeChart
29
+ resize: onResize
34
30
  };
35
31
  }
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-sandbox",
7
+ "version": "1.0.194-sandbox-4",
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-sandbox",
17
- "@dative-gpi/foundation-shared-services": "1.0.194-sandbox"
16
+ "@dative-gpi/foundation-shared-domain": "1.0.194-sandbox-4",
17
+ "@dative-gpi/foundation-shared-services": "1.0.194-sandbox-4"
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": "456a9bcb78b6f7cbacc1c9845f68cbbf62320dbb"
41
+ "gitHead": "5344244153200caa3426444b2d3f7ed84f46679c"
43
42
  }