nuxeo-development-framework 5.5.5 → 5.5.7

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.
Files changed (34) hide show
  1. package/bundles/nuxeo-development-framework.umd.js +308 -153
  2. package/bundles/nuxeo-development-framework.umd.js.map +1 -1
  3. package/esm2015/lib/components/reports/charts/chart.token.js +1 -1
  4. package/esm2015/lib/components/reports/charts/components/chart.component.js +1 -1
  5. package/esm2015/lib/components/reports/charts/utility/colors.js +7 -1
  6. package/esm2015/lib/components/reports/charts/utility/css.js +32 -1
  7. package/esm2015/lib/components/reports/ndf-reports/base/base-graph.report.js +30 -1
  8. package/esm2015/lib/components/reports/ndf-reports/charts-components/graph-chart/graph-chart.component.js +1 -1
  9. package/esm2015/lib/components/reports/ndf-reports/components/dynamic-timeline-report/dynamic-timeline-report.component.js +1 -23
  10. package/esm2015/lib/components/reports/ndf-reports/components/graph-report/graph-report.component.js +2 -24
  11. package/esm2015/lib/components/reports/ndf-reports/services/report-config-mapper.service.js +3 -9
  12. package/esm2015/lib/components/reports/ndf-reports/utilities/dataset-colors.js +3 -5
  13. package/esm2015/lib/components/spell-checker-field/spell-checker-field.module.js +1 -1
  14. package/esm2015/lib/components/tables/table/dynamic-column/dynamic-column.component.js +10 -5
  15. package/esm2015/lib/components/tables/table/dynamic-component.js +10 -5
  16. package/esm2015/lib/core/services/column-renderer/column-renderer-registry.service.js +102 -0
  17. package/esm2015/lib/core/services/column-renderer/index.js +2 -0
  18. package/esm2015/lib/core/services/extension/extension.service.js +35 -4
  19. package/esm2015/lib/core/services/index.js +2 -1
  20. package/fesm2015/nuxeo-development-framework.js +298 -145
  21. package/fesm2015/nuxeo-development-framework.js.map +1 -1
  22. package/lib/components/reports/charts/chart.token.d.ts +3 -0
  23. package/lib/components/reports/charts/utility/colors.d.ts +1 -0
  24. package/lib/components/reports/charts/utility/css.d.ts +4 -0
  25. package/lib/components/reports/ndf-reports/base/base-graph.report.d.ts +5 -1
  26. package/lib/components/reports/ndf-reports/components/dynamic-timeline-report/dynamic-timeline-report.component.d.ts +2 -5
  27. package/lib/components/reports/ndf-reports/components/graph-report/graph-report.component.d.ts +1 -5
  28. package/lib/components/tables/table/dynamic-column/dynamic-column.component.d.ts +3 -1
  29. package/lib/components/tables/table/dynamic-component.d.ts +3 -1
  30. package/lib/core/services/column-renderer/column-renderer-registry.service.d.ts +62 -0
  31. package/lib/core/services/column-renderer/index.d.ts +1 -0
  32. package/lib/core/services/extension/extension.service.d.ts +33 -0
  33. package/lib/core/services/index.d.ts +1 -0
  34. package/package.json +1 -1
@@ -4,5 +4,8 @@ export declare type ChartDefaultsOptions = {
4
4
  globalPlugins?: Plugin[];
5
5
  fontFamily?: string;
6
6
  fontSize?: number;
7
+ color?: string;
8
+ borderColor?: string;
9
+ backgroundColor?: string;
7
10
  };
8
11
  export declare const CHART_DEFAULTS_OPTIONS: InjectionToken<ChartDefaultsOptions>;
@@ -14,3 +14,4 @@ export declare function createConicGradient(chart: Chart, colors: {
14
14
  startColor: string;
15
15
  endColor: string;
16
16
  }): any;
17
+ export declare function isColor(str: string): boolean;
@@ -43,3 +43,7 @@ export declare const getColors: (length?: number, staticColors?: string[]) => st
43
43
  * @returns {string} - The text color, either the dark color (`--chart-value-dark-color`) or the light color (`--chart-value-light-color`).
