Private
All columns to track in the ordering.
Backwards compatible usage (without ColumnVisibility):
New usage (with ColumnVisibility):
visibleColumns
to indicate which are visibleOptional
existingOrder?: Map<string, number>Optional: Previously saved column order to restore.
Optional
save?: (order: Map<string, number>) => voidOptional: Callback to persist the column order (e.g., to localStorage).
Optional
visibleColumns?: () => Record<string, boolean>Optional: Record of which columns are currently visible.
When provided, moveLeft/moveRight will skip over hidden columns.
When omitted, all columns from columns
are treated as visible (backwards compatible).
Example when using ColumnVisibility:
visibleColumns: () => columns.reduce((acc, col) => {
acc[col.key] = meta(col).ColumnVisibility?.isVisible !== false;
return acc;
}, {})
Private
argsAll columns to track in the ordering.
Backwards compatible usage (without ColumnVisibility):
New usage (with ColumnVisibility):
visibleColumns
to indicate which are visibleOptional
existingOrder?: Map<string, number>Optional: Previously saved column order to restore.
Optional
save?: (order: Map<string, number>) => voidOptional: Callback to persist the column order (e.g., to localStorage).
Optional
visibleColumns?: () => Record<string, boolean>Optional: Record of which columns are currently visible.
When provided, moveLeft/moveRight will skip over hidden columns.
When omitted, all columns from columns
are treated as visible (backwards compatible).
Example when using ColumnVisibility:
visibleColumns: () => columns.reduce((acc, col) => {
acc[col.key] = meta(col).ColumnVisibility?.isVisible !== false;
return acc;
}, {})
This map will be empty until we re-order something.
The same as this.map, but with all the columns' information
Private
getPrivate
Helper to get visible columns, defaulting to all columns if not specified
To account for columnVisibilty, we need to:
To account for columnVisibilty, we need to:
Performs a swap of the column's position with the column at position
Used for keeping track of and updating column order