import { type CollisionDetection, type DragOverEvent, type Modifier } from '@dnd-kit/core'; import type { Column } from '../../../../hooks/useTable/types.js'; import type { ColumnPinningState } from '../../../../tanstack-table-core-override/src/index.js'; export declare const DATA_TABLE_COLUMNS_LIST_ITEM_BOTTOM_BORDER = 1; export declare const DATA_TABLE_COLUMNS_LIST_ITEM_MIN_HEIGHT: number; /** * Transforms columns in the settings modal upwards or downwards to make space for the item which is currently being dragged. * * @param columnsList - the columns list element holding the columns in the settings modal. * @param event - contains "active" (item being dragged) and "over" ids (item where the active item is currently dragged over). * @param localColumnOrder - column order before dragging. * @param transformValue - the value by which the columns should be transformed (positive for down or negative for up). * @param activeColumn - the column which is currently being dragged. * @internal */ export declare function transformColumnsOnDragOver(columnsList: HTMLElement | null, event: DragOverEvent, localColumnOrder: string[], transformValue: number, activeColumn: Column | undefined): void; /** * Gets the rendered element of an unpinned column in the settings modal with a given column id. * * @param columnsList - the columns list element holding the columns in the settings modal. * @param columnId - id of the column. * @returns the column in the settings modal with the given id, or null if not found. * @internal */ export declare function getColumnById(columnsList: HTMLElement, columnId: string): HTMLElement | null; /** * Gets all column elements displayed in the column settings modal. * * @param columnsList - the columns list element holding the columns shown in the settings modal. * @returns all columns in the settings modal. * @internal */ export declare function getAllColumns(columnsList: HTMLElement): HTMLElement[]; /** * Resets the transform style on all items in the columns list. * * @param localColumns - the columns in the settings modal to reset. */ export declare function resetAllColumnsStyles(localColumns: HTMLElement[]): void; /** * Applies styles to visually indicate droppable targets for the currently active columns in the settings modal. * Pinned columns or columns that do not share the same parent as the dragged column will appear visually disabled. * * @param columnsList - the columns list element containing the columns to style. * @param activeParentId - the parent id of the currently actively dragged column. * @internal */ export declare function styleNonTargetColumns(columnsList: HTMLElement, activeParentId?: string): void; /** * Hides child columns during parent column drag and * tracks which columns should remain hidden during scrolling. * This is necessary to handle virtualization - when child columns scroll back into view, * they need to be hidden again. * * @param columnsList - the columns list element containing the columns. * @param childColumnIds - the ids of child columns to hide. * @internal */ export declare function hideChildColumns(columnsList: HTMLElement, childColumnIds: string[]): void; /** * Reapplies the isDragging class to child columns that should be hidden. * Called when scrolling during drag to handle newly rendered virtualized items. * * @param columnsList - the columns list element containing the columns. * @internal */ export declare function hideChildColumnsOnScroll(columnsList: HTMLElement): void; /** * Gets the source and destination indexes for a dragged column. * * @param localColumnOrder - contains the ids of the columns in order. * @param activeId - the id of the dragged column in the settings modal. * @param overId - the id of the column where the active column is currently dragged over. * @returns indexes from where a column is dragged and where it is dragged to. */ export declare function getDragIndexes(localColumnOrder: string[], activeId: string, overId: string): { fromIndex: number; toIndex: number; }; /** * Gets a list of ordered leaf column ids for the given column based on the column order. * * @param column - the column to get the leaf columns for. * @param localColumnOrder - the local column order to use for filtering. * @returns an array of ordered leaf column ids for the given column, or an empty array if the column is already a leaf column. * @internal */ export declare function getLeafColumnsForColumn(column: Column, localColumnOrder: string[]): string[]; /** * Information about the currently dragged column. * @internal */ export type DraggingColumnInfo = { id: string; index: number; column: Column; }; /** * Custom collision detection for column ordering in the column settings modal. * Filters out invalid drop targets based on the nested structure and column pinning state, and applies * the closestCenter collision detection on the remaining valid targets. * * @param localColumnOrder - the column order before dragging. * @param localColumnPinning - the column pinning state in the column settings modal before dragging. * @param draggingColumnInfo - information about the currently dragged column. * @returns dnd-kit CollisionDetection * @internal */ export declare function createColumnOrderSettingsCollisionDetection(localColumnOrder: string[], localColumnPinning: ColumnPinningState, draggingColumnInfo: DraggingColumnInfo | null): CollisionDetection; /** * Creates a modifier that restricts the drag overlay to the columns list area within the settings modal. * * @param modalContent - The columns list element to restrict dragging within. * @returns dnd-kit modifier * @internal */ export declare function createRestrictToColumnsListAreaModifier(modalContent: HTMLDivElement | null): Modifier; /** * Gets the drag handle button for a specific column in the column settings modal. * @param columnId - the id of the column to get the drag handle for. * @param columnsList - the columns list element holding the columns in the settings modal. * @returns the drag handle button for the specified column, or null if not found. */ export declare function getDragHandleForColumn(columnId: string, columnsList: HTMLElement | null): HTMLButtonElement | null;