@decaf-ts/for-angular 0.0.15 → 0.0.17

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 (61) hide show
  1. package/assets/i18n/en.json +10 -0
  2. package/assets/i18n/pt.json +149 -0
  3. package/assets/icons/icon-128.webp +0 -0
  4. package/assets/icons/icon-192.webp +0 -0
  5. package/assets/icons/icon-256.webp +0 -0
  6. package/assets/icons/icon-48.webp +0 -0
  7. package/assets/icons/icon-512.webp +0 -0
  8. package/assets/icons/icon-72.webp +0 -0
  9. package/assets/icons/icon-96.webp +0 -0
  10. package/assets/images/apple-touch-icon.png +0 -0
  11. package/assets/images/favicon.png +0 -0
  12. package/assets/images/favicon.svg +29 -0
  13. package/components/component-renderer/component-renderer.component.d.ts +5 -4
  14. package/components/crud-field/crud-field.component.d.ts +174 -19
  15. package/components/crud-form/crud-form.component.d.ts +170 -6
  16. package/components/fieldset/fieldset.component.d.ts +374 -36
  17. package/components/list/list.component.d.ts +1 -1
  18. package/components/list-item/list-item.component.d.ts +2 -2
  19. package/components/model-renderer/model-renderer.component.d.ts +1 -5
  20. package/directives/collapsable.directive.d.ts +1 -0
  21. package/engine/NgxBaseComponent.d.ts +6 -6
  22. package/engine/NgxCrudFormField.d.ts +5 -2
  23. package/engine/NgxFormService.d.ts +113 -12
  24. package/engine/NgxRenderingEngine.d.ts +150 -25
  25. package/engine/constants.d.ts +11 -6
  26. package/engine/decorators.d.ts +2 -2
  27. package/engine/index.d.ts +4 -2
  28. package/engine/interfaces.d.ts +261 -0
  29. package/engine/types.d.ts +3 -206
  30. package/esm2022/components/component-renderer/component-renderer.component.mjs +13 -11
  31. package/esm2022/components/crud-field/crud-field.component.mjs +193 -8
  32. package/esm2022/components/crud-form/crud-form.component.mjs +116 -11
  33. package/esm2022/components/empty-state/empty-state.component.mjs +3 -3
  34. package/esm2022/components/fieldset/fieldset.component.mjs +482 -43
  35. package/esm2022/components/filter/filter.component.mjs +3 -3
  36. package/esm2022/components/layout/layout.component.mjs +3 -3
  37. package/esm2022/components/list/list.component.mjs +4 -5
  38. package/esm2022/components/list-item/list-item.component.mjs +9 -9
  39. package/esm2022/components/model-renderer/model-renderer.component.mjs +9 -8
  40. package/esm2022/components/pagination/pagination.component.mjs +4 -4
  41. package/esm2022/components/searchbar/searchbar.component.mjs +3 -3
  42. package/esm2022/directives/collapsable.directive.mjs +3 -2
  43. package/esm2022/engine/NgxBaseComponent.mjs +28 -22
  44. package/esm2022/engine/NgxCrudFormField.mjs +14 -4
  45. package/esm2022/engine/NgxFormService.mjs +239 -27
  46. package/esm2022/engine/NgxRenderingEngine.mjs +202 -46
  47. package/esm2022/engine/ValidatorFactory.mjs +6 -2
  48. package/esm2022/engine/constants.mjs +14 -9
  49. package/esm2022/engine/decorators.mjs +6 -6
  50. package/esm2022/engine/index.mjs +5 -3
  51. package/esm2022/engine/interfaces.mjs +4 -0
  52. package/esm2022/engine/types.mjs +1 -3
  53. package/esm2022/helpers/utils.mjs +6 -2
  54. package/fesm2022/decaf-ts-for-angular.mjs +2910 -2129
  55. package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
  56. package/helpers/utils.d.ts +1 -0
  57. package/package.json +2 -1
  58. package/engine/NgxRenderingEngine2.d.ts +0 -250
  59. package/esm2022/engine/NgxRenderingEngine2.mjs +0 -332
  60. package/esm2022/interfaces.mjs +0 -2
  61. package/interfaces.d.ts +0 -28
@@ -1,5 +1,5 @@
1
1
  import { AfterViewInit, ElementRef, OnDestroy, OnInit } from '@angular/core';
