virtua 0.48.2 → 0.48.3
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 +2 -26
- package/lib/core/index.cjs +1 -1
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +1 -1
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +1 -1
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +1 -1
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +12 -13
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/Virtualizer.svelte +5 -5
- package/lib/svelte/WindowVirtualizer.svelte +1 -2
- package/lib/vue/index.cjs +1 -1
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +1 -1
- package/lib/vue/index.js.map +1 -1
- package/package.json +18 -18
package/lib/solid/index.jsx
CHANGED
|
@@ -807,7 +807,7 @@ const createScroller = (store, isHorizontal) => {
|
|
|
807
807
|
}
|
|
808
808
|
});
|
|
809
809
|
return {
|
|
810
|
-
$observe(viewport) {
|
|
810
|
+
$observe(_, viewport) {
|
|
811
811
|
viewportElement = viewport;
|
|
812
812
|
if (isHorizontal) {
|
|
813
813
|
isNegative = getComputedStyle(viewport).direction === "rtl";
|
|
@@ -1006,9 +1006,9 @@ const createGridScroller = (rowStore, colStore) => {
|
|
|
1006
1006
|
const rowScroller = createScroller(rowStore, false);
|
|
1007
1007
|
const colScroller = createScroller(colStore, true);
|
|
1008
1008
|
return {
|
|
1009
|
-
$observe(
|
|
1010
|
-
rowScroller.$observe(
|
|
1011
|
-
colScroller.$observe(
|
|
1009
|
+
$observe(container, viewport) {
|
|
1010
|
+
rowScroller.$observe(container, viewport);
|
|
1011
|
+
colScroller.$observe(container, viewport);
|
|
1012
1012
|
},
|
|
1013
1013
|
$dispose() {
|
|
1014
1014
|
rowScroller.$dispose();
|
|
@@ -1373,9 +1373,10 @@ const Virtualizer = (props) => {
|
|
|
1373
1373
|
scrollBy: scroller.$scrollBy,
|
|
1374
1374
|
});
|
|
1375
1375
|
}
|
|
1376
|
-
const
|
|
1376
|
+
const container = containerRef;
|
|
1377
|
+
const scrollable = props.scrollRef || container.parentElement;
|
|
1377
1378
|
resizer.$observeRoot(scrollable);
|
|
1378
|
-
scroller.$observe(scrollable);
|
|
1379
|
+
scroller.$observe(container, scrollable);
|
|
1379
1380
|
onCleanup(() => {
|
|
1380
1381
|
if (props.ref) {
|
|
1381
1382
|
props.ref();
|
|
@@ -1400,7 +1401,6 @@ const Virtualizer = (props) => {
|
|
|
1400
1401
|
store.$update(ACTION_ITEMS_LENGTH_CHANGE, [count, props.shift]);
|
|
1401
1402
|
}
|
|
1402
1403
|
});
|
|
1403
|
-
const pushKey = !horizontal && isNegative() ? "unshift" : "push";
|
|
1404
1404
|
const items = [];
|
|
1405
1405
|
const indexes = [];
|
|
1406
1406
|
if (props.keepMounted) {
|
|
@@ -1409,14 +1409,14 @@ const Virtualizer = (props) => {
|
|
|
1409
1409
|
mounted.add(i);
|
|
1410
1410
|
}
|
|
1411
1411
|
sort([...mounted]).forEach((index) => {
|
|
1412
|
-
items
|
|
1413
|
-
indexes
|
|
1412
|
+
items.push(props.data[index]);
|
|
1413
|
+
indexes.push(index);
|
|
1414
1414
|
});
|
|
1415
1415
|
}
|
|
1416
1416
|
else {
|
|
1417
1417
|
for (let [i, j] = range(); i <= j; i++) {
|
|
1418
|
-
items
|
|
1419
|
-
indexes
|
|
1418
|
+
items.push(props.data[i]);
|
|
1419
|
+
indexes.push(i);
|
|
1420
1420
|
}
|
|
1421
1421
|
}
|
|
1422
1422
|
return { _items: items, _indexes: indexes };
|
|
@@ -1565,10 +1565,9 @@ const WindowVirtualizer = (props) => {
|
|
|
1565
1565
|
store.$update(ACTION_ITEMS_LENGTH_CHANGE, [count, props.shift]);
|
|
1566
1566
|
}
|
|
1567
1567
|
});
|
|
1568
|
-
const pushKey = !horizontal && isNegative() ? "unshift" : "push";
|
|
1569
1568
|
const items = [];
|
|
1570
1569
|
for (let [i, j] = range(); i <= j; i++) {
|
|
1571
|
-
items
|
|
1570
|
+
items.push(props.data[i]);
|
|
1572
1571
|
}
|
|
1573
1572
|
return items;
|
|
1574
1573
|
});
|