@ng-native/components 0.25.0 → 0.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/reanimated-web.d.ts +1 -0
- package/dist/reanimated-web.js +1 -0
- package/dist/reanimated-web.js.map +1 -1
- package/dist/reanimated.d.ts +1 -0
- package/dist/reanimated.js +1 -0
- package/dist/reanimated.js.map +1 -1
- package/dist/release-on-destroy.d.ts +32 -0
- package/dist/release-on-destroy.js +45 -0
- package/dist/release-on-destroy.js.map +1 -0
- package/dist/section-list.d.ts +3 -1
- package/dist/section-list.js +7 -3
- package/dist/section-list.js.map +1 -1
- package/dist/sticky-rows.d.ts +142 -0
- package/dist/sticky-rows.js +274 -0
- package/dist/sticky-rows.js.map +1 -0
- package/dist/virtual-list-layout.d.ts +21 -0
- package/dist/virtual-list-layout.js +11 -0
- package/dist/virtual-list-layout.js.map +1 -0
- package/dist/virtual-list-num-columns.d.ts +47 -0
- package/dist/virtual-list-num-columns.js +97 -0
- package/dist/virtual-list-num-columns.js.map +1 -0
- package/dist/virtual-list.d.ts +74 -51
- package/dist/virtual-list.js +285 -198
- package/dist/virtual-list.js.map +1 -1
- package/package.json +3 -3
package/dist/virtual-list.d.ts
CHANGED
|
@@ -184,9 +184,17 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
184
184
|
* up to `windowSize - 1` more around it. While the JS thread is
|
|
185
185
|
* idle the window grows a viewport at a time, ahead of the scroll direction first, so a fling
|
|
186
186
|
* lands on rows already drawn. About two-thirds of the extra viewports go ahead of the scroll and
|
|
187
|
-
* the rest behind. `1`
|
|
187
|
+
* the rest behind. `1` fills no extra viewports, though a fast scroll still renders ahead of
|
|
188
|
+
* itself unless `velocityLead` is `0`.
|
|
188
189
|
*/
|
|
189
190
|
readonly windowSize: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
191
|
+
/**
|
|
192
|
+
* How far past the viewport a scroll renders in the direction it is going, in milliseconds of
|
|
193
|
+
* its speed, up to three viewports: the rows the list will reach by the time a window change has
|
|
194
|
+
* been through JavaScript and back to native. `0` renders only the visible rows, the overscan
|
|
195
|
+
* and the fill.
|
|
196
|
+
*/
|
|
197
|
+
readonly velocityLead: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
190
198
|
/** How close to the end, in viewport heights, `(endReached)` fires. RN's default is 2. */
|
|
191
199
|
readonly endReachedThreshold: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
192
200
|
/** Lay the rows out along x instead of y, and scroll that way. */
|
|
@@ -218,8 +226,6 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
218
226
|
left: readonly number[];
|
|
219
227
|
}>;
|
|
220
228
|
private readonly viewport;
|
|
221
|
-
/** The leading edge of the viewport in content space, which sticky rows and viewability need. */
|
|
222
|
-
private readonly offset;
|
|
223
229
|
private readonly headerHeight;
|
|
224
230
|
/** What native reported the content measures along the axis, once it has. */
|
|
225
231
|
private contentSize;
|
|
@@ -237,16 +243,6 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
237
243
|
private readonly refreshControl;
|
|
238
244
|
/** See ScrollView: inside Android's swipe layout the list must see a drag first. */
|
|
239
245
|
protected readonly nestedScroll: import("@angular/core").Signal<true | undefined>;
|
|
240
|
-
/**
|
|
241
|
-
* Whether native moves sticky rows. Each then stays at its own place in the list and native
|
|
242
|
-
* translates it on every frame the list scrolls, as RN's `ScrollViewStickyHeader` does; a
|
|
243
|
-
* translate committed from each scroll event lands a frame or more late, and on a fast fling
|
|
244
|
-
* the row shudders and comes away from the edge.
|
|
245
|
-
*/
|
|
246
|
-
private readonly nativeSticky;
|
|
247
|
-
/** The offset once scrolling pauses, which the settled translate of a native-moved row is from. */
|
|
248
|
-
private readonly settled;
|
|
249
|
-
private settleTimer;
|
|
250
246
|
/** Viewports filled past the overscan, before and after the visible rows in index order. */
|
|
251
247
|
private readonly fill;
|
|
252
248
|
/** The way the visible row last moved: 1 toward the end of the list, -1 toward the start. */
|
|
@@ -254,11 +250,9 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
254
250
|
/** The fill, cut to what `windowSize` allows ahead of the scroll and behind it. */
|
|
255
251
|
private readonly reach;
|
|
256
252
|
private fillTimer;
|
|
257
|
-
/** What native is moving, by row view, with the transform kept beside the translate. */
|
|
258
|
-
private readonly drives;
|
|
259
253
|
private readonly canvasView;
|
|
260
|
-
/**
|
|
261
|
-
private readonly
|
|
254
|
+
/** The sticky rows and header: see `StickyRows`. */
|
|
255
|
+
private readonly sticky;
|
|
262
256
|
/** Rows size themselves and are laid out in flow, rather than placed at a known offset. */
|
|
263
257
|
readonly measuring: import("@angular/core").Signal<boolean>;
|
|
264
258
|
/** The padding on each side. */
|
|
@@ -267,6 +261,26 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
267
261
|
private readonly lead;
|
|
268
262
|
/** The rows' insets across the axis, as the props that place an absolutely positioned row. */
|
|
269
263
|
private readonly across;
|
|
264
|
+
/** How items are laid out across the width, when a directive on the list says: see the token. */
|
|
265
|
+
private readonly columnLayout;
|
|
266
|
+
/**
|
|
267
|
+
* Items to a line. Only for a vertical list whose rows have known heights: a line's height
|
|
268
|
+
* would otherwise wait on every item in it measuring, and FlatList's `numColumns` is vertical
|
|
269
|
+
* only too. The directive says so in development.
|
|
270
|
+
*/
|
|
271
|
+
private readonly columns;
|
|
272
|
+
/** Which line each item is on, when there is more than one to a line. */
|
|
273
|
+
private readonly lines;
|
|
274
|
+
/** The props across each column, built once per change of columns, gap or padding. */
|
|
275
|
+
private readonly columnAcross;
|
|
276
|
+
/** An item's insets across the axis: its column's, or the whole width's. */
|
|
277
|
+
private acrossOf;
|
|
278
|
+
/** The line an item is on: the item itself, when each has a line to itself. */
|
|
279
|
+
private lineOf;
|
|
280
|
+
/** Whether a row is on the list's last line, which no separator comes after. */
|
|
281
|
+
private onLastLine;
|
|
282
|
+
/** The first item on a line, or the item count for a line past the last. */
|
|
283
|
+
private lineStart;
|
|
270
284
|
/** Heights native has reported, by key. */
|
|
271
285
|
private readonly measured;
|
|
272
286
|
/** Bumped when a measurement changes, which is what re-sizes the list. */
|
|
@@ -325,11 +339,11 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
325
339
|
private readonly flowSpacing;
|
|
326
340
|
/** A row in flow, flipped back when the list is inverted. One object, so rows never re-clone. */
|
|
327
341
|
private readonly flowStyle;
|
|
328
|
-
/** Top of a row: the leading padding, and every row and gap before it. */
|
|
342
|
+
/** Top of a row: the leading padding, and every row and gap before it. In columns, its line's. */
|
|
329
343
|
private topOf;
|
|
330
|
-
/** A row's own size, without the gap after it. */
|
|
344
|
+
/** A row's own size, without the gap after it. In columns, its line's. */
|
|
331
345
|
private heightOf;
|
|
332
|
-
/** First row whose bottom, or the gap after it, is past `y`. */
|
|
346
|
+
/** First row whose bottom, or the gap after it, is past `y`. In columns, the first on its line. */
|
|
333
347
|
private indexAt;
|
|
334
348
|
/** The row the viewport's leading edge is in, taken at each scroll. */
|
|
335
349
|
private anchor;
|
|
@@ -389,6 +403,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
389
403
|
constructor();
|
|
390
404
|
/** The items the end and viewability were last checked against after a render. */
|
|
391
405
|
private checkedItems;
|
|
406
|
+
/** And the table placing them, which a new column count makes again for the same items. */
|
|
407
|
+
private checkedTable;
|
|
392
408
|
/**
|
|
393
409
|
* New items can bring the end within reach or change what is on screen with no scroll: a list
|
|
394
410
|
* shorter than its viewport, a page appended while at the end, a filter. Checked once the rows
|
|
@@ -425,26 +441,10 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
425
441
|
*/
|
|
426
442
|
private leadWindow;
|
|
427
443
|
private styleFor;
|
|
428
|
-
/** A pinned row in flow, moved from where flow put it to the leading edge by a transform. */
|
|
429
|
-
private pinnedFlowStyle;
|
|
430
|
-
/**
|
|
431
|
-
* A sticky row native moves: at its own place, with the translate native had reached when
|
|
432
|
-
* scrolling paused, so the props agree with what is on screen.
|
|
433
|
-
*/
|
|
434
|
-
private stickyStyle;
|
|
435
|
-
/** Each sticky row, and the one after it, which pushes it off. */
|
|
436
|
-
private readonly nextSticky;
|
|
437
|
-
/** Where a sticky row stops, pushed off by the next: that row's top, less this row's size. */
|
|
438
|
-
private stopOf;
|
|
439
|
-
/**
|
|
440
|
-
* How native moves a rendered row, or null when it does not: along the scroll view's own
|
|
441
|
-
* offset, which counts the header, from the row's top until the next sticky row pushes it off.
|
|
442
|
-
*/
|
|
443
|
-
private stickyDrive;
|
|
444
444
|
/**
|
|
445
|
-
* Hand each rendered sticky row's view to native to move
|
|
446
|
-
*
|
|
447
|
-
*
|
|
445
|
+
* Hand each rendered sticky row's view to native to move. The rows' views are the canvas's
|
|
446
|
+
* element children in window order, after the spacer, which is how `@for` over `window()`
|
|
447
|
+
* leaves them.
|
|
448
448
|
*/
|
|
449
449
|
private driveStickyRows;
|
|
450
450
|
/** Which recycling slot each rendered item holds, by key: its type, and the row it last drew. */
|
|
@@ -505,10 +505,7 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
505
505
|
* it at the estimate would put a line through the middle of a row that turns out taller.
|
|
506
506
|
*/
|
|
507
507
|
private measuredGapStyle;
|
|
508
|
-
/**
|
|
509
|
-
* The header's translation while it is pinned: the scroll position, held back at zero by an
|
|
510
|
-
* overscroll and at the first sticky row, which pushes it off.
|
|
511
|
-
*/
|
|
508
|
+
/** The header, pinned with the rows when `stickyHeader` says so: see `StickyRows`. */
|
|
512
509
|
protected readonly headerStyle: import("@angular/core").Signal<{
|
|
513
510
|
transform: string;
|
|
514
511
|
zIndex?: undefined;
|
|
@@ -526,11 +523,6 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
526
523
|
protected readonly footerStyle: import("@angular/core").Signal<{
|
|
527
524
|
transform: string;
|
|
528
525
|
} | undefined>;
|
|
529
|
-
/**
|
|
530
|
-
* The sticky row currently holding the leading edge: the last one at or before the offset.
|
|
531
|
-
* Null when the list has scrolled back above the first of them.
|
|
532
|
-
*/
|
|
533
|
-
private readonly pinnedIndex;
|
|
534
526
|
/** Which rows are on screen far enough to count, by the caller's threshold. */
|
|
535
527
|
private viewableAt;
|
|
536
528
|
/** The last set announced, so the output fires on a change rather than on every frame. */
|
|
@@ -569,7 +561,29 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
569
561
|
x?: number;
|
|
570
562
|
y?: number;
|
|
571
563
|
};
|
|
564
|
+
timestamp?: number;
|
|
572
565
|
}>): void;
|
|
566
|
+
/**
|
|
567
|
+
* Points the window reaches past the viewport for the scroll's speed, positive toward the end,
|
|
568
|
+
* in steps of a quarter viewport: written only when it moves a step, so a fling costs a pass
|
|
569
|
+
* for it every few frames rather than on every scroll event.
|
|
570
|
+
*/
|
|
571
|
+
private readonly ahead;
|
|
572
|
+
/** The speed's lead before rounding to a step, eased from one event to the next. */
|
|
573
|
+
private eased;
|
|
574
|
+
/** The offset of the last scroll event, and when it arrived. */
|
|
575
|
+
private lastScroll;
|
|
576
|
+
/** Lets go of the reach once scroll events stop, which is all a scroll that stops sends. */
|
|
577
|
+
private speedTimer;
|
|
578
|
+
/**
|
|
579
|
+
* Follow the scroll's speed, from each scroll event's offset and the time native sent it, in
|
|
580
|
+
* milliseconds, which iOS and Android both give. Not the time it reached JavaScript: a thread
|
|
581
|
+
* that fell behind gets a fling's events in a burst, which would read as no time at all between
|
|
582
|
+
* them. Where native gives no time, as on the web, the time it arrived.
|
|
583
|
+
*/
|
|
584
|
+
private trackSpeed;
|
|
585
|
+
/** Start the speed over: a pause, or a jump, which is no fling. */
|
|
586
|
+
private stopSpeed;
|
|
573
587
|
/** The most viewports rendered ahead of the scroll direction and behind it. */
|
|
574
588
|
private fillCaps;
|
|
575
589
|
/** Move the window to a new visible row. */
|
|
@@ -593,8 +607,6 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
593
607
|
* the scroll first. Every window change restarts the wait, so a fling is never slowed by it.
|
|
594
608
|
*/
|
|
595
609
|
private scheduleFill;
|
|
596
|
-
/** A pinned row's translate, settled once scrolling pauses: see `STICKY_SETTLE_MS`. */
|
|
597
|
-
private settleAfterPause;
|
|
598
610
|
protected onLayout(event: NativeSyntheticEvent<{
|
|
599
611
|
layout?: {
|
|
600
612
|
width?: number;
|
|
@@ -620,9 +632,20 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
620
632
|
width?: number;
|
|
621
633
|
height?: number;
|
|
622
634
|
}>): void;
|
|
635
|
+
/** The scroll view's content along the axis, header and all. */
|
|
636
|
+
private contentExtent;
|
|
637
|
+
/** The user took the scroll over: native's own events move the rows from here. */
|
|
638
|
+
protected onDragBegin(): void;
|
|
639
|
+
/** A scroll came to rest: see `StickyRows.rested`. */
|
|
640
|
+
protected onScrollEnd(): void;
|
|
641
|
+
/**
|
|
642
|
+
* How far toward `offset` the content lets native scroll. Android stops a scroll at its end and
|
|
643
|
+
* says nothing of it; iOS goes past, and its scroll end event says where it came to rest.
|
|
644
|
+
*/
|
|
645
|
+
private reachable;
|
|
623
646
|
private checkEnd;
|
|
624
647
|
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualList<any>, never>;
|
|
625
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VirtualList<any>, "virtual-list", ["virtualList"], { "items": { "alias": "items"; "required": true; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "estimatedItemHeight": { "alias": "estimatedItemHeight"; "required": false; "isSignal": true; }; "contentPadding": { "alias": "contentPadding"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "keyExtractor": { "alias": "keyExtractor"; "required": false; "isSignal": true; }; "itemType": { "alias": "itemType"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "windowSize": { "alias": "windowSize"; "required": false; "isSignal": true; }; "endReachedThreshold": { "alias": "endReachedThreshold"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "inverted": { "alias": "inverted"; "required": false; "isSignal": true; }; "stickyIndices": { "alias": "stickyIndices"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "itemVisiblePercentThreshold": { "alias": "itemVisiblePercentThreshold"; "required": false; "isSignal": true; }; }, { "endReached": "endReached"; "viewableItemsChanged": "viewableItemsChanged"; }, ["separator", "refreshControl"], ["refresh-control", "[listHeader]", "*", "[listFooter]"], true, never>;
|
|
648
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VirtualList<any>, "virtual-list", ["virtualList"], { "items": { "alias": "items"; "required": true; "isSignal": true; }; "itemHeight": { "alias": "itemHeight"; "required": false; "isSignal": true; }; "estimatedItemHeight": { "alias": "estimatedItemHeight"; "required": false; "isSignal": true; }; "contentPadding": { "alias": "contentPadding"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "keyExtractor": { "alias": "keyExtractor"; "required": false; "isSignal": true; }; "itemType": { "alias": "itemType"; "required": false; "isSignal": true; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; "isSignal": true; }; "overscan": { "alias": "overscan"; "required": false; "isSignal": true; }; "windowSize": { "alias": "windowSize"; "required": false; "isSignal": true; }; "velocityLead": { "alias": "velocityLead"; "required": false; "isSignal": true; }; "endReachedThreshold": { "alias": "endReachedThreshold"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "inverted": { "alias": "inverted"; "required": false; "isSignal": true; }; "stickyIndices": { "alias": "stickyIndices"; "required": false; "isSignal": true; }; "stickyHeader": { "alias": "stickyHeader"; "required": false; "isSignal": true; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; "isSignal": true; }; "itemVisiblePercentThreshold": { "alias": "itemVisiblePercentThreshold"; "required": false; "isSignal": true; }; }, { "endReached": "endReached"; "viewableItemsChanged": "viewableItemsChanged"; }, ["separator", "refreshControl"], ["refresh-control", "[listHeader]", "*", "[listFooter]"], true, never>;
|
|
626
649
|
}
|
|
627
650
|
/**
|
|
628
651
|
* Put on each row's view: `<view [virtualListRow]="row">`. Applies the row's style, and reports
|