API Reference
@univerjs
@univerjs/sheets
classes
Refselectionsservice

@univerjs/sheets v0.4.2Docs


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

packages/sheets/src/services/selections/ref-selections.service.ts:37 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseSheetsSelectionsService._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
_instanceSrvreadonlyIUniverInstanceServiceundefinedSheetsSelectionsService._instanceSrvpackages/sheets/src/services/selections/selection-manager.service.ts:57 (opens in a new tab)
_workbookSelectionsprotectedMap<string, WorkbookSelections>undefinedSheetsSelectionsService._workbookSelectionspackages/sheets/src/services/selections/selection-manager.service.ts:184 (opens in a new tab)
dispose$protectedSubject<void>undefinedSheetsSelectionsService.dispose$packages/core/src/shared/lifecycle.ts:117 (opens in a new tab)
selectionMoveEnd$publicObservable<ISelectionWithStyle[]>undefinedSheetsSelectionsService.selectionMoveEnd$packages/sheets/src/services/selections/selection-manager.service.ts:54 (opens in a new tab)
selectionMoveStart$publicObservable<Nullable<ISelectionWithStyle[]>>undefinedSheetsSelectionsService.selectionMoveStart$packages/sheets/src/services/selections/selection-manager.service.ts:52 (opens in a new tab)
selectionMoving$publicObservable<Nullable<ISelectionWithStyle[]>>undefinedSheetsSelectionsService.selectionMoving$packages/sheets/src/services/selections/selection-manager.service.ts:53 (opens in a new tab)

Accessors

currentSelectionParam

get currentSelectionParam(): Nullable<ISelectionManagerSearchParam>

Returns

Nullable<ISelectionManagerSearchParam>

Inherited from

SheetsSelectionsService.currentSelectionParam

Defined in

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

Methods

_ensureWorkbookSelection()

protected _ensureWorkbookSelection(unitId): WorkbookSelections

Parameters

ParameterType
unitIdstring

Returns

WorkbookSelections

Inherited from

SheetsSelectionsService._ensureWorkbookSelection

Defined in

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


_getCurrentSelections()

protected _getCurrentSelections(): ISelectionWithStyle[]

Returns

ISelectionWithStyle[]

Inherited from

SheetsSelectionsService._getCurrentSelections

Defined in

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


_init()

protected _init(): void

Returns

void

Overrides

SheetsSelectionsService._init

Defined in

packages/sheets/src/services/selections/ref-selections.service.ts:43 (opens in a new tab)


_removeWorkbookSelection()

protected _removeWorkbookSelection(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Inherited from

SheetsSelectionsService._removeWorkbookSelection

Defined in

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


addSelections()

addSelections(selectionsData)

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

void

Inherited from

SheetsSelectionsService.addSelections

Defined in

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

addSelections(unitId, worksheetId, selectionDatas)

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

void

Inherited from

SheetsSelectionsService.addSelections

Defined in

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


clear()

clear(): void

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

Returns

void

Inherited from

SheetsSelectionsService.clear

Defined in

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


clearCurrentSelections()

clearCurrentSelections(): void

Returns

void

Inherited from

SheetsSelectionsService.clearCurrentSelections

Defined in

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


dispose()

dispose(): void

Returns

void

Inherited from

SheetsSelectionsService.dispose

Defined in

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


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

SheetsSelectionsService.disposeWithMe

Defined in

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


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

SheetsSelectionsService.ensureNotDisposed

Defined in

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


getCurrentLastSelection()

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

Returns

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

Inherited from

SheetsSelectionsService.getCurrentLastSelection

Defined in

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


getCurrentSelections()

getCurrentSelections(): readonly ISelectionWithStyle[]

Returns

readonly ISelectionWithStyle[]

Inherited from

SheetsSelectionsService.getCurrentSelections

Defined in

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


getWorkbookSelections()

getWorkbookSelections(unitId): WorkbookSelections

Parameters

ParameterType
unitIdstring

Returns

WorkbookSelections

Inherited from

SheetsSelectionsService.getWorkbookSelections

Defined in

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


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

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


setSelections()

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

Param

Param

Param

Param

setSelections(selectionDatas, type)

setSelections(selectionDatas, type?): void

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

Parameters
ParameterType
selectionDatasISelectionWithStyle[]
type?SelectionMoveType
Returns

void

Param
Param
Param
Param
Inherited from

SheetsSelectionsService.setSelections

Defined in

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

setSelections(unitId, worksheetId, selectionDatas, type)

setSelections(
   unitId, 
   worksheetId, 
   selectionDatas, 
   type?): void

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

Parameters
ParameterType
unitIdstring
worksheetIdstring
selectionDatasISelectionWithStyle[]
type?SelectionMoveType
Returns

void

Param
Param
Param
Param
Inherited from

SheetsSelectionsService.setSelections

Defined in

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


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