@univerjssheetsindexclassesWorkbookselectionmodel

@univerjs/sheets v0.5.4


Class: WorkbookSelectionModel

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:28

Origin name: WorkbookSelections NOT Same as @univerjs/sheets-ui.SelectionRenderModel, that’s data for SelectionControl in rendering.

Extends

Constructors

new WorkbookSelectionModel()

new WorkbookSelectionModel(_workbook): WorkbookSelectionModel

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:49

Parameters

ParameterType
_workbookWorkbook

Returns

WorkbookSelectionModel

Overrides

Disposable.constructor

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:96
_selectionMoveEnd$readonlyBehaviorSubject<ISelectionWithStyle[]>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:40
beforeSelectionMoveEnd$readonlyObservable<ISelectionWithStyle[]>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:47
selectionMoveEnd$readonlyObservable<ISelectionWithStyle[]>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:41
selectionMoveStart$readonlyObservable<Nullable<ISelectionWithStyle[]>>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:35
selectionMoving$readonlyObservable<Nullable<ISelectionWithStyle[]>>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:38
selectionSet$readonlyObservable<ISelectionWithStyle[]>undefined-submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:44

Methods

addSelections()

addSelections(sheetId, selectionDatas): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:65

Parameters

ParameterType
sheetIdstring
selectionDatasISelectionWithStyle[]

Returns

void


clear()

clear(): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:135

Clear all selections in this workbook.

Returns

void


deleteSheetSelection()

deleteSheetSelection(sheetId): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:130

Parameters

ParameterType
sheetIdstring

Returns

void


dispose()

dispose(): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:55

Returns

void

Overrides

Disposable.dispose


disposeWithMe()

disposeWithMe(disposable): IDisposable

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:99

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe


ensureNotDisposed()

protected ensureNotDisposed(): void

Defined in: submodules/univer/packages/core/src/shared/lifecycle.ts:103

Returns

void

Inherited from

Disposable.ensureNotDisposed


getCurrentLastSelection()

getCurrentLastSelection(): Readonly<Nullable<ISelectionWithStyle & {
  primary: ISelectionCell;
}>>

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:144

Returns

Readonly<Nullable<ISelectionWithStyle & { primary: ISelectionCell; }>>


getCurrentSelections()

getCurrentSelections(): readonly ISelectionWithStyle[]

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:105

Returns

readonly ISelectionWithStyle[]


getSelectionOfWorksheet()

getSelectionOfWorksheet(sheetId): ISelectionWithStyle[]

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:114

Parameters

ParameterType
sheetIdstring

Returns

ISelectionWithStyle[]

Deprecated

use getSelectionsOfWorksheet instead.


getSelectionsOfWorksheet()

getSelectionsOfWorksheet(sheetId): ISelectionWithStyle[]

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:118

Parameters

ParameterType
sheetIdstring

Returns

ISelectionWithStyle[]


setSelections()

setSelections(
   sheetId, 
   selectionDatas, 
   type): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:77

Set selectionDatas to _worksheetSelections, and emit selectionDatas by type.

Parameters

ParameterTypeDefault value
sheetIdstringundefined
selectionDatasISelectionWithStyle[][]
typeSelectionMoveTypeundefined

Returns

void


setSelectionsOfWorksheet()

setSelectionsOfWorksheet(sheetId, selections): void

Defined in: submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:126

Parameters

ParameterType
sheetIdstring
selectionsISelectionWithStyle[]

Returns

void