virtua 0.51.3 → 0.52.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/README.md +37 -13
- package/lib/angular/VGrid.d.ts +249 -0
- package/lib/angular/VList.d.ts +3 -3
- package/lib/angular/Virtualizer.d.ts +3 -3
- package/lib/angular/WindowVirtualizer.d.ts +3 -3
- package/lib/angular/index.d.ts +2 -0
- package/lib/angular/index.js +1150 -327
- package/lib/angular/index.js.map +1 -1
- package/lib/core/grid.d.ts +30 -0
- package/lib/core/index.cjs +484 -270
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +5 -3
- package/lib/core/index.js +462 -249
- package/lib/core/index.js.map +1 -1
- package/lib/core/layouts/grid.d.ts +21 -0
- package/lib/core/scroll-to.d.ts +50 -1
- package/lib/core/types.d.ts +0 -25
- package/lib/index.cjs +761 -558
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +730 -509
- package/lib/index.js.map +1 -1
- package/lib/react/VGrid.d.ts +105 -80
- package/lib/react/index.d.ts +3 -2
- package/lib/solid/VGrid.d.ts +193 -0
- package/lib/solid/index.cjs +817 -288
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.d.ts +3 -0
- package/lib/solid/index.js +786 -270
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +743 -124
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/GridCell.svelte +44 -0
- package/lib/svelte/GridRow.svelte +42 -0
- package/lib/svelte/GridRowGroup.svelte +42 -0
- package/lib/svelte/VGrid.svelte +238 -0
- package/lib/svelte/VGrid.type.d.ts +185 -0
- package/lib/svelte/index.d.ts +3 -0
- package/lib/svelte/index.js +2 -1
- package/lib/vue/VGrid.d.ts +194 -0
- package/lib/vue/index.cjs +886 -376
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.d.ts +3 -0
- package/lib/vue/index.js +858 -349
- package/lib/vue/index.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
   [](https://bestofjs.org/projects/virtua) [](https://deepwiki.com/inokawa/virtua) [](https://github.com/inokawa/virtua/actions/workflows/check.yml) [](https://github.com/inokawa/virtua/actions/workflows/demo.yml)
|
|
4
4
|
|
|
5
|
-
> A zero-config, fast and small
|
|
5
|
+
> A zero-config, fast and small virtual list and grid component for [React](https://github.com/facebook/react), [Vue](https://vuejs.org/), [Solid](https://www.solidjs.com/), [Svelte](https://svelte.dev/) and [Angular](https://angular.dev/).
|
|
6
6
|
|
|
7
7
|

|
|
8
8
|
|
|
@@ -14,7 +14,7 @@ This project is a challenge to rethink virtualization. The goals are...
|
|
|
14
14
|
|
|
15
15
|
- **Zero-config virtualization:** This library is designed to give the best performance without configuration. It also handles common hard things in the real world (dynamic size measurement, scroll position adjustment while reverse scrolling and imperative scrolling, iOS support, etc).
|
|
16
16
|
- **Fast:** Natural virtual scrolling needs optimization in many aspects (eliminate frame drops by reducing CPU usage and GC, reduce [synchronous layout recalculation](https://gist.github.com/paulirish/5d52fb081b3570c81e3a), reduce visual jumps on repaint, optimize with CSS, optimize for JIT, optimize for frameworks, etc). We are trying to combine the best of them.
|
|
17
|
-
- **Small:** Its bundle size should be small as much as possible to be friendly with modern web development. Currently
|
|
17
|
+
- **Small:** Its bundle size should be small as much as possible to be friendly with modern web development. Currently components start from ~3kB gzipped and are tree-shakeable.
|
|
18
18
|
- **Flexible:** Aiming to support many usecases - fixed size, dynamic size, horizontal scrolling, reverse scrolling, RTL, mobile, infinite scrolling, scroll restoration, DnD, keyboard navigation, sticky, placeholder and more. See [live demo](#demo).
|
|
19
19
|
- **Framework agnostic:** [React](https://react.dev/), [Vue](https://vuejs.org/), [Solid](https://www.solidjs.com/), [Svelte](https://svelte.dev/) and [Angular](https://angular.dev/) are supported. We could support other frameworks in the future.
|
|
20
20
|
|
|
@@ -34,6 +34,7 @@ If you want to support legacy browsers, you need polyfills.
|
|
|
34
34
|
- [Scroll methods on elements](https://caniuse.com/element-scroll-methods) are always required (e.g. [element-scroll-polyfill](https://github.com/idmadj/element-scroll-polyfill)).
|
|
35
35
|
- [CSS scroll-behavior](https://caniuse.com/?search=scroll-behavior) is required only if you call `scrollToIndex` with `smooth: true` (e.g. [scroll-behavior-polyfill](https://github.com/wessberg/scroll-behavior-polyfill)).
|
|
36
36
|
- [CSS inset-inline-start](https://caniuse.com/mdn-css_properties_inset-inline-start) is required only if you set `horizontal: true`. It cannot be polyfilled so use `virtua@<=0.50` instead.
|
|
37
|
+
- [CSS subgrid](https://caniuse.com/css-subgrid) is required for VGrid.
|
|
37
38
|
|
|
38
39
|
## Getting started
|
|
39
40
|
|
|
@@ -174,24 +175,46 @@ export const App = () => {
|
|
|
174
175
|
};
|
|
175
176
|
```
|
|
176
177
|
|
|
177
|
-
####
|
|
178
|
+
#### Tabular data
|
|
178
179
|
|
|
179
180
|
```tsx
|
|
180
|
-
import {
|
|
181
|
+
import { VGrid } from "virtua";
|
|
182
|
+
|
|
183
|
+
const columns = [
|
|
184
|
+
{ key: "id", width: 80 },
|
|
185
|
+
{ key: "name", width: 200 },
|
|
186
|
+
{ key: "email", width: 300 },
|
|
187
|
+
{ key: "age", width: 80 },
|
|
188
|
+
{ key: "joined", width: 160 },
|
|
189
|
+
{ key: "bio", width: 480 },
|
|
190
|
+
] as const;
|
|
191
|
+
|
|
192
|
+
const rows = Array.from({ length: 10000 }, (_, i) => ({
|
|
193
|
+
id: i,
|
|
194
|
+
name: `User ${i}`,
|
|
195
|
+
email: `user${i}@example.com`,
|
|
196
|
+
age: 20 + (i % 50),
|
|
197
|
+
joined: new Date(2020, 0, 1 + i).toDateString(),
|
|
198
|
+
bio: `Hello, I'm user ${i}.`,
|
|
199
|
+
}));
|
|
181
200
|
|
|
182
201
|
export const App = () => {
|
|
183
202
|
return (
|
|
184
|
-
<VGrid
|
|
185
|
-
{
|
|
203
|
+
<VGrid
|
|
204
|
+
style={{ height: 800, border: "solid 1px gray", background: "white" }}
|
|
205
|
+
rows={rows}
|
|
206
|
+
rowHeight={40}
|
|
207
|
+
cols={columns}
|
|
208
|
+
colWidth="width"
|
|
209
|
+
>
|
|
210
|
+
{(row, col) => (
|
|
186
211
|
<div
|
|
187
212
|
style={{
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
borderLeft: colIndex !== 0 ? "solid 1px gray" : undefined,
|
|
191
|
-
borderTop: rowIndex !== 0 ? "solid 1px gray" : undefined,
|
|
213
|
+
borderRight: "solid 1px gray",
|
|
214
|
+
borderBottom: "solid 1px gray",
|
|
192
215
|
}}
|
|
193
216
|
>
|
|
194
|
-
{
|
|
217
|
+
{row[col.key]}
|
|
195
218
|
</div>
|
|
196
219
|
)}
|
|
197
220
|
</VGrid>
|
|
@@ -409,8 +432,9 @@ This package uses [exports of package.json](https://nodejs.org/api/packages.html
|
|
|
409
432
|
| Vertical scroll | ✅ | ✅ | ✅ | ✅ | 🟠 (needs customization) |
|
|
410
433
|
| Horizontal scroll | ✅ | ✅ | ✅ | ✅ | 🟠 (needs customization) |
|
|
411
434
|
| Horizontal scroll in RTL direction | ✅ | ❌ | ✅ | ❌ | 🟠 (isRtl) |
|
|
412
|
-
| Grid (Virtualization for two
|
|
413
|
-
|
|
|
435
|
+
| Grid (Virtualization for two dimensions) | ✅ (VGrid) | ❌ | ✅ ([Grid](https://react-window.vercel.app/grid/grid)) | ✅ ([Grid](https://github.com/bvaughn/react-virtualized/blob/master/docs/Grid.md)) | 🟠 (needs customization) |
|
|
436
|
+
| Tabular data (Columns with headers) | ✅ (VGrid) | ✅ (TableVirtuoso) | 🟠 ([Supported](https://react-window.vercel.app/list/tabular-data)) | ✅ ([Table](https://github.com/bvaughn/react-virtualized/blob/master/docs/Table.md)) | 🟠 (needs customization) |
|
|
437
|
+
| HTML table element | 🟠 (needs customization) | ✅ (TableVirtuoso) | ❌ | ❌ | 🟠 (needs customization) |
|
|
414
438
|
| Masonry | ❌ | ✅ (VirtuosoMasonry) | ❌ | ✅ ([Masonry](https://github.com/bvaughn/react-virtualized/blob/master/docs/Masonry.md)) | 🟠 (needs customization) |
|
|
415
439
|
| Window scroller | ✅ (WindowVirtualizer) | ✅ | ❌ | ✅ ([WindowScroller](https://github.com/bvaughn/react-virtualized/blob/master/docs/WindowScroller.md)) | ✅ (useWindowVirtualizer) |
|
|
416
440
|
| Dynamic list size | ✅ | ✅ | ✅ | 🟠 (needs [AutoSizer](https://github.com/bvaughn/react-virtualized/blob/master/docs/AutoSizer.md)) | ✅ |
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { type OnInit, TemplateRef } from "@angular/core";
|
|
2
|
+
import { type GridCellState, type GridRowGroupState, type GridRowState, type VGridScrollToIndexOpts, type VGridAxis, type VGridCell, type VGridSize, type VGridSpan } from "../core/index.js";
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Methods of {@link VGrid}.
|
|
6
|
+
*/
|
|
7
|
+
export interface VGridHandle {
|
|
8
|
+
/**
|
|
9
|
+
* Get current scrollTop.
|
|
10
|
+
*/
|
|
11
|
+
readonly verticalScrollOffset: number;
|
|
12
|
+
/**
|
|
13
|
+
* Get current scrollLeft. Always positive even in RTL.
|
|
14
|
+
*/
|
|
15
|
+
readonly horizontalScrollOffset: number;
|
|
16
|
+
/**
|
|
17
|
+
* Get current scrollHeight.
|
|
18
|
+
*/
|
|
19
|
+
readonly scrollHeight: number;
|
|
20
|
+
/**
|
|
21
|
+
* Get current scrollWidth.
|
|
22
|
+
*/
|
|
23
|
+
readonly scrollWidth: number;
|
|
24
|
+
/**
|
|
25
|
+
* Get current clientHeight.
|
|
26
|
+
*/
|
|
27
|
+
readonly viewportHeight: number;
|
|
28
|
+
/**
|
|
29
|
+
* Get current clientWidth.
|
|
30
|
+
*/
|
|
31
|
+
readonly viewportWidth: number;
|
|
32
|
+
/**
|
|
33
|
+
* Find nearest row index from offset.
|
|
34
|
+
* @param offset offset in pixels from the top of the scroll container
|
|
35
|
+
*/
|
|
36
|
+
findRowIndex(offset: number): number;
|
|
37
|
+
/**
|
|
38
|
+
* Find nearest column index from offset.
|
|
39
|
+
* @param offset offset in pixels from the start of the scroll container
|
|
40
|
+
*/
|
|
41
|
+
findColIndex(offset: number): number;
|
|
42
|
+
/**
|
|
43
|
+
* Get offset of the row from the top.
|
|
44
|
+
* @param index index of row
|
|
45
|
+
*/
|
|
46
|
+
getRowOffset(index: number): number;
|
|
47
|
+
/**
|
|
48
|
+
* Get offset of the column from the start.
|
|
49
|
+
* @param index index of column
|
|
50
|
+
*/
|
|
51
|
+
getColOffset(index: number): number;
|
|
52
|
+
/**
|
|
53
|
+
* Get size of the row.
|
|
54
|
+
* @param index index of row
|
|
55
|
+
*/
|
|
56
|
+
getRowSize(index: number): number;
|
|
57
|
+
/**
|
|
58
|
+
* Get size of the column.
|
|
59
|
+
* @param index index of column
|
|
60
|
+
*/
|
|
61
|
+
getColSize(index: number): number;
|
|
62
|
+
/**
|
|
63
|
+
* Scroll to the cell specified by the indexes. The cell is not hidden behind the rows and the columns sticking over it.
|
|
64
|
+
* @param opts the indexes of the cell and the options. See {@link VGridScrollToIndexOpts}.
|
|
65
|
+
*/
|
|
66
|
+
scrollToIndex(opts: VGridScrollToIndexOpts): void;
|
|
67
|
+
/**
|
|
68
|
+
* Scroll to the given offsets from the top/start of the scroll container.
|
|
69
|
+
* @param offset the offsets. The axis whose offset is omitted is not scrolled.
|
|
70
|
+
*/
|
|
71
|
+
scrollTo(offset: {
|
|
72
|
+
vertical?: number;
|
|
73
|
+
horizontal?: number;
|
|
74
|
+
}): void;
|
|
75
|
+
/**
|
|
76
|
+
* Scroll by the given offsets from the current position.
|
|
77
|
+
* @param offset the offsets. The axis whose offset is omitted is not scrolled.
|
|
78
|
+
*/
|
|
79
|
+
scrollBy(offset: {
|
|
80
|
+
vertical?: number;
|
|
81
|
+
horizontal?: number;
|
|
82
|
+
}): void;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Context of the cell template.
|
|
86
|
+
*/
|
|
87
|
+
export type CellContext<R = number, C = number> = {
|
|
88
|
+
/**
|
|
89
|
+
* The item of the rows at the row of the cell, or the row index if the rows are a number. Same as `row`.
|
|
90
|
+
*/
|
|
91
|
+
$implicit: R;
|
|
92
|
+
/**
|
|
93
|
+
* The item of the rows at the row of the cell, or the row index if the rows are a number.
|
|
94
|
+
*/
|
|
95
|
+
row: R;
|
|
96
|
+
/**
|
|
97
|
+
* The item of the columns at the column of the cell, or the column index if the columns are a number.
|
|
98
|
+
*/
|
|
99
|
+
col: C;
|
|
100
|
+
/**
|
|
101
|
+
* The row index and the column index of the cell.
|
|
102
|
+
*/
|
|
103
|
+
cell: Readonly<VGridCell>;
|
|
104
|
+
};
|
|
105
|
+
export declare class GridCell {
|
|
106
|
+
readonly state: import("@angular/core").InputSignal<GridCellState>;
|
|
107
|
+
readonly resizer: import("@angular/core").InputSignal<(el: HTMLElement, rowIndex: number | undefined, colIndex: number | undefined) => () => void>;
|
|
108
|
+
constructor();
|
|
109
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridCell, never>;
|
|
110
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GridCell, "div[virtuaGridCell]", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "resizer": { "alias": "resizer"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
111
|
+
}
|
|
112
|
+
export declare class GridRow<R, C> {
|
|
113
|
+
readonly state: import("@angular/core").InputSignal<GridRowState>;
|
|
114
|
+
readonly template: import("@angular/core").InputSignal<TemplateRef<CellContext<R, C>>>;
|
|
115
|
+
readonly row: import("@angular/core").InputSignal<R>;
|
|
116
|
+
readonly cols: import("@angular/core").InputSignal<VGridAxis<C>>;
|
|
117
|
+
readonly resizer: import("@angular/core").InputSignal<(el: HTMLElement, rowIndex: number | undefined, colIndex: number | undefined) => () => void>;
|
|
118
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridRow<any, any>, never>;
|
|
119
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GridRow<any, any>, "div[virtuaGridRow]", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "template": { "alias": "template"; "required": true; "isSignal": true; }; "row": { "alias": "row"; "required": true; "isSignal": true; }; "cols": { "alias": "cols"; "required": true; "isSignal": true; }; "resizer": { "alias": "resizer"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
120
|
+
}
|
|
121
|
+
export declare class GridRowGroup<R, C> {
|
|
122
|
+
readonly state: import("@angular/core").InputSignal<GridRowGroupState>;
|
|
123
|
+
readonly template: import("@angular/core").InputSignal<TemplateRef<CellContext<R, C>>>;
|
|
124
|
+
readonly rows: import("@angular/core").InputSignal<VGridAxis<R>>;
|
|
125
|
+
readonly cols: import("@angular/core").InputSignal<VGridAxis<C>>;
|
|
126
|
+
readonly resizer: import("@angular/core").InputSignal<(el: HTMLElement, rowIndex: number | undefined, colIndex: number | undefined) => () => void>;
|
|
127
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GridRowGroup<any, any>, never>;
|
|
128
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GridRowGroup<any, any>, "div[virtuaGridRowGroup]", never, { "state": { "alias": "state"; "required": true; "isSignal": true; }; "template": { "alias": "template"; "required": true; "isSignal": true; }; "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "cols": { "alias": "cols"; "required": true; "isSignal": true; }; "resizer": { "alias": "resizer"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Virtualized grid component for tabular data. See {@link VGridHandle}.
|
|
132
|
+
*
|
|
133
|
+
* The host element is the scrollable viewport of the grid.
|
|
134
|
+
*/
|
|
135
|
+
export declare class VGrid<R = number, C = number> implements OnInit, VGridHandle {
|
|
136
|
+
/**
|
|
137
|
+
* The rows of the grid. See {@link VGridAxis} for the accepted values.
|
|
138
|
+
*/
|
|
139
|
+
readonly rows: import("@angular/core").InputSignal<VGridAxis<R>>;
|
|
140
|
+
/**
|
|
141
|
+
* The columns of the grid. See {@link VGridAxis} for the accepted values.
|
|
142
|
+
*/
|
|
143
|
+
readonly cols: import("@angular/core").InputSignal<VGridAxis<C>>;
|
|
144
|
+
/**
|
|
145
|
+
* The heights of the rows. See {@link VGridSize} for the accepted values.
|
|
146
|
+
*/
|
|
147
|
+
readonly rowHeight: import("@angular/core").InputSignal<NoInfer<VGridSize<R>>>;
|
|
148
|
+
/**
|
|
149
|
+
* The widths of the columns. See {@link VGridSize} for the accepted values.
|
|
150
|
+
*/
|
|
151
|
+
readonly colWidth: import("@angular/core").InputSignal<NoInfer<VGridSize<C>>>;
|
|
152
|
+
/**
|
|
153
|
+
* The number of the leading rows pinned to the start, which are the column headers (`role="columnheader"`).
|
|
154
|
+
*
|
|
155
|
+
* **The pinned cells are rendered over the other cells, so give them an opaque background.**
|
|
156
|
+
* @defaultValue 0
|
|
157
|
+
*/
|
|
158
|
+
readonly headerRows: import("@angular/core").InputSignal<number | undefined>;
|
|
159
|
+
/**
|
|
160
|
+
* Indexes of the rows which start sections. A section lasts until the next section row or the footer rows, and its first row sticks below the header rows while the section is scrolled through.
|
|
161
|
+
*
|
|
162
|
+
* **The section rows are rendered over the other cells while they stick, so give them an opaque background.**
|
|
163
|
+
*/
|
|
164
|
+
readonly sectionRows: import("@angular/core").InputSignal<readonly number[] | undefined>;
|
|
165
|
+
/**
|
|
166
|
+
* The number of the trailing rows pinned to the end.
|
|
167
|
+
*
|
|
168
|
+
* **The pinned cells are rendered over the other cells, so give them an opaque background.**
|
|
169
|
+
* @defaultValue 0
|
|
170
|
+
*/
|
|
171
|
+
readonly footerRows: import("@angular/core").InputSignal<number | undefined>;
|
|
172
|
+
/**
|
|
173
|
+
* The number of the leading columns pinned to the start, the last of which is the row header (`role="rowheader"`).
|
|
174
|
+
*
|
|
175
|
+
* **The pinned cells are rendered over the other cells, so give them an opaque background.**
|
|
176
|
+
* @defaultValue 0
|
|
177
|
+
*/
|
|
178
|
+
readonly headerCols: import("@angular/core").InputSignal<number | undefined>;
|
|
179
|
+
/**
|
|
180
|
+
* The number of the trailing columns pinned to the end.
|
|
181
|
+
*
|
|
182
|
+
* **The pinned cells are rendered over the other cells, so give them an opaque background.**
|
|
183
|
+
* @defaultValue 0
|
|
184
|
+
*/
|
|
185
|
+
readonly footerCols: import("@angular/core").InputSignal<number | undefined>;
|
|
186
|
+
/**
|
|
187
|
+
* Cells merged over multiple rows and/or columns. See {@link VGridSpan} for the accepted values.
|
|
188
|
+
*
|
|
189
|
+
* The cell at the origin is stretched over the merged area, and the other cells in it are not rendered. Spans must not overlap each other or cross the boundaries of the pinned rows/columns or the sections. A spanning cell is not measured for `"auto"` sizes on the axes it spans, and doesn't enlarge those tracks.
|
|
190
|
+
*/
|
|
191
|
+
readonly spans: import("@angular/core").InputSignal<readonly VGridSpan[] | undefined>;
|
|
192
|
+
/**
|
|
193
|
+
* List of cells that should be always mounted, even when off screen.
|
|
194
|
+
*/
|
|
195
|
+
readonly keepMounted: import("@angular/core").InputSignal<readonly VGridCell[] | undefined>;
|
|
196
|
+
/**
|
|
197
|
+
* Extra space in pixels to render before/after the viewport. The minimum value is 0. Lower value will give better performance but you can increase to avoid showing blank cells in fast scrolling.
|
|
198
|
+
* @defaultValue 200
|
|
199
|
+
*/
|
|
200
|
+
readonly bufferSize: import("@angular/core").InputSignal<number | undefined>;
|
|
201
|
+
/**
|
|
202
|
+
* The gap between the rows and the columns in pixels, which is not included in the sizes. Must not be changed after mount.
|
|
203
|
+
* @defaultValue 0
|
|
204
|
+
*/
|
|
205
|
+
readonly gap: import("@angular/core").InputSignal<number>;
|
|
206
|
+
/**
|
|
207
|
+
* The header cell of the sorted column or row, and the sort order (`aria-sort`).
|
|
208
|
+
*/
|
|
209
|
+
readonly ariaSort: import("@angular/core").InputSignal<(VGridCell & {
|
|
210
|
+
order: "ascending" | "descending" | "other";
|
|
211
|
+
}) | undefined>;
|
|
212
|
+
/**
|
|
213
|
+
* Emitted whenever the vertical scroll offset changes. The value is current scrollTop.
|
|
214
|
+
*/
|
|
215
|
+
readonly verticalScrolled: import("@angular/core").OutputEmitterRef<number>;
|
|
216
|
+
/**
|
|
217
|
+
* Emitted whenever the horizontal scroll offset changes. The value is current scrollLeft, which is always positive even in RTL.
|
|
218
|
+
*/
|
|
219
|
+
readonly horizontalScrolled: import("@angular/core").OutputEmitterRef<number>;
|
|
220
|
+
/**
|
|
221
|
+
* Emitted when scrolling stops.
|
|
222
|
+
*/
|
|
223
|
+
readonly scrollEnded: import("@angular/core").OutputEmitterRef<void>;
|
|
224
|
+
constructor();
|
|
225
|
+
ngOnInit(): void;
|
|
226
|
+
get verticalScrollOffset(): number;
|
|
227
|
+
get horizontalScrollOffset(): number;
|
|
228
|
+
get scrollHeight(): number;
|
|
229
|
+
get scrollWidth(): number;
|
|
230
|
+
get viewportHeight(): number;
|
|
231
|
+
get viewportWidth(): number;
|
|
232
|
+
findRowIndex(offset: number): number;
|
|
233
|
+
findColIndex(offset: number): number;
|
|
234
|
+
getRowOffset(index: number): number;
|
|
235
|
+
getColOffset(index: number): number;
|
|
236
|
+
getRowSize(index: number): number;
|
|
237
|
+
getColSize(index: number): number;
|
|
238
|
+
scrollToIndex(opts: VGridScrollToIndexOpts): void;
|
|
239
|
+
scrollTo({ vertical, horizontal, }: {
|
|
240
|
+
vertical?: number;
|
|
241
|
+
horizontal?: number;
|
|
242
|
+
}): void;
|
|
243
|
+
scrollBy({ vertical, horizontal, }: {
|
|
244
|
+
vertical?: number;
|
|
245
|
+
horizontal?: number;
|
|
246
|
+
}): void;
|
|
247
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VGrid<any, any>, never>;
|
|
248
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VGrid<any, any>, "virtua-vgrid", never, { "rows": { "alias": "rows"; "required": true; "isSignal": true; }; "cols": { "alias": "cols"; "required": true; "isSignal": true; }; "rowHeight": { "alias": "rowHeight"; "required": true; "isSignal": true; }; "colWidth": { "alias": "colWidth"; "required": true; "isSignal": true; }; "headerRows": { "alias": "headerRows"; "required": false; "isSignal": true; }; "sectionRows": { "alias": "sectionRows"; "required": false; "isSignal": true; }; "footerRows": { "alias": "footerRows"; "required": false; "isSignal": true; }; "headerCols": { "alias": "headerCols"; "required": false; "isSignal": true; }; "footerCols": { "alias": "footerCols"; "required": false; "isSignal": true; }; "spans": { "alias": "spans"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "ariaSort": { "alias": "ariaSort"; "required": false; "isSignal": true; }; }, { "verticalScrolled": "verticalScrolled"; "horizontalScrolled": "horizontalScrolled"; "scrollEnded": "scrollEnded"; }, ["template"], never, true, never>;
|
|
249
|
+
}
|
package/lib/angular/VList.d.ts
CHANGED
|
@@ -64,11 +64,11 @@ export declare class VList<T> implements OnInit, VListHandle {
|
|
|
64
64
|
/**
|
|
65
65
|
* Emitted whenever scroll offset changes. The value is current scrollTop, or scrollLeft if horizontal: true.
|
|
66
66
|
*/
|
|
67
|
-
readonly
|
|
67
|
+
readonly scrolled: import("@angular/core").OutputEmitterRef<number>;
|
|
68
68
|
/**
|
|
69
69
|
* Emitted when scrolling stops.
|
|
70
70
|
*/
|
|
71
|
-
readonly
|
|
71
|
+
readonly scrollEnded: import("@angular/core").OutputEmitterRef<void>;
|
|
72
72
|
ngOnInit(): void;
|
|
73
73
|
get cache(): CacheSnapshot;
|
|
74
74
|
get scrollOffset(): number;
|
|
@@ -81,5 +81,5 @@ export declare class VList<T> implements OnInit, VListHandle {
|
|
|
81
81
|
scrollTo(offset: number): void;
|
|
82
82
|
scrollBy(offset: number): void;
|
|
83
83
|
static ɵfac: i0.ɵɵFactoryDeclaration<VList<any>, never>;
|
|
84
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VList<any>, "virtua-vlist", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "itemProps": { "alias": "itemProps"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; }, { "
|
|
84
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VList<any>, "virtua-vlist", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "itemProps": { "alias": "itemProps"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; }, { "scrolled": "scrolled"; "scrollEnded": "scrollEnded"; }, ["template"], never, true, never>;
|
|
85
85
|
}
|
|
@@ -119,11 +119,11 @@ export declare class Virtualizer<T> implements OnInit, VirtualizerHandle {
|
|
|
119
119
|
/**
|
|
120
120
|
* Emitted whenever scroll offset changes. The value is current scrollTop, or scrollLeft if horizontal: true.
|
|
121
121
|
*/
|
|
122
|
-
readonly
|
|
122
|
+
readonly scrolled: import("@angular/core").OutputEmitterRef<number>;
|
|
123
123
|
/**
|
|
124
124
|
* Emitted when scrolling stops.
|
|
125
125
|
*/
|
|
126
|
-
readonly
|
|
126
|
+
readonly scrollEnded: import("@angular/core").OutputEmitterRef<void>;
|
|
127
127
|
constructor();
|
|
128
128
|
ngOnInit(): void;
|
|
129
129
|
get cache(): CacheSnapshot;
|
|
@@ -137,5 +137,5 @@ export declare class Virtualizer<T> implements OnInit, VirtualizerHandle {
|
|
|
137
137
|
scrollTo(offset: number): void;
|
|
138
138
|
scrollBy(offset: number): void;
|
|
139
139
|
static ɵfac: i0.ɵɵFactoryDeclaration<Virtualizer<any>, never>;
|
|
140
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Virtualizer<any>, "virtua-virtualizer, [virtuaVirtualizer]", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "itemProps": { "alias": "itemProps"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "scrollRef": { "alias": "scrollRef"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; "startMargin": { "alias": "startMargin"; "required": false; "isSignal": true; }; }, { "
|
|
140
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Virtualizer<any>, "virtua-virtualizer, [virtuaVirtualizer]", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "itemProps": { "alias": "itemProps"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "scrollRef": { "alias": "scrollRef"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "keepMounted": { "alias": "keepMounted"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; "startMargin": { "alias": "startMargin"; "required": false; "isSignal": true; }; }, { "scrolled": "scrolled"; "scrollEnded": "scrollEnded"; }, ["contentTemplate"], never, true, never>;
|
|
141
141
|
}
|
|
@@ -88,11 +88,11 @@ export declare class WindowVirtualizer<T> implements OnInit, WindowVirtualizerHa
|
|
|
88
88
|
/**
|
|
89
89
|
* Emitted whenever scroll offset changes.
|
|
90
90
|
*/
|
|
91
|
-
readonly
|
|
91
|
+
readonly scrolled: import("@angular/core").OutputEmitterRef<void>;
|
|
92
92
|
/**
|
|
93
93
|
* Emitted when scrolling stops.
|
|
94
94
|
*/
|
|
95
|
-
readonly
|
|
95
|
+
readonly scrollEnded: import("@angular/core").OutputEmitterRef<void>;
|
|
96
96
|
constructor();
|
|
97
97
|
ngOnInit(): void;
|
|
98
98
|
get cache(): CacheSnapshot;
|
|
@@ -103,5 +103,5 @@ export declare class WindowVirtualizer<T> implements OnInit, WindowVirtualizerHa
|
|
|
103
103
|
getItemSize(index: number): number;
|
|
104
104
|
scrollToIndex(index: number, opts?: ScrollToIndexOpts): void;
|
|
105
105
|
static ɵfac: i0.ɵɵFactoryDeclaration<WindowVirtualizer<any>, never>;
|
|
106
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<WindowVirtualizer<any>, "virtua-window-virtualizer, [virtuaWindowVirtualizer]", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; }, { "
|
|
106
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<WindowVirtualizer<any>, "virtua-window-virtualizer, [virtuaWindowVirtualizer]", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "getKey": { "alias": "getKey"; "required": false; "isSignal": true; }; "bufferSize": { "alias": "bufferSize"; "required": false; "isSignal": true; }; "itemSize": { "alias": "itemSize"; "required": false; "isSignal": true; }; "ssrCount": { "alias": "ssrCount"; "required": false; "isSignal": true; }; "shift": { "alias": "shift"; "required": false; "isSignal": true; }; "horizontal": { "alias": "horizontal"; "required": false; "isSignal": true; }; "cacheProp": { "alias": "cache"; "required": false; "isSignal": true; }; }, { "scrolled": "scrolled"; "scrollEnded": "scrollEnded"; }, ["template"], never, true, never>;
|
|
107
107
|
}
|
package/lib/angular/index.d.ts
CHANGED
|
@@ -4,3 +4,5 @@
|
|
|
4
4
|
export { VList, type VListHandle } from "./VList.js";
|
|
5
5
|
export { Virtualizer, type VirtualizerHandle } from "./Virtualizer.js";
|
|
6
6
|
export { WindowVirtualizer, type WindowVirtualizerHandle, } from "./WindowVirtualizer.js";
|
|
7
|
+
export { VGrid, type VGridHandle } from "./VGrid.js";
|
|
8
|
+
export type { VGridSize, VGridSpan } from "../core/index.js";
|