@decaf-ts/for-angular 0.0.24 → 0.0.26

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 (78) hide show
  1. package/fesm2022/decaf-ts-for-angular.mjs +1512 -1517
  2. package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
  3. package/index.d.ts +7470 -3
  4. package/package.json +14 -17
  5. package/components/component-renderer/component-renderer.component.d.ts +0 -278
  6. package/components/crud-field/crud-field.component.d.ts +0 -611
  7. package/components/crud-form/constants.d.ts +0 -5
  8. package/components/crud-form/crud-form.component.d.ts +0 -288
  9. package/components/crud-form/types.d.ts +0 -17
  10. package/components/empty-state/empty-state.component.d.ts +0 -300
  11. package/components/fieldset/fieldset.component.d.ts +0 -555
  12. package/components/filter/filter.component.d.ts +0 -514
  13. package/components/for-angular-components.module.d.ts +0 -20
  14. package/components/index.d.ts +0 -16
  15. package/components/layout/layout.component.d.ts +0 -110
  16. package/components/list/list.component.d.ts +0 -848
  17. package/components/list-item/list-item.component.d.ts +0 -390
  18. package/components/model-renderer/model-renderer.component.d.ts +0 -97
  19. package/components/pagination/constants.d.ts +0 -7
  20. package/components/pagination/pagination.component.d.ts +0 -264
  21. package/components/searchbar/searchbar.component.d.ts +0 -407
  22. package/components/steped-form/steped-form.component.d.ts +0 -243
  23. package/directives/collapsable.directive.d.ts +0 -9
  24. package/directives/index.d.ts +0 -1
  25. package/engine/DynamicModule.d.ts +0 -17
  26. package/engine/NgxBaseComponent.d.ts +0 -541
  27. package/engine/NgxCrudFormField.d.ts +0 -123
  28. package/engine/NgxFormService.d.ts +0 -601
  29. package/engine/NgxRenderingEngine.d.ts +0 -282
  30. package/engine/ValidatorFactory.d.ts +0 -15
  31. package/engine/constants.d.ts +0 -168
  32. package/engine/decorators.d.ts +0 -25
  33. package/engine/index.d.ts +0 -18
  34. package/engine/interfaces.d.ts +0 -271
  35. package/engine/types.d.ts +0 -200
  36. package/esm2022/components/component-renderer/component-renderer.component.mjs +0 -321
  37. package/esm2022/components/crud-field/crud-field.component.mjs +0 -518
  38. package/esm2022/components/crud-form/constants.mjs +0 -14
  39. package/esm2022/components/crud-form/crud-form.component.mjs +0 -259
  40. package/esm2022/components/crud-form/types.mjs +0 -2
  41. package/esm2022/components/empty-state/empty-state.component.mjs +0 -345
  42. package/esm2022/components/fieldset/fieldset.component.mjs +0 -677
  43. package/esm2022/components/filter/filter.component.mjs +0 -700
  44. package/esm2022/components/for-angular-components.module.mjs +0 -84
  45. package/esm2022/components/index.mjs +0 -20
  46. package/esm2022/components/layout/layout.component.mjs +0 -150
  47. package/esm2022/components/list/list.component.mjs +0 -1238
  48. package/esm2022/components/list-item/list-item.component.mjs +0 -405
  49. package/esm2022/components/model-renderer/model-renderer.component.mjs +0 -144
  50. package/esm2022/components/pagination/constants.mjs +0 -2
  51. package/esm2022/components/pagination/pagination.component.mjs +0 -321
  52. package/esm2022/components/searchbar/searchbar.component.mjs +0 -491
  53. package/esm2022/components/steped-form/steped-form.component.mjs +0 -291
  54. package/esm2022/decaf-ts-for-angular.mjs +0 -5
  55. package/esm2022/directives/collapsable.directive.mjs +0 -29
  56. package/esm2022/directives/index.mjs +0 -2
  57. package/esm2022/engine/DynamicModule.mjs +0 -18
  58. package/esm2022/engine/NgxBaseComponent.mjs +0 -541
  59. package/esm2022/engine/NgxCrudFormField.mjs +0 -137
  60. package/esm2022/engine/NgxFormService.mjs +0 -917
  61. package/esm2022/engine/NgxRenderingEngine.mjs +0 -376
  62. package/esm2022/engine/ValidatorFactory.mjs +0 -106
  63. package/esm2022/engine/constants.mjs +0 -170
  64. package/esm2022/engine/decorators.mjs +0 -38
  65. package/esm2022/engine/index.mjs +0 -19
  66. package/esm2022/engine/interfaces.mjs +0 -4
  67. package/esm2022/engine/types.mjs +0 -2
  68. package/esm2022/for-angular-common.module.mjs +0 -84
  69. package/esm2022/helpers/index.mjs +0 -13
  70. package/esm2022/helpers/utils.mjs +0 -436
  71. package/esm2022/i18n/Loader.mjs +0 -86
  72. package/esm2022/i18n/data/en.json +0 -80
  73. package/esm2022/public-apis.mjs +0 -15
  74. package/for-angular-common.module.d.ts +0 -50
  75. package/helpers/index.d.ts +0 -12
  76. package/helpers/utils.d.ts +0 -279
  77. package/i18n/Loader.d.ts +0 -43
  78. package/public-apis.d.ts +0 -14
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decaf-ts/for-angular",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "author": "Tiago Venceslau",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {
@@ -12,17 +12,16 @@
12
12
  "npm": ">=10.0.0"
