@univerjs/sheets v0.4.2 • 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:224 (opens in a new tab)
Properties
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:245 (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:240 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Overrides
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:230 (opens in a new tab)
disposeWithMe()
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:301 (opens in a new tab)
getCurrentSelections()
getCurrentSelections(): readonly ISelectionWithStyle[]
Returns
readonly ISelectionWithStyle
[]
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:285 (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:289 (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 | Default value |
---|---|---|
sheetId | string | undefined |
selectionDatas | ISelectionWithStyle [] | [] |
type | SelectionMoveType | undefined |
Returns
void
Defined in
packages/sheets/src/services/selections/selection-manager.service.ts:258 (opens in a new tab)