@makolabs/ripple 0.0.7 → 0.0.8

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.
@@ -286,8 +286,8 @@
286
286
 
287
287
  if (isCurrentlySelected) {
288
288
  // Remove from selection
289
- selectedFiles = selectedFiles.filter(key => key !== file.key);
290
- selected = selected.filter(item => item.key !== file.key);
289
+ selectedFiles = selectedFiles.filter((key) => key !== file.key);
290
+ selected = selected.filter((item) => item.key !== file.key);
291
291
  console.log('selected [HANDLEROWCLICK, REMOVE]', selected);
292
292
  } else {
293
293
  // Add to selection
@@ -386,22 +386,22 @@
386
386
  }
387
387
 
388
388
  // Effect to update the Table component's selection state when selectedFiles changes
389
- // $effect(() => {
390
- // if (displayFiles.length === 0) return;
391
-
392
- // // Get all files that should be selected based on our current selection state
393
- // const filesToSelect = displayFiles.filter((file) => isRowSelected(file));
394
-
395
- // // We need to update the Table's internal selection state without triggering additional updates
396
- // // This ensures the UI is properly updated
397
- // if (
398
- // JSON.stringify(selected.map((f) => f.key).sort()) !==
399
- // JSON.stringify(filesToSelect.map((f) => f.key).sort())
400
- // ) {
401
- // // Only update if the selection has actually changed
402
- // selected = filesToSelect;
403
- // }
404
- // });
389
+ $effect(() => {
390
+ if (displayFiles.length === 0) return;
391
+
392
+ // Get all files that should be selected based on our current selection state
393
+ const filesToSelect = displayFiles.filter((file) => isRowSelected(file));
394
+
395
+ // We need to update the Table's internal selection state without triggering additional updates
396
+ // This ensures the UI is properly updated
397
+ if (
398
+ JSON.stringify(selected.map((f) => f.key).sort()) !==
399
+ JSON.stringify(filesToSelect.map((f) => f.key).sort())
400
+ ) {
401
+ // Only update if the selection has actually changed
402
+ selected = filesToSelect;
403
+ }
404
+ });
405
405
 
406
406
  // Track the selected items for the Table component's internal state
407
407
  let selected = $state<FileItem[]>([]);
@@ -437,7 +437,7 @@
437
437
  }
438
438
  return false;
439
439
  });
440
-
440
+
441
441
  // Always allow folders to be selected (for recursive selection)
442
442
  return item.isFolder || hasAllowedAction;
443
443
  });
@@ -648,7 +648,14 @@
648
648
  <div class="flex items-center gap-2">
649
649
  {#each singularActions(file) as action (action.label)}
650
650
  {#if action.isAllowed(file)}
651
- <Button size={Size.XS} onclick={() => action.action?.(file)}>{action.label(file)}</Button>
651
+ <Button
652
+ size={Size.XS}
653
+ onclick={(e) => {
654
+ e.stopPropagation();
655
+ e.preventDefault();
656
+ action.action?.(file);
657
+ }}>{action.label(file)}</Button
658
+ >
652
659
  {/if}
653
660
  {/each}
654
661
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "repository": {
6
6
  "type": "git",