compote-ui 0.60.4 → 0.60.6

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.
@@ -28,7 +28,17 @@
28
28
  const columnVisibility = $derived.by(() => table.atoms.columnVisibility.get());
29
29
  const activeCount = $derived(columnFilters.length);
30
30
 
31
- let activeFilterIds: string[] = $derived(columnFilters.map((f) => f.id));
31
+ // Filters the user has explicitly opened. Kept separate from the table's
32
+ // columnFilters so a filter card stays visible after its value is cleared
33
+ // (e.g. unchecking the last select option) until removed via the X button.
34
+ let manualFilterIds = $state<string[]>([]);
35
+ const activeFilterIds: string[] = $derived.by(() => {
36
+ const ids = columnFilters.map((f) => f.id);
37
+ for (const id of manualFilterIds) {
38
+ if (!ids.includes(id)) ids.push(id);
39
+ }
40
+ return ids;
41
+ });
32
42
  let showColumnPicker = $state(false);
33
43
  let columnSearchText = $state('');
34
44
 
@@ -65,13 +75,13 @@
65
75
  }
66
76
 
67
77
  function addFilter(column: Column<DataTableFeatures, T, unknown>) {
68
- activeFilterIds = [...activeFilterIds, column.id];
78
+ manualFilterIds = [...manualFilterIds, column.id];
69
79
  showColumnPicker = false;
70
80
  columnSearchText = '';
71
81
  }
72
82
 
73
83
  function removeFilter(column: Column<DataTableFeatures, T, unknown>) {
74
- activeFilterIds = activeFilterIds.filter((id) => id !== column.id);
84
+ manualFilterIds = manualFilterIds.filter((id) => id !== column.id);
75
85
  column.setFilterValue(undefined);
76
86
  delete localText[column.id];
77
87
  delete localNumMin[column.id];
@@ -89,6 +99,7 @@
89
99
  localNumMin = {};
90
100
  localNumMax = {};
91
101
  localSelectSearch = {};
102
+ manualFilterIds = [];
92
103
  showColumnPicker = false;
93
104
  columnSearchText = '';
94
105
  table.resetColumnFilters();
@@ -1,6 +1,6 @@
1
1
  <script lang="ts">
2
2
  import { Tabs } from '@ark-ui/svelte/tabs';
3
- import { ClientOnly } from '@ark-ui/svelte/client-only';
3
+ /* import { ClientOnly } from '@ark-ui/svelte/client-only'; */
4
4
  import type { TabsProps } from './types';
5
5
 
6
6
  let {
@@ -12,14 +12,14 @@
12
12
  }: TabsProps = $props();
13
13
  </script>
14
14
 
15
- <ClientOnly>
16
- <Tabs.Root
17
- {...rootProps}
18
- bind:value
19
- {defaultValue}
20
- {orientation}
21
- class="flex h-full data-[orientation='horizontal']:flex-col data-[orientation='vertical']:flex-row"
22
- >
23
- {@render children?.()}
24
- </Tabs.Root>
25
- </ClientOnly>
15
+ <!-- <ClientOnly> -->
16
+ <Tabs.Root
17
+ {...rootProps}
18
+ bind:value
19
+ {defaultValue}
20
+ {orientation}
21
+ class="flex h-full data-[orientation='horizontal']:flex-col data-[orientation='vertical']:flex-row"
22
+ >
23
+ {@render children?.()}
24
+ </Tabs.Root>
25
+ <!-- </ClientOnly> -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.60.4",
3
+ "version": "0.60.6",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",