@symbiote-native/angular 3.1.3 → 3.2.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/build/angular/accessibility-events.d.ts +12 -0
- package/build/angular/accessibility-events.js +28 -0
- package/build/angular/accessibility-events.js.map +1 -0
- package/build/angular/accessibility-inputs.d.ts +40 -0
- package/build/angular/accessibility-inputs.js +130 -0
- package/build/angular/accessibility-inputs.js.map +1 -0
- package/build/angular/bootstrap.d.ts +3 -1
- package/build/angular/bootstrap.js +4 -1
- package/build/angular/bootstrap.js.map +1 -1
- package/build/angular/components/flat-list/flat-list-template.d.ts +1 -0
- package/build/angular/components/flat-list/flat-list-template.js +158 -0
- package/build/angular/components/flat-list/flat-list-template.js.map +1 -0
- package/build/angular/components/flat-list/index.d.ts +6 -61
- package/build/angular/components/flat-list/index.js +26 -463
- package/build/angular/components/flat-list/index.js.map +1 -1
- package/build/angular/components/keyboard-avoiding-view/index.d.ts +4 -40
- package/build/angular/components/keyboard-avoiding-view/index.js +7 -131
- package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
- package/build/angular/components/modal/index.d.ts +5 -41
- package/build/angular/components/modal/index.js +8 -133
- package/build/angular/components/modal/index.js.map +1 -1
- package/build/angular/components/section-list/index.d.ts +4 -51
- package/build/angular/components/section-list/index.js +18 -335
- package/build/angular/components/section-list/index.js.map +1 -1
- package/build/angular/components/virtualized-list/cell-registry.d.ts +35 -0
- package/build/angular/components/virtualized-list/cell-registry.js +133 -0
- package/build/angular/components/virtualized-list/cell-registry.js.map +1 -0
- package/build/angular/components/virtualized-list/index.d.ts +18 -253
- package/build/angular/components/virtualized-list/index.js +112 -1178
- package/build/angular/components/virtualized-list/index.js.map +1 -1
- package/build/angular/components/virtualized-list/list-a11y-forward.d.ts +1 -0
- package/build/angular/components/virtualized-list/list-a11y-forward.js +42 -0
- package/build/angular/components/virtualized-list/list-a11y-forward.js.map +1 -0
- package/build/angular/components/virtualized-list/list-bags.d.ts +32 -0
- package/build/angular/components/virtualized-list/list-bags.js +120 -0
- package/build/angular/components/virtualized-list/list-bags.js.map +1 -0
- package/build/angular/components/virtualized-list/list-effects.d.ts +31 -0
- package/build/angular/components/virtualized-list/list-effects.js +83 -0
- package/build/angular/components/virtualized-list/list-effects.js.map +1 -0
- package/build/angular/components/virtualized-list/list-events.d.ts +17 -0
- package/build/angular/components/virtualized-list/list-events.js +34 -0
- package/build/angular/components/virtualized-list/list-events.js.map +1 -0
- package/build/angular/components/virtualized-list/list-handle.d.ts +35 -0
- package/build/angular/components/virtualized-list/list-handle.js +61 -0
- package/build/angular/components/virtualized-list/list-handle.js.map +1 -0
- package/build/angular/components/virtualized-list/list-inputs.d.ts +78 -0
- package/build/angular/components/virtualized-list/list-inputs.js +150 -0
- package/build/angular/components/virtualized-list/list-inputs.js.map +1 -0
- package/build/angular/components/virtualized-list/list-props.d.ts +58 -0
- package/build/angular/components/virtualized-list/list-props.js +3 -0
- package/build/angular/components/virtualized-list/list-props.js.map +1 -0
- package/build/angular/components/virtualized-list/list-styles.d.ts +23 -0
- package/build/angular/components/virtualized-list/list-styles.js +26 -0
- package/build/angular/components/virtualized-list/list-styles.js.map +1 -0
- package/build/angular/components/virtualized-list/list-template.d.ts +1 -0
- package/build/angular/components/virtualized-list/list-template.js +176 -0
- package/build/angular/components/virtualized-list/list-template.js.map +1 -0
- package/build/angular/components/virtualized-section-list/index.d.ts +13 -70
- package/build/angular/components/virtualized-section-list/index.js +22 -455
- package/build/angular/components/virtualized-section-list/index.js.map +1 -1
- package/build/angular/components/virtualized-section-list/section-list-template.d.ts +1 -0
- package/build/angular/components/virtualized-section-list/section-list-template.js +107 -0
- package/build/angular/components/virtualized-section-list/section-list-template.js.map +1 -0
- package/build/angular/finalization-registry.d.ts +4 -0
- package/build/angular/finalization-registry.js +17 -0
- package/build/angular/finalization-registry.js.map +1 -0
- package/build/angular/index.d.ts +5 -1
- package/build/angular/index.js +5 -1
- package/build/angular/index.js.map +1 -1
- package/build/angular/native-view-base.d.ts +19 -0
- package/build/angular/native-view-base.js +48 -0
- package/build/angular/native-view-base.js.map +1 -0
- package/build/angular/render/index.d.ts +2 -1
- package/build/angular/render/index.js +46 -73
- package/build/angular/render/index.js.map +1 -1
- package/build/angular/services/connect-watched-signal.d.ts +2 -0
- package/build/angular/services/connect-watched-signal.js +9 -0
- package/build/angular/services/connect-watched-signal.js.map +1 -0
- package/build/angular/services/create-event-value-hook.d.ts +3 -0
- package/build/angular/services/create-event-value-hook.js +17 -0
- package/build/angular/services/create-event-value-hook.js.map +1 -0
- package/build/angular/services/create-resource-hook.d.ts +7 -0
- package/build/angular/services/create-resource-hook.js +20 -0
- package/build/angular/services/create-resource-hook.js.map +1 -0
- package/build/angular/services/index.d.ts +4 -0
- package/build/angular/services/index.js +4 -0
- package/build/angular/services/index.js.map +1 -1
- package/build/angular/services/permissions-service-base.d.ts +14 -0
- package/build/angular/services/permissions-service-base.js +38 -0
- package/build/angular/services/permissions-service-base.js.map +1 -0
- package/package.json +6 -6
- package/src/accessibility-events.ts +13 -0
- package/src/accessibility-inputs.ts +89 -0
- package/src/bootstrap.ts +6 -2
- package/src/components/flat-list/flat-list-template.ts +159 -0
- package/src/components/flat-list/index.ts +30 -307
- package/src/components/keyboard-avoiding-view/index.ts +4 -78
- package/src/components/modal/index.ts +7 -80
- package/src/components/section-list/index.ts +21 -172
- package/src/components/virtualized-list/cell-registry.ts +199 -0
- package/src/components/virtualized-list/index.ts +145 -1181
- package/src/components/virtualized-list/list-a11y-forward.ts +42 -0
- package/src/components/virtualized-list/list-bags.ts +142 -0
- package/src/components/virtualized-list/list-effects.ts +116 -0
- package/src/components/virtualized-list/list-events.ts +31 -0
- package/src/components/virtualized-list/list-handle.ts +92 -0
- package/src/components/virtualized-list/list-inputs.ts +149 -0
- package/src/components/virtualized-list/list-props.ts +81 -0
- package/src/components/virtualized-list/list-styles.ts +62 -0
- package/src/components/virtualized-list/list-template.ts +175 -0
- package/src/components/virtualized-section-list/index.ts +40 -351
- package/src/components/virtualized-section-list/section-list-template.ts +108 -0
- package/src/finalization-registry.ts +18 -0
- package/src/index.ts +12 -1
- package/src/native-view-base.ts +51 -0
- package/src/render/index.ts +76 -77
- package/src/services/connect-watched-signal.ts +15 -0
- package/src/services/create-event-value-hook.ts +24 -0
- package/src/services/create-resource-hook.ts +32 -0
- package/src/services/index.ts +4 -0
- package/src/services/permissions-service-base.ts +46 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Everything a windowed list keeps per cell between passes: the context objects (reused by
|
|
2
|
+
// identity), the measure closures, and the separator overrides a row drives through `separators`
|
|
3
|
+
import { isSeparatorGapInRange, readLayoutLength, readLayoutOffset, } from '@symbiote-native/components';
|
|
4
|
+
import { dlog } from '@symbiote-native/engine';
|
|
5
|
+
// The gap a cell's `updateProps` side addresses, relative to the cell's own index
|
|
6
|
+
const SEPARATOR_GAP_OFFSET = { leading: -1, trailing: 0 };
|
|
7
|
+
export class CellRegistry {
|
|
8
|
+
constructor(host) {
|
|
9
|
+
this.host = host;
|
|
10
|
+
// A cell's context is the only thing its stamped view reads, and the outlet refreshes that view
|
|
11
|
+
// whenever the object's identity changes. Handing back the same object for a cell whose item and
|
|
12
|
+
// index did not move keeps a window slide from refreshing every cell in it
|
|
13
|
+
this.contexts = new Map();
|
|
14
|
+
this.nextContexts = new Map();
|
|
15
|
+
// What a cell's content can depend on besides its own item: an `extraData` flip has to drop
|
|
16
|
+
// every reused context or nothing would repaint
|
|
17
|
+
this.epoch = undefined;
|
|
18
|
+
this.separatorOverrides = new Map();
|
|
19
|
+
this.measures = new Map();
|
|
20
|
+
}
|
|
21
|
+
beginPass(epoch) {
|
|
22
|
+
const previous = this.epoch;
|
|
23
|
+
this.epoch = epoch;
|
|
24
|
+
if (previous === undefined ||
|
|
25
|
+
previous.length !== epoch.length ||
|
|
26
|
+
!previous.every((value, index) => value === epoch[index])) {
|
|
27
|
+
this.contexts.clear();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
clear() {
|
|
31
|
+
this.contexts.clear();
|
|
32
|
+
this.nextContexts.clear();
|
|
33
|
+
}
|
|
34
|
+
// A cell that left the window is absent from the pass that just ran, so the old map is the
|
|
35
|
+
// garbage and the new one is exactly the live set
|
|
36
|
+
endPass() {
|
|
37
|
+
this.contexts = this.nextContexts;
|
|
38
|
+
this.nextContexts = new Map();
|
|
39
|
+
}
|
|
40
|
+
windowCell(index, key, includeSeparator, isSticky) {
|
|
41
|
+
const item = this.host.itemAt(index);
|
|
42
|
+
return {
|
|
43
|
+
key,
|
|
44
|
+
index,
|
|
45
|
+
context: this.contextFor(key, index, item),
|
|
46
|
+
measure: this.measureFor(index),
|
|
47
|
+
separatorContext: includeSeparator
|
|
48
|
+
? this.separatorContextFor(index, item)
|
|
49
|
+
: undefined,
|
|
50
|
+
isSticky,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
contextFor(key, index, item) {
|
|
54
|
+
const cached = this.contexts.get(key);
|
|
55
|
+
if (cached !== undefined &&
|
|
56
|
+
cached.$implicit === item &&
|
|
57
|
+
cached.index === index) {
|
|
58
|
+
this.nextContexts.set(key, cached);
|
|
59
|
+
return cached;
|
|
60
|
+
}
|
|
61
|
+
const context = {
|
|
62
|
+
$implicit: item,
|
|
63
|
+
index,
|
|
64
|
+
separators: this.makeSeparators(index),
|
|
65
|
+
};
|
|
66
|
+
this.nextContexts.set(key, context);
|
|
67
|
+
return context;
|
|
68
|
+
}
|
|
69
|
+
separatorContextFor(index, item) {
|
|
70
|
+
const overrides = this.separatorOverrides.get(index);
|
|
71
|
+
const highlighted = overrides?.highlighted ?? false;
|
|
72
|
+
const context = {
|
|
73
|
+
$implicit: highlighted,
|
|
74
|
+
highlighted,
|
|
75
|
+
leadingItem: item,
|
|
76
|
+
trailingItem: this.host.itemAt(index + 1),
|
|
77
|
+
};
|
|
78
|
+
// Custom `updateProps` keys ride the index signature, typed fields stay authoritative
|
|
79
|
+
if (overrides !== undefined) {
|
|
80
|
+
for (const key of Object.keys(overrides)) {
|
|
81
|
+
if (key === 'highlighted' ||
|
|
82
|
+
key === 'leadingItem' ||
|
|
83
|
+
key === 'trailingItem')
|
|
84
|
+
continue;
|
|
85
|
+
context[key] = overrides[key];
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return context;
|
|
89
|
+
}
|
|
90
|
+
measureFor(index) {
|
|
91
|
+
const existing = this.measures.get(index);
|
|
92
|
+
if (existing !== undefined)
|
|
93
|
+
return existing;
|
|
94
|
+
const measure = (event) => {
|
|
95
|
+
const horizontal = this.host.isHorizontal();
|
|
96
|
+
const length = readLayoutLength(event, horizontal);
|
|
97
|
+
if (length === undefined)
|
|
98
|
+
return;
|
|
99
|
+
const offset = readLayoutOffset(event, horizontal);
|
|
100
|
+
dlog(`Angular VirtualizedList cell ${index} measured length=${length} offset=${offset ?? 'none'}`);
|
|
101
|
+
this.host.measured(index, length, offset);
|
|
102
|
+
};
|
|
103
|
+
this.measures.set(index, measure);
|
|
104
|
+
return measure;
|
|
105
|
+
}
|
|
106
|
+
mergeSeparator(gapIndex, patch) {
|
|
107
|
+
if (!isSeparatorGapInRange(gapIndex, this.host.itemCount()))
|
|
108
|
+
return;
|
|
109
|
+
this.separatorOverrides.set(gapIndex, {
|
|
110
|
+
...this.separatorOverrides.get(gapIndex),
|
|
111
|
+
...patch,
|
|
112
|
+
});
|
|
113
|
+
this.host.markForCheck();
|
|
114
|
+
}
|
|
115
|
+
makeSeparators(index) {
|
|
116
|
+
return {
|
|
117
|
+
highlight: () => {
|
|
118
|
+
dlog(`Angular VirtualizedList separator highlight cell=${index}`);
|
|
119
|
+
this.mergeSeparator(index - 1, { highlighted: true });
|
|
120
|
+
this.mergeSeparator(index, { highlighted: true });
|
|
121
|
+
},
|
|
122
|
+
unhighlight: () => {
|
|
123
|
+
dlog(`Angular VirtualizedList separator unhighlight cell=${index}`);
|
|
124
|
+
this.mergeSeparator(index - 1, { highlighted: false });
|
|
125
|
+
this.mergeSeparator(index, { highlighted: false });
|
|
126
|
+
},
|
|
127
|
+
updateProps: (select, newProps) => {
|
|
128
|
+
this.mergeSeparator(index + SEPARATOR_GAP_OFFSET[select], newProps);
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=cell-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-registry.js","sourceRoot":"","sources":["../../../../src/components/virtualized-list/cell-registry.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,iGAAiG;AAEjG,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,GAGjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,IAAI,EAAuB,MAAM,yBAAyB,CAAC;AAuBpE,kFAAkF;AAClF,MAAM,oBAAoB,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAW,CAAC;AAEnE,MAAM,OAAO,YAAY;IAkBvB,YAA6B,IAAsB;QAAtB,SAAI,GAAJ,IAAI,CAAkB;QAjBnD,gGAAgG;QAChG,iGAAiG;QACjG,2EAA2E;QACnE,aAAQ,GAAG,IAAI,GAAG,EAAoC,CAAC;QACvD,iBAAY,GAAG,IAAI,GAAG,EAAoC,CAAC;QACnE,4FAA4F;QAC5F,gDAAgD;QACxC,UAAK,GAA0B,SAAS,CAAC;QAChC,uBAAkB,GAAG,IAAI,GAAG,EAG1C,CAAC;QACa,aAAQ,GAAG,IAAI,GAAG,EAGhC,CAAC;IAEkD,CAAC;IAEvD,SAAS,CAAC,KAAgB;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IACE,QAAQ,KAAK,SAAS;YACtB,QAAQ,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM;YAChC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,KAA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CAAC;gBACpE,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;gBACvD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC;YACrD,CAAC;YACD,WAAW,EAAE,CACX,MAAyC,EACzC,QAAiC,EAC3B,EAAE;gBACR,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,oBAAoB,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;YACtE,CAAC;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,191 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type
|
|
3
|
-
import { type
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { type AfterViewChecked, type DoCheck, type OnDestroy } from '@angular/core';
|
|
2
|
+
import { type IListAction, type IScrollViewHandle } from '@symbiote-native/components';
|
|
3
|
+
import { type ISymbioteEvent, type ISymbioteNode, type IViewStyle } from '@symbiote-native/engine';
|
|
4
|
+
import { type IWindowCell } from './cell-registry';
|
|
5
|
+
import { VirtualizedListBagsBase } from './list-bags';
|
|
6
|
+
import type { IVirtualizedListInputs } from './list-props';
|
|
6
7
|
import * as i0 from "@angular/core";
|
|
7
8
|
import * as i1 from "../../primitives/shared";
|
|
8
9
|
export type { ICellLayout, ISeparators, ISeparatorProps, IViewToken, IViewableItemsChangedInfo, IViewabilityConfig, IViewabilityConfigCallbackPair, IVirtualizedListHandle, } from '@symbiote-native/components';
|
|
9
10
|
export { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListItemDirective, VListSeparatorDirective, } from './directives';
|
|
10
11
|
export type { IVListItemContext, IVListSeparatorContext } from './directives';
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
getItem: (data: unknown, index: number) => ItemT;
|
|
14
|
-
getItemCount: (data: unknown) => number;
|
|
15
|
-
keyExtractor?: (item: ItemT, index: number) => string;
|
|
16
|
-
getItemLayout?: (data: unknown, index: number) => {
|
|
17
|
-
length: number;
|
|
18
|
-
offset: number;
|
|
19
|
-
index: number;
|
|
20
|
-
};
|
|
21
|
-
horizontal?: boolean;
|
|
22
|
-
inverted?: boolean;
|
|
23
|
-
extraData?: unknown;
|
|
24
|
-
onEndReached?: (info: {
|
|
25
|
-
distanceFromEnd: number;
|
|
26
|
-
}) => void;
|
|
27
|
-
onEndReachedThreshold?: number;
|
|
28
|
-
onStartReached?: (info: {
|
|
29
|
-
distanceFromStart: number;
|
|
30
|
-
}) => void;
|
|
31
|
-
onStartReachedThreshold?: number;
|
|
32
|
-
onRefresh?: () => void;
|
|
33
|
-
refreshing?: boolean | null;
|
|
34
|
-
progressViewOffset?: number;
|
|
35
|
-
onViewableItemsChanged?: (info: IViewableItemsChangedInfo<ItemT>) => void;
|
|
36
|
-
viewabilityConfig?: IViewabilityConfig;
|
|
37
|
-
viewabilityConfigCallbackPairs?: IViewabilityConfigCallbackPair<ItemT>[];
|
|
38
|
-
onScrollToIndexFailed?: (info: {
|
|
39
|
-
index: number;
|
|
40
|
-
highestMeasuredFrameIndex: number;
|
|
41
|
-
averageItemLength: number;
|
|
42
|
-
}) => void;
|
|
43
|
-
initialNumToRender?: number;
|
|
44
|
-
initialScrollIndex?: number;
|
|
45
|
-
maxToRenderPerBatch?: number;
|
|
46
|
-
updateCellsBatchingPeriod?: number;
|
|
47
|
-
windowSize?: number;
|
|
48
|
-
stickyHeaderIndices?: number[];
|
|
49
|
-
maintainVisibleContentPosition?: {
|
|
50
|
-
minIndexForVisible: number;
|
|
51
|
-
autoscrollToTopThreshold?: number;
|
|
52
|
-
};
|
|
53
|
-
onScroll?: (event: ISymbioteEvent) => void;
|
|
54
|
-
onScrollBeginDrag?: (event: ISymbioteEvent) => void;
|
|
55
|
-
onScrollEndDrag?: (event: ISymbioteEvent) => void;
|
|
56
|
-
onMomentumScrollBegin?: (event: ISymbioteEvent) => void;
|
|
57
|
-
onMomentumScrollEnd?: (event: ISymbioteEvent) => void;
|
|
58
|
-
scrollEventThrottle?: number;
|
|
59
|
-
keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
|
|
60
|
-
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
61
|
-
removeClippedSubviews?: boolean;
|
|
62
|
-
nestedScrollEnabled?: boolean;
|
|
63
|
-
style?: IStyleProp<IViewStyle>;
|
|
64
|
-
contentContainerStyle?: IStyleProp<IViewStyle>;
|
|
65
|
-
}
|
|
66
|
-
export type IVirtualizedListInputs<ItemT> = Omit<IVirtualizedListProps<ItemT>, 'onEndReached' | 'onStartReached' | 'onRefresh' | 'onViewableItemsChanged' | 'onScrollToIndexFailed' | 'onAccessibilityAction' | 'onAccessibilityTap' | 'onMagicTap' | 'onAccessibilityEscape'>;
|
|
67
|
-
interface IWindowCell<ItemT> {
|
|
68
|
-
key: string;
|
|
69
|
-
index: number;
|
|
70
|
-
context: IVListItemContext<ItemT>;
|
|
71
|
-
measure: (event: ISymbioteEvent) => void;
|
|
72
|
-
separatorContext?: IVListSeparatorContext<ItemT>;
|
|
73
|
-
/**
|
|
74
|
-
* Picks the cell's TAG in the template — `sticky-header` pins, `view` does not.
|
|
75
|
-
*
|
|
76
|
-
* It is stable per cell key (an index is a section header or it is not), so the `@if` never
|
|
77
|
-
* swaps an element type under a live cell and nothing remounts as the window slides.
|
|
78
|
-
*/
|
|
79
|
-
isSticky: boolean;
|
|
80
|
-
}
|
|
81
|
-
export declare class VirtualizedList<ItemT = unknown> implements IVirtualizedListInputs<ItemT>, IVirtualizedListHandle, DoCheck, AfterViewChecked, OnChanges, OnDestroy {
|
|
82
|
-
readonly endReached: EventEmitter<{
|
|
83
|
-
distanceFromEnd: number;
|
|
84
|
-
}>;
|
|
85
|
-
readonly startReached: EventEmitter<{
|
|
86
|
-
distanceFromStart: number;
|
|
87
|
-
}>;
|
|
88
|
-
readonly refresh: EventEmitter<void>;
|
|
89
|
-
readonly viewableItemsChanged: EventEmitter<IViewableItemsChangedInfo<ItemT>>;
|
|
90
|
-
readonly scrollToIndexFailed: EventEmitter<{
|
|
91
|
-
index: number;
|
|
92
|
-
highestMeasuredFrameIndex: number;
|
|
93
|
-
averageItemLength: number;
|
|
94
|
-
}>;
|
|
95
|
-
readonly accessibilityAction: EventEmitter<ISymbioteEvent>;
|
|
96
|
-
readonly accessibilityTap: EventEmitter<ISymbioteEvent>;
|
|
97
|
-
readonly magicTap: EventEmitter<ISymbioteEvent>;
|
|
98
|
-
readonly accessibilityEscape: EventEmitter<ISymbioteEvent>;
|
|
99
|
-
private readonly gateDemandAbove;
|
|
100
|
-
wantsGate(name: IGatedAccessibilityEvent): boolean;
|
|
101
|
-
data: unknown;
|
|
102
|
-
getItem: (data: unknown, index: number) => ItemT;
|
|
103
|
-
getItemCount: (data: unknown) => number;
|
|
104
|
-
keyExtractor?: (item: ItemT, index: number) => string;
|
|
105
|
-
getItemLayout?: (data: unknown, index: number) => {
|
|
106
|
-
length: number;
|
|
107
|
-
offset: number;
|
|
108
|
-
index: number;
|
|
109
|
-
};
|
|
110
|
-
horizontal?: boolean;
|
|
111
|
-
inverted?: boolean;
|
|
112
|
-
extraData?: unknown;
|
|
113
|
-
onEndReachedThreshold?: number;
|
|
114
|
-
onStartReachedThreshold?: number;
|
|
115
|
-
refreshing?: boolean | null;
|
|
116
|
-
progressViewOffset?: number;
|
|
117
|
-
refreshRequested?: boolean;
|
|
118
|
-
viewabilityConfig?: IViewabilityConfig;
|
|
119
|
-
viewabilityConfigCallbackPairs?: IViewabilityConfigCallbackPair<ItemT>[];
|
|
120
|
-
initialNumToRender?: number;
|
|
121
|
-
initialScrollIndex?: number;
|
|
122
|
-
maxToRenderPerBatch?: number;
|
|
123
|
-
updateCellsBatchingPeriod?: number;
|
|
124
|
-
windowSize?: number;
|
|
125
|
-
stickyHeaderIndices?: number[];
|
|
126
|
-
maintainVisibleContentPosition?: {
|
|
127
|
-
minIndexForVisible: number;
|
|
128
|
-
autoscrollToTopThreshold?: number;
|
|
129
|
-
};
|
|
130
|
-
onScroll?: (event: ISymbioteEvent) => void;
|
|
131
|
-
onScrollBeginDrag?: (event: ISymbioteEvent) => void;
|
|
132
|
-
onScrollEndDrag?: (event: ISymbioteEvent) => void;
|
|
133
|
-
onMomentumScrollBegin?: (event: ISymbioteEvent) => void;
|
|
134
|
-
onMomentumScrollEnd?: (event: ISymbioteEvent) => void;
|
|
135
|
-
scrollEventThrottle?: number;
|
|
136
|
-
keyboardShouldPersistTaps?: boolean | 'always' | 'never' | 'handled';
|
|
137
|
-
keyboardDismissMode?: 'none' | 'on-drag' | 'interactive';
|
|
138
|
-
removeClippedSubviews?: boolean;
|
|
139
|
-
nestedScrollEnabled?: boolean;
|
|
140
|
-
style?: IStyleProp<IViewStyle>;
|
|
141
|
-
contentContainerStyle?: IStyleProp<IViewStyle>;
|
|
142
|
-
testID?: string;
|
|
143
|
-
nativeID?: string;
|
|
144
|
-
accessible?: boolean;
|
|
145
|
-
accessibilityLabel?: string;
|
|
146
|
-
accessibilityHint?: string;
|
|
147
|
-
accessibilityRole?: IAccessibilityProps['accessibilityRole'];
|
|
148
|
-
accessibilityState?: IAccessibilityStateValue;
|
|
149
|
-
accessibilityValue?: IAccessibilityProps['accessibilityValue'];
|
|
150
|
-
accessibilityActions?: IAccessibilityProps['accessibilityActions'];
|
|
151
|
-
accessibilityLabelledBy?: string | string[];
|
|
152
|
-
importantForAccessibility?: IAccessibilityProps['importantForAccessibility'];
|
|
153
|
-
accessibilityLiveRegion?: IAccessibilityProps['accessibilityLiveRegion'];
|
|
154
|
-
screenReaderFocusable?: boolean;
|
|
155
|
-
accessibilityViewIsModal?: boolean;
|
|
156
|
-
accessibilityElementsHidden?: boolean;
|
|
157
|
-
accessibilityIgnoresInvertColors?: boolean;
|
|
158
|
-
accessibilityLanguage?: string;
|
|
159
|
-
accessibilityRespondsToUserInteraction?: boolean;
|
|
160
|
-
accessibilityShowsLargeContentViewer?: boolean;
|
|
161
|
-
accessibilityLargeContentTitle?: string;
|
|
162
|
-
role?: IAriaProps['role'];
|
|
163
|
-
ariaLabel?: string;
|
|
164
|
-
ariaLabelledBy?: string;
|
|
165
|
-
ariaLive?: IAriaProps['aria-live'];
|
|
166
|
-
ariaHidden?: boolean;
|
|
167
|
-
ariaBusy?: boolean;
|
|
168
|
-
ariaChecked?: boolean | 'mixed';
|
|
169
|
-
ariaDisabled?: boolean;
|
|
170
|
-
ariaExpanded?: boolean;
|
|
171
|
-
ariaSelected?: boolean;
|
|
172
|
-
ariaModal?: boolean;
|
|
173
|
-
ariaValueMax?: number;
|
|
174
|
-
ariaValueMin?: number;
|
|
175
|
-
ariaValueNow?: number;
|
|
176
|
-
ariaValueText?: string;
|
|
177
|
-
itemDir?: VListItemDirective<ItemT>;
|
|
178
|
-
headerDir?: VListHeaderDirective;
|
|
179
|
-
footerDir?: VListFooterDirective;
|
|
180
|
-
emptyDir?: VListEmptyDirective;
|
|
181
|
-
separatorDir?: VListSeparatorDirective<ItemT>;
|
|
182
|
-
itemTemplate?: TemplateRef<IVListItemContext<ItemT>>;
|
|
183
|
-
itemSeparatorTemplate?: TemplateRef<IVListSeparatorContext<ItemT>>;
|
|
184
|
-
get cellTemplate(): TemplateRef<IVListItemContext<ItemT>> | undefined;
|
|
185
|
-
get separatorTemplate(): TemplateRef<IVListSeparatorContext<ItemT>> | undefined;
|
|
12
|
+
export type { IVirtualizedListInputs, IVirtualizedListProps, } from './list-props';
|
|
13
|
+
export declare class VirtualizedList<ItemT = unknown> extends VirtualizedListBagsBase<ItemT> implements IVirtualizedListInputs<ItemT>, DoCheck, AfterViewChecked, OnDestroy {
|
|
186
14
|
private scrollHostRef?;
|
|
187
|
-
|
|
188
|
-
|
|
15
|
+
protected get scrollNode(): ISymbioteNode | null;
|
|
16
|
+
protected readonly scrollHandle: IScrollViewHandle;
|
|
189
17
|
itemCount: number;
|
|
190
18
|
windowCells: IWindowCell<ItemT>[];
|
|
191
19
|
forcedStickyCell: IWindowCell<ItemT> | null;
|
|
@@ -193,93 +21,30 @@ export declare class VirtualizedList<ItemT = unknown> implements IVirtualizedLis
|
|
|
193
21
|
gapSpacerStyle: IViewStyle | null;
|
|
194
22
|
trailingSpacerStyle: IViewStyle | null;
|
|
195
23
|
cellStyle: IViewStyle | undefined;
|
|
196
|
-
resolvedStyle: IViewStyle | undefined;
|
|
197
|
-
resolvedContentContainerStyle: IStyleProp<IViewStyle> | undefined;
|
|
198
|
-
resolvedMaintainVisibleContentPosition: {
|
|
199
|
-
minIndexForVisible: number;
|
|
200
|
-
autoscrollToTopThreshold?: number;
|
|
201
|
-
} | undefined;
|
|
202
|
-
commandedOffset: {
|
|
203
|
-
x: number;
|
|
204
|
-
y: number;
|
|
205
|
-
} | undefined;
|
|
206
24
|
private readonly listState;
|
|
207
25
|
private renderVersion;
|
|
208
|
-
private readonly
|
|
209
|
-
private
|
|
210
|
-
private nextCellContexts;
|
|
211
|
-
private cellContextEpoch;
|
|
212
|
-
private readonly separatorOverrides;
|
|
213
|
-
private viewableTimer;
|
|
214
|
-
private batchTimer;
|
|
26
|
+
private readonly cells;
|
|
27
|
+
private readonly effects;
|
|
215
28
|
private lastEffectSignature;
|
|
216
29
|
private lastRecompute;
|
|
217
30
|
private readonly cdr;
|
|
218
31
|
private readonly elementRef;
|
|
219
|
-
private readonly inputsRevision;
|
|
220
|
-
readonly foldedAccessibility: import("@angular/core").Signal<IAccessibilityProps & IAriaProps & Record<string, unknown>>;
|
|
221
|
-
get shouldRenderRefreshControl(): boolean;
|
|
222
|
-
scrollViewBag(): Record<string, unknown>;
|
|
223
|
-
refreshControlBag(): Record<string, unknown>;
|
|
224
|
-
get isHorizontal(): boolean;
|
|
225
|
-
private get isInverted();
|
|
226
|
-
private get windowSizeValue();
|
|
227
|
-
private get initialNumToRenderValue();
|
|
228
|
-
private get maxToRenderPerBatchValue();
|
|
229
|
-
private get updateCellsBatchingPeriodValue();
|
|
230
|
-
private get onEndReachedThresholdValue();
|
|
231
|
-
private get onStartReachedThresholdValue();
|
|
232
|
-
onScrollTick: (event: ISymbioteEvent) => void;
|
|
233
|
-
onLayoutTick: (event: ISymbioteEvent) => void;
|
|
234
|
-
handleRefresh: () => void;
|
|
235
|
-
accessibilityActionTick: (event: ISymbioteEvent) => void;
|
|
236
|
-
accessibilityTapTick: (event: ISymbioteEvent) => void;
|
|
237
|
-
magicTapTick: (event: ISymbioteEvent) => void;
|
|
238
|
-
accessibilityEscapeTick: (event: ISymbioteEvent) => void;
|
|
239
32
|
private keyFor;
|
|
240
33
|
private buildInputs;
|
|
241
|
-
|
|
34
|
+
protected dispatch(action: IListAction<ItemT>): void;
|
|
242
35
|
private isWindowSettled;
|
|
243
|
-
private runEffects;
|
|
244
|
-
ngOnChanges(): void;
|
|
245
36
|
ngDoCheck(): void;
|
|
246
37
|
ngAfterViewChecked(): void;
|
|
247
38
|
ngOnDestroy(): void;
|
|
248
39
|
private recomputeView;
|
|
249
|
-
private
|
|
250
|
-
private
|
|
251
|
-
private
|
|
40
|
+
private applyStyles;
|
|
41
|
+
private showEmpty;
|
|
42
|
+
private applySpacers;
|
|
252
43
|
private spacerStyle;
|
|
253
|
-
private
|
|
44
|
+
private buildCells;
|
|
254
45
|
handleCellLayout(measure: (event: ISymbioteEvent) => void, event: unknown): void;
|
|
255
46
|
private isSymbioteEvent;
|
|
256
|
-
private mergeSeparator;
|
|
257
|
-
private makeSeparators;
|
|
258
|
-
scrollToOffset(params: {
|
|
259
|
-
offset: number;
|
|
260
|
-
animated?: boolean;
|
|
261
|
-
}): void;
|
|
262
|
-
scrollToIndex(params: {
|
|
263
|
-
index: number;
|
|
264
|
-
animated?: boolean;
|
|
265
|
-
viewOffset?: number;
|
|
266
|
-
viewPosition?: number;
|
|
267
|
-
}): void;
|
|
268
|
-
scrollToItem(params: {
|
|
269
|
-
item: unknown;
|
|
270
|
-
animated?: boolean;
|
|
271
|
-
viewPosition?: number;
|
|
272
|
-
}): void;
|
|
273
|
-
scrollToEnd(params?: {
|
|
274
|
-
animated?: boolean;
|
|
275
|
-
}): void;
|
|
276
|
-
flashScrollIndicators(): void;
|
|
277
|
-
getNativeScrollRef(): IScrollViewHandle | null;
|
|
278
|
-
getScrollableNode(): IScrollViewHandle | null;
|
|
279
|
-
getScrollResponder(): IScrollViewHandle | null;
|
|
280
|
-
getScrollNode(): ISymbioteNode | null;
|
|
281
|
-
recordInteraction(): void;
|
|
282
47
|
private scrollToPixel;
|
|
283
48
|
static ɵfac: i0.ɵɵFactoryDeclaration<VirtualizedList<any>, never>;
|
|
284
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VirtualizedList<any>, "VirtualizedList", never, {
|
|
49
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VirtualizedList<any>, "VirtualizedList", never, {}, {}, never, never, true, [{ directive: typeof i1.SymbioteStyleInputDirective; inputs: { "style": "style"; }; outputs: {}; }]>;
|
|
285
50
|
}
|