pub fn toggle_sorting_state_tanstack(
sorting: &mut Vec<SortSpec>,
column: &SortToggleColumn,
options: TableOptions,
multi: bool,
auto_sort_dir_desc: bool,
)Expand description
TanStack-aligned sorting state transition for column.toggleSorting(undefined, multi).
This implements the upstream action logic (add/toggle/remove/replace) including:
sortDescFirst(table + column)enableSortingRemoval(note: TanStack’stoggleSortingdoes not pass themultiflag togetNextSortingOrder, soenableMultiRemovedoes not affect the direct toggle behavior)enableMultiSort/maxMultiSortColCount
Notes:
- This models the behavior of calling
column.toggleSortingdirectly. It does not include UI gating likegetCanSort()(which TanStack applies ingetToggleSortingHandler). - This currently does not implement TanStack’s
getAutoSortDir()inference (string => asc, else desc) whensortDescFirstis unset. Until we add a stable “sort value extractor” surface, the fallback first direction isasc.