@porscheinformatik/clr-addons 21.5.1 → 21.5.3

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.
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, NgModule, Injectable, EventEmitter, Output, Input, Directive, ViewChild, ContentChildren, TemplateRef, ViewChildren, HostBinding, ElementRef, Renderer2, forwardRef, DOCUMENT, Inject, ContentChild, Optional, input, ChangeDetectionStrategy, signal, computed, SkipSelf, inject, model, contentChild, linkedSignal, DestroyRef, contentChildren, effect, NgZone, viewChild, HostAttributeToken, ViewContainerRef, afterRenderEffect, InjectionToken, isSignal, HostListener, LOCALE_ID, Self, Host, output, ChangeDetectorRef, Injector, untracked, runInInjectionContext } from '@angular/core';
2
+ import { Component, NgModule, Injectable, EventEmitter, Output, Input, Directive, ViewChild, ContentChildren, TemplateRef, ViewChildren, HostBinding, ElementRef, Renderer2, forwardRef, DOCUMENT, Inject, ContentChild, Optional, input, ChangeDetectionStrategy, signal, computed, SkipSelf, inject, model, contentChild, linkedSignal, DestroyRef, contentChildren, effect, NgZone, viewChild, ViewContainerRef, afterRenderEffect, InjectionToken, isSignal, HostListener, LOCALE_ID, Self, Host, output, ChangeDetectorRef, Injector, untracked, runInInjectionContext } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, NgComponentOutlet, NgTemplateOutlet, getLocaleDateFormat, FormatWidth, NgOptimizedImage, NgClass } from '@angular/common';
5
5
  import * as i2 from '@clr/angular/icon';
@@ -4553,7 +4553,6 @@ class TreetableColumnStateService {
4553
4553
  this._changeHideable$ = new Subject();
4554
4554
  this._changeHiddenForAll$ = new Subject();
4555
4555
  this._changeHidden$ = new Subject();
4556
- this._resetHidden$ = new Subject();
4557
4556
  this._columnState = signal({}, ...(ngDevMode ? [{ debugName: "_columnState" }] : /* istanbul ignore next */ []));
4558
4557
  this.columns = computed(() => Object.values(this._columnState()).sort((a, b) => a.columnIndex - b.columnIndex), ...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
4559
4558
  this.visibleColumns = computed(() => this.columns().filter(column => !column.hidden), ...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
@@ -4563,10 +4562,10 @@ class TreetableColumnStateService {
4563
4562
  this._changeHideableAction$ = this._changeHideable$.pipe(tap(patch => {
4564
4563
  const current = this.getColumn(patch.id);
4565
4564
  if (current.hideable && !patch.hideable) {
4566
- this.update(patch.id, { hideable: false, hidden: false, initialHidden: false });
4565
+ this.update(patch.id, { hideable: false, hidden: false });
4567
4566
  }
4568
4567
  if (!current.hideable && patch.hideable) {
4569
- this.update(patch.id, { hideable: true, hidden: patch.hidden, initialHidden: patch.hidden });
4568
+ this.update(patch.id, { hideable: true, hidden: patch.hidden });
4570
4569
  }
4571
4570
  this.update(patch.id, { hidden: patch.hidden });
4572
4571
  }), share());
@@ -4580,23 +4579,11 @@ class TreetableColumnStateService {
4580
4579
  },
4581
4580
  ])));
4582
4581
  }), share());
4583
- this._resetHiddenAction$ = this._resetHidden$.pipe(tap(() => {
4584
- this._columnState.update(current => Object.fromEntries(Object.entries(current).map(([id, column]) => [
4585
- id,
4586
- column.hideable
4587
- ? {
4588
- ...column,
4589
- hidden: column.initialHidden,
4590
- }
4591
- : column,
4592
- ])));
4593
- }), share());
4594
- this.changes$ = merge(this._changeWidthAction$.pipe(map$1(() => TreetableColumnUpdate.WIDTH)), this._changeHideableAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)), this._changeHiddenForAllAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)), this._changeHiddenAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)), this._resetHiddenAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)));
4582
+ this.changes$ = merge(this._changeWidthAction$.pipe(map$1(() => TreetableColumnUpdate.WIDTH)), this._changeHideableAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)), this._changeHiddenForAllAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)), this._changeHiddenAction$.pipe(map$1(() => TreetableColumnUpdate.HIDDEN)));
4595
4583
  this._changeWidthAction$.pipe(takeUntilDestroyed()).subscribe();
4596
4584
  this._changeHideableAction$.pipe(takeUntilDestroyed()).subscribe();
4597
4585
  this._changeHiddenForAllAction$.pipe(takeUntilDestroyed()).subscribe();
4598
4586
  this._changeHiddenAction$.pipe(takeUntilDestroyed()).subscribe();
4599
- this._resetHiddenAction$.pipe(takeUntilDestroyed()).subscribe();
4600
4587
  }
4601
4588
  register(options) {
4602
4589
  this._columnState.update(current => ({
@@ -4623,7 +4610,6 @@ class TreetableColumnStateService {
4623
4610
  ...existing,
4624
4611
  hideable: options.hideable,
4625
4612
  hidden: options.hidden,
4626
- initialHidden: options.initialHidden ?? options.hidden,
4627
4613
  titleTemplateRef: options.titleTemplateRef,
4628
4614
  },
4629
4615
  };
@@ -4666,14 +4652,11 @@ class TreetableColumnStateService {
4666
4652
  const current = this.getColumn(id);
4667
4653
  this._changeHidden$.next({ id, hidden: !current.hidden });
4668
4654
  }
4669
- resetToInitialHidden() {
4670
- this._resetHidden$.next();
4671
- }
4672
4655
  getColumnState(id) {
4673
4656
  return toObservable(this._columnState).pipe(map$1(columns => columns[id]), distinctUntilChanged());
4674
4657
  }
4675
4658
  getColumnChangesById(id) {
4676
- const hiddenChanges$ = merge(this._changeHiddenAction$.pipe(filter$1(change => change.id === id)), this._changeHiddenForAllAction$, this._resetHiddenAction$).pipe(map$1(() => ({
4659
+ const hiddenChanges$ = merge(this._changeHiddenAction$.pipe(filter$1(change => change.id === id)), this._changeHiddenForAllAction$).pipe(map$1(() => ({
4677
4660
  id,
4678
4661
  type: TreetableColumnUpdate.HIDDEN,
4679
4662
  hidden: this.getColumn(id)?.hidden ?? false,
@@ -5027,19 +5010,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5027
5010
  */
5028
5011
  let columnId = 0;
5029
5012
  class ClrTreetableColumn {
5030
- get dataTestId() {
5031
- return this._userDataTestId ?? `treetable-column-${this.columnId}`;
5032
- }
5033
5013
  ngOnInit() {
5034
5014
  this._columnState.register({ id: this.columnId, titleTemplateRef: this._columnTitleRef() });
5035
5015
  }
5016
+ ngAfterViewInit() {
5017
+ // Only set a default testid if the consumer didn't already provide one.
5018
+ const host = this._elementRef.nativeElement;
5019
+ if (!host.hasAttribute('data-testid')) {
5020
+ this._renderer.setAttribute(host, 'data-testid', `treetable-column-${this.columnId}`);
5021
+ }
5022
+ }
5036
5023
  ngOnDestroy() {
5037
5024
  this._columnState.unregister(this.columnId);
5038
5025
  }
5039
5026
  constructor() {
5040
5027
  this.columnId = `clr-tt-col-${columnId++}`;
5041
- /* Keep a data-testid set by the consumer, and only fall back to the default when none was provided. */
5042
- this._userDataTestId = inject(new HostAttributeToken('data-testid'), { optional: true });
5028
+ this._elementRef = inject(ElementRef);
5029
+ this._renderer = inject(Renderer2);
5043
5030
  this._columnTitleRef = viewChild('columnTitle', { ...(ngDevMode ? { debugName: "_columnTitleRef" } : /* istanbul ignore next */ {}), read: TemplateRef });
5044
5031
  this._columnState = inject(TreetableColumnStateService);
5045
5032
  this._sort = inject((SortStateService));
@@ -5124,7 +5111,7 @@ class ClrTreetableColumn {
5124
5111
  this._sort.toggle(comparator, reverse);
5125
5112
  }
5126
5113
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableColumn, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5127
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableColumn, isStandalone: false, selector: "clr-tt-column", inputs: { clrTtSortBy: { classPropertyName: "clrTtSortBy", publicName: "clrTtSortBy", isSignal: true, isRequired: false, transformFunction: null }, clrTtSortOrder: { classPropertyName: "clrTtSortOrder", publicName: "clrTtSortOrder", isSignal: true, isRequired: false, transformFunction: null }, clrTtColumnSize: { classPropertyName: "clrTtColumnSize", publicName: "clrTtColumnSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clrTtSortOrderChange: "clrTtSortOrderChange", clrTtColumnResize: "clrTtColumnResize" }, host: { attributes: { "role": "columnheader" }, properties: { "class.treetable-column": "true", "attr.aria-sort": "ariaSort()", "attr.data-testid": "dataTestId" } }, providers: [ClrPopoverService], viewQueries: [{ propertyName: "_columnTitleRef", first: true, predicate: ["columnTitle"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
5114
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableColumn, isStandalone: false, selector: "clr-tt-column", inputs: { clrTtSortBy: { classPropertyName: "clrTtSortBy", publicName: "clrTtSortBy", isSignal: true, isRequired: false, transformFunction: null }, clrTtSortOrder: { classPropertyName: "clrTtSortOrder", publicName: "clrTtSortOrder", isSignal: true, isRequired: false, transformFunction: null }, clrTtColumnSize: { classPropertyName: "clrTtColumnSize", publicName: "clrTtColumnSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clrTtSortOrderChange: "clrTtSortOrderChange", clrTtColumnResize: "clrTtColumnResize" }, host: { attributes: { "role": "columnheader" }, properties: { "class.treetable-column": "true", "attr.aria-sort": "ariaSort()" } }, providers: [ClrPopoverService], viewQueries: [{ propertyName: "_columnTitleRef", first: true, predicate: ["columnTitle"], descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: `
5128
5115
  @if (isSortable()) {
5129
5116
  <button type="button" class="treetable-column-title" data-testId="clrTtSortButton" (click)="sort()">
5130
5117
  <ng-container *ngTemplateOutlet="columnTitle" />
@@ -5189,7 +5176,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5189
5176
  host: {
5190
5177
  '[class.treetable-column]': 'true',
5191
5178
  '[attr.aria-sort]': 'ariaSort()',
5192
- '[attr.data-testid]': 'dataTestId',
5193
5179
  role: 'columnheader',
5194
5180
  },
5195
5181
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -5208,13 +5194,11 @@ class ClrTreetableColumnManagerMenuComponent {
5208
5194
  this.popoverPosition = ClrPopoverPosition.TOP_LEFT;
5209
5195
  this.popoverType = ClrPopoverType.DROPDOWN;
5210
5196
  this.commonStrings = this._commonStringsService.keys;
5211
- this.resetLabel = input.required(...(ngDevMode ? [{ debugName: "resetLabel" }] : /* istanbul ignore next */ []));
5212
5197
  this.open = toSignal(this._popoverService.openChange);
5213
5198
  this.hideableColumns = this._columnService.hideableColumns;
5214
5199
  this.hasOnlyOneVisibleColumn = computed(() => this._columnService.columns().length === this._columnService.hideableColumns().length &&
5215
5200
  this._columnService.visibleColumns().length === 1, ...(ngDevMode ? [{ debugName: "hasOnlyOneVisibleColumn" }] : /* istanbul ignore next */ []));
5216
5201
  this.areAllColumnsVisible = computed(() => this._columnService.visibleColumns().length === this._columnService.columns().length, ...(ngDevMode ? [{ debugName: "areAllColumnsVisible" }] : /* istanbul ignore next */ []));
5217
- this.areAllColumnsReset = computed(() => this._columnService.hideableColumns().every(column => column.hidden === column.initialHidden), ...(ngDevMode ? [{ debugName: "areAllColumnsReset" }] : /* istanbul ignore next */ []));
5218
5202
  }
5219
5203
  toggleColumnState(id) {
5220
5204
  this._columnService.toggleHidden(id);
@@ -5224,11 +5208,8 @@ class ClrTreetableColumnManagerMenuComponent {
5224
5208
  this._columnService.displayAllColumns();
5225
5209
  }
5226
5210
  }
5227
- resetAllToInitial() {
5228
- this._columnService.resetToInitialHidden();
5229
- }
5230
5211
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableColumnManagerMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5231
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableColumnManagerMenuComponent, isStandalone: false, selector: "clr-tt-column-manager-menu", inputs: { resetLabel: { classPropertyName: "resetLabel", publicName: "resetLabel", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.column-manager-menu": "true", "class.active": "open()" } }, hostDirectives: [{ directive: i1$2.ClrPopoverHostDirective }], ngImport: i0, template: `
5212
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableColumnManagerMenuComponent, isStandalone: false, selector: "clr-tt-column-manager-menu", host: { properties: { "class.column-manager-menu": "true", "class.active": "open()" } }, hostDirectives: [{ directive: i1$2.ClrPopoverHostDirective }], ngImport: i0, template: `
5232
5213
  <button
5233
5214
  role="button"
5234
5215
  type="button"
@@ -5303,15 +5284,6 @@ class ClrTreetableColumnManagerMenuComponent {
5303
5284
  >
5304
5285
  {{ commonStrings.selectAll }}
5305
5286
  </button>
5306
- <button
5307
- type="button"
5308
- class="btn btn-sm btn-link switch-button"
5309
- data-testid="treetable-column-manager-reset"
5310
- [disabled]="areAllColumnsReset()"
5311
- (click)="resetAllToInitial()"
5312
- >
5313
- {{ resetLabel() }}
5314
- </button>
5315
5287
  </div>
5316
5288
  </div>
5317
5289
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "directive", type: i2.CdsIconCustomTag, selector: "cds-icon" }, { kind: "directive", type: i1$1.ClrControlLabel, selector: "label", inputs: ["id", "for"] }, { kind: "directive", type: i4.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i4.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "directive", type: i2$3.ClrPopoverOrigin, selector: "[clrPopoverOrigin]" }, { kind: "directive", type: i2$3.ClrPopoverCloseButton, selector: "[clrPopoverCloseButton]", outputs: ["clrPopoverOnCloseChange"] }, { kind: "directive", type: i2$3.ClrPopoverOpenCloseButton, selector: "[clrPopoverOpenCloseButton]", outputs: ["clrPopoverOpenCloseChange"] }, { kind: "directive", type: i2$3.ClrPopoverContent, selector: "[clrPopoverContent]", inputs: ["clrPopoverContent", "clrPopoverContentAt", "clrPopoverContentAvailablePositions", "clrPopoverContentType", "clrPopoverContentOutsideClickToClose", "clrPopoverContentScrollToClose", "clrPopoverContentOrigin"] }, { kind: "directive", type: i3.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.CdkTrapFocusModule_CdkTrapFocus, selector: "[cdkTrapFocus]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
@@ -5395,15 +5367,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5395
5367
  >
5396
5368
  {{ commonStrings.selectAll }}
5397
5369
  </button>
5398
- <button
5399
- type="button"
5400
- class="btn btn-sm btn-link switch-button"
5401
- data-testid="treetable-column-manager-reset"
5402
- [disabled]="areAllColumnsReset()"
5403
- (click)="resetAllToInitial()"
5404
- >
5405
- {{ resetLabel() }}
5406
- </button>
5407
5370
  </div>
5408
5371
  </div>
5409
5372
  `,
@@ -5415,7 +5378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5415
5378
  changeDetection: ChangeDetectionStrategy.OnPush,
5416
5379
  standalone: false,
5417
5380
  }]
5418
- }], propDecorators: { resetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetLabel", required: true }] }] } });
5381
+ }] });
5419
5382
 
5420
5383
  class ClrTreetableFooter {
5421
5384
  constructor() {
@@ -5423,13 +5386,12 @@ class ClrTreetableFooter {
5423
5386
  this._columnService = inject(TreetableColumnStateService);
5424
5387
  this._dataService = inject(TreetableDataStateService);
5425
5388
  this.commonStrings = this._commonStringsService.keys;
5426
- this.clrResetLabel = input('RESET', ...(ngDevMode ? [{ debugName: "clrResetLabel" }] : /* istanbul ignore next */ []));
5427
5389
  this.hasHideableColumns = this._columnService.hasHideableColumns;
5428
5390
  this.selectedRows = this._dataService.selectedNodes;
5429
5391
  this.hasSelectedRows = computed(() => this.selectedRows()?.length > 0, ...(ngDevMode ? [{ debugName: "hasSelectedRows" }] : /* istanbul ignore next */ []));
5430
5392
  }
5431
5393
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableFooter, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5432
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableFooter, isStandalone: false, selector: "clr-tt-footer", inputs: { clrResetLabel: { classPropertyName: "clrResetLabel", publicName: "clrResetLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.treetable-footer": "true" } }, ngImport: i0, template: `
5394
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.20", type: ClrTreetableFooter, isStandalone: false, selector: "clr-tt-footer", host: { properties: { "class.treetable-footer": "true" } }, ngImport: i0, template: `
5433
5395
  @if (hasSelectedRows()) {
5434
5396
  <div class="clr-form-control-disabled">
5435
5397
  <clr-checkbox-wrapper class="treetable-footer-select" data-testid="treetable-footer-selected-wrapper">
@@ -5448,13 +5410,13 @@ class ClrTreetableFooter {
5448
5410
  </div>
5449
5411
  }
5450
5412
  @if (hasHideableColumns()) {
5451
- <clr-tt-column-manager-menu [resetLabel]="clrResetLabel()" />
5413
+ <clr-tt-column-manager-menu />
5452
5414
  }
5453
5415
 
5454
5416
  <div class="treetable-footer-description" data-testid="treetable-footer-description">
5455
5417
  <ng-content />
5456
5418
  </div>
5457
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.ClrControlLabel, selector: "label", inputs: ["id", "for"] }, { kind: "directive", type: i4.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i4.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "component", type: ClrTreetableColumnManagerMenuComponent, selector: "clr-tt-column-manager-menu", inputs: ["resetLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5419
+ `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.ClrControlLabel, selector: "label", inputs: ["id", "for"] }, { kind: "directive", type: i4.ClrCheckbox, selector: "[clrCheckbox],[clrToggle]" }, { kind: "component", type: i4.ClrCheckboxWrapper, selector: "clr-checkbox-wrapper,clr-toggle-wrapper" }, { kind: "component", type: ClrTreetableColumnManagerMenuComponent, selector: "clr-tt-column-manager-menu" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5458
5420
  }
5459
5421
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableFooter, decorators: [{
5460
5422
  type: Component,
@@ -5479,7 +5441,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5479
5441
  </div>
5480
5442
  }
5481
5443
  @if (hasHideableColumns()) {
5482
- <clr-tt-column-manager-menu [resetLabel]="clrResetLabel()" />
5444
+ <clr-tt-column-manager-menu />
5483
5445
  }
5484
5446
 
5485
5447
  <div class="treetable-footer-description" data-testid="treetable-footer-description">
@@ -5492,7 +5454,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5492
5454
  changeDetection: ChangeDetectionStrategy.OnPush,
5493
5455
  standalone: false,
5494
5456
  }]
5495
- }], propDecorators: { clrResetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clrResetLabel", required: false }] }] } });
5457
+ }] });
5496
5458
 
5497
5459
  /*
5498
5460
  * Copyright (c) 2018-2026 Porsche Informatik. All Rights Reserved.
@@ -5526,10 +5488,10 @@ class ClrTreetableHideableColumn {
5526
5488
  this.resolvedHidden = computed(() => {
5527
5489
  const value = this.clrTtHideableColumn();
5528
5490
  if (typeof value === 'string') {
5529
- return { hidden: false, initialHidden: false };
5491
+ return { hidden: false };
5530
5492
  }
5531
5493
  const hidden = value?.hidden ?? false;
5532
- return { hidden: hidden, initialHidden: value?.initial ?? hidden };
5494
+ return { hidden: hidden };
5533
5495
  }, ...(ngDevMode ? [{ debugName: "resolvedHidden" }] : /* istanbul ignore next */ []));
5534
5496
  // Render the content in-place (inside the column header)
5535
5497
  this._viewContainerRef.createEmbeddedView(this._titleTemplateRef);
@@ -5546,7 +5508,6 @@ class ClrTreetableHideableColumn {
5546
5508
  this._columnState.registerHideable(this._column.columnId, {
5547
5509
  hideable: true,
5548
5510
  hidden: resolvedHidden.hidden,
5549
- initialHidden: resolvedHidden.initialHidden,
5550
5511
  titleTemplateRef: this._titleTemplateRef,
5551
5512
  });
5552
5513
  }
@@ -5677,16 +5638,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5677
5638
  * This software is released under MIT license.
5678
5639
  * The full license information can be found in LICENSE in the root directory of this project.
5679
5640
  */
5641
+ const DEFAULT_TEST_ID = 'treetable-cell';
5680
5642
  class ClrTreetableCell {
5681
5643
  constructor() {
5682
- /* Keep a data-testid set by the consumer, and only fall back to the default when none was provided. */
5683
- this._userDataTestId = inject(new HostAttributeToken('data-testid'), { optional: true });
5644
+ this._elementRef = inject(ElementRef);
5645
+ this._renderer = inject(Renderer2);
5684
5646
  }
5685
- get dataTestId() {
5686
- return this._userDataTestId ?? 'treetable-cell';
5647
+ ngAfterViewInit() {
5648
+ // Only set a default testid if the consumer didn't already provide one.
5649
+ const host = this._elementRef.nativeElement;
5650
+ if (!host.hasAttribute('data-testid')) {
5651
+ this._renderer.setAttribute(host, 'data-testid', DEFAULT_TEST_ID);
5652
+ }
5687
5653
  }
5688
5654
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableCell, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
5689
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.20", type: ClrTreetableCell, isStandalone: false, selector: "clr-tt-cell", host: { attributes: { "role": "gridcell" }, properties: { "class.treetable-cell": "true", "attr.data-testid": "dataTestId" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5655
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.20", type: ClrTreetableCell, isStandalone: false, selector: "clr-tt-cell", host: { attributes: { "role": "gridcell" }, properties: { "class.treetable-cell": "true" } }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5690
5656
  }
5691
5657
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableCell, decorators: [{
5692
5658
  type: Component,
@@ -5695,7 +5661,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5695
5661
  template: '<ng-content></ng-content>',
5696
5662
  host: {
5697
5663
  '[class.treetable-cell]': 'true',
5698
- '[attr.data-testid]': 'dataTestId',
5699
5664
  role: 'gridcell',
5700
5665
  },
5701
5666
  standalone: false,
@@ -5776,7 +5741,6 @@ class TreetableHeaderRenderer {
5776
5741
  setWidth(width) {
5777
5742
  const el = this.elementRef.nativeElement;
5778
5743
  this.renderer.setStyle(el, 'width', `${width}px`);
5779
- this.renderer.setStyle(el, 'max-width', `${width}px`);
5780
5744
  this.renderer.setStyle(el, 'flex', '0 0 auto');
5781
5745
  }
5782
5746
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: TreetableHeaderRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -5820,7 +5784,6 @@ class TreetableCellRenderer {
5820
5784
  setWidth(width) {
5821
5785
  const el = this.elementRef.nativeElement;
5822
5786
  this.renderer.setStyle(el, 'width', `${width}px`);
5823
- this.renderer.setStyle(el, 'max-width', `${width}px`);
5824
5787
  this.renderer.setStyle(el, 'flex', '0 0 auto');
5825
5788
  }
5826
5789
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: TreetableCellRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }