virtua 0.52.0 → 0.52.2
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/lib/angular/VGrid.d.ts +20 -20
- package/lib/angular/index.d.ts +1 -1
- package/lib/angular/index.js +287 -269
- package/lib/angular/index.js.map +1 -1
- package/lib/core/grid.d.ts +3 -3
- package/lib/core/index.cjs +286 -268
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +4 -4
- package/lib/core/index.js +258 -240
- package/lib/core/index.js.map +1 -1
- package/lib/core/layouts/grid.d.ts +8 -6
- package/lib/core/scroll-to.d.ts +1 -1
- package/lib/index.cjs +429 -411
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +444 -426
- package/lib/index.js.map +1 -1
- package/lib/react/VGrid.d.ts +16 -16
- package/lib/react/index.d.ts +1 -1
- package/lib/solid/VGrid.d.ts +16 -16
- package/lib/solid/index.cjs +436 -418
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.d.ts +1 -1
- package/lib/solid/index.js +466 -448
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +206 -191
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/GridCell.svelte +2 -2
- package/lib/svelte/GridRow.svelte +4 -4
- package/lib/svelte/GridRowGroup.svelte +5 -5
- package/lib/svelte/VGrid.svelte +20 -10
- package/lib/svelte/VGrid.type.d.ts +16 -16
- package/lib/svelte/index.d.ts +1 -1
- package/lib/vue/VGrid.d.ts +16 -16
- package/lib/vue/index.cjs +431 -413
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.d.ts +1 -1
- package/lib/vue/index.js +450 -432
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
import {
|
|
4
4
|
type GridCellState,
|
|
5
5
|
type GridDriver,
|
|
6
|
-
type
|
|
6
|
+
type GridCell,
|
|
7
7
|
gridStyleToString,
|
|
8
8
|
} from "../core/index.js";
|
|
9
9
|
|
|
10
10
|
interface Props {
|
|
11
11
|
state: GridCellState;
|
|
12
|
-
children: Snippet<[row: R, col: C, cell: Readonly<
|
|
12
|
+
children: Snippet<[row: R, col: C, cell: Readonly<GridCell>]>;
|
|
13
13
|
row: R;
|
|
14
14
|
col: C;
|
|
15
15
|
rowIndex: number;
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
getAxisLength,
|
|
6
6
|
type GridDriver,
|
|
7
7
|
type GridRowState,
|
|
8
|
-
type
|
|
9
|
-
type
|
|
8
|
+
type GridAxis,
|
|
9
|
+
type GridCell as GridCellType,
|
|
10
10
|
gridStyleToString,
|
|
11
11
|
} from "../core/index.js";
|
|
12
12
|
import GridCell from "./GridCell.svelte";
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
state: GridRowState;
|
|
16
|
-
children: Snippet<[row: R, col: C, cell: Readonly<
|
|
16
|
+
children: Snippet<[row: R, col: C, cell: Readonly<GridCellType>]>;
|
|
17
17
|
row: R;
|
|
18
|
-
cols:
|
|
18
|
+
cols: GridAxis<C>;
|
|
19
19
|
resizer: GridDriver["$observeItem"];
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
getAxisLength,
|
|
6
6
|
type GridDriver,
|
|
7
7
|
type GridRowGroupState,
|
|
8
|
-
type
|
|
9
|
-
type
|
|
8
|
+
type GridAxis,
|
|
9
|
+
type GridCell,
|
|
10
10
|
gridStyleToString,
|
|
11
11
|
} from "../core/index.js";
|
|
12
12
|
import GridRow from "./GridRow.svelte";
|
|
13
13
|
|
|
14
14
|
interface Props {
|
|
15
15
|
state: GridRowGroupState;
|
|
16
|
-
children: Snippet<[row: R, col: C, cell: Readonly<
|
|
17
|
-
rows:
|
|
18
|
-
cols:
|
|
16
|
+
children: Snippet<[row: R, col: C, cell: Readonly<GridCell>]>;
|
|
17
|
+
rows: GridAxis<R>;
|
|
18
|
+
cols: GridAxis<C>;
|
|
19
19
|
resizer: GridDriver["$observeItem"];
|
|
20
20
|
}
|
|
21
21
|
|
package/lib/svelte/VGrid.svelte
CHANGED
|
@@ -84,10 +84,26 @@
|
|
|
84
84
|
|
|
85
85
|
// The sizes read from the items are tracked, so the items mutated in place are followed.
|
|
86
86
|
$effect.pre(() => {
|
|
87
|
-
updateGridAxis(
|
|
87
|
+
updateGridAxis(
|
|
88
|
+
rowStore,
|
|
89
|
+
rowLayout,
|
|
90
|
+
rows,
|
|
91
|
+
rowHeight,
|
|
92
|
+
headerRows,
|
|
93
|
+
footerRows,
|
|
94
|
+
true,
|
|
95
|
+
);
|
|
88
96
|
});
|
|
89
97
|
$effect.pre(() => {
|
|
90
|
-
updateGridAxis(
|
|
98
|
+
updateGridAxis(
|
|
99
|
+
colStore,
|
|
100
|
+
colLayout,
|
|
101
|
+
cols,
|
|
102
|
+
colWidth,
|
|
103
|
+
headerCols,
|
|
104
|
+
footerCols,
|
|
105
|
+
true,
|
|
106
|
+
);
|
|
91
107
|
});
|
|
92
108
|
let rowCount = $derived(stateVersion && rowStore.$getItemsLength());
|
|
93
109
|
let colCount = $derived(stateVersion && colStore.$getItemsLength());
|
|
@@ -98,11 +114,7 @@
|
|
|
98
114
|
colLayout,
|
|
99
115
|
rowStore.$getRange(bufferSize),
|
|
100
116
|
colStore.$getRange(bufferSize),
|
|
101
|
-
headerRows,
|
|
102
117
|
sectionRows,
|
|
103
|
-
footerRows,
|
|
104
|
-
headerCols,
|
|
105
|
-
footerCols,
|
|
106
118
|
spans,
|
|
107
119
|
keepMounted,
|
|
108
120
|
ariaSort,
|
|
@@ -155,11 +167,9 @@
|
|
|
155
167
|
driver,
|
|
156
168
|
rowStore,
|
|
157
169
|
colStore,
|
|
158
|
-
|
|
170
|
+
rowLayout,
|
|
171
|
+
colLayout,
|
|
159
172
|
sectionRows,
|
|
160
|
-
footerRows,
|
|
161
|
-
headerCols,
|
|
162
|
-
footerCols,
|
|
163
173
|
opts,
|
|
164
174
|
);
|
|
165
175
|
export const scrollTo: VGridHandle["scrollTo"] = ({ vertical, horizontal }) =>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Snippet } from 'svelte';
|
|
2
|
-
import {
|
|
2
|
+
import { GridScrollToIndexOpts, GridAxis, GridCell, GridSize, GridSpan } from '../core/index.js';
|
|
3
3
|
import { ViewportComponentAttributes } from './types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Props of {@link VGrid}.
|
|
@@ -11,23 +11,23 @@ export interface VGridProps<R = number, C = number> extends Omit<ViewportCompone
|
|
|
11
11
|
* @param col the item of {@link VGridProps.cols} at the column of the cell, or the column index if {@link VGridProps.cols} is a number
|
|
12
12
|
* @param cell the row index and the column index of the cell
|
|
13
13
|
*/
|
|
14
|
-
children: Snippet<[row: R, col: C, cell: Readonly<
|
|
14
|
+
children: Snippet<[row: R, col: C, cell: Readonly<GridCell>]>;
|
|
15
15
|
/**
|
|
16
|
-
* The rows of the grid. See {@link
|
|
16
|
+
* The rows of the grid. See {@link GridAxis} for the accepted values.
|
|
17
17
|
*/
|
|
18
|
-
rows:
|
|
18
|
+
rows: GridAxis<R>;
|
|
19
19
|
/**
|
|
20
|
-
* The columns of the grid. See {@link
|
|
20
|
+
* The columns of the grid. See {@link GridAxis} for the accepted values.
|
|
21
21
|
*/
|
|
22
|
-
cols:
|
|
22
|
+
cols: GridAxis<C>;
|
|
23
23
|
/**
|
|
24
|
-
* The heights of the rows. See {@link
|
|
24
|
+
* The heights of the rows. See {@link GridSize} for the accepted values.
|
|
25
25
|
*/
|
|
26
|
-
rowHeight:
|
|
26
|
+
rowHeight: GridSize<R>;
|
|
27
27
|
/**
|
|
28
|
-
* The widths of the columns. See {@link
|
|
28
|
+
* The widths of the columns. See {@link GridSize} for the accepted values.
|
|
29
29
|
*/
|
|
30
|
-
colWidth:
|
|
30
|
+
colWidth: GridSize<C>;
|
|
31
31
|
/**
|
|
32
32
|
* The number of the leading rows pinned to the start, which are the column headers (`role="columnheader"`).
|
|
33
33
|
*
|
|
@@ -63,15 +63,15 @@ export interface VGridProps<R = number, C = number> extends Omit<ViewportCompone
|
|
|
63
63
|
*/
|
|
64
64
|
footerCols?: number;
|
|
65
65
|
/**
|
|
66
|
-
* Cells merged over multiple rows and/or columns. See {@link
|
|
66
|
+
* Cells merged over multiple rows and/or columns. See {@link GridSpan} for the accepted values.
|
|
67
67
|
*
|
|
68
68
|
* 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.
|
|
69
69
|
*/
|
|
70
|
-
spans?: readonly
|
|
70
|
+
spans?: readonly GridSpan[];
|
|
71
71
|
/**
|
|
72
72
|
* List of cells that should be always mounted, even when off screen.
|
|
73
73
|
*/
|
|
74
|
-
keepMounted?: readonly
|
|
74
|
+
keepMounted?: readonly GridCell[];
|
|
75
75
|
/**
|
|
76
76
|
* 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.
|
|
77
77
|
* @defaultValue 200
|
|
@@ -85,7 +85,7 @@ export interface VGridProps<R = number, C = number> extends Omit<ViewportCompone
|
|
|
85
85
|
/**
|
|
86
86
|
* The header cell of the sorted column or row, and the sort order (`aria-sort`).
|
|
87
87
|
*/
|
|
88
|
-
ariaSort?:
|
|
88
|
+
ariaSort?: GridCell & {
|
|
89
89
|
order: "ascending" | "descending" | "other";
|
|
90
90
|
};
|
|
91
91
|
/**
|
|
@@ -163,9 +163,9 @@ export interface VGridHandle {
|
|
|
163
163
|
getColSize(index: number): number;
|
|
164
164
|
/**
|
|
165
165
|
* Scroll to the cell specified by the indexes. The cell is not hidden behind the rows and the columns sticking over it.
|
|
166
|
-
* @param opts the indexes of the cell and the options. See {@link
|
|
166
|
+
* @param opts the indexes of the cell and the options. See {@link GridScrollToIndexOpts}.
|
|
167
167
|
*/
|
|
168
|
-
scrollToIndex(opts:
|
|
168
|
+
scrollToIndex(opts: GridScrollToIndexOpts): void;
|
|
169
169
|
/**
|
|
170
170
|
* Scroll to the given offsets from the top/start of the scroll container.
|
|
171
171
|
* @param offset the offsets. The axis whose offset is omitted is not scrolled.
|
package/lib/svelte/index.d.ts
CHANGED
|
@@ -9,4 +9,4 @@ export { default as WindowVirtualizer } from './WindowVirtualizer.svelte';
|
|
|
9
9
|
export type { WindowVirtualizerProps, WindowVirtualizerHandle, } from './WindowVirtualizer.type.js';
|
|
10
10
|
export { default as VGrid } from './VGrid.svelte';
|
|
11
11
|
export type { VGridProps, VGridHandle } from './VGrid.type.js';
|
|
12
|
-
export type {
|
|
12
|
+
export type { GridSize, GridSpan } from '../core/index.js';
|
package/lib/vue/VGrid.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { VNode, PublicProps } from 'vue';
|
|
2
|
-
import {
|
|
2
|
+
import { GridScrollToIndexOpts, GridAxis, GridCell as GridCellType, GridSize, GridSpan } from '../core/index.js';
|
|
3
3
|
/**
|
|
4
4
|
* Props of {@link VGrid}.
|
|
5
5
|
*/
|
|
6
6
|
export interface VGridProps<R = number, C = number> extends PublicProps {
|
|
7
7
|
/**
|
|
8
|
-
* The rows of the grid. See {@link
|
|
8
|
+
* The rows of the grid. See {@link GridAxis} for the accepted values.
|
|
9
9
|
*/
|
|
10
|
-
rows:
|
|
10
|
+
rows: GridAxis<R>;
|
|
11
11
|
/**
|
|
12
|
-
* The columns of the grid. See {@link
|
|
12
|
+
* The columns of the grid. See {@link GridAxis} for the accepted values.
|
|
13
13
|
*/
|
|
14
|
-
cols:
|
|
14
|
+
cols: GridAxis<C>;
|
|
15
15
|
/**
|
|
16
|
-
* The heights of the rows. See {@link
|
|
16
|
+
* The heights of the rows. See {@link GridSize} for the accepted values.
|
|
17
17
|
*/
|
|
18
|
-
rowHeight:
|
|
18
|
+
rowHeight: GridSize<R>;
|
|
19
19
|
/**
|
|
20
|
-
* The widths of the columns. See {@link
|
|
20
|
+
* The widths of the columns. See {@link GridSize} for the accepted values.
|
|
21
21
|
*/
|
|
22
|
-
colWidth:
|
|
22
|
+
colWidth: GridSize<C>;
|
|
23
23
|
/**
|
|
24
24
|
* The number of the leading rows pinned to the start, which are the column headers (`role="columnheader"`).
|
|
25
25
|
*
|
|
@@ -55,15 +55,15 @@ export interface VGridProps<R = number, C = number> extends PublicProps {
|
|
|
55
55
|
*/
|
|
56
56
|
footerCols?: number;
|
|
57
57
|
/**
|
|
58
|
-
* Cells merged over multiple rows and/or columns. See {@link
|
|
58
|
+
* Cells merged over multiple rows and/or columns. See {@link GridSpan} for the accepted values.
|
|
59
59
|
*
|
|
60
60
|
* 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.
|
|
61
61
|
*/
|
|
62
|
-
spans?: readonly
|
|
62
|
+
spans?: readonly GridSpan[];
|
|
63
63
|
/**
|
|
64
64
|
* List of cells that should be always mounted, even when off screen.
|
|
65
65
|
*/
|
|
66
|
-
keepMounted?: readonly
|
|
66
|
+
keepMounted?: readonly GridCellType[];
|
|
67
67
|
/**
|
|
68
68
|
* 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.
|
|
69
69
|
* @defaultValue 200
|
|
@@ -77,7 +77,7 @@ export interface VGridProps<R = number, C = number> extends PublicProps {
|
|
|
77
77
|
/**
|
|
78
78
|
* The header cell of the sorted column or row, and the sort order (`aria-sort`).
|
|
79
79
|
*/
|
|
80
|
-
ariaSort?:
|
|
80
|
+
ariaSort?: GridCellType & {
|
|
81
81
|
order: "ascending" | "descending" | "other";
|
|
82
82
|
};
|
|
83
83
|
/**
|
|
@@ -155,9 +155,9 @@ export interface VGridHandle {
|
|
|
155
155
|
getColSize(index: number): number;
|
|
156
156
|
/**
|
|
157
157
|
* Scroll to the cell specified by the indexes. The cell is not hidden behind the rows and the columns sticking over it.
|
|
158
|
-
* @param opts the indexes of the cell and the options. See {@link
|
|
158
|
+
* @param opts the indexes of the cell and the options. See {@link GridScrollToIndexOpts}.
|
|
159
159
|
*/
|
|
160
|
-
scrollToIndex(opts:
|
|
160
|
+
scrollToIndex(opts: GridScrollToIndexOpts): void;
|
|
161
161
|
/**
|
|
162
162
|
* Scroll to the given offsets from the top/start of the scroll container.
|
|
163
163
|
* @param offset the offsets. The axis whose offset is omitted is not scrolled.
|
|
@@ -181,7 +181,7 @@ interface VGridInstance<R = number, C = number> extends VGridHandle {
|
|
|
181
181
|
default: (arg: {
|
|
182
182
|
row: R;
|
|
183
183
|
col: C;
|
|
184
|
-
cell: Readonly<
|
|
184
|
+
cell: Readonly<GridCellType>;
|
|
185
185
|
}) => VNode[];
|
|
186
186
|
};
|
|
187
187
|
}
|