@univerjssheets-uiindexclassesSheetscrollmanagerservice

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


Class: SheetScrollManagerService

This service manages and sets the virtual scrolling of the canvas content area. It triggers service changes through SetScrollOperation.

ScrollController subscribes to the changes in service data to refresh the view scrolling.

Implements

Constructors

new SheetScrollManagerService()

new SheetScrollManagerService(_context, _sheetSkeletonManagerService): SheetScrollManagerService

Parameters

ParameterType
_contextIRenderContext<Workbook>
_sheetSkeletonManagerServiceSheetSkeletonManagerService

Returns

SheetScrollManagerService

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:91

Properties

PropertyModifierTypeDescriptionDefined in
rawScrollInfo$readonlyObservable<Nullable<IScrollState>>a subject for current sheet scrollInfo ( events, ex wheel event and point events add deltaXY to rawScrollInfo$)submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:76
validViewportScrollInfo$readonlyBehaviorSubject<Nullable<IViewportScrollState>>a subject for current valid scrollInfo, viewport@_scrollCore would limit rawScrollInfo$ exclude negative value or over max value. use this subject not rawScrollInfo$ when get scrolling state of viewport. The value of this subject is the same as the value of onScrollAfter$submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:83

Methods

calcViewportScrollFromRowColOffset()

calcViewportScrollFromRowColOffset(scrollInfo): {
  viewportScrollX: 0;
  viewportScrollY: 0;
}

Parameters

ParameterType
scrollInfoNullable<IViewportScrollState>

Returns

{
  viewportScrollX: 0;
  viewportScrollY: 0;
}
NameTypeDefault valueDefined in
viewportScrollXnumber0submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:169
viewportScrollYnumber0submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:170

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:166


clear()

clear(): void

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:159


dispose()

dispose(): void

Returns

void

Implementation of

IRenderModule.dispose

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:98


getCurrentScrollState()

getCurrentScrollState(): Readonly<Nullable<IScrollState>>

Returns

Readonly<Nullable<IScrollState>>

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:115


getScrollStateByParam()

getScrollStateByParam(param): Readonly<Nullable<IScrollState>>

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

Readonly<Nullable<IScrollState>>

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:111


setScrollInfoAndEmitEvent()

setScrollInfoAndEmitEvent(param): void

Set scrollInfo by SetScrollOperation, call by ScrollCommand.id.

Parameters

ParameterType
paramIScrollStateWithSearchParam

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:123


setScrollStateToCurrSheet()

setScrollStateToCurrSheet(scroll): void

set _scrollStateMap but no _scrollInfo$.next

Parameters

ParameterType
scrollIScrollState

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:148


setScrollStateToCurrSheetAndEmitEvent()

setScrollStateToCurrSheetAndEmitEvent(scrollInfo): void

call by set frozen

Parameters

ParameterType
scrollInfoIScrollState

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:132


setSearchParam()

setSearchParam(param): void

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:102


setSearchParamAndRefresh()

setSearchParamAndRefresh(param): void

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

void

Defined in

submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:106