Interface SelectionResults

interface SelectionResults {
    appendSelection: ((start, end, anchor?) => void);
    clearLastSelection: (() => void);
    clearSelections: (() => void);
    commands: CommandMap;
    cursor?: string;
    isAllSelected: boolean;
    modifySelection: ((coords, coordsPivot?) => void);
    navigate?: ((direction, select?, contentFul?, incrementAmount?) => void);
    navigateSelection: ((direction) => void);
    newSelection: ((coordsStart, coordsEnd?, anchor?) => void);
    onPointerDown: ((e) => void);
    overlay: ((view) => ReactNode);
    selection: GridSelection;
    setActiveCoords: ((coords, shouldScroll?) => void);
    setSelectionRanges: ((ranges) => void);
}

Properties

appendSelection: ((start, end, anchor?) => void)

Add a new selection

Type declaration

clearLastSelection: (() => void)

Clears the last selection

Type declaration

    • (): void
    • Returns void

clearSelections: (() => void)

Clear all current ranges. Leaves the anchor intact

Type declaration

    • (): void
    • Returns void

commands: CommandMap
cursor?: string

Preferred global cursor if set

isAllSelected: boolean

Returns a boolean indicating if the entire range is selected

modifySelection: ((coords, coordsPivot?) => void)

Modify selection. If the coordsPivot is not provided than the current anchor will be used.

Type declaration

    • (coords, coordsPivot?): void
    • Parameters

      Returns void

navigate?: ((direction, select?, contentFul?, incrementAmount?) => void)

Navigate left/right/up/down

Type declaration

    • Parameters

      • direction: CartesianDirection
      • Optional select: boolean
      • Optional contentFul: boolean
      • Optional incrementAmount: number

        Use instead of contentful. Allows for navigating distances (useful for pageUp/pageDown)

      Returns void

navigateSelection: ((direction) => void)

Navigate with the selections (unless there is no active selection)

Type declaration

newSelection: ((coordsStart, coordsEnd?, anchor?) => void)

Use this to invoke a new selection. All old selections will be cleared

Type declaration

    • (coordsStart, coordsEnd?, anchor?): void
    • Parameters

      Returns void

onPointerDown: ((e) => void)

Handler for pointerdown, use to set activeCoords

Type declaration

    • (e): void
    • Parameters

      • e: PointerEvent<HTMLDivElement>

      Returns void

overlay: ((view) => ReactNode)

Array of functions that return components to overlay // TODO - make this a function that takes props and received onMouse, onKeyboard (we can then make selection overlays a function that doesn't rerender the table (or sheet on move))

Type declaration

selection: GridSelection

selections

setActiveCoords: ((coords, shouldScroll?) => void)

Set the currently active cell

Type declaration

    • (coords, shouldScroll?): void
    • Parameters

      Returns void

setSelectionRanges: ((ranges) => void)

Use this to update selections without clearing old selection.

Type declaration