@invopop/popui 0.1.4-beta.29 → 0.1.4-beta.30
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.
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
paginationSelectedSlot,
|
|
55
55
|
paginationUnselectedSlot,
|
|
56
56
|
manualPagination = false,
|
|
57
|
+
manualSorting = false,
|
|
57
58
|
pageCount,
|
|
58
59
|
rowCount,
|
|
59
60
|
onPageChange,
|
|
@@ -150,6 +151,7 @@
|
|
|
150
151
|
enableSelection,
|
|
151
152
|
enablePagination,
|
|
152
153
|
manualPagination,
|
|
154
|
+
manualSorting,
|
|
153
155
|
pageCount,
|
|
154
156
|
getRowCount: () => rowCount,
|
|
155
157
|
getRowSelection: () => rowSelection,
|
|
@@ -402,7 +404,10 @@
|
|
|
402
404
|
showSortOptions={column.getCanSort()}
|
|
403
405
|
showFilterOption={!column.columnDef.disableColumnFilter}
|
|
404
406
|
onOrderBy={(direction) => {
|
|
405
|
-
|
|
407
|
+
// In manual sorting mode, don't update internal state - let props control it
|
|
408
|
+
if (!manualSorting) {
|
|
409
|
+
column.toggleSorting(direction === 'desc')
|
|
410
|
+
}
|
|
406
411
|
// Reset to first page when sorting changes (same as page size change)
|
|
407
412
|
if (manualPagination) {
|
|
408
413
|
table.setPageIndex(0)
|
|
@@ -123,9 +123,11 @@ export function setupTable(options) {
|
|
|
123
123
|
},
|
|
124
124
|
getCoreRowModel: getCoreRowModel(),
|
|
125
125
|
getPaginationRowModel: options.enablePagination && !options.manualPagination ? getPaginationRowModel() : undefined,
|
|
126
|
-
getSortedRowModel: getSortedRowModel(),
|
|
126
|
+
getSortedRowModel: !options.manualSorting ? getSortedRowModel() : undefined,
|
|
127
127
|
// Manual pagination configuration
|
|
128
|
-
manualPagination: options.manualPagination
|
|
128
|
+
manualPagination: options.manualPagination,
|
|
129
|
+
// Manual sorting configuration
|
|
130
|
+
manualSorting: options.manualSorting
|
|
129
131
|
};
|
|
130
132
|
// Only provide pageCount/rowCount for manual pagination
|
|
131
133
|
// When manualPagination is false, TanStack Table calculates it automatically
|