virtua 0.52.0 → 0.52.1
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 +43 -41
- package/lib/angular/index.js.map +1 -1
- package/lib/core/grid.d.ts +3 -3
- package/lib/core/index.cjs +135 -133
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +4 -4
- package/lib/core/index.js +43 -41
- 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 +43 -41
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +43 -41
- 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 +43 -41
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.d.ts +1 -1
- package/lib/solid/index.js +43 -41
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +75 -77
- 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.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 +43 -41
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.d.ts +1 -1
- package/lib/vue/index.js +43 -41
- 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
|
|
|
@@ -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
|
}
|
package/lib/vue/index.cjs
CHANGED
|
@@ -1050,49 +1050,51 @@ e.defineComponent)({
|
|
|
1050
1050
|
let g = 0, v = !e.P(o) && null, I = o + 1, k = !1;
|
|
1051
1051
|
for (let e = 0; e < J; e++) {
|
|
1052
1052
|
const s = X[e], i = s < y, c = s >= b, u = c || s >= E && s <= j, d = U.get(f + s);
|
|
1053
|
-
if (d ? d.rowIndex
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1053
|
+
if (d ? d.rowIndex === o && d.colIndex === s : l && u || r || a || i) {
|
|
1054
|
+
const l = d ? A(d, $) : o + 1, u = d ? M(d, h) : s + 1, f = l - o > 1, w = u - s > 1, S = f || w, y = S ? l - o : void 0, b = S ? u - s : void 0;
|
|
1055
|
+
let z, x;
|
|
1056
|
+
I = n(I, l);
|
|
1057
|
+
const O = i ? t.u(s) : null, R = c ? t.t() - t.u(u - 1) - t.p(u - 1) : null;
|
|
1058
|
+
!1 !== v || f || (z = o, v = !0), !1 !== Q[e] || w || (x = s, Q[e] = !0);
|
|
1059
|
+
const T = r ? "columnheader" : s === B && (i || a) ? "rowheader" : "cell", N = "cell" !== T && _ && _.rowIndex === o && _.colIndex === s ? _.order : void 0;
|
|
1060
|
+
let C;
|
|
1061
|
+
if (p) {
|
|
1062
|
+
for (;g < p.length && p[g].de < s; ) g++;
|
|
1063
|
+
g < p.length && (C = p[g]);
|
|
1064
|
+
}
|
|
1065
|
+
if (!C || C.de !== s || C.pe !== y || C.me !== b || C.ke !== O || C.Oe !== R || C.ae !== z || C.fe !== x || C.ge !== T || C._e !== N) {
|
|
1066
|
+
const e = {
|
|
1067
|
+
contain: "layout style",
|
|
1068
|
+
display: "grid",
|
|
1069
|
+
gridArea: S ? "1/l" + s + "/l" + l + "/l" + u : "1/l" + s
|
|
1070
|
+
};
|
|
1071
|
+
f && (e.height = "0px", e.minHeight = "100%", e.zIndex = 1), w && (e.width = "0px",
|
|
1072
|
+
e.minWidth = "100%"), (i || c) && (i ? e.insetInlineStart = O + "px" : e.insetInlineEnd = R + "px",
|
|
1073
|
+
e.position = "sticky", e.zIndex = 2), C = {
|
|
1074
|
+
de: s,
|
|
1075
|
+
pe: y,
|
|
1076
|
+
me: b,
|
|
1077
|
+
ae: z,
|
|
1078
|
+
fe: x,
|
|
1079
|
+
ge: T,
|
|
1080
|
+
_e: N,
|
|
1081
|
+
$e: e,
|
|
1082
|
+
ke: O,
|
|
1083
|
+
Oe: R
|
|
1084
|
+
}, k = !0;
|
|
1085
|
+
}
|
|
1086
|
+
m.push(C);
|
|
1085
1087
|
}
|
|
1086
|
-
m.push(W);
|
|
1087
1088
|
}
|
|
1088
|
-
if (Z.push(v),
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1089
|
+
if (Z.push(v), m.length) {
|
|
1090
|
+
const e = d && !k && d.be.length === m.length && d.Re === u ? d : {
|
|
1091
|
+
ye: o,
|
|
1092
|
+
be: m,
|
|
1093
|
+
$e: C(o, I, u, "top", 3),
|
|
1094
|
+
Re: u
|
|
1095
|
+
};
|
|
1096
|
+
ne.set(o, e), oe.push(e);
|
|
1097
|
+
}
|
|
1096
1098
|
}
|
|
1097
1099
|
return v.set(e, ne), {
|
|
1098
1100
|
Te: N(e, F, Z, c(G), "max-content", $),
|