+
+
+ {api.rows.map(row =>
)}
+
+
;
+ }
+
+ beforeEach(() => {
+ frames = new Map();
+ frameId = 0;
+ commits = 0;
+ time = 0;
+ height = 1;
+ opening = true;
+ childReadback = false;
+ vi.useFakeTimers();
+ vi.stubGlobal('requestAnimationFrame', (callback: FrameRequestCallback) => {
+ frames.set(++frameId, callback);
+ return frameId;
+ });
+ vi.stubGlobal('cancelAnimationFrame', (id: number) => frames.delete(id));
+ vi.stubGlobal('ResizeObserver', class { observe() {} unobserve() {} disconnect() {} });
+ vi.spyOn(HTMLElement.prototype, 'offsetHeight', 'get').mockImplementation(function () {
+ return this.hasAttribute('data-scroller') ? 500 : this.hasAttribute('data-virtual-index') ? height : 0;
+ });
+ vi.spyOn(HTMLElement.prototype, 'offsetWidth', 'get').mockReturnValue(800);
+ vi.spyOn(HTMLElement.prototype, 'clientHeight', 'get').mockReturnValue(500);
+ vi.spyOn(HTMLElement.prototype, 'scrollHeight', 'get').mockImplementation(function () {
+ const content = this.querySelector