@alfresco/adf-core 8.4.0-19535715289 → 8.4.0-19568221987

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 { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, RendererFactory2, effect, Optional, Inject, NgModule, HostBinding, Pipe, InjectionToken, provideAppInitializer, EventEmitter, HostListener, ViewChild, Output, ViewChildren, DestroyRef, QueryList, Self, signal, computed, DEFAULT_CURRENCY_CODE, SecurityContext, ElementRef, ChangeDetectorRef, ViewContainerRef, forwardRef, Compiler, Injector } from '@angular/core';
2
+ import { Input, ChangeDetectionStrategy, ViewEncapsulation, Component, inject, Injectable, TemplateRef, ContentChild, Directive, ContentChildren, RendererFactory2, effect, Optional, Inject, NgModule, HostBinding, Pipe, InjectionToken, provideAppInitializer, EventEmitter, HostListener, ViewChild, Output, ViewChildren, DestroyRef, QueryList, Self, signal, computed, DEFAULT_CURRENCY_CODE, SecurityContext, ElementRef, ViewContainerRef, forwardRef, Compiler, ChangeDetectorRef, Injector } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule, DOCUMENT, NgIf, NgClass, NgForOf, AsyncPipe, NgTemplateOutlet, NgStyle, DecimalPipe, DatePipe, CurrencyPipe, NgFor } from '@angular/common';
5
5
  import * as i2 from '@angular/material/table';
@@ -13704,11 +13704,20 @@ class DataTableCellComponent {
13704
13704
  this.resolverFn = null;
13705
13705
  this.destroyRef = inject(DestroyRef);
13706
13706
  this.dataTableService = inject(DataTableService, { optional: true });
13707
+ this.userPreferencesService = inject(UserPreferencesService);
13707
13708
  this.value$ = new BehaviorSubject('');
13708
13709
  // Signal to track the raw computed title (without tooltip override)
13709
13710
  this.rawComputedTitle = signal('');
13710
13711
  // Computed signal that automatically combines tooltip input with computed title
13711
13712
  this.title = computed(() => this.tooltip || this.rawComputedTitle());
13713
+ // Store the latest value for locale change re-computation
13714
+ this.latestValue = null;
13715
+ // Listen to locale changes and re-compute the title with the latest value
13716
+ effect(() => {
13717
+ this.userPreferencesService.localeSignal();
13718
+ // When locale changes, re-compute title using the stored latest value
13719
+ this.recomputeTitle();
13720
+ });
13712
13721
  }