2
- import { FormControl, FormGroup } from '@angular/forms';
2
+ import { FormArray, FormControl, FormGroup } from '@angular/forms';
3
3
  import { AutocompleteTypes, SelectInterface } from '@ionic/core';
4
4
  import { CrudOperations } from '@decaf-ts/db-decorators';
5
5
  import { NgxCrudFormField } from '../../engine/NgxCrudFormField';
@@ -86,6 +86,16 @@ export declare class CrudFieldComponent extends NgxCrudFormField implements OnIn
86
86
  * @type {string}
87
87
  * @memberOf CrudFieldComponent
88
88
  */
89
+ /**
90
+ * @description The parent field path for nested field structures.
91
+ * @summary Specifies the full dot-delimited path of the parent field when this field
92
+ * is part of a nested structure. This is used for hierarchical form organization
93
+ * and proper form control resolution in complex form structures.
94
+ *
95
+ * @type {string}
96
+ * @default ''
97
+ * @memberOf CrudFieldComponent
98
+ */
89
99
  childOf: string;
90
100
  /**
91
101
  * @description The input type of the field.
@@ -225,38 +235,60 @@ export declare class CrudFieldComponent extends NgxCrudFormField implements OnIn
225
235
  */
226
236
  step?: number;
227
237
  /**
228
- * @description Field name for equals comparison.
229
- * @type {string}
238
+ * @description Field name for equality validation comparison.
239
+ * @summary Specifies another field name that this field's value must be equal to for validation.
240
+ * This is commonly used for password confirmation fields or other scenarios where
241
+ * two fields must contain the same value.
242
+ *
243
+ * @type {string | undefined}
230
244
  * @memberOf CrudFieldComponent
231
245
  */
232
246
  equals?: string;
233
247
  /**
234
- * @description Field name for different comparison.
235
- * @type {string}
248
+ * @description Field name for inequality validation comparison.
249
+ * @summary Specifies another field name that this field's value must be different from for validation.
250
+ * This is used to ensure that two fields do not contain the same value, which might be
251
+ * required for certain business rules or security constraints.
252
+ *
253
+ * @type {string | undefined}
236
254
  * @memberOf CrudFieldComponent
237
255
  */
238
256
  different?: string;
239
257
  /**
240
- * @description Field name for less than comparison.
241
- * @type {string}
258
+ * @description Field name for less-than validation comparison.
259
+ * @summary Specifies another field name that this field's value must be less than for validation.
260
+ * This is commonly used for date ranges, numeric ranges, or other scenarios where
261
+ * one field must have a smaller value than another.
262
+ *
263
+ * @type {string | undefined}
242
264
  * @memberOf CrudFieldComponent
243
265
  */
244
266
  lessThan?: string;
245
267
  /**
246
- * @description Field name for less than or equal comparison.
247
- * @type {string}
268
+ * @description Field name for less-than-or-equal validation comparison.
269
+ * @summary Specifies another field name that this field's value must be less than or equal to
270
+ * for validation. This provides inclusive upper bound validation for numeric or date comparisons.
271
+ *
272
+ * @type {string | undefined}
248
273
  * @memberOf CrudFieldComponent
249
274
  */
250
275
  lessThanOrEqual?: string;
251
276
  /**
252
- * @description Field name for greater than comparison.
253
- * @type {string}
277
+ * @description Field name for greater-than validation comparison.
278
+ * @summary Specifies another field name that this field's value must be greater than for validation.
279
+ * This is commonly used for date ranges, numeric ranges, or other scenarios where
280
+ * one field must have a larger value than another.
281
+ *
282
+ * @type {string | undefined}
254
283
  * @memberOf CrudFieldComponent
255
284
  */
256
285
  greaterThan?: string;
257
286
  /**
258
- * @description Field name for greater than or equal comparison.
259
- * @type {string}
287
+ * @description Field name for greater-than-or-equal validation comparison.
288
+ * @summary Specifies another field name that this field's value must be greater than or equal to
289
+ * for validation. This provides inclusive lower bound validation for numeric or date comparisons.
290
+ *
291
+ * @type {string | undefined}
260
292
  * @memberOf CrudFieldComponent
261
293
  */
262
294
  greaterThanOrEqual?: string;
@@ -418,7 +450,35 @@ export declare class CrudFieldComponent extends NgxCrudFormField implements OnIn
418
450
  * @memberOf CrudFieldComponent
