61 lines
2.0 KiB
JavaScript
61 lines
2.0 KiB
JavaScript
// Metro module 444 (f445).
|
|
import { FALLBACK_ESTIMATED_WIDTH, INITIAL_NUM_TO_RENDER } from "./Module442";
|
|
import ReactNativeElement from "./ReactNativeElement";
|
|
export default {
|
|
initial: {
|
|
itemCount: INITIAL_NUM_TO_RENDER,
|
|
spacerStyle: (a0) => ({
|
|
width: a0 * FALLBACK_ESTIMATED_WIDTH
|
|
})
|
|
},
|
|
next: ({ target, targetRect, thresholdRect }) => {
|
|
let r53;
|
|
let c12331_0;
|
|
c12331_0 = void 0;
|
|
if (target instanceof ReactNativeElement) {
|
|
const r41 = Math.min(targetRect.x + targetRect.width, thresholdRect.x + thresholdRect.width) - Math.max(targetRect.x, thresholdRect.x);
|
|
let previousElementSibling = target.previousElementSibling;
|
|
const r7 = previousElementSibling != null;
|
|
let r1 = 0;
|
|
let r44 = target;
|
|
if (r7) {
|
|
const r48 = previousElementSibling.nodeName.startsWith("RN:VirtualView");
|
|
let r0 = 0;
|
|
r1 = 0;
|
|
r44 = target;
|
|
if (r48) {
|
|
do {
|
|
const r2 = r0 + 1;
|
|
const previousElementSibling2 = previousElementSibling.previousElementSibling;
|
|
const r50 = previousElementSibling;
|
|
r1 = r2;
|
|
r44 = r50;
|
|
if (!(r2 < 3)) {
|
|
break;
|
|
}
|
|
r1 = r2;
|
|
r44 = r50;
|
|
if (previousElementSibling2 == null) {
|
|
break;
|
|
}
|
|
r53 = previousElementSibling2.nodeName.startsWith("RN:VirtualView");
|
|
previousElementSibling = previousElementSibling2;
|
|
r0 = r2;
|
|
r1 = r0;
|
|
r44 = r50;
|
|
} while (r53);
|
|
}
|
|
}
|
|
const r54 = 0 < r1 ? (target.getBoundingClientRect().left - r44.getBoundingClientRect().left) / r1 : FALLBACK_ESTIMATED_WIDTH;
|
|
c12331_0 = r54;
|
|
return {
|
|
itemCount: r41 / r54,
|
|
spacerStyle: (a0) => ({
|
|
width: a0 * c12331_0
|
|
})
|
|
};
|
|
}
|
|
throw new Error("Expected target to be a ReactNativeElement. VirtualRow requires DOM APIs to be enabled in React Native.");
|
|
}
|
|
};
|