@decaf-ts/for-angular 0.0.11 → 0.0.13

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 (85) hide show
  1. package/package.json +19 -91
  2. package/LICENSE.md +0 -659
  3. package/dist/lib/README.md +0 -92
  4. package/dist/lib/assets/i18n/en.json +0 -140
  5. package/dist/lib/assets/images/angular-logo.svg +0 -45
  6. package/dist/lib/assets/images/decaf-logo-black.svg +0 -22
  7. package/dist/lib/assets/images/decaf-logo-lw.svg +0 -50
  8. package/dist/lib/assets/images/decaf-logo-white.svg +0 -22
  9. package/dist/lib/assets/images/decaf-logo.svg +0 -54
  10. package/dist/lib/components/component-renderer/component-renderer.component.d.ts +0 -276
  11. package/dist/lib/components/crud-field/crud-field.component.d.ts +0 -445
  12. package/dist/lib/components/crud-form/constants.d.ts +0 -5
  13. package/dist/lib/components/crud-form/crud-form.component.d.ts +0 -102
  14. package/dist/lib/components/crud-form/types.d.ts +0 -17
  15. package/dist/lib/components/empty-state/empty-state.component.d.ts +0 -301
  16. package/dist/lib/components/fieldset/fieldset.component.d.ts +0 -199
  17. package/dist/lib/components/filter/filter.component.d.ts +0 -505
  18. package/dist/lib/components/for-angular-components.module.d.ts +0 -20
  19. package/dist/lib/components/index.d.ts +0 -16
  20. package/dist/lib/components/layout/layout.component.d.ts +0 -133
  21. package/dist/lib/components/list/constants.d.ts +0 -29
  22. package/dist/lib/components/list/list.component.d.ts +0 -849
  23. package/dist/lib/components/list-item/list-item.component.d.ts +0 -390
  24. package/dist/lib/components/model-renderer/model-renderer.component.d.ts +0 -96
  25. package/dist/lib/components/pagination/constants.d.ts +0 -7
  26. package/dist/lib/components/pagination/pagination.component.d.ts +0 -264
  27. package/dist/lib/components/searchbar/searchbar.component.d.ts +0 -407
  28. package/dist/lib/directives/collapsable.directive.d.ts +0 -8
  29. package/dist/lib/directives/index.d.ts +0 -1
  30. package/dist/lib/engine/DynamicModule.d.ts +0 -17
  31. package/dist/lib/engine/NgxBaseComponent.d.ts +0 -541
  32. package/dist/lib/engine/NgxCrudFormField.d.ts +0 -118
  33. package/dist/lib/engine/NgxFormService.d.ts +0 -167
  34. package/dist/lib/engine/NgxRenderingEngine.d.ts +0 -127
  35. package/dist/lib/engine/NgxRenderingEngine2.d.ts +0 -250
  36. package/dist/lib/engine/ValidatorFactory.d.ts +0 -15
  37. package/dist/lib/engine/constants.d.ts +0 -151
  38. package/dist/lib/engine/decorators.d.ts +0 -25
  39. package/dist/lib/engine/index.d.ts +0 -16
  40. package/dist/lib/engine/types.d.ts +0 -381
  41. package/dist/lib/esm2022/components/component-renderer/component-renderer.component.mjs +0 -313
  42. package/dist/lib/esm2022/components/crud-field/crud-field.component.mjs +0 -301
  43. package/dist/lib/esm2022/components/crud-form/constants.mjs +0 -14
  44. package/dist/lib/esm2022/components/crud-form/crud-form.component.mjs +0 -139
  45. package/dist/lib/esm2022/components/crud-form/types.mjs +0 -2
  46. package/dist/lib/esm2022/components/empty-state/empty-state.component.mjs +0 -348
  47. package/dist/lib/esm2022/components/fieldset/fieldset.component.mjs +0 -225
  48. package/dist/lib/esm2022/components/filter/filter.component.mjs +0 -689
  49. package/dist/lib/esm2022/components/for-angular-components.module.mjs +0 -71
  50. package/dist/lib/esm2022/components/index.mjs +0 -20
  51. package/dist/lib/esm2022/components/layout/layout.component.mjs +0 -176
  52. package/dist/lib/esm2022/components/list/constants.mjs +0 -6
  53. package/dist/lib/esm2022/components/list/list.component.mjs +0 -1236
  54. package/dist/lib/esm2022/components/list-item/list-item.component.mjs +0 -408
  55. package/dist/lib/esm2022/components/model-renderer/model-renderer.component.mjs +0 -138
  56. package/dist/lib/esm2022/components/pagination/constants.mjs +0 -2
  57. package/dist/lib/esm2022/components/pagination/pagination.component.mjs +0 -323
  58. package/dist/lib/esm2022/components/searchbar/searchbar.component.mjs +0 -493
  59. package/dist/lib/esm2022/decaf-ts-for-angular.mjs +0 -5
  60. package/dist/lib/esm2022/directives/collapsable.directive.mjs +0 -28
  61. package/dist/lib/esm2022/directives/index.mjs +0 -2
  62. package/dist/lib/esm2022/engine/DynamicModule.mjs +0 -18
  63. package/dist/lib/esm2022/engine/NgxBaseComponent.mjs +0 -539
  64. package/dist/lib/esm2022/engine/NgxCrudFormField.mjs +0 -125
  65. package/dist/lib/esm2022/engine/NgxFormService.mjs +0 -315
  66. package/dist/lib/esm2022/engine/NgxRenderingEngine.mjs +0 -192
  67. package/dist/lib/esm2022/engine/NgxRenderingEngine2.mjs +0 -332
  68. package/dist/lib/esm2022/engine/ValidatorFactory.mjs +0 -102
  69. package/dist/lib/esm2022/engine/constants.mjs +0 -160
  70. package/dist/lib/esm2022/engine/decorators.mjs +0 -38
  71. package/dist/lib/esm2022/engine/index.mjs +0 -17
  72. package/dist/lib/esm2022/engine/types.mjs +0 -4
  73. package/dist/lib/esm2022/for-angular.module.mjs +0 -118
  74. package/dist/lib/esm2022/helpers/index.mjs +0 -13
  75. package/dist/lib/esm2022/helpers/utils.mjs +0 -415
  76. package/dist/lib/esm2022/interfaces.mjs +0 -2
  77. package/dist/lib/esm2022/public-apis.mjs +0 -14
  78. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs +0 -7109
  79. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs.map +0 -1
  80. package/dist/lib/for-angular.module.d.ts +0 -45
  81. package/dist/lib/helpers/index.d.ts +0 -12
  82. package/dist/lib/helpers/utils.d.ts +0 -253
  83. package/dist/lib/index.d.ts +0 -5
  84. package/dist/lib/interfaces.d.ts +0 -28
  85. package/dist/lib/public-apis.d.ts +0 -13
@@ -1,276 +0,0 @@
1
- import { ComponentRef, EnvironmentInjector, EventEmitter, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
2
- import { KeyValue, RendererCustomEvent } from '../../engine';
3
- import { Logger } from '@decaf-ts/logging';
4
- import { Model } from '@decaf-ts/decorator-validation';
5
- import * as i0 from "@angular/core";
6
- /**
7
- * @description Dynamic component renderer for Decaf Angular applications.
8
- * @summary This component provides a flexible way to dynamically render Angular components
9
- * at runtime based on a tag name. It handles the creation, property binding, and event
10
- * subscription for dynamically loaded components. This is particularly useful for
11
- * building configurable UIs where components need to be determined at runtime.
12
- *
13
- * @component {ComponentRendererComponent}
14
- * @example
15
- * <ngx-decaf-component-renderer
16
- * [tag]="tag"
17
- * [globals]="globals"
18
- * (listenEvent)="listenEvent($event)">
19
- * </ngx-decaf-component-renderer>
20
- *
21
- * @mermaid
22
- * classDiagram
23
- * class ComponentRendererComponent {
24
- * +ViewContainerRef vcr
25
- * +string tag
26
- * +Record~string, unknown~ globals
27
- * +EnvironmentInjector injector
28
- * +ComponentRef~unknown~ component
29
- * +EventEmitter~RendererCustomEvent~ listenEvent
30
- * +ngOnInit()
31
- * +ngOnDestroy()
32
- * +ngOnChanges(changes)
33
- * -createComponent(tag, globals)
34
- * -subscribeEvents()
35
- * -unsubscribeEvents()
36
- * }
37
- * ComponentRendererComponent --|> OnInit
38
- * ComponentRendererComponent --|> OnChanges
39
- * ComponentRendererComponent --|> OnDestroy
40
- *
41
- * @implements {OnInit}
42
- * @implements {OnChanges}
43
- * @implements {OnDestroy}
44
- */
45
- export declare class ComponentRendererComponent implements OnInit, OnDestroy {
46
- /**
47
- * @description Reference to the container where the dynamic component will be rendered.
48
- * @summary This ViewContainerRef provides the container where the dynamically created
49
- * component will be inserted into the DOM. It's marked as static to ensure it's available
50
- * during the ngOnInit lifecycle hook when the component is created.
51
- *
52
- * @type {ViewContainerRef}
53
- * @memberOf ComponentRendererComponent
54
- */
55
- vcr: ViewContainerRef;
56
- /**
57
- * @description The tag name of the component to be dynamically rendered.
58
- * @summary This input property specifies which component should be rendered by providing
59
- * its registered tag name. The tag must correspond to a component that has been registered
60
- * with the NgxRenderingEngine2. This is a required input as it determines which component
61
- * to create.
62
- *
63
- * @type {string}
64
- * @required
65
- * @memberOf ComponentRendererComponent
66
- */
67
- tag: string;
68
- /**
69
- * @description Global properties to pass to the rendered component.
70
- * @summary This input property allows passing a set of properties to the dynamically
71
- * rendered component. These properties will be mapped to the component's inputs if they
72
- * match. Properties that don't match any input on the target component will be filtered out
73
- * with a warning.
74
- *
75
- * @type {Record<string, unknown>}
76
- * @default {}
77
- * @memberOf ComponentRendererComponent
78
- */
79
- globals: Record<string, unknown>;
80
- /**
81
- * @description Injector used for dependency injection in the dynamic component.
82
- * @summary This injector is used when creating the dynamic component to provide it with
83
- * access to the application's dependency injection system. It ensures that the dynamically
84
- * created component can access the same services and dependencies as statically created
85
- * components.
86
- *
87
- * @type {EnvironmentInjector}
88
- * @memberOf ComponentRendererComponent
89
- */
90
- injector: EnvironmentInjector;
91
- /**
92
- * @description Reference to the dynamically created component.
93
- * @summary This property holds a reference to the ComponentRef of the dynamically created
94
- * component. It's used to interact with the component instance, subscribe to its events,
95
- * and properly destroy it when the renderer is destroyed.
96
- *
97
- * @type {ComponentRef<unknown>}
98
- * @memberOf ComponentRendererComponent
99
- */
100
- component: ComponentRef<unknown>;
101
- /**
102
- * @description Event emitter for events from the rendered component.
103
- * @summary This output property emits events that originate from the dynamically rendered
104
- * component. It allows the parent component to listen for and respond to events from the
105
- * dynamic component, creating a communication channel between the parent and the dynamically
106
- * rendered child.
107
- *
108
- * @type {EventEmitter<RendererCustomEvent>}
109
- * @memberOf ComponentRendererComponent
110
- */
111
- listenEvent: EventEmitter<RendererCustomEvent>;
112
- /**
113
- * @description Logger instance for the component.
114
- * @summary This property holds a Logger instance specific to this component.
115
- * It's used to log information, warnings, and errors related to the component's
116
- * operations, particularly useful for debugging and monitoring the dynamic
117
- * component rendering process.
118
- *
119
- * @type {Logger}
120
- * @memberOf ComponentRendererComponent
121
- */
122
- logger: Logger;
123
- /**
124
- * @description Repository model for data operations.
125
- * @summary The data model repository that this component will use for CRUD operations.
126
- * This provides a connection to the data layer for retrieving and manipulating data.
127
- *
128
- * @type {Model| undefined}
129
- */
130
- model: Model | undefined;
131
- parent: undefined | KeyValue;
132
- inner?: TemplateRef<unknown>;
133
- /**
134
- * @description Creates an instance of ComponentRendererComponent.
135
- * @summary Initializes a new ComponentRendererComponent. This component doesn't require
136
- * any dependencies to be injected in its constructor as it uses the inject function to
137
- * obtain the EnvironmentInjector.
138
- *
139
- * @memberOf ComponentRendererComponent
140
- */
141
- constructor();
142
- /**
143
- * @description Initializes the component after Angular first displays the data-bound properties.
144
- * @summary Sets up the component by creating the dynamic component specified by the tag input.
145
- * This method is called once when the component is initialized and triggers the dynamic
146
- * component creation process with the provided tag name and global properties.
147
- *
148
- * @mermaid
149
- * sequenceDiagram
150
- * participant A as Angular Lifecycle
151
- * participant C as ComponentRendererComponent
152
- * participant R as NgxRenderingEngine2
153
- *
154
- * A->>C: ngOnInit()
155
- * C->>C: createComponent(tag, globals)
156
- * C->>R: components(tag)
157
- * R-->>C: Return component constructor
158
- * C->>C: Process component inputs
159
- * C->>C: Create component instance
160
- * C->>C: subscribeEvents()
161
- *
162
- * @return {void}
163
- * @memberOf ComponentRendererComponent
164
- */
165
- ngOnInit(): void;
166
- /**
167
- * @description Cleans up resources when the component is destroyed.
168
- * @summary Performs cleanup operations when the component is being destroyed by Angular.
169
- * This includes unsubscribing from all event emitters of the dynamic component and
170
- * destroying the rendering engine instance to prevent memory leaks.
171
- *
172
- * @mermaid
173
- * sequenceDiagram
174
- * participant A as Angular Lifecycle
175
- * participant C as ComponentRendererComponent
176
- * participant R as NgxRenderingEngine2
177
- *
178
- * A->>C: ngOnDestroy()
179
- * alt component exists
180
- * C->>C: unsubscribeEvents()
181
- * C->>R: destroy()
182
- * end
183
- *
184
- * @return {Promise<void>} A promise that resolves when cleanup is complete
185
- * @memberOf ComponentRendererComponent
186
- */
187
- ngOnDestroy(): Promise<void>;
188
- /**
189
- * @description Creates and renders a dynamic component.
190
- * @summary This method handles the creation of a dynamic component based on the provided tag.
191
- * It retrieves the component constructor from the rendering engine, processes its inputs,
192
- * filters out unmapped properties, creates the component instance, and sets up event subscriptions.
193
- *
194
- * @param {string} tag - The tag name of the component to create
195
- * @param {KeyValue} globals - Global properties to pass to the component
196
- * @return {void}
197
- *
198
- * @mermaid
199
- * sequenceDiagram
200
- * participant C as ComponentRendererComponent
201
- * participant R as NgxRenderingEngine2
202
- * participant V as ViewContainerRef
203
- *
204
- * C->>R: components(tag)
205
- * R-->>C: Return component constructor
206
- * C->>C: reflectComponentType(component)
207
- * C->>C: Process input properties
208
- * C->>C: Filter unmapped properties
209
- * C->>V: clear()
210
- * C->>R: createComponent(component, props, metadata, vcr, injector, [])
211
- * R-->>C: Return component reference
212
- * C->>C: subscribeEvents()
213
- *
214
- * @private
215
- * @memberOf ComponentRendererComponent
216
- */
217
- private createComponent;
218
- createParentComponent(): void;
219
- /**
220
- * @description Subscribes to events emitted by the dynamic component.
221
- * @summary This method sets up subscriptions to all EventEmitter properties of the
222
- * dynamically created component. When an event is emitted by the dynamic component,
223
- * it is captured and re-emitted through the listenEvent output property with additional
224
- * metadata about the event source.
225
- *
226
- * @mermaid
227
- * sequenceDiagram
228
- * participant C as ComponentRendererComponent
229
- * participant D as Dynamic Component
230
- * participant P as Parent Component
231
- *
232
- * C->>C: subscribeEvents()
233
- * C->>D: Get instance properties
234
- * loop For each property
235
- * C->>C: Check if property is EventEmitter
236
- * alt is EventEmitter
237
- * C->>D: Subscribe to event
238
- * D-->>C: Event emitted
239
- * C->>P: Re-emit event with metadata
240
- * end
241
- * end
242
- *
243
- * @private
244
- * @return {void}
245
- * @memberOf ComponentRendererComponent
246
- */
247
- private subscribeEvents;
248
- /**
249
- * @description Unsubscribes from all events of the dynamic component.
250
- * @summary This method cleans up event subscriptions when the component is being destroyed.
251
- * It iterates through all properties of the dynamic component instance and unsubscribes
252
- * from any EventEmitter properties to prevent memory leaks and unexpected behavior after
253
- * the component is destroyed.
254
- *
255
- * @mermaid
256
- * sequenceDiagram
257
- * participant C as ComponentRendererComponent
258
- * participant D as Dynamic Component
259
- *
260
- * C->>C: unsubscribeEvents()
261
- * C->>D: Get instance properties
262
- * loop For each property
263
- * C->>C: Check if property is EventEmitter
264
- * alt is EventEmitter
265
- * C->>D: Unsubscribe from event
266
- * end
267
- * end
268
- *
269
- * @private
270
- * @return {void}
271
- * @memberOf ComponentRendererComponent
272
- */
273
- private unsubscribeEvents;
274
- static ɵfac: i0.ɵɵFactoryDeclaration<ComponentRendererComponent, never>;
275
- static ɵcmp: i0.ɵɵComponentDeclaration<ComponentRendererComponent, "ngx-decaf-component-renderer", never, { "tag": { "alias": "tag"; "required": true; }; "globals": { "alias": "globals"; "required": false; }; "model": { "alias": "model"; "required": false; }; "parent": { "alias": "parent"; "required": false; }; }, { "listenEvent": "listenEvent"; }, never, never, true, never>;
276
- }