@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
14 lines (13 loc) • 436 B
JavaScript
//#region src/grid/engine/sort.ts
function e(e, r) {
return r === "horizontal" ? n(e) : r === "vertical" ? t(e) : [...e];
}
function t(e) {
return [...e].sort((e, t) => e.y === t.y ? e.x - t.x : e.y - t.y);
}
function n(e) {
return [...e].sort((e, t) => e.x === t.x ? e.y - t.y : e.x - t.x);
}
//#endregion
export { e as sortLayoutItems, n as sortLayoutItemsByColRow, t as sortLayoutItemsByRowCol };
//# sourceMappingURL=sort.js.map