@lensui/lens-table 0.1.70 → 0.1.71

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/dist/index.cjs CHANGED
@@ -2874,7 +2874,7 @@ function TableInner({
2874
2874
  verticalTrack.style.display = "none";
2875
2875
  } else {
2876
2876
  const top = fixedHeader ? bodyTop : 0;
2877
- const bottom = bottomSummaryHeight;
2877
+ const bottom = bottomSummaryHeight + 2;
2878
2878
  const trackHeight = Math.max(0, effectiveHeight - top - bottom);
2879
2879
  if (trackHeight <= 0) {
2880
2880
  verticalTrack.style.display = "none";
@@ -3769,6 +3769,9 @@ function TableInner({
3769
3769
  const metric = metrics[editing.columnIndex];
3770
3770
  const column = columns[editing.columnIndex];
3771
3771
  if (!metric || !column) return void 0;
3772
+ const row = rows[editing.rowIndex];
3773
+ const cellValue = column.dataIndex === void 0 ? void 0 : row?.[column.dataIndex];
3774
+ const backgroundColor = row ? column.cellStyle?.(cellValue, row, editing.rowIndex).backgroundColor ?? rowStyle?.(row, editing.rowIndex).backgroundColor : void 0;
3772
3775
  const fixedSide = column.fixed;
3773
3776
  const span = getCellSpan(editing.rowIndex, editing.columnIndex);
3774
3777
  const cellWidth = getCellDisplayWidth(editing.columnIndex, span?.colSpan ?? 1);
@@ -3787,7 +3790,8 @@ function TableInner({
3787
3790
  left: visibleLeft,
3788
3791
  top: visibleTop,
3789
3792
  width: Math.max(0, visibleRight - visibleLeft),
3790
- height: Math.max(0, visibleBottom - visibleTop)
3793
+ height: Math.max(0, visibleBottom - visibleTop),
3794
+ backgroundColor
3791
3795
  };
3792
3796
  }
3793
3797
  return {
@@ -3796,9 +3800,10 @@ function TableInner({
3796
3800
  width: cellWidth,
3797
3801
  height: cellHeight,
3798
3802
  textAlign: column.align ?? "left",
3803
+ backgroundColor,
3799
3804
  clipPath: `inset(${Math.max(0, visibleTop - cellTop)}px ${Math.max(0, cellLeft + cellWidth - visibleRight)}px ${Math.max(0, cellTop + cellHeight - visibleBottom)}px ${Math.max(0, visibleLeft - cellLeft)}px)`
3800
3805
  };
3801
- }, [bodyTop, columns, editing, fixedHeader, fixedWidth, getCellDisplayWidth, getCellSpan, getScrollableColumnLeft, leftFixedOffsets, metrics, renderHeight, rightFixedOffsets, rightFixedWidth, rowHeight, viewport.width]);
3806
+ }, [bodyTop, columns, editing, fixedHeader, fixedWidth, getCellDisplayWidth, getCellSpan, getScrollableColumnLeft, leftFixedOffsets, metrics, renderHeight, rightFixedOffsets, rightFixedWidth, rowHeight, rows, rowStyle, viewport.width]);
3802
3807
  const handleColumnPointerDown = (0, import_react8.useCallback)((event) => {
3803
3808
  const rect = event.currentTarget.getBoundingClientRect();
3804
3809
  const localY = event.clientY - rect.top;
package/dist/index.js CHANGED
@@ -2844,7 +2844,7 @@ function TableInner({
2844
2844
  verticalTrack.style.display = "none";
2845
2845
  } else {
2846
2846
  const top = fixedHeader ? bodyTop : 0;
2847
- const bottom = bottomSummaryHeight;
2847
+ const bottom = bottomSummaryHeight + 2;
2848
2848
  const trackHeight = Math.max(0, effectiveHeight - top - bottom);
2849
2849
  if (trackHeight <= 0) {
2850
2850
  verticalTrack.style.display = "none";
@@ -3739,6 +3739,9 @@ function TableInner({
3739
3739
  const metric = metrics[editing.columnIndex];
3740
3740
  const column = columns[editing.columnIndex];
3741
3741
  if (!metric || !column) return void 0;
3742
+ const row = rows[editing.rowIndex];
3743
+ const cellValue = column.dataIndex === void 0 ? void 0 : row?.[column.dataIndex];
3744
+ const backgroundColor = row ? column.cellStyle?.(cellValue, row, editing.rowIndex).backgroundColor ?? rowStyle?.(row, editing.rowIndex).backgroundColor : void 0;
3742
3745
  const fixedSide = column.fixed;
3743
3746
  const span = getCellSpan(editing.rowIndex, editing.columnIndex);
3744
3747
  const cellWidth = getCellDisplayWidth(editing.columnIndex, span?.colSpan ?? 1);
@@ -3757,7 +3760,8 @@ function TableInner({
3757
3760
  left: visibleLeft,
3758
3761
  top: visibleTop,
3759
3762
  width: Math.max(0, visibleRight - visibleLeft),
3760
- height: Math.max(0, visibleBottom - visibleTop)
3763
+ height: Math.max(0, visibleBottom - visibleTop),
3764
+ backgroundColor
3761
3765
  };
3762
3766
  }
3763
3767
  return {
@@ -3766,9 +3770,10 @@ function TableInner({
3766
3770
  width: cellWidth,
3767
3771
  height: cellHeight,
3768
3772
  textAlign: column.align ?? "left",
3773
+ backgroundColor,
3769
3774
  clipPath: `inset(${Math.max(0, visibleTop - cellTop)}px ${Math.max(0, cellLeft + cellWidth - visibleRight)}px ${Math.max(0, cellTop + cellHeight - visibleBottom)}px ${Math.max(0, visibleLeft - cellLeft)}px)`
3770
3775
  };
3771
- }, [bodyTop, columns, editing, fixedHeader, fixedWidth, getCellDisplayWidth, getCellSpan, getScrollableColumnLeft, leftFixedOffsets, metrics, renderHeight, rightFixedOffsets, rightFixedWidth, rowHeight, viewport.width]);
3776
+ }, [bodyTop, columns, editing, fixedHeader, fixedWidth, getCellDisplayWidth, getCellSpan, getScrollableColumnLeft, leftFixedOffsets, metrics, renderHeight, rightFixedOffsets, rightFixedWidth, rowHeight, rows, rowStyle, viewport.width]);
3772
3777
  const handleColumnPointerDown = useCallback2((event) => {
3773
3778
  const rect = event.currentTarget.getBoundingClientRect();
3774
3779
  const localY = event.clientY - rect.top;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensui/lens-table",
3
- "version": "0.1.70",
3
+ "version": "0.1.71",
4
4
  "description": "A lightweight, canvas-rendered React table component for LensUI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",