13
13
  },
14
14
  "peerDependencies": {
15
- "@angular/animations": "^18.2.14",
16
- "@angular/cdk": "^18.2.14",
17
- "@angular/common": "^18.2.14",
18
- "@angular/compiler": "^18.2.14",
19
- "@angular/core": "^18.2.14",
20
- "@angular/forms": "^18.2.14",
21
- "@angular/platform-browser": "^18.2.14",
22
- "@angular/platform-browser-dynamic": "^18.2.14",
23
- "@angular/router": "^18.2.14",
15
+ "@angular/animations": "^20.2.4",
16
+ "@angular/common": "^20.2.4",
17
+ "@angular/compiler": "^20.2.4",
18
+ "@angular/core": "^20.2.4",
19
+ "@angular/forms": "^20.2.4",
20
+ "@angular/platform-browser": "^20.2.4",
21
+ "@angular/platform-browser-dynamic": "^20.2.4",
22
+ "@angular/router": "^20.2.4",
24
23
  "@decaf-ts/cli": "latest",
25
- "@decaf-ts/core": "latest",
24
+ "@decaf-ts/core": "^0.5.29",
26
25
  "@decaf-ts/db-decorators": "latest",
27
26
  "@decaf-ts/decorator-validation": "latest",
28
27
  "@decaf-ts/for-http": "latest",
@@ -32,15 +31,15 @@
32
31
  "@decaf-ts/styles": "latest",
33
32
  "@decaf-ts/transactional-decorators": "latest",
34
33
  "@decaf-ts/ui-decorators": "latest",
35
- "@ionic/angular": "^8.5.5",
36
- "@ngx-translate/core": "^16.0.4",
37
- "@ngx-translate/http-loader": "^16.0.1",
34
+ "@ionic/angular": "^8.7.4",
35
+ "@ngx-translate/core": "^17.0.0",
36
+ "@ngx-translate/http-loader": "^17.0.0",
38
37
  "@tabler/icons-webfont": "^3.31.0",
39
38
  "axios": "^1.8.4",
40
39
  "ionicons": "^7.4.0",
41
40
  "reflect-metadata": "^0.2.1",
42
41
  "rxjs": "~7.8.0",
43
- "zone.js": "~0.14.10"
42
+ "zone.js": "^0.15.1"
44
43
  },
45
44
  "schematics": "./schematics/collection.json",
