virtua 0.52.2 → 0.52.4
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 +1 -1
- package/lib/angular/index.js +113 -124
- package/lib/angular/index.js.map +1 -1
- package/lib/core/index.cjs +112 -123
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.js +90 -101
- package/lib/core/index.js.map +1 -1
- package/lib/index.cjs +155 -166
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +167 -178
- package/lib/index.js.map +1 -1
- package/lib/solid/index.cjs +173 -184
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.js +181 -192
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +32 -53
- package/lib/solid/index.jsx.map +1 -1
- package/lib/vue/index.cjs +101 -112
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.js +101 -112
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
package/lib/solid/index.jsx
CHANGED
|
@@ -526,17 +526,7 @@ var updateGridAxis = (store, layout, axis, size, header, footer, mutable) => {
|
|
|
526
526
|
}
|
|
527
527
|
};
|
|
528
528
|
var rowStatesCache = /*#__PURE__*/ new WeakMap();
|
|
529
|
-
var
|
|
530
|
-
if (from < pinnedStart || max(from, start) < min(to, end + 1) || trailStart < to) {
|
|
531
|
-
return true;
|
|
532
|
-
}
|
|
533
|
-
for (const i of extras) {
|
|
534
|
-
if (i >= from && i < to) {
|
|
535
|
-
return true;
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
return false;
|
|
539
|
-
};
|
|
529
|
+
var hasVisibleTrack = (from, to, pinnedStart, start, end, trailStart) => from < pinnedStart || max(from, start) < min(to, end + 1) || trailStart < to;
|
|
540
530
|
var getSectionStarts = (sectionRows, pinnedStart, trailStart) => {
|
|
541
531
|
const starts = [];
|
|
542
532
|
for (const rowIndex of sectionRows) {
|
|
@@ -562,12 +552,6 @@ var getSectionIndex = (starts, rowIndex, trailStart) => {
|
|
|
562
552
|
}
|
|
563
553
|
return lo - 1;
|
|
564
554
|
};
|
|
565
|
-
var addSectionHeader = (extras, sectionStarts, rowIndex, trailStart) => {
|
|
566
|
-
const section = getSectionIndex(sectionStarts, rowIndex, trailStart);
|
|
567
|
-
if (section >= 0) {
|
|
568
|
-
extras.push(sectionStarts[section]);
|
|
569
|
-
}
|
|
570
|
-
};
|
|
571
555
|
var addExtras = (indexes, extras, e, bound, lastRendered) => {
|
|
572
556
|
const extrasLength = extras.length;
|
|
573
557
|
for (; e < extrasLength && extras[e] < bound; e++) {
|
|
@@ -652,42 +636,37 @@ var createGridPlan = (rowLayout, colLayout, rowRange, colRange, sectionRows = EM
|
|
|
652
636
|
extraCells.push(cell);
|
|
653
637
|
}
|
|
654
638
|
}
|
|
639
|
+
const keptLength = extraCells.length;
|
|
655
640
|
const sectionLength = sectionStarts.length;
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
641
|
+
const firstSection = getSectionIndex(sectionStarts, rowRangeStart, rowTrailStart);
|
|
642
|
+
const firstSectionStart = firstSection < 0 ? -1 : sectionStarts[firstSection];
|
|
643
|
+
if (firstSectionStart >= 0) {
|
|
644
|
+
extraRows.push(firstSectionStart);
|
|
659
645
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
const rowTo = getSpanRowEnd(span, totalRowCount);
|
|
674
|
-
const colTo = getSpanColEnd(span, totalColCount);
|
|
675
|
-
if (row < totalRowCount && col < totalColCount && (rowTo - row > 1 || colTo - col > 1)) {
|
|
676
|
-
const hasRenderedRow = hasTrackIn(extraRows, row, rowTo, rowPinnedStart, rowRangeStart, rowRangeEnd, rowTrailStart);
|
|
677
|
-
if (hasRenderedRow && hasTrackIn(extraCols, col, colTo, colPinnedStart, colRangeStart, colRangeEnd, colTrailStart)) {
|
|
678
|
-
extraCells.push(span);
|
|
679
|
-
} else if (hasRenderedRow) {
|
|
680
|
-
const section = getSectionIndex(sectionStarts, rowTo - 1, rowTrailStart);
|
|
681
|
-
if (row < rowPinnedStart || section >= 0 && sectionStarts[section] >= row) {
|
|
682
|
-
rest.push(span);
|
|
683
|
-
}
|
|
684
|
-
} else if (col < colPinnedStart) {
|
|
685
|
-
rest.push(span);
|
|
686
|
-
}
|
|
646
|
+
for (const span of spans) {
|
|
647
|
+
const row = span.rowIndex;
|
|
648
|
+
const col = span.colIndex;
|
|
649
|
+
const rowTo = getSpanRowEnd(span, totalRowCount);
|
|
650
|
+
const colTo = getSpanColEnd(span, totalColCount);
|
|
651
|
+
if (row < totalRowCount && col < totalColCount && (rowTo - row > 1 || colTo - col > 1)) {
|
|
652
|
+
let isLaid = (hasVisibleTrack(row, rowTo, rowPinnedStart, rowRangeStart, rowRangeEnd, rowTrailStart) || firstSectionStart >= row && firstSectionStart < rowTo) && hasVisibleTrack(col, colTo, colPinnedStart, colRangeStart, colRangeEnd, colTrailStart);
|
|
653
|
+
for (let k = 0; !isLaid && k < keptLength; k++) {
|
|
654
|
+
const { rowIndex, colIndex } = extraCells[k];
|
|
655
|
+
isLaid = rowIndex >= row && rowIndex < rowTo && colIndex >= col && colIndex < colTo;
|
|
656
|
+
}
|
|
657
|
+
if (isLaid) {
|
|
658
|
+
extraCells.push(span);
|
|
687
659
|
}
|
|
688
660
|
}
|
|
689
|
-
|
|
690
|
-
|
|
661
|
+
}
|
|
662
|
+
for (const { rowIndex, colIndex } of extraCells) {
|
|
663
|
+
const section = getSectionIndex(sectionStarts, rowIndex, rowTrailStart);
|
|
664
|
+
extraRows.push(rowIndex);
|
|
665
|
+
if (section >= 0) {
|
|
666
|
+
extraRows.push(sectionStarts[section]);
|
|
667
|
+
}
|
|
668
|
+
extraCols.push(colIndex);
|
|
669
|
+
}
|
|
691
670
|
sort(extraRows);
|
|
692
671
|
sort(extraCols);
|
|
693
672
|
const rows = getTrackIndexes(extraRows, totalRowCount, rowPinnedStart, rowRangeStart, rowRangeEnd, rowTrailStart);
|
|
@@ -723,7 +702,6 @@ var createGridPlan = (rowLayout, colLayout, rowRange, colRange, sectionRows = EM
|
|
|
723
702
|
for (const rowIndex of rows) {
|
|
724
703
|
const isRowPinnedStart = rowIndex < rowPinnedStart;
|
|
725
704
|
const isRowPinnedEnd = rowIndex >= rowTrailStart;
|
|
726
|
-
const isRowInRangeOrPinnedToEnd = isRowPinnedEnd || rowIndex >= rowRangeStart && rowIndex <= rowRangeEnd;
|
|
727
705
|
const section = getSectionIndex(sectionStarts, rowIndex, rowTrailStart);
|
|
728
706
|
const groupStart = isRowPinnedStart ? 0 : isRowPinnedEnd ? rowTrailStart : section < 0 ? -1 : sectionStarts[section];
|
|
729
707
|
if (rowIndex === groupStart) {
|
|
@@ -740,6 +718,7 @@ var createGridPlan = (rowLayout, colLayout, rowRange, colRange, sectionRows = EM
|
|
|
740
718
|
groupRows = groups;
|
|
741
719
|
}
|
|
742
720
|
const isSectionHeaderRow = section >= 0 && rowIndex === groupStart;
|
|
721
|
+
const isRowVisible = isRowPinnedStart || isRowPinnedEnd || rowIndex === firstSectionStart || rowIndex >= rowRangeStart && rowIndex <= rowRangeEnd;
|
|
743
722
|
const rowTop = isSectionHeaderRow ? sectionHeaderTop : null;
|
|
744
723
|
const rowKey = rowIndex * totalColCount;
|
|
745
724
|
const prevRow = prev && prev.get(rowIndex);
|
|
@@ -753,9 +732,9 @@ var createGridPlan = (rowLayout, colLayout, rowRange, colRange, sectionRows = EM
|
|
|
753
732
|
const colIndex = cols[i];
|
|
754
733
|
const isColPinnedStart = colIndex < colPinnedStart;
|
|
755
734
|
const isColPinnedEnd = colIndex >= colTrailStart;
|
|
756
|
-
const
|
|
735
|
+
const isColVisible = isColPinnedStart || isColPinnedEnd || colIndex >= colRangeStart && colIndex <= colRangeEnd;
|
|
757
736
|
const span = spanCells.get(rowKey + colIndex);
|
|
758
|
-
if (span ? span.rowIndex === rowIndex && span.colIndex === colIndex :
|
|
737
|
+
if (span ? span.rowIndex === rowIndex && span.colIndex === colIndex : isRowVisible && isColVisible) {
|
|
759
738
|
const rowTo = span ? getSpanRowEnd(span, totalRowCount) : rowIndex + 1;
|
|
760
739
|
const colTo = span ? getSpanColEnd(span, totalColCount) : colIndex + 1;
|
|
761
740
|
const rowSpan = rowTo - rowIndex;
|
|
@@ -1319,7 +1298,7 @@ var scrollGridAxisToIndex = (driver, store, layout, sections, index, align, isHo
|
|
|
1319
1298
|
const starts = getSectionStarts(sections, pinnedStart, trailStart);
|
|
1320
1299
|
const section = getSectionIndex(starts, index, trailStart);
|
|
1321
1300
|
const sectionHeader = section < 0 ? -1 : starts[section];
|
|
1322
|
-
const getInsetStart = () => layout.$getItemOffset(pinnedStart) + (sectionHeader < 0 || sectionHeader === index ? 0 :
|
|
1301
|
+
const getInsetStart = () => layout.$getItemOffset(pinnedStart) + (sectionHeader < 0 || sectionHeader === index ? 0 : layout.$getItemOffset(sectionHeader + 1) - layout.$getItemOffset(sectionHeader));
|
|
1323
1302
|
const getInsetEnd = () => layout.$getItemOffset(count) - layout.$getItemOffset(trailStart);
|
|
1324
1303
|
if (align === "nearest") {
|
|
1325
1304
|
if (index < pinnedStart || index >= trailStart) {
|