@revolist/revogrid 3.5.0 → 3.5.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.
@@ -28,9 +28,13 @@ items, realCount, virtualSize, dimension) {
28
28
  toUpdate = recombineByOffset(Math.abs(changedOffsetStart), Object.assign(Object.assign({ positiveDirection: changedOffsetStart > -1 }, dimension), items));
29
29
  }
30
30
  }
31
+ // virtual size can differ based on scroll position if some big items are present
32
+ // scroll can be in the middle of item and virtual size will be larger
33
+ // so we need to exclude this part from virtual size hence it's already passed
34
+ const maxSizeVirtualSize = Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize);
31
35
  // if partial recombination add items if revo-viewport has some space left
32
36
  if (toUpdate) {
33
- const extra = addMissingItems(activeItem, realCount, virtualSize, toUpdate, dimension);
37
+ const extra = addMissingItems(activeItem, realCount, maxSizeVirtualSize, toUpdate, dimension);
34
38
  if (extra.length) {
35
39
  updateMissingAndRange(toUpdate.items, extra, toUpdate);
36
40
  }
@@ -41,10 +45,7 @@ items, realCount, virtualSize, dimension) {
41
45
  firstItemStart: activeItem.start,
42
46
  firstItemIndex: activeItem.itemIndex,
43
47
  origSize: dimension.originItemSize,
44
- // virtual size can differ based on scroll position if some big items are present
45
- // scroll can be in the middle of item and virtual size will be larger
46
- // so we need to exclude this part from virtual size hence it's already passed
47
- maxSize: Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize),
48
+ maxSize: maxSizeVirtualSize,
48
49
  maxCount: realCount,
49
50
  sizes: dimension.sizes,
50
51
  });
@@ -4524,9 +4524,13 @@ items, realCount, virtualSize, dimension) {
4524
4524
  toUpdate = recombineByOffset(Math.abs(changedOffsetStart), Object.assign(Object.assign({ positiveDirection: changedOffsetStart > -1 }, dimension), items));
4525
4525
  }
4526
4526
  }
4527
+ // virtual size can differ based on scroll position if some big items are present
4528
+ // scroll can be in the middle of item and virtual size will be larger
4529
+ // so we need to exclude this part from virtual size hence it's already passed
4530
+ const maxSizeVirtualSize = Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize);
4527
4531
  // if partial recombination add items if revo-viewport has some space left
4528
4532
  if (toUpdate) {
4529
- const extra = addMissingItems(activeItem, realCount, virtualSize, toUpdate, dimension);
4533
+ const extra = addMissingItems(activeItem, realCount, maxSizeVirtualSize, toUpdate, dimension);
4530
4534
  if (extra.length) {
4531
4535
  updateMissingAndRange(toUpdate.items, extra, toUpdate);
4532
4536
  }
@@ -4537,10 +4541,7 @@ items, realCount, virtualSize, dimension) {
4537
4541
  firstItemStart: activeItem.start,
4538
4542
  firstItemIndex: activeItem.itemIndex,
4539
4543
  origSize: dimension.originItemSize,
4540
- // virtual size can differ based on scroll position if some big items are present
4541
- // scroll can be in the middle of item and virtual size will be larger
4542
- // so we need to exclude this part from virtual size hence it's already passed
4543
- maxSize: Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize),
4544
+ maxSize: maxSizeVirtualSize,
4544
4545
  maxCount: realCount,
4545
4546
  sizes: dimension.sizes,
4546
4547
  });
@@ -21,9 +21,13 @@ items, realCount, virtualSize, dimension) {
21
21
  toUpdate = recombineByOffset(Math.abs(changedOffsetStart), Object.assign(Object.assign({ positiveDirection: changedOffsetStart > -1 }, dimension), items));
22
22
  }
23
23
  }
24
+ // virtual size can differ based on scroll position if some big items are present
25
+ // scroll can be in the middle of item and virtual size will be larger
26
+ // so we need to exclude this part from virtual size hence it's already passed
27
+ const maxSizeVirtualSize = Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize);
24
28
  // if partial recombination add items if revo-viewport has some space left
25
29
  if (toUpdate) {
26
- const extra = addMissingItems(activeItem, realCount, virtualSize, toUpdate, dimension);
30
+ const extra = addMissingItems(activeItem, realCount, maxSizeVirtualSize, toUpdate, dimension);
27
31
  if (extra.length) {
28
32
  updateMissingAndRange(toUpdate.items, extra, toUpdate);
29
33
  }
@@ -34,10 +38,7 @@ items, realCount, virtualSize, dimension) {
34
38
  firstItemStart: activeItem.start,
35
39
  firstItemIndex: activeItem.itemIndex,
36
40
  origSize: dimension.originItemSize,
37
- // virtual size can differ based on scroll position if some big items are present
38
- // scroll can be in the middle of item and virtual size will be larger
39
- // so we need to exclude this part from virtual size hence it's already passed
40
- maxSize: Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize),
41
+ maxSize: maxSizeVirtualSize,
41
42
  maxCount: realCount,
42
43
  sizes: dimension.sizes,
43
44
  });
@@ -4520,9 +4520,13 @@ items, realCount, virtualSize, dimension) {
4520
4520
  toUpdate = recombineByOffset(Math.abs(changedOffsetStart), Object.assign(Object.assign({ positiveDirection: changedOffsetStart > -1 }, dimension), items));
4521
4521
  }
4522
4522
  }
4523
+ // virtual size can differ based on scroll position if some big items are present
4524
+ // scroll can be in the middle of item and virtual size will be larger
4525
+ // so we need to exclude this part from virtual size hence it's already passed
4526
+ const maxSizeVirtualSize = Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize);
4523
4527
  // if partial recombination add items if revo-viewport has some space left
4524
4528
  if (toUpdate) {
4525
- const extra = addMissingItems(activeItem, realCount, virtualSize, toUpdate, dimension);
4529
+ const extra = addMissingItems(activeItem, realCount, maxSizeVirtualSize, toUpdate, dimension);
4526
4530
  if (extra.length) {
4527
4531
  updateMissingAndRange(toUpdate.items, extra, toUpdate);
4528
4532
  }
@@ -4533,10 +4537,7 @@ items, realCount, virtualSize, dimension) {
4533
4537
  firstItemStart: activeItem.start,
4534
4538
  firstItemIndex: activeItem.itemIndex,
4535
4539
  origSize: dimension.originItemSize,
4536
- // virtual size can differ based on scroll position if some big items are present
4537
- // scroll can be in the middle of item and virtual size will be larger
4538
- // so we need to exclude this part from virtual size hence it's already passed
4539
- maxSize: Math.min(virtualSize + (activeItem.end - activeItem.start), dimension.realSize),
4540
+ maxSize: maxSizeVirtualSize,
4540
4541
  maxCount: realCount,
4541
4542
  sizes: dimension.sizes,
4542
4543
  });