@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.
Files changed (121) hide show
  1. package/build/angular/accessibility-events.d.ts +12 -0
  2. package/build/angular/accessibility-events.js +28 -0
  3. package/build/angular/accessibility-events.js.map +1 -0
  4. package/build/angular/accessibility-inputs.d.ts +40 -0
  5. package/build/angular/accessibility-inputs.js +130 -0
  6. package/build/angular/accessibility-inputs.js.map +1 -0
  7. package/build/angular/bootstrap.d.ts +3 -1
  8. package/build/angular/bootstrap.js +4 -1
  9. package/build/angular/bootstrap.js.map +1 -1
  10. package/build/angular/components/flat-list/flat-list-template.d.ts +1 -0
  11. package/build/angular/components/flat-list/flat-list-template.js +158 -0
  12. package/build/angular/components/flat-list/flat-list-template.js.map +1 -0
  13. package/build/angular/components/flat-list/index.d.ts +6 -61
  14. package/build/angular/components/flat-list/index.js +26 -463
  15. package/build/angular/components/flat-list/index.js.map +1 -1
  16. package/build/angular/components/keyboard-avoiding-view/index.d.ts +4 -40
  17. package/build/angular/components/keyboard-avoiding-view/index.js +7 -131
  18. package/build/angular/components/keyboard-avoiding-view/index.js.map +1 -1
  19. package/build/angular/components/modal/index.d.ts +5 -41
  20. package/build/angular/components/modal/index.js +8 -133
  21. package/build/angular/components/modal/index.js.map +1 -1
  22. package/build/angular/components/section-list/index.d.ts +4 -51
  23. package/build/angular/components/section-list/index.js +18 -335
  24. package/build/angular/components/section-list/index.js.map +1 -1
  25. package/build/angular/components/virtualized-list/cell-registry.d.ts +35 -0
  26. package/build/angular/components/virtualized-list/cell-registry.js +133 -0
  27. package/build/angular/components/virtualized-list/cell-registry.js.map +1 -0
  28. package/build/angular/components/virtualized-list/index.d.ts +18 -253
  29. package/build/angular/components/virtualized-list/index.js +112 -1178
  30. package/build/angular/components/virtualized-list/index.js.map +1 -1
  31. package/build/angular/components/virtualized-list/list-a11y-forward.d.ts +1 -0
  32. package/build/angular/components/virtualized-list/list-a11y-forward.js +42 -0
  33. package/build/angular/components/virtualized-list/list-a11y-forward.js.map +1 -0
  34. package/build/angular/components/virtualized-list/list-bags.d.ts +32 -0
  35. package/build/angular/components/virtualized-list/list-bags.js +120 -0
  36. package/build/angular/components/virtualized-list/list-bags.js.map +1 -0
  37. package/build/angular/components/virtualized-list/list-effects.d.ts +31 -0
  38. package/build/angular/components/virtualized-list/list-effects.js +83 -0
  39. package/build/angular/components/virtualized-list/list-effects.js.map +1 -0
  40. package/build/angular/components/virtualized-list/list-events.d.ts +17 -0
  41. package/build/angular/components/virtualized-list/list-events.js +34 -0
  42. package/build/angular/components/virtualized-list/list-events.js.map +1 -0
  43. package/build/angular/components/virtualized-list/list-handle.d.ts +35 -0
  44. package/build/angular/components/virtualized-list/list-handle.js +61 -0
  45. package/build/angular/components/virtualized-list/list-handle.js.map +1 -0
  46. package/build/angular/components/virtualized-list/list-inputs.d.ts +78 -0
  47. package/build/angular/components/virtualized-list/list-inputs.js +150 -0
  48. package/build/angular/components/virtualized-list/list-inputs.js.map +1 -0
  49. package/build/angular/components/virtualized-list/list-props.d.ts +58 -0
  50. package/build/angular/components/virtualized-list/list-props.js +3 -0
  51. package/build/angular/components/virtualized-list/list-props.js.map +1 -0
  52. package/build/angular/components/virtualized-list/list-styles.d.ts +23 -0
  53. package/build/angular/components/virtualized-list/list-styles.js +26 -0
  54. package/build/angular/components/virtualized-list/list-styles.js.map +1 -0
  55. package/build/angular/components/virtualized-list/list-template.d.ts +1 -0
  56. package/build/angular/components/virtualized-list/list-template.js +176 -0
  57. package/build/angular/components/virtualized-list/list-template.js.map +1 -0
  58. package/build/angular/components/virtualized-section-list/index.d.ts +13 -70
  59. package/build/angular/components/virtualized-section-list/index.js +22 -455
  60. package/build/angular/components/virtualized-section-list/index.js.map +1 -1
  61. package/build/angular/components/virtualized-section-list/section-list-template.d.ts +1 -0
  62. package/build/angular/components/virtualized-section-list/section-list-template.js +107 -0
  63. package/build/angular/components/virtualized-section-list/section-list-template.js.map +1 -0
  64. package/build/angular/finalization-registry.d.ts +4 -0
  65. package/build/angular/finalization-registry.js +17 -0
  66. package/build/angular/finalization-registry.js.map +1 -0
  67. package/build/angular/index.d.ts +5 -1
  68. package/build/angular/index.js +5 -1
  69. package/build/angular/index.js.map +1 -1
  70. package/build/angular/native-view-base.d.ts +19 -0
  71. package/build/angular/native-view-base.js +48 -0
  72. package/build/angular/native-view-base.js.map +1 -0
  73. package/build/angular/render/index.d.ts +2 -1
  74. package/build/angular/render/index.js +46 -73
  75. package/build/angular/render/index.js.map +1 -1
  76. package/build/angular/services/connect-watched-signal.d.ts +2 -0
  77. package/build/angular/services/connect-watched-signal.js +9 -0
  78. package/build/angular/services/connect-watched-signal.js.map +1 -0
  79. package/build/angular/services/create-event-value-hook.d.ts +3 -0
  80. package/build/angular/services/create-event-value-hook.js +17 -0
  81. package/build/angular/services/create-event-value-hook.js.map +1 -0
  82. package/build/angular/services/create-resource-hook.d.ts +7 -0
  83. package/build/angular/services/create-resource-hook.js +20 -0
  84. package/build/angular/services/create-resource-hook.js.map +1 -0
  85. package/build/angular/services/index.d.ts +4 -0
  86. package/build/angular/services/index.js +4 -0
  87. package/build/angular/services/index.js.map +1 -1
  88. package/build/angular/services/permissions-service-base.d.ts +14 -0
  89. package/build/angular/services/permissions-service-base.js +38 -0
  90. package/build/angular/services/permissions-service-base.js.map +1 -0
  91. package/package.json +6 -6
  92. package/src/accessibility-events.ts +13 -0
  93. package/src/accessibility-inputs.ts +89 -0
  94. package/src/bootstrap.ts +6 -2
  95. package/src/components/flat-list/flat-list-template.ts +159 -0
  96. package/src/components/flat-list/index.ts +30 -307
  97. package/src/components/keyboard-avoiding-view/index.ts +4 -78
  98. package/src/components/modal/index.ts +7 -80
  99. package/src/components/section-list/index.ts +21 -172
  100. package/src/components/virtualized-list/cell-registry.ts +199 -0
  101. package/src/components/virtualized-list/index.ts +145 -1181
  102. package/src/components/virtualized-list/list-a11y-forward.ts +42 -0
  103. package/src/components/virtualized-list/list-bags.ts +142 -0
  104. package/src/components/virtualized-list/list-effects.ts +116 -0
  105. package/src/components/virtualized-list/list-events.ts +31 -0
  106. package/src/components/virtualized-list/list-handle.ts +92 -0
  107. package/src/components/virtualized-list/list-inputs.ts +149 -0
  108. package/src/components/virtualized-list/list-props.ts +81 -0
  109. package/src/components/virtualized-list/list-styles.ts +62 -0
  110. package/src/components/virtualized-list/list-template.ts +175 -0
  111. package/src/components/virtualized-section-list/index.ts +40 -351
  112. package/src/components/virtualized-section-list/section-list-template.ts +108 -0
  113. package/src/finalization-registry.ts +18 -0
  114. package/src/index.ts +12 -1
  115. package/src/native-view-base.ts +51 -0
  116. package/src/render/index.ts +76 -77
  117. package/src/services/connect-watched-signal.ts +15 -0
  118. package/src/services/create-event-value-hook.ts +24 -0
  119. package/src/services/create-resource-hook.ts +32 -0
  120. package/src/services/index.ts +4 -0
  121. 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,GAA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C,QAAQ,EAAE;YACpC,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC;YACxC,GAAG,KAAK;SACT,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;IAC3B,CAAC;IAEO,cAAc,CAAC,KAAa;QAClC,OAAO;YACL,SAAS,EAAE,GAAS,EAAE;gBACpB,IAAI,CAAC,oDAAoD,KAAK,EAAE,CAAC,CAAC;gBAClE,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;gBACtD,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,WAAW,EAAE,GAAS,EAAE;gBACtB,IAAI,CAAC,sDAAsD,KAAK,EAAE,CAAC,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 { EventEmitter, TemplateRef, type AfterViewChecked, type DoCheck, type OnChanges, type OnDestroy } from '@angular/core';
