nuxeo-development-framework 5.5.6 → 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.
@@ -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.6",
3
+ "version": "5.5.7",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "12.2.3",
6
6
  "@angular/common": "12.2.3",