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
package/lib/angular/VGrid.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OnInit, TemplateRef } from "@angular/core";
|
|
2
|
-
import { type GridCellState, type GridRowGroupState, type GridRowState, type
|
|
2
|
+
import { type GridCellState, type GridRowGroupState, type GridRowState, type GridScrollToIndexOpts, type GridAxis, type GridCell as GridCellType, type GridSize, type GridSpan } from "../core/index.js";
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
/**
|
|
5
5
|
* Methods of {@link VGrid}.
|
|
@@ -61,9 +61,9 @@ export interface VGridHandle {
|
|
|
61
61
|
getColSize(index: number): number;
|
|
62
62
|
/**
|
|
63
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
|
|
64
|
+
* @param opts the indexes of the cell and the options. See {@link GridScrollToIndexOpts}.
|
|
65
65
|
*/
|
|
66
|
-
scrollToIndex(opts:
|
|
66
|
+
scrollToIndex(opts: GridScrollToIndexOpts): void;
|
|
67
67
|
/**
|
|
68
68
|
* Scroll to the given offsets from the top/start of the scroll container.
|
|
69
69
|
* @param offset the offsets. The axis whose offset is omitted is not scrolled.
|
|
@@ -100,7 +100,7 @@ export type CellContext<R = number, C = number> = {
|
|
|
100
100
|
/**
|
|
101
101
|
* The row index and the column index of the cell.
|
|
102
102
|
*/
|
|
103
|
-
cell: Readonly<
|
|
103
|
+
cell: Readonly<GridCellType>;
|
|
104
104
|
};
|
|
105
105
|
export declare class GridCell {
|
|
106
106
|
readonly state: import("@angular/core").InputSignal<GridCellState>;
|
|
@@ -113,7 +113,7 @@ export declare class GridRow<R, C> {
|
|
|
113
113
|
readonly state: import("@angular/core").InputSignal<GridRowState>;
|
|
114
114
|
readonly template: import("@angular/core").InputSignal<TemplateRef<CellContext<R, C>>>;
|
|
115
115
|
readonly row: import("@angular/core").InputSignal<R>;
|
|
116
|
-
readonly cols: import("@angular/core").InputSignal<
|
|
116
|
+
readonly cols: import("@angular/core").InputSignal<GridAxis<C>>;
|
|
117
117
|
readonly resizer: import("@angular/core").InputSignal<(el: HTMLElement, rowIndex: number | undefined, colIndex: number | undefined) => () => void>;
|
|
118
118
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridRow<any, any>, never>;
|
|
119
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>;
|
|
@@ -121,8 +121,8 @@ export declare class GridRow<R, C> {
|
|
|
121
121
|
export declare class GridRowGroup<R, C> {
|
|
122
122
|
readonly state: import("@angular/core").InputSignal<GridRowGroupState>;
|
|
123
123
|
readonly template: import("@angular/core").InputSignal<TemplateRef<CellContext<R, C>>>;
|
|
124
|
-
readonly rows: import("@angular/core").InputSignal<
|
|
125
|
-
readonly cols: import("@angular/core").InputSignal<
|
|
124
|
+
readonly rows: import("@angular/core").InputSignal<GridAxis<R>>;
|
|
125
|
+
readonly cols: import("@angular/core").InputSignal<GridAxis<C>>;
|
|
126
126
|
readonly resizer: import("@angular/core").InputSignal<(el: HTMLElement, rowIndex: number | undefined, colIndex: number | undefined) => () => void>;
|
|
127
127
|
static ɵfac: i0.ɵɵFactoryDeclaration<GridRowGroup<any, any>, never>;
|
|
128
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>;
|
|
@@ -134,21 +134,21 @@ export declare class GridRowGroup<R, C> {
|
|
|
134
134
|
*/
|
|
135
135
|
export declare class VGrid<R = number, C = number> implements OnInit, VGridHandle {
|
|
136
136
|
/**
|
|
137
|
-
* The rows of the grid. See {@link
|
|
137
|
+
* The rows of the grid. See {@link GridAxis} for the accepted values.
|
|
138
138
|
*/
|
|
139
|
-
readonly rows: import("@angular/core").InputSignal<
|
|
139
|
+
readonly rows: import("@angular/core").InputSignal<GridAxis<R>>;
|
|
140
140
|
/**
|
|
141
|
-
* The columns of the grid. See {@link
|
|
141
|
+
* The columns of the grid. See {@link GridAxis} for the accepted values.
|
|
142
142
|
*/
|
|
143
|
-
readonly cols: import("@angular/core").InputSignal<
|
|
143
|
+
readonly cols: import("@angular/core").InputSignal<GridAxis<C>>;
|
|
144
144
|
/**
|
|
145
|
-
* The heights of the rows. See {@link
|
|
145
|
+
* The heights of the rows. See {@link GridSize} for the accepted values.
|
|
146
146
|
*/
|
|
147
|
-
readonly rowHeight: import("@angular/core").InputSignal<
|
|
147
|
+
readonly rowHeight: import("@angular/core").InputSignal<GridSize<R>>;
|
|
148
148
|
/**
|
|
149
|
-
* The widths of the columns. See {@link
|
|
149
|
+
* The widths of the columns. See {@link GridSize} for the accepted values.
|
|
150
150
|
*/
|
|
151
|
-
readonly colWidth: import("@angular/core").InputSignal<
|
|
151
|
+
readonly colWidth: import("@angular/core").InputSignal<GridSize<C>>;
|
|
152
152
|
/**
|
|
153
153
|
* The number of the leading rows pinned to the start, which are the column headers (`role="columnheader"`).
|
|
154
154
|
*
|
|
@@ -184,15 +184,15 @@ export declare class VGrid<R = number, C = number> implements OnInit, VGridHandl
|
|
|
184
184
|
*/
|
|
185
185
|
readonly footerCols: import("@angular/core").InputSignal<number | undefined>;
|
|
186
186
|
/**
|
|
187
|
-
* Cells merged over multiple rows and/or columns. See {@link
|
|
187
|
+
* Cells merged over multiple rows and/or columns. See {@link GridSpan} for the accepted values.
|
|
188
188
|
*
|
|
189
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
190
|
*/
|
|
191
|
-
readonly spans: import("@angular/core").InputSignal<readonly
|
|
191
|
+
readonly spans: import("@angular/core").InputSignal<readonly GridSpan[] | undefined>;
|
|
192
192
|
/**
|
|
193
193
|
* List of cells that should be always mounted, even when off screen.
|
|
194
194
|
*/
|
|
195
|
-
readonly keepMounted: import("@angular/core").InputSignal<readonly
|
|
195
|
+
readonly keepMounted: import("@angular/core").InputSignal<readonly GridCellType[] | undefined>;
|
|
196
196
|
/**
|
|
197
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
198
|
* @defaultValue 200
|
|
@@ -206,7 +206,7 @@ export declare class VGrid<R = number, C = number> implements OnInit, VGridHandl
|
|
|
206
206
|
/**
|
|
207
207
|
* The header cell of the sorted column or row, and the sort order (`aria-sort`).
|
|
208
208
|
*/
|
|
209
|
-
readonly ariaSort: import("@angular/core").InputSignal<(
|
|
209
|
+
readonly ariaSort: import("@angular/core").InputSignal<(GridCellType & {
|
|
210
210
|
order: "ascending" | "descending" | "other";
|
|
211
211
|
}) | undefined>;
|
|
212
212
|
/**
|
|
@@ -235,7 +235,7 @@ export declare class VGrid<R = number, C = number> implements OnInit, VGridHandl
|
|
|
235
235
|
getColOffset(index: number): number;
|
|
236
236
|
getRowSize(index: number): number;
|
|
237
237
|
getColSize(index: number): number;
|
|
238
|
-
scrollToIndex(opts:
|
|
238
|
+
scrollToIndex(opts: GridScrollToIndexOpts): void;
|
|
239
239
|
scrollTo({ vertical, horizontal, }: {
|
|
240
240
|
vertical?: number;
|
|
241
241
|
horizontal?: number;
|
package/lib/angular/index.d.ts
CHANGED
|
@@ -5,4 +5,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
7
|
export { VGrid, type VGridHandle } from "./VGrid.js";
|
|
8
|
-
export type {
|
|
8
|
+
export type { GridSize, GridSpan } from "../core/index.js";
|
package/lib/angular/index.js
CHANGED
|
@@ -1556,49 +1556,51 @@ var pe = class t {
|
|
|
1556
1556
|
let P = 0, q = !e.$isMeasurable(i) && null, F = i + 1, k = !1;
|
|
1557
1557
|
for (let e = 0; e < E; e++) {
|
|
1558
1558
|
const r = _[e], o = r < g, l = r >= S, c = l || r >= w && r <= $, h = L.get(u + r);
|
|
1559
|
-
if (h ? h.rowIndex
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1559
|
+
if (h ? h.rowIndex === i && h.colIndex === r : n && c || s || a || o) {
|
|
1560
|
+
const n = h ? X(h, m) : i + 1, c = h ? Y(h, d) : r + 1, u = n - i > 1, f = c - r > 1, g = u || f, S = g ? n - i : void 0, y = g ? c - r : void 0;
|
|
1561
|
+
let v, w;
|
|
1562
|
+
F = N(F, n);
|
|
1563
|
+
const z = o ? t.$getItemOffset(r) : null, $ = l ? t.$getTotalSize() - t.$getItemOffset(c - 1) - t.$getItemSize(c - 1) : null;
|
|
1564
|
+
!1 !== q || u || (v = i, q = !0), !1 !== G[e] || f || (w = r, G[e] = !0);
|
|
1565
|
+
const R = s ? "columnheader" : r === x && (o || a) ? "rowheader" : "cell", C = "cell" !== R && p && p.rowIndex === i && p.colIndex === r ? p.order : void 0;
|
|
1566
|
+
let O;
|
|
1567
|
+
if (b) {
|
|
1568
|
+
for (;P < b.length && b[P].$col < r; ) P++;
|
|
1569
|
+
P < b.length && (O = b[P]);
|
|
1570
|
+
}
|
|
1571
|
+
if (!O || O.$col !== r || O.$rowSpan !== S || O.$colSpan !== y || O.$start !== z || O.$end !== $ || O.$measureRow !== v || O.$measureCol !== w || O.$role !== R || O.$sort !== C) {
|
|
1572
|
+
const e = {
|
|
1573
|
+
contain: "layout style",
|
|
1574
|
+
display: "grid",
|
|
1575
|
+
gridArea: g ? "1/l" + r + "/l" + n + "/l" + c : "1/l" + r
|
|
1576
|
+
};
|
|
1577
|
+
u && (e.height = "0px", e.minHeight = "100%", e.zIndex = 1), f && (e.width = "0px",
|
|
1578
|
+
e.minWidth = "100%"), (o || l) && (o ? e.insetInlineStart = z + "px" : e.insetInlineEnd = $ + "px",
|
|
1579
|
+
e.position = "sticky", e.zIndex = 2), O = {
|
|
1580
|
+
$col: r,
|
|
1581
|
+
$rowSpan: S,
|
|
1582
|
+
$colSpan: y,
|
|
1583
|
+
$measureRow: v,
|
|
1584
|
+
$measureCol: w,
|
|
1585
|
+
$role: R,
|
|
1586
|
+
$sort: C,
|
|
1587
|
+
$style: e,
|
|
1588
|
+
$start: z,
|
|
1589
|
+
$end: $
|
|
1590
|
+
}, k = !0;
|
|
1591
|
+
}
|
|
1592
|
+
I.push(O);
|
|
1591
1593
|
}
|
|
1592
|
-
I.push(W);
|
|
1593
1594
|
}
|
|
1594
|
-
if (W.push(q),
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1595
|
+
if (W.push(q), I.length) {
|
|
1596
|
+
const e = z && !k && z.$cells.length === I.length && z.$top === c ? z : {
|
|
1597
|
+
$row: i,
|
|
1598
|
+
$cells: I,
|
|
1599
|
+
$style: Z(i, F, c, "top", 3),
|
|
1600
|
+
$top: c
|
|
1601
|
+
};
|
|
1602
|
+
re.set(i, e), ie.push(e);
|
|
1603
|
+
}
|
|
1602
1604
|
}
|
|
1603
1605
|
return H.set(e, re), {
|
|
1604
1606
|
$rowTemplate: U(e, M, W, P(D), "max-content", m),
|