@rivet-health/design-system 32.0.0 → 32.0.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.
@@ -7276,10 +7276,19 @@ class SimpleTableComponent {
7276
7276
  const allowedTypes = RivTable.ColumnDataTypes.join(', ');
7277
7277
  throw new Error(`Each header cell must define an appropriate dataType, one of ${allowedTypes}`);
7278
7278
  }
7279
- headerCell.alignment = RivTable.getColumnAlignment(dataType, i === 0);
7280
- headerCell.leftPinOffset = runningWidthTotal;
7279
+ const newAlignment = RivTable.getColumnAlignment(dataType, i === 0);
7280
+ const newLeftPinOffset = runningWidthTotal;
7281
7281
  runningWidthTotal += headerCell.width;
7282
- headerCell.cdr.markForCheck();
7282
+ const changed = headerCell.alignment != newAlignment ||
7283
+ headerCell.leftPinOffset != newLeftPinOffset;
7284
+ headerCell.alignment = newAlignment;
7285
+ headerCell.leftPinOffset = newLeftPinOffset;
7286
+ // Only mark for check when changed to prevent infinite cycles
7287
+ if (changed) {
7288
+ queueMicrotask(() => {
7289
+ headerCell.cdr.markForCheck();
7290
+ });
7291
+ }
7283
7292
  });
7284
7293
  const getCellCoordinates = createCellCoordinateCalculator(dataCells.map(dataCell => {
7285
7294
  const element = dataCell.elementRef.nativeElement;
@@ -7292,13 +7301,25 @@ class SimpleTableComponent {
7292
7301
  dataCells.forEach((dataCell, cellIndex) => {
7293
7302
  const bounds = getCellCoordinates(cellIndex);
7294
7303
  const headerCell = headerCells.get(bounds.start.col);
7304
+ let changed = false;
7295
7305
  if (headerCell) {
7306
+ changed =
7307
+ dataCell.alignment != headerCell.alignment ||
7308
+ dataCell.pinned != headerCell.pinned ||
7309
+ dataCell.leftPinOffset != headerCell.leftPinOffset;
7296
7310
  dataCell.alignment = headerCell.alignment;
7297
7311
  dataCell.pinned = headerCell.pinned;
7298
7312
  dataCell.leftPinOffset = headerCell.leftPinOffset;
7299
7313
  }
7300
- dataCell.isLastRow = bounds.end.row === maxRow;
7301
- dataCell.cdr.markForCheck();
7314
+ const newIsLastRow = bounds.end.row === maxRow;
7315
+ changed = changed || dataCell.isLastRow != newIsLastRow;
7316
+ dataCell.isLastRow = newIsLastRow;
7317
+ // Only mark for check when changed to prevent infinite cycles
7318
+ if (changed) {
7319
+ queueMicrotask(() => {
7320
+ dataCell.cdr.markForCheck();
7321
+ });
7322
+ }
7302
7323
  });
7303
7324
  }
7304
7325
  }