| 73 | `, |
| 74 | }) |
| 75 | export class AppComponent { |
| 76 | rows = rows |
| 77 | |
| 78 | isSticky = (index: number) => stickyIndexesSet.has(index) |
| 79 | |
| 80 | scrollElement = viewChild<ElementRef<HTMLDivElement>>('scrollElement') |
| 81 | |
| 82 | virtualizer = injectVirtualizer(() => ({ |
| 83 | scrollElement: this.scrollElement(), |
| 84 | count: this.rows.length, |
| 85 | estimateSize: () => 50, |
| 86 | rangeExtractor: (range) => { |
| 87 | const next = new Set([ |
| 88 | reversedStickyIndexes.find((index) => range.startIndex >= index)!, |
| 89 | ...defaultRangeExtractor(range), |
| 90 | ]) |
| 91 | return [...next].sort((a, b) => a - b) |
| 92 | }, |
| 93 | })) |
| 94 | |
| 95 | activeStickyIndex = computed(() => { |
| 96 | return this.virtualizer.getVirtualItems()[0]?.index |
| 97 | }) |
| 98 | |
| 99 | isActiveSticky = (index: number) => this.activeStickyIndex() === index |
| 100 | } |
nothing calls this directly
no test coverage detected