compote-ui 0.43.8 → 0.43.9

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.
@@ -50,6 +50,12 @@
50
50
  const isRowSelectionEnabled = $derived(Boolean(table.options.enableRowSelection));
51
51
  const isMultiRowSelectionEnabled = $derived(table.options.enableMultiRowSelection !== false);
52
52
  const headerGroupCount = $derived(headerGroups.length);
53
+ const visibleColumnIds = $derived(
54
+ table
55
+ .getVisibleLeafColumns()
56
+ .map((column) => column.id)
57
+ .join('|')
58
+ );
53
59
  const allRowsSelectionState = $derived.by(() => {
54
60
  getReactiveTableState(table);
55
61
  return getAllRowsSelectionState(table);
@@ -59,26 +65,6 @@
59
65
  return getSelectedRowCount(table);
60
66
  });
61
67
  const isColumnResizing = $derived(tableState.columnSizingInfo.isResizingColumn !== false);
62
-
63
- $effect(() => {
64
- console.log('VIRTUAL DATA TABLE DEBUG', {
65
- columnVisibility: { ...tableState.columnVisibility },
66
- visibleLeafColumns: table.getVisibleLeafColumns().map((column) => column.id),
67
- allLeafColumns: table.getAllLeafColumns().map((column) => ({
68
- id: column.id,
69
- isVisible: column.getIsVisible()
70
- })),
71
- headerGroups: table.getHeaderGroups().map((group) => ({
72
- id: group.id,
73
- headers: group.headers.map((header) => ({
74
- id: header.id,
75
- columnId: header.column.id,
76
- colSpan: header.colSpan,
77
- isPlaceholder: header.isPlaceholder
78
- }))
79
- }))
80
- });
81
- });
82
68
  </script>
83
69
 
84
70
  <div
@@ -100,15 +86,17 @@
100
86
  {#if caption}
101
87
  <caption class="sr-only">{caption}</caption>
102
88
  {/if}
103
- <DataTableHead
104
- {table}
105
- {headerGroups}
106
- {headerGroupCount}
107
- {isRowSelectionEnabled}
108
- {isMultiRowSelectionEnabled}
109
- {allRowsSelectionState}
110
- isVirtual
111
- />
89
+ {#key visibleColumnIds}
90
+ <DataTableHead
91
+ {table}
92
+ {headerGroups}
93
+ {headerGroupCount}
94
+ {isRowSelectionEnabled}
95
+ {isMultiRowSelectionEnabled}
96
+ {allRowsSelectionState}
97
+ isVirtual
98
+ />
99
+ {/key}
112
100
  {#if scrollContainerRef}
113
101
  <DataTableVirtualRows
114
102
  rows={rowModel.rows}
@@ -69,6 +69,7 @@
69
69
  const tableColumnCount = $derived(visibleColumnCount + (isRowSelectionEnabled ? 1 : 0));
70
70
  const renderedColumnCount = $derived(tableColumnCount + 1);
71
71
  const headerGroupCount = $derived(headerGroups.length);
72
+ const visibleColumnIds = $derived(visibleLeafColumns.map((column) => column.id).join('|'));
72
73
  const allRowsSelectionState = $derived.by(() => {
73
74
  getReactiveTableState(table);
74
75
  return getAllRowsSelectionState(table);
@@ -78,26 +79,6 @@
78
79
  return getSelectedRowCount(table);
79
80
  });
80
81
  const isColumnResizing = $derived(tableState.columnSizingInfo.isResizingColumn !== false);
81
-
82
- $effect(() => {
83
- console.log('DATA TABLE DEBUG', {
84
- columnVisibility: { ...tableState.columnVisibility },
85
- visibleLeafColumns: table.getVisibleLeafColumns().map((column) => column.id),
86
- allLeafColumns: table.getAllLeafColumns().map((column) => ({
87
- id: column.id,
88
- isVisible: column.getIsVisible()
89
- })),
90
- headerGroups: table.getHeaderGroups().map((group) => ({
91
- id: group.id,
92
- headers: group.headers.map((header) => ({
93
- id: header.id,
94
- columnId: header.column.id,
95
- colSpan: header.colSpan,
96
- isPlaceholder: header.isPlaceholder
97
- }))
98
- }))
99
- });
100
- });
101
82
  </script>
102
83
 
103
84
  <div
@@ -134,17 +115,19 @@
134
115
  {#if caption}
135
116
  <caption class="sr-only">{caption}</caption>
136
117
  {/if}
137
- <DataTableHead
138
- {table}
139
- {headerGroups}
140
- {headerGroupCount}
141
- {isRowSelectionEnabled}
142
- {isMultiRowSelectionEnabled}
143
- {allRowsSelectionState}
144
- {hasGrowColumn}
145
- />
118
+ {#key visibleColumnIds}
119
+ <DataTableHead
120
+ {table}
121
+ {headerGroups}
122
+ {headerGroupCount}
123
+ {isRowSelectionEnabled}
124
+ {isMultiRowSelectionEnabled}
125
+ {allRowsSelectionState}
126
+ {hasGrowColumn}
127
+ />
128
+ {/key}
146
129
  <tbody>
147
- {#key visibleLeafColumns.map((column) => column.id).join('|')}
130
+ {#key visibleColumnIds}
148
131
  {#each rowModel.rows as row (row.id)}
149
132
  {@const rowSelected = getReactiveTableState(table).rowSelection[row.id] === true}
150
133
  <tr
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "compote-ui",
3
- "version": "0.43.8",
3
+ "version": "0.43.9",
4
4
  "license": "MIT",
5
5
  "scripts": {
6
6
  "dev": "vite dev --open",