Skip to main content

Class: TableSelection

@lexical/table.TableSelection

Implements

Constructors

constructor

new TableSelection(tableKey, anchor, focus): TableSelection

Parameters

NameType
tableKeystring
anchorPointType
focusPointType

Returns

TableSelection

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:115

Properties

_cachedNodes

_cachedNodes: null | LexicalNode[]

Implementation of

BaseSelection._cachedNodes

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:112


anchor

anchor: PointType

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:110


dirty

dirty: boolean

Implementation of

BaseSelection.dirty

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:113


focus

focus: PointType

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:111


tableKey

tableKey: string

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:109

Methods

clone

clone(): TableSelection

Returns

TableSelection

Implementation of

BaseSelection.clone

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:185


extract

extract(): LexicalNode[]

Returns

LexicalNode[]

Implementation of

BaseSelection.extract

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:197


getCachedNodes

getCachedNodes(): null | LexicalNode[]

Returns

null | LexicalNode[]

Implementation of

BaseSelection.getCachedNodes

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:155


getNodes

getNodes(): LexicalNode[]

Returns

LexicalNode[]

Implementation of

BaseSelection.getNodes

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:283


getShape

getShape(): TableSelectionShape

Returns

TableSelectionShape

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:244


getStartEndPoints

getStartEndPoints(): [PointType, PointType]

Returns

[PointType, PointType]

Implementation of

BaseSelection.getStartEndPoints

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:125


getTextContent

getTextContent(): string

Returns

string

Implementation of

BaseSelection.getTextContent

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:358


hasFormat

hasFormat(type): boolean

Returns whether the provided TextFormatType is present on the Selection. This will be true if any paragraph in table cells has the specified format.

Parameters

NameTypeDescription
typeTextFormatTypethe TextFormatType to check for.

Returns

boolean

true if the provided format is currently toggled on on the Selection, false otherwise.

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:216


insertNodes

insertNodes(nodes): void

Parameters

NameType
nodesLexicalNode[]

Returns

void

Implementation of

BaseSelection.insertNodes

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:231


insertRawText

insertRawText(text): void

Parameters

NameType
textstring

Returns

void

Implementation of

BaseSelection.insertRawText

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:201


insertText

insertText(): void

Returns

void

Implementation of

BaseSelection.insertText

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:205


is

is(selection): boolean

Parameters

NameType
selectionnull | BaseSelection

Returns

boolean

Implementation of

BaseSelection.is

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:163


isBackward

isBackward(): boolean

Returns whether the Selection is "backwards", meaning the focus logically precedes the anchor in the EditorState.

Returns

boolean

true if the Selection is backwards, false otherwise.

Implementation of

BaseSelection.isBackward

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:151


isCollapsed

isCollapsed(): boolean

Returns

boolean

Implementation of

BaseSelection.isCollapsed

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:193


isValid

isValid(): boolean

$createTableSelection unfortunately makes it very easy to create nonsense selections, so we have a method to see if the selection probably makes sense.

Returns

boolean

true if the TableSelection is (probably) valid

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:136


set

set(tableKey, anchorCellKey, focusCellKey): void

Parameters

NameType
tableKeystring
anchorCellKeystring
focusCellKeystring

Returns

void

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:172


setCachedNodes

setCachedNodes(nodes): void

Parameters

NameType
nodesnull | LexicalNode[]

Returns

void

Implementation of

BaseSelection.setCachedNodes

Defined in

packages/lexical-table/src/LexicalTableSelection.ts:159