@smartnet360/svelte-components 0.0.111 → 0.0.112

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.
@@ -190,21 +190,18 @@
190
190
  }
191
191
 
192
192
  // Track previous values to avoid unnecessary updates
193
- let prevCellsLength = 0;
194
- let prevCellsFirstId: string | null = null;
193
+ let prevCellsRef: unknown[] | null = null;
195
194
  let prevGroupBy: string | null = null;
196
195
  let prevColumnPreset: string | null = null;
197
196
 
198
- // Update table data when cells actually change (not just reference)
197
+ // Update table data when cells change (reference comparison)
199
198
  $effect(() => {
200
- const currentLength = sortedCells?.length ?? 0;
201
- const currentFirstId = sortedCells?.[0]?.id ?? null;
199
+ // Track the cells array reference to detect any change
200
+ const currentRef = sortedCells;
202
201
 
203
- // Only update if length or first item changed (rough equality check)
204
- if (isInitialized && table &&
205
- (currentLength !== prevCellsLength || currentFirstId !== prevCellsFirstId)) {
206
- prevCellsLength = currentLength;
207
- prevCellsFirstId = currentFirstId;
202
+ // Update if reference changed (new array assignment)
203
+ if (isInitialized && table && currentRef !== prevCellsRef) {
204
+ prevCellsRef = currentRef;
208
205
  table.replaceData(sortedCells);
209
206
  ondatachange?.({
210
207
  type: 'load',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartnet360/svelte-components",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",