@univerjssheets-uiindexclassesSheetscrollmanagerservice

@univerjs/sheets-ui v0.5.4


Class: SheetScrollManagerService

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:76

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

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:103

Parameters

ParameterType
_contextIRenderContext<Workbook>
_sheetSkeletonManagerServiceSheetSkeletonManagerService

Returns

SheetScrollManagerService

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:88
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:95

Methods

calcViewportScrollFromRowColOffset()

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

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:162

Parameters

ParameterType
scrollInfoNullable<IViewportScrollState>

Returns

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

clear()

clear(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:155

Returns

void


dispose()

dispose(): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:110

Returns

void

Implementation of

IRenderModule.dispose


getCurrentScrollState()

getCurrentScrollState(): Readonly<IScrollState>

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:127

Returns

Readonly<IScrollState>


getScrollStateByParam()

getScrollStateByParam(param): Readonly<IScrollState>

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

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

Readonly<IScrollState>


setScrollInfoAndEmitEvent()

setScrollInfoAndEmitEvent(param): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:135

Set scrollInfo by SetScrollOperation, call by ScrollCommand.id.

Parameters

ParameterType
paramIScrollStateWithSearchParam

Returns

void


setScrollStateToCurrSheet()

setScrollStateToCurrSheet(scroll): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:144

Set _scrollStateMap but no _scrollInfo$.next

Parameters

ParameterType
scrollIScrollState

Returns

void


setSearchParam()

setSearchParam(param): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:114

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

void


setSearchParamAndRefresh()

setSearchParamAndRefresh(param): void

Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:118

Parameters

ParameterType
paramIScrollStateSearchParam

Returns

void