@pdg/react-table 1.0.74 → 1.0.75

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
@@ -3437,17 +3437,21 @@ var TableTopHead = function (_a) {
3437
3437
  React.createElement(material.TableCell, { colSpan: columns.length }, caption)));
3438
3438
  }, [caption, columns]);
3439
3439
  var makeRowCells = React.useCallback(function (row, top) {
3440
+ var totalColumns = 0;
3440
3441
  var cells = row
3441
3442
  .map(function (info, idx) {
3442
- return !!info && (React.createElement(material.TableCell, { key: idx, colSpan: info.colSpan, align: info.align, style: {
3443
- top: top,
3444
- borderBottom: 0,
3445
- } },
3446
- info.label,
3447
- info.label != null && React.createElement(BottomLine, { style: { backgroundColor: theme.palette.divider } })));
3443
+ if (info) {
3444
+ totalColumns += info.colSpan || 1;
3445
+ return (React.createElement(material.TableCell, { key: idx, colSpan: info.colSpan, align: info.align, style: {
3446
+ top: top,
3447
+ borderBottom: 0,
3448
+ } },
3449
+ info.label,
3450
+ info.label != null && React.createElement(BottomLine, { style: { backgroundColor: theme.palette.divider } })));
3451
+ }
3448
3452
  })
3449
3453
  .filter(function (cell) { return !!cell; });
3450
- if (cells.length < columns.length) {
3454
+ if (totalColumns < columns.length) {
3451
3455
  cells.push(React.createElement(material.TableCell, { key: columns.length, colSpan: columns.length - cells.length, style: { top: top, borderBottom: 0 } }));
3452
3456
  }
3453
3457
  return cells;