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.
@@ -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(viewportElement) {
1010
- rowScroller.$observe(viewportElement);
1011
- colScroller.$observe(viewportElement);
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 scrollable = props.scrollRef || containerRef.parentElement;
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[pushKey](props.data[index]);
1413
- indexes[pushKey](index);
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[pushKey](props.data[i]);
1419
- indexes[pushKey](i);
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[pushKey](props.data[i]);
1570
+ items.push(props.data[i]);
1572
1571
  }
1573
1572
  return items;
1574
1573
  });