virtua 0.52.0 → 0.52.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/VGrid.d.ts +20 -20
- package/lib/angular/index.d.ts +1 -1
- package/lib/angular/index.js +43 -41
- package/lib/angular/index.js.map +1 -1
- package/lib/core/grid.d.ts +3 -3
- package/lib/core/index.cjs +135 -133
- package/lib/core/index.cjs.map +1 -1
- package/lib/core/index.d.ts +4 -4
- package/lib/core/index.js +43 -41
- package/lib/core/index.js.map +1 -1
- package/lib/core/layouts/grid.d.ts +8 -6
- package/lib/core/scroll-to.d.ts +1 -1
- package/lib/index.cjs +43 -41
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +43 -41
- package/lib/index.js.map +1 -1
- package/lib/react/VGrid.d.ts +16 -16
- package/lib/react/index.d.ts +1 -1
- package/lib/solid/VGrid.d.ts +16 -16
- package/lib/solid/index.cjs +43 -41
- package/lib/solid/index.cjs.map +1 -1
- package/lib/solid/index.d.ts +1 -1
- package/lib/solid/index.js +43 -41
- package/lib/solid/index.js.map +1 -1
- package/lib/solid/index.jsx +75 -77
- package/lib/solid/index.jsx.map +1 -1
- package/lib/svelte/GridCell.svelte +2 -2
- package/lib/svelte/GridRow.svelte +4 -4
- package/lib/svelte/GridRowGroup.svelte +5 -5
- package/lib/svelte/VGrid.type.d.ts +16 -16
- package/lib/svelte/index.d.ts +1 -1
- package/lib/vue/VGrid.d.ts +16 -16
- package/lib/vue/index.cjs +43 -41
- package/lib/vue/index.cjs.map +1 -1
- package/lib/vue/index.d.ts +1 -1
- package/lib/vue/index.js +43 -41
- package/lib/vue/index.js.map +1 -1
- package/package.json +1 -1
package/lib/solid/index.jsx
CHANGED
|
@@ -743,92 +743,90 @@ var createGridPlan = (rowLayout, colLayout, rowRange, colRange, headerRows = 0,
|
|
|
743
743
|
const endPinned = colIndex >= colTrailStart;
|
|
744
744
|
const colInRangeOrPinnedToEnd = endPinned || colIndex >= colRangeStart && colIndex <= colRangeEnd;
|
|
745
745
|
const span = spanCells.get(rowKey + colIndex);
|
|
746
|
-
if (span ? span.rowIndex
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
measureRowIndex = rowIndex;
|
|
763
|
-
measuredRow = true;
|
|
764
|
-
}
|
|
765
|
-
if (measuredCols[i] === false && !spansCols) {
|
|
766
|
-
measureColIndex = colIndex;
|
|
767
|
-
measuredCols[i] = true;
|
|
768
|
-
}
|
|
769
|
-
const role = pinnedTop ? "columnheader" : colIndex === rowHeaderCol && (startPinned || isSectionHeaderRow) ? "rowheader" : "cell";
|
|
770
|
-
const sortOrder = role !== "cell" && sortedCell && sortedCell.rowIndex === rowIndex && sortedCell.colIndex === colIndex ? sortedCell.order : undefined;
|
|
771
|
-
let cell;
|
|
772
|
-
if (prevCells) {
|
|
773
|
-
while (p < prevCells.length && prevCells[p].$col < colIndex) {
|
|
774
|
-
p++;
|
|
746
|
+
if (span ? span.rowIndex === rowIndex && span.colIndex === colIndex : rowInRangeOrPinnedToEnd && colInRangeOrPinnedToEnd || pinnedTop || isSectionHeaderRow || startPinned) {
|
|
747
|
+
const rowTo = span ? getSpanRowEnd(span, rowCount) : rowIndex + 1;
|
|
748
|
+
const colTo = span ? getSpanColEnd(span, colCount) : colIndex + 1;
|
|
749
|
+
const spansRows = rowTo - rowIndex > 1;
|
|
750
|
+
const spansCols = colTo - colIndex > 1;
|
|
751
|
+
const spanning = spansRows || spansCols;
|
|
752
|
+
const rowSpan = spanning ? rowTo - rowIndex : undefined;
|
|
753
|
+
const colSpan = spanning ? colTo - colIndex : undefined;
|
|
754
|
+
let measureRowIndex;
|
|
755
|
+
let measureColIndex;
|
|
756
|
+
rowEnd = max(rowEnd, rowTo);
|
|
757
|
+
const stickyStart = startPinned ? colLayout.$getItemOffset(colIndex) : null;
|
|
758
|
+
const stickyEnd = endPinned ? colLayout.$getTotalSize() - colLayout.$getItemOffset(colTo - 1) - colLayout.$getItemSize(colTo - 1) : null;
|
|
759
|
+
if (measuredRow === false && !spansRows) {
|
|
760
|
+
measureRowIndex = rowIndex;
|
|
761
|
+
measuredRow = true;
|
|
775
762
|
}
|
|
776
|
-
if (
|
|
777
|
-
|
|
763
|
+
if (measuredCols[i] === false && !spansCols) {
|
|
764
|
+
measureColIndex = colIndex;
|
|
765
|
+
measuredCols[i] = true;
|
|
778
766
|
}
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
style["zIndex"] = 1;
|
|
790
|
-
}
|
|
791
|
-
if (spansCols) {
|
|
792
|
-
style["width"] = "0px";
|
|
793
|
-
style["minWidth"] = "100%";
|
|
767
|
+
const role = pinnedTop ? "columnheader" : colIndex === rowHeaderCol && (startPinned || isSectionHeaderRow) ? "rowheader" : "cell";
|
|
768
|
+
const sortOrder = role !== "cell" && sortedCell && sortedCell.rowIndex === rowIndex && sortedCell.colIndex === colIndex ? sortedCell.order : undefined;
|
|
769
|
+
let cell;
|
|
770
|
+
if (prevCells) {
|
|
771
|
+
while (p < prevCells.length && prevCells[p].$col < colIndex) {
|
|
772
|
+
p++;
|
|
773
|
+
}
|
|
774
|
+
if (p < prevCells.length) {
|
|
775
|
+
cell = prevCells[p];
|
|
776
|
+
}
|
|
794
777
|
}
|
|
795
|
-
if (
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
778
|
+
if (!cell || cell.$col !== colIndex || cell.$rowSpan !== rowSpan || cell.$colSpan !== colSpan || cell.$start !== stickyStart || cell.$end !== stickyEnd || cell.$measureRow !== measureRowIndex || cell.$measureCol !== measureColIndex || cell.$role !== role || cell.$sort !== sortOrder) {
|
|
779
|
+
const style = {
|
|
780
|
+
contain: "layout style",
|
|
781
|
+
display: "grid",
|
|
782
|
+
gridArea: spanning ? "1/l" + colIndex + "/l" + rowTo + "/l" + colTo : "1/l" + colIndex
|
|
783
|
+
};
|
|
784
|
+
if (spansRows) {
|
|
785
|
+
style["height"] = "0px";
|
|
786
|
+
style["minHeight"] = "100%";
|
|
787
|
+
style["zIndex"] = 1;
|
|
788
|
+
}
|
|
789
|
+
if (spansCols) {
|
|
790
|
+
style["width"] = "0px";
|
|
791
|
+
style["minWidth"] = "100%";
|
|
800
792
|
}
|
|
801
|
-
|
|
802
|
-
|
|
793
|
+
if (startPinned || endPinned) {
|
|
794
|
+
if (startPinned) {
|
|
795
|
+
style["insetInlineStart"] = stickyStart + "px";
|
|
796
|
+
} else {
|
|
797
|
+
style["insetInlineEnd"] = stickyEnd + "px";
|
|
798
|
+
}
|
|
799
|
+
style["position"] = "sticky";
|
|
800
|
+
style["zIndex"] = 2;
|
|
801
|
+
}
|
|
802
|
+
cell = {
|
|
803
|
+
$col: colIndex,
|
|
804
|
+
$rowSpan: rowSpan,
|
|
805
|
+
$colSpan: colSpan,
|
|
806
|
+
$measureRow: measureRowIndex,
|
|
807
|
+
$measureCol: measureColIndex,
|
|
808
|
+
$role: role,
|
|
809
|
+
$sort: sortOrder,
|
|
810
|
+
$style: style,
|
|
811
|
+
$start: stickyStart,
|
|
812
|
+
$end: stickyEnd
|
|
813
|
+
};
|
|
814
|
+
changed = true;
|
|
803
815
|
}
|
|
804
|
-
cell
|
|
805
|
-
$col: colIndex,
|
|
806
|
-
$rowSpan: rowSpan,
|
|
807
|
-
$colSpan: colSpan,
|
|
808
|
-
$measureRow: measureRowIndex,
|
|
809
|
-
$measureCol: measureColIndex,
|
|
810
|
-
$role: role,
|
|
811
|
-
$sort: sortOrder,
|
|
812
|
-
$style: style,
|
|
813
|
-
$start: stickyStart,
|
|
814
|
-
$end: stickyEnd
|
|
815
|
-
};
|
|
816
|
-
changed = true;
|
|
816
|
+
rowCells.push(cell);
|
|
817
817
|
}
|
|
818
|
-
rowCells.push(cell);
|
|
819
818
|
}
|
|
820
819
|
measuredRows.push(measuredRow);
|
|
821
|
-
if (
|
|
822
|
-
|
|
820
|
+
if (rowCells.length) {
|
|
821
|
+
const row = prevRow && !changed && prevRow.$cells.length === rowCells.length && prevRow.$top === rowTop ? prevRow : {
|
|
822
|
+
$row: rowIndex,
|
|
823
|
+
$cells: rowCells,
|
|
824
|
+
$style: getBoxStyle(rowIndex, rowEnd, rowTop, "top", 3),
|
|
825
|
+
$top: rowTop
|
|
826
|
+
};
|
|
827
|
+
rowStates.set(rowIndex, row);
|
|
828
|
+
groupRows.push(row);
|
|
823
829
|
}
|
|
824
|
-
const row = prevRow && !changed && prevRow.$cells.length === rowCells.length && prevRow.$top === rowTop ? prevRow : {
|
|
825
|
-
$row: rowIndex,
|
|
826
|
-
$cells: rowCells,
|
|
827
|
-
$style: getBoxStyle(rowIndex, rowEnd, rowTop, "top", 3),
|
|
828
|
-
$top: rowTop
|
|
829
|
-
};
|
|
830
|
-
rowStates.set(rowIndex, row);
|
|
831
|
-
groupRows.push(row);
|
|
832
830
|
}
|
|
833
831
|
rowStatesCache.set(rowLayout, rowStates);
|
|
834
832
|
return {
|