419
451
  */
420
452
  formGroup: FormGroup | undefined;
453
+ /**
454
+ * @description Angular FormControl instance for this field.
455
+ * @summary The specific FormControl instance that manages this field's state, validation,
456
+ * and value. This provides direct access to Angular's reactive forms functionality
457
+ * for this individual field within the broader form structure.
458
+ *
459
+ * @type {FormControl}
460
+ * @memberOf CrudFieldComponent
461
+ */
421
462
  formControl: FormControl;
463
+ /**
464
+ * @description Indicates if this field supports multiple values.
465
+ * @summary When true, this field can handle multiple values, typically used in
466
+ * multi-select scenarios or when the field is part of a form array structure
467
+ * that allows multiple entries of the same field type.
468
+ *
469
+ * @type {boolean}
470
+ * @default false
471
+ * @memberOf CrudFieldComponent
472
+ */
473
+ multiple: boolean;
474
+ /**
475
+ * @description Unique identifier for the current record.
476
+ * @summary A unique identifier for the current record being displayed or manipulated.
477
+ * This is typically used in conjunction with the primary key for operations on specific records.
478
+ *
479
+ * @type {string | number}
480
+ */
481
+ uid: string;
422
482
  /**
423
483
  * @description Translatability of field labels.
424
484
  * @summary Indicates whether the field labels should be translated based on the current language settings.
@@ -430,16 +490,111 @@ export declare class CrudFieldComponent extends NgxCrudFormField implements OnIn
430
490
  */
431
491
  translatable: StringOrBoolean;
432
492
  /**
433
- * @description Unique identifier for the current record.
434
- * @summary A unique identifier for the current record being displayed or manipulated.
435
- * This is typically used in conjunction with the primary key for operations on specific records.
493
+ * @description Index of the currently active form group in a form array.
494
+ * @summary When working with multiple form groups (form arrays), this indicates
495
+ * which form group is currently active or being edited. This is used to manage
496
+ * focus and data binding in multi-entry scenarios.
436
497
  *
437
- * @type {string | number}
498
+ * @type {number}
499
+ * @default 0
500
+ * @memberOf CrudFieldComponent
501
+ */
502
+ activeFormGroup: number;
503
+ /**
504
+ * @description FormArray containing multiple form groups for this field.
505
+ * @summary When this field is part of a multi-entry structure, this FormArray
506
+ * contains all the form groups. This enables management of multiple instances
507
+ * of the same field structure within a single form.
508
+ *
509
+ * @type {FormArray}
510
+ * @memberOf CrudFieldComponent
511
+ */
512
+ formGroupArray: FormArray;
513
+ /**
514
+ * @description Primary key field name for uniqueness validation.
515
+ * @summary Specifies the field name that serves as the primary key for uniqueness
516
+ * validation within form arrays. This is used to prevent duplicate entries
517
+ * and ensure data integrity in multi-entry forms.
518
+ *
519
+ * @type {string}
520
+ * @memberOf CrudFieldComponent
521
+ */
522
+ pk: string;
523
+ /**
524
+ * @description Gets the currently active form group based on context.
525
+ * @summary Returns the appropriate FormGroup based on whether this field supports
526
+ * multiple values. For single-value fields, returns the main form group.
527
+ * For multi-value fields, returns the form group at the active index from the parent FormArray.
528
+ *
529
+ * @returns {FormGroup} The currently active FormGroup for this field
530
+ * @memberOf CrudFieldComponent
531
+ */
532
+ get getActiveFormGroup(): FormGroup;
533
+ /**
534
+ * @description Component initialization lifecycle method.
535
+ * @summary Initializes the field component based on the operation type and field configuration.
536
+ * For READ and DELETE operations, removes the form group to make fields read-only.
537
+ * For other operations, sets up icons, configures multi-value support if needed,
538
+ * and sets default values for radio buttons if no value is provided.
539
+ *
540
+ * @returns {void}
541
+ * @memberOf CrudFieldComponent
438
542
  */
439
- uid: string | number | undefined;
440
543
  ngOnInit(): void;
544
+ /**
545
+ * @description Component after view initialization lifecycle method.
546
+ * @summary Calls the parent afterViewInit method for READ and DELETE operations.
547
+ * This ensures proper initialization of read-only fields that don't require
548
+ * form functionality but still need view setup.
549
+ *
550
+ * @returns {void}
551
+ * @memberOf CrudFieldComponent
552
+ */
441
553
  ngAfterViewInit(): void;
