@univerjs/sheets v0.2.11 • Docs
Class: WorkbookSelections
This class manages selections in a single workbook.
Extends
Constructors
new WorkbookSelections()
new WorkbookSelections(_workbook): WorkbookSelections
Parameters
Parameter | Type |
---|---|
_workbook | Workbook |
Returns
Overrides
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:217 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
beforeSelectionMoveEnd$ | readonly | Observable <ISelectionWithStyle []> | undefined | - | packages/sheets/src/services/selections/selection-manager.service.ts:215 (opens in a new tab) |
selectionMoveEnd$ | readonly | Observable <ISelectionWithStyle []> | undefined | - | packages/sheets/src/services/selections/selection-manager.service.ts:212 (opens in a new tab) |
selectionMoveStart$ | readonly | Observable <Nullable <ISelectionWithStyle []>> | undefined | - | packages/sheets/src/services/selections/selection-manager.service.ts:206 (opens in a new tab) |
selectionMoving$ | readonly | Observable <Nullable <ISelectionWithStyle []>> | undefined | - | packages/sheets/src/services/selections/selection-manager.service.ts:209 (opens in a new tab) |
Methods
addSelections()
addSelections(sheetId, selectionDatas): void
Parameters
Parameter | Type |
---|---|
sheetId | string |
selectionDatas | ISelectionWithStyle [] |
Returns
void
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:238 (opens in a new tab)
clear()
clear(): void
Clear all selections in this workbook.
Returns
void
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:233 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:223 (opens in a new tab)
disposeWithMe()
protected disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureNotDisposed()
protected ensureNotDisposed(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)
getCurrentLastSelection()
getCurrentLastSelection(): Readonly<Nullable<ISelectionWithStyle & {
primary: ISelectionCell;
}>>
Returns
Readonly
<Nullable
<ISelectionWithStyle
& {
primary
: ISelectionCell
;
}>>
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:290 (opens in a new tab)
getCurrentSelections()
getCurrentSelections(): readonly ISelectionWithStyle[]
Returns
readonly ISelectionWithStyle
[]
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:274 (opens in a new tab)
getSelectionOfWorksheet()
getSelectionOfWorksheet(sheetId): ISelectionWithStyle[]
Parameters
Parameter | Type |
---|---|
sheetId | string |
Returns
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:278 (opens in a new tab)
setSelections()
setSelections(
sheetId,
selectionDatas,
type): void
Set selectionDatas to _worksheetSelections, and emit selectionDatas by type. If type is not specfied, this method would clear all existing selections.
Parameters
Parameter | Type |
---|---|
sheetId | string |
selectionDatas | ISelectionWithStyle [] |
type | SelectionMoveType |
Returns
void
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:251 (opens in a new tab)