Extends
Properties
collapseToEnd
#
Get a new selection at the end point of this one
- Overrides:
- Source:
collapseToFrom
#
Get a new selection at the 'from' point of this one
- Overrides:
- Source:
collapseToStart
#
Get a new selection at the start point of this one
- Overrides:
- Source:
collapseToTo
#
Get a new selection at the 'to' point of this one
- Overrides:
- Source:
equals
#
Check if two selections are equal
- Overrides:
- Source:
getCoveringRange
#
Get the covering linear range for this selection
- Overrides:
- Source:
getDescription
#
Get a textual description of this selection, for debugging purposes
- Overrides:
- Source:
getRanges
#
Get the content ranges for this selection
- Overrides:
- Source:
isCollapsed
#
Check if a selection is collapsed
- Overrides:
- Source:
toJSON
#
Get a JSON serialization of this selection
- Overrides:
- Source:
translateByTransaction
#
Apply translations from a transaction
- Overrides:
- Source:
translateByTransactionWithAuthor
#
Apply translations from a transaction, with bias depending on author ID comparison
- Overrides:
- Source:
Methods
containsCell(cell) → {boolean}
#
Check if a given cell is within this selection
Parameters:
Name | Type | Description |
---|---|---|
cell |
ve.dm.TableMatrixCell | Table matrix cell |
Returns:
Cell is within this selection
- Type
- boolean
expand(doc) → {ve.dm.TableSelection}private
#
Expand the selection to cover all merged cells
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
Expanded table selection
- Type
- ve.dm.TableSelection
getColCount() → {number}
#
Get the number of columns covered by the selection
Returns:
Number of columns covered
- Type
- number
getMatrixCells(doc, [includePlaceholders]) → {Array.<ve.dm.TableMatrixCell>}
#
Retrieves all cells within a given selection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
|
includePlaceholders |
boolean |
optional |
Include placeholders in result |
Returns:
List of table cells
- Type
- Array.<ve.dm.TableMatrixCell>
getName() → {string}
#
Get the name of the selection type
- Inherited from:
- Source:
Returns:
Selection type name
- Type
- string
getOuterRanges(doc) → {Array.<ve.Range>}
#
Get outer ranges of the selected cells
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
Outer ranges
getRowCount() → {number}
#
Get the number of rows covered by the selection
Returns:
Number of rows covered
- Type
- number
getTableNode(doc) → {ve.dm.TableNode}
#
Get the selection's table node
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
Table node
- Type
- ve.dm.TableNode
getTableSliceRanges(doc) → {Array.<ve.Range>}
#
Get all the ranges required to build a table slice from the selection
In addition to the outer ranges of the cells, this also includes the start and end tags of table rows, sections and the table itself.
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
Ranges
Get all the ranges required to build a table slice from the selection
In addition to the outer ranges of the cells, this also includes the start and end tags of table rows, sections and the table itself.
isEditable(doc) → {boolean}
#
Check the selected cells are all editable
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
Cells are all editable
- Type
- boolean
isFullCol(doc) → {boolean}
#
Check if the table selection covers one or more full columns
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
The table selection covers one or more full columns
- Type
- boolean
isFullRow(doc) → {boolean}
#
Check if the table selection covers one or more full rows
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
The table selection covers one or more full rows
- Type
- boolean
isMergeable(doc) → {boolean}
#
Check if the selection is mergeable or unmergeable
The selection must span more than one matrix cell, but only one table section.
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
The selection is mergeable or unmergeable
- Type
- boolean
Check if the selection is mergeable or unmergeable
The selection must span more than one matrix cell, but only one table section.
isNull() → {boolean}
#
Check if this selection is null
- Inherited from:
- Source:
Returns:
The selection is null
- Type
- boolean
isSingleCell(doc) → {boolean}
#
Check if the selection spans a single cell
Parameters:
Name | Type | Description |
---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
Returns:
The selection spans a single cell
- Type
- boolean
newFromAdjustment(doc, fromColOffset, fromRowOffset, [toColOffset], [toRowOffset], [wrap]) → {ve.dm.TableSelection}
#
Get a new selection with adjusted row and column positions
Placeholder cells are skipped over so this method can be used for cursoring.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
doc |
ve.dm.Document | The document to which this selection applies |
|
fromColOffset |
number | Starting column offset |
|
fromRowOffset |
number | Starting row offset |
|
toColOffset |
number |
optional |
End column offset |
toRowOffset |
number |
optional |
End row offset |
wrap |
number |
optional |
Wrap to the next/previous row if column limits are exceeded |
Returns:
Adjusted selection
- Type
- ve.dm.TableSelection
Get a new selection with adjusted row and column positions
Placeholder cells are skipped over so this method can be used for cursoring.
translateByChange(change, authorId) → {ve.dm.Selection}
#
Apply translations from a change
Parameters:
Name | Type | Description |
---|---|---|
change |
ve.dm.Change | |
authorId |
number | The author ID of this selection |
- Inherited from:
- Source:
Returns:
A new translated selection
- Type
- ve.dm.Selection
translateByTransactions(txs, [excludeInsertion]) → {ve.dm.Selection}
#
Apply translations from a set of transactions
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
txs |
Array.<ve.dm.Transaction> | Transactions |
|
excludeInsertion |
boolean |
optional |
Do not grow to cover insertions at boundaries |
- Inherited from:
- Source:
Returns:
A new translated selection
- Type
- ve.dm.Selection
getTableMatrixCells(matrix, selectionOffsets, [includePlaceholders]) → {Array.<ve.dm.TableMatrixCell>}static
#
Retrieves all cells within a given selection.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
matrix |
ve.dm.TableMatrix | The table matrix |
|
selectionOffsets |
Object | Selection col/row offsets (startRow/endRow/startCol/endCol) |
|
includePlaceholders |
boolean |
optional |
Include placeholders in result |
Returns:
List of table cells
- Type
- Array.<ve.dm.TableMatrixCell>