@univerjs/sheets-ui v0.5.0-beta.1 • Docs
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
Parameter | Type |
---|---|
_context | IRenderContext <Workbook > |
_sheetSkeletonManagerService | SheetSkeletonManagerService |
Returns
Defined in
submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:91
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:76 |
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:83 |
Methods
calcViewportScrollFromRowColOffset()
calcViewportScrollFromRowColOffset(scrollInfo): {
viewportScrollX: 0;
viewportScrollY: 0;
}
Parameters
Parameter | Type |
---|---|
scrollInfo | Nullable <IViewportScrollState > |
Returns
{
viewportScrollX: 0;
viewportScrollY: 0;
}
Name | Type | Default value | Defined in |
---|---|---|---|
viewportScrollX | number | 0 | submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:169 |
viewportScrollY | number | 0 | submodules/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
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
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
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
Parameter | Type |
---|---|
param | IScrollStateWithSearchParam |
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
Parameter | Type |
---|---|
scroll | IScrollState |
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
Parameter | Type |
---|---|
scrollInfo | IScrollState |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:132
setSearchParam()
setSearchParam(param): void
Parameters
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:102
setSearchParamAndRefresh()
setSearchParamAndRefresh(param): void
Parameters
Parameter | Type |
---|---|
param | IScrollStateSearchParam |
Returns
void
Defined in
submodules/univer/packages/sheets-ui/src/services/scroll-manager.service.ts:106