pace-table-lib 1.0.34 → 1.0.35
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.
|
@@ -17458,7 +17458,7 @@ function StaticTable({
|
|
|
17458
17458
|
newNonFixedColCellWidth,
|
|
17459
17459
|
fixedColWidth
|
|
17460
17460
|
} = useMemo(() => {
|
|
17461
|
-
let colCellH =
|
|
17461
|
+
let colCellH = Table2.RowHeight;
|
|
17462
17462
|
let rowCellH = Table2.RowHeight;
|
|
17463
17463
|
let nonFixColCellW = Table2.TableWidth;
|
|
17464
17464
|
let fixedColCellW = Table2.FixHeaderWidth;
|
|
@@ -17469,12 +17469,14 @@ function StaticTable({
|
|
|
17469
17469
|
rowCellH = newRowHeight;
|
|
17470
17470
|
}
|
|
17471
17471
|
if (isFitTableOn) {
|
|
17472
|
-
const
|
|
17473
|
-
const
|
|
17474
|
-
|
|
17475
|
-
|
|
17476
|
-
|
|
17477
|
-
|
|
17472
|
+
const baseColWidth = Math.floor(tableWidth / columnCount);
|
|
17473
|
+
const extraWidth = tableWidth - baseColWidth * columnCount;
|
|
17474
|
+
nonFixColCellW = baseColWidth;
|
|
17475
|
+
fixedColCellW = baseColWidth + extraWidth;
|
|
17476
|
+
const baseRowHeight = Math.floor(tableHeight / rowCount);
|
|
17477
|
+
const extraHeight = tableHeight - baseRowHeight * rowCount;
|
|
17478
|
+
rowCellH = baseRowHeight;
|
|
17479
|
+
colCellH = baseRowHeight + extraHeight;
|
|
17478
17480
|
}
|
|
17479
17481
|
return {
|
|
17480
17482
|
colCellHeight: Number(colCellH),
|
|
@@ -18398,7 +18400,7 @@ function StaticTable({
|
|
|
18398
18400
|
if (isFirstRow) {
|
|
18399
18401
|
if (isColHeaderVisible) {
|
|
18400
18402
|
style["--borderT"] = insideHBorder;
|
|
18401
|
-
} else if (!isColHeaderVisible && headerAtStart) {
|
|
18403
|
+
} else if (!isColHeaderVisible && headerAtStart && isColTotalOn) {
|
|
18402
18404
|
style["--borderT"] = insideHBorder;
|
|
18403
18405
|
} else {
|
|
18404
18406
|
style["--borderT"] = outsideBorder;
|
|
@@ -18445,13 +18447,27 @@ function StaticTable({
|
|
|
18445
18447
|
const dataAreaTop = fixedRowCount2 * cellHeight;
|
|
18446
18448
|
const finalBottom = dataAreaTop + finalTotalRows * cellHeight;
|
|
18447
18449
|
const isLastRow = Math.abs(cellBottom - finalBottom) < 1;
|
|
18450
|
+
let borderForTop = null;
|
|
18451
|
+
if (isColHeaderVisible) {
|
|
18452
|
+
if (isColTotalOn2 && headerAtStart) {
|
|
18453
|
+
borderForTop = null;
|
|
18454
|
+
} else {
|
|
18455
|
+
borderForTop = insideHBorder;
|
|
18456
|
+
}
|
|
18457
|
+
} else {
|
|
18458
|
+
if (isColTotalOn2 && headerAtStart) {
|
|
18459
|
+
borderForTop = insideHBorder;
|
|
18460
|
+
} else {
|
|
18461
|
+
borderForTop = outsideBorder;
|
|
18462
|
+
}
|
|
18463
|
+
}
|
|
18448
18464
|
const newStyle = {
|
|
18449
18465
|
...style,
|
|
18450
18466
|
// OUTER BORDER — always applied
|
|
18451
18467
|
["--borderL"]: isFirstCol ? outsideBorder : null,
|
|
18452
18468
|
["--borderR"]: insideVBorder,
|
|
18453
18469
|
["--borderB"]: isLastRow ? outsideBorder : insideHBorder,
|
|
18454
|
-
["--borderT"]: isFirstRow
|
|
18470
|
+
["--borderT"]: isFirstRow ? borderForTop : null
|
|
18455
18471
|
};
|
|
18456
18472
|
if (cell.isSparkLine) {
|
|
18457
18473
|
newStyle.borderLeft = INNER;
|
|
@@ -18474,18 +18490,16 @@ function StaticTable({
|
|
|
18474
18490
|
return count;
|
|
18475
18491
|
}
|
|
18476
18492
|
const visibleHeaderCols = computeVisibleHeaderCols();
|
|
18477
|
-
const lastHeaderColAbs =
|
|
18493
|
+
const lastHeaderColAbs = visibleHeaderCols - 1;
|
|
18478
18494
|
const lastHeaderRow = fixedRowCount2 - 1;
|
|
18479
|
-
const processed = headers.map((cell) => {
|
|
18495
|
+
const processed = headers.map((cell, cellIndex) => {
|
|
18480
18496
|
const style = { ...cell.style ?? cell };
|
|
18481
18497
|
const leftPx = style.left ?? 0;
|
|
18482
18498
|
const topPx = style.top ?? 0;
|
|
18483
|
-
const widthPx = style.width || cellWidth;
|
|
18484
18499
|
const heightPx = style.height || cellHeight;
|
|
18485
|
-
const colIndexAbs = Math.round(leftPx / cellWidth);
|
|
18486
|
-
const colSpan = Math.max(1, Math.round(widthPx / cellWidth));
|
|
18500
|
+
const colIndexAbs = Math.round((leftPx - fixedColCount2 * fixedColWidth) / cellWidth);
|
|
18487
18501
|
const isFirstCol = colIndexAbs === fixedColCount2;
|
|
18488
|
-
const isLastCol = colIndexAbs
|
|
18502
|
+
const isLastCol = colIndexAbs === lastHeaderColAbs;
|
|
18489
18503
|
const rowIndex = Math.round(topPx / cellHeight);
|
|
18490
18504
|
const rowSpan = Math.max(1, Math.round(heightPx / cellHeight));
|
|
18491
18505
|
const isFirstRow = rowIndex === 0;
|