API Reference
@univerjs
@univerjs/sheets
classes
Workbookselections

@univerjs/sheets v0.4.2Docs


Class: WorkbookSelections

This class manages selections in a single workbook.

Extends

Constructors

new WorkbookSelections()

new WorkbookSelections(_workbook): WorkbookSelections

Parameters

ParameterType
_workbookWorkbook

Returns

WorkbookSelections

Overrides

Disposable.constructor

Defined in

packages/sheets/src/services/selections/selection-manager.service.ts:224 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_selectionMoveEnd$readonlyBehaviorSubject<ISelectionWithStyle[]>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:215 (opens in a new tab)
beforeSelectionMoveEnd$readonlyObservable<ISelectionWithStyle[]>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:222 (opens in a new tab)
selectionMoveEnd$readonlyObservable<ISelectionWithStyle[]>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:216 (opens in a new tab)
selectionMoveStart$readonlyObservable<Nullable<ISelectionWithStyle[]>>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:210 (opens in a new tab)
selectionMoving$readonlyObservable<Nullable<ISelectionWithStyle[]>>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:213 (opens in a new tab)
selectionSet$readonlyObservable<ISelectionWithStyle[]>undefined-packages/sheets/src/services/selections/selection-manager.service.ts:219 (opens in a new tab)

Methods

addSelections()

addSelections(sheetId, selectionDatas): void

Parameters

ParameterType
sheetIdstring
selectionDatasISelectionWithStyle[]

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

Disposable.dispose

Defined in

packages/sheets/src/services/selections/selection-manager.service.ts:230 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

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

ParameterType
sheetIdstring

Returns

ISelectionWithStyle[]

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

ParameterTypeDefault value
sheetIdstringundefined
selectionDatasISelectionWithStyle[][]
typeSelectionMoveTypeundefined

Returns

void

Defined in

packages/sheets/src/services/selections/selection-manager.service.ts:258 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.