@univerjssheetsindexclassesRefselectionsservice

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


Class: RefSelectionsService

RefSelectionsService treats selectionMoveStart$ selectionMoving$ and selectionMoveEnd$ differently than SheetsSelectionsService. Because ref selections can be in different workbooks.

Extends

Constructors

new RefSelectionsService()

new RefSelectionsService(_instanceSrv): RefSelectionsService

Parameters

ParameterType
_instanceSrvIUniverInstanceService

Returns

RefSelectionsService

Overrides

SheetsSelectionsService.constructor

Defined in

submodules/univer/packages/sheets/src/services/selections/ref-selections.service.ts:37

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseSheetsSelectionsService._disposedsubmodules/univer/packages/core/src/shared/lifecycle.ts:93
_instanceSrvreadonlyIUniverInstanceServiceundefinedSheetsSelectionsService._instanceSrvsubmodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:45
_workbookSelectionsprotectedMap<string, WorkbookSelectionModel>undefinedSheetsSelectionsService._workbookSelectionssubmodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:176
dispose$protectedSubject<void>undefinedSheetsSelectionsService.dispose$submodules/univer/packages/core/src/shared/lifecycle.ts:117
selectionMoveEnd$publicObservable<ISelectionWithStyle[]>undefinedSheetsSelectionsService.selectionMoveEnd$submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:42
selectionMoveStart$publicObservable<Nullable<ISelectionWithStyle[]>>undefinedSheetsSelectionsService.selectionMoveStart$submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:40
selectionMoving$publicObservable<Nullable<ISelectionWithStyle[]>>undefinedSheetsSelectionsService.selectionMoving$submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:41

Accessors

currentSelectionParam

Get Signature

get currentSelectionParam(): Nullable<ISelectionManagerSearchParam>
Returns

Nullable<ISelectionManagerSearchParam>

Inherited from

SheetsSelectionsService.currentSelectionParam

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:36

Methods

_ensureWorkbookSelection()

protected _ensureWorkbookSelection(unitId): WorkbookSelectionModel

Parameters

ParameterType
unitIdstring

Returns

WorkbookSelectionModel

Inherited from

SheetsSelectionsService._ensureWorkbookSelection

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:177


_getCurrentSelections()

protected _getCurrentSelections(): ISelectionWithStyle[]

Returns

ISelectionWithStyle[]

Inherited from

SheetsSelectionsService._getCurrentSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:162


_init()

protected _init(): void

Returns

void

Overrides

SheetsSelectionsService._init

Defined in

submodules/univer/packages/sheets/src/services/selections/ref-selections.service.ts:43


_removeWorkbookSelection()

protected _removeWorkbookSelection(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Inherited from

SheetsSelectionsService._removeWorkbookSelection

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:192


addSelections()

addSelections(selectionsData)

addSelections(selectionsData): void
Parameters
ParameterType
selectionsDataISelectionWithStyle[]
Returns

void

Inherited from

SheetsSelectionsService.addSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:80

addSelections(unitId, worksheetId, selectionDatas)

addSelections(
   unitId, 
   worksheetId, 
   selectionDatas): void
Parameters
ParameterType
unitIdstring
worksheetIdstring
selectionDatasISelectionWithStyle[]
Returns

void

Inherited from

SheetsSelectionsService.addSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:81


clear()

clear(): void

Clear all selections in all workbooks. invoked by prompt.controller

Returns

void

Inherited from

SheetsSelectionsService.clear

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:67


clearCurrentSelections()

clearCurrentSelections(): void

Returns

void

Inherited from

SheetsSelectionsService.clearCurrentSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:131


dispose()

dispose(): void

Returns

void

Inherited from

SheetsSelectionsService.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

SheetsSelectionsService.disposeWithMe

Defined in

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


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

SheetsSelectionsService.ensureNotDisposed

Defined in

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


getCurrentLastSelection()

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

Returns

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

Inherited from

SheetsSelectionsService.getCurrentLastSelection

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:75


getCurrentSelections()

getCurrentSelections(): readonly ISelectionWithStyle[]

Returns

readonly ISelectionWithStyle[]

Inherited from

SheetsSelectionsService.getCurrentSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:71


getWorkbookSelections()

getWorkbookSelections(unitId): WorkbookSelectionModel

Parameters

ParameterType
unitIdstring

Returns

WorkbookSelectionModel

Inherited from

SheetsSelectionsService.getWorkbookSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:172


isOverlapping()

isOverlapping(): boolean

Determine whether multiple current selections overlap

Returns

boolean

Deprecated

this should be extracted to an pure function

Inherited from

SheetsSelectionsService.isOverlapping

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:141


setSelections()

setSelections(selectionDatas, type)

setSelections(selectionDatas, type?): void

Set selection data to WorkbookSelectionModel. If type is not specified, this method would clear all existing selections.

Parameters
ParameterType
selectionDatasISelectionWithStyle[]
type?SelectionMoveType
Returns

void

Inherited from

SheetsSelectionsService.setSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:105

setSelections(unitId, worksheetId, selectionDatas, type)

setSelections(
   unitId, 
   worksheetId, 
   selectionDatas, 
   type?): void
Parameters
ParameterType
unitIdstring
worksheetIdstring
selectionDatasISelectionWithStyle[]
type?SelectionMoveType
Returns

void

Inherited from

SheetsSelectionsService.setSelections

Defined in

submodules/univer/packages/sheets/src/services/selections/selection-manager.service.ts:106