@mitcsutt/kiln-dnd
Version:
Kiln drag and drop: sortable lists, boards, drop zones and grid layouts with one keyboard model and one announcer, rendered through kiln-ui
21 lines (20 loc) • 945 B
TypeScript
/*! @license
* Vendored from react-grid-layout 2.3.0 (src/core/sort.ts), MIT licence.
* Copyright (c) 2016 Samuel Reed. See ./LICENSE.
* https://github.com/react-grid-layout/react-grid-layout/tree/2.3.0/src/core
*/
import type { CompactType, Layout, LayoutItem } from './types.js';
/**
* Sort layout items based on the compaction type.
*
* - Vertical compaction: sort by row (y) then column (x)
* - Horizontal compaction: sort by column (x) then row (y)
* - No compaction (null): return original order
*
* Does not modify the original layout.
*/
export declare function sortLayoutItems(layout: Layout, compactType: CompactType): LayoutItem[];
/** Sort layout items by row ascending, then column ascending. */
export declare function sortLayoutItemsByRowCol(layout: Layout): LayoutItem[];
/** Sort layout items by column ascending, then row ascending. */
export declare function sortLayoutItemsByColRow(layout: Layout): LayoutItem[];