summaryrefslogtreecommitdiff
path: root/packages/web/src/components/grid/selection.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/web/src/components/grid/selection.ts')
-rw-r--r--packages/web/src/components/grid/selection.ts28
1 files changed, 0 insertions, 28 deletions
diff --git a/packages/web/src/components/grid/selection.ts b/packages/web/src/components/grid/selection.ts
deleted file mode 100644
index 517f8ae..0000000
--- a/packages/web/src/components/grid/selection.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-import { CellRef, cellRefEquals } from "../../types";
-import { RenderedGrid } from "./renderGrid";
-
-export type CellRange = [start: CellRef, end: CellRef];
-
-export interface GridSelection {
- activeCellRef: CellRef;
- range?: CellRange;
-}
-
-export function extendSelection(
- selection: GridSelection | undefined,
- cellRef: CellRef,
-): GridSelection {
- if (!selection || cellRefEquals(selection.activeCellRef, cellRef)) {
- return { activeCellRef: cellRef };
- }
-
- if (selection.range) {
- return { ...selection, range: [selection.range[0], cellRef] };
- }
-
- return { ...selection, range: [selection.activeCellRef, cellRef] };
-}
-
-export function getSelectionRange(selection: GridSelection): CellRange {
- return selection.range ?? [selection.activeCellRef, selection.activeCellRef];
-}