Class: ScrollList<P>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:54
A scrollable list.
Extends
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
P extends ScrollListProps | ScrollListProps |
Constructors
Constructor
new ScrollList<
P>(props):ScrollList<P>
Defined in: sdk/components/FSComponent.ts:73
Creates an instance of a DisplayComponent.
Parameters
| Parameter | Type | Description |
|---|---|---|
props | P | The propertis of the component. |
Returns
ScrollList<P>
Inherited from
Properties
_animationTargetScrollPos
protectedreadonly_animationTargetScrollPos:Subject<undefined|number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:182
_firstVisibleIndex
protectedreadonly_firstVisibleIndex:MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:199
_itemsPerPage
protectedreadonly_itemsPerPage:undefined|Subject<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:72
_lengthPx
protectedreadonly_lengthPx:Subscribable<number> |MappedSubscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:100
_listItemLengthWithMarginPx
protectedreadonly_listItemLengthWithMarginPx:MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:81
_maxScrollPos
protectedreadonly_maxScrollPos:MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:126
_renderWindow
protectedreadonly_renderWindow:Vec2Subject
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:231
_scrollPos
protectedreadonly_scrollPos:Subject<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:139
_totalLengthPx
protectedreadonly_totalLengthPx:MappedSubject<[number,number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:89
animateFunc()
protectedreadonlyanimateFunc: () =>void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:238
Called once per animation frame while we are animating.
Returns
void
animationTargetScrollPos
readonlyanimationTargetScrollPos:Subscribable<undefined|number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:187
The scroll position targeted by this list's current scrolling animation, in pixels, or undefined if scrolling is
not currently animated or the animation has no defined target scroll position.
context?
optionalcontext: [] =undefined
Defined in: sdk/components/FSComponent.ts:64
The context on this component, if any.
Inherited from
contextType?
readonlyoptionalcontextType: readonly [] =undefined
Defined in: sdk/components/FSComponent.ts:67
The type of context for this component, if any.
Inherited from
cssClassSub?
protectedoptionalcssClassSub:Subscription|Subscription[]
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:254
deltaTimeSeconds
protecteddeltaTimeSeconds:number=0
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:243
firstVisibleIndex
readonlyfirstVisibleIndex:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:207
goToAnimationTargetPos
protectedgoToAnimationTargetPos:boolean=false
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:249
interval?
protectedoptionalinterval:number
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:250
isAnimating
protectedisAnimating:boolean=false
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:240
itemCount
protectedreadonlyitemCount:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:67
itemsContainerRef
protectedreadonlyitemsContainerRef:NodeReference<HTMLDivElement>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:59
itemsPerPage
readonlyitemsPerPage:undefined|Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:77
The number of visible list items per page displayed by this list, or undefined if the number of items per page
is not prescribed.
itemsPerPageProp
protectedreadonlyitemsPerPageProp:undefined|Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:63
lastTimeSeconds
protectedlastTimeSeconds:number=0
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:242
lengthPx
readonlylengthPx:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:113
The visible length of this list, in pixels, along its scroll axis.
listItemLengthPx
protectedreadonlylistItemLengthPx:Subject<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:65
listItemLengthPxProp
protectedreadonlylistItemLengthPxProp:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:61
listItemLengthWithMarginPx
readonlylistItemLengthWithMarginPx:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:87
The length, in pixels, of one item in this list plus its margin along this list's scroll axis.
listItemParamSubs
protectedreadonlylistItemParamSubs:Subscription[] =[]
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:252
listItemSpacingPx
protectedreadonlylistItemSpacingPx:Subject<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:66
listItemSpacingPxProp
protectedreadonlylistItemSpacingPxProp:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:62
maxOverscrollPx
protectedreadonlymaxOverscrollPx:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:137
How many pixels we will allow overscrolling before stopping.
maxRenderedItemCount
protectedreadonlymaxRenderedItemCount:undefined|MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:209
maxScrollPos
readonlymaxScrollPos:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:134
This list's maximum allowed scroll position, in pixels. Does not include overscroll.
maxTimeInOverscrollSeconds
protectedmaxTimeInOverscrollSeconds:number=0.5
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:246
How long to wait while overscrolled before snapping back.
pageLength
protectedreadonlypageLength:MappedSubscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:116
The length of one page, in pixels, along this list's scroll axis.
props
props:
P&ComponentProps
Defined in: sdk/components/FSComponent.ts:61
The properties of the component.
Inherited from
renderWindow
readonlyrenderWindow:Subscribable<Readonly<Omit<Float64Array<ArrayBufferLike>,"set"|"sort"|"copyWithin">>>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:236
The window of rendered list items, as [startIndex, endIndex], where startIndex is the index of the first
rendered item, inclusive, and endIndex is the index of the last rendered item, exclusive.
renderWindowStartIndex
protectedreadonlyrenderWindowStartIndex:Subject<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:217
renderWindowStartPos
protectedreadonlyrenderWindowStartPos:MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:218
rootRef
protectedreadonlyrootRef:NodeReference<HTMLDivElement>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:57
scrollAxis
readonlyscrollAxis:"y"|"x"
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:70
The axis along which this list scrolls.
scrollBarLengthFraction
readonlyscrollBarLengthFraction:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:174
The fraction of this list's visible length compared to the total length of all items in this list plus their margins along this list's scroll axis.
scrollPos
readonlyscrollPos:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:144
This list's current scroll position, in pixels. The scroll position is zero when the list is scrolled to the beginning (without overscroll) and increases as the list is scrolled toward the end.
scrollPosFraction
readonlyscrollPosFraction:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:150
This list's current scroll position, normalized such that 0 represents when the list is scrolled to the beginning (without overscroll) and 1 represents when the list is scrolled to the end (without overscroll).
snappingTransitionSpeed
protectedsnappingTransitionSpeed:number=200
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:248
Once at or below this velocity, we pick that target Y to snap to.
snapToItem
protectedreadonlysnapToItem:boolean
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:79
targetScrollPos
readonlytargetScrollPos:MappedSubject<[undefined|number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:193
This list's current target scroll position, in pixels. The target scroll position is equal to the current animation target if it is defined; otherwise it is equal to the current scroll position.
timeInOverscrollSeconds
protectedtimeInOverscrollSeconds:number=0
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:244
totalLengthPx
readonlytotalLengthPx:Subscribable<number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:98
The total length, in pixels, of all items in this list plus their margins along this list's scroll axis.
translatableRef
protectedreadonlytranslatableRef:NodeReference<HTMLDivElement>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:58
trueScrollPos
protectedreadonlytrueScrollPos:MappedSubject<[number,number],number>
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:225
This list's current scroll position adjusted for the render window.
velocity
protectedvelocity:number=0
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:241
RESERVED_CLASSES
protectedreadonlystaticRESERVED_CLASSES:string[]
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:55
Methods
animate()
protectedanimate():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:485
Called once per animation frame while we are animating.
Returns
void
animateSnapback()
protectedanimateSnapback():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:554
Animates scrolling back when overscrolled.
Returns
void
animateSnapping()
protectedanimateSnapping(deltaTimeSeconds):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:585
If we have a target Y position to stop scrolling at, animate towards a smooth stop right at that point.
Parameters
| Parameter | Type | Description |
|---|---|---|
deltaTimeSeconds | number | Seconds since last animation frame. |
Returns
void
animateVelocity()
protectedanimateVelocity(deltaTimeSeconds):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:529
Applies the velocity to the scroll position, which gives it the "flick" effect. Also slows the velocity down overtime.
Parameters
| Parameter | Type | Description |
|---|---|---|
deltaTimeSeconds | number | Seconds since last animation frame. |
Returns
void
changeRenderWindow()
protectedchangeRenderWindow(scrollPos,renderCount,itemLength,windowLength):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:736
Changes this list's item render window.
Parameters
| Parameter | Type | Description |
|---|---|---|
scrollPos | number | The scroll position on which to center the new render window, in pixels. |
renderCount | number | The number of items to render in the new window. |
itemLength | number | The length of each item to render, including margin, in pixels. |
windowLength | number | The length of the render window, in pixels. |
Returns
void
destroy()
destroy():
void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:867
Destroys this component.
Returns
void
Overrides
ensureScrollIsInBounds()
protectedensureScrollIsInBounds():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:763
Checks if the list is scrolled past the maximum limit, and if so, snaps the list back to the limit.
Returns
void
executeScrollTo()
protectedexecuteScrollTo(pos,animate):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:446
Executes a scroll to a specifed position.
Parameters
| Parameter | Type | Description |
|---|---|---|
pos | number | The position to which to scroll. |
animate | boolean | Whether to animate the scroll. |
Returns
void
getContainerRef()
getContainerRef():
HTMLDivElement
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:303
Returns a reference to the element where the list items should be added.
Returns
HTMLDivElement
A reference to the element where the list items should be added.
getContext()
protectedgetContext(context):never
Defined in: sdk/components/FSComponent.ts:106
Gets a context data subscription from the context collection.
Parameters
| Parameter | Type | Description |
|---|---|---|
context | never | The context to get the subscription for. |
Returns
never
The requested context.
Throws
An error if no data for the specified context type could be found.
Inherited from
getDampening()
protectedgetDampening(direction):number
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:779
Returns a number used to dampen the mouse movement when overscrolled.
Parameters
| Parameter | Type | Description |
|---|---|---|
direction | number | What direction os the mouse moving in. |
Returns
number
a number used to dampen the mouse movement when overscrolled.
getOverscrollPx()
protectedgetOverscrollPx():number
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:811
Gets the distance by which this list is currently overscrolled, in pixels along the scroll axis.
Returns
number
The distance by which this list is currently overscrolled, in pixels along the scroll axis.
getReservedCssClasses()
protectedgetReservedCssClasses(): readonlystring[]
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:862
Gets an array of this list's reserved CSS classes.
Returns
readonly string[]
An array of this list's reserved CSS classes.
isOverscrolled()
protectedisOverscrolled():boolean
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:825
Returns whether this list is currently overscrolled.
Returns
boolean
Whether this list is currently overscrolled.
onAfterRender()
onAfterRender():
void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:257
A callback that is called after the component is rendered.
Returns
void
Overrides
DisplayComponent.onAfterRender
onBeforeRender()
onBeforeRender():
void
Defined in: sdk/components/FSComponent.ts:80
A callback that is called before the component is rendered.
Returns
void
Inherited from
DisplayComponent.onBeforeRender
onListItemParamChanged()
protectedonListItemParamChanged(pipeTo,value):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:691
Responds to when one of this list's item parameters changes when the list supports snapping to items.
Parameters
| Parameter | Type | Description |
|---|---|---|
pipeTo | MutableSubscribable<number> | The mutable subscribable to which to pipe the new parameter value. |
value | number | The new parameter value. |
Returns
void
pageBack()
pageBack():
void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:310
Scrolls backward by one full page length.
Returns
void
pageForward()
pageForward():
void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:325
Scrolls forward by one full page length.
Returns
void
pickNearestSnapToPos()
protectedpickNearestSnapToPos(pos):number
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:682
Picks the scroll position, in pixels, of the snap-to target that is nearest to a given scroll position.
Parameters
| Parameter | Type | Description |
|---|---|---|
pos | number | The scroll position, in pixels, for which to find the nearest snap-to target. |
Returns
number
The scroll position, in pixels, of the snap-to target that is nearest to the specified scroll position.
render()
render():
VNode
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:830
Renders the component.
Returns
A JSX element to be rendered.
Overrides
scrollToIndex()
scrollToIndex(
index,position,animate):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:346
Scrolls until the item at a specified index is in view.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | The index of the item to which to scroll. |
position | number | The position to place the target item at the end of the scroll. Position 0 is the top/left-most visible slot, position 1 is the next slot, and so on. Values greater than or equal to the number of visible items per page will be clamped. Negative values will be interpreted as counting backwards from the bottom/right-most visible slot starting with -1. Ignored if this list does not support snapping to list items. |
animate | boolean | Whether to animate the scroll. |
Returns
void
scrollToIndexWithMargin()
scrollToIndexWithMargin(
index,margin,animate):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:402
Scrolls the minimum possible distance until the item at a specified index is in view with a given margin from the edges of the visible list.
Parameters
| Parameter | Type | Description |
|---|---|---|
index | number | The index of the item to which to scroll. |
margin | number | The margin from the edges of the visible list to respect when scrolling to the target item. In other words, the scrolling operation will attempt to place the target item at least as far from the edges of the visible list as the specified margin. If this list supports snapping to items, then the margin should be expressed as an item count. If this list does not support snapping to items, then the margin should be expressed as pixels. The margin will be clamped between zero and the largest possible value such that an item can be placed within the visible list while respecting the margin value on both sides. |
animate | boolean | Whether to animate the scroll. |
Returns
void
startAnimating()
protectedstartAnimating():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:463
Reset the animation vars and start the animation, if not already started.
Returns
void
stopAnimating()
protectedstopAnimating():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:475
Stop the animation.
Returns
void
updateRenderWindow()
protectedupdateRenderWindow():void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:706
Updates this list's item render window.
Returns
void
updateTransformX()
protectedupdateTransformX(scrollPos):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:748
Updates this list's item container's x-transform based on the current true scroll position.
Parameters
| Parameter | Type | Description |
|---|---|---|
scrollPos | number | The current true scroll position, in pixels. |
Returns
void
updateTransformY()
protectedupdateTransformY(scrollPos):void
Defined in: workingtitle-instruments-epic2/shared/Components/List/ScrollList.tsx:756
Updates this list's item container's y-transform based on the current true scroll position.
Parameters
| Parameter | Type | Description |
|---|---|---|
scrollPos | number | The current true scroll position, in pixels. |
Returns
void