@symbiote-native/angular 0.0.0-canary-20260724081123
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/LICENSE +21 -0
- package/README.md +157 -0
- package/babel-linker.cjs +7 -0
- package/babel-register-composed.cjs +127 -0
- package/bin/symbiote-angular-dev.cjs +93 -0
- package/build/angular/anchor-host-registry.d.ts +2 -0
- package/build/angular/anchor-host-registry.js +84 -0
- package/build/angular/anchor-host-registry.js.map +1 -0
- package/build/angular/bootstrap.d.ts +7 -0
- package/build/angular/bootstrap.js +15 -0
- package/build/angular/bootstrap.js.map +1 -0
- package/build/angular/components/activity-indicator/index.android.d.ts +12 -0
- package/build/angular/components/activity-indicator/index.android.js +21 -0
- package/build/angular/components/activity-indicator/index.android.js.map +1 -0
- package/build/angular/components/activity-indicator/index.d.ts +1 -0
- package/build/angular/components/activity-indicator/index.ios.d.ts +8 -0
- package/build/angular/components/activity-indicator/index.ios.js +21 -0
- package/build/angular/components/activity-indicator/index.ios.js.map +1 -0
- package/build/angular/components/activity-indicator/index.js +4 -0
- package/build/angular/components/activity-indicator/index.js.map +1 -0
- package/build/angular/components/activity-indicator/shared.d.ts +67 -0
- package/build/angular/components/activity-indicator/shared.js +260 -0
- package/build/angular/components/activity-indicator/shared.js.map +1 -0
- package/build/angular/components/button.d.ts +63 -0
- package/build/angular/components/button.js +332 -0
- package/build/angular/components/button.js.map +1 -0
- package/build/angular/components/flat-list/index.d.ts +122 -0
- package/build/angular/components/flat-list/index.js +688 -0
- package/build/angular/components/flat-list/index.js.map +1 -0
- package/build/angular/components/image/index.android.d.ts +10 -0
- package/build/angular/components/image/index.android.js +59 -0
- package/build/angular/components/image/index.android.js.map +1 -0
- package/build/angular/components/image/index.d.ts +1 -0
- package/build/angular/components/image/index.ios.d.ts +10 -0
- package/build/angular/components/image/index.ios.js +59 -0
- package/build/angular/components/image/index.ios.js.map +1 -0
- package/build/angular/components/image/index.js +3 -0
- package/build/angular/components/image/index.js.map +1 -0
- package/build/angular/components/image/shared.d.ts +101 -0
- package/build/angular/components/image/shared.js +406 -0
- package/build/angular/components/image/shared.js.map +1 -0
- package/build/angular/components/image-background.d.ts +81 -0
- package/build/angular/components/image-background.js +418 -0
- package/build/angular/components/image-background.js.map +1 -0
- package/build/angular/components/input-accessory-view/index.d.ts +60 -0
- package/build/angular/components/input-accessory-view/index.js +251 -0
- package/build/angular/components/input-accessory-view/index.js.map +1 -0
- package/build/angular/components/keyboard-avoiding-view/index.d.ts +82 -0
- package/build/angular/components/keyboard-avoiding-view/index.js +358 -0
- package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -0
- package/build/angular/components/modal/index.d.ts +92 -0
- package/build/angular/components/modal/index.js +360 -0
- package/build/angular/components/modal/index.js.map +1 -0
- package/build/angular/components/pressable/index.d.ts +123 -0
- package/build/angular/components/pressable/index.js +420 -0
- package/build/angular/components/pressable/index.js.map +1 -0
- package/build/angular/components/refresh-control/index.d.ts +86 -0
- package/build/angular/components/refresh-control/index.js +342 -0
- package/build/angular/components/refresh-control/index.js.map +1 -0
- package/build/angular/components/safe-area-view/index.d.ts +57 -0
- package/build/angular/components/safe-area-view/index.js +248 -0
- package/build/angular/components/safe-area-view/index.js.map +1 -0
- package/build/angular/components/scroll-view/index.android.d.ts +21 -0
- package/build/angular/components/scroll-view/index.android.js +235 -0
- package/build/angular/components/scroll-view/index.android.js.map +1 -0
- package/build/angular/components/scroll-view/index.d.ts +3 -0
- package/build/angular/components/scroll-view/index.ios.d.ts +9 -0
- package/build/angular/components/scroll-view/index.ios.js +86 -0
- package/build/angular/components/scroll-view/index.ios.js.map +1 -0
- package/build/angular/components/scroll-view/index.js +6 -0
- package/build/angular/components/scroll-view/index.js.map +1 -0
- package/build/angular/components/scroll-view/projection.d.ts +32 -0
- package/build/angular/components/scroll-view/projection.js +334 -0
- package/build/angular/components/scroll-view/projection.js.map +1 -0
- package/build/angular/components/scroll-view/shared.d.ts +230 -0
- package/build/angular/components/scroll-view/shared.js +682 -0
- package/build/angular/components/scroll-view/shared.js.map +1 -0
- package/build/angular/components/scroll-view/sticky-header.d.ts +40 -0
- package/build/angular/components/scroll-view/sticky-header.js +225 -0
- package/build/angular/components/scroll-view/sticky-header.js.map +1 -0
- package/build/angular/components/section-list/index.d.ts +116 -0
- package/build/angular/components/section-list/index.js +641 -0
- package/build/angular/components/section-list/index.js.map +1 -0
- package/build/angular/components/switch/index.android.d.ts +20 -0
- package/build/angular/components/switch/index.android.js +70 -0
- package/build/angular/components/switch/index.android.js.map +1 -0
- package/build/angular/components/switch/index.d.ts +1 -0
- package/build/angular/components/switch/index.ios.d.ts +19 -0
- package/build/angular/components/switch/index.ios.js +69 -0
- package/build/angular/components/switch/index.ios.js.map +1 -0
- package/build/angular/components/switch/index.js +4 -0
- package/build/angular/components/switch/index.js.map +1 -0
- package/build/angular/components/switch/shared.d.ts +40 -0
- package/build/angular/components/switch/shared.js +127 -0
- package/build/angular/components/switch/shared.js.map +1 -0
- package/build/angular/components/text-input.d.ts +153 -0
- package/build/angular/components/text-input.js +599 -0
- package/build/angular/components/text-input.js.map +1 -0
- package/build/angular/components/touchable/index.d.ts +245 -0
- package/build/angular/components/touchable/index.js +1186 -0
- package/build/angular/components/touchable/index.js.map +1 -0
- package/build/angular/components/touchable-native-feedback/index.d.ts +83 -0
- package/build/angular/components/touchable-native-feedback/index.js +371 -0
- package/build/angular/components/touchable-native-feedback/index.js.map +1 -0
- package/build/angular/components/virtualized-list/directives.d.ts +54 -0
- package/build/angular/components/virtualized-list/directives.js +153 -0
- package/build/angular/components/virtualized-list/directives.js.map +1 -0
- package/build/angular/components/virtualized-list/index.d.ts +253 -0
- package/build/angular/components/virtualized-list/index.js +1031 -0
- package/build/angular/components/virtualized-list/index.js.map +1 -0
- package/build/angular/components/virtualized-section-list/directives.d.ts +37 -0
- package/build/angular/components/virtualized-section-list/directives.js +76 -0
- package/build/angular/components/virtualized-section-list/directives.js.map +1 -0
- package/build/angular/components/virtualized-section-list/index.d.ts +178 -0
- package/build/angular/components/virtualized-section-list/index.js +720 -0
- package/build/angular/components/virtualized-section-list/index.js.map +1 -0
- package/build/angular/components.d.ts +39 -0
- package/build/angular/components.js +38 -0
- package/build/angular/components.js.map +1 -0
- package/build/angular/create-portal/index.d.ts +22 -0
- package/build/angular/create-portal/index.js +74 -0
- package/build/angular/create-portal/index.js.map +1 -0
- package/build/angular/create-tunnel/index.d.ts +34 -0
- package/build/angular/create-tunnel/index.js +126 -0
- package/build/angular/create-tunnel/index.js.map +1 -0
- package/build/angular/descriptor-to-angular/index.d.ts +22 -0
- package/build/angular/descriptor-to-angular/index.js +142 -0
- package/build/angular/descriptor-to-angular/index.js.map +1 -0
- package/build/angular/host-instance/index.d.ts +2 -0
- package/build/angular/host-instance/index.js +37 -0
- package/build/angular/host-instance/index.js.map +1 -0
- package/build/angular/index.d.ts +22 -0
- package/build/angular/index.js +46 -0
- package/build/angular/index.js.map +1 -0
- package/build/angular/modules/animated/animated-leaf-binder/index.d.ts +14 -0
- package/build/angular/modules/animated/animated-leaf-binder/index.js +91 -0
- package/build/angular/modules/animated/animated-leaf-binder/index.js.map +1 -0
- package/build/angular/modules/animated/animated-leaf-binder.d.ts +14 -0
- package/build/angular/modules/animated/animated-leaf-binder.js +91 -0
- package/build/angular/modules/animated/animated-leaf-binder.js.map +1 -0
- package/build/angular/modules/animated/create-animated-component.d.ts +59 -0
- package/build/angular/modules/animated/create-animated-component.js +364 -0
- package/build/angular/modules/animated/create-animated-component.js.map +1 -0
- package/build/angular/modules/animated/index.d.ts +51 -0
- package/build/angular/modules/animated/index.js +59 -0
- package/build/angular/modules/animated/index.js.map +1 -0
- package/build/angular/modules/app-registry/index.d.ts +7 -0
- package/build/angular/modules/app-registry/index.js +23 -0
- package/build/angular/modules/app-registry/index.js.map +1 -0
- package/build/angular/modules/status-bar/index.d.ts +20 -0
- package/build/angular/modules/status-bar/index.js +59 -0
- package/build/angular/modules/status-bar/index.js.map +1 -0
- package/build/angular/primitives/index.d.ts +63 -0
- package/build/angular/primitives/index.js +189 -0
- package/build/angular/primitives/index.js.map +1 -0
- package/build/angular/primitives/shared.d.ts +88 -0
- package/build/angular/primitives/shared.js +171 -0
- package/build/angular/primitives/shared.js.map +1 -0
- package/build/angular/render/index.d.ts +11 -0
- package/build/angular/render/index.js +171 -0
- package/build/angular/render/index.js.map +1 -0
- package/build/angular/renderer/index.d.ts +37 -0
- package/build/angular/renderer/index.js +301 -0
- package/build/angular/renderer/index.js.map +1 -0
- package/build/angular/services/color-scheme.service.d.ts +16 -0
- package/build/angular/services/color-scheme.service.js +31 -0
- package/build/angular/services/color-scheme.service.js.map +1 -0
- package/build/angular/services/index.d.ts +2 -0
- package/build/angular/services/index.js +3 -0
- package/build/angular/services/index.js.map +1 -0
- package/build/angular/services/window-dimensions.service.d.ts +16 -0
- package/build/angular/services/window-dimensions.service.js +42 -0
- package/build/angular/services/window-dimensions.service.js.map +1 -0
- package/metro-config.cjs +48 -0
- package/metro-css-parser.cjs +13 -0
- package/package.json +80 -0
- package/src/__tests__/responder-change-detection.test.ts +102 -0
- package/src/__tests__/responder-nested-cd.test.ts +113 -0
- package/src/anchor-host-registry.ts +88 -0
- package/src/angular-gaps.test.ts +142 -0
- package/src/angular-imports.test.ts +100 -0
- package/src/bootstrap.ts +26 -0
- package/src/components/activity-indicator/activity-indicator-class-style.test.ts +44 -0
- package/src/components/activity-indicator/activity-indicator.test.ts +131 -0
- package/src/components/activity-indicator/index.android.ts +16 -0
- package/src/components/activity-indicator/index.ios.ts +17 -0
- package/src/components/activity-indicator/index.ts +4 -0
- package/src/components/activity-indicator/shared.ts +206 -0
- package/src/components/button.ts +193 -0
- package/src/components/flat-list/column-wrapper-style-class.test.ts +116 -0
- package/src/components/flat-list/flat-list-array-style.test.ts +131 -0
- package/src/components/flat-list/flat-list-class-style.test.ts +74 -0
- package/src/components/flat-list/flat-list-scroll-containment.test.ts +107 -0
- package/src/components/flat-list/flat-list.test.ts +99 -0
- package/src/components/flat-list/index.ts +574 -0
- package/src/components/image/image-class-style.test.ts +46 -0
- package/src/components/image/index.android.ts +48 -0
- package/src/components/image/index.ios.ts +48 -0
- package/src/components/image/index.ts +3 -0
- package/src/components/image/shared.ts +479 -0
- package/src/components/image-background-class-style.test.ts +48 -0
- package/src/components/image-background-style-class.test.ts +79 -0
- package/src/components/image-background.ts +270 -0
- package/src/components/input-accessory-view/index.ts +185 -0
- package/src/components/input-accessory-view/input-accessory-view.test.ts +43 -0
- package/src/components/keyboard-avoiding-view/index.ts +303 -0
- package/src/components/keyboard-avoiding-view/keyboard-avoiding-view.test.ts +54 -0
- package/src/components/modal/index.ts +299 -0
- package/src/components/modal/modal.test.ts +43 -0
- package/src/components/pressable/index.ts +373 -0
- package/src/components/pressable/pressable.test.ts +85 -0
- package/src/components/refresh-control/index.ts +284 -0
- package/src/components/refresh-control/refresh-control.test.ts +41 -0
- package/src/components/safe-area-view/index.ts +177 -0
- package/src/components/safe-area-view/safe-area-view.test.ts +43 -0
- package/src/components/scroll-view/android-scroll-view-axis-projection.test.ts +123 -0
- package/src/components/scroll-view/content-container-style-class.test.ts +75 -0
- package/src/components/scroll-view/index.android.ts +190 -0
- package/src/components/scroll-view/index.ios.ts +79 -0
- package/src/components/scroll-view/index.ts +7 -0
- package/src/components/scroll-view/projection.ts +414 -0
- package/src/components/scroll-view/scroll-view-class-style.test.ts +134 -0
- package/src/components/scroll-view/scroll-view-projection.test.ts +194 -0
- package/src/components/scroll-view/shared.ts +844 -0
- package/src/components/scroll-view/sticky-header.ts +255 -0
- package/src/components/section-list/index.ts +445 -0
- package/src/components/switch/android-switch-class.test.ts +42 -0
- package/src/components/switch/index.android.ts +61 -0
- package/src/components/switch/index.ios.ts +60 -0
- package/src/components/switch/index.ts +4 -0
- package/src/components/switch/shared.ts +197 -0
- package/src/components/switch/switch.test.ts +92 -0
- package/src/components/text-input-class-style.test.ts +54 -0
- package/src/components/text-input.ts +531 -0
- package/src/components/touchable/index.ts +629 -0
- package/src/components/touchable/touchable.test.ts +102 -0
- package/src/components/touchable-native-feedback/index.ts +254 -0
- package/src/components/touchable-native-feedback/touchable-native-feedback.test.ts +49 -0
- package/src/components/virtualized-list/directives.ts +168 -0
- package/src/components/virtualized-list/index.ts +992 -0
- package/src/components/virtualized-list/virtualized-list-class-style.test.ts +76 -0
- package/src/components/virtualized-section-list/directives.ts +90 -0
- package/src/components/virtualized-section-list/index.ts +601 -0
- package/src/components/virtualized-section-list/virtualized-section-list-class-style.test.ts +60 -0
- package/src/components.ts +149 -0
- package/src/create-portal/create-portal.test.ts +90 -0
- package/src/create-portal/index.ts +74 -0
- package/src/create-tunnel/create-tunnel.test.ts +120 -0
- package/src/create-tunnel/index.ts +136 -0
- package/src/descriptor-to-angular/descriptor-outlet.test.ts +94 -0
- package/src/descriptor-to-angular/index.ts +190 -0
- package/src/host-instance/host-instance.test.ts +49 -0
- package/src/host-instance/index.ts +36 -0
- package/src/index.ts +261 -0
- package/src/modules/animated/animated-leaf-binder/animated-leaf-binder.test.ts +116 -0
- package/src/modules/animated/animated-leaf-binder/index.ts +101 -0
- package/src/modules/animated/animated-leaf-binder.test.ts +116 -0
- package/src/modules/animated/animated-leaf-binder.ts +101 -0
- package/src/modules/animated/animated-scroll-view.test.ts +102 -0
- package/src/modules/animated/create-animated-component.ts +365 -0
- package/src/modules/animated/index.ts +105 -0
- package/src/modules/app-registry/app-registry.test.ts +106 -0
- package/src/modules/app-registry/index.ts +60 -0
- package/src/modules/status-bar/index.ts +57 -0
- package/src/modules/status-bar/status-bar.test.ts +50 -0
- package/src/primitives/index.ts +119 -0
- package/src/primitives/shared.ts +190 -0
- package/src/render/index.ts +235 -0
- package/src/render/render.test.ts +147 -0
- package/src/renderer/index.ts +347 -0
- package/src/renderer/renderer.test.ts +203 -0
- package/src/services/color-scheme.service.ts +27 -0
- package/src/services/index.ts +2 -0
- package/src/services/services.test.ts +163 -0
- package/src/services/window-dimensions.service.ts +41 -0
- package/tsconfig.angular.base.json +30 -0
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
// VirtualizedList, the Angular lifecycle half. The windowing engine (offset table, window
|
|
2
|
+
// compute, batch throttle, viewability, edge-reached, the child PLAN, the imperative-handle
|
|
3
|
+
// geometry) lives in @symbiote-native/components/state, shared verbatim with the React and Vue adapters
|
|
4
|
+
// so every adapter keeps the same feature surface. Here Angular supplies only the lifecycle: plain fields
|
|
5
|
+
// for scroll offset / viewport / measurement bumps, a once-per-CD metrics + view recompute in
|
|
6
|
+
// ngDoCheck (the Angular twin of React render / Vue `computed` — it owns the controlled
|
|
7
|
+
// committedWindow throttle and assembles the windowed cells before the template bindings are read),
|
|
8
|
+
// and the after-commit work (batch fill, onEndReached/onStartReached, viewability, initialScroll, MVCP)
|
|
9
|
+
// in ngAfterViewChecked. OnPush + ChangeDetectorRef.markForCheck() drives re-render off the native
|
|
10
|
+
// scroll/layout/measure callbacks (they fire outside Angular's own event bindings, so they must
|
|
11
|
+
// mark the view dirty). This is the Angular twin of the React useReducer/useEffect and Vue
|
|
12
|
+
// ref/computed/watch over the same shared functions. It composes the Angular ScrollView, exactly
|
|
13
|
+
// as the React/Vue lists drive their ScrollView.
|
|
14
|
+
//
|
|
15
|
+
// Per-item rendering is TEMPLATES, not a callback: React/Vue `renderItem: (info) => element` does
|
|
16
|
+
// not translate to Angular. The app supplies the cell via `<ng-template vListItem>` (and the
|
|
17
|
+
// header/footer/empty/separator slots via vListHeader/vListFooter/vListEmpty/vListSeparator); the
|
|
18
|
+
// list captures them with @ContentChild and stamps the WINDOWED slice through VListOutletDirective
|
|
19
|
+
// (a core-only NgTemplateOutlet twin — @angular/common is not a dependency). See ./directives.ts.
|
|
20
|
+
// Every React/Vue behavior is present (windowing, onEndReached, viewability, headers/footers/empty/
|
|
21
|
+
// separators, refresh, imperative scroll, horizontal, inverted, MVCP); only the cell AUTHORING
|
|
22
|
+
// shape differs, since a callback prop returning an element has no Angular equivalent.
|
|
23
|
+
//
|
|
24
|
+
// Lists have no Descriptor render fn — the cell content is the framework's own children.
|
|
25
|
+
// Cells/spacers are plain symbiote-view host elements.
|
|
26
|
+
import { CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, EventEmitter, Input, Output, ViewChild, inject, } from '@angular/core';
|
|
27
|
+
import { DEFAULT_END_REACHED_THRESHOLD, DEFAULT_INITIAL_NUM_TO_RENDER, DEFAULT_MAX_TO_RENDER_PER_BATCH, DEFAULT_START_REACHED_THRESHOLD, DEFAULT_UPDATE_CELLS_BATCHING_PERIOD, DEFAULT_WINDOW_SIZE, EMPTY_OFFSET, FIRST_INDEX, INVERTED_X_STYLE, INVERTED_Y_STYLE, buildListPlan, buildViewabilityPairs, createInitialListState, isSeparatorGapInRange, listEffectSignature, readLayoutLength, readScrollOffset, reduceList, resolveAccessibilityProps, resolveItemKey, } from '@symbiote-native/components';
|
|
28
|
+
import { dlog, flattenStyle, } from '@symbiote-native/engine';
|
|
29
|
+
import { ScrollView } from '../scroll-view';
|
|
30
|
+
import { RefreshControl } from '../refresh-control';
|
|
31
|
+
import { anchorHostStyle, ViewHost } from '../../primitives';
|
|
32
|
+
import { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListItemDirective, VListOutletDirective, VListSeparatorDirective, } from './directives';
|
|
33
|
+
import * as i0 from "@angular/core";
|
|
34
|
+
export { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListItemDirective, VListSeparatorDirective, } from './directives';
|
|
35
|
+
export class VirtualizedList {
|
|
36
|
+
// The list's edge/viewability/failure events as real Angular events: `(endReached)="…"`, not
|
|
37
|
+
// `[onEndReached]="…"`. See handleRefresh/accessibility*Tick below for how the still-callback-
|
|
38
|
+
// shaped ScrollView/RefreshControl @Input()s are fed from these.
|
|
39
|
+
endReached = new EventEmitter();
|
|
40
|
+
startReached = new EventEmitter();
|
|
41
|
+
refresh = new EventEmitter();
|
|
42
|
+
viewableItemsChanged = new EventEmitter();
|
|
43
|
+
scrollToIndexFailed = new EventEmitter();
|
|
44
|
+
accessibilityAction = new EventEmitter();
|
|
45
|
+
accessibilityTap = new EventEmitter();
|
|
46
|
+
magicTap = new EventEmitter();
|
|
47
|
+
accessibilityEscape = new EventEmitter();
|
|
48
|
+
data;
|
|
49
|
+
getItem;
|
|
50
|
+
getItemCount;
|
|
51
|
+
keyExtractor;
|
|
52
|
+
getItemLayout;
|
|
53
|
+
horizontal;
|
|
54
|
+
inverted;
|
|
55
|
+
extraData;
|
|
56
|
+
onEndReachedThreshold;
|
|
57
|
+
onStartReachedThreshold;
|
|
58
|
+
refreshing;
|
|
59
|
+
progressViewOffset;
|
|
60
|
+
// Set explicitly by a wrapper (FlatList/VirtualizedSectionList) that ALWAYS binds
|
|
61
|
+
// `(refresh)="refresh.emit()"` on this component to re-forward the event outward — that binding
|
|
62
|
+
// itself makes `this.refresh.observed` permanently true (Angular subscribes unconditionally the
|
|
63
|
+
// moment a template writes `(refresh)="…"`, regardless of what the handler does), so `.observed`
|
|
64
|
+
// can no longer tell "the app actually wants pull-to-refresh" from "a wrapper is just forwarding
|
|
65
|
+
// the event". A wrapper passes its OWN public `refresh.observed` here instead; direct usage
|
|
66
|
+
// (no wrapper) falls back to this component's own `.observed`, unchanged from before.
|
|
67
|
+
refreshRequested;
|
|
68
|
+
viewabilityConfig;
|
|
69
|
+
viewabilityConfigCallbackPairs;
|
|
70
|
+
initialNumToRender;
|
|
71
|
+
initialScrollIndex;
|
|
72
|
+
maxToRenderPerBatch;
|
|
73
|
+
updateCellsBatchingPeriod;
|
|
74
|
+
windowSize;
|
|
75
|
+
stickyHeaderIndices;
|
|
76
|
+
maintainVisibleContentPosition;
|
|
77
|
+
onScroll;
|
|
78
|
+
onScrollBeginDrag;
|
|
79
|
+
onScrollEndDrag;
|
|
80
|
+
onMomentumScrollBegin;
|
|
81
|
+
onMomentumScrollEnd;
|
|
82
|
+
scrollEventThrottle;
|
|
83
|
+
keyboardShouldPersistTaps;
|
|
84
|
+
keyboardDismissMode;
|
|
85
|
+
style;
|
|
86
|
+
contentContainerStyle;
|
|
87
|
+
testID;
|
|
88
|
+
nativeID;
|
|
89
|
+
accessible;
|
|
90
|
+
accessibilityLabel;
|
|
91
|
+
accessibilityHint;
|
|
92
|
+
accessibilityRole;
|
|
93
|
+
accessibilityState;
|
|
94
|
+
accessibilityValue;
|
|
95
|
+
accessibilityActions;
|
|
96
|
+
accessibilityLabelledBy;
|
|
97
|
+
importantForAccessibility;
|
|
98
|
+
accessibilityLiveRegion;
|
|
99
|
+
screenReaderFocusable;
|
|
100
|
+
accessibilityViewIsModal;
|
|
101
|
+
accessibilityElementsHidden;
|
|
102
|
+
accessibilityIgnoresInvertColors;
|
|
103
|
+
accessibilityLanguage;
|
|
104
|
+
accessibilityRespondsToUserInteraction;
|
|
105
|
+
accessibilityShowsLargeContentViewer;
|
|
106
|
+
accessibilityLargeContentTitle;
|
|
107
|
+
role;
|
|
108
|
+
ariaLabel;
|
|
109
|
+
ariaLabelledBy;
|
|
110
|
+
ariaLive;
|
|
111
|
+
ariaHidden;
|
|
112
|
+
ariaBusy;
|
|
113
|
+
ariaChecked;
|
|
114
|
+
ariaDisabled;
|
|
115
|
+
ariaExpanded;
|
|
116
|
+
ariaSelected;
|
|
117
|
+
ariaModal;
|
|
118
|
+
ariaValueMax;
|
|
119
|
+
ariaValueMin;
|
|
120
|
+
ariaValueNow;
|
|
121
|
+
ariaValueText;
|
|
122
|
+
// The cell + slot templates the app authors (the Angular twin of renderItem / ListHeaderComponent
|
|
123
|
+
// / ListFooterComponent / ListEmptyComponent / ItemSeparatorComponent), captured from projected
|
|
124
|
+
// <ng-template> content. Resolved by ngAfterContentInit, read each ngDoCheck (from the 2nd CD on).
|
|
125
|
+
itemDir;
|
|
126
|
+
headerDir;
|
|
127
|
+
footerDir;
|
|
128
|
+
emptyDir;
|
|
129
|
+
separatorDir;
|
|
130
|
+
// The composed inner scroll view. Its instance IS an IScrollViewHandle (scrollTo / scrollToEnd /
|
|
131
|
+
// flashScrollIndicators / getScrollNode), so the imperative handle delegates straight to it.
|
|
132
|
+
// Available from ngAfterViewInit on; the handle reads the node lazily and no-ops before commit.
|
|
133
|
+
scrollView;
|
|
134
|
+
// --- template-bound view state, assembled in ngDoCheck (recomputeView) ---
|
|
135
|
+
itemCount = EMPTY_OFFSET;
|
|
136
|
+
windowCells = [];
|
|
137
|
+
leadingSpacerStyle = null;
|
|
138
|
+
trailingSpacerStyle = null;
|
|
139
|
+
cellStyle = undefined;
|
|
140
|
+
renderedStickyIndices = undefined;
|
|
141
|
+
// Bound to the template's `[style]="resolvedStyle"`, which Angular compiles to the built-in
|
|
142
|
+
// ɵɵstyleMap instruction — it only understands a flat object, never an array (RN's own
|
|
143
|
+
// `style={[a, b]}` composition idiom crashes deep inside Angular's styling engine), so this
|
|
144
|
+
// is always pre-flattened via the engine's own flattenStyle, never left as an array.
|
|
145
|
+
resolvedStyle = undefined;
|
|
146
|
+
resolvedContentContainerStyle = undefined;
|
|
147
|
+
resolvedMaintainVisibleContentPosition = undefined;
|
|
148
|
+
// The offset we are imperatively driving native to before the scroll handle attaches (rides down
|
|
149
|
+
// as contentOffset). A fresh object identity each push so the commit re-applies a repeated value.
|
|
150
|
+
commandedOffset = undefined;
|
|
151
|
+
// The one folded state cell (the Angular twin of React's stateRef): scroll offset, viewport,
|
|
152
|
+
// measured lengths, committed window, edge/viewability dedup, MVCP anchor — all in IListState,
|
|
153
|
+
// driven by the shared reduceList. `renderVersion` bumps whenever a transition changes render
|
|
154
|
+
// state, so ngDoCheck's recompute-dedup can detect it (listState is a plain object, not tracked).
|
|
155
|
+
listState = createInitialListState();
|
|
156
|
+
renderVersion = EMPTY_OFFSET;
|
|
157
|
+
cellMeasures = new Map();
|
|
158
|
+
separatorOverrides = new Map();
|
|
159
|
+
// The adapter-owned debounce (minimumViewTime) and incremental-fill timers; the reducer only
|
|
160
|
+
// hands back a delay.
|
|
161
|
+
viewableTimer = null;
|
|
162
|
+
batchTimer = null;
|
|
163
|
+
// Dedupes the after-commit effects: they run only when the windowing signature changed.
|
|
164
|
+
lastEffectSignature = '';
|
|
165
|
+
// Dedupes ngDoCheck's own recompute. WITHOUT this, recomputeView() unconditionally rebuilds
|
|
166
|
+
// windowCells (and each cell's `separators` handle — fresh closures every call) on EVERY CD pass,
|
|
167
|
+
// including ones triggered by something else entirely in the app. A fresh context object flows
|
|
168
|
+
// into VListOutletDirective, which (correctly) sees its `context` @Input() change and calls
|
|
169
|
+
// `viewRef.markForCheck()` — which reschedules ANOTHER change-detection tick via the zoneless
|
|
170
|
+
// scheduler (adapters/angular/src/render.ts). Recomputing unconditionally therefore free-runs
|
|
171
|
+
// forever the moment a list actually has cells to stamp (a real, previously-dormant bug only
|
|
172
|
+
// exposed once flat-list.test.ts's projection fix let cells render for the first time — see that
|
|
173
|
+
// test's comment). Guarding recompute behind "did anything relevant actually change" breaks the
|
|
174
|
+
// cycle: unrelated CD passes reuse the same windowCells/context identities, so
|
|
175
|
+
// VListOutletDirective's ngOnChanges sees no change and never reschedules.
|
|
176
|
+
lastRecompute = undefined;
|
|
177
|
+
cdr = inject(ChangeDetectorRef);
|
|
178
|
+
// This component's OWN host — the non-painting anchor `class="..."` at the use site resolves
|
|
179
|
+
// onto (see anchorHostStyle's doc comment) — NOT `scrollView` above, which targets the real
|
|
180
|
+
// inner `<ScrollView>` one level down (itself its own separate anchor host).
|
|
181
|
+
elementRef = inject(ElementRef);
|
|
182
|
+
get foldedAccessibility() {
|
|
183
|
+
return resolveAccessibilityProps({
|
|
184
|
+
testID: this.testID,
|
|
185
|
+
nativeID: this.nativeID,
|
|
186
|
+
accessible: this.accessible,
|
|
187
|
+
accessibilityLabel: this.accessibilityLabel,
|
|
188
|
+
accessibilityHint: this.accessibilityHint,
|
|
189
|
+
accessibilityRole: this.accessibilityRole,
|
|
190
|
+
accessibilityState: this.accessibilityState,
|
|
191
|
+
accessibilityValue: this.accessibilityValue,
|
|
192
|
+
accessibilityActions: this.accessibilityActions,
|
|
193
|
+
accessibilityLabelledBy: this.accessibilityLabelledBy,
|
|
194
|
+
importantForAccessibility: this.importantForAccessibility,
|
|
195
|
+
accessibilityLiveRegion: this.accessibilityLiveRegion,
|
|
196
|
+
screenReaderFocusable: this.screenReaderFocusable,
|
|
197
|
+
accessibilityViewIsModal: this.accessibilityViewIsModal,
|
|
198
|
+
accessibilityElementsHidden: this.accessibilityElementsHidden,
|
|
199
|
+
accessibilityIgnoresInvertColors: this.accessibilityIgnoresInvertColors,
|
|
200
|
+
accessibilityLanguage: this.accessibilityLanguage,
|
|
201
|
+
accessibilityRespondsToUserInteraction: this.accessibilityRespondsToUserInteraction,
|
|
202
|
+
accessibilityShowsLargeContentViewer: this.accessibilityShowsLargeContentViewer,
|
|
203
|
+
accessibilityLargeContentTitle: this.accessibilityLargeContentTitle,
|
|
204
|
+
role: this.role,
|
|
205
|
+
'aria-label': this.ariaLabel,
|
|
206
|
+
'aria-labelledby': this.ariaLabelledBy,
|
|
207
|
+
'aria-live': this.ariaLive,
|
|
208
|
+
'aria-hidden': this.ariaHidden,
|
|
209
|
+
'aria-busy': this.ariaBusy,
|
|
210
|
+
'aria-checked': this.ariaChecked,
|
|
211
|
+
'aria-disabled': this.ariaDisabled,
|
|
212
|
+
'aria-expanded': this.ariaExpanded,
|
|
213
|
+
'aria-selected': this.ariaSelected,
|
|
214
|
+
'aria-modal': this.ariaModal,
|
|
215
|
+
'aria-valuemax': this.ariaValueMax,
|
|
216
|
+
'aria-valuemin': this.ariaValueMin,
|
|
217
|
+
'aria-valuenow': this.ariaValueNow,
|
|
218
|
+
'aria-valuetext': this.ariaValueText,
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
get shouldRenderRefreshControl() {
|
|
222
|
+
return this.refreshRequested ?? this.refresh.observed;
|
|
223
|
+
}
|
|
224
|
+
get isHorizontal() {
|
|
225
|
+
return this.horizontal === true;
|
|
226
|
+
}
|
|
227
|
+
get isInverted() {
|
|
228
|
+
return this.inverted === true;
|
|
229
|
+
}
|
|
230
|
+
get windowSizeValue() {
|
|
231
|
+
return this.windowSize ?? DEFAULT_WINDOW_SIZE;
|
|
232
|
+
}
|
|
233
|
+
get initialNumToRenderValue() {
|
|
234
|
+
return this.initialNumToRender ?? DEFAULT_INITIAL_NUM_TO_RENDER;
|
|
235
|
+
}
|
|
236
|
+
get maxToRenderPerBatchValue() {
|
|
237
|
+
return this.maxToRenderPerBatch ?? DEFAULT_MAX_TO_RENDER_PER_BATCH;
|
|
238
|
+
}
|
|
239
|
+
get updateCellsBatchingPeriodValue() {
|
|
240
|
+
return this.updateCellsBatchingPeriod ?? DEFAULT_UPDATE_CELLS_BATCHING_PERIOD;
|
|
241
|
+
}
|
|
242
|
+
get onEndReachedThresholdValue() {
|
|
243
|
+
return this.onEndReachedThreshold ?? DEFAULT_END_REACHED_THRESHOLD;
|
|
244
|
+
}
|
|
245
|
+
get onStartReachedThresholdValue() {
|
|
246
|
+
return this.onStartReachedThreshold ?? DEFAULT_START_REACHED_THRESHOLD;
|
|
247
|
+
}
|
|
248
|
+
// ScrollView's onScroll stays an @Input() callback (an Animated.event(...) target must be able to
|
|
249
|
+
// flow through it, which an @Output() can't carry), so this is a stable arrow field passed
|
|
250
|
+
// straight to [onScroll]. onLayout is a real @Output() now, bound via (layout)="onLayoutTick($event)".
|
|
251
|
+
onScrollTick = (event) => {
|
|
252
|
+
const offset = readScrollOffset(event, this.isHorizontal);
|
|
253
|
+
if (offset === undefined)
|
|
254
|
+
return;
|
|
255
|
+
dlog(`Angular VirtualizedList onScroll offset=${offset}`);
|
|
256
|
+
// A real native scroll supersedes any pending commanded offset.
|
|
257
|
+
this.commandedOffset = undefined;
|
|
258
|
+
this.dispatch({ kind: 'scroll', offset });
|
|
259
|
+
// Compose, don't clobber: internal windowing ran first, now the user's onScroll.
|
|
260
|
+
this.onScroll?.(event);
|
|
261
|
+
};
|
|
262
|
+
onLayoutTick = (event) => {
|
|
263
|
+
const length = readLayoutLength(event, this.isHorizontal);
|
|
264
|
+
if (length === undefined)
|
|
265
|
+
return;
|
|
266
|
+
dlog(`Angular VirtualizedList onLayout viewport=${length}`);
|
|
267
|
+
this.dispatch({ kind: 'layout', length });
|
|
268
|
+
};
|
|
269
|
+
// RefreshControl's refresh and ScrollView's accessibility events are real @Output()s now, bound
|
|
270
|
+
// via (refresh)="handleRefresh()" / (accessibilityAction)="accessibilityActionTick($event)" etc.
|
|
271
|
+
// — these fields just adapt VirtualizedList's own @Output() into a plain re-emit callback.
|
|
272
|
+
handleRefresh = () => {
|
|
273
|
+
this.refresh.emit();
|
|
274
|
+
};
|
|
275
|
+
accessibilityActionTick = (event) => {
|
|
276
|
+
this.accessibilityAction.emit(event);
|
|
277
|
+
};
|
|
278
|
+
accessibilityTapTick = (event) => {
|
|
279
|
+
this.accessibilityTap.emit(event);
|
|
280
|
+
};
|
|
281
|
+
magicTapTick = (event) => {
|
|
282
|
+
this.magicTap.emit(event);
|
|
283
|
+
};
|
|
284
|
+
accessibilityEscapeTick = (event) => {
|
|
285
|
+
this.accessibilityEscape.emit(event);
|
|
286
|
+
};
|
|
287
|
+
keyFor = (index) => {
|
|
288
|
+
const item = this.getItem(this.data, index);
|
|
289
|
+
return resolveItemKey(item, index, this.keyExtractor);
|
|
290
|
+
};
|
|
291
|
+
// The reducer inputs, folded off the @Input()s each call. The edge/viewability listeners map to
|
|
292
|
+
// `.observed` (Angular's "is anyone bound to this @Output()"), so the reducer emits only when the
|
|
293
|
+
// consumer listens — the same on-demand gating the prop-callback era had.
|
|
294
|
+
buildInputs() {
|
|
295
|
+
return {
|
|
296
|
+
data: this.data,
|
|
297
|
+
getItem: this.getItem,
|
|
298
|
+
getItemCount: this.getItemCount,
|
|
299
|
+
keyExtractor: this.keyExtractor,
|
|
300
|
+
getItemLayout: this.getItemLayout,
|
|
301
|
+
horizontal: this.isHorizontal,
|
|
302
|
+
windowSize: this.windowSizeValue,
|
|
303
|
+
initialNumToRender: this.initialNumToRenderValue,
|
|
304
|
+
maxToRenderPerBatch: this.maxToRenderPerBatchValue,
|
|
305
|
+
updateCellsBatchingPeriod: this.updateCellsBatchingPeriodValue,
|
|
306
|
+
onEndReachedThreshold: this.onEndReachedThresholdValue,
|
|
307
|
+
onStartReachedThreshold: this.onStartReachedThresholdValue,
|
|
308
|
+
onEndReachedActive: this.endReached.observed,
|
|
309
|
+
onStartReachedActive: this.startReached.observed,
|
|
310
|
+
viewabilityPairs: buildViewabilityPairs(this.viewableItemsChanged.observed
|
|
311
|
+
? (info) => this.viewableItemsChanged.emit(info)
|
|
312
|
+
: undefined, this.viewabilityConfig, this.viewabilityConfigCallbackPairs),
|
|
313
|
+
maintainVisibleContentPosition: this.maintainVisibleContentPosition,
|
|
314
|
+
initialScrollIndex: this.initialScrollIndex,
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
// Map a native event / imperative call to an action, run the returned effects, and mark the view
|
|
318
|
+
// dirty when render state changed (the native callbacks fire outside Angular's own bindings).
|
|
319
|
+
dispatch(action) {
|
|
320
|
+
const inputs = this.buildInputs();
|
|
321
|
+
const result = reduceList(this.listState, action, inputs);
|
|
322
|
+
this.runEffects(result.effects, inputs);
|
|
323
|
+
if (result.changed) {
|
|
324
|
+
this.renderVersion += 1;
|
|
325
|
+
this.cdr.markForCheck();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
runEffects(effects, inputs) {
|
|
329
|
+
for (const effect of effects) {
|
|
330
|
+
switch (effect.kind) {
|
|
331
|
+
case 'scroll-to':
|
|
332
|
+
this.scrollToPixel(effect.offset, effect.animated);
|
|
333
|
+
break;
|
|
334
|
+
case 'fire-end-reached':
|
|
335
|
+
this.endReached.emit({ distanceFromEnd: effect.distanceFromEnd });
|
|
336
|
+
break;
|
|
337
|
+
case 'fire-start-reached':
|
|
338
|
+
this.startReached.emit({ distanceFromStart: effect.distanceFromStart });
|
|
339
|
+
break;
|
|
340
|
+
case 'fire-scroll-to-index-failed':
|
|
341
|
+
this.scrollToIndexFailed.emit({
|
|
342
|
+
index: effect.index,
|
|
343
|
+
highestMeasuredFrameIndex: effect.highestMeasuredFrameIndex,
|
|
344
|
+
averageItemLength: effect.averageItemLength,
|
|
345
|
+
});
|
|
346
|
+
break;
|
|
347
|
+
case 'schedule-refill': {
|
|
348
|
+
if (this.batchTimer !== null)
|
|
349
|
+
clearTimeout(this.batchTimer);
|
|
350
|
+
this.batchTimer = setTimeout(() => {
|
|
351
|
+
this.batchTimer = null;
|
|
352
|
+
this.dispatch({ kind: 'batch-tick' });
|
|
353
|
+
}, effect.delay);
|
|
354
|
+
break;
|
|
355
|
+
}
|
|
356
|
+
case 'fire-viewable': {
|
|
357
|
+
const pairs = inputs.viewabilityPairs;
|
|
358
|
+
const info = effect.info;
|
|
359
|
+
const map = effect.map;
|
|
360
|
+
const fire = () => {
|
|
361
|
+
for (const pair of pairs)
|
|
362
|
+
pair.onViewableItemsChanged(info);
|
|
363
|
+
this.dispatch({ kind: 'viewable-fired', map });
|
|
364
|
+
};
|
|
365
|
+
if (this.viewableTimer !== null) {
|
|
366
|
+
clearTimeout(this.viewableTimer);
|
|
367
|
+
this.viewableTimer = null;
|
|
368
|
+
}
|
|
369
|
+
if (effect.delay > EMPTY_OFFSET) {
|
|
370
|
+
this.viewableTimer = setTimeout(() => {
|
|
371
|
+
this.viewableTimer = null;
|
|
372
|
+
fire();
|
|
373
|
+
}, effect.delay);
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
fire();
|
|
377
|
+
}
|
|
378
|
+
break;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
// Once-per-CD recompute, BEFORE the template bindings are read (so the freshly computed
|
|
384
|
+
// template-bound fields render this pass — computing them in ngAfterContentChecked instead would
|
|
385
|
+
// trip ExpressionChangedAfterItHasBeenChecked). The dedup guard runs refresh-metrics (which owns
|
|
386
|
+
// the controlled committedWindow throttle) only when something relevant changed, so the window
|
|
387
|
+
// grows exactly one step per meaningful CD. The projected templates (ContentChild) are resolved
|
|
388
|
+
// from the second CD on; the first paint (count/viewport still 0) corrects on the layout-driven CD.
|
|
389
|
+
ngDoCheck() {
|
|
390
|
+
const recomputeInputs = [
|
|
391
|
+
this.data,
|
|
392
|
+
this.extraData,
|
|
393
|
+
this.getItemLayout,
|
|
394
|
+
this.keyExtractor,
|
|
395
|
+
this.isHorizontal,
|
|
396
|
+
this.isInverted,
|
|
397
|
+
this.windowSizeValue,
|
|
398
|
+
this.initialNumToRenderValue,
|
|
399
|
+
this.maxToRenderPerBatchValue,
|
|
400
|
+
this.stickyHeaderIndices,
|
|
401
|
+
this.maintainVisibleContentPosition,
|
|
402
|
+
this.style,
|
|
403
|
+
this.contentContainerStyle,
|
|
404
|
+
// Folds scroll / layout / measure / batch-tick: dispatch bumps renderVersion on any change.
|
|
405
|
+
this.renderVersion,
|
|
406
|
+
this.headerDir !== undefined,
|
|
407
|
+
this.footerDir !== undefined,
|
|
408
|
+
this.emptyDir !== undefined,
|
|
409
|
+
this.separatorDir !== undefined,
|
|
410
|
+
];
|
|
411
|
+
const previous = this.lastRecompute;
|
|
412
|
+
this.lastRecompute = recomputeInputs;
|
|
413
|
+
if (previous !== undefined &&
|
|
414
|
+
previous.length === recomputeInputs.length &&
|
|
415
|
+
previous.every((value, index) => value === recomputeInputs[index])) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
// The single derive-per-CD: recompute the window off the current state before the view reads it.
|
|
419
|
+
reduceList(this.listState, { kind: 'refresh-metrics' }, this.buildInputs());
|
|
420
|
+
this.recomputeView();
|
|
421
|
+
}
|
|
422
|
+
ngAfterViewChecked() {
|
|
423
|
+
const signature = listEffectSignature(this.listState);
|
|
424
|
+
if (signature === this.lastEffectSignature)
|
|
425
|
+
return;
|
|
426
|
+
this.lastEffectSignature = signature;
|
|
427
|
+
const inputs = this.buildInputs();
|
|
428
|
+
const result = reduceList(this.listState, { kind: 'commit' }, inputs);
|
|
429
|
+
this.runEffects(result.effects, inputs);
|
|
430
|
+
}
|
|
431
|
+
ngOnDestroy() {
|
|
432
|
+
if (this.viewableTimer !== null)
|
|
433
|
+
clearTimeout(this.viewableTimer);
|
|
434
|
+
if (this.batchTimer !== null)
|
|
435
|
+
clearTimeout(this.batchTimer);
|
|
436
|
+
}
|
|
437
|
+
recomputeView() {
|
|
438
|
+
const m = this.listState.metrics;
|
|
439
|
+
this.itemCount = m.count;
|
|
440
|
+
const hasHeader = this.headerDir !== undefined;
|
|
441
|
+
const hasSeparators = this.separatorDir !== undefined;
|
|
442
|
+
const stickySet = this.stickyHeaderIndices !== undefined ? new Set(this.stickyHeaderIndices) : undefined;
|
|
443
|
+
this.resolvedContentContainerStyle = this.isHorizontal
|
|
444
|
+
? [this.contentContainerStyle, { width: m.total }]
|
|
445
|
+
: this.contentContainerStyle;
|
|
446
|
+
this.resolvedStyle = flattenStyle([
|
|
447
|
+
anchorHostStyle(this.elementRef),
|
|
448
|
+
this.isInverted
|
|
449
|
+
? [this.style, this.isHorizontal ? INVERTED_X_STYLE : INVERTED_Y_STYLE]
|
|
450
|
+
: this.style,
|
|
451
|
+
]);
|
|
452
|
+
this.cellStyle = this.isInverted
|
|
453
|
+
? this.isHorizontal
|
|
454
|
+
? INVERTED_X_STYLE
|
|
455
|
+
: INVERTED_Y_STYLE
|
|
456
|
+
: undefined;
|
|
457
|
+
this.resolvedMaintainVisibleContentPosition =
|
|
458
|
+
this.maintainVisibleContentPosition === undefined
|
|
459
|
+
? undefined
|
|
460
|
+
: {
|
|
461
|
+
...this.maintainVisibleContentPosition,
|
|
462
|
+
minIndexForVisible: this.maintainVisibleContentPosition.minIndexForVisible + (hasHeader ? 1 : 0),
|
|
463
|
+
};
|
|
464
|
+
if (m.count === FIRST_INDEX) {
|
|
465
|
+
this.windowCells = [];
|
|
466
|
+
this.leadingSpacerStyle = null;
|
|
467
|
+
this.trailingSpacerStyle = null;
|
|
468
|
+
this.renderedStickyIndices = undefined;
|
|
469
|
+
dlog(`Angular VirtualizedList empty (viewport=${this.listState.viewportLength})`);
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
const plan = buildListPlan({
|
|
473
|
+
count: m.count,
|
|
474
|
+
first: m.first,
|
|
475
|
+
last: m.last,
|
|
476
|
+
offsets: m.offsets,
|
|
477
|
+
lengths: m.lengths,
|
|
478
|
+
total: m.total,
|
|
479
|
+
keyFor: this.keyFor,
|
|
480
|
+
stickyIndices: stickySet,
|
|
481
|
+
hasHeader,
|
|
482
|
+
hasSeparators,
|
|
483
|
+
});
|
|
484
|
+
this.leadingSpacerStyle =
|
|
485
|
+
plan.leadingExtent > EMPTY_OFFSET ? this.spacerStyle(plan.leadingExtent) : null;
|
|
486
|
+
this.trailingSpacerStyle =
|
|
487
|
+
plan.trailingExtent > EMPTY_OFFSET ? this.spacerStyle(plan.trailingExtent) : null;
|
|
488
|
+
this.renderedStickyIndices =
|
|
489
|
+
stickySet !== undefined && plan.stickyChildPositions.length > 0
|
|
490
|
+
? plan.stickyChildPositions
|
|
491
|
+
: undefined;
|
|
492
|
+
const cells = [];
|
|
493
|
+
for (const planned of plan.cells) {
|
|
494
|
+
const item = this.getItem(this.data, planned.index);
|
|
495
|
+
const context = {
|
|
496
|
+
$implicit: item,
|
|
497
|
+
index: planned.index,
|
|
498
|
+
separators: this.makeSeparators(planned.index),
|
|
499
|
+
};
|
|
500
|
+
let separatorContext;
|
|
501
|
+
if (hasSeparators && planned.index < m.last) {
|
|
502
|
+
separatorContext = this.buildSeparatorContext(planned.index, item);
|
|
503
|
+
}
|
|
504
|
+
cells.push({
|
|
505
|
+
key: planned.key,
|
|
506
|
+
index: planned.index,
|
|
507
|
+
context,
|
|
508
|
+
measure: this.cellMeasure(planned.index),
|
|
509
|
+
separatorContext,
|
|
510
|
+
});
|
|
511
|
+
}
|
|
512
|
+
this.windowCells = cells;
|
|
513
|
+
dlog(`Angular VirtualizedList window [${m.first}, ${m.last}] of ${m.count} ` +
|
|
514
|
+
`(offset=${this.listState.scrollOffset}, viewport=${this.listState.viewportLength}, rendered=${cells.length})`);
|
|
515
|
+
}
|
|
516
|
+
buildSeparatorContext(index, item) {
|
|
517
|
+
const overrides = this.separatorOverrides.get(index);
|
|
518
|
+
const highlighted = overrides?.highlighted ?? false;
|
|
519
|
+
const context = {
|
|
520
|
+
$implicit: highlighted,
|
|
521
|
+
highlighted,
|
|
522
|
+
leadingItem: item,
|
|
523
|
+
trailingItem: this.getItem(this.data, index + 1),
|
|
524
|
+
};
|
|
525
|
+
// Fold any custom updateProps keys through the context's index signature (RN lets a row drive
|
|
526
|
+
// arbitrary separator props); the typed fields above stay authoritative.
|
|
527
|
+
if (overrides !== undefined) {
|
|
528
|
+
for (const key of Object.keys(overrides)) {
|
|
529
|
+
if (key === 'highlighted' || key === 'leadingItem' || key === 'trailingItem')
|
|
530
|
+
continue;
|
|
531
|
+
context[key] = overrides[key];
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
return context;
|
|
535
|
+
}
|
|
536
|
+
spacerStyle(extent) {
|
|
537
|
+
return this.isHorizontal ? { width: extent } : { height: extent };
|
|
538
|
+
}
|
|
539
|
+
cellMeasure(index) {
|
|
540
|
+
const existing = this.cellMeasures.get(index);
|
|
541
|
+
if (existing !== undefined)
|
|
542
|
+
return existing;
|
|
543
|
+
const measure = (event) => {
|
|
544
|
+
const length = readLayoutLength(event, this.isHorizontal);
|
|
545
|
+
if (length === undefined)
|
|
546
|
+
return;
|
|
547
|
+
dlog(`Angular VirtualizedList cell ${index} measured length=${length}`);
|
|
548
|
+
// The reducer guards a fixed getItemLayout and a repeated length; a no-op leaves state and the
|
|
549
|
+
// view untouched (dispatch marks for check only when something changed).
|
|
550
|
+
this.dispatch({ kind: 'measure', index, length });
|
|
551
|
+
};
|
|
552
|
+
this.cellMeasures.set(index, measure);
|
|
553
|
+
return measure;
|
|
554
|
+
}
|
|
555
|
+
// Per-cell onLayout rides the engine's structural (layout) event channel — Angular forbids an
|
|
556
|
+
// [onLayout] property binding (NG8002). $event arrives untyped, narrowed before reaching measure.
|
|
557
|
+
handleCellLayout(measure, event) {
|
|
558
|
+
if (this.isSymbioteEvent(event))
|
|
559
|
+
measure(event);
|
|
560
|
+
}
|
|
561
|
+
isSymbioteEvent(value) {
|
|
562
|
+
return typeof value === 'object' && value !== null && 'nativeEvent' in value;
|
|
563
|
+
}
|
|
564
|
+
mergeSeparator(gapIndex, patch) {
|
|
565
|
+
const count = this.listState.metrics.count;
|
|
566
|
+
if (!isSeparatorGapInRange(gapIndex, count))
|
|
567
|
+
return;
|
|
568
|
+
this.separatorOverrides.set(gapIndex, { ...this.separatorOverrides.get(gapIndex), ...patch });
|
|
569
|
+
this.cdr.markForCheck();
|
|
570
|
+
}
|
|
571
|
+
makeSeparators(index) {
|
|
572
|
+
return {
|
|
573
|
+
highlight: () => {
|
|
574
|
+
dlog(`Angular VirtualizedList separator highlight cell=${index}`);
|
|
575
|
+
this.mergeSeparator(index - 1, { highlighted: true });
|
|
576
|
+
this.mergeSeparator(index, { highlighted: true });
|
|
577
|
+
},
|
|
578
|
+
unhighlight: () => {
|
|
579
|
+
dlog(`Angular VirtualizedList separator unhighlight cell=${index}`);
|
|
580
|
+
this.mergeSeparator(index - 1, { highlighted: false });
|
|
581
|
+
this.mergeSeparator(index, { highlighted: false });
|
|
582
|
+
},
|
|
583
|
+
updateProps: (select, newProps) => {
|
|
584
|
+
this.mergeSeparator(select === 'leading' ? index - 1 : index, newProps);
|
|
585
|
+
},
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
// ---- imperative handle (the shared IVirtualizedListHandle surface) ----
|
|
589
|
+
// Each scroll resolves to an offset (or a scroll-to-index failure) inside the reducer, then rides
|
|
590
|
+
// the scroll-to effect through scrollToPixel.
|
|
591
|
+
scrollToOffset(params) {
|
|
592
|
+
this.dispatch({
|
|
593
|
+
kind: 'scroll-to-offset',
|
|
594
|
+
offset: params.offset,
|
|
595
|
+
animated: params.animated ?? true,
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
scrollToIndex(params) {
|
|
599
|
+
this.dispatch({
|
|
600
|
+
kind: 'scroll-to-index',
|
|
601
|
+
index: params.index,
|
|
602
|
+
animated: params.animated ?? true,
|
|
603
|
+
viewPosition: params.viewPosition ?? FIRST_INDEX,
|
|
604
|
+
viewOffset: params.viewOffset ?? EMPTY_OFFSET,
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
scrollToItem(params) {
|
|
608
|
+
this.dispatch({
|
|
609
|
+
kind: 'scroll-to-item',
|
|
610
|
+
item: params.item,
|
|
611
|
+
animated: params.animated ?? true,
|
|
612
|
+
viewPosition: params.viewPosition ?? FIRST_INDEX,
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
scrollToEnd(params) {
|
|
616
|
+
this.dispatch({ kind: 'scroll-to-end', animated: params?.animated ?? true });
|
|
617
|
+
}
|
|
618
|
+
flashScrollIndicators() {
|
|
619
|
+
this.scrollView?.flashScrollIndicators();
|
|
620
|
+
}
|
|
621
|
+
getNativeScrollRef() {
|
|
622
|
+
return this.scrollView ?? null;
|
|
623
|
+
}
|
|
624
|
+
getScrollableNode() {
|
|
625
|
+
return this.scrollView ?? null;
|
|
626
|
+
}
|
|
627
|
+
getScrollResponder() {
|
|
628
|
+
return this.scrollView ?? null;
|
|
629
|
+
}
|
|
630
|
+
getScrollNode() {
|
|
631
|
+
return this.scrollView?.getScrollNode() ?? null;
|
|
632
|
+
}
|
|
633
|
+
recordInteraction() {
|
|
634
|
+
this.dispatch({ kind: 'record-interaction' });
|
|
635
|
+
}
|
|
636
|
+
scrollToPixel(offset, animated) {
|
|
637
|
+
const clamped = Math.max(EMPTY_OFFSET, offset);
|
|
638
|
+
const target = this.isHorizontal
|
|
639
|
+
? { x: clamped, y: EMPTY_OFFSET }
|
|
640
|
+
: { x: EMPTY_OFFSET, y: clamped };
|
|
641
|
+
if (this.scrollView !== undefined) {
|
|
642
|
+
dlog(`Angular VirtualizedList scrollTo offset=${clamped} animated=${animated} (horizontal=${this.isHorizontal})`);
|
|
643
|
+
this.scrollView.scrollTo({ x: target.x, y: target.y, animated });
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
dlog(`Angular VirtualizedList scrollTo offset=${clamped} pending-ref`);
|
|
647
|
+
this.commandedOffset = target;
|
|
648
|
+
this.cdr.markForCheck();
|
|
649
|
+
}
|
|
650
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VirtualizedList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
651
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", type: VirtualizedList, isStandalone: true, selector: "VirtualizedList", inputs: { data: "data", getItem: "getItem", getItemCount: "getItemCount", keyExtractor: "keyExtractor", getItemLayout: "getItemLayout", horizontal: "horizontal", inverted: "inverted", extraData: "extraData", onEndReachedThreshold: "onEndReachedThreshold", onStartReachedThreshold: "onStartReachedThreshold", refreshing: "refreshing", progressViewOffset: "progressViewOffset", refreshRequested: "refreshRequested", viewabilityConfig: "viewabilityConfig", viewabilityConfigCallbackPairs: "viewabilityConfigCallbackPairs", initialNumToRender: "initialNumToRender", initialScrollIndex: "initialScrollIndex", maxToRenderPerBatch: "maxToRenderPerBatch", updateCellsBatchingPeriod: "updateCellsBatchingPeriod", windowSize: "windowSize", stickyHeaderIndices: "stickyHeaderIndices", maintainVisibleContentPosition: "maintainVisibleContentPosition", onScroll: "onScroll", onScrollBeginDrag: "onScrollBeginDrag", onScrollEndDrag: "onScrollEndDrag", onMomentumScrollBegin: "onMomentumScrollBegin", onMomentumScrollEnd: "onMomentumScrollEnd", scrollEventThrottle: "scrollEventThrottle", keyboardShouldPersistTaps: "keyboardShouldPersistTaps", keyboardDismissMode: "keyboardDismissMode", style: "style", contentContainerStyle: "contentContainerStyle", testID: "testID", nativeID: "nativeID", accessible: "accessible", accessibilityLabel: "accessibilityLabel", accessibilityHint: "accessibilityHint", accessibilityRole: "accessibilityRole", accessibilityState: "accessibilityState", accessibilityValue: "accessibilityValue", accessibilityActions: "accessibilityActions", accessibilityLabelledBy: "accessibilityLabelledBy", importantForAccessibility: "importantForAccessibility", accessibilityLiveRegion: "accessibilityLiveRegion", screenReaderFocusable: "screenReaderFocusable", accessibilityViewIsModal: "accessibilityViewIsModal", accessibilityElementsHidden: "accessibilityElementsHidden", accessibilityIgnoresInvertColors: "accessibilityIgnoresInvertColors", accessibilityLanguage: "accessibilityLanguage", accessibilityRespondsToUserInteraction: "accessibilityRespondsToUserInteraction", accessibilityShowsLargeContentViewer: "accessibilityShowsLargeContentViewer", accessibilityLargeContentTitle: "accessibilityLargeContentTitle", role: "role", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", ariaLive: "ariaLive", ariaHidden: "ariaHidden", ariaBusy: "ariaBusy", ariaChecked: "ariaChecked", ariaDisabled: "ariaDisabled", ariaExpanded: "ariaExpanded", ariaSelected: "ariaSelected", ariaModal: "ariaModal", ariaValueMax: "ariaValueMax", ariaValueMin: "ariaValueMin", ariaValueNow: "ariaValueNow", ariaValueText: "ariaValueText" }, outputs: { endReached: "endReached", startReached: "startReached", refresh: "refresh", viewableItemsChanged: "viewableItemsChanged", scrollToIndexFailed: "scrollToIndexFailed", accessibilityAction: "accessibilityAction", accessibilityTap: "accessibilityTap", magicTap: "magicTap", accessibilityEscape: "accessibilityEscape" }, queries: [{ propertyName: "itemDir", first: true, predicate: VListItemDirective, descendants: true }, { propertyName: "headerDir", first: true, predicate: VListHeaderDirective, descendants: true }, { propertyName: "footerDir", first: true, predicate: VListFooterDirective, descendants: true }, { propertyName: "emptyDir", first: true, predicate: VListEmptyDirective, descendants: true }, { propertyName: "separatorDir", first: true, predicate: VListSeparatorDirective, descendants: true }], viewQueries: [{ propertyName: "scrollView", first: true, predicate: ScrollView, descendants: true }], ngImport: i0, template: `
|
|
652
|
+
<ScrollView
|
|
653
|
+
[horizontal]="isHorizontal"
|
|
654
|
+
[style]="resolvedStyle"
|
|
655
|
+
[contentContainerStyle]="resolvedContentContainerStyle"
|
|
656
|
+
[testID]="foldedAccessibility.testID"
|
|
657
|
+
[nativeID]="foldedAccessibility.nativeID"
|
|
658
|
+
[accessible]="foldedAccessibility.accessible"
|
|
659
|
+
[accessibilityLabel]="foldedAccessibility.accessibilityLabel"
|
|
660
|
+
[accessibilityHint]="foldedAccessibility.accessibilityHint"
|
|
661
|
+
[accessibilityRole]="foldedAccessibility.accessibilityRole"
|
|
662
|
+
[accessibilityState]="foldedAccessibility.accessibilityState"
|
|
663
|
+
[accessibilityValue]="foldedAccessibility.accessibilityValue"
|
|
664
|
+
[accessibilityActions]="foldedAccessibility.accessibilityActions"
|
|
665
|
+
[accessibilityLabelledBy]="foldedAccessibility.accessibilityLabelledBy"
|
|
666
|
+
[importantForAccessibility]="foldedAccessibility.importantForAccessibility"
|
|
667
|
+
[accessibilityLiveRegion]="foldedAccessibility.accessibilityLiveRegion"
|
|
668
|
+
[screenReaderFocusable]="foldedAccessibility.screenReaderFocusable"
|
|
669
|
+
[accessibilityViewIsModal]="foldedAccessibility.accessibilityViewIsModal"
|
|
670
|
+
[accessibilityElementsHidden]="foldedAccessibility.accessibilityElementsHidden"
|
|
671
|
+
[accessibilityIgnoresInvertColors]="foldedAccessibility.accessibilityIgnoresInvertColors"
|
|
672
|
+
[accessibilityLanguage]="foldedAccessibility.accessibilityLanguage"
|
|
673
|
+
[accessibilityRespondsToUserInteraction]="
|
|
674
|
+
foldedAccessibility.accessibilityRespondsToUserInteraction
|
|
675
|
+
"
|
|
676
|
+
[accessibilityShowsLargeContentViewer]="
|
|
677
|
+
foldedAccessibility.accessibilityShowsLargeContentViewer
|
|
678
|
+
"
|
|
679
|
+
[accessibilityLargeContentTitle]="foldedAccessibility.accessibilityLargeContentTitle"
|
|
680
|
+
(accessibilityAction)="accessibilityActionTick($event)"
|
|
681
|
+
(accessibilityTap)="accessibilityTapTick($event)"
|
|
682
|
+
(magicTap)="magicTapTick($event)"
|
|
683
|
+
(accessibilityEscape)="accessibilityEscapeTick($event)"
|
|
684
|
+
[onScroll]="onScrollTick"
|
|
685
|
+
(layout)="onLayoutTick($event)"
|
|
686
|
+
[onScrollBeginDrag]="onScrollBeginDrag"
|
|
687
|
+
[onScrollEndDrag]="onScrollEndDrag"
|
|
688
|
+
[onMomentumScrollBegin]="onMomentumScrollBegin"
|
|
689
|
+
[onMomentumScrollEnd]="onMomentumScrollEnd"
|
|
690
|
+
[scrollEventThrottle]="scrollEventThrottle"
|
|
691
|
+
[keyboardShouldPersistTaps]="keyboardShouldPersistTaps"
|
|
692
|
+
[keyboardDismissMode]="keyboardDismissMode"
|
|
693
|
+
[contentOffset]="commandedOffset"
|
|
694
|
+
[stickyHeaderIndices]="renderedStickyIndices"
|
|
695
|
+
[maintainVisibleContentPosition]="resolvedMaintainVisibleContentPosition"
|
|
696
|
+
>
|
|
697
|
+
@if (shouldRenderRefreshControl) {
|
|
698
|
+
<RefreshControl
|
|
699
|
+
[refreshing]="refreshing ?? false"
|
|
700
|
+
(refresh)="handleRefresh()"
|
|
701
|
+
[progressViewOffset]="progressViewOffset"
|
|
702
|
+
/>
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
@if (headerDir !== undefined) {
|
|
706
|
+
<symbiote-view>
|
|
707
|
+
<ng-container [vListOutlet]="headerDir.templateRef"></ng-container>
|
|
708
|
+
</symbiote-view>
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
@if (itemCount === 0) {
|
|
712
|
+
@if (emptyDir !== undefined) {
|
|
713
|
+
<symbiote-view>
|
|
714
|
+
<ng-container [vListOutlet]="emptyDir.templateRef"></ng-container>
|
|
715
|
+
</symbiote-view>
|
|
716
|
+
}
|
|
717
|
+
} @else {
|
|
718
|
+
@if (leadingSpacerStyle !== null) {
|
|
719
|
+
<symbiote-view [style]="leadingSpacerStyle"></symbiote-view>
|
|
720
|
+
}
|
|
721
|
+
@for (cell of windowCells; track cell.key) {
|
|
722
|
+
<symbiote-view (layout)="handleCellLayout(cell.measure, $event)" [style]="cellStyle">
|
|
723
|
+
<ng-container
|
|
724
|
+
[vListOutlet]="itemDir?.templateRef"
|
|
725
|
+
[vListOutletContext]="cell.context"
|
|
726
|
+
></ng-container>
|
|
727
|
+
</symbiote-view>
|
|
728
|
+
@if (cell.separatorContext !== undefined) {
|
|
729
|
+
<symbiote-view>
|
|
730
|
+
<ng-container
|
|
731
|
+
[vListOutlet]="separatorDir?.templateRef"
|
|
732
|
+
[vListOutletContext]="cell.separatorContext"
|
|
733
|
+
></ng-container>
|
|
734
|
+
</symbiote-view>
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
@if (trailingSpacerStyle !== null) {
|
|
738
|
+
<symbiote-view [style]="trailingSpacerStyle"></symbiote-view>
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
|
|
742
|
+
@if (footerDir !== undefined) {
|
|
743
|
+
<symbiote-view>
|
|
744
|
+
<ng-container [vListOutlet]="footerDir.templateRef"></ng-container>
|
|
745
|
+
</symbiote-view>
|
|
746
|
+
}
|
|
747
|
+
</ScrollView>
|
|
748
|
+
`, isInline: true, dependencies: [{ kind: "component", type: ScrollView, selector: "ScrollView", inputs: ["style", "contentContainerStyle", "horizontal", "scrollEnabled", "showsVerticalScrollIndicator", "showsHorizontalScrollIndicator", "pagingEnabled", "bounces", "decelerationRate", "scrollEventThrottle", "contentInset", "contentOffset", "removeClippedSubviews", "snapToInterval", "snapToOffsets", "snapToAlignment", "snapToStart", "snapToEnd", "disableIntervalMomentum", "stickyHeaderIndices", "invertStickyHeaders", "StickyHeaderComponent", "keyboardDismissMode", "keyboardShouldPersistTaps", "maintainVisibleContentPosition", "alwaysBounceHorizontal", "alwaysBounceVertical", "centerContent", "scrollIndicatorInsets", "indicatorStyle", "directionalLockEnabled", "automaticallyAdjustKeyboardInsets", "contentInsetAdjustmentBehavior", "minimumZoomScale", "maximumZoomScale", "zoomScale", "bouncesZoom", "pinchGestureEnabled", "nestedScrollEnabled", "overScrollMode", "fadingEdgeLength", "persistentScrollbar", "endFillColor", "onScroll", "onScrollBeginDrag", "onScrollEndDrag", "onMomentumScrollBegin", "onMomentumScrollEnd", "testID", "nativeID", "accessible", "accessibilityLabel", "accessibilityHint", "accessibilityRole", "accessibilityState", "accessibilityValue", "accessibilityActions", "accessibilityLabelledBy", "importantForAccessibility", "accessibilityLiveRegion", "screenReaderFocusable", "accessibilityViewIsModal", "accessibilityElementsHidden", "accessibilityIgnoresInvertColors", "accessibilityLanguage", "accessibilityRespondsToUserInteraction", "accessibilityShowsLargeContentViewer", "accessibilityLargeContentTitle", "role", "aria-label", "aria-labelledby", "aria-live", "aria-hidden", "aria-busy", "aria-checked", "aria-disabled", "aria-expanded", "aria-selected", "aria-modal", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"] }, { kind: "component", type: RefreshControl, selector: "RefreshControl", inputs: ["refreshing", "tintColor", "title", "titleColor", "progressViewOffset", "colors", "progressBackgroundColor", "size", "enabled", "style", "testID", "nativeID", "accessible", "accessibilityLabel", "accessibilityHint", "accessibilityRole", "accessibilityState", "accessibilityValue", "accessibilityActions", "accessibilityLabelledBy", "importantForAccessibility", "accessibilityLiveRegion", "screenReaderFocusable", "accessibilityViewIsModal", "accessibilityElementsHidden", "accessibilityIgnoresInvertColors", "accessibilityLanguage", "accessibilityRespondsToUserInteraction", "accessibilityShowsLargeContentViewer", "accessibilityLargeContentTitle", "role", "aria-label", "aria-labelledby", "aria-live", "aria-hidden", "aria-busy", "aria-checked", "aria-disabled", "aria-expanded", "aria-selected", "aria-modal", "aria-valuemax", "aria-valuemin", "aria-valuenow", "aria-valuetext"], outputs: ["refresh", "accessibilityAction", "accessibilityTap", "magicTap", "accessibilityEscape"] }, { kind: "directive", type: VListOutletDirective, selector: "[vListOutlet]", inputs: ["vListOutlet", "vListOutletContext"] }, { kind: "component", type: ViewHost, selector: "symbiote-view, View" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
749
|
+
}
|
|
750
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VirtualizedList, decorators: [{
|
|
751
|
+
type: Component,
|
|
752
|
+
args: [{
|
|
753
|
+
selector: 'VirtualizedList',
|
|
754
|
+
standalone: true,
|
|
755
|
+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
756
|
+
imports: [ScrollView, RefreshControl, VListOutletDirective, ViewHost],
|
|
757
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
758
|
+
template: `
|
|
759
|
+
<ScrollView
|
|
760
|
+
[horizontal]="isHorizontal"
|
|
761
|
+
[style]="resolvedStyle"
|
|
762
|
+
[contentContainerStyle]="resolvedContentContainerStyle"
|
|
763
|
+
[testID]="foldedAccessibility.testID"
|
|
764
|
+
[nativeID]="foldedAccessibility.nativeID"
|
|
765
|
+
[accessible]="foldedAccessibility.accessible"
|
|
766
|
+
[accessibilityLabel]="foldedAccessibility.accessibilityLabel"
|
|
767
|
+
[accessibilityHint]="foldedAccessibility.accessibilityHint"
|
|
768
|
+
[accessibilityRole]="foldedAccessibility.accessibilityRole"
|
|
769
|
+
[accessibilityState]="foldedAccessibility.accessibilityState"
|
|
770
|
+
[accessibilityValue]="foldedAccessibility.accessibilityValue"
|
|
771
|
+
[accessibilityActions]="foldedAccessibility.accessibilityActions"
|
|
772
|
+
[accessibilityLabelledBy]="foldedAccessibility.accessibilityLabelledBy"
|
|
773
|
+
[importantForAccessibility]="foldedAccessibility.importantForAccessibility"
|
|
774
|
+
[accessibilityLiveRegion]="foldedAccessibility.accessibilityLiveRegion"
|
|
775
|
+
[screenReaderFocusable]="foldedAccessibility.screenReaderFocusable"
|
|
776
|
+
[accessibilityViewIsModal]="foldedAccessibility.accessibilityViewIsModal"
|
|
777
|
+
[accessibilityElementsHidden]="foldedAccessibility.accessibilityElementsHidden"
|
|
778
|
+
[accessibilityIgnoresInvertColors]="foldedAccessibility.accessibilityIgnoresInvertColors"
|
|
779
|
+
[accessibilityLanguage]="foldedAccessibility.accessibilityLanguage"
|
|
780
|
+
[accessibilityRespondsToUserInteraction]="
|
|
781
|
+
foldedAccessibility.accessibilityRespondsToUserInteraction
|
|
782
|
+
"
|
|
783
|
+
[accessibilityShowsLargeContentViewer]="
|
|
784
|
+
foldedAccessibility.accessibilityShowsLargeContentViewer
|
|
785
|
+
"
|
|
786
|
+
[accessibilityLargeContentTitle]="foldedAccessibility.accessibilityLargeContentTitle"
|
|
787
|
+
(accessibilityAction)="accessibilityActionTick($event)"
|
|
788
|
+
(accessibilityTap)="accessibilityTapTick($event)"
|
|
789
|
+
(magicTap)="magicTapTick($event)"
|
|
790
|
+
(accessibilityEscape)="accessibilityEscapeTick($event)"
|
|
791
|
+
[onScroll]="onScrollTick"
|
|
792
|
+
(layout)="onLayoutTick($event)"
|
|
793
|
+
[onScrollBeginDrag]="onScrollBeginDrag"
|
|
794
|
+
[onScrollEndDrag]="onScrollEndDrag"
|
|
795
|
+
[onMomentumScrollBegin]="onMomentumScrollBegin"
|
|
796
|
+
[onMomentumScrollEnd]="onMomentumScrollEnd"
|
|
797
|
+
[scrollEventThrottle]="scrollEventThrottle"
|
|
798
|
+
[keyboardShouldPersistTaps]="keyboardShouldPersistTaps"
|
|
799
|
+
[keyboardDismissMode]="keyboardDismissMode"
|
|
800
|
+
[contentOffset]="commandedOffset"
|
|
801
|
+
[stickyHeaderIndices]="renderedStickyIndices"
|
|
802
|
+
[maintainVisibleContentPosition]="resolvedMaintainVisibleContentPosition"
|
|
803
|
+
>
|
|
804
|
+
@if (shouldRenderRefreshControl) {
|
|
805
|
+
<RefreshControl
|
|
806
|
+
[refreshing]="refreshing ?? false"
|
|
807
|
+
(refresh)="handleRefresh()"
|
|
808
|
+
[progressViewOffset]="progressViewOffset"
|
|
809
|
+
/>
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
@if (headerDir !== undefined) {
|
|
813
|
+
<symbiote-view>
|
|
814
|
+
<ng-container [vListOutlet]="headerDir.templateRef"></ng-container>
|
|
815
|
+
</symbiote-view>
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
@if (itemCount === 0) {
|
|
819
|
+
@if (emptyDir !== undefined) {
|
|
820
|
+
<symbiote-view>
|
|
821
|
+
<ng-container [vListOutlet]="emptyDir.templateRef"></ng-container>
|
|
822
|
+
</symbiote-view>
|
|
823
|
+
}
|
|
824
|
+
} @else {
|
|
825
|
+
@if (leadingSpacerStyle !== null) {
|
|
826
|
+
<symbiote-view [style]="leadingSpacerStyle"></symbiote-view>
|
|
827
|
+
}
|
|
828
|
+
@for (cell of windowCells; track cell.key) {
|
|
829
|
+
<symbiote-view (layout)="handleCellLayout(cell.measure, $event)" [style]="cellStyle">
|
|
830
|
+
<ng-container
|
|
831
|
+
[vListOutlet]="itemDir?.templateRef"
|
|
832
|
+
[vListOutletContext]="cell.context"
|
|
833
|
+
></ng-container>
|
|
834
|
+
</symbiote-view>
|
|
835
|
+
@if (cell.separatorContext !== undefined) {
|
|
836
|
+
<symbiote-view>
|
|
837
|
+
<ng-container
|
|
838
|
+
[vListOutlet]="separatorDir?.templateRef"
|
|
839
|
+
[vListOutletContext]="cell.separatorContext"
|
|
840
|
+
></ng-container>
|
|
841
|
+
</symbiote-view>
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
@if (trailingSpacerStyle !== null) {
|
|
845
|
+
<symbiote-view [style]="trailingSpacerStyle"></symbiote-view>
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
@if (footerDir !== undefined) {
|
|
850
|
+
<symbiote-view>
|
|
851
|
+
<ng-container [vListOutlet]="footerDir.templateRef"></ng-container>
|
|
852
|
+
</symbiote-view>
|
|
853
|
+
}
|
|
854
|
+
</ScrollView>
|
|
855
|
+
`,
|
|
856
|
+
}]
|
|
857
|
+
}], propDecorators: { endReached: [{
|
|
858
|
+
type: Output
|
|
859
|
+
}], startReached: [{
|
|
860
|
+
type: Output
|
|
861
|
+
}], refresh: [{
|
|
862
|
+
type: Output
|
|
863
|
+
}], viewableItemsChanged: [{
|
|
864
|
+
type: Output
|
|
865
|
+
}], scrollToIndexFailed: [{
|
|
866
|
+
type: Output
|
|
867
|
+
}], accessibilityAction: [{
|
|
868
|
+
type: Output
|
|
869
|
+
}], accessibilityTap: [{
|
|
870
|
+
type: Output
|
|
871
|
+
}], magicTap: [{
|
|
872
|
+
type: Output
|
|
873
|
+
}], accessibilityEscape: [{
|
|
874
|
+
type: Output
|
|
875
|
+
}], data: [{
|
|
876
|
+
type: Input,
|
|
877
|
+
args: [{ required: true }]
|
|
878
|
+
}], getItem: [{
|
|
879
|
+
type: Input,
|
|
880
|
+
args: [{ required: true }]
|
|
881
|
+
}], getItemCount: [{
|
|
882
|
+
type: Input,
|
|
883
|
+
args: [{ required: true }]
|
|
884
|
+
}], keyExtractor: [{
|
|
885
|
+
type: Input
|
|
886
|
+
}], getItemLayout: [{
|
|
887
|
+
type: Input
|
|
888
|
+
}], horizontal: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}], inverted: [{
|
|
891
|
+
type: Input
|
|
892
|
+
}], extraData: [{
|
|
893
|
+
type: Input
|
|
894
|
+
}], onEndReachedThreshold: [{
|
|
895
|
+
type: Input
|
|
896
|
+
}], onStartReachedThreshold: [{
|
|
897
|
+
type: Input
|
|
898
|
+
}], refreshing: [{
|
|
899
|
+
type: Input
|
|
900
|
+
}], progressViewOffset: [{
|
|
901
|
+
type: Input
|
|
902
|
+
}], refreshRequested: [{
|
|
903
|
+
type: Input
|
|
904
|
+
}], viewabilityConfig: [{
|
|
905
|
+
type: Input
|
|
906
|
+
}], viewabilityConfigCallbackPairs: [{
|
|
907
|
+
type: Input
|
|
908
|
+
}], initialNumToRender: [{
|
|
909
|
+
type: Input
|
|
910
|
+
}], initialScrollIndex: [{
|
|
911
|
+
type: Input
|
|
912
|
+
}], maxToRenderPerBatch: [{
|
|
913
|
+
type: Input
|
|
914
|
+
}], updateCellsBatchingPeriod: [{
|
|
915
|
+
type: Input
|
|
916
|
+
}], windowSize: [{
|
|
917
|
+
type: Input
|
|
918
|
+
}], stickyHeaderIndices: [{
|
|
919
|
+
type: Input
|
|
920
|
+
}], maintainVisibleContentPosition: [{
|
|
921
|
+
type: Input
|
|
922
|
+
}], onScroll: [{
|
|
923
|
+
type: Input
|
|
924
|
+
}], onScrollBeginDrag: [{
|
|
925
|
+
type: Input
|
|
926
|
+
}], onScrollEndDrag: [{
|
|
927
|
+
type: Input
|
|
928
|
+
}], onMomentumScrollBegin: [{
|
|
929
|
+
type: Input
|
|
930
|
+
}], onMomentumScrollEnd: [{
|
|
931
|
+
type: Input
|
|
932
|
+
}], scrollEventThrottle: [{
|
|
933
|
+
type: Input
|
|
934
|
+
}], keyboardShouldPersistTaps: [{
|
|
935
|
+
type: Input
|
|
936
|
+
}], keyboardDismissMode: [{
|
|
937
|
+
type: Input
|
|
938
|
+
}], style: [{
|
|
939
|
+
type: Input
|
|
940
|
+
}], contentContainerStyle: [{
|
|
941
|
+
type: Input
|
|
942
|
+
}], testID: [{
|
|
943
|
+
type: Input
|
|
944
|
+
}], nativeID: [{
|
|
945
|
+
type: Input
|
|
946
|
+
}], accessible: [{
|
|
947
|
+
type: Input
|
|
948
|
+
}], accessibilityLabel: [{
|
|
949
|
+
type: Input
|
|
950
|
+
}], accessibilityHint: [{
|
|
951
|
+
type: Input
|
|
952
|
+
}], accessibilityRole: [{
|
|
953
|
+
type: Input
|
|
954
|
+
}], accessibilityState: [{
|
|
955
|
+
type: Input
|
|
956
|
+
}], accessibilityValue: [{
|
|
957
|
+
type: Input
|
|
958
|
+
}], accessibilityActions: [{
|
|
959
|
+
type: Input
|
|
960
|
+
}], accessibilityLabelledBy: [{
|
|
961
|
+
type: Input
|
|
962
|
+
}], importantForAccessibility: [{
|
|
963
|
+
type: Input
|
|
964
|
+
}], accessibilityLiveRegion: [{
|
|
965
|
+
type: Input
|
|
966
|
+
}], screenReaderFocusable: [{
|
|
967
|
+
type: Input
|
|
968
|
+
}], accessibilityViewIsModal: [{
|
|
969
|
+
type: Input
|
|
970
|
+
}], accessibilityElementsHidden: [{
|
|
971
|
+
type: Input
|
|
972
|
+
}], accessibilityIgnoresInvertColors: [{
|
|
973
|
+
type: Input
|
|
974
|
+
}], accessibilityLanguage: [{
|
|
975
|
+
type: Input
|
|
976
|
+
}], accessibilityRespondsToUserInteraction: [{
|
|
977
|
+
type: Input
|
|
978
|
+
}], accessibilityShowsLargeContentViewer: [{
|
|
979
|
+
type: Input
|
|
980
|
+
}], accessibilityLargeContentTitle: [{
|
|
981
|
+
type: Input
|
|
982
|
+
}], role: [{
|
|
983
|
+
type: Input
|
|
984
|
+
}], ariaLabel: [{
|
|
985
|
+
type: Input
|
|
986
|
+
}], ariaLabelledBy: [{
|
|
987
|
+
type: Input
|
|
988
|
+
}], ariaLive: [{
|
|
989
|
+
type: Input
|
|
990
|
+
}], ariaHidden: [{
|
|
991
|
+
type: Input
|
|
992
|
+
}], ariaBusy: [{
|
|
993
|
+
type: Input
|
|
994
|
+
}], ariaChecked: [{
|
|
995
|
+
type: Input
|
|
996
|
+
}], ariaDisabled: [{
|
|
997
|
+
type: Input
|
|
998
|
+
}], ariaExpanded: [{
|
|
999
|
+
type: Input
|
|
1000
|
+
}], ariaSelected: [{
|
|
1001
|
+
type: Input
|
|
1002
|
+
}], ariaModal: [{
|
|
1003
|
+
type: Input
|
|
1004
|
+
}], ariaValueMax: [{
|
|
1005
|
+
type: Input
|
|
1006
|
+
}], ariaValueMin: [{
|
|
1007
|
+
type: Input
|
|
1008
|
+
}], ariaValueNow: [{
|
|
1009
|
+
type: Input
|
|
1010
|
+
}], ariaValueText: [{
|
|
1011
|
+
type: Input
|
|
1012
|
+
}], itemDir: [{
|
|
1013
|
+
type: ContentChild,
|
|
1014
|
+
args: [VListItemDirective]
|
|
1015
|
+
}], headerDir: [{
|
|
1016
|
+
type: ContentChild,
|
|
1017
|
+
args: [VListHeaderDirective]
|
|
1018
|
+
}], footerDir: [{
|
|
1019
|
+
type: ContentChild,
|
|
1020
|
+
args: [VListFooterDirective]
|
|
1021
|
+
}], emptyDir: [{
|
|
1022
|
+
type: ContentChild,
|
|
1023
|
+
args: [VListEmptyDirective]
|
|
1024
|
+
}], separatorDir: [{
|
|
1025
|
+
type: ContentChild,
|
|
1026
|
+
args: [VListSeparatorDirective]
|
|
1027
|
+
}], scrollView: [{
|
|
1028
|
+
type: ViewChild,
|
|
1029
|
+
args: [ScrollView]
|
|
1030
|
+
}] } });
|
|
1031
|
+
//# sourceMappingURL=index.js.map
|