pace-table-lib 1.0.33 → 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.
@@ -17477,7 +17477,7 @@
17477
17477
  newNonFixedColCellWidth,
17478
17478
  fixedColWidth
17479
17479
  } = React.useMemo(() => {
17480
- let colCellH = 20;
17480
+ let colCellH = Table2.RowHeight;
17481
17481
  let rowCellH = Table2.RowHeight;
17482
17482
  let nonFixColCellW = Table2.TableWidth;
17483
17483
  let fixedColCellW = Table2.FixHeaderWidth;
@@ -17488,12 +17488,14 @@
17488
17488
  rowCellH = newRowHeight;
17489
17489
  }
17490
17490
  if (isFitTableOn) {
17491
- const sharedWidth = Math.floor(tableWidth / columnCount);
17492
- const sharedHeight = Math.floor(tableHeight / rowCount);
17493
- colCellH = sharedHeight;
17494
- rowCellH = sharedHeight;
17495
- nonFixColCellW = sharedWidth;
17496
- fixedColCellW = sharedWidth;
17491
+ const baseColWidth = Math.floor(tableWidth / columnCount);
17492
+ const extraWidth = tableWidth - baseColWidth * columnCount;
17493
+ nonFixColCellW = baseColWidth;
17494
+ fixedColCellW = baseColWidth + extraWidth;
17495
+ const baseRowHeight = Math.floor(tableHeight / rowCount);
17496
+ const extraHeight = tableHeight - baseRowHeight * rowCount;
17497
+ rowCellH = baseRowHeight;
17498
+ colCellH = baseRowHeight + extraHeight;
17497
17499
  }
17498
17500
  return {
17499
17501
  colCellHeight: Number(colCellH),
@@ -18417,7 +18419,7 @@
18417
18419
  if (isFirstRow) {
18418
18420
  if (isColHeaderVisible) {
18419
18421
  style["--borderT"] = insideHBorder;
18420
- } else if (!isColHeaderVisible && headerAtStart) {
18422
+ } else if (!isColHeaderVisible && headerAtStart && isColTotalOn) {
18421
18423
  style["--borderT"] = insideHBorder;
18422
18424
  } else {
18423
18425
  style["--borderT"] = outsideBorder;
@@ -18464,13 +18466,27 @@
18464
18466
  const dataAreaTop = fixedRowCount2 * cellHeight;
18465
18467
  const finalBottom = dataAreaTop + finalTotalRows * cellHeight;
18466
18468
  const isLastRow = Math.abs(cellBottom - finalBottom) < 1;
18469
+ let borderForTop = null;
18470
+ if (isColHeaderVisible) {
18471
+ if (isColTotalOn2 && headerAtStart) {
18472
+ borderForTop = null;
18473
+ } else {
18474
+ borderForTop = insideHBorder;
18475
+ }
18476
+ } else {
18477
+ if (isColTotalOn2 && headerAtStart) {
18478
+ borderForTop = insideHBorder;
18479
+ } else {
18480
+ borderForTop = outsideBorder;
18481
+ }
18482
+ }
18467
18483
  const newStyle = {
18468
18484
  ...style,
18469
18485
  // OUTER BORDER — always applied
18470
18486
  ["--borderL"]: isFirstCol ? outsideBorder : null,
18471
18487
  ["--borderR"]: insideVBorder,
18472
18488
  ["--borderB"]: isLastRow ? outsideBorder : insideHBorder,
18473
- ["--borderT"]: isFirstRow && !isColTotalOn2 && !headerAtStart ? insideHBorder : null
18489
+ ["--borderT"]: isFirstRow ? borderForTop : null
18474
18490
  };
18475
18491
  if (cell.isSparkLine) {
18476
18492
  newStyle.borderLeft = INNER;
@@ -18493,18 +18509,16 @@
18493
18509
  return count;
18494
18510
  }
18495
18511
  const visibleHeaderCols = computeVisibleHeaderCols();
18496
- const lastHeaderColAbs = fixedColCount2 + visibleHeaderCols - 1;
18512
+ const lastHeaderColAbs = visibleHeaderCols - 1;
18497
18513
  const lastHeaderRow = fixedRowCount2 - 1;
18498
- const processed = headers.map((cell) => {
18514
+ const processed = headers.map((cell, cellIndex) => {
18499
18515
  const style = { ...cell.style ?? cell };
18500
18516
  const leftPx = style.left ?? 0;
18501
18517
  const topPx = style.top ?? 0;
18502
- const widthPx = style.width || cellWidth;
18503
18518
  const heightPx = style.height || cellHeight;
18504
- const colIndexAbs = Math.round(leftPx / cellWidth);
18505
- const colSpan = Math.max(1, Math.round(widthPx / cellWidth));
18519
+ const colIndexAbs = Math.round((leftPx - fixedColCount2 * fixedColWidth) / cellWidth);
18506
18520
  const isFirstCol = colIndexAbs === fixedColCount2;
18507
- const isLastCol = colIndexAbs + colSpan - 1 === lastHeaderColAbs;
18521
+ const isLastCol = colIndexAbs === lastHeaderColAbs;
18508
18522
  const rowIndex = Math.round(topPx / cellHeight);
18509
18523
  const rowSpan = Math.max(1, Math.round(heightPx / cellHeight));
18510
18524
  const isFirstRow = rowIndex === 0;