44
44
  */
45
45
  export declare function getTextColor(backgroundColor: string): string;
46
+ export declare function getCssColors(colors: string[]): string[];
47
+ export declare function isCssVar(value: string): boolean;
48
+ export declare function extractCssVar(data: string): string;
49
+ export declare function resolveColor(value: string | undefined, cssVar: string, fallback: string): string;
@@ -1,14 +1,18 @@
1
1
  import { ComponentType } from '@angular/cdk/portal';
2
+ import { AfterViewInit, OnDestroy } from '@angular/core';
2
3
  import { DynamicLineChart, DynamicLineChartDefinition, GraphChart, GraphChartDefinition } from '../models';
3
4
  import { ChartThemeService } from '../services';
4
5
  import { ReportsDialogService } from '../services/reports-dialog.service';
5
6
  import { BaseReport } from './base-report';
6
7
  import * as i0 from "@angular/core";
7
- export declare abstract class BaseGraphReport<TDefinition extends GraphChartDefinition | DynamicLineChartDefinition, TConfig extends GraphChart | DynamicLineChart> extends BaseReport<TDefinition, TConfig> {
8
+ export declare abstract class BaseGraphReport<TDefinition extends GraphChartDefinition | DynamicLineChartDefinition, TConfig extends GraphChart | DynamicLineChart> extends BaseReport<TDefinition, TConfig> implements AfterViewInit, OnDestroy {
8
9
  protected _dialog: ReportsDialogService<any>;
9
10
  protected _chartThemeService: ChartThemeService;
10
11
  protected _initialTheme: "dark" | "light";
11
12
  openGraphDialog(component?: ComponentType<any>): void;
13
+ ngAfterViewInit(): void;
14
+ ngOnDestroy(): void;
15
+ protected _setupThemeWatcher(): void;
12
16
  static ɵfac: i0.ɵɵFactoryDeclaration<BaseGraphReport<any, any>, never>;
13
17
  static ɵdir: i0.ɵɵDirectiveDeclaration<BaseGraphReport<any, any>, never, never, {}, {}, never>;
14
18
  }
@@ -1,9 +1,9 @@
1
- import { AfterViewInit, Injector, OnDestroy } from '@angular/core';
1
+ import { Injector } from '@angular/core';
2
2
  import { GraphChartComponent } from '../../charts-components';
3
3
  import { BaseGraphReport } from '../../base/base-graph.report';
4
4
  import { DynamicLineChart, DynamicLineChartDefinition, TimeGroups } from '../../models';
5
5
  import * as i0 from "@angular/core";
6
- export declare class DynamicTimelineReportComponent extends BaseGraphReport<DynamicLineChartDefinition, DynamicLineChart> implements AfterViewInit, OnDestroy {
6
+ export declare class DynamicTimelineReportComponent extends BaseGraphReport<DynamicLineChartDefinition, DynamicLineChart> {
7
7
  injector: Injector;
8
8
  private readonly _timelineService;
9
9
  graphChartComponent: GraphChartComponent;
@@ -12,14 +12,11 @@ export declare class DynamicTimelineReportComponent extends BaseGraphReport<Dyna
12
12
  filterCriteria$: import("rxjs").Observable<any>;
13
13
  report$: import("rxjs").Observable<any>;
14
14
  constructor(injector: Injector);
15
- ngAfterViewInit(): void;
16
- ngOnDestroy(): void;
17
15
  _subscribeToLanguage(): void;
18
16
  printChart(): void;
19
17
  changeGroup(group: TimeGroups): void;
20
18
  openTimelineDialog(): void;
21
19
  openDetails(): void;
22
- private _setupThemeWatcher;
23
20
  static ɵfac: i0.ɵɵFactoryDeclaration<DynamicTimelineReportComponent, never>;
24
21
  static ɵcmp: i0.ɵɵComponentDeclaration<DynamicTimelineReportComponent, "app-dynamic-timeline-report", never, {}, {}, never, never>;
25
22
  }
@@ -1,16 +1,12 @@
1
- import { AfterViewInit, OnDestroy } from '@angular/core';
2
1
  import { GraphChartComponent } from '../../charts-components';
3
2
  import { BaseGraphReport } from '../../base/base-graph.report';
4
3
  import { ChartTypes, GraphChart, GraphChartDefinition } from '../../models';
5
4
  import * as i0 from "@angular/core";
6
- export declare class GraphReportComponent extends BaseGraphReport<GraphChartDefinition, GraphChart> implements AfterViewInit, OnDestroy {
5
+ export declare class GraphReportComponent extends BaseGraphReport<GraphChartDefinition, GraphChart> {
7
6
  graphChartComponent: GraphChartComponent;
8
7
  chartType$: import("rxjs").Observable<"line" | "scatter" | "bubble" | "pie" | "doughnut" | "polarArea" | "radar" | "verticalBar" | "horizontalBar">;
9
- ngAfterViewInit(): void;
10
- ngOnDestroy(): void;
11
8
  changeChartType(type: ChartTypes): void;
12
9
  printChart(): void;
13
- private _setupThemeWatcher;
14
10
  static ɵfac: i0.ɵɵFactoryDeclaration<GraphReportComponent, never>;
15
11
  static ɵcmp: i0.ɵɵComponentDeclaration<GraphReportComponent, "app-graph-report", never, {}, {}, never, never>;
16
12
  }
@@ -1,8 +1,10 @@
1
1
  import { ChangeDetectorRef, ComponentFactoryResolver, OnChanges, OnDestroy, OnInit, SimpleChanges, ViewContainerRef } from '@angular/core';
2
2
  import { ExtensionService } from '../../../../core/services/extension/extension.service';
3
+ import { ColumnRendererRegistryService } from '../../../../core/services';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DynamicColumnComponent implements OnInit, OnChanges, OnDestroy {
5
6
  private extensions;
7
+ private _columnRegister;
6
8
  private componentFactoryResolver;
7
9
  private cdr;
8
10
  content: ViewContainerRef;
@@ -10,7 +12,7 @@ export declare class DynamicColumnComponent implements OnInit, OnChanges, OnDest
10
12
  context: any;
11
13
  column: any;
12
14
  private componentRef;
13
- constructor(extensions: ExtensionService, componentFactoryResolver: ComponentFactoryResolver, cdr: ChangeDetectorRef);
15
+ constructor(extensions: ExtensionService, _columnRegister: ColumnRendererRegistryService, componentFactoryResolver: ComponentFactoryResolver, cdr: ChangeDetectorRef);
14
16
  ngOnInit(): void;
15
17
  ngOnChanges(changes: SimpleChanges): void;
16
18
  ngOnDestroy(): void;
@@ -1,8 +1,10 @@
1
1
  import { ComponentFactoryResolver, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { ExtensionService } from '../../../core/services/extension/extension.service';
3
+ import { ColumnRendererRegistryService } from '../../../core/services';
3
4
  import * as i0 from "@angular/core";
4
5
  export declare class DynamicCustomComponent implements OnInit, OnChanges, OnDestroy {
5
6
  private _extensions;
7
+ private _columnRegister;
6
8
  private _factoryResolver;
7
9
  private _vcr;
8
10
  componentName: string;
@@ -10,7 +12,7 @@ export declare class DynamicCustomComponent implements OnInit, OnChanges, OnDest
10
12
  rowAction: EventEmitter<any>;
11
13
  onClick: EventEmitter<any>;
12
14
  private _componentRef;
13
- constructor(_extensions: ExtensionService, _factoryResolver: ComponentFactoryResolver);
15
+ constructor(_extensions: ExtensionService, _columnRegister: ColumnRendererRegistryService, _factoryResolver: ComponentFactoryResolver);
14
16
  ngOnInit(): void;
15
17
  ngOnChanges(changes: SimpleChanges): void;
16
18
  private updateInstance;
@@ -0,0 +1,62 @@
1
+ import { Type } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare type CategoryType = 'common' | 'custom';
4
+ export interface ColumnTypeDefinition {
5
+ name: string;
6
+ type: string;
7
+ app?: string;
8
+ description?: string;
9
+ icon?: string;
10
+ component: Type<any>;
11
+ category: CategoryType;
12
+ }
13
+ export declare class ColumnRendererRegistryService {
14
+ private registry;
15
+ register(definition: ColumnTypeDefinition): void;
16
+ register(definition: ColumnTypeDefinition[]): void;
17
+ /**
18
+ * Retrieves a column type definition by its unique type key.
19
+ * @param type The column type identifier
20
+ */
21
+ get(type: string): ColumnTypeDefinition | undefined;
22
+ /**
23
+ * Returns all registered column type definitions.
24
+ */
25
+ getAll(): ColumnTypeDefinition[];
26
+ /**
27
+ * Gets column types filtered by app
28
+ */
29
+ getByApp(app: string): ColumnTypeDefinition[];
30
+ /**
31
+ * Returns only the component associated with a column type.
32
+ * @param type The column type identifier
33
+ */
34
+ getComponent(type: string): Type<unknown> | undefined;
35
+ /**
36
+ * Gets all column types filtered by category
37
+ */
38
+ getByCategory(category: string): ColumnTypeDefinition[];
39
+ /**
40
+ * Returns all unique categories
41
+ */
42
+ getCategories(): string[];
43
+ /**
44
+ * Returns column types grouped by category
45
+ */
46
+ getGroupedByCategory(): Record<string, ColumnTypeDefinition[]>;
47
+ /**
48
+ * Gets column types filtered by multiple categories
49
+ */
50
+ getByCategories(categories: string[]): ColumnTypeDefinition[];
51
+ /**
52
+ * Checks if a column type exists
53
+ */
54
+ has(type: string): boolean;
55
+ /**
56
+ * Clears all registered column types (mainly for testing or hot reload scenarios).
57
+ */
58
+ clear(): void;
59
+ private _set;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnRendererRegistryService, never>;
61
+ static ɵprov: i0.ɵɵInjectableDeclaration<ColumnRendererRegistryService>;
62
+ }
@@ -0,0 +1 @@
1
+ export * from './column-renderer-registry.service';
@@ -41,6 +41,39 @@ export declare class ExtensionService {
41
41
  /**
42
42
  * Adds one or more new components to the existing set.
43
43
  * @param values The new components to add
44
+ * @deprecated This method is deprecated for column components and will be removed in a future version.
45
+ * Use `ColumnRendererRegistryService.register()` instead for registering column components.
46
+ *
47
+ * @example
48
+ * // For columns (deprecated)
49
+ * this.setComponents({ 'common.components.text': TextComponent, 'number': NumberComponent });
50
+ *
51
+ * // For columns (recommended - single)
52
+ * this.columnRegistry.register({
53
+ * name: 'Text Column',
54
+ * type: 'common.text',
55
+ * category: 'basic',
56
+ * component: TextComponent
57
+ * });
58
+ *
59
+ * // For columns (recommended - multiple)
60
+ * this.columnRegistry.register([
61
+ * {
62
+ * name: 'Text Column',
63
+ * type: 'common.text',
64
+ * category: 'basic',
65
+ * component: TextComponent
66
+ * },
67
+ * {
68
+ * name: 'Number Column',
69
+ * type: 'common.number',
70
+ * category: 'basic',
71
+ * component: NumberComponent
72
+ * }
73
+ * ]);
74
+ *
75
+ * // For viewer components (still supported)
76
+ * this.setComponents({ 'viewer.components.pdf': PdfViewerComponent });
44
77
  */
45
78
  setComponents(values: {
46
79
  [key: string]: Type<{}>;
@@ -1,3 +1,4 @@
1
1
  export * from './ndf-transform.service';
2
2
  export * from './nuxeo/nuxeo.service';
3
3
  export * from './roles/roles.service';
4
+ export * from './column-renderer';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nuxeo-development-framework",
3
- "version": "5.5.5",
3
+ "version": "5.5.7",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "12.2.3",
6
6
  "@angular/common": "12.2.3",