Module: @lexical/table
Classes
Type Aliases
HTMLTableElementWithWithTableSelectionState
Ƭ HTMLTableElementWithWithTableSelectionState: HTMLTableElement
& Record
<typeof LEXICAL_ELEMENT_KEY
, TableObserver
>
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:696
InsertTableCommandPayload
Ƭ InsertTableCommandPayload: Readonly
<{ columns
: string
; includeHeaders?
: InsertTableCommandPayloadHeaders
; rows
: string
}>
Defined in
lexical-table/src/LexicalTableCommands.ts:20
InsertTableCommandPayloadHeaders
Ƭ InsertTableCommandPayloadHeaders: Readonly
<{ columns
: boolean
; rows
: boolean
}> | boolean
Defined in
lexical-table/src/LexicalTableCommands.ts:13
SerializedTableCellNode
Ƭ SerializedTableCellNode: Spread
<{ backgroundColor?
: null
| string
; colSpan?
: number
; headerState
: TableCellHeaderState
; rowSpan?
: number
; width?
: number
}, SerializedElementNode
>
Defined in
lexical-table/src/LexicalTableCellNode.ts:42
SerializedTableNode
Ƭ SerializedTableNode: SerializedElementNode
Defined in
lexical-table/src/LexicalTableNode.ts:33
SerializedTableRowNode
Ƭ SerializedTableRowNode: Spread
<{ height
: number
}, SerializedElementNode
>
Defined in
lexical-table/src/LexicalTableRowNode.ts:25
TableDOMCell
Ƭ TableDOMCell: Object
Type declaration
Name | Type |
---|---|
elem | HTMLElement |
hasBackgroundColor | boolean |
highlighted | boolean |
x | number |
y | number |
Defined in
lexical-table/src/LexicalTableObserver.ts:39
TableSelectionShape
Ƭ TableSelectionShape: Object
Type declaration
Name | Type |
---|---|
fromX | number |
fromY | number |
toX | number |
toY | number |
Defined in
lexical-table/src/LexicalTableSelection.ts:28
Variables
INSERT_TABLE_COMMAND
• Const
INSERT_TABLE_COMMAND: LexicalCommand
<InsertTableCommandPayload
>
Defined in
lexical-table/src/LexicalTableCommands.ts:26
TableCellHeaderStates
• Const
TableCellHeaderStates: Object
Type declaration
Name | Type |
---|---|
BOTH | number |
COLUMN | number |
NO_STATUS | number |
ROW | number |
Defined in
lexical-table/src/LexicalTableCellNode.ts:32
Functions
$computeTableMap
▸ $computeTableMap(grid
, cellA
, cellB
): [TableMapType
, TableMapValueType
, TableMapValueType
]
Parameters
Name | Type |
---|---|
grid | TableNode |
cellA | TableCellNode |
cellB | TableCellNode |
Returns
[TableMapType
, TableMapValueType
, TableMapValueType
]
Defined in
lexical-table/src/LexicalTableUtils.ts:712
$createTableCellNode
▸ $createTableCellNode(headerState
, colSpan?
, width?
): TableCellNode
Parameters
Name | Type | Default value |
---|---|---|
headerState | number | undefined |
colSpan | number | 1 |
width? | number | undefined |
Returns
Defined in
lexical-table/src/LexicalTableCellNode.ts:344
$createTableNode
▸ $createTableNode(): TableNode
Returns
Defined in
lexical-table/src/LexicalTableNode.ts:246
$createTableNodeWithDimensions
▸ $createTableNodeWithDimensions(rowCount
, columnCount
, includeHeaders?
): TableNode
Parameters
Name | Type | Default value |
---|---|---|
rowCount | number | undefined |
columnCount | number | undefined |
includeHeaders | InsertTableCommandPayloadHeaders | true |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:39
$createTableRowNode
▸ $createTableRowNode(height?
): TableRowNode
Parameters
Name | Type |
---|---|
height? | number |
Returns
Defined in
lexical-table/src/LexicalTableRowNode.ts:121
$createTableSelection
▸ $createTableSelection(): TableSelection
Returns
Defined in
lexical-table/src/LexicalTableSelection.ts:347
$deleteTableColumn
▸ $deleteTableColumn(tableNode
, targetIndex
): TableNode
Parameters
Name | Type |
---|---|
tableNode | TableNode |
targetIndex | number |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:470
$deleteTableColumn__EXPERIMENTAL
▸ $deleteTableColumn__EXPERIMENTAL(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:569
$deleteTableRow__EXPERIMENTAL
▸ $deleteTableRow__EXPERIMENTAL(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:493
$getElementForTableNode
▸ $getElementForTableNode(editor
, tableNode
): TableDOMTable
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
tableNode | TableNode |
Returns
TableDOMTable
Defined in
lexical-table/src/LexicalTableNode.ts:229
$getNodeTriplet
▸ $getNodeTriplet(source
): [TableCellNode
, TableRowNode
, TableNode
]
Parameters
Name | Type |
---|---|
source | LexicalNode | PointType | TableCellNode |
Returns
[TableCellNode
, TableRowNode
, TableNode
]
Defined in
lexical-table/src/LexicalTableUtils.ts:773
$getTableCellNodeFromLexicalNode
▸ $getTableCellNodeFromLexicalNode(startingNode
): TableCellNode
| null
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
TableCellNode
| null
Defined in
lexical-table/src/LexicalTableUtils.ts:75
$getTableCellNodeRect
▸ $getTableCellNodeRect(tableCellNode
): { colSpan
: number
; columnIndex
: number
; rowIndex
: number
; rowSpan
: number
} | null
Parameters
Name | Type |
---|---|
tableCellNode | TableCellNode |
Returns
{ colSpan
: number
; columnIndex
: number
; rowIndex
: number
; rowSpan
: number
} | null
Defined in
lexical-table/src/LexicalTableUtils.ts:807
$getTableColumnIndexFromTableCellNode
▸ $getTableColumnIndexFromTableCellNode(tableCellNode
): number
Parameters
Name | Type |
---|---|
tableCellNode | TableCellNode |
Returns
number
Defined in
lexical-table/src/LexicalTableUtils.ts:119
$getTableNodeFromLexicalNodeOrThrow
▸ $getTableNodeFromLexicalNodeOrThrow(startingNode
): TableNode
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:99
$getTableRowIndexFromTableCellNode
▸ $getTableRowIndexFromTableCellNode(tableCellNode
): number
Parameters
Name | Type |
---|---|
tableCellNode | TableCellNode |
Returns
number
Defined in
lexical-table/src/LexicalTableUtils.ts:111
$getTableRowNodeFromTableCellNodeOrThrow
▸ $getTableRowNodeFromTableCellNodeOrThrow(startingNode
): TableRowNode
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:87
$insertTableColumn
▸ $insertTableColumn(tableNode
, targetIndex
, shouldInsertAfter?
, columnCount
, table
): TableNode
Parameters
Name | Type | Default value |
---|---|---|
tableNode | TableNode | undefined |
targetIndex | number | undefined |
shouldInsertAfter | boolean | true |
columnCount | number | undefined |
table | TableDOMTable | undefined |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:311
$insertTableColumn__EXPERIMENTAL
▸ $insertTableColumn__EXPERIMENTAL(insertAfter?
): void
Parameters
Name | Type | Default value |
---|---|---|
insertAfter | boolean | true |
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:370
$insertTableRow
▸ $insertTableRow(tableNode
, targetIndex
, shouldInsertAfter?
, rowCount
, table
): TableNode
Parameters
Name | Type | Default value |
---|---|---|
tableNode | TableNode | undefined |
targetIndex | number | undefined |
shouldInsertAfter | boolean | true |
rowCount | number | undefined |
table | TableDOMTable | undefined |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:162
$insertTableRow__EXPERIMENTAL
▸ $insertTableRow__EXPERIMENTAL(insertAfter?
): void
Parameters
Name | Type | Default value |
---|---|---|
insertAfter | boolean | true |
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:242
$isTableCellNode
▸ $isTableCellNode(node
): node is TableCellNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TableCellNode
Defined in
lexical-table/src/LexicalTableCellNode.ts:352
$isTableNode
▸ $isTableNode(node
): node is TableNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TableNode
Defined in
lexical-table/src/LexicalTableNode.ts:250
$isTableRowNode
▸ $isTableRowNode(node
): node is TableRowNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TableRowNode
Defined in
lexical-table/src/LexicalTableRowNode.ts:125
$isTableSelection
▸ $isTableSelection(x
): x is TableSelection
Parameters
Name | Type |
---|---|
x | unknown |
Returns
x is TableSelection
Defined in
lexical-table/src/LexicalTableSelection.ts:343
$removeTableRowAtIndex
▸ $removeTableRowAtIndex(tableNode
, indexToDelete
): TableNode
Parameters
Name | Type |
---|---|
tableNode | TableNode |
indexToDelete | number |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:147
$unmergeCell
▸ $unmergeCell(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:654
applyTableHandlers
▸ applyTableHandlers(tableNode
, tableElement
, editor
, hasTabHandler
): TableObserver
Parameters
Name | Type |
---|---|
tableNode | TableNode |
tableElement | HTMLTableElementWithWithTableSelectionState |
editor | LexicalEditor |
hasTabHandler | boolean |
Returns
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:64
getDOMCellFromTarget
▸ getDOMCellFromTarget(node
): TableDOMCell
| null
Parameters
Name | Type |
---|---|
node | Node |
Returns
TableDOMCell
| null
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:712
getTableObserverFromTableElement
▸ getTableObserverFromTableElement(tableElement
): TableObserver
| null
Parameters
Name | Type |
---|---|
tableElement | HTMLTableElementWithWithTableSelectionState |
Returns
TableObserver
| null
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:706