Module: @lexical/table
Classes
Type Aliases
Cell
Ƭ Cell: Object
Type declaration
Name | Type |
---|---|
elem | HTMLElement |
hasBackgroundColor | boolean |
highlighted | boolean |
x | number |
y | number |
Defined in
lexical-table/src/LexicalTableSelection.ts:44
HTMLTableElementWithWithTableSelectionState
Ƭ HTMLTableElementWithWithTableSelectionState: HTMLTableElement
& Record
<typeof LEXICAL_ELEMENT_KEY
, TableSelection
>
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:550
InsertTableCommandPayload
Ƭ InsertTableCommandPayload: Readonly
<{ columns
: string
; includeHeaders?
: InsertTableCommandPayloadHeaders
; rows
: string
}>
Defined in
lexical-table/src/index.ts:67
InsertTableCommandPayloadHeaders
Ƭ InsertTableCommandPayloadHeaders: Readonly
<{ columns
: boolean
; rows
: boolean
}> | boolean
Defined in
lexical-table/src/index.ts:60
SerializedTableCellNode
Ƭ SerializedTableCellNode: Spread
<{ backgroundColor?
: null
| string
; headerState
: TableCellHeaderState
; width?
: number
}, SerializedGridCellNode
>
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
Variables
INSERT_TABLE_COMMAND
• Const
INSERT_TABLE_COMMAND: LexicalCommand
<InsertTableCommandPayload
>
Defined in
lexical-table/src/index.ts:73
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
$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:310
$createTableNode
▸ $createTableNode(): TableNode
Returns
Defined in
lexical-table/src/LexicalTableNode.ts:238
$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:40
$createTableRowNode
▸ $createTableRowNode(height?
): TableRowNode
Parameters
Name | Type |
---|---|
height? | number |
Returns
Defined in
lexical-table/src/LexicalTableRowNode.ts:121
$deleteTableColumn
▸ $deleteTableColumn(tableNode
, targetIndex
): TableNode
Parameters
Name | Type |
---|---|
tableNode | TableNode |
targetIndex | number |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:421
$deleteTableColumn__EXPERIMENTAL
▸ $deleteTableColumn__EXPERIMENTAL(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:520
$deleteTableRow__EXPERIMENTAL
▸ $deleteTableRow__EXPERIMENTAL(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:444
$getElementGridForTableNode
▸ $getElementGridForTableNode(editor
, tableNode
): Grid
Parameters
Name | Type |
---|---|
editor | LexicalEditor |
tableNode | TableNode |
Returns
Grid
Defined in
lexical-table/src/LexicalTableNode.ts:221
$getTableCellNodeFromLexicalNode
▸ $getTableCellNodeFromLexicalNode(startingNode
): TableCellNode
| null
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
TableCellNode
| null
Defined in
lexical-table/src/LexicalTableUtils.ts:76
$getTableColumnIndexFromTableCellNode
▸ $getTableColumnIndexFromTableCellNode(tableCellNode
): number
Parameters
Name | Type |
---|---|
tableCellNode | TableCellNode |
Returns
number
Defined in
lexical-table/src/LexicalTableUtils.ts:120
$getTableNodeFromLexicalNodeOrThrow
▸ $getTableNodeFromLexicalNodeOrThrow(startingNode
): TableNode
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:100
$getTableRowIndexFromTableCellNode
▸ $getTableRowIndexFromTableCellNode(tableCellNode
): number
Parameters
Name | Type |
---|---|
tableCellNode | TableCellNode |
Returns
number
Defined in
lexical-table/src/LexicalTableUtils.ts:112
$getTableRowNodeFromTableCellNodeOrThrow
▸ $getTableRowNodeFromTableCellNodeOrThrow(startingNode
): TableRowNode
Parameters
Name | Type |
---|---|
startingNode | LexicalNode |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:88
$insertTableColumn
▸ $insertTableColumn(tableNode
, targetIndex
, shouldInsertAfter?
, columnCount
, grid
): TableNode
Parameters
Name | Type | Default value |
---|---|---|
tableNode | TableNode | undefined |
targetIndex | number | undefined |
shouldInsertAfter | boolean | true |
columnCount | number | undefined |
grid | Grid | undefined |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:283
$insertTableColumn__EXPERIMENTAL
▸ $insertTableColumn__EXPERIMENTAL(insertAfter?
): void
Parameters
Name | Type | Default value |
---|---|---|
insertAfter | boolean | true |
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:342
$insertTableRow
▸ $insertTableRow(tableNode
, targetIndex
, shouldInsertAfter?
, rowCount
, grid
): TableNode
Parameters
Name | Type | Default value |
---|---|---|
tableNode | TableNode | undefined |
targetIndex | number | undefined |
shouldInsertAfter | boolean | true |
rowCount | number | undefined |
grid | Grid | undefined |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:163
$insertTableRow__EXPERIMENTAL
▸ $insertTableRow__EXPERIMENTAL(insertAfter?
): void
Parameters
Name | Type | Default value |
---|---|---|
insertAfter | boolean | true |
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:230
$isTableCellNode
▸ $isTableCellNode(node
): node is TableCellNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TableCellNode
Defined in
lexical-table/src/LexicalTableCellNode.ts:318
$isTableNode
▸ $isTableNode(node
): node is TableNode
Parameters
Name | Type |
---|---|
node | undefined | null | LexicalNode |
Returns
node is TableNode
Defined in
lexical-table/src/LexicalTableNode.ts:242
$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
$removeTableRowAtIndex
▸ $removeTableRowAtIndex(tableNode
, indexToDelete
): TableNode
Parameters
Name | Type |
---|---|
tableNode | TableNode |
indexToDelete | number |
Returns
Defined in
lexical-table/src/LexicalTableUtils.ts:148
$unmergeCell
▸ $unmergeCell(): void
Returns
void
Defined in
lexical-table/src/LexicalTableUtils.ts:605
applyTableHandlers
▸ applyTableHandlers(tableNode
, tableElement
, editor
, hasTabHandler
): TableSelection
Parameters
Name | Type |
---|---|
tableNode | TableNode |
tableElement | HTMLTableElementWithWithTableSelectionState |
editor | LexicalEditor |
hasTabHandler | boolean |
Returns
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:58
getCellFromTarget
▸ getCellFromTarget(node
): Cell
| null
Parameters
Name | Type |
---|---|
node | Node |
Returns
Cell
| null
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:566
getTableSelectionFromTableElement
▸ getTableSelectionFromTableElement(tableElement
): TableSelection
| null
Parameters
Name | Type |
---|---|
tableElement | HTMLTableElementWithWithTableSelectionState |
Returns
TableSelection
| null
Defined in
lexical-table/src/LexicalTableSelectionHelpers.ts:560