@danske/sapphire-angular 1.14.1 → 1.14.2

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.
@@ -5227,9 +5227,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.0", ngImpor
5227
5227
 
5228
5228
  class TableCellDirective {
5229
5229
  get role() {
5230
- return this.tableRow.cells.toArray().indexOf(this) === 0
5231
- ? 'rowheader'
5232
- : 'cell';
5230
+ return this.isFirstCellInRow ? 'rowheader' : 'cell';
5233
5231
  }
5234
5232
  /**
5235
5233
  * Horizontal alignment of content in the cell.
@@ -5237,29 +5235,31 @@ class TableCellDirective {
5237
5235
  * @default 'left'
5238
5236
  */
5239
5237
  get align() {
5240
- return (this._align ||
5241
- this.tableRow.getColumnHeadCellProperty(this, 'align'));
5238
+ return this._align || this.headCell?.align;
5242
5239
  }
5243
5240
  set align(value) {
5244
5241
  this._align = value;
5245
5242
  }
5246
5243
  get width() {
5247
- return this.tableRow.getColumnHeadCellProperty(this, 'width');
5244
+ return this.headCell?.width;
5248
5245
  }
5249
5246
  get minWidth() {
5250
- return this.tableRow.getColumnHeadCellProperty(this, 'minWidth');
5247
+ return this.headCell?.minWidth;
5251
5248
  }
5252
5249
  get maxWidth() {
5253
- return this.tableRow.getColumnHeadCellProperty(this, 'maxWidth');
5250
+ return this.headCell?.maxWidth;
5254
5251
  }
5255
5252
  constructor(table, truncatedWithTooltipDirective, tableRow) {
5256
5253
  this.table = table;
5257
5254
  this.truncatedWithTooltipDirective = truncatedWithTooltipDirective;
5258
5255
  this.tableRow = tableRow;
5256
+ this.isFirstCellInRow = false;
5259
5257
  }
5260
5258
  ngAfterContentChecked() {
5261
5259
  this.truncatedWithTooltipDirective.enabled =
5262
5260
  this.table.cellOverflow === 'truncate';
5261
+ this.headCell = this.tableRow.getColumnHeadCell(this);
5262
+ this.isFirstCellInRow = this.tableRow.cells.toArray().indexOf(this) === 0;
5263
5263
  }
5264
5264
  }
5265
5265
  TableCellDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.0", ngImport: i0, type: TableCellDirective, deps: [{ token: forwardRef(() => TableComponent) }, { token: TruncatedWithTooltipDirective }, { token: forwardRef(() => TableRowDirective) }], target: i0.ɵɵFactoryTarget.Directive });
@@ -5308,9 +5308,9 @@ class TableRowDirective {
5308
5308
  rowData: this.rowData,
5309
5309
  });
5310
5310
  }
5311
- getColumnHeadCellProperty(cell, property) {
5311
+ getColumnHeadCell(cell) {
5312
5312
  const index = this.cells.toArray().indexOf(cell);
5313
- return this.table.headCells?.toArray()[index]?.[property];
5313
+ return this.table.headCells?.toArray()[index];
5314
5314
  }
5315
5315
  constructor(table) {
5316
5316
  this.table = table;