virtua 0.53.0 → 0.53.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/VMasonry.d.ts +6 -1
- package/lib/angular/index.js +78 -60
- package/lib/angular/index.js.map +1 -1
- package/lib/index.cjs +48 -41
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +103 -96
- package/lib/index.js.map +1 -1
- package/lib/react/VMasonry.d.ts +4 -0
- package/lib/solid/VMasonry.d.ts +4 -0
- package/lib/solid/index.cjs +8 -2
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +8 -2
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +17 -3
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/VMasonry.svelte +19 -5
- package/lib/svelte/VMasonry.type.d.ts +4 -0
- package/lib/vue/VMasonry.d.ts +4 -0
- package/lib/vue/index.cjs +14 -7
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +14 -7
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
package/lib/react/VMasonry.d.ts
CHANGED
|
@@ -81,6 +81,10 @@ export interface VMasonryProps<T> extends ViewportComponentAttributes {
|
|
|
81
81
|
* @defaultValue 200
|
|
82
82
|
*/
|
|
83
83
|
bufferSize?: number;
|
|
84
|
+
/**
|
|
85
|
+
* List of indexes that should be always mounted, even when off screen.
|
|
86
|
+
*/
|
|
87
|
+
keepMounted?: readonly number[];
|
|
84
88
|
/**
|
|
85
89
|
* You can restore cache by passing a {@link CacheSnapshot} on mount. This is useful when you want to restore scroll position after navigation. The snapshot can be obtained from {@link VMasonryHandle.cache}.
|
|
86
90
|
*
|
package/lib/solid/VMasonry.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export interface VMasonryProps<T> extends ViewportComponentAttributes {
|
|
|
85
85
|
* @defaultValue 200
|
|
86
86
|
*/
|
|
87
87
|
bufferSize?: number;
|
|
88
|
+
/**
|
|
89
|
+
* List of indexes that should be always mounted, even when off screen.
|
|
90
|
+
*/
|
|
91
|
+
keepMounted?: readonly number[];
|
|
88
92
|
/**
|
|
89
93
|
* You can restore cache by passing a {@link CacheSnapshot} on mount. This is useful when you want to restore scroll position after navigation. The snapshot can be obtained from {@link VMasonryHandle.cache}.
|
|
90
94
|
*
|
package/lib/solid/index.cjs
CHANGED
|
@@ -1089,7 +1089,7 @@ exports.VGrid = r => {
|
|
|
1089
1089
|
var s;
|
|
1090
1090
|
}, exports.VMasonry = r => {
|
|
1091
1091
|
let n;
|
|
1092
|
-
const {itemSize: i, cache: l} = r, [, c] = (0, t.splitProps)(r, [ "ref", "data", "children", "lanes", "gap", "itemSize", "bufferSize", "cache", "onScroll", "onScrollEnd", "style" ]), a = ((e, t, r = 0, n, i) => {
|
|
1092
|
+
const {itemSize: i, cache: l} = r, [, c] = (0, t.splitProps)(r, [ "ref", "data", "children", "lanes", "gap", "itemSize", "bufferSize", "keepMounted", "cache", "onScroll", "onScrollEnd", "style" ]), a = ((e, t, r = 0, n, i) => {
|
|
1093
1093
|
let l = s(t, 1), c = l, a = r, f = i && i[1] || n || 40, g = -1, d = n ? void 0 : /* @__PURE__ */ new Set, h = !n;
|
|
1094
1094
|
const p = i && i[0], $ = p ? w(p.slice(0, o(e, p.length)), s(0, e - p.length)) : w([], e), v = [], m = [], x = [], y = e => {
|
|
1095
1095
|
const t = $[e];
|
|
@@ -1214,7 +1214,13 @@ exports.VGrid = r => {
|
|
|
1214
1214
|
e !== f.L() && f.A(5, [ e ]);
|
|
1215
1215
|
});
|
|
1216
1216
|
const n = [], o = [];
|
|
1217
|
-
|
|
1217
|
+
if (r.keepMounted) {
|
|
1218
|
+
const t = new Set(r.keepMounted);
|
|
1219
|
+
for (let [e, r] = p(); e <= r; e++) t.add(e);
|
|
1220
|
+
u([ ...t ]).forEach(t => {
|
|
1221
|
+
t < e && (n.push(r.data[t]), o.push(t));
|
|
1222
|
+
});
|
|
1223
|
+
} else for (let [e, t] = p(); e <= t; e++) n.push(r.data[e]), o.push(e);
|
|
1218
1224
|
return {
|
|
1219
1225
|
de: n,
|
|
1220
1226
|
he: o
|