Skip to main content

Module: @lexical/table

Classes

Type Aliases

Cell

Ƭ Cell: Object

Type declaration

NameType
elemHTMLElement
highlightedboolean
xnumber
ynumber

Defined in

lexical-table/src/LexicalTableSelection.ts:40


HTMLTableElementWithWithTableSelectionState

Ƭ HTMLTableElementWithWithTableSelectionState: HTMLTableElement & Record<typeof LEXICAL_ELEMENT_KEY, TableSelection>

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:983


InsertTableCommandPayload

Ƭ InsertTableCommandPayload: Readonly<{ columns: string ; includeHeaders?: boolean ; rows: string }>

Defined in

lexical-table/src/index.ts:91


SerializedTableCellNode

Ƭ SerializedTableCellNode: Spread<{ headerState: TableCellHeaderState ; type: "tablecell" ; width?: number }, SerializedGridCellNode>

Defined in

lexical-table/src/LexicalTableCellNode.ts:40


SerializedTableNode

Ƭ SerializedTableNode: Spread<{ type: "table" ; version: 1 }, SerializedElementNode>

Defined in

lexical-table/src/LexicalTableNode.ts:34


SerializedTableRowNode

Ƭ SerializedTableRowNode: Spread<{ height: number ; type: "tablerow" ; version: 1 }, SerializedElementNode>

Defined in

lexical-table/src/LexicalTableRowNode.ts:23

Variables

INSERT_TABLE_COMMAND

Const INSERT_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload>

Defined in

lexical-table/src/index.ts:97


TableCellHeaderStates

Const TableCellHeaderStates: Object

Type declaration

NameType
BOTHnumber
COLUMNnumber
NO_STATUSnumber
ROWnumber

Defined in

lexical-table/src/LexicalTableCellNode.ts:30

Functions

$createTableCellNode

$createTableCellNode(headerState, colSpan?, width?): TableCellNode

Parameters

NameTypeDefault value
headerStatenumberundefined
colSpannumber1
width?numberundefined

Returns

TableCellNode

Defined in

lexical-table/src/LexicalTableCellNode.ts:250


$createTableNode

$createTableNode(): TableNode

Returns

TableNode

Defined in

lexical-table/src/LexicalTableNode.ts:240


$createTableNodeWithDimensions

$createTableNodeWithDimensions(rowCount, columnCount, includeHeaders?): TableNode

Parameters

NameTypeDefault value
rowCountnumberundefined
columnCountnumberundefined
includeHeadersbooleantrue

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:29


$createTableRowNode

$createTableRowNode(height?): TableRowNode

Parameters

NameType
height?number

Returns

TableRowNode

Defined in

lexical-table/src/LexicalTableRowNode.ts:114


$deleteTableColumn

$deleteTableColumn(tableNode, targetIndex): TableNode

Parameters

NameType
tableNodeTableNode
targetIndexnumber

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:268


$getElementGridForTableNode

$getElementGridForTableNode(editor, tableNode): Grid

Parameters

NameType
editorLexicalEditor
tableNodeTableNode

Returns

Grid

Defined in

lexical-table/src/LexicalTableNode.ts:223


$getTableCellNodeFromLexicalNode

$getTableCellNodeFromLexicalNode(startingNode): TableCellNode | null

Parameters

NameType
startingNodeLexicalNode

Returns

TableCellNode | null

Defined in

lexical-table/src/LexicalTableUtils.ts:60


$getTableColumnIndexFromTableCellNode

$getTableColumnIndexFromTableCellNode(tableCellNode): number

Parameters

NameType
tableCellNodeTableCellNode

Returns

number

Defined in

lexical-table/src/LexicalTableUtils.ts:104


$getTableNodeFromLexicalNodeOrThrow

$getTableNodeFromLexicalNodeOrThrow(startingNode): TableNode

Parameters

NameType
startingNodeLexicalNode

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:84


$getTableRowIndexFromTableCellNode

$getTableRowIndexFromTableCellNode(tableCellNode): number

Parameters

NameType
tableCellNodeTableCellNode

Returns

number

Defined in

lexical-table/src/LexicalTableUtils.ts:96


$getTableRowNodeFromTableCellNodeOrThrow

$getTableRowNodeFromTableCellNodeOrThrow(startingNode): TableRowNode

Parameters

NameType
startingNodeLexicalNode

Returns

TableRowNode

Defined in

lexical-table/src/LexicalTableUtils.ts:72


$insertTableColumn

$insertTableColumn(tableNode, targetIndex, shouldInsertAfter?, columnCount, grid): TableNode

Parameters

NameTypeDefault value
tableNodeTableNodeundefined
targetIndexnumberundefined
shouldInsertAfterbooleantrue
columnCountnumberundefined
gridGridundefined

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:214


$insertTableRow

$insertTableRow(tableNode, targetIndex, shouldInsertAfter?, rowCount, grid): TableNode

Parameters

NameTypeDefault value
tableNodeTableNodeundefined
targetIndexnumberundefined
shouldInsertAfterbooleantrue
rowCountnumberundefined
gridGridundefined

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:147


$isTableCellNode

$isTableCellNode(node): node is TableCellNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableCellNode

Defined in

lexical-table/src/LexicalTableCellNode.ts:258


$isTableNode

$isTableNode(node): node is TableNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableNode

Defined in

lexical-table/src/LexicalTableNode.ts:244


$isTableRowNode

$isTableRowNode(node): node is TableRowNode

Parameters

NameType
nodeundefined | null | LexicalNode

Returns

node is TableRowNode

Defined in

lexical-table/src/LexicalTableRowNode.ts:118


$removeTableRowAtIndex

$removeTableRowAtIndex(tableNode, indexToDelete): TableNode

Parameters

NameType
tableNodeTableNode
indexToDeletenumber

Returns

TableNode

Defined in

lexical-table/src/LexicalTableUtils.ts:132


applyTableHandlers

applyTableHandlers(tableNode, tableElement, editor): TableSelection

Parameters

NameType
tableNodeTableNode
tableElementHTMLTableElementWithWithTableSelectionState
editorLexicalEditor

Returns

TableSelection

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:58


getCellFromTarget

getCellFromTarget(node): Cell | null

Parameters

NameType
nodeNode

Returns

Cell | null

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:999


getTableSelectionFromTableElement

getTableSelectionFromTableElement(tableElement): TableSelection | null

Parameters

NameType
tableElementHTMLTableElementWithWithTableSelectionState

Returns

TableSelection | null

Defined in

lexical-table/src/LexicalTableSelectionHelpers.ts:993