2
- import { type IAccessibilityProps, type IAccessibilityStateValue, type IAriaProps, type IScrollViewHandle, type IViewabilityConfig, type IViewabilityConfigCallbackPair, type IViewableItemsChangedInfo, type IVirtualizedListHandle } from '@symbiote-native/components';
3
- import { type IStyleProp, type ISymbioteEvent, type ISymbioteNode, type IViewStyle } from '@symbiote-native/engine';
4
- import { VListEmptyDirective, VListFooterDirective, VListHeaderDirective, VListItemDirective, VListSeparatorDirective, type IVListItemContext, type IVListSeparatorContext } from './directives';
5
- import { type IGatedAccessibilityEvent } from '../../gate-demand';
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 interface IVirtualizedListProps<ItemT> extends IAccessibilityProps, IAriaProps {
12
- data: unknown;
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
- private get scrollNode();
188
- private readonly scrollHandle;
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 cellMeasures;
209
- private cellContexts;
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
- private dispatch;
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 buildWindowCell;
250
- private contextFor;
251
- private buildSeparatorContext;
40
+ private applyStyles;
41
+ private showEmpty;
42
+ private applySpacers;
252
43
  private spacerStyle;
253
- private cellMeasure;
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, { "data": { "alias": "data"; "required": true; }; "getItem": { "alias": "getItem"; "required": true; }; "getItemCount": { "alias": "getItemCount"; "required": true; }; "keyExtractor": { "alias": "keyExtractor"; "required": false; }; "getItemLayout": { "alias": "getItemLayout"; "required": false; }; "horizontal": { "alias": "horizontal"; "required": false; }; "inverted": { "alias": "inverted"; "required": false; }; "extraData": { "alias": "extraData"; "required": false; }; "onEndReachedThreshold": { "alias": "onEndReachedThreshold"; "required": false; }; "onStartReachedThreshold": { "alias": "onStartReachedThreshold"; "required": false; }; "refreshing": { "alias": "refreshing"; "required": false; }; "progressViewOffset": { "alias": "progressViewOffset"; "required": false; }; "refreshRequested": { "alias": "refreshRequested"; "required": false; }; "viewabilityConfig": { "alias": "viewabilityConfig"; "required": false; }; "viewabilityConfigCallbackPairs": { "alias": "viewabilityConfigCallbackPairs"; "required": false; }; "initialNumToRender": { "alias": "initialNumToRender"; "required": false; }; "initialScrollIndex": { "alias": "initialScrollIndex"; "required": false; }; "maxToRenderPerBatch": { "alias": "maxToRenderPerBatch"; "required": false; }; "updateCellsBatchingPeriod": { "alias": "updateCellsBatchingPeriod"; "required": false; }; "windowSize": { "alias": "windowSize"; "required": false; }; "stickyHeaderIndices": { "alias": "stickyHeaderIndices"; "required": false; }; "maintainVisibleContentPosition": { "alias": "maintainVisibleContentPosition"; "required": false; }; "onScroll": { "alias": "onScroll"; "required": false; }; "onScrollBeginDrag": { "alias": "onScrollBeginDrag"; "required": false; }; "onScrollEndDrag": { "alias": "onScrollEndDrag"; "required": false; }; "onMomentumScrollBegin": { "alias": "onMomentumScrollBegin"; "required": false; }; "onMomentumScrollEnd": { "alias": "onMomentumScrollEnd"; "required": false; }; "scrollEventThrottle": { "alias": "scrollEventThrottle"; "required": false; }; "keyboardShouldPersistTaps": { "alias": "keyboardShouldPersistTaps"; "required": false; }; "keyboardDismissMode": { "alias": "keyboardDismissMode"; "required": false; }; "removeClippedSubviews": { "alias": "removeClippedSubviews"; "required": false; }; "nestedScrollEnabled": { "alias": "nestedScrollEnabled"; "required": false; }; "style": { "alias": "style"; "required": false; }; "contentContainerStyle": { "alias": "contentContainerStyle"; "required": false; }; "testID": { "alias": "testID"; "required": false; }; "nativeID": { "alias": "nativeID"; "required": false; }; "accessible": { "alias": "accessible"; "required": false; }; "accessibilityLabel": { "alias": "accessibilityLabel"; "required": false; }; "accessibilityHint": { "alias": "accessibilityHint"; "required": false; }; "accessibilityRole": { "alias": "accessibilityRole"; "required": false; }; "accessibilityState": { "alias": "accessibilityState"; "required": false; }; "accessibilityValue": { "alias": "accessibilityValue"; "required": false; }; "accessibilityActions": { "alias": "accessibilityActions"; "required": false; }; "accessibilityLabelledBy": { "alias": "accessibilityLabelledBy"; "required": false; }; "importantForAccessibility": { "alias": "importantForAccessibility"; "required": false; }; "accessibilityLiveRegion": { "alias": "accessibilityLiveRegion"; "required": false; }; "screenReaderFocusable": { "alias": "screenReaderFocusable"; "required": false; }; "accessibilityViewIsModal": { "alias": "accessibilityViewIsModal"; "required": false; }; "accessibilityElementsHidden": { "alias": "accessibilityElementsHidden"; "required": false; }; "accessibilityIgnoresInvertColors": { "alias": "accessibilityIgnoresInvertColors"; "required": false; }; "accessibilityLanguage": { "alias": "accessibilityLanguage"; "required": false; }; "accessibilityRespondsToUserInteraction": { "alias": "accessibilityRespondsToUserInteraction"; "required": false; }; "accessibilityShowsLargeContentViewer": { "alias": "accessibilityShowsLargeContentViewer"; "required": false; }; "accessibilityLargeContentTitle": { "alias": "accessibilityLargeContentTitle"; "required": false; }; "role": { "alias": "role"; "required": false; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaLabelledBy": { "alias": "ariaLabelledBy"; "required": false; }; "ariaLive": { "alias": "ariaLive"; "required": false; }; "ariaHidden": { "alias": "ariaHidden"; "required": false; }; "ariaBusy": { "alias": "ariaBusy"; "required": false; }; "ariaChecked": { "alias": "ariaChecked"; "required": false; }; "ariaDisabled": { "alias": "ariaDisabled"; "required": false; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; }; "ariaSelected": { "alias": "ariaSelected"; "required": false; }; "ariaModal": { "alias": "ariaModal"; "required": false; }; "ariaValueMax": { "alias": "ariaValueMax"; "required": false; }; "ariaValueMin": { "alias": "ariaValueMin"; "required": false; }; "ariaValueNow": { "alias": "ariaValueNow"; "required": false; }; "ariaValueText": { "alias": "ariaValueText"; "required": false; }; "itemTemplate": { "alias": "itemTemplate"; "required": false; }; "itemSeparatorTemplate": { "alias": "itemSeparatorTemplate"; "required": false; }; }, { "endReached": "endReached"; "startReached": "startReached"; "refresh": "refresh"; "viewableItemsChanged": "viewableItemsChanged"; "scrollToIndexFailed": "scrollToIndexFailed"; "accessibilityAction": "accessibilityAction"; "accessibilityTap": "accessibilityTap"; "magicTap": "magicTap"; "accessibilityEscape": "accessibilityEscape"; }, ["itemDir", "headerDir", "footerDir", "emptyDir", "separatorDir"], never, true, [{ directive: typeof i1.SymbioteStyleInputDirective; inputs: { "style": "style"; }; outputs: {}; }]>;
49
+ static ɵcmp: i0.ɵɵComponentDeclaration<VirtualizedList<any>, "VirtualizedList", never, {}, {}, never, never, true, [{ directive: typeof i1.SymbioteStyleInputDirective; inputs: { "style": "style"; }; outputs: {}; }]>;
285
50
  }