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
Parameter | Type |
---|---|
_context | IRenderContext <Workbook > |
_sheetSkeletonManagerService | SheetSkeletonManagerService |
Returns
Properties
Property | Modifier | Type | Description | Defined in |
---|---|---|---|---|
rawScrollInfo$ | readonly | Observable <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$ | readonly | BehaviorSubject <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
Parameter | Type |
---|---|
scrollInfo | Nullable <IViewportScrollState > |
Returns
{
viewportScrollX: number;
viewportScrollY: number;
}
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
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
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
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
Parameter | Type |
---|---|
param | IScrollStateWithSearchParam |
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
Parameter | Type |
---|---|
scroll | IScrollState |
Returns
void
setSearchParam()
setSearchParam(param): void
Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:114
Parameters
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
Returns
void
setSearchParamAndRefresh()
setSearchParamAndRefresh(param): void
Defined in: submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:118
Parameters
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
Returns
void