@bmsuisse/datagrid 0.37.0 → 0.37.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/dist/index.js CHANGED
@@ -3612,11 +3612,12 @@ function DataGrid({
3612
3612
  );
3613
3613
  function pinnedCellProps(column, area = "body") {
3614
3614
  const bg = area === "header" ? "bg-muted" : "bg-background";
3615
+ const bgOdd = area === "header" ? "bg-muted" : STRUCTURAL_ZEBRA_BG_CLASS;
3615
3616
  if (column.pinned === "left") {
3616
- return { className: `sticky z-10 ${bg}`, style: { left: leftPinnedOffsets.get(column.id), width: columnSize(column.id), minWidth: columnSize(column.id) } };
3617
+ return { className: `sticky z-10 ${bg}`, classNameOdd: `sticky z-10 ${bgOdd}`, style: { left: leftPinnedOffsets.get(column.id), width: columnSize(column.id), minWidth: columnSize(column.id) } };
3617
3618
  }
3618
3619
  if (column.pinned === "right") {
3619
- return { className: `sticky z-10 ${bg}`, style: { right: rightPinnedOffsets.get(column.id), width: columnSize(column.id), minWidth: columnSize(column.id) } };
3620
+ return { className: `sticky z-10 ${bg}`, classNameOdd: `sticky z-10 ${bgOdd}`, style: { right: rightPinnedOffsets.get(column.id), width: columnSize(column.id), minWidth: columnSize(column.id) } };
3620
3621
  }
3621
3622
  if (enableColumnResizing) return { style: { width: columnSize(column.id) } };
3622
3623
  return { style: column.width ? { width: column.width } : void 0 };
@@ -3651,6 +3652,7 @@ function DataGrid({
3651
3652
  const pinnedProps = column.pinned || enableColumnResizing ? pinnedCellProps(column) : void 0;
3652
3653
  return {
3653
3654
  className: pinnedProps?.className ? `${BODY_TD_BASE_CLASS} ${pinnedProps.className}` : BODY_TD_BASE_CLASS,
3655
+ classNameOdd: pinnedProps?.classNameOdd ? `${BODY_TD_BASE_CLASS} ${pinnedProps.classNameOdd}` : BODY_TD_BASE_CLASS,
3654
3656
  style: pinnedProps?.style
3655
3657
  };
3656
3658
  }
@@ -4049,7 +4051,7 @@ function DataGrid({
4049
4051
  "td",
4050
4052
  {
4051
4053
  style: cellProps?.style,
4052
- className: cellProps?.className ?? BODY_TD_BASE_CLASS,
4054
+ className: (isOddRow ? cellProps?.classNameOdd : cellProps?.className) ?? BODY_TD_BASE_CLASS,
4053
4055
  "data-cell-row": hasCellEditing ? row.id : void 0,
4054
4056
  "data-cell-col": hasCellEditing ? cell.column.id : void 0,
4055
4057
  children: flexRender(cell.column.columnDef.cell, cell.getContext())