@lensui/lens-table 0.1.70 → 0.1.72

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
@@ -2907,7 +2907,7 @@ function TableInner({
2907
2907
  horizontalTrack.style.display = "block";
2908
2908
  horizontalTrack.style.left = `${trackLeft}px`;
2909
2909
  horizontalTrack.style.right = `${trackRight}px`;
2910
- horizontalTrack.style.bottom = `${bottomSummaryHeight + 2}px`;
2910
+ horizontalTrack.style.bottom = `${bottomSummaryHeight}px`;
2911
2911
  horizontalThumb.style.width = `${Math.min(trackWidth, thumbWidth)}px`;
2912
2912
  horizontalThumb.style.transform = `translateX(${thumbLeft}px)`;
2913
2913
  }, [autoHeight, bodyTop, bottomSummaryHeight, effectiveHeight, fixedHeader, fixedWidth, realContentHeight, renderHeight, rightFixedWidth, viewport.width]);
@@ -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
@@ -2877,7 +2877,7 @@ function TableInner({
2877
2877
  horizontalTrack.style.display = "block";
2878
2878
  horizontalTrack.style.left = `${trackLeft}px`;
2879
2879
  horizontalTrack.style.right = `${trackRight}px`;
2880
- horizontalTrack.style.bottom = `${bottomSummaryHeight + 2}px`;
2880
+ horizontalTrack.style.bottom = `${bottomSummaryHeight}px`;
2881
2881
  horizontalThumb.style.width = `${Math.min(trackWidth, thumbWidth)}px`;
2882
2882
  horizontalThumb.style.transform = `translateX(${thumbLeft}px)`;
2883
2883
  }, [autoHeight, bodyTop, bottomSummaryHeight, effectiveHeight, fixedHeader, fixedWidth, realContentHeight, renderHeight, rightFixedWidth, viewport.width]);
@@ -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.72",
4
4
  "description": "A lightweight, canvas-rendered React table component for LensUI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",