Used for keeping track of and updating column order

Constructors

  • Parameters

    • args: {
          columns: () => Column<unknown>[];
          existingOrder?: Map<string, number>;
          save?: (order: Map<string, number>) => void;
      }

    Returns ColumnOrder

Properties

args: {
    columns: () => Column<unknown>[];
    existingOrder?: Map<string, number>;
    save?: (order: Map<string, number>) => void;
}
map: TrackedMap<string, number> = ...

This map will be empty until we re-order something.

Accessors

Methods

  • To account for columnVisibilty, we need to:

    • get the list of visible columns
    • get the column order (which preserves the order of hidden columns)
    • skip over non-visible columns when determining the previous "index"
    • set the position to whatever that is.

    Parameters

    • key: string

    Returns void

  • To account for columnVisibilty, we need to:

    • get the list of visible columns
    • get the column order (which preserves the order of hidden columns)
    • skip over non-visible columns when determining the next "index"
    • set the position to whatever that is.

    Parameters

    • key: string

    Returns void

  • Performs a swap of the column's position with the column at position

    Parameters

    • key: string
    • position: number

    Returns undefined | false