13713
13722
  ngOnInit() {
13714
13723
  this.updateValue();
@@ -13718,9 +13727,18 @@ class DataTableCellComponent {
13718
13727
  if (this.column?.key && this.row && this.data) {
13719
13728
  const value = this.data.getValue(this.row, this.column, this.resolverFn);
13720
13729
  this.value$.next(value);
13721
- this.rawComputedTitle.set(this.computeTitle(value));
13730
+ // Store the value for locale change re-computation and update the title
13731
+ this.latestValue = value;
13732
+ this.recomputeTitle();
13722
13733
  }
13723
13734
  }
13735
+ /**
13736
+ * Re-computes the title based on the current latestValue.
13737
+ * This is called both when the value changes (via updateValue) and when the locale changes (via effect).
13738
+ */
13739
+ recomputeTitle() {
13740
+ this.rawComputedTitle.set(this.computeTitle(this.latestValue));
13741
+ }
13724
13742
  subscribeToRowUpdates() {
13725
13743
  if (!this.dataTableService || !this.row.obj) {
13726
13744
  return;
@@ -13797,7 +13815,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
13797
13815
  encapsulation: ViewEncapsulation.None,
13798
13816
  host: { class: 'adf-datatable-content-cell' }
13799
13817
  }]
13800
- }], propDecorators: { data: [{
13818
+ }], ctorParameters: () => [], propDecorators: { data: [{
13801
13819
  type: Input,
13802
13820
  args: [{ required: true }]
13803
13821
  }], column: [{
@@ -13840,16 +13858,14 @@ class AmountCellComponent extends DataTableCellComponent {
13840
13858
  digitsInfo: undefined,
13841
13859
  locale: undefined
13842
13860
  };
13843
- }
13844
- ngOnInit() {
13845
- super.ngOnInit();
13861
+ this.amountValue = toSignal(this.value$);
13846
13862
  }
13847
13863
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
13848
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: AmountCellComponent, isStandalone: true, selector: "adf-amount-cell", inputs: { currencyConfig: "currencyConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"value$ | async as amount\">\n <span [title]=\"amount\">\n {{ amount | currency:\n (currencyConfig?.code || defaultCurrencyConfig.code):\n (currencyConfig?.display || defaultCurrencyConfig.display):\n (currencyConfig?.digitsInfo || defaultCurrencyConfig.digitsInfo):\n (currencyConfig?.locale || defaultCurrencyConfig.locale)\n }}\n </span>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.CurrencyPipe, name: "currency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
13864
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: AmountCellComponent, isStandalone: true, selector: "adf-amount-cell", inputs: { currencyConfig: "currencyConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: "@let amount = amountValue();\n@if (amount) {\n <span [title]=\"amount\">\n {{ amount | currency:\n (currencyConfig?.code || defaultCurrencyConfig.code):\n (currencyConfig?.display || defaultCurrencyConfig.display):\n (currencyConfig?.digitsInfo || defaultCurrencyConfig.digitsInfo):\n (currencyConfig?.locale || defaultCurrencyConfig.locale)\n }}\n </span>\n}\n", dependencies: [{ kind: "pipe", type: CurrencyPipe, name: "currency" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
13849
13865
  }
13850
13866
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: AmountCellComponent, decorators: [{
13851
13867
  type: Component,
13852
- args: [{ imports: [CommonModule], selector: 'adf-amount-cell', host: { class: 'adf-datatable-content-cell' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"value$ | async as amount\">\n <span [title]=\"amount\">\n {{ amount | currency:\n (currencyConfig?.code || defaultCurrencyConfig.code):\n (currencyConfig?.display || defaultCurrencyConfig.display):\n (currencyConfig?.digitsInfo || defaultCurrencyConfig.digitsInfo):\n (currencyConfig?.locale || defaultCurrencyConfig.locale)\n }}\n </span>\n</ng-container>\n" }]
13868
+ args: [{ imports: [CurrencyPipe], selector: 'adf-amount-cell', host: { class: 'adf-datatable-content-cell' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let amount = amountValue();\n@if (amount) {\n <span [title]=\"amount\">\n {{ amount | currency:\n (currencyConfig?.code || defaultCurrencyConfig.code):\n (currencyConfig?.display || defaultCurrencyConfig.display):\n (currencyConfig?.digitsInfo || defaultCurrencyConfig.digitsInfo):\n (currencyConfig?.locale || defaultCurrencyConfig.locale)\n }}\n </span>\n}\n" }]
13853
13869
  }], propDecorators: { currencyConfig: [{
13854
13870
  type: Input
13855
13871
  }] } });
@@ -13873,12 +13889,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
13873
13889
  class BooleanCellComponent extends DataTableCellComponent {
13874
13890
  constructor() {
13875
13891
  super(...arguments);
13876
- this.boolValue = '';
13877
- }
13878
- ngOnInit() {
13879
- super.ngOnInit();
13880
- this.value$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
13881
- this.boolValue = this.transformBoolean(value);
13892
+ this.booleanValue = toSignal(this.value$);
13893
+ this.boolValue = computed(() => {
13894
+ const value = this.booleanValue();
13895
+ return this.transformBoolean(value);
13882
13896
  });
13883
13897
  }
13884
13898
  transformBoolean(value) {
@@ -13891,23 +13905,14 @@ class BooleanCellComponent extends DataTableCellComponent {
13891
13905
  return '';
13892
13906
  }
13893
13907
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: BooleanCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
13894
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: BooleanCellComponent, isStandalone: true, selector: "adf-boolean-cell", host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
13895
- <span [title]="tooltip">
13896
- {{ boolValue }}
13897
- </span>
13898
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
13908
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: BooleanCellComponent, isStandalone: true, selector: "adf-boolean-cell", host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: ` <span [title]="title()">{{ boolValue() }}</span> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
13899
13909
  }
13900
13910
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: BooleanCellComponent, decorators: [{
13901
13911
  type: Component,
13902
13912
  args: [{
13903
- imports: [CommonModule],
13904
13913
  selector: 'adf-boolean-cell',
13905
13914
  changeDetection: ChangeDetectionStrategy.OnPush,
13906
- template: `
13907
- <span [title]="tooltip">
13908
- {{ boolValue }}
13909
- </span>
13910
- `,
13915
+ template: ` <span [title]="title()">{{ boolValue() }}</span> `,
13911
13916
  encapsulation: ViewEncapsulation.None,
13912
13917
  host: { class: 'adf-datatable-content-cell' }
13913
13918
  }]
@@ -15934,46 +15939,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
15934
15939
  * limitations under the License.
15935
15940
  */
15936
15941
  class IconCellComponent extends DataTableCellComponent {
15937
- constructor(changeDetectorRef) {
15938
- super();
15939
- this.changeDetectorRef = changeDetectorRef;
15940
- this.icon = '';
15941
- }
15942
- ngOnInit() {
15943
- super.ngOnInit();
15944
- this.value$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((value) => {
15945
- const newIcon = this.validateIconValue(value) ? value : '';
15946
- if (this.icon !== newIcon) {
15947
- this.icon = newIcon;
15948
- this.changeDetectorRef.detectChanges();
15949
- }
15942
+ constructor() {
15943
+ super(...arguments);
15944
+ this.iconValue = toSignal(this.value$);
15945
+ this.icon = computed(() => {
15946
+ const value = this.iconValue();
15947
+ return this.validateIconValue(value) ? value : '';
15950
15948
  });
15951
15949
  }
15952
15950
  validateIconValue(value) {
15953
15951
  return typeof value === 'string';
15954
15952
  }
15955
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: IconCellComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
15956
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: IconCellComponent, isStandalone: true, selector: "adf-icon-cell", host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
15957
- <ng-container *ngIf="icon">
15958
- <mat-icon [title]="tooltip" aria-hidden="true">{{ icon }}</mat-icon>
15959
- </ng-container>
15960
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
15953
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: IconCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
15954
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: IconCellComponent, isStandalone: true, selector: "adf-icon-cell", host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
15955
+ @if (icon()) {
15956
+ <mat-icon [title]="title()" aria-hidden="true">{{ icon() }}</mat-icon>
15957
+ }
15958
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i1$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
15961
15959
  }
15962
15960
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: IconCellComponent, decorators: [{
15963
15961
  type: Component,
15964
15962
  args: [{
15965
- imports: [CommonModule, MatIconModule],
15963
+ imports: [MatIconModule],
15966
15964
  selector: 'adf-icon-cell',
15967
15965
  changeDetection: ChangeDetectionStrategy.OnPush,
15968
15966
  template: `
15969
- <ng-container *ngIf="icon">
15970
- <mat-icon [title]="tooltip" aria-hidden="true">{{ icon }}</mat-icon>
15971
- </ng-container>
15967
+ @if (icon()) {
15968
+ <mat-icon [title]="title()" aria-hidden="true">{{ icon() }}</mat-icon>
15969
+ }
15972
15970
  `,
15973
15971
  encapsulation: ViewEncapsulation.None,
15974
15972
  host: { class: 'adf-datatable-content-cell' }
15975
15973
  }]
15976
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
15974
+ }] });
15977
15975
 
15978
15976
  /*!
15979
15977
  * @license
@@ -15994,23 +15992,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
15994
15992
  class DateCellComponent extends DataTableCellComponent {
15995
15993
  constructor() {
15996
15994
  super();
15997
- this.config = {};
15995
+ this.config = signal({});
15998
15996
  this.appConfig = inject(AppConfigService);
15999
15997
  this.localizedDatePipe = inject(LocalizedDatePipe);
16000
- this.userPreferencesService = inject(UserPreferencesService);
16001
- this.cdr = inject(ChangeDetectorRef);
15998
+ this.timeAgoPipe = inject(TimeAgoPipe);
16002
15999
  this.userLocale = 'en';
16003
16000
  this.defaultDateConfig = {
16004
16001
  format: 'medium',
16005
16002
  tooltipFormat: 'medium',
16006
16003
  locale: undefined
16007
16004
  };
16005
+ // Convert value$ observable to signal for reactive computation
16006
+ this.dateValue = toSignal(this.value$);
16007
+ // Computed signal that automatically formats the date based on value and config
16008
+ this.formattedDate = computed(() => {
16009
+ const date = this.dateValue();
16010
+ const currentConfig = this.config();
16011
+ if (!date) {
16012
+ return '';
16013
+ }
16014
+ if (currentConfig.format === 'timeAgo') {
16015
+ return this.timeAgoPipe.transform(date, currentConfig.locale) || '';
16016
+ }
16017
+ return this.localizedDatePipe.transform(date, currentConfig.format, currentConfig.locale) || '';
16018
+ });
16008
16019
  // Use effect to react to locale signal changes (must be in injection context)
16009
16020
  effect(() => {
16010
16021
  this.userLocale = this.userPreferencesService.localeSignal() || 'en';
16011
16022
  this.setConfig();
16012
- this.updateValue(); // Recalculate computedTitle with new locale
16013
- this.cdr.markForCheck();
16014
16023
  });
16015
16024
  }
16016
16025
  ngOnInit() {
@@ -16018,7 +16027,8 @@ class DateCellComponent extends DataTableCellComponent {
16018
16027
  }
16019
16028
  computeTitle(value) {
16020
16029
  if (value) {
16021
- return this.localizedDatePipe.transform(value, this.config.tooltipFormat, this.config.locale) || '';
16030
+ const currentConfig = this.config();
16031
+ return this.localizedDatePipe.transform(value, currentConfig.tooltipFormat, currentConfig.locale) || '';
16022
16032
  }
16023
16033
  return '';
16024
16034
  }
@@ -16031,14 +16041,18 @@ class DateCellComponent extends DataTableCellComponent {
16031
16041
  }
16032
16042
  }
16033
16043
  setCustomConfig() {
16034
- this.config.format = this.dateConfig?.format || this.getDefaultFormat();
16035
- this.config.tooltipFormat = this.dateConfig?.tooltipFormat || this.getDefaultTooltipFormat();
16036
- this.config.locale = this.normalizeLocale(this.dateConfig?.locale || this.getDefaultLocale());
16044
+ this.config.set({
16045
+ format: this.dateConfig?.format || this.getDefaultFormat(),
16046
+ tooltipFormat: this.dateConfig?.tooltipFormat || this.getDefaultTooltipFormat(),
16047
+ locale: this.normalizeLocale(this.dateConfig?.locale || this.userLocale)
16048
+ });
16037
16049
  }
16038
16050
  setDefaultConfig() {
16039
- this.config.format = this.getDefaultFormat();
16040
- this.config.tooltipFormat = this.getDefaultTooltipFormat();
16041
- this.config.locale = this.normalizeLocale(this.getDefaultLocale());
16051
+ this.config.set({
16052
+ format: this.getDefaultFormat(),
16053
+ tooltipFormat: this.getDefaultTooltipFormat(),
16054
+ locale: this.normalizeLocale(this.userLocale)
16055
+ });
16042
16056
  }
16043
16057
  normalizeLocale(locale) {
16044
16058
  if (!locale) {
@@ -16054,11 +16068,6 @@ class DateCellComponent extends DataTableCellComponent {
16054
16068
  getDefaultFormat() {
16055
16069
  return this.column?.format || this.getAppConfigPropertyValue('dateValues.defaultDateFormat', this.defaultDateConfig.format);
16056
16070
  }
16057
- getDefaultLocale() {
16058
- // Always use the user locale from UserPreferencesService
16059
- // This is kept in sync via subscription and reflects the user's current locale choice
16060
- return this.userLocale;
16061
- }
16062
16071
  getDefaultTooltipFormat() {
16063
16072
  return this.getAppConfigPropertyValue('dateValues.defaultTooltipDateFormat', this.defaultDateConfig.tooltipFormat);
16064
16073
  }
@@ -16066,11 +16075,26 @@ class DateCellComponent extends DataTableCellComponent {
16066
16075
  return this.appConfig.get(key, defaultValue);
16067
16076
  }
16068
16077
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DateCellComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
16069
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: DateCellComponent, isStandalone: true, selector: "adf-date-cell", inputs: { dateConfig: "dateConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, providers: [LocalizedDatePipe], usesInheritance: true, ngImport: i0, template: "@let date = value$ | async;\n\n@if (date) {\n <span [title]=\"title()\" class=\"adf-datatable-cell-value\">\n @if (config.format === 'timeAgo') {\n @if (config.locale) {\n {{ date | adfTimeAgo: config.locale }}\n } @else {\n {{ date | adfTimeAgo }}\n }\n } @else {\n @if (config.locale) {\n {{ date | adfLocalizedDate: config.format: config.locale }}\n } @else {\n {{ date | adfLocalizedDate: config.format }}\n }\n }\n </span>\n}\n", dependencies: [{ kind: "pipe", type: LocalizedDatePipe, name: "adfLocalizedDate" }, { kind: "pipe", type: TimeAgoPipe, name: "adfTimeAgo" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16078
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: DateCellComponent, isStandalone: true, selector: "adf-date-cell", inputs: { dateConfig: "dateConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, providers: [LocalizedDatePipe, TimeAgoPipe], usesInheritance: true, ngImport: i0, template: `
16079
+ @if (formattedDate()) {
16080
+ <span [title]="title()" class="adf-datatable-cell-value">{{ formattedDate() }}</span>
16081
+ }
16082
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16070
16083
  }
16071
16084
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DateCellComponent, decorators: [{
16072
16085
  type: Component,
16073
- args: [{ imports: [LocalizedDatePipe, TimeAgoPipe, AsyncPipe], selector: 'adf-date-cell', encapsulation: ViewEncapsulation.None, host: { class: 'adf-datatable-content-cell' }, changeDetection: ChangeDetectionStrategy.OnPush, providers: [LocalizedDatePipe], template: "@let date = value$ | async;\n\n@if (date) {\n <span [title]=\"title()\" class=\"adf-datatable-cell-value\">\n @if (config.format === 'timeAgo') {\n @if (config.locale) {\n {{ date | adfTimeAgo: config.locale }}\n } @else {\n {{ date | adfTimeAgo }}\n }\n } @else {\n @if (config.locale) {\n {{ date | adfLocalizedDate: config.format: config.locale }}\n } @else {\n {{ date | adfLocalizedDate: config.format }}\n }\n }\n </span>\n}\n" }]
16086
+ args: [{
16087
+ selector: 'adf-date-cell',
16088
+ template: `
16089
+ @if (formattedDate()) {
16090
+ <span [title]="title()" class="adf-datatable-cell-value">{{ formattedDate() }}</span>
16091
+ }
16092
+ `,
16093
+ encapsulation: ViewEncapsulation.None,
16094
+ host: { class: 'adf-datatable-content-cell' },
16095
+ changeDetection: ChangeDetectionStrategy.OnPush,
16096
+ providers: [LocalizedDatePipe, TimeAgoPipe]
16097
+ }]
16074
16098
  }], ctorParameters: () => [], propDecorators: { dateConfig: [{
16075
16099
  type: Input
16076
16100
  }] } });
@@ -16092,8 +16116,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
16092
16116
  * limitations under the License.
16093
16117
  */
16094
16118
  class LocationCellComponent extends DataTableCellComponent {
16095
- ngOnInit() {
16096
- super.ngOnInit();
16119
+ constructor() {
16120
+ super(...arguments);
16121
+ this.locationValue = toSignal(this.value$);
16097
16122
  }
16098
16123
  updateValue() {
16099
16124
  if (this.column?.key && this.column?.format && this.row && this.data) {
@@ -16110,25 +16135,21 @@ class LocationCellComponent extends DataTableCellComponent {
16110
16135
  }
16111
16136
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: LocationCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
16112
16137
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: LocationCellComponent, isStandalone: true, selector: "adf-location-cell", inputs: { link: "link" }, host: { classAttribute: "adf-location-cell adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
16113
- <ng-container>
16114
- <a [title]="tooltip" [routerLink]="link">
16115
- {{ value$ | async }}
16116
- </a>
16117
- </ng-container>
16118
- `, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$9.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16138
+ <a [title]="tooltip" [routerLink]="link">
16139
+ {{ locationValue() }}
16140
+ </a>
16141
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$9.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16119
16142
  }
16120
16143
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: LocationCellComponent, decorators: [{
16121
16144
  type: Component,
16122
16145
  args: [{
16123
- imports: [AsyncPipe, RouterModule],
16146
+ imports: [RouterModule],
16124
16147
  selector: 'adf-location-cell',
16125
16148
  changeDetection: ChangeDetectionStrategy.OnPush,
16126
16149
  template: `
16127
- <ng-container>
16128
- <a [title]="tooltip" [routerLink]="link">
16129
- {{ value$ | async }}
16130
- </a>
16131
- </ng-container>
16150
+ <a [title]="tooltip" [routerLink]="link">
16151
+ {{ locationValue() }}
16152
+ </a>
16132
16153
  `,
16133
16154
  encapsulation: ViewEncapsulation.None,
16134
16155
  host: { class: 'adf-location-cell adf-datatable-content-cell' }
@@ -16154,23 +16175,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
16154
16175
  * limitations under the License.
16155
16176
  */
16156
16177
  class FileSizeCellComponent extends DataTableCellComponent {
16157
- constructor() {
16158
- super(...arguments);
16159
- this.fileSizePipe = inject(FileSizePipe);
16160
- }
16161
- ngOnInit() {
16162
- super.ngOnInit();
16163
- }
16164
- computeTitle(value) {
16165
- if (value != null) {
16166
- return this.fileSizePipe.transform(value);
16167
- }
16168
- return '';
16169
- }
16170
16178
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FileSizeCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
16171
16179
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: FileSizeCellComponent, isStandalone: true, selector: "adf-filesize-cell", host: { classAttribute: "adf-filesize-cell" }, providers: [FileSizePipe], usesInheritance: true, ngImport: i0, template: `
16172
16180
  @let value = value$ | async;
16173
- <span [title]="title()" class="adf-datatable-cell-value">{{ value | adfFileSize }}</span>
16181
+ <span [title]="value | adfFileSize" class="adf-datatable-cell-value">{{ value | adfFileSize }}</span>
16174
16182
  `, isInline: true, dependencies: [{ kind: "pipe", type: FileSizePipe, name: "adfFileSize" }, { kind: "pipe", type: AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
16175
16183
  }
16176
16184
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FileSizeCellComponent, decorators: [{
@@ -16180,7 +16188,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImpor
16180
16188
  imports: [FileSizePipe, AsyncPipe],
16181
16189
  template: `
16182
16190
  @let value = value$ | async;
16183
- <span [title]="title()" class="adf-datatable-cell-value">{{ value | adfFileSize }}</span>
16191
+ <span [title]="value | adfFileSize" class="adf-datatable-cell-value">{{ value | adfFileSize }}</span>
16184
16192
  `,
16185
16193
  encapsulation: ViewEncapsulation.None,
16186
16194
  host: { class: 'adf-filesize-cell' },
@@ -16253,13 +16261,15 @@ class JsonCellComponent extends DataTableCellComponent {
16253
16261
  this.dialog = dialog;
16254
16262
  /** Editable JSON. */
16255
16263
  this.editable = false;
16256
- }
16257
- ngOnInit() {
16258
- super.ngOnInit();
16264
+ this.jsonValue = toSignal(this.value$);
16265
+ this.shouldShowButton = computed(() => {
16266
+ const value = this.jsonValue();
16267
+ return !!value || this.editable;
16268
+ });
16259
16269
  }
16260
16270
  view() {
16261
16271
  const rawValue = this.data.getValue(this.row, this.column, this.resolverFn);
16262
- const value = typeof rawValue === 'object' ? JSON.stringify(rawValue || {}, null, 2) : rawValue;
16272
+ const value = typeof rawValue === 'object' ? JSON.stringify(rawValue || {}, null, 2) : String(rawValue ?? '');
16263
16273
  const settings = {
16264
16274
  title: this.column.title,
16265
16275
  editable: this.editable,
@@ -16272,36 +16282,21 @@ class JsonCellComponent extends DataTableCellComponent {
16272
16282
  minHeight: '50%'
16273
16283
  })
16274
16284
  .afterClosed()
16275
- .subscribe(( /*result: string*/) => {
16276
- if (typeof rawValue === 'object') {
16277
- // todo: update cell value as object
16278
- }
16279
- else {
16280
- // todo: update cell value as string
16281
- }
16282
- });
16285
+ .subscribe();
16283
16286
  }
16284
16287
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: JsonCellComponent, deps: [{ token: i1$7.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
16285
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: JsonCellComponent, isStandalone: true, selector: "adf-json-cell", inputs: { editable: "editable" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
16286
- <ng-container *ngIf="value$ | async as value; else editEmpty">
16287
- <button mat-button color="primary" (click)="view()">json</button>
16288
- </ng-container>
16289
-
16290
- <ng-template #editEmpty>
16291
- <button *ngIf="editable" mat-button color="primary" (click)="view()">json</button>
16292
- </ng-template>
16293
- `, isInline: true, styles: [".adf-datatable-json-cell{white-space:pre-wrap;word-wrap:break-word}.adf-datatable-cell-value{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16288
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: JsonCellComponent, isStandalone: true, selector: "adf-json-cell", inputs: { editable: "editable" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: `
16289
+ @if (shouldShowButton()) {
16290
+ <button mat-button (click)="view()">json</button>
16291
+ }
16292
+ `, isInline: true, styles: [".adf-datatable-json-cell{white-space:pre-wrap;word-wrap:break-word}.adf-datatable-cell-value{position:relative}\n"], dependencies: [{ kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i2$2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatDialogModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16294
16293
  }
16295
16294
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: JsonCellComponent, decorators: [{
16296
16295
  type: Component,
16297
- args: [{ selector: 'adf-json-cell', imports: [CommonModule, MatButtonModule, MatDialogModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
16298
- <ng-container *ngIf="value$ | async as value; else editEmpty">
16299
- <button mat-button color="primary" (click)="view()">json</button>
16300
- </ng-container>
16301
-
16302
- <ng-template #editEmpty>
16303
- <button *ngIf="editable" mat-button color="primary" (click)="view()">json</button>
16304
- </ng-template>
16296
+ args: [{ selector: 'adf-json-cell', imports: [MatButtonModule, MatDialogModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
16297
+ @if (shouldShowButton()) {
16298
+ <button mat-button (click)="view()">json</button>
16299
+ }
16305
16300
  `, encapsulation: ViewEncapsulation.None, host: { class: 'adf-datatable-content-cell' }, styles: [".adf-datatable-json-cell{white-space:pre-wrap;word-wrap:break-word}.adf-datatable-cell-value{position:relative}\n"] }]
16306
16301
  }], ctorParameters: () => [{ type: i1$7.MatDialog }], propDecorators: { editable: [{
16307
16302
  type: Input
@@ -16330,16 +16325,14 @@ class NumberCellComponent extends DataTableCellComponent {
16330
16325
  digitsInfo: undefined,
16331
16326
  locale: undefined
16332
16327
  };
16333
- }
16334
- ngOnInit() {
16335
- super.ngOnInit();
16328
+ this.numberValue = toSignal(this.value$);
16336
16329
  }
16337
16330
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NumberCellComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
16338
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.6", type: NumberCellComponent, isStandalone: true, selector: "adf-number-cell", inputs: { decimalConfig: "decimalConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"value$ | async as number\">\n <span [title]=\"number\">\n {{ number | number:\n (decimalConfig?.digitsInfo || defaultDecimalConfig.digitsInfo):\n (decimalConfig?.locale || defaultDecimalConfig.locale)\n }}\n </span>\n</ng-container>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16331
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: NumberCellComponent, isStandalone: true, selector: "adf-number-cell", inputs: { decimalConfig: "decimalConfig" }, host: { classAttribute: "adf-datatable-content-cell" }, usesInheritance: true, ngImport: i0, template: "@let number = numberValue();\n@if (number) {\n <span [title]=\"number\">\n {{ number | number:\n (decimalConfig?.digitsInfo || defaultDecimalConfig.digitsInfo):\n (decimalConfig?.locale || defaultDecimalConfig.locale)\n }}\n </span>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
16339
16332
  }
16340
16333
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NumberCellComponent, decorators: [{
16341
16334
  type: Component,
16342
- args: [{ imports: [CommonModule], selector: 'adf-number-cell', host: { class: 'adf-datatable-content-cell' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"value$ | async as number\">\n <span [title]=\"number\">\n {{ number | number:\n (decimalConfig?.digitsInfo || defaultDecimalConfig.digitsInfo):\n (decimalConfig?.locale || defaultDecimalConfig.locale)\n }}\n </span>\n</ng-container>\n" }]
16335
+ args: [{ imports: [CommonModule], selector: 'adf-number-cell', host: { class: 'adf-datatable-content-cell' }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "@let number = numberValue();\n@if (number) {\n <span [title]=\"number\">\n {{ number | number:\n (decimalConfig?.digitsInfo || defaultDecimalConfig.digitsInfo):\n (decimalConfig?.locale || defaultDecimalConfig.locale)\n }}\n </span>\n}\n" }]
16343
16336
  }], propDecorators: { decimalConfig: [{
16344
16337
  type: Input
16345
16338
  }] } });
@@ -17846,9 +17839,7 @@ class DataTableModule {
17846
17839
  DataTableRowComponent,
17847
17840
  DataTableCellComponent,
17848
17841
  DataTableComponent] }); }
17849
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataTableModule, imports: [BooleanCellComponent,
17850
- AmountCellComponent,
17851
- NumberCellComponent,
17842
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: DataTableModule, imports: [NumberCellComponent,
17852
17843
  LocationCellComponent,
17853
17844
  IconCellComponent,
17854
17845
  ColumnsSelectorComponent,
@@ -31717,7 +31708,7 @@ class CoreModule {
31717
31708
  MaterialModule] }); }
31718
31709
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CoreModule, providers: [...CORE_PIPES], imports: [AboutExtensionListComponent, AboutLicenseListComponent, ModuleListComponent, AboutRepositoryInfoComponent, PackageListComponent, AboutStatusListComponent, AboutServerSettingsComponent, AboutComponent, PdfPasswordDialogComponent, ViewerRenderComponent, ImgViewerComponent, PdfViewerComponent, UnknownFormatComponent, ViewerComponent, DownloadPromptDialogComponent, HeaderLayoutComponent, SidebarActionMenuComponent, LayoutContainerComponent, SidenavLayoutComponent, IdentityUserInfoComponent, TooltipCardComponent, PAGINATION_DIRECTIVES, ToolbarComponent, ContextMenuListComponent, CardViewComponent, CardViewBoolItemComponent, CardViewDateItemComponent, CardViewMapItemComponent, CardViewTextItemComponent, CardViewKeyValuePairsItemComponent, CardViewSelectItemComponent, CardViewArrayItemComponent, SelectFilterInputComponent, FormBaseModule,
31719
31710
  CommentsComponent,
31720
- CommentListComponent, LoginComponent, LoginDialogPanelComponent, LANGUAGE_MENU_DIRECTIVES, InfoDrawerLayoutComponent, InfoDrawerComponent, BooleanCellComponent, AmountCellComponent, NumberCellComponent, LocationCellComponent, IconCellComponent, ColumnsSelectorComponent, JsonCellComponent, DataTableCellComponent, DataTableComponent, TEMPLATE_DIRECTIVES, IconComponent,
31711
+ CommentListComponent, LoginComponent, LoginDialogPanelComponent, LANGUAGE_MENU_DIRECTIVES, InfoDrawerLayoutComponent, InfoDrawerComponent, NumberCellComponent, LocationCellComponent, IconCellComponent, ColumnsSelectorComponent, JsonCellComponent, DataTableCellComponent, DataTableComponent, TEMPLATE_DIRECTIVES, IconComponent,
31721
31712
  SortingPickerComponent, NOTIFICATION_HISTORY_DIRECTIVES, SearchTextInputComponent, UnsavedChangesDialogComponent,
31722
31713
  DynamicChipListComponent,
31723
31714
  MaterialModule, FormBaseModule,