46
45
  "eslintConfig": {
@@ -56,8 +55,6 @@
56
55
  },
57
56
  ".": {
58
57
  "types": "./index.d.ts",
59
- "esm2022": "./esm2022/decaf-ts-for-angular.mjs",
60
- "esm": "./esm2022/decaf-ts-for-angular.mjs",
61
58
  "default": "./fesm2022/decaf-ts-for-angular.mjs"
62
59
  }
63
60
  },
@@ -1,278 +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 NgxRenderingEngine. 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
- children: KeyValue[];
102
- /**
103
- * @description Event emitter for events from the rendered component.
104
- * @summary This output property emits events that originate from the dynamically rendered
105
- * component. It allows the parent component to listen for and respond to events from the
106
- * dynamic component, creating a communication channel between the parent and the dynamically
107
- * rendered child.
108
- *
109
- * @type {EventEmitter<RendererCustomEvent>}
110
- * @memberOf ComponentRendererComponent
111
- */
112
- listenEvent: EventEmitter<RendererCustomEvent>;
113
- /**
114
- * @description Logger instance for the component.
115
- * @summary This property holds a Logger instance specific to this component.
116
- * It's used to log information, warnings, and errors related to the component's
117
- * operations, particularly useful for debugging and monitoring the dynamic
118
- * component rendering process.
119
- *
120
- * @type {Logger}
121
- * @memberOf ComponentRendererComponent
122
- */
123
- logger: Logger;
124
- /**
125
- * @description Repository model for data operations.
126
- * @summary The data model repository that this component will use for CRUD operations.
127
- * This provides a connection to the data layer for retrieving and manipulating data.
128
- *
129
- * @type {Model| undefined}
130
- */
131
- model: Model | undefined;
132
- parent: undefined | KeyValue;
133
- inner?: TemplateRef<unknown>;
134
- uid: string;
135
- /**
136
- * @description Creates an instance of ComponentRendererComponent.
137
- * @summary Initializes a new ComponentRendererComponent. This component doesn't require
138
- * any dependencies to be injected in its constructor as it uses the inject function to
139
- * obtain the EnvironmentInjector.
140
- *
141
- * @memberOf ComponentRendererComponent
142
- */
143
- constructor();
144
- /**
145
- * @description Initializes the component after Angular first displays the data-bound properties.
146
- * @summary Sets up the component by creating the dynamic component specified by the tag input.
147
- * This method is called once when the component is initialized and triggers the dynamic
148
- * component creation process with the provided tag name and global properties.
149
- *
150
- * @mermaid
151
- * sequenceDiagram
152
- * participant A as Angular Lifecycle
153
- * participant C as ComponentRendererComponent
154
- * participant R as NgxRenderingEngine
155
- *
156
- * A->>C: ngOnInit()
157
- * C->>C: createComponent(tag, globals)
158
- * C->>R: components(tag)
159
- * R-->>C: Return component constructor
160
- * C->>C: Process component inputs
161
- * C->>C: Create component instance
162
- * C->>C: subscribeEvents()
163
- *
164
- * @return {void}
165
- * @memberOf ComponentRendererComponent
166
- */
167
- ngOnInit(): void;
168
- /**
169
- * @description Cleans up resources when the component is destroyed.
170
- * @summary Performs cleanup operations when the component is being destroyed by Angular.
171
- * This includes unsubscribing from all event emitters of the dynamic component and
172
- * destroying the rendering engine instance to prevent memory leaks.
173
- *
174
- * @mermaid
175
- * sequenceDiagram
176
- * participant A as Angular Lifecycle
177
- * participant C as ComponentRendererComponent
178
- * participant R as NgxRenderingEngine
179
- *
180
- * A->>C: ngOnDestroy()
181
- * alt component exists
182
- * C->>C: unsubscribeEvents()
183
- * C->>R: destroy()
184
- * end
185
- *
186
- * @return {Promise<void>} A promise that resolves when cleanup is complete
187
- * @memberOf ComponentRendererComponent
188
- */
189
- ngOnDestroy(): Promise<void>;
190
- /**
191
- * @description Creates and renders a dynamic component.
192
- * @summary This method handles the creation of a dynamic component based on the provided tag.
193
- * It retrieves the component constructor from the rendering engine, processes its inputs,
194
- * filters out unmapped properties, creates the component instance, and sets up event subscriptions.
195
- *
196
- * @param {string} tag - The tag name of the component to create
197
- * @param {KeyValue} globals - Global properties to pass to the component
198
- * @return {void}
199
- *
200
- * @mermaid
201
- * sequenceDiagram
202
- * participant C as ComponentRendererComponent
203
- * participant R as NgxRenderingEngine
204
- * participant V as ViewContainerRef
205
- *
206
- * C->>R: components(tag)
207
- * R-->>C: Return component constructor
208
- * C->>C: reflectComponentType(component)
209
- * C->>C: Process input properties
210
- * C->>C: Filter unmapped properties
211
- * C->>V: clear()
212
- * C->>R: createComponent(component, props, metadata, vcr, injector, [])
213
- * R-->>C: Return component reference
214
- * C->>C: subscribeEvents()
215
- *
216
- * @private
217
- * @memberOf ComponentRendererComponent
218
- */
219
- private createComponent;
220
- private createParentComponent;
221
- /**
222
- * @description Subscribes to events emitted by the dynamic component.
223
- * @summary This method sets up subscriptions to all EventEmitter properties of the
224
- * dynamically created component. When an event is emitted by the dynamic component,
225
- * it is captured and re-emitted through the listenEvent output property with additional
226
- * metadata about the event source.
227
- *
228
- * @mermaid
229
- * sequenceDiagram
230
- * participant C as ComponentRendererComponent
231
- * participant D as Dynamic Component
232
- * participant P as Parent Component
233
- *
234
- * C->>C: subscribeEvents()
235
- * C->>D: Get instance properties
236
- * loop For each property
237
- * C->>C: Check if property is EventEmitter
238
- * alt is EventEmitter
239
- * C->>D: Subscribe to event
240
- * D-->>C: Event emitted
241
- * C->>P: Re-emit event with metadata
242
- * end
243
- * end
244
- *
245
- * @private
246
- * @return {void}
247
- * @memberOf ComponentRendererComponent
248
- */
249
- private subscribeEvents;
250
- /**
251
- * @description Unsubscribes from all events of the dynamic component.
252
- * @summary This method cleans up event subscriptions when the component is being destroyed.
253
- * It iterates through all properties of the dynamic component instance and unsubscribes
254
- * from any EventEmitter properties to prevent memory leaks and unexpected behavior after
255
- * the component is destroyed.
256
- *
257
- * @mermaid
258
- * sequenceDiagram
259
- * participant C as ComponentRendererComponent
260
- * participant D as Dynamic Component
261
- *
262
- * C->>C: unsubscribeEvents()
263
- * C->>D: Get instance properties
264
- * loop For each property
265
- * C->>C: Check if property is EventEmitter
266
- * alt is EventEmitter
267
- * C->>D: Unsubscribe from event
268
- * end
269
- * end
270
- *
271
- * @private
272
- * @return {void}
273
- * @memberOf ComponentRendererComponent
274
- */
275
- private unsubscribeEvents;
276
- static ɵfac: i0.ɵɵFactoryDeclaration<ComponentRendererComponent, never>;
277
- static ɵcmp: i0.ɵɵComponentDeclaration<ComponentRendererComponent, "ngx-decaf-component-renderer", never, { "tag": { "alias": "tag"; "required": true; }; "globals": { "alias": "globals"; "required": false; }; "children": { "alias": "children"; "required": false; }; "model": { "alias": "model"; "required": false; }; "parent": { "alias": "parent"; "required": false; }; }, { "listenEvent": "listenEvent"; }, never, never, true, never>;
278
- }