The cell formulas of a table (TableOptionsIf.cellFormulas): connects the body model with a SheetEngine. Rows are the physical rows (getAllRows() / the array), columns the data columns (row number and checkbox columns don't count). The body asks it for the value of every text input (SheetCellsIf); the table reports every write (cellsWritten). A new rows array (setRows), another row count or other columns rebuild the engine.

Since

1.1.99

Hierarchy

  • TableSheet

Implements

Properties

engine: SheetEngine

Methods

  • The address of a cell ("B3"), undefined for a row number or checkbox column.

    Parameters

    • displayRow: number

      display index

    • columnIndex: number

      model column

    Returns undefined | string

    the address

  • False for arrays (moving a column moves the data of every row – the references would point elsewhere); object rows: the column letter belongs to the property and moves with it.

    Returns boolean

    true if columns may be dragged

  • The cell of an address: display row (-1 if a filter hides it) and model column; undefined if invalid.

    Parameters

    • address: string

      "B3", "$B$3"

    Returns undefined | [number, number]

    display row and model column

  • The value of a cell by physical row and engine column (the rows are checked first).

    Parameters

    • row: number

      physical row

    • col: number

      engine column

    Returns unknown

    the value

  • Cells were written (their inputs changed): the engine compiles their formulas again and recalculates the dependent cells – before the table repaints.

    Parameters

    • changes: readonly CellChangeIf<any>[]

      the written cells (row object or display index, model column)

    Returns void

  • The copy of a cell inside the table: a CopiedFormula for a formula cell, otherwise value.

    Parameters

    • displayRow: number

      display index

    • columnIndex: number

      model column

    • input: unknown

      the cell's input

    • value: unknown

      the cell's value

    Returns unknown

    the copy

  • The formula cells that read a cell directly (display row, model column; hidden rows left out).

    Parameters

    • displayRow: number

      display index

    • columnIndex: number

      model column

    Returns [number, number][]

    the dependents

  • The display row of a physical row, -1 if a filter hides it.

    Parameters

    • physicalRow: number

      the row in getAllRows() / the array

    Returns number

    the display index

  • Parameters

    • columnIndex: number

    Returns undefined | number

    the engine column (A = 0) of a model column

  • The input of a cell by physical row and engine column (also of a row a filter hides).

    Parameters

    • row: number

      physical row

    • col: number

      engine column

    Returns unknown

    the input

  • True if a written value is a formula: text with = in a formula column (it skips editInputPipe and validate).

    Parameters

    • columnIndex: number

      model column

    • value: unknown

      the written value

    Returns value is string

    true for a formula

  • A formula moved from one cell to another (fill handle, paste): relative references move by the physical distance.

    Parameters

    • input: string

      the formula (with =)

    • fromRow: number

      physical row of the source

    • fromCol: number

      engine column of the source

    • toDisplayRow: number

      display row of the target

    • toColumnIndex: number

      model column of the target

    Returns undefined | string

    the moved formula, undefined if the target holds no formulas

  • The physical row of a display row (undefined if there is none).

    Parameters

    • displayRow: number

      display index

    Returns undefined | number

    the row in getAllRows() / the array

  • The cells and ranges a formula reads, as addresses (["B2", "C2", "D2:D4", "A:A"]).

    Parameters

    • displayRow: number

      display index

    • columnIndex: number

      model column

    Returns string[]

    the addresses (empty for a value cell)

  • The message of a syntax error of a formula, undefined if it parses.

    Parameters

    • input: string

      the formula text (with =)

    Returns undefined | string

    the message

  • The value of a cell of an array row (AreaModelArrayOfArrays): the result for a formula, otherwise input.

    Parameters

    • row: unknown
    • columnIndex: number
    • input: string

    Returns unknown

  • Writes an input directly into the data (no events, no recalculation) – formulas adjusted after inserting or deleting rows. row is a physical row or the row itself (object or array).

    Parameters

    • row: number | object

      physical row or row

    • col: number

      engine column

    • value: unknown

      the input

    Returns void