554
+ /**
555
+ * @description Component cleanup lifecycle method.
556
+ * @summary Performs cleanup operations for READ and DELETE operations by calling
557
+ * the parent onDestroy method. This ensures proper resource cleanup for
558
+ * read-only field components.
559
+ *
560
+ * @returns {void}
561
+ * @memberOf CrudFieldComponent
562
+ */
442
563
  ngOnDestroy(): void;
564
+ /**
565
+ * @description Handles fieldset group creation events from parent fieldsets.
566
+ * @summary Processes events triggered when a new group needs to be added to a fieldset.
567
+ * Validates the current form group, checks for uniqueness if applicable, and either
568
+ * creates a new group or provides validation feedback. Updates the active form group
569
+ * and resets the field for new input after successful creation.
570
+ *
571
+ * @param {CustomEvent} event - The fieldset create group event containing group details
572
+ * @returns {void}
573
+ * @memberOf CrudFieldComponent
574
+ */
575
+ handleFieldsetCreateGroupEvent(event: CustomEvent): void;
576
+ /**
577
+ * @description Handles fieldset group update events from parent fieldsets.
578
+ * @summary Processes events triggered when an existing group needs to be updated.
579
+ * Updates the active form group index and refreshes the form group and form control
580
+ * references to point to the group being edited.
581
+ *
582
+ * @param {CustomEvent} event - The fieldset update group event containing update details
583
+ * @returns {void}
584
+ * @memberOf CrudFieldComponent
585
+ */
586
+ handleFieldsetUpdateGroupEvent(event: CustomEvent): void;
587
+ /**
588
+ * @description Handles fieldset group removal events from parent fieldsets.
589
+ * @summary Processes events triggered when a group needs to be removed from a fieldset.
590
+ * Removes the specified group from the form array, updates the active form group index,
591
+ * and refreshes the form references. Dispatches a confirmation event back to the component.
592
+ *
593
+ * @param {CustomEvent} event - The fieldset remove group event containing removal details
594
+ * @returns {void}
595
+ * @memberOf CrudFieldComponent
596
+ */
597
+ handleFieldsetRemoveGroupEvent(event: CustomEvent): void;
443
598
  static ɵfac: i0.ɵɵFactoryDeclaration<CrudFieldComponent, never>;
444
- static ɵcmp: i0.ɵɵComponentDeclaration<CrudFieldComponent, "ngx-decaf-crud-field", never, { "operation": { "alias": "operation"; "required": true; }; "name": { "alias": "name"; "required": true; }; "path": { "alias": "path"; "required": true; }; "childOf": { "alias": "childOf"; "required": false; }; "type": { "alias": "type"; "required": true; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": true; }; "placeholder": { "alias": "placeholder"; "required": false; }; "format": { "alias": "format"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "max": { "alias": "max"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "min": { "alias": "min"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "step": { "alias": "step"; "required": false; }; "equals": { "alias": "equals"; "required": false; }; "different": { "alias": "different"; "required": false; }; "lessThan": { "alias": "lessThan"; "required": false; }; "lessThanOrEqual": { "alias": "lessThanOrEqual"; "required": false; }; "greaterThan": { "alias": "greaterThan"; "required": false; }; "greaterThanOrEqual": { "alias": "greaterThanOrEqual"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; "cancelText": { "alias": "cancelText"; "required": false; }; "interface": { "alias": "interface"; "required": false; }; "options": { "alias": "options"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "spellcheck": { "alias": "spellcheck"; "required": false; }; "inputmode": { "alias": "inputmode"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "labelPlacement": { "alias": "labelPlacement"; "required": false; }; "updateOn": { "alias": "updateOn"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; }, {}, never, never, true, never>;
599
+ static ɵcmp: i0.ɵɵComponentDeclaration<CrudFieldComponent, "ngx-decaf-crud-field", never, { "operation": { "alias": "operation"; "required": true; }; "name": { "alias": "name"; "required": true; }; "path": { "alias": "path"; "required": true; }; "childOf": { "alias": "childOf"; "required": false; }; "type": { "alias": "type"; "required": true; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": true; }; "placeholder": { "alias": "placeholder"; "required": false; }; "format": { "alias": "format"; "required": false; }; "hidden": { "alias": "hidden"; "required": false; }; "max": { "alias": "max"; "required": false; }; "maxlength": { "alias": "maxlength"; "required": false; }; "min": { "alias": "min"; "required": false; }; "minlength": { "alias": "minlength"; "required": false; }; "pattern": { "alias": "pattern"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "required": { "alias": "required"; "required": false; }; "step": { "alias": "step"; "required": false; }; "equals": { "alias": "equals"; "required": false; }; "different": { "alias": "different"; "required": false; }; "lessThan": { "alias": "lessThan"; "required": false; }; "lessThanOrEqual": { "alias": "lessThanOrEqual"; "required": false; }; "greaterThan": { "alias": "greaterThan"; "required": false; }; "greaterThanOrEqual": { "alias": "greaterThanOrEqual"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "alignment": { "alias": "alignment"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "justify": { "alias": "justify"; "required": false; }; "cancelText": { "alias": "cancelText"; "required": false; }; "interface": { "alias": "interface"; "required": false; }; "options": { "alias": "options"; "required": false; }; "mode": { "alias": "mode"; "required": false; }; "spellcheck": { "alias": "spellcheck"; "required": false; }; "inputmode": { "alias": "inputmode"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "fill": { "alias": "fill"; "required": false; }; "labelPlacement": { "alias": "labelPlacement"; "required": false; }; "updateOn": { "alias": "updateOn"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "formControl": { "alias": "formControl"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; "activeFormGroup": { "alias": "activeFormGroup"; "required": false; }; "pk": { "alias": "pk"; "required": false; }; }, {}, never, never, true, never>;
445
600
  }
@@ -1,7 +1,7 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
2
  import { FormGroup } from '@angular/forms';
3
- import { FormElement } from '../../interfaces';
4
- import { CrudFormEvent, FieldUpdateMode, HTMLFormTarget, RenderedModel } from '../../engine';
3
+ import { IFormElement } from '../../engine/interfaces';
4
+ import { CrudFormEvent, FieldUpdateMode, HandlerLike, HTMLFormTarget, RenderedModel } from '../../engine';
5
5
  import { CrudFormOptions } from './types';
6
6
  import { CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';
7
7
  import { Model } from '@decaf-ts/decorator-validation';
@@ -26,23 +26,109 @@ import * as i0 from "@angular/core";
26
26
  * @param {string} target - The target
27
27
  * @param {string} method - The method
28
28
  */
29
- export declare class CrudFormComponent implements OnInit, FormElement, OnDestroy, RenderedModel {
29
+ export declare class CrudFormComponent implements OnInit, IFormElement, OnDestroy, RenderedModel {
30
30
  /**
31
31
  * @description Repository model for data operations.
32
32
  * @summary The data model repository that this component will use for CRUD operations.
33
33
  * This provides a connection to the data layer for retrieving and manipulating data.
34
34
  *
35
35
  * @type {Model| undefined}
36
+ * @memberOf CrudFormComponent
36
37
  */
37
38
  model: Model | undefined;
39
+ /**
40
+ * @description Field update trigger mode for form validation.
41
+ * @summary Determines when form field validation should be triggered. Options include
42
+ * 'change', 'blur', or 'submit'. This affects the user experience by controlling
43
+ * when validation feedback is shown to the user during form interaction.
44
+ *
45
+ * @type {FieldUpdateMode}
46
+ * @default 'change'
47
+ * @memberOf CrudFormComponent
48
+ */
38
49
  updateOn: FieldUpdateMode;
50
+ /**
51
+ * @description Reference to the reactive form DOM element.
52
+ * @summary ViewChild reference that provides direct access to the form's DOM element.
53
+ * This enables programmatic manipulation of the form element and access to native
54
+ * HTML form properties and methods when needed.
55
+ *
56
+ * @type {ElementRef}
57
+ * @memberOf CrudFormComponent
58
+ */
39
59
  component: ElementRef;
60
+ /**
61
+ * @description Form submission target specification.
62
+ * @summary Specifies where to display the response after form submission, similar
63
+ * to the HTML form target attribute. Options include '_self', '_blank', '_parent',
64
+ * '_top', or a named frame. Controls the browser behavior for form responses.
65
+ *
66
+ * @type {HTMLFormTarget}
67
+ * @default '_self'
68
+ * @memberOf CrudFormComponent
69
+ */
40
70
  target: HTMLFormTarget;
71
+ /**
72
+ * @description HTTP method or submission strategy for the form.
73
+ * @summary Defines how the form should be submitted. 'get' and 'post' correspond
74
+ * to standard HTTP methods for traditional form submission, while 'event' uses
75
+ * Angular event-driven submission for single-page application workflows.
76
+ *
77
+ * @type {'get' | 'post' | 'event'}
78
+ * @default 'event'
79
+ * @memberOf CrudFormComponent
80
+ */
41
81
  method: 'get' | 'post' | 'event';
82
+ /**
83
+ * @description Configuration options for the CRUD form behavior.
84
+ * @summary Contains various configuration settings that control form rendering,
85
+ * validation, and behavior. These options are merged with default settings
86
+ * during component initialization to customize the form's functionality.
87
+ *
88
+ * @type {CrudFormOptions}
89
+ * @memberOf CrudFormComponent
90
+ */
42
91
  options: CrudFormOptions;
92
+ /**
93
+ * @description Optional action identifier for form submission context.
94
+ * @summary Specifies a custom action name that will be included in the submit event.
95
+ * If not provided, defaults to the standard submit event constant. Used to
96
+ * distinguish between different types of form submissions within the same component.
97
+ *
98
+ * @type {string | undefined}
99
+ * @memberOf CrudFormComponent
100
+ */
43
101
  action?: string;
102
+ /**
103
+ * @description The current CRUD operation being performed.
104
+ * @summary Specifies the type of operation this form is handling (CREATE, READ, UPDATE, DELETE).
105
+ * This is a required input that determines form behavior, validation rules, and available actions.
106
+ * The operation affects form state, button visibility, and submission logic.
107
+ *
108
+ * @type {CrudOperations}
109
+ * @required
110
+ * @memberOf CrudFormComponent
111
+ */
44
112
  operation: CrudOperations;
45
- handlers: Record<string, (...args: unknown[]) => unknown | Promise<unknown>>;
113
+ /**
114
+ * @description Custom event handlers for form actions.
115
+ * @summary A record of event handler functions keyed by event names that can be
116
+ * triggered during form operations. These handlers provide extensibility for
117
+ * custom business logic and can be invoked for various form events and actions.
118
+ *
119
+ * @type {HandlerLike}
120
+ * @memberOf CrudFormComponent
121
+ */
122
+ handlers: HandlerLike;
123
+ /**
124
+ * @description Angular reactive FormGroup for form state management.
125
+ * @summary The FormGroup instance that manages all form controls, validation,
126
+ * and form state. This is the main interface for accessing form values and
127
+ * controlling form behavior. May be undefined for read-only operations.
128
+ *
129
+ * @type {FormGroup | undefined}
130
+ * @memberOf CrudFormComponent
131
+ */
46
132
  formGroup: FormGroup | undefined;
47
133
  /**
48
134
  * @description Path to the parent FormGroup, if nested.
@@ -52,6 +138,15 @@ export declare class CrudFormComponent implements OnInit, FormElement, OnDestroy
52
138
  * @memberOf CrudFormComponent
53
139
  */
54
140
  childOf?: string;
141
+ /**
142
+ * @description Unique identifier for the form renderer.
143
+ * @summary A unique string identifier used to register and manage this form
144
+ * instance within the NgxFormService. This ID is also used as the HTML id
145
+ * attribute for the form element, enabling DOM queries and form management.
146
+ *
147
+ * @type {string}
148
+ * @memberOf CrudFormComponent
149
+ */
55
150
  rendererId: string;
56
151
  /**
57
152
  * @description Unique identifier for the current record.
@@ -59,8 +154,18 @@ export declare class CrudFormComponent implements OnInit, FormElement, OnDestroy
59
154
  * This is typically used in conjunction with the primary key for operations on specific records.
60
155
  *
61
156
  * @type {string | number}
157
+ * @memberOf CrudFormComponent
158
+ */
159
+ uid: string;
160
+ /**
161
+ * @description Event emitter for form submission events.
162
+ * @summary Emits CrudFormEvent objects when the form is submitted, providing
163
+ * form data, component information, and any associated handlers to parent
164
+ * components. This enables decoupled handling of form submission logic.
165
+ *
166
+ * @type {EventEmitter<CrudFormEvent>}
167
+ * @memberOf CrudFormComponent
62
168
  */
63
- uid: string | number | undefined;
64
169
  submitEvent: EventEmitter<CrudFormEvent>;
65
170
  /**
66
171
  * @description Logger instance for the component.
@@ -88,14 +193,73 @@ export declare class CrudFormComponent implements OnInit, FormElement, OnDestroy
88
193
  * @memberOf CrudFormComponent
89
194
  */
90
195
  private location;
196
+ /**
197
+ * @description Component initialization lifecycle method.
198
+ * @summary Initializes the component by setting up the logger, configuring form state
199
+ * based on the operation type, and merging configuration options. For READ and DELETE
200
+ * operations, the formGroup is set to undefined since these operations don't require
201
+ * form input. Configuration options are merged with default settings.
202
+ *
203
+ * @returns {Promise<void>}
204
+ * @memberOf CrudFormComponent
205
+ */
91
206
  ngOnInit(): Promise<void>;
207
+ /**
208
+ * @description Component cleanup lifecycle method.
209
+ * @summary Performs cleanup operations when the component is destroyed.
210
+ * Unregisters the FormGroup from the NgxFormService to prevent memory leaks
211
+ * and ensure proper resource cleanup.
212
+ *
213
+ * @returns {void}
214
+ * @memberOf CrudFormComponent
215
+ */
92
216
  ngOnDestroy(): void;
93
217
  /**
94
- * @param {SubmitEvent} event
218
+ * @description Handles form submission with validation and event emission.
219
+ * @summary Processes form submission by first preventing default browser behavior,
220
+ * then validating all form fields using NgxFormService. If validation passes,
221
+ * extracts form data and emits a submitEvent with the data, component information,
222
+ * and any associated handlers. Returns false if validation fails.
223
+ *
224
+ * @param {SubmitEvent} event - The browser's native form submit event
225
+ * @returns {Promise<boolean | void>} Returns false if validation fails, void if successful
226
+ * @memberOf CrudFormComponent
95
227
  */
96
228
  submit(event: SubmitEvent): Promise<boolean | void>;
229
+ /**
230
+ * @description Handles form reset or navigation back functionality.
231
+ * @summary Provides different reset behavior based on the current operation.
232
+ * For CREATE and UPDATE operations, resets the form to its initial state.
233
+ * For READ and DELETE operations, navigates back in the browser history
234
+ * since these operations don't have modifiable form data to reset.
235
+ *
236
+ * @returns {void}
237
+ * @memberOf CrudFormComponent
238
+ */
97
239
  handleReset(): void;
240
+ /**
241
+ * @description Handles delete operations by emitting delete events.
242
+ * @summary Processes delete requests by emitting a submit event with the
243
+ * record's unique identifier as data. This allows parent components to
244
+ * handle the actual deletion logic while maintaining separation of concerns.
245
+ * The event includes the uid and standard component identification.
246
+ *
247
+ * @returns {void}
248
+ * @memberOf CrudFormComponent
249
+ */
98
250
  handleDelete(): void;
251
+ /**
252
+ * @description Reference to CRUD operation constants for template usage.
253
+ * @summary Exposes the OperationKeys enum to the component template, enabling
254
+ * conditional rendering and behavior based on operation types. This protected
255
+ * readonly property ensures that template logic can access operation constants
256
+ * while maintaining encapsulation and preventing accidental modification.
257
+ *
258
+ * @type {CrudOperations}
259
+ * @protected
260
+ * @readonly
261
+ * @memberOf CrudFormComponent
262
+ */
99
263
  protected readonly OperationKeys: typeof OperationKeys;
100
264
  static ɵfac: i0.ɵɵFactoryDeclaration<CrudFormComponent, never>;
101
265
  static ɵcmp: i0.ɵɵComponentDeclaration<CrudFormComponent, "ngx-decaf-crud-form", never, { "model": { "alias": "model"; "required": false; }; "updateOn": { "alias": "updateOn"; "required": false; }; "target": { "alias": "target"; "required": false; }; "method": { "alias": "method"; "required": false; }; "options": { "alias": "options"; "required": false; }; "action": { "alias": "action"; "required": false; }; "operation": { "alias": "operation"; "required": true; }; "handlers": { "alias": "handlers"; "required": false; }; "formGroup": { "alias": "formGroup"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "rendererId": { "alias": "rendererId"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; }, { "submitEvent": "submitEvent"; }, never, ["*"], true, never>;