@porscheinformatik/clr-addons 21.5.1 → 21.5.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.
@@ -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,
@@ -5208,13 +5191,11 @@ class ClrTreetableColumnManagerMenuComponent {
5208
5191
  this.popoverPosition = ClrPopoverPosition.TOP_LEFT;
5209
5192
  this.popoverType = ClrPopoverType.DROPDOWN;
5210
5193
  this.commonStrings = this._commonStringsService.keys;
5211
- this.resetLabel = input.required(...(ngDevMode ? [{ debugName: "resetLabel" }] : /* istanbul ignore next */ []));
5212
5194
  this.open = toSignal(this._popoverService.openChange);
5213
5195
  this.hideableColumns = this._columnService.hideableColumns;
5214
5196
  this.hasOnlyOneVisibleColumn = computed(() => this._columnService.columns().length === this._columnService.hideableColumns().length &&
5215
5197
  this._columnService.visibleColumns().length === 1, ...(ngDevMode ? [{ debugName: "hasOnlyOneVisibleColumn" }] : /* istanbul ignore next */ []));
5216
5198
  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
5199
  }
5219
5200
  toggleColumnState(id) {
5220
5201
  this._columnService.toggleHidden(id);
@@ -5224,11 +5205,8 @@ class ClrTreetableColumnManagerMenuComponent {
5224
5205
  this._columnService.displayAllColumns();
5225
5206
  }
5226
5207
  }
5227
- resetAllToInitial() {
5228
- this._columnService.resetToInitialHidden();
5229
- }
5230
5208
  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: `
5209
+ 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
5210
  <button
5233
5211
  role="button"
5234
5212
  type="button"
@@ -5303,15 +5281,6 @@ class ClrTreetableColumnManagerMenuComponent {
5303
5281
  >
5304
5282
  {{ commonStrings.selectAll }}
5305
5283
  </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
5284
  </div>
5316
5285
  </div>
5317
5286
  `, 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 +5364,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5395
5364
  >
5396
5365
  {{ commonStrings.selectAll }}
5397
5366
  </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
5367
  </div>
5408
5368
  </div>
5409
5369
  `,
@@ -5415,7 +5375,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5415
5375
  changeDetection: ChangeDetectionStrategy.OnPush,
5416
5376
  standalone: false,
5417
5377
  }]
5418
- }], propDecorators: { resetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetLabel", required: true }] }] } });
5378
+ }] });
5419
5379
 
5420
5380
  class ClrTreetableFooter {
5421
5381
  constructor() {
@@ -5423,13 +5383,12 @@ class ClrTreetableFooter {
5423
5383
  this._columnService = inject(TreetableColumnStateService);
5424
5384
  this._dataService = inject(TreetableDataStateService);
5425
5385
  this.commonStrings = this._commonStringsService.keys;
5426
- this.clrResetLabel = input('RESET', ...(ngDevMode ? [{ debugName: "clrResetLabel" }] : /* istanbul ignore next */ []));
5427
5386
  this.hasHideableColumns = this._columnService.hasHideableColumns;
5428
5387
  this.selectedRows = this._dataService.selectedNodes;
5429
5388
  this.hasSelectedRows = computed(() => this.selectedRows()?.length > 0, ...(ngDevMode ? [{ debugName: "hasSelectedRows" }] : /* istanbul ignore next */ []));
5430
5389
  }
5431
5390
  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: `
5391
+ 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
5392
  @if (hasSelectedRows()) {
5434
5393
  <div class="clr-form-control-disabled">
5435
5394
  <clr-checkbox-wrapper class="treetable-footer-select" data-testid="treetable-footer-selected-wrapper">
@@ -5448,13 +5407,13 @@ class ClrTreetableFooter {
5448
5407
  </div>
5449
5408
  }
5450
5409
  @if (hasHideableColumns()) {
5451
- <clr-tt-column-manager-menu [resetLabel]="clrResetLabel()" />
5410
+ <clr-tt-column-manager-menu />
5452
5411
  }
5453
5412
 
5454
5413
  <div class="treetable-footer-description" data-testid="treetable-footer-description">
5455
5414
  <ng-content />
5456
5415
  </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 }); }
5416
+ `, 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
5417
  }
5459
5418
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: ClrTreetableFooter, decorators: [{
5460
5419
  type: Component,
@@ -5479,7 +5438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5479
5438
  </div>
5480
5439
  }
5481
5440
  @if (hasHideableColumns()) {
5482
- <clr-tt-column-manager-menu [resetLabel]="clrResetLabel()" />
5441
+ <clr-tt-column-manager-menu />
5483
5442
  }
5484
5443
 
5485
5444
  <div class="treetable-footer-description" data-testid="treetable-footer-description">
@@ -5492,7 +5451,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.20", ngImpo
5492
5451
  changeDetection: ChangeDetectionStrategy.OnPush,
5493
5452
  standalone: false,
5494
5453
  }]
5495
- }], propDecorators: { clrResetLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "clrResetLabel", required: false }] }] } });
5454
+ }] });
5496
5455
 
5497
5456
  /*
5498
5457
  * Copyright (c) 2018-2026 Porsche Informatik. All Rights Reserved.
@@ -5526,10 +5485,10 @@ class ClrTreetableHideableColumn {
5526
5485
  this.resolvedHidden = computed(() => {
5527
5486
  const value = this.clrTtHideableColumn();
5528
5487
  if (typeof value === 'string') {
5529
- return { hidden: false, initialHidden: false };
5488
+ return { hidden: false };
5530
5489
  }
5531
5490
  const hidden = value?.hidden ?? false;
5532
- return { hidden: hidden, initialHidden: value?.initial ?? hidden };
5491
+ return { hidden: hidden };
5533
5492
  }, ...(ngDevMode ? [{ debugName: "resolvedHidden" }] : /* istanbul ignore next */ []));
5534
5493
  // Render the content in-place (inside the column header)
5535
5494
  this._viewContainerRef.createEmbeddedView(this._titleTemplateRef);
@@ -5546,7 +5505,6 @@ class ClrTreetableHideableColumn {
5546
5505
  this._columnState.registerHideable(this._column.columnId, {
5547
5506
  hideable: true,
5548
5507
  hidden: resolvedHidden.hidden,
5549
- initialHidden: resolvedHidden.initialHidden,
5550
5508
  titleTemplateRef: this._titleTemplateRef,
5551
5509
  });
5552
5510
  }
@@ -5776,7 +5734,6 @@ class TreetableHeaderRenderer {
5776
5734
  setWidth(width) {
5777
5735
  const el = this.elementRef.nativeElement;
5778
5736
  this.renderer.setStyle(el, 'width', `${width}px`);
5779
- this.renderer.setStyle(el, 'max-width', `${width}px`);
5780
5737
  this.renderer.setStyle(el, 'flex', '0 0 auto');
5781
5738
  }
5782
5739
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: TreetableHeaderRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
@@ -5820,7 +5777,6 @@ class TreetableCellRenderer {
5820
5777
  setWidth(width) {
5821
5778
  const el = this.elementRef.nativeElement;
5822
5779
  this.renderer.setStyle(el, 'width', `${width}px`);
5823
- this.renderer.setStyle(el, 'max-width', `${width}px`);
5824
5780
  this.renderer.setStyle(el, 'flex', '0 0 auto');
5825
5781
  }
5826
5782
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.20", ngImport: i0, type: TreetableCellRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }