@univerjssheetsindexclassesWorkbookselectionmodel

@univerjs/sheets v0.5.0-beta.1Docs


Class: WorkbookSelectionModel

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

Parameters

ParameterType
_workbookWorkbook

Returns

WorkbookSelectionModel

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93
_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

Parameters

ParameterType
sheetIdstring
selectionDatasISelectionWithStyle[]

Returns

void

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:71


clear()

clear(): void

Clear all selections in this workbook.

Returns

void

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:66


deleteSheetSelection()

deleteSheetSelection(sheetId): void

Parameters

ParameterType
sheetIdstring

Returns

void

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:155


dispose()

dispose(): void

Returns

void

Overrides

Disposable.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:96


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

submodules/univer/packages/core/src/shared/lifecycle.ts:100


getCurrentLastSelection()

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

Returns

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

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:137


getCurrentSelections()

getCurrentSelections(): readonly ISelectionWithStyle[]

Returns

readonly ISelectionWithStyle[]

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:112


getSelectionOfWorksheet()

getSelectionOfWorksheet(sheetId): ISelectionWithStyle[]

Parameters

ParameterType
sheetIdstring

Returns

ISelectionWithStyle[]

Deprecated

use getSelectionsOfWorksheet instead.

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:121


getSelectionsOfWorksheet()

getSelectionsOfWorksheet(sheetId): ISelectionWithStyle[]

Parameters

ParameterType
sheetIdstring

Returns

ISelectionWithStyle[]

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:125


setSelections()

setSelections(
   sheetId, 
   selectionDatas, 
   type): void

Set selectionDatas to _worksheetSelections, and emit selectionDatas by type.

Parameters

ParameterTypeDefault value
sheetIdstringundefined
selectionDatasISelectionWithStyle[][]
typeSelectionMoveTypeundefined

Returns

void

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-data-model.ts:83