@rkosafo/cai.components 0.0.62 → 0.0.64

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.
@@ -1,3 +1,4 @@
1
+ import { browser } from '$app/environment';
1
2
  const defaultConfig = {
2
3
  headerOffset: 200,
3
4
  footerOffset: 70,
@@ -14,12 +15,12 @@ export function calculateTableHeight(config = {}) {
14
15
  * Create a reactive table height store that updates on window resize
15
16
  */
16
17
  export function createTableHeightStore(config = {}) {
17
- let height = $state(calculateTableHeight(config));
18
+ let height = calculateTableHeight(config);
18
19
  const updateHeight = () => {
19
20
  height = calculateTableHeight(config);
20
21
  };
21
22
  // Initialize and set up resize listener
22
- if (typeof window !== 'undefined') {
23
+ if (browser) {
23
24
  window.addEventListener('resize', updateHeight);
24
25
  }
25
26
  return {
@@ -28,7 +29,7 @@ export function createTableHeightStore(config = {}) {
28
29
  },
29
30
  update: updateHeight,
30
31
  dispose: () => {
31
- if (typeof window !== 'undefined') {
32
+ if (browser) {
32
33
  window.removeEventListener('resize', updateHeight);
33
34
  }
34
35
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rkosafo/cai.components",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "files": [
5
5
  "dist",
6
6
  "!dist/**/*.test.*",