@ng-native/components 0.28.0 → 0.29.0
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/android/src/main/java/dev/ngnative/components/ColorSchemeModule.kt +116 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/menu.d.ts +11 -5
- package/dist/menu.js +12 -32
- package/dist/menu.js.map +1 -1
- package/dist/native-button.d.ts +25 -3
- package/dist/native-button.js +101 -7
- package/dist/native-button.js.map +1 -1
- package/dist/press-menu.d.ts +29 -8
- package/dist/press-menu.js +56 -16
- package/dist/press-menu.js.map +1 -1
- package/dist/pressable.js +2 -1
- package/dist/pressable.js.map +1 -1
- package/dist/scroll-view.d.ts +3 -1
- package/dist/scroll-view.js +7 -2
- package/dist/scroll-view.js.map +1 -1
- package/dist/sidebar.js +4 -3
- package/dist/sidebar.js.map +1 -1
- package/dist/split-view.d.ts +23 -2
- package/dist/split-view.js +32 -5
- package/dist/split-view.js.map +1 -1
- package/dist/sticky-headers.d.ts +19 -0
- package/dist/sticky-headers.js +67 -10
- package/dist/sticky-headers.js.map +1 -1
- package/dist/sticky-rows.d.ts +13 -11
- package/dist/sticky-rows.js +35 -21
- package/dist/sticky-rows.js.map +1 -1
- package/dist/svg-icon.d.ts +16 -2
- package/dist/svg-icon.js +19 -3
- package/dist/svg-icon.js.map +1 -1
- package/dist/tray-icon.d.ts +7 -1
- package/dist/tray-icon.js +15 -3
- package/dist/tray-icon.js.map +1 -1
- package/dist/virtual-list-sticky-level.d.ts +0 -6
- package/dist/virtual-list-sticky-level.js +2 -26
- package/dist/virtual-list-sticky-level.js.map +1 -1
- package/dist/virtual-list.d.ts +24 -6
- package/dist/virtual-list.js +79 -28
- package/dist/virtual-list.js.map +1 -1
- package/dist/written-props.js +2 -0
- package/dist/written-props.js.map +1 -1
- package/ios/NgNativeButtonComponentView.mm +8 -4
- package/ios/NgNativeButtonMetrics.h +9 -2
- package/ios/NgNativeButtonMetrics.mm +33 -4
- package/ios/NgNativeButtonShadowNode.h +2 -0
- package/ios/NgNativeButtonShadowNode.mm +5 -1
- package/ios/NgNativeMenus.mm +42 -2
- package/ios/NgNativePressMenu.h +28 -0
- package/ios/NgNativePressMenu.mm +45 -0
- package/package.json +3 -3
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Directive,
|
|
1
|
+
import { Directive, computed, forwardRef, input } from '@angular/core';
|
|
2
2
|
import { numberOr } from "./transforms.js";
|
|
3
|
-
import { VirtualList } from "./virtual-list.js";
|
|
4
3
|
import { VIRTUAL_LIST_STICKY } from "./virtual-list-sticky.js";
|
|
5
4
|
import * as i0 from "@angular/core";
|
|
6
5
|
/**
|
|
@@ -21,10 +20,6 @@ import * as i0 from "@angular/core";
|
|
|
21
20
|
* A row pins under the nearest row before it of each level further out than its own, and stays
|
|
22
21
|
* until the next row of its own level, or of one further out, pushes it off. The rows of
|
|
23
22
|
* `stickyIndices` are at level 0, so the two can be given together.
|
|
24
|
-
*
|
|
25
|
-
* ponytail: rows that size themselves pin level 0 alone, with a warning in development, and
|
|
26
|
-
* deeper rows scroll with the rest: where a row pins under others depends on their heights, which
|
|
27
|
-
* are not known until each has been measured.
|
|
28
23
|
*/
|
|
29
24
|
export class VirtualListStickyLevel {
|
|
30
25
|
/** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */
|
|
@@ -35,8 +30,6 @@ export class VirtualListStickyLevel {
|
|
|
35
30
|
*/
|
|
36
31
|
maxLevels = input(Infinity, { ...(ngDevMode ? { debugName: "maxLevels" } : /* istanbul ignore next */ {}), alias: 'virtualListMaxStickyLevels',
|
|
37
32
|
transform: numberOr(Infinity) });
|
|
38
|
-
// Looked up once the list exists: the list injects this directive while it is being made.
|
|
39
|
-
injector = inject(Injector);
|
|
40
33
|
levelOf = computed(() => {
|
|
41
34
|
const level = this.level();
|
|
42
35
|
if (!level)
|
|
@@ -48,23 +41,6 @@ export class VirtualListStickyLevel {
|
|
|
48
41
|
};
|
|
49
42
|
}, /* @ts-ignore */
|
|
50
43
|
...(ngDevMode ? [{ debugName: "levelOf" }] : /* istanbul ignore next */ []));
|
|
51
|
-
constructor() {
|
|
52
|
-
if (typeof ngDevMode === 'undefined' || !ngDevMode)
|
|
53
|
-
return;
|
|
54
|
-
const unsupported = effect(() => {
|
|
55
|
-
const levelOf = this.levelOf();
|
|
56
|
-
const list = this.injector.get(VirtualList, null, { self: true });
|
|
57
|
-
if (!levelOf || !list?.measuring())
|
|
58
|
-
return;
|
|
59
|
-
if (!list.items().some((item, index) => (levelOf(item, index) ?? 0) > 0))
|
|
60
|
-
return;
|
|
61
|
-
unsupported.destroy();
|
|
62
|
-
console.warn(`[angular-native] virtualListStickyLevel pins level 0 alone on rows without itemHeight: ` +
|
|
63
|
-
`a row pins under others by their heights, which rows that size themselves do not ` +
|
|
64
|
-
`have until they are measured.`);
|
|
65
|
-
}, /* @ts-ignore */
|
|
66
|
-
...(ngDevMode ? [{ debugName: "unsupported" }] : /* istanbul ignore next */ []));
|
|
67
|
-
}
|
|
68
44
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.2.0", ngImport: i0, type: VirtualListStickyLevel, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
69
45
|
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.2.0", type: VirtualListStickyLevel, isStandalone: true, selector: "virtual-list[virtualListStickyLevel]", inputs: { level: { classPropertyName: "level", publicName: "virtualListStickyLevel", isSignal: true, isRequired: false, transformFunction: null }, maxLevels: { classPropertyName: "maxLevels", publicName: "virtualListMaxStickyLevels", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
70
46
|
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
@@ -78,5 +54,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.2.0", ngImpor
|
|
|
78
54
|
{ provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },
|
|
79
55
|
],
|
|
80
56
|
}]
|
|
81
|
-
}],
|
|
57
|
+
}], propDecorators: { level: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListStickyLevel", required: false }] }], maxLevels: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualListMaxStickyLevels", required: false }] }] } });
|
|
82
58
|
//# sourceMappingURL=virtual-list-sticky-level.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-list-sticky-level.js","sourceRoot":"","sources":["../src/virtual-list-sticky-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"virtual-list-sticky-level.js","sourceRoot":"","sources":["../src/virtual-list-sticky-level.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAA0B,MAAM,0BAA0B,CAAC;;AAEvF;;;;;;;;;;;;;;;;;;GAkBG;AAOH,MAAM,OAAO,sBAAsB;IACjC,uFAAuF;IAC9E,KAAK,GAAG,KAAK,CAEpB,SAAS,6EAAI,KAAK,EAAE,wBAAwB,GAAG,CAAC;IAClD;;;OAGG;IACM,SAAS,GAAG,KAAK,CAAC,QAAQ,iFACjC,KAAK,EAAE,4BAA4B;QACnC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC,GAC7B,CAAC;IAEM,OAAO,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI,CAAC,KAAK;YAAE,OAAO,IAAI,CAAC;QACxB,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO,CAAC,IAAa,EAAE,KAAa,EAAE,EAAE;YACtC,MAAM,EAAE,GAAG,KAAK,CAAC,IAAS,EAAE,KAAK,CAAC,CAAC;YACnC,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAClF,CAAC,CAAC;IACJ,CAAC;gFAAC,CAAC;uGAtBQ,sBAAsB;2FAAtB,sBAAsB,6XAJtB;YACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC,EAAE;SACxF;;2FAEU,sBAAsB;kBANlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sCAAsC;oBAChD,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC,EAAE;qBACxF;iBACF","sourcesContent":["import { Directive, computed, forwardRef, input } from '@angular/core';\nimport { numberOr } from './transforms.ts';\nimport { VIRTUAL_LIST_STICKY, type VirtualListSticky } from './virtual-list-sticky.ts';\n\n/**\n * Sticky rows at more than one level, on `<virtual-list>` itself: a year pinned at the leading\n * edge, its month under it and the day under that, each pushed off by the next of its own level\n * or of one further out.\n *\n * ```html\n * <virtual-list #list [items]=\"rows\" [itemHeight]=\"44\" [virtualListStickyLevel]=\"levelOf\">\n * @for (row of list.window(); track row.slot) {\n * <view [virtualListRow]=\"row\"><text>{{ row.item.label }}</text></view>\n * }\n * </virtual-list>\n * ```\n *\n * `levelOf` is given each item and its index and returns the row's level: 0 for the outermost,\n * 1 for the rows pinned under those, and so on, or `null` for a row that scrolls with the rest.\n * A row pins under the nearest row before it of each level further out than its own, and stays\n * until the next row of its own level, or of one further out, pushes it off. The rows of\n * `stickyIndices` are at level 0, so the two can be given together.\n */\n@Directive({\n selector: 'virtual-list[virtualListStickyLevel]',\n providers: [\n { provide: VIRTUAL_LIST_STICKY, useExisting: forwardRef(() => VirtualListStickyLevel) },\n ],\n})\nexport class VirtualListStickyLevel<T = unknown> implements VirtualListSticky {\n /** A row's level, from 0 for the outermost, or `null` for a row that is not sticky. */\n readonly level = input<\n ((item: T, index: number) => number | null | undefined) | null | undefined\n >(undefined, { alias: 'virtualListStickyLevel' });\n /**\n * How many levels pin at once, from the outermost. Rows deeper than that are not sticky. It\n * limits the levels the function gives: the rows of `stickyIndices` pin whatever it is.\n */\n readonly maxLevels = input(Infinity, {\n alias: 'virtualListMaxStickyLevels',\n transform: numberOr(Infinity),\n });\n\n readonly levelOf = computed(() => {\n const level = this.level();\n if (!level) return null;\n const levels = this.maxLevels();\n return (item: unknown, index: number) => {\n const at = level(item as T, index);\n return typeof at === 'number' && at >= 0 && at < levels ? Math.floor(at) : null;\n };\n });\n}\n"]}
|
package/dist/virtual-list.d.ts
CHANGED
|
@@ -242,7 +242,8 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
242
242
|
private readonly measuredGaps;
|
|
243
243
|
protected readonly separator: import("@angular/core").Signal<VirtualListSeparator<T> | undefined>;
|
|
244
244
|
private readonly refreshControl;
|
|
245
|
-
|
|
245
|
+
private readonly inSheet;
|
|
246
|
+
/** See ScrollView: inside Android's swipe layout or a form sheet the list must see a drag first. */
|
|
246
247
|
protected readonly nestedScroll: import("@angular/core").Signal<true | undefined>;
|
|
247
248
|
/** Viewports filled past the overscan, before and after the visible rows in index order. */
|
|
248
249
|
private readonly fill;
|
|
@@ -434,14 +435,31 @@ export declare class VirtualList<T> extends ScrollViewProps {
|
|
|
434
435
|
height: number;
|
|
435
436
|
width?: undefined;
|
|
436
437
|
}>;
|
|
437
|
-
/**
|
|
438
|
+
/**
|
|
439
|
+
* Where the first row rendered in flow starts: `first`'s place, less each row rendered ahead of
|
|
440
|
+
* it, or where native moves them, the first of those rows' own place. Less than nothing where a
|
|
441
|
+
* negative gap overlaps the rows not rendered, which the spacer cannot be: the first row takes
|
|
442
|
+
* the rest as a margin (`rowsFor`).
|
|
443
|
+
*/
|
|
444
|
+
private flowStart;
|
|
445
|
+
/**
|
|
446
|
+
* The rows rendered ahead of the window: the pinned rows it has left behind, and where native
|
|
447
|
+
* moves rows in flow, the row before each pinned row after the outermost. Flow places a row
|
|
448
|
+
* after the row before it, so with that row rendered too, a pinned row is at its own place
|
|
449
|
+
* with no margin of its own, and its props stay as they are as the window moves past it.
|
|
450
|
+
*/
|
|
451
|
+
private readonly rendersAhead;
|
|
452
|
+
/** The rows from `first` up to `last`, and the rows ahead of them if there are any. */
|
|
438
453
|
private rowsFor;
|
|
454
|
+
/** Start the first row in flow at `start`, below zero, where the spacer cannot reach. */
|
|
455
|
+
private startBefore;
|
|
439
456
|
/**
|
|
440
|
-
* A pinned row native moves stays at its own place, so the rows
|
|
441
|
-
* made up
|
|
442
|
-
*
|
|
457
|
+
* A pinned row native moves stays at its own place, so the rows that are not rendered between
|
|
458
|
+
* it and the next are made up by a margin on the next row that is not pinned, up to the
|
|
459
|
+
* window's first, a negative one where a negative gap overlaps them: new props on a view native
|
|
460
|
+
* is moving put its transform back for a frame.
|
|
443
461
|
*/
|
|
444
|
-
private
|
|
462
|
+
private placeAhead;
|
|
445
463
|
private styleFor;
|
|
446
464
|
/**
|
|
447
465
|
* Hand each rendered sticky row's view to native to move. The rows' views are the canvas's
|
package/dist/virtual-list.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterEveryRender, booleanAttribute, computed, contentChild, effect, inject, input, linkedSignal, output, signal, untracked, viewChild, } from '@angular/core';
|
|
2
2
|
import { nativePlatform, } from '@ng-native/fabric';
|
|
3
|
+
import { IN_FORM_SHEET } from '@ng-native/device';
|
|
3
4
|
import { HeightIndex } from "./height-index.js";
|
|
4
5
|
import { dismissKeyboardOnTap } from "./keyboard-taps.js";
|
|
5
6
|
import { RefreshControl } from "./refresh-control.js";
|
|
@@ -227,8 +228,9 @@ export class VirtualList extends ScrollViewProps {
|
|
|
227
228
|
...(ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []));
|
|
228
229
|
refreshControl = contentChild(RefreshControl, /* @ts-ignore */
|
|
229
230
|
...(ngDevMode ? [{ debugName: "refreshControl" }] : /* istanbul ignore next */ []));
|
|
230
|
-
|
|
231
|
-
|
|
231
|
+
inSheet = inject(IN_FORM_SHEET);
|
|
232
|
+
/** See ScrollView: inside Android's swipe layout or a form sheet the list must see a drag first. */
|
|
233
|
+
nestedScroll = computed(() => nativePlatform() === 'android' && (this.inSheet || this.refreshControl()) ? true : undefined, /* @ts-ignore */
|
|
232
234
|
...(ngDevMode ? [{ debugName: "nestedScroll" }] : /* istanbul ignore next */ []));
|
|
233
235
|
/** Viewports filled past the overscan, before and after the visible rows in index order. */
|
|
234
236
|
fill = signal({ before: 0, after: 0 }, /* @ts-ignore */
|
|
@@ -804,23 +806,56 @@ export class VirtualList extends ScrollViewProps {
|
|
|
804
806
|
*/
|
|
805
807
|
spacer = computed(() => {
|
|
806
808
|
const span = this.span();
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (span && pinned !== undefined && pinned < span.first) {
|
|
810
|
-
lead = this.sticky.native ? this.topOf(pinned) : lead - this.heightOf(pinned) - this.rowGap();
|
|
811
|
-
}
|
|
812
|
-
return this.horizontal() ? { width: Math.max(0, lead) } : { height: Math.max(0, lead) };
|
|
809
|
+
const lead = span ? Math.max(0, this.flowStart(span.first, this.rendersAhead())) : 0;
|
|
810
|
+
return this.horizontal() ? { width: lead } : { height: lead };
|
|
813
811
|
}, /* @ts-ignore */
|
|
814
812
|
...(ngDevMode ? [{ debugName: "spacer" }] : /* istanbul ignore next */ []));
|
|
815
|
-
/**
|
|
813
|
+
/**
|
|
814
|
+
* Where the first row rendered in flow starts: `first`'s place, less each row rendered ahead of
|
|
815
|
+
* it, or where native moves them, the first of those rows' own place. Less than nothing where a
|
|
816
|
+
* negative gap overlaps the rows not rendered, which the spacer cannot be: the first row takes
|
|
817
|
+
* the rest as a margin (`rowsFor`).
|
|
818
|
+
*/
|
|
819
|
+
flowStart(first, ahead) {
|
|
820
|
+
if (this.sticky.native && ahead.length > 0)
|
|
821
|
+
return this.topOf(ahead[0]);
|
|
822
|
+
let start = this.topOf(first);
|
|
823
|
+
for (const index of ahead)
|
|
824
|
+
start -= this.heightOf(index) + this.rowGap();
|
|
825
|
+
return start;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* The rows rendered ahead of the window: the pinned rows it has left behind, and where native
|
|
829
|
+
* moves rows in flow, the row before each pinned row after the outermost. Flow places a row
|
|
830
|
+
* after the row before it, so with that row rendered too, a pinned row is at its own place
|
|
831
|
+
* with no margin of its own, and its props stay as they are as the window moves past it.
|
|
832
|
+
*/
|
|
833
|
+
rendersAhead = computed(() => {
|
|
834
|
+
const span = this.span();
|
|
835
|
+
if (!span)
|
|
836
|
+
return [];
|
|
837
|
+
const pinned = this.sticky.pinned();
|
|
838
|
+
const ahead = new Set(pinned.filter((index) => index < span.first));
|
|
839
|
+
if (this.sticky.native && this.measuring()) {
|
|
840
|
+
for (const index of pinned.slice(1)) {
|
|
841
|
+
if (index <= span.first && index - 1 < span.first)
|
|
842
|
+
ahead.add(index - 1);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
return [...ahead].sort((a, b) => a - b);
|
|
846
|
+
}, { ...(ngDevMode ? { debugName: "rendersAhead" } : /* istanbul ignore next */ {}), equal: (a, b) => a.length === b.length && a.every((index, at) => index === b[at]) });
|
|
847
|
+
/** The rows from `first` up to `last`, and the rows ahead of them if there are any. */
|
|
816
848
|
rowsFor(items, first, last) {
|
|
817
849
|
const rows = [];
|
|
818
850
|
const pinned = this.sticky.pinned();
|
|
819
|
-
const
|
|
820
|
-
this.releaseRecycled(first, last,
|
|
851
|
+
const ahead = this.rendersAhead();
|
|
852
|
+
this.releaseRecycled(first, last, ahead);
|
|
853
|
+
// Where flow puts each row ahead of the window, where JavaScript moves the pinned ones.
|
|
854
|
+
const start = this.flowStart(first, ahead);
|
|
855
|
+
let at = start;
|
|
821
856
|
// A pinned row is on screen even when its own place in the list is not, which is the whole
|
|
822
857
|
// point of it, so it is rendered whether or not the window reaches that far.
|
|
823
|
-
for (const index of
|
|
858
|
+
for (const index of ahead) {
|
|
824
859
|
const key = this.keyAt(index);
|
|
825
860
|
rows.push(this.hold({
|
|
826
861
|
index,
|
|
@@ -828,11 +863,14 @@ export class VirtualList extends ScrollViewProps {
|
|
|
828
863
|
key,
|
|
829
864
|
item: items[index],
|
|
830
865
|
style: this.sticky.native
|
|
831
|
-
?
|
|
866
|
+
? pinned.includes(index)
|
|
867
|
+
? this.sticky.style(index)
|
|
868
|
+
: this.flowStyle()
|
|
832
869
|
: this.measuring()
|
|
833
|
-
? this.sticky.flowStyle(index,
|
|
870
|
+
? this.sticky.flowStyle(index, at)
|
|
834
871
|
: this.sticky.slotStyle(index),
|
|
835
872
|
}));
|
|
873
|
+
at += this.heightOf(index) + this.rowGap();
|
|
836
874
|
}
|
|
837
875
|
for (let index = first; index < last; index++) {
|
|
838
876
|
const key = this.keyAt(index);
|
|
@@ -844,26 +882,39 @@ export class VirtualList extends ScrollViewProps {
|
|
|
844
882
|
style: this.styleFor(index, pinned.includes(index)),
|
|
845
883
|
}));
|
|
846
884
|
}
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
if (lead !== undefined && this.sticky.native && this.measuring()) {
|
|
850
|
-
this.leadWindow(rows, lead, first);
|
|
885
|
+
if (ahead.length > 0 && this.sticky.native && this.measuring()) {
|
|
886
|
+
this.placeAhead(rows, ahead.length + 1, pinned);
|
|
851
887
|
}
|
|
888
|
+
if (start < 0)
|
|
889
|
+
this.startBefore(rows, start);
|
|
852
890
|
return rows;
|
|
853
891
|
}
|
|
892
|
+
/** Start the first row in flow at `start`, below zero, where the spacer cannot reach. */
|
|
893
|
+
startBefore(rows, start) {
|
|
894
|
+
const [row] = rows;
|
|
895
|
+
if (!row || !this.measuring())
|
|
896
|
+
return;
|
|
897
|
+
const margin = this.horizontal() ? 'marginLeft' : 'marginTop';
|
|
898
|
+
rows[0] = this.hold({ ...row, style: { ...row.style, [margin]: start } });
|
|
899
|
+
}
|
|
854
900
|
/**
|
|
855
|
-
* A pinned row native moves stays at its own place, so the rows
|
|
856
|
-
* made up
|
|
857
|
-
*
|
|
901
|
+
* A pinned row native moves stays at its own place, so the rows that are not rendered between
|
|
902
|
+
* it and the next are made up by a margin on the next row that is not pinned, up to the
|
|
903
|
+
* window's first, a negative one where a negative gap overlaps them: new props on a view native
|
|
904
|
+
* is moving put its transform back for a frame.
|
|
858
905
|
*/
|
|
859
|
-
|
|
860
|
-
const lead = rows[1];
|
|
861
|
-
// The pinned row's own gap already follows it in flow.
|
|
862
|
-
const between = this.topOf(first) - this.topOf(pinned) - this.heightOf(pinned) - this.rowGap();
|
|
863
|
-
if (!lead || between <= 0)
|
|
864
|
-
return;
|
|
906
|
+
placeAhead(rows, count, pinned) {
|
|
865
907
|
const margin = this.horizontal() ? 'marginLeft' : 'marginTop';
|
|
866
|
-
|
|
908
|
+
let end = this.topOf(rows[0].index);
|
|
909
|
+
for (let at = 0; at < Math.min(count, rows.length); at++) {
|
|
910
|
+
const row = rows[at];
|
|
911
|
+
const start = this.topOf(row.index);
|
|
912
|
+
if (start !== end && !pinned.includes(row.index)) {
|
|
913
|
+
rows[at] = this.hold({ ...row, style: { ...row.style, [margin]: start - end } });
|
|
914
|
+
}
|
|
915
|
+
// A row's own gap already follows it in flow.
|
|
916
|
+
end = start + this.heightOf(row.index) + this.rowGap();
|
|
917
|
+
}
|
|
867
918
|
}
|
|
868
919
|
styleFor(index, pinned) {
|
|
869
920
|
if (this.sticky.native && this.sticky.rows().has(index))
|