@decaf-ts/for-angular 0.0.36 → 0.0.38

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.
package/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { ElementRef, Type, Injector, EnvironmentInjector, ComponentMirror, ViewContainerRef, ComponentRef, TemplateRef, OnChanges, ChangeDetectorRef, Renderer2, EventEmitter, SimpleChanges, OnInit, OnDestroy, AfterViewInit, InjectionToken, Provider, ModuleWithProviders } from '@angular/core';
2
+ import { ElementRef, Type, Injector, EnvironmentInjector, ComponentMirror, ViewContainerRef, ComponentRef, TemplateRef, OnChanges, ChangeDetectorRef, Renderer2, EventEmitter, SimpleChanges, AfterViewInit, OnInit, OnDestroy, NgZone, InjectionToken, Provider, ModuleWithProviders } from '@angular/core';
3
3
  import * as i2 from '@angular/forms';
4
4
  import { FormGroup, FormArray, FormControl, ControlValueAccessor, AbstractControl } from '@angular/forms';
5
- import { Repository, Adapter, OrderDirection, Paginator, Condition } from '@decaf-ts/core';
5
+ import { Repository, Adapter, OrderDirection, EventIds, Paginator, Condition } from '@decaf-ts/core';
6
6
  import { IonInput, IonSelect, IonTextarea, IonCheckbox, MenuController, SpinnerTypes, InfiniteScrollCustomEvent, RefresherCustomEvent } from '@ionic/angular';
7
7
  import { TextFieldTypes, SelectInterface, AutocompleteTypes, CheckboxCustomEvent, PredefinedColors } from '@ionic/core';
8
8
  import { RepositoryFlags, Context, CrudOperations, OperationKeys } from '@decaf-ts/db-decorators';
@@ -11,14 +11,15 @@ import { Model, Constructor, ModelConstructor } from '@decaf-ts/decorator-valida
11
11
  import { FieldProperties, CrudOperationKeys, RenderingEngine, FieldDefinition, UIModelMetadata, UIMediaBreakPointsType } from '@decaf-ts/ui-decorators';
12
12
  import { LoggedClass, Logger } from '@decaf-ts/logging';
13
13
  import { Router } from '@angular/router';
14
+ import * as i1 from '@angular/common';
15
+ import { Location } from '@angular/common';
14
16
  import * as i3 from '@ngx-translate/core';
15
17
  import { TranslateService, TranslateLoader, TranslationObject, TranslateParser, RootTranslateServiceConfig } from '@ngx-translate/core';
16
18
  import { Title, SafeHtml } from '@angular/platform-browser';
17
19
  import { IonAccordionGroup, ItemReorderEventDetail } from '@ionic/angular/standalone';
18
- import { Subscription, Observable } from 'rxjs';
20
+ import { Observable, Subscription } from 'rxjs';
19
21
  import { InjectablesRegistry } from '@decaf-ts/injectable-decorators';
20
22
  import { HttpClient } from '@angular/common/http';
21
- import * as i1 from '@angular/common';
22
23
 
23
24
  /**
24
25
  * @module module:lib/engine/types
@@ -99,7 +100,7 @@ type FieldUpdateMode = 'change' | 'blur' | 'submit';
99
100
  * @typedef {('checkbox'|'radio'|'select'|TextFieldTypes|'textarea')} PossibleInputTypes
100
101
  * @memberOf module:engine
101
102
  */
102
- type PossibleInputTypes = 'checkbox' | 'radio' | 'select' | TextFieldTypes | 'textarea';
103
+ type PossibleInputTypes = 'checkbox' | 'radio' | 'select' | TextFieldTypes | 'file' | 'textarea';
103
104
  /**
104
105
  * @description Field definition for Angular components
105
106
  * @summary A comprehensive type that combines properties from various Ionic components
@@ -192,14 +193,13 @@ type FormParent = FormGroup | FormArray;
192
193
  */
193
194
  type FormParentGroup = [FormParent, string];
194
195
  type I18nResourceConfigType = I18nResourceConfig | I18nResourceConfig[];
196
+ type WindowColorScheme = 'dark' | 'light' | unknown;
195
197
 
196
198
  /**
197
- * @module module:lib/engine/interfaces
199
+ * @module lib/engine/interfaces
198
200
  * @description Type and interface definitions used by the Angular rendering engine.
199
201
  * @summary Exposes interfaces for component input metadata, rendering outputs, form events,
200
202
  * and supporting types used across the engine and components.
201
- *
202
- * @link {@link AngularDynamicOutput}
203
203
  */
204
204
 
205
205
  /**
@@ -326,6 +326,9 @@ interface IComponentInput extends FieldProperties {
326
326
  formControl?: FormControl;
327
327
  model?: Model | string;
328
328
  operation?: CrudOperationKeys | undefined;
329
+ pages?: number;
330
+ cols?: number;
331
+ rows?: number;
329
332
  }
330
333
  /**
331
334
  * @description Component configuration structure
@@ -392,6 +395,7 @@ interface AngularDynamicOutput {
392
395
  children?: AngularDynamicOutput[];
393
396
  instance?: Type<unknown>;
394
397
  formGroup?: FormGroup;
398
+ page?: number;
395
399
  formControl?: FormControl;
396
400
  projectable?: boolean;
397
401
  }
@@ -472,11 +476,18 @@ interface IBaseCustomEvent {
472
476
  data?: unknown;
473
477
  target?: HTMLElement;
474
478
  }
479
+ interface IModelPageCustomEvent extends IBaseCustomEvent {
480
+ success: boolean;
481
+ message?: string;
482
+ }
475
483
  /**
476
- * Configuration for internationalization (i18n) resource file paths.
477
- *
478
- * @property prefix - The prefix to be used for the resource file path.
479
- * @property suffix - The suffix to be appended to the resource file path.
484
+ * @description Configuration for internationalization (i18n) resource file paths
485
+ * @summary Defines the structure for configuring i18n resource file paths with prefix and suffix.
486
+ * Used by the translation system to locate and load language resource files.
487
+ * @interface I18nResourceConfig
488
+ * @property {string} prefix - The prefix to be used for the resource file path
489
+ * @property {string} suffix - The suffix to be appended to the resource file path
490
+ * @memberOf module:engine
480
491
  */
481
492
  interface I18nResourceConfig {
482
493
  prefix: string;
@@ -486,8 +497,12 @@ interface I18nResourceConfig {
486
497
  * @description CRUD form event type
487
498
  * @summary Extends IBaseCustomEvent to include optional handlers for CRUD form operations.
488
499
  * This event type is used for form-related actions like create, read, update, and delete operations.
489
- * @typedef ICrudFormEvent
490
- * @property {Record<string, any>} [handlers] - Optional handlers for form operations
500
+ * @interface ICrudFormEvent
501
+ * @property {Record<string, unknown>} [handlers] - Optional handlers for form operations
502
+ * @property {string} name - The name of the event (inherited from IBaseCustomEvent)
503
+ * @property {string} [component] - The component that triggered the event (inherited from IBaseCustomEvent)
504
+ * @property {unknown} [data] - The data associated with the event (inherited from IBaseCustomEvent)
505
+ * @property {HTMLElement} [target] - The target element (inherited from IBaseCustomEvent)
491
506
  * @memberOf module:engine
492
507
  */
493
508
  interface ICrudFormEvent extends IBaseCustomEvent {
@@ -498,6 +513,9 @@ interface ICrudFormEvent extends IBaseCustomEvent {
498
513
  * @summary Event emitted by pagination components to signal page navigation.
499
514
  * Extends IBaseCustomEvent and carries a payload with the target page number and navigation direction.
500
515
  * @interface IPaginationCustomEvent
516
+ * @property {Object} data - The pagination data payload
517
+ * @property {number} data.page - The target page number
518
+ * @property {'next' | 'previous'} data.direction - The navigation direction
501
519
  * @memberOf module:engine
502
520
  */
503
521
  interface IPaginationCustomEvent extends IBaseCustomEvent {
@@ -511,6 +529,11 @@ interface IPaginationCustomEvent extends IBaseCustomEvent {
511
529
  * @summary Represents a single item in a navigation or contextual menu.
512
530
  * Includes the visible label and optional metadata such as accessibility title, target URL, icon, and color.
513
531
  * @interface IMenuItem
532
+ * @property {string} label - The visible text label for the menu item
533
+ * @property {string} [title] - Optional accessibility title or tooltip text
534
+ * @property {string} [url] - Optional target URL for navigation
535
+ * @property {string} [icon] - Optional icon identifier to display with the menu item
536
+ * @property {string} [color] - Optional color theme for the menu item
514
537
  * @memberOf module:engine
515
538
  */
516
539
  interface IMenuItem {
@@ -520,9 +543,33 @@ interface IMenuItem {
520
543
  icon?: string;
521
544
  color?: string;
522
545
  }
546
+ /**
547
+ * @description Form reactive submit event data
548
+ * @summary Defines the structure of data emitted when a reactive form is submitted.
549
+ * Contains the processed form data as key-value pairs.
550
+ * @interface IFormReactiveSubmitEvent
551
+ * @property {Record<string, unknown>} data - The form data as key-value pairs
552
+ * @memberOf module:engine
553
+ */
523
554
  interface IFormReactiveSubmitEvent {
524
555
  data: Record<string, unknown>;
525
556
  }
557
+ /**
558
+ * @description CRUD form options configuration
559
+ * @summary Defines the configuration options for CRUD form buttons including submit and clear buttons.
560
+ * Each button can be customized with text, icon, and icon position.
561
+ * @interface ICrudFormOptions
562
+ * @property {Object} buttons - Configuration for form action buttons
563
+ * @property {Object} buttons.submit - Submit button configuration
564
+ * @property {string} [buttons.submit.icon] - Optional icon for the submit button
565
+ * @property {'start' | 'end'} [buttons.submit.iconSlot] - Position of the icon relative to text
566
+ * @property {string} [buttons.submit.text] - Text label for the submit button
567
+ * @property {Object} [buttons.clear] - Optional clear button configuration
568
+ * @property {string} [buttons.clear.icon] - Optional icon for the clear button
569
+ * @property {'start' | 'end'} [buttons.clear.iconSlot] - Position of the icon relative to text
570
+ * @property {string} [buttons.clear.text] - Text label for the clear button
571
+ * @memberOf module:engine
572
+ */
526
573
  interface ICrudFormOptions {
527
574
  buttons: {
528
575
  submit: {
@@ -537,7 +584,20 @@ interface ICrudFormOptions {
537
584
  };
538
585
  };
539
586
  }
540
- interface IListEmptyResult {
587
+ /**
588
+ * @description Empty list display options
589
+ * @summary Defines the configuration for displaying an empty state in list components
590
+ * when no data is available. Includes text, button, icon, and link settings.
591
+ * @interface IListEmptyOptions
592
+ * @property {string} title - Title text or translation key for empty state
593
+ * @property {string} subtitle - Subtitle text or translation key for empty state
594
+ * @property {boolean} showButton - Whether to show an action button in empty state
595
+ * @property {string} buttonText - Button text or translation key
596
+ * @property {string} link - Navigation link for the button
597
+ * @property {string} icon - Icon identifier for the empty state
598
+ * @memberOf module:engine
599
+ */
600
+ interface IListEmptyOptions {
541
601
  title: string;
542
602
  subtitle: string;
543
603
  showButton: boolean;
@@ -545,11 +605,17 @@ interface IListEmptyResult {
545
605
  link: string;
546
606
  icon: string;
547
607
  }
608
+ interface IWindowResizeEvent {
609
+ width: number;
610
+ height: number;
611
+ }
548
612
 
549
613
  /**
550
- * @description Angular engine key constants
614
+ * @description Angular engine key constants.
551
615
  * @summary Contains key strings used by the Angular rendering engine for reflection,
552
- * dynamic component creation, and other engine operations.
616
+ * dynamic component creation, and other engine operations. These constants provide
617
+ * consistent naming for metadata keys, DOM attributes, and component identification
618
+ * throughout the rendering system.
553
619
  * @typedef {Object} AngularEngineKeys
554
620
  * @property {string} REFLECT - Prefix for reflection metadata keys
555
621
  * @property {string} DYNAMIC - Key for dynamic component identification
@@ -563,8 +629,10 @@ interface IListEmptyResult {
563
629
  * @property {string} RENDER - Key for renderable components
564
630
  * @property {string} RENDERED_ID - Template for rendered component IDs
565
631
  * @property {string} PARENT - Key for comparison decorators and validators
632
+ * @property {string} VALIDATION_PARENT_KEY - Key for validation parent reference
633
+ * @property {string} FLAVOUR - Identifier for the Angular engine flavor
566
634
  * @const AngularEngineKeys
567
- * @memberOf module:engine
635
+ * @memberOf module:lib/engine/constants
568
636
  */
569
637
  declare const AngularEngineKeys: {
570
638
  REFLECT: string;
@@ -580,32 +648,40 @@ declare const AngularEngineKeys: {
580
648
  RENDERED_ID: string;
581
649
  PARENT: string;
582
650
  VALIDATION_PARENT_KEY: symbol;
651
+ FLAVOUR: string;
583
652
  };
584
653
  /**
585
- * @description Form validation state constants
654
+ * @description Form validation state constants.
586
655
  * @summary Contains constants representing the possible validation states of a form.
587
656
  * These are used to check and handle form validation throughout the application.
657
+ * The VALID state indicates all form controls pass validation, while INVALID
658
+ * indicates one or more validation errors exist.
588
659
  * @typedef {Object} FormConstants
589
660
  * @property {string} VALID - Constant representing a valid form state
590
661
  * @property {string} INVALID - Constant representing an invalid form state
591
662
  * @const FormConstants
592
- * @memberOf module:engine
663
+ * @memberOf module:lib/engine/constants
593
664
  */
594
665
  declare const FormConstants: {
595
666
  readonly VALID: "VALID";
596
667
  readonly INVALID: "INVALID";
597
668
  };
598
669
  /**
599
- * @description Event name constants
600
- * @summary Enum containing constants for event names used throughout the application.
601
- * These are used to standardize event naming and handling.
602
- * @enum {string}
603
- * @readonly
670
+ * @description Event name constants.
671
+ * @summary Contains constants for standardized event names used throughout the application.
672
+ * These constants ensure consistent event naming across components and make it easier to
673
+ * track and handle events. Each constant represents a specific application event type.
674
+ * @typedef {Object} EventConstants
604
675
  * @property {string} BACK_BUTTON_NAVIGATION - Event fired when back button navigation ends
605
- * @property {string} REFRESH_EVENT - Event fired when a refresh action occurs
606
- * @property {string} CLICK_EVENT - Event fired when a click action occurs
607
- * @property {string} SUBMIT_EVENT - Event fired when a form submission occurs
608
- * @memberOf module:engine
676
+ * @property {string} REFRESH - Event fired when a refresh action occurs
677
+ * @property {string} CLICK - Event fired when a click action occurs
678
+ * @property {string} SUBMIT - Event fired when a form submission occurs
679
+ * @property {string} VALIDATION_ERROR - Event fired when a validation error occurs
680
+ * @property {string} FIELDSET_ADD_GROUP - Event fired when adding a group to a fieldset
681
+ * @property {string} FIELDSET_UPDATE_GROUP - Event fired when updating a fieldset group
682
+ * @property {string} FIELDSET_REMOVE_GROUP - Event fired when removing a fieldset group
683
+ * @const EventConstants
684
+ * @memberOf module:lib/engine/constants
609
685
  */
610
686
  declare const EventConstants: {
611
687
  readonly BACK_BUTTON_NAVIGATION: "backButtonNavigationEndEvent";
@@ -618,9 +694,11 @@ declare const EventConstants: {
618
694
  readonly FIELDSET_REMOVE_GROUP: "fieldsetRemoveGroupEvent";
619
695
  };
620
696
  /**
621
- * @description Logger level constants
622
- * @summary Enum defining the logging levels used in the application's logging system.
623
- * Lower values represent more verbose logging, while higher values represent more critical logs.
697
+ * @description Logger level constants.
698
+ * @summary Defines the logging levels used in the application's logging system.
699
+ * Lower numeric values represent more verbose logging, while higher values represent
700
+ * more critical logs. These levels control which log messages are output based on
701
+ * the configured logging threshold.
624
702
  * @enum {number}
625
703
  * @readonly
626
704
  * @property {number} ALL - Log everything (most verbose)
@@ -629,7 +707,7 @@ declare const EventConstants: {
629
707
  * @property {number} WARN - Log warnings
630
708
  * @property {number} ERROR - Log errors
631
709
  * @property {number} CRITICAL - Log critical errors (least verbose)
632
- * @memberOf module:engine
710
+ * @memberOf module:lib/engine/constants
633
711
  */
634
712
  declare enum LoggerLevels {
635
713
  ALL = 0,
@@ -640,15 +718,16 @@ declare enum LoggerLevels {
640
718
  CRITICAL = 5
641
719
  }
642
720
  /**
643
- * @description Route direction constants
644
- * @summary Enum defining the possible navigation directions in the application.
645
- * Used for controlling navigation flow and animation directions.
721
+ * @description Route direction constants.
722
+ * @summary Defines the possible navigation directions in the application.
723
+ * Used for controlling navigation flow and animation directions during route transitions.
724
+ * These constants help maintain consistent navigation behavior throughout the app.
646
725
  * @enum {string}
647
726
  * @readonly
648
727
  * @property {string} BACK - Navigate back to the previous page
649
728
  * @property {string} FORWARD - Navigate forward to the next page
650
729
  * @property {string} ROOT - Navigate to the root/home page
651
- * @memberOf module:engine
730
+ * @memberOf module:lib/engine/constants
652
731
  */
653
732
  declare enum RouteDirections {
654
733
  BACK = "back",
@@ -656,15 +735,18 @@ declare enum RouteDirections {
656
735
  ROOT = "root"
657
736
  }
658
737
  /**
659
- * @description Component tag name constants
660
- * @summary Enum defining the tag names for custom components used in the application.
661
- * These tag names are used for component registration and rendering.
738
+ * @description Component tag name constants.
739
+ * @summary Defines the custom HTML tag names for specialized components used in the application.
740
+ * These tag names are registered with Angular and used for component rendering and identification.
741
+ * Each constant represents the selector for a specific custom component type.
662
742
  * @enum {string}
663
743
  * @readonly
664
744
  * @property {string} LIST_ITEM - Tag name for list item component
665
745
  * @property {string} LIST_INFINITE - Tag name for infinite scrolling list component
666
746
  * @property {string} LIST_PAGINATED - Tag name for paginated list component
667
- * @memberOf module:engine
747
+ * @property {string} CRUD_FIELD - Tag name for CRUD form field component
748
+ * @property {string} LAYOUT_COMPONENT - Tag name for layout container component
749
+ * @memberOf module:lib/engine/constants
668
750
  */
669
751
  declare enum ComponentsTagNames {
670
752
  LIST_ITEM = "ngx-decaf-list-item",
@@ -674,13 +756,16 @@ declare enum ComponentsTagNames {
674
756
  LAYOUT_COMPONENT = "ngx-decaf-layout"
675
757
  }
676
758
  /**
677
- * @description Base component property name constants
678
- * @summary Enum defining the standard property names used by base components in the application.
679
- * These property names are used for consistent property access across components.
759
+ * @description Base component property name constants.
760
+ * @summary Defines the standard property names used by base components throughout the application.
761
+ * These constants ensure consistent property naming across components and facilitate
762
+ * property access, validation, and data binding. Used primarily for component input
763
+ * properties and change detection.
680
764
  * @enum {string}
681
765
  * @readonly
682
766
  * @property {string} MODEL - Property name for the component's data model
683
767
  * @property {string} LOCALE - Property name for localization settings
768
+ * @property {string} LOCALE_ROOT - Property name for the locale root identifier
684
769
  * @property {string} PK - Property name for primary key
685
770
  * @property {string} ITEMS - Property name for collection items
686
771
  * @property {string} ROUTE - Property name for routing information
@@ -689,7 +774,10 @@ declare enum ComponentsTagNames {
689
774
  * @property {string} TRANSLATABLE - Property name for translation flag
690
775
  * @property {string} MAPPER - Property name for property mapper
691
776
  * @property {string} INITIALIZED - Property name for initialization state
692
- * @memberOf module:engine
777
+ * @property {string} COMPONENT_NAME - Property name for component identifier
778
+ * @property {string} PARENT_COMPONENT - Property name for parent component reference
779
+ * @property {string} FORM_GROUP_COMPONENT_PROPS - Property name for form group component properties
780
+ * @memberOf module:lib/engine/constants
693
781
  */
694
782
  declare enum BaseComponentProps {
695
783
  MODEL = "model",
@@ -707,14 +795,65 @@ declare enum BaseComponentProps {
707
795
  PARENT_COMPONENT = "parentComponent",
708
796
  FORM_GROUP_COMPONENT_PROPS = "componentProps"
709
797
  }
798
+ /**
799
+ * @description List component type constants.
800
+ * @summary Defines the available types for list components, determining their
801
+ * pagination and scrolling behavior. Used to configure list rendering strategies.
802
+ * @enum {string}
803
+ * @readonly
804
+ * @property {string} INFINITE - Infinite scroll list type
805
+ * @property {string} PAGINATED - Paginated list type with page navigation
806
+ * @memberOf module:lib/engine/constants
807
+ */
710
808
  declare enum ListComponentsTypes {
711
809
  INFINITE = "infinite",
712
810
  PAGINATED = "paginated"
713
811
  }
812
+ /**
813
+ * @description CSS class name constants.
814
+ * @summary Contains predefined CSS class names used for consistent styling
815
+ * across components. These constants help maintain a unified visual language
816
+ * and make it easier to apply standard styles.
817
+ * @typedef {Object} CssClasses
818
+ * @property {string} BUTTONS_CONTAINER - CSS class for button container elements
819
+ * @const CssClasses
820
+ * @memberOf module:lib/engine/constants
821
+ */
714
822
  declare const CssClasses: {
715
823
  BUTTONS_CONTAINER: string;
716
824
  };
825
+ /**
826
+ * @description Default options for reactive CRUD forms.
827
+ * @summary Provides default configuration for form buttons in CRUD operations.
828
+ * Includes default text labels for submit and clear buttons, which can be
829
+ * overridden by individual form implementations.
830
+ * @type {ICrudFormOptions}
831
+ * @property {Object} buttons - Configuration for form action buttons
832
+ * @property {Object} buttons.submit - Submit button configuration
833
+ * @property {string} buttons.submit.text - Default text for submit button
834
+ * @property {Object} buttons.clear - Clear button configuration
835
+ * @property {string} buttons.clear.text - Default text for clear button
836
+ * @const DefaultFormReactiveOptions
837
+ * @memberOf module:lib/engine/constants
838
+ */
717
839
  declare const DefaultFormReactiveOptions: ICrudFormOptions;
840
+ /**
841
+ * @description Default options for empty list state display.
842
+ * @summary Provides default configuration for displaying empty state in list components
843
+ * when no data is available. Includes default text for title and subtitle, icon name,
844
+ * button text and visibility settings. These defaults can be overridden by individual
845
+ * list component implementations to customize the empty state presentation.
846
+ * @type {IListEmptyOptions}
847
+ * @property {string} title - Default translation key for empty list title
848
+ * @property {string} subtitle - Default translation key for empty list subtitle
849
+ * @property {boolean} showButton - Whether to show action button in empty state
850
+ * @property {string} icon - Default Ionic icon name for empty state
851
+ * @property {string} buttonText - Default translation key for button text
852
+ * @property {string} link - Default navigation link (empty string)
853
+ * @const DefaultListEmptyOptions
854
+ * @memberOf module:lib/engine/constants
855
+ */
856
+ declare const DefaultListEmptyOptions: IListEmptyOptions;
718
857
 
719
858
  /**
720
859
  * @description Marks an Angular component as dynamically loadable
@@ -761,33 +900,30 @@ declare abstract class DynamicModule {
761
900
  }
762
901
 
763
902
  /**
764
- * @module module:lib/engine/NgxRenderingEngine
903
+ * @module lib/engine/NgxRenderingEngine
765
904
  * @description Angular rendering engine for Decaf model-driven UIs.
766
905
  * @summary Implements NgxRenderingEngine which converts model decorator metadata
767
906
  * into Angular components, manages component registration, and orchestrates
768
907
  * dynamic component creation and input mapping.
769
- *
770
908
  * @link {@link NgxRenderingEngine}
771
909
  */
772
910
 
773
911
  /**
774
- * @description Angular implementation of the RenderingEngine with enhanced features
775
- * @summary This class extends the base RenderingEngine to provide Angular-specific rendering capabilities
776
- * with additional features compared to NgxRenderingEngine. It handles the conversion of field definitions
777
- * to Angular components, manages component registration, and provides utilities for component creation
778
- * and input handling. This implementation uses Angular's newer component APIs.
779
- *
912
+ * @description Angular implementation of the RenderingEngine for Decaf components.
913
+ * @summary This class extends the base RenderingEngine to provide Angular-specific rendering capabilities.
914
+ * It handles the conversion of field definitions to Angular components, manages component registration,
915
+ * and provides utilities for component creation and input handling. The engine converts model decorator
916
+ * metadata into dynamically created Angular components with proper input binding and lifecycle management.
780
917
  * @template AngularFieldDefinition - Type for Angular-specific field definitions
781
918
  * @template AngularDynamicOutput - Type for Angular-specific component output
782
- *
783
919
  * @class NgxRenderingEngine
920
+ * @extends {RenderingEngine<AngularFieldDefinition, AngularDynamicOutput>}
784
921
  * @example
785
922
  * ```typescript
786
923
  * const engine = NgxRenderingEngine.get();
787
924
  * engine.initialize();
788
925
  * const output = engine.render(myModel, {}, viewContainerRef, injector, templateRef);
789
926
  * ```
790
- *
791
927
  * @mermaid
792
928
  * sequenceDiagram
793
929
  * participant Client
@@ -803,83 +939,95 @@ declare abstract class DynamicModule {
803
939
  * Components-->>Engine: component constructor
804
940
  * Engine->>Engine: createComponent(component, inputs, metadata, vcr, injector, template)
805
941
  * Engine-->>Client: return AngularDynamicOutput
942
+ * @memberOf module:lib/engine/NgxRenderingEngine
806
943
  */
807
944
  declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition, AngularDynamicOutput> {
808
945
  /**
809
- * @description Registry of components available for rendering
946
+ * @description Registry of components available for dynamic rendering.
810
947
  * @summary Static registry that stores all registered components indexed by their selector name.
811
948
  * Each component entry contains a constructor reference that can be used to instantiate
812
949
  * the component during the rendering process. This registry is shared across all instances
813
950
  * of the rendering engine and is populated through the registerComponent method.
814
- *
815
951
  * @private
816
952
  * @static
817
953
  * @type {Record<string, { constructor: Constructor<unknown> }>}
954
+ * @memberOf module:lib/engine/NgxRenderingEngine
818
955
  */
819
956
  private static _components;
820
957
  /**
821
- * @description Currently active model being rendered
958
+ * @description Currently active model being rendered by the engine.
822
959
  * @summary Stores a reference to the model instance that is currently being processed
823
960
  * by the rendering engine. This property is set during the render method execution
824
961
  * and is used throughout the rendering lifecycle to access model data and metadata.
825
962
  * The definite assignment assertion (!) is used because this property is always
826
963
  * initialized before use within the render method.
827
- *
828
964
  * @private
829
965
  * @type {Model}
966
+ * @memberOf module:lib/engine/NgxRenderingEngine
830
967
  */
831
968
  private _model;
832
969
  /**
833
- * @description Current operation context for component visibility control
970
+ * @description Current operation context for component visibility control.
834
971
  * @summary Static property that stores the current operation being performed,
835
972
  * which is used to determine component visibility through the 'hidden' property.
836
973
  * Components can specify operations where they should be hidden, and this property
837
974
  * provides the context for those visibility checks. The value is typically extracted
838
975
  * from the global properties during the rendering process.
839
- *
840
976
  * @private
841
977
  * @static
842
978
  * @type {string | undefined}
979
+ * @memberOf module:lib/engine/NgxRenderingEngine
843
980
  */
844
981
  private static _operation;
845
982
  /**
846
- * @description Reference to the currently active component instance
983
+ * @description Reference to the currently active component instance.
847
984
  * @summary Static property that maintains a reference to the most recently created
848
985
  * component instance. This is used internally for component lifecycle management
849
986
  * and can be cleared through the destroy method. The reference allows access to
850
987
  * the active component instance for operations that need to interact with the
851
988
  * currently rendered component.
852
- *
853
989
  * @private
854
990
  * @static
855
991
  * @type {Type<unknown> | undefined}
992
+ * @memberOf module:lib/engine/NgxRenderingEngine
856
993
  */
857
994
  private static _instance;
995
+ /**
996
+ * @description Parent component properties for child component inheritance.
997
+ * @summary Static property that stores parent component properties that should be
998
+ * inherited by child components. This is particularly used for passing page configuration
999
+ * down to child components in multi-page forms. The property is cleared after rendering
1000
+ * to prevent property leakage between unrelated component trees.
1001
+ * @private
1002
+ * @static
1003
+ * @type {KeyValue | undefined}
1004
+ * @memberOf module:lib/engine/NgxRenderingEngine
1005
+ */
858
1006
  private static _parentProps;
859
1007
  /**
860
- * @description Constructs a new NgxRenderingEngine instance
1008
+ * @description Constructs a new NgxRenderingEngine instance.
861
1009
  * @summary Initializes a new instance of the Angular rendering engine by calling the parent
862
1010
  * constructor with the 'angular' engine type identifier. This constructor sets up the base
863
1011
  * rendering engine functionality with Angular-specific configurations and prepares the
864
1012
  * instance for component registration and rendering operations.
865
- *
866
1013
  * @constructor
1014
+ * @memberOf module:lib/engine/NgxRenderingEngine
867
1015
  */
868
1016
  constructor();
869
1017
  /**
870
- * @description Converts a field definition to an Angular component output
1018
+ * @description Converts a field definition to an Angular component output.
871
1019
  * @summary This private method takes a field definition and creates the corresponding Angular component.
872
- * It handles component instantiation, input property mapping, and child component rendering.
873
- * The method validates input properties against the component's metadata and processes
1020
+ * It handles component instantiation, input property mapping, child component rendering, and visibility
1021
+ * control. The method validates input properties against the component's metadata and processes
874
1022
  * child components recursively.
875
- *
876
1023
  * @param {FieldDefinition<AngularFieldDefinition>} fieldDef - The field definition to convert
877
1024
  * @param {ViewContainerRef} vcr - The view container reference for component creation
878
1025
  * @param {Injector} injector - The Angular injector for dependency injection
879
1026
  * @param {TemplateRef<any>} tpl - The template reference for content projection
880
1027
  * @param {string} registryFormId - Form identifier for the component renderer
1028
+ * @param {boolean} createComponent - Whether to create the component instance
1029
+ * @param {FormParent} [formGroup] - Optional form group for form components
881
1030
  * @return {AngularDynamicOutput} The Angular component output with component reference and inputs
882
- *
883
1031
  * @mermaid
884
1032
  * sequenceDiagram
885
1033
  * participant Method as fromFieldDefinition
@@ -900,14 +1048,15 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
900
1048
  * Method->>Method: Create component instance
901
1049
  * end
902
1050
  * Method-->>Caller: return AngularDynamicOutput
1051
+ * @private
1052
+ * @memberOf module:lib/engine/NgxRenderingEngine
903
1053
  */
904
1054
  private fromFieldDefinition;
905
1055
  /**
906
- * @description Creates an Angular component instance
1056
+ * @description Creates an Angular component instance with inputs and template projection.
907
1057
  * @summary This static utility method creates an Angular component instance with the specified
908
1058
  * inputs and template. It uses Angular's component creation API to instantiate the component
909
1059
  * and then sets the input properties using the provided metadata.
910
- *
911
1060
  * @param {Type<unknown>} component - The component type to create
912
1061
  * @param {KeyValue} [inputs={}] - The input properties to set on the component
913
1062
  * @param {ComponentMirror<unknown>} metadata - The component metadata for input validation
@@ -915,36 +1064,40 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
915
1064
  * @param {Injector} injector - The Angular injector for dependency injection
916
1065
  * @param {Node[]} [template=[]] - The template nodes to project into the component
917
1066
  * @return {ComponentRef<unknown>} The created component reference
1067
+ * @static
1068
+ * @memberOf module:lib/engine/NgxRenderingEngine
918
1069
  */
919
1070
  static createComponent(component: Type<unknown>, inputs: KeyValue | undefined, metadata: ComponentMirror<unknown>, vcr: ViewContainerRef, injector: Injector, template?: Node[]): ComponentRef<unknown>;
920
1071
  /**
921
- * @description Extracts decorator metadata from a model
1072
+ * @description Extracts decorator metadata from a model.
922
1073
  * @summary This method provides access to the field definition generated from a model's
923
1074
  * decorators. It's a convenience wrapper around the toFieldDefinition method that
924
1075
  * converts a model to a field definition based on its decorators and the provided
925
1076
  * global properties.
926
- *
927
1077
  * @param {Model} model - The model to extract decorators from
928
1078
  * @param {Record<string, unknown>} globalProps - Global properties to include in the field definition
929
1079
  * @return {FieldDefinition<AngularFieldDefinition>} The field definition generated from the model
1080
+ * @memberOf module:lib/engine/NgxRenderingEngine
930
1081
  */
931
1082
  getDecorators(model: Model, globalProps: Record<string, unknown>): FieldDefinition<AngularFieldDefinition>;
932
1083
  /**
933
- * @description Destroys the current engine instance
934
- * @summary This static method clears the current instance reference, effectively
935
- * destroying the singleton instance of the rendering engine. This can be used
936
- * to reset the engine state or to prepare for a new instance creation.
937
- *
1084
+ * @description Destroys the current engine instance and cleans up resources.
1085
+ * @summary This static method clears the current instance reference and parent props,
1086
+ * effectively destroying the singleton instance of the rendering engine. Optionally
1087
+ * removes the form registry for the specified form ID. This can be used to reset the
1088
+ * engine state or to prepare for a new instance creation.
1089
+ * @param {string} [formId] - Optional form ID to remove from registry
938
1090
  * @return {Promise<void>} A promise that resolves when the instance is destroyed
1091
+ * @static
1092
+ * @memberOf module:lib/engine/NgxRenderingEngine
939
1093
  */
940
1094
  static destroy(formId?: string): Promise<void>;
941
1095
  /**
942
- * @description Renders a model into an Angular component output
1096
+ * @description Renders a model into an Angular component output.
943
1097
  * @summary This method takes a model and converts it to an Angular component output.
944
1098
  * It first stores a reference to the model, then converts it to a field definition
945
1099
  * using the base RenderingEngine's toFieldDefinition method, and finally converts
946
1100
  * that field definition to an Angular component output using fromFieldDefinition.
947
- *
948
1101
  * @template M - Type extending Model
949
1102
  * @param {M} model - The model to render
950
1103
  * @param {Record<string, unknown>} globalProps - Global properties to pass to the component
@@ -952,7 +1105,6 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
952
1105
  * @param {Injector} injector - The Angular injector for dependency injection
953
1106
  * @param {TemplateRef<any>} tpl - The template reference for content projection
954
1107
  * @return {AngularDynamicOutput} The Angular component output with component reference and inputs
955
- *
956
1108
  * @mermaid
957
1109
  * sequenceDiagram
958
1110
  * participant Client as Client Code
@@ -967,63 +1119,68 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
967
1119
  * Render->>FromField: fromFieldDefinition(fieldDef, vcr, injector, tpl)
968
1120
  * FromField-->>Render: AngularDynamicOutput
969
1121
  * Render-->>Client: return AngularDynamicOutput
1122
+ * @override
1123
+ * @memberOf module:lib/engine/NgxRenderingEngine
970
1124
  */
971
1125
  render<M extends Model>(model: M, globalProps: Record<string, unknown>, vcr: ViewContainerRef, injector: Injector, tpl: TemplateRef<unknown>): AngularDynamicOutput;
972
1126
  /**
973
- * @description Initializes the rendering engine
1127
+ * @description Initializes the rendering engine.
974
1128
  * @summary This method initializes the rendering engine. It checks if the engine is already initialized
975
1129
  * and sets the initialized flag to true. This method is called before the engine is used
976
1130
  * to ensure it's properly set up for rendering operations.
977
- *
978
1131
  * @return {Promise<void>} A promise that resolves when initialization is complete
1132
+ * @override
1133
+ * @memberOf module:lib/engine/NgxRenderingEngine
979
1134
  */
980
1135
  initialize(): Promise<void>;
981
1136
  /**
982
- * @description Registers a component with the rendering engine
1137
+ * @description Registers a component with the rendering engine.
983
1138
  * @summary This static method registers a component constructor with the rendering engine
984
1139
  * under a specific name. It initializes the components registry if needed and throws
985
1140
  * an error if a component is already registered under the same name to prevent
986
1141
  * accidental overrides.
987
- *
988
1142
  * @param {string} name - The name to register the component under
989
1143
  * @param {Constructor<unknown>} constructor - The component constructor
990
1144
  * @return {void}
1145
+ * @static
1146
+ * @memberOf module:lib/engine/NgxRenderingEngine
991
1147
  */
992
1148
  static registerComponent(name: string, constructor: Constructor<unknown>): void;
993
1149
  /**
994
- * @description Retrieves registered components from the rendering engine
1150
+ * @description Retrieves registered components from the rendering engine.
995
1151
  * @summary This static method retrieves either all registered components or a specific component
996
1152
  * by its selector. When called without a selector, it returns an array of all registered
997
1153
  * components. When called with a selector, it returns the specific component if found,
998
1154
  * or throws an error if the component is not registered.
999
- *
1000
1155
  * @param {string} [selector] - Optional selector to retrieve a specific component
1001
1156
  * @return {Object|Array} Either a specific component or an array of all components
1157
+ * @static
1158
+ * @memberOf module:lib/engine/NgxRenderingEngine
1002
1159
  */
1003
1160
  static components(selector?: string): object | string[];
1004
1161
  /**
1005
- * @description Generates a key for reflection metadata
1162
+ * @description Generates a key for reflection metadata storage.
1006
1163
  * @summary This static method generates a key for reflection metadata by prefixing the input key
1007
1164
  * with the Angular engine's reflection prefix. This is used for storing and retrieving
1008
1165
  * metadata in a namespaced way to avoid conflicts with other metadata.
1009
- *
1010
1166
  * @param {string} key - The base key to prefix
1011
1167
  * @return {string} The prefixed key for reflection metadata
1168
+ * @static
1169
+ * @override
1170
+ * @memberOf module:lib/engine/NgxRenderingEngine
1012
1171
  */
1013
1172
  static key(key: string): string;
1014
1173
  /**
1015
- * @description Sets input properties on a component instance
1174
+ * @description Sets input properties on a component instance.
1016
1175
  * @summary This static utility method sets input properties on a component instance
1017
1176
  * based on the provided inputs object and component metadata. It handles both simple
1018
1177
  * values and nested objects, recursively processing object properties. The method
1019
1178
  * validates each input against the component's metadata to ensure only valid inputs
1020
1179
  * are set.
1021
- *
1022
1180
  * @param {ComponentRef<unknown>} component - The component reference to set inputs on
1023
1181
  * @param {KeyValue} inputs - The input properties to set
1024
1182
  * @param {ComponentMirror<unknown>} metadata - The component metadata for input validation
1025
1183
  * @return {void}
1026
- *
1027
1184
  * @mermaid
1028
1185
  * sequenceDiagram
1029
1186
  * participant Caller
@@ -1043,341 +1200,457 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
1043
1200
  * SetInputs->>Component: setInput(key, value)
1044
1201
  * end
1045
1202
  * end
1203
+ * @static
1204
+ * @memberOf module:lib/engine/NgxRenderingEngine
1046
1205
  */
1047
1206
  static setInputs(component: ComponentRef<unknown>, inputs: KeyValue, metadata: ComponentMirror<unknown>): void;
1048
1207
  }
1049
1208
 
1050
1209
  /**
1051
- * @module module:lib/engine/NgxDecafComponentDirective
1210
+ * @module lib/engine/NgxComponentDirective
1052
1211
  * @description Base decaf component abstraction providing shared inputs and utilities.
1053
- * @summary NgxDecafComponentDirective is the abstract foundation for Decaf components and provides common
1212
+ * @summary NgxComponentDirective is the abstract foundation for Decaf components and provides common
1054
1213
  * inputs (model, mapper, pk, props), logging, repository resolution, and event dispatch helpers.
1055
1214
  * It centralizes shared behavior for child components and simplifies integration with the rendering engine.
1056
- *
1057
- * @link {@link NgxDecafComponentDirective}
1215
+ * @link {@link NgxComponentDirective}
1058
1216
  */
1059
1217
 
1060
- declare abstract class NgxDecafComponentDirective extends LoggedClass implements OnChanges {
1061
- protected componentName?: string | undefined;
1062
- protected localeRoot?: string | undefined;
1218
+ /**
1219
+ * @description Base directive for Decaf components in Angular applications.
1220
+ * @summary Abstract base class that provides common functionality for all Decaf components.
1221
+ * This directive establishes a foundation for component development by offering shared inputs
1222
+ * (model, mapper, pk, props), logging infrastructure, repository access, event handling, and
1223
+ * internationalization support. It implements OnChanges to respond to input property changes
1224
+ * and includes utilities for navigation, localization, and dynamic property binding. All Decaf
1225
+ * components should extend this directive to inherit its foundational capabilities.
1226
+ * @class NgxComponentDirective
1227
+ * @extends {LoggedClass}
1228
+ * @implements {OnChanges}
1229
+ * @memberOf module:lib/engine/NgxComponentDirective
1230
+ */
1231
+ declare abstract class NgxComponentDirective extends LoggedClass implements OnChanges {
1063
1232
  /**
1064
- * @description Reference to the component's element.
1233
+ * @description Reference to the component's native DOM element.
1065
1234
  * @summary Provides direct access to the native DOM element of the component through Angular's
1066
1235
  * ViewChild decorator. This reference can be used to manipulate the DOM element directly,
1067
1236
  * apply custom styles, or access native element properties and methods. The element is
1068
1237
  * identified by the 'component' template reference variable.
1069
- *
1070
1238
  * @type {ElementRef}
1071
- * @memberOf NgxDecafComponentDirective
1239
+ * @memberOf module:lib/engine/NgxComponentDirective
1072
1240
  */
1073
1241
  component: ElementRef;
1242
+ /**
1243
+ * @description Name identifier for the component instance.
1244
+ * @summary Provides a string identifier that can be used to name or label the component
1245
+ * instance. This name can be used for debugging purposes, logging, or to identify specific
1246
+ * component instances within a larger application structure. It serves as a human-readable
1247
+ * identifier that helps distinguish between multiple instances of the same component type.
1248
+ * @type {string}
1249
+ * @memberOf module:lib/engine/NgxComponentDirective
1250
+ */
1074
1251
  name: string;
1252
+ /**
1253
+ * @description Parent component identifier for hierarchical component relationships.
1254
+ * @summary Specifies the identifier of the parent component in a hierarchical component structure.
1255
+ * This property establishes a parent-child relationship between components, allowing for
1256
+ * proper nesting and organization of components within a layout. It can be used to track
1257
+ * component dependencies and establish component hierarchies for rendering and event propagation.
1258
+ * @type {string | undefined}
1259
+ * @memberOf module:lib/engine/NgxComponentDirective
1260
+ */
1075
1261
  childOf: string | undefined;
1076
1262
  /**
1077
- * @description Unique identifier for the current record.
1078
- * @summary A unique identifier for the current record being displayed or manipulated.
1079
- * This is typically used in conjunction with the primary key for operations on specific records.
1080
- *
1263
+ * @description Unique identifier for the component instance.
1264
+ * @summary A unique identifier automatically generated for each component instance.
1265
+ * This UID is used for DOM element identification, component tracking, and debugging purposes.
1266
+ * By default, it generates a random 16-character value, but it can be explicitly set via input.
1081
1267
  * @type {string | number}
1082
- * @memberOf NgxDecafComponentDirective
1268
+ * @default generateRandomValue(16)
1269
+ * @memberOf module:lib/engine/NgxComponentDirective
1083
1270
  */
1084
1271
  uid: string | number;
1085
1272
  /**
1086
- * @description Repository model for data operations.
1087
- * @summary The data model repository that this component will use for CRUD operations.
1088
- * This provides a connection to the data layer for retrieving and manipulating data.
1089
- *
1090
- * @type {Model| undefined}
1091
- * @memberOf NgxDecafComponentDirective
1273
+ * @description Data model or model name for component operations.
1274
+ * @summary The data model that this component will use for CRUD operations. This can be provided
1275
+ * as a Model instance, a model constructor, or a string representing the model's registered name.
1276
+ * When set, this property provides the component with access to the model's schema, validation rules,
1277
+ * and metadata needed for rendering and data operations.
1278
+ * @type {Model | string | undefined}
1279
+ * @memberOf module:lib/engine/NgxComponentDirective
1092
1280
  */
1093
1281
  model: Model | string | undefined;
1094
1282
  /**
1095
- * @description The primary data model used for CRUD operations.
1096
- * @summary This input provides the main Model instance that the form interacts with for
1097
- * creating, reading, updating, or deleting records. It serves as the source of schema
1098
- * and validation rules for the form fields, and is required for most operations except
1099
- * for certain read or delete scenarios.
1100
- *
1101
- * @type {string | number | undefined}
1102
- * @memberOf NgxDecafComponentDirective
1283
+ * @description Primary key value of the current model instance.
1284
+ * @summary Specifies the primary key value for the current model record being displayed or
1285
+ * manipulated by the component. This identifier is used for CRUD operations that target
1286
+ * specific records, such as read, update, and delete operations. The value corresponds to
1287
+ * the field designated as the primary key in the model definition.
1288
+ * @type {EventIds}
1289
+ * @memberOf module:lib/engine/NgxComponentDirective
1103
1290
  */
1104
- modelId?: string | number;
1291
+ modelId?: EventIds;
1105
1292
  /**
1106
- * @description Primary key field name for the model.
1293
+ * @description Primary key field name for the data model.
1107
1294
  * @summary Specifies which field in the model should be used as the primary key.
1108
1295
  * This is typically used for identifying unique records in operations like update and delete.
1109
- *
1296
+ * If not explicitly set, it defaults to the repository's configured primary key or 'id'.
1110
1297
  * @type {string}
1111
1298
  * @default 'id'
1112
- * @memberOf NgxDecafComponentDirective
1299
+ * @memberOf module:lib/engine/NgxComponentDirective
1113
1300
  */
1114
1301
  pk: string;
1115
1302
  /**
1116
- * @description Field mapping configuration.
1303
+ * @description Field mapping configuration object or function.
1117
1304
  * @summary Defines how fields from the data model should be mapped to properties used by the component.
1118
- * This allows for flexible data binding between the model and the component's display logic.
1119
- *
1120
- * @type {Record<string, string>}
1121
- * @memberOf NgxDecafComponentDirective
1305
+ * This allows for flexible data binding between the model and the component's display logic. Can be
1306
+ * provided as a static object mapping or as a function for dynamic mapping transformations.
1307
+ * @type {Record<string, string> | FunctionLike}
1308
+ * @default {}
1309
+ * @memberOf module:lib/engine/NgxComponentDirective
1122
1310
  */
1123
1311
  mapper: Record<string, string> | FunctionLike;
1124
1312
  /**
1125
- * @description Available CRUD operations for this component.
1313
+ * @description Available CRUD operations for this component instance.
1126
1314
  * @summary Defines which CRUD operations (Create, Read, Update, Delete) are available
1127
- * for this component. This affects which operations can be performed on the data.
1128
- *
1315
+ * for this component. This affects which operations can be performed on the data and
1316
+ * which operation buttons are displayed in the UI. By default, only READ operations are enabled.
1317
+ * @type {CrudOperations[]}
1129
1318
  * @default [OperationKeys.READ]
1130
- * @memberOf NgxDecafComponentDirective
1319
+ * @memberOf module:lib/engine/NgxComponentDirective
1131
1320
  */
1132
1321
  operations: CrudOperations[];
1133
1322
  /**
1134
- * @description Primary key field name for the model.
1135
- * @summary Specifies which field in the model should be used as the primary key.
1136
- * This is typically used for identifying unique records in operations like update and delete.
1323
+ * @description The CRUD operation type to be performed on the model.
1324
+ * @summary Specifies which operation (Create, Read, Update, Delete) this component instance
1325
+ * should perform. This determines the UI behavior, form configuration, and available actions.
1326
+ * The operation affects form validation, field availability, and the specific repository
1327
+ * method called during data submission.
1137
1328
  *
1329
+ * @type {OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE}
1330
+ * @default OperationKeys.READ
1331
+ * @memberOf ModelPage
1332
+ */
1333
+ operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE;
1334
+ /**
1335
+ * @description Row position in a grid-based layout system.
1336
+ * @summary Specifies the row position of this component when rendered within a grid-based layout.
1337
+ * This property is used for positioning components in multi-row, multi-column layouts and helps
1338
+ * establish the component's vertical placement within the grid structure.
1138
1339
  * @type {number}
1139
1340
  * @default 1
1140
- * @memberOf NgxDecafComponentDirective
1341
+ * @memberOf module:lib/engine/NgxComponentDirective
1141
1342
  */
1142
1343
  row: number;
1143
1344
  /**
1144
- * @description Primary key field name for the model.
1145
- * @summary Specifies which field in the model should be used as the primary key.
1146
- * This is typically used for identifying unique records in operations like update and delete.
1147
- *
1345
+ * @description Column position in a grid-based layout system.
1346
+ * @summary Specifies the column position of this component when rendered within a grid-based layout.
1347
+ * This property is used for positioning components in multi-row, multi-column layouts and helps
1348
+ * establish the component's horizontal placement within the grid structure.
1148
1349
  * @type {number}
1149
1350
  * @default 1
1150
- * @memberOf NgxDecafComponentDirective
1351
+ * @memberOf module:lib/engine/NgxComponentDirective
1151
1352
  */
1152
1353
  col: number;
1153
1354
  /**
1154
- * @description Additional CSS class names to apply to the component.
1355
+ * @description Additional CSS class names for component styling.
1155
1356
  * @summary Allows custom CSS classes to be added to the component's root element.
1156
1357
  * These classes are appended to any automatically generated classes based on other
1157
1358
  * component properties. Multiple classes can be provided as a space-separated string.
1158
1359
  * This provides a way to customize the component's appearance beyond the built-in styling options.
1159
- *
1160
1360
  * @type {string}
1161
1361
  * @default ""
1162
- * @memberOf NgxDecafComponentDirective
1362
+ * @memberOf module:lib/engine/NgxComponentDirective
1163
1363
  */
1164
1364
  className: string;
1165
1365
  /**
1166
- * @description The repository for interacting with the data model.
1366
+ * @description Repository instance for data layer operations.
1167
1367
  * @summary Provides a connection to the data layer for retrieving and manipulating data.
1168
- * This is an instance of the `DecafRepository` class from the `@decaf-ts/core` package,
1169
- * which is initialized in the `repository` getter method.
1170
- *
1368
+ * This is an instance of the DecafRepository class, initialized lazily in the repository getter.
1171
1369
  * The repository is used to perform CRUD (Create, Read, Update, Delete) operations on the
1172
- * data model, such as fetching data, creating new items, updating existing items, and deleting
1173
- * items. It also provides methods for querying and filtering data based on specific criteria.
1174
- *
1370
+ * data model and provides methods for querying and filtering data based on specific criteria.
1175
1371
  * @type {DecafRepository<Model>}
1176
1372
  * @private
1177
- * @memberOf NgxDecafComponentDirective
1373
+ * @memberOf module:lib/engine/NgxComponentDirective
1178
1374
  */
1179
1375
  protected _repository?: DecafRepository<Model>;
1180
1376
  /**
1181
- * @description Root component of the Decaf-ts for Angular application
1182
- * @summary This component serves as the main entry point for the application.
1183
- * It sets up the navigation menu, handles routing events, and initializes
1184
- * the application state. It also manages the application title and menu visibility.
1185
- *
1186
- * @private
1377
+ * @description Ionic menu controller service for menu management.
1378
+ * @summary Injected service that provides programmatic control over Ionic menu components.
1379
+ * This service allows the component to open, close, toggle, and manage menu states within
1380
+ * the application. It provides access to menu functionality for implementing navigation
1381
+ * and layout features that require menu interaction.
1382
+ * @protected
1187
1383
  * @type {MenuController}
1188
- * @memberOf NgxDecafComponentDirective
1384
+ * @memberOf module:lib/engine/NgxComponentDirective
1189
1385
  */
1190
1386
  protected menuController: MenuController;
1191
1387
  /**
1192
- * @description Angular change detection service.
1193
- * @summary Injected service that provides manual control over change detection cycles.
1194
- * This is essential for ensuring that programmatic DOM changes (like setting accordion
1195
- * attributes) are properly reflected in the component's state and trigger appropriate
1196
- * view updates when modifications occur outside the normal Angular change detection flow.
1197
- *
1198
- * @protected
1199
- * @type {ChangeDetectorRef}
1200
- * @memberOf CrudFormComponent
1201
- */
1388
+ * @description Angular change detection service for manual change detection control.
1389
+ * @summary Injected service that provides manual control over change detection cycles.
1390
+ * This is essential for ensuring that programmatic DOM changes (like setting accordion
1391
+ * attributes) are properly reflected in the component's state and trigger appropriate
1392
+ * view updates when modifications occur outside the normal Angular change detection flow.
1393
+ * @protected
1394
+ * @type {ChangeDetectorRef}
1395
+ * @memberOf module:lib/engine/NgxComponentDirective
1396
+ */
1202
1397
  protected changeDetectorRef: ChangeDetectorRef;
1203
1398
  /**
1204
- * @description Angular Renderer2 service for safe DOM manipulation.
1399
+ * @description Angular Renderer2 service for platform-agnostic DOM manipulation.
1205
1400
  * @summary Injected service that provides a safe, platform-agnostic way to manipulate DOM elements.
1206
1401
  * This service ensures proper handling of DOM operations across different platforms and environments,
1207
- * including server-side rendering and web workers.
1208
- *
1402
+ * including server-side rendering and web workers, without direct DOM access.
1209
1403
  * @protected
1210
1404
  * @type {Renderer2}
1211
- * @memberOf CrudFormComponent
1405
+ * @memberOf module:lib/engine/NgxComponentDirective
1212
1406
  */
1213
1407
  protected renderer: Renderer2;
1214
1408
  /**
1215
- * @description Translation service for internationalization.
1409
+ * @description Translation service for application internationalization.
1216
1410
  * @summary Injected service that provides translation capabilities for UI text.
1217
- * Used to translate button labels and validation messages based on the current locale.
1218
- *
1411
+ * Used to translate button labels, validation messages, and other text content based
1412
+ * on the current locale setting, enabling multilingual support throughout the application.
1219
1413
  * @protected
1220
1414
  * @type {TranslateService}
1221
- * @memberOf CrudFormComponent
1415
+ * @memberOf module:lib/engine/NgxComponentDirective
1222
1416
  */
1223
1417
  protected translateService: TranslateService;
1224
1418
  /**
1225
- * @description Logger instance for the component.
1419
+ * @description Logger instance for structured component logging.
1226
1420
  * @summary Provides logging capabilities for the component, allowing for consistent
1227
- * and structured logging of information, warnings, and errors. This logger is initialized
1228
- * in the ngOnInit method using the getLogger function from the ForAngularCommonModule.
1229
- *
1421
+ * and structured logging of information, warnings, and errors. This logger is inherited
1422
+ * from the LoggedClass and provides access to structured logging functionality.
1230
1423
  * The logger is used throughout the component to record important events, debug information,
1231
- * and potential issues. It helps in monitoring the component's behavior, tracking the flow
1232
- * of operations, and facilitating easier debugging and maintenance.
1233
- *
1424
+ * and potential issues, facilitating easier debugging and maintenance.
1234
1425
  * @type {Logger}
1235
- * @private
1236
- * @memberOf NgxDecafComponentDirective
1426
+ * @memberOf module:lib/engine/NgxComponentDirective
1237
1427
  */
1238
1428
  logger: Logger;
1239
1429
  /**
1240
- * @description Event emitter for custom renderer events.
1241
- * @summary Emits custom events that occur within child components or the layout itself.
1430
+ * @description Event emitter for custom component events.
1431
+ * @summary Emits custom events that occur within child components or the component itself.
1242
1432
  * This allows parent components to listen for and respond to user interactions or
1243
- * state changes within the grid layout. Events are passed up the component hierarchy
1244
- * to enable coordinated behavior across the application.
1245
- *
1433
+ * state changes. Events are passed up the component hierarchy to enable coordinated
1434
+ * behavior across the application.
1246
1435
  * @type {EventEmitter<IBaseCustomEvent>}
1247
- * @memberOf NgxDecafComponentDirective
1436
+ * @memberOf module:lib/engine/NgxComponentDirective
1248
1437
  */
1249
1438
  listenEvent: EventEmitter<IBaseCustomEvent>;
1250
1439
  /**
1251
- * @description Angular Router instance for navigation
1252
- * @summary Injected Router service used for programmatic navigation
1253
- * to other pages after successful login or other routing operations.
1254
- *
1255
- * @private
1440
+ * @description Angular Router instance for programmatic navigation.
1441
+ * @summary Injected Router service used for programmatic navigation between routes
1442
+ * in the application. This service enables navigation to different views and operations,
1443
+ * handles route parameters, and manages the browser's navigation history.
1444
+ * @protected
1256
1445
  * @type {Router}
1257
- * @memberOf NgxDecafComponentDirective
1446
+ * @memberOf module:lib/engine/NgxComponentDirective
1258
1447
  */
1259
1448
  protected router: Router;
1260
1449
  /**
1261
- * @description Angular Router instance for navigation
1262
- * @summary Injected Router service used for programmatic navigation
1263
- * to other pages after successful login or other routing operations.
1264
- *
1265
- * @private
1266
- * @type {Router}
1267
- * @memberOf NgxDecafComponentDirective
1450
+ * @description Current locale identifier for component internationalization.
1451
+ * @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text
1452
+ * and formatting data according to regional conventions. This property can be set to override
1453
+ * the default application locale for this specific component instance, enabling per-component
1454
+ * localization when needed.
1455
+ * @type {string | undefined}
1456
+ * @memberOf module:lib/engine/NgxComponentDirective
1268
1457
  */
1269
1458
  locale?: string;
1270
1459
  /**
1271
- * @description Configuration for list item rendering
1460
+ * @description Configuration for list item rendering behavior.
1272
1461
  * @summary Defines how list items should be rendered in the component.
1273
1462
  * This property holds a configuration object that specifies the tag name
1274
1463
  * and other properties needed to render list items correctly. The tag property
1275
1464
  * identifies which component should be used to render each item in a list.
1276
1465
  * Additional properties can be included to customize the rendering behavior.
1277
- *
1278
1466
  * @type {Record<string, unknown>}
1279
1467
  * @default {tag: ""}
1280
- * @memberOf NgxDecafComponentDirective
1468
+ * @memberOf module:lib/engine/NgxComponentDirective
1281
1469
  */
1282
1470
  item: Record<string, unknown>;
1283
1471
  /**
1284
- * @description Dynamic properties configuration object.
1472
+ * @description Dynamic properties configuration for runtime customization.
1285
1473
  * @summary Contains key-value pairs of dynamic properties that can be applied to the component
1286
1474
  * at runtime. This flexible configuration object allows for dynamic property assignment without
1287
1475
  * requiring explicit input bindings for every possible configuration option. Properties from
1288
1476
  * this object are parsed and applied to the component instance through the parseProps method,
1289
1477
  * enabling customizable component behavior based on external configuration.
1290
- *
1291
1478
  * @type {Record<string, unknown>}
1292
1479
  * @default {}
1293
- * @memberOf NgxDecafComponentDirective
1480
+ * @memberOf module:lib/engine/NgxComponentDirective
1294
1481
  */
1295
1482
  props: Record<string, unknown>;
1296
1483
  /**
1297
- * @description Base route for navigation related to this component.
1484
+ * @description Base route path for component navigation.
1298
1485
  * @summary Defines the base route path used for navigation actions related to this component.
1299
- * This is often used as a prefix for constructing navigation URLs.
1300
- *
1486
+ * This is often used as a prefix for constructing navigation URLs when transitioning between
1487
+ * different operations or views. The route helps establish the component's position in the
1488
+ * application's routing hierarchy.
1301
1489
  * @type {string}
1302
- * @memberOf NgxDecafComponentDirective
1490
+ * @memberOf module:lib/engine/NgxComponentDirective
1303
1491
  */
1304
1492
  route: string;
1305
1493
  /**
1306
- * @description Flag indicating if the component has been initialized
1494
+ * @description Initialization status flag for the component.
1307
1495
  * @summary Tracks whether the component has completed its initialization process.
1308
1496
  * This flag is used to prevent duplicate initialization and to determine if
1309
1497
  * certain operations that require initialization can be performed.
1310
- *
1311
1498
  * @type {boolean}
1312
1499
  * @default false
1313
- * @memberOf NgxDecafComponentDirective
1500
+ * @memberOf module:lib/engine/NgxComponentDirective
1314
1501
  */
1315
1502
  initialized: boolean;
1316
- constructor(componentName?: string | undefined, localeRoot?: string | undefined);
1317
- get localeContext(): string;
1318
1503
  /**
1319
- * @description Getter for the repository instance.
1320
- * @summary Provides a connection to the data layer for retrieving and manipulating data.
1321
- * This method initializes the `_repository` property if it is not already set, ensuring
1322
- * that a single instance of the repository is used throughout the component.
1323
- *
1324
- * The repository is used to perform CRUD operations on the data model, such as fetching data,
1325
- * creating new items, updating existing items, and deleting items. It also provides methods
1326
- * for querying and filtering data based on specific criteria.
1504
+ * @description Component name identifier for logging and localization contexts.
1505
+ * @summary Stores the component's name which is used as a key for logging contexts
1506
+ * and as a base for locale resolution. Can be injected via the CPTKN token or defaults
1507
+ * to "NgxComponentDirective" if not provided.
1508
+ * @protected
1509
+ * @type {string | undefined}
1510
+ * @memberOf module:lib/engine/NgxComponentDirective
1511
+ */
1512
+ protected componentName?: string;
1513
+ /**
1514
+ * @description Root key for component locale context resolution.
1515
+ * @summary Defines the base key used to resolve localization contexts for this component.
1516
+ * If not explicitly provided, it defaults to the component's name. This key is used to
1517
+ * load appropriate translation resources and locale-specific configurations.
1518
+ * @protected
1519
+ * @type {string | undefined}
1520
+ * @memberOf module:lib/engine/NgxComponentDirective
1521
+ */
1522
+ protected localeRoot?: string;
1523
+ /**
1524
+ * @description Reference to CRUD operation constants for template usage.
1525
+ * @summary Exposes the OperationKeys enum to the component template, enabling
1526
+ * conditional rendering and behavior based on operation types. This protected
1527
+ * readonly property ensures that template logic can access operation constants
1528
+ * while maintaining encapsulation and preventing accidental modification.
1529
+ * @protected
1530
+ * @readonly
1531
+ * @memberOf module:lib/engine/NgxComponentDirective
1532
+ */
1533
+ protected readonly OperationKeys: typeof OperationKeys;
1534
+ /**
1535
+ * @description Angular Location service.
1536
+ * @summary Injected service that provides access to the browser's URL and history.
1537
+ * This service is used for interacting with the browser's history API, allowing
1538
+ * for back navigation and URL manipulation outside of Angular's router.
1327
1539
  *
1328
- * @returns {DecafRepository<Model>} The initialized repository instance.
1329
1540
  * @private
1330
- * @memberOf NgxDecafComponentDirective
1541
+ * @type {Location}
1542
+ */
1543
+ protected location: Location;
1544
+ /**
1545
+ * @description Constructor for NgxComponentDirective.
1546
+ * @summary Initializes the directive by setting up the component name, locale root,
1547
+ * and logger. Calls the parent LoggedClass constructor and configures localization
1548
+ * context. The component name and locale root can be optionally injected via the
1549
+ * CPTKN token, otherwise defaults are used.
1550
+ * @param {string} [componentName] - Optional component name for identification and logging
1551
+ * @param {string} [localeRoot] - Optional locale root key for internationalization
1552
+ * @memberOf module:lib/engine/NgxComponentDirective
1553
+ */
1554
+ constructor(componentName?: string, localeRoot?: string);
1555
+ /**
1556
+ * @description Getter for the current locale context identifier.
1557
+ * @summary Returns the current locale identifier by calling the getLocale method.
1558
+ * This property provides convenient access to the component's active locale setting.
1559
+ * @returns {string} The current locale identifier
1560
+ * @memberOf module:lib/engine/NgxComponentDirective
1561
+ */
1562
+ get localeContext(): string;
1563
+ /**
1564
+ * @description Getter for the data repository instance.
1565
+ * @summary Lazily initializes and returns the DecafRepository instance for the current model.
1566
+ * This getter ensures the repository is created only when needed and reused for subsequent
1567
+ * access. It also automatically sets the primary key field if not explicitly configured.
1568
+ * @protected
1569
+ * @returns {DecafRepository<Model>} The repository instance for the current model
1570
+ * @throws {InternalError} If repository initialization fails
1571
+ * @memberOf module:lib/engine/NgxComponentDirective
1331
1572
  */
1332
1573
  protected get repository(): DecafRepository<Model>;
1333
1574
  /**
1334
- * @description Handles changes to component inputs
1335
- * @summary This Angular lifecycle hook is called when input properties change.
1336
- * It responds to changes in the model, locale, or translatable properties by
1337
- * updating the component's internal state accordingly. When the model changes,
1338
- * it calls getModel to process the new model and getLocale to update the locale.
1339
- * When locale or translatable properties change, it calls getLocale to update
1340
- * the translation settings.
1341
- *
1342
- * @param {SimpleChanges} changes - Object containing changed properties
1575
+ * @description Angular lifecycle hook for handling input property changes.
1576
+ * @summary Responds to changes in component input properties, specifically monitoring changes
1577
+ * to the model, locale root, and component name properties. When the model changes, it triggers
1578
+ * model initialization and locale context updates. When locale-related properties change,
1579
+ * it updates the component's locale setting accordingly.
1580
+ * @param {SimpleChanges} changes - Object containing the changed properties with their previous and current values
1343
1581
  * @return {void}
1582
+ * @memberOf module:lib/engine/NgxComponentDirective
1344
1583
  */
1345
1584
  ngOnChanges(changes: SimpleChanges): void;
1585
+ /**
1586
+ * @description Translates text phrases using the translation service.
1587
+ * @summary Provides a promise-based wrapper around the translation service to translate
1588
+ * UI text based on the current locale. Supports both single phrases and arrays of phrases,
1589
+ * and accepts optional parameters for template interpolation. When a string parameter is
1590
+ * provided, it's automatically converted to an object format for the translation service.
1591
+ * @protected
1592
+ * @param {string | string[]} phrase - The translation key or array of keys to translate
1593
+ * @param {object | string} [params] - Optional parameters for interpolation in translated text
1594
+ * @return {Promise<string>} A promise that resolves to the translated text
1595
+ * @memberOf module:lib/engine/NgxComponentDirective
1596
+ */
1346
1597
  protected translate(phrase: string | string[], params?: object | string): Promise<string>;
1598
+ /**
1599
+ * @description Initializes the component asynchronously with custom logic.
1600
+ * @summary Abstract initialization method that can be overridden by child components to perform
1601
+ * custom initialization logic. By default, it simply sets the initialized flag to true.
1602
+ * Child components can extend this method to load data, configure settings, or perform
1603
+ * other setup operations required before the component is fully functional.
1604
+ * @protected
1605
+ * @param {...unknown[]} args - Variable number of arguments that can be used by child implementations
1606
+ * @return {Promise<void>} A promise that resolves when initialization is complete
1607
+ * @memberOf module:lib/engine/NgxComponentDirective
1608
+ */
1347
1609
  protected initialize(...args: unknown[]): Promise<void>;
1610
+ /**
1611
+ * @description Retrieves or sets the locale context for the component.
1612
+ * @summary Gets the locale identifier from the locale context system. If a locale parameter
1613
+ * is provided, it updates the localeRoot property and resolves the new locale context.
1614
+ * If no locale is currently set, it initializes it from the localeRoot.
1615
+ * @protected
1616
+ * @param {string} [locale] - Optional locale identifier to set
1617
+ * @return {string} The current locale identifier
1618
+ * @memberOf module:lib/engine/NgxComponentDirective
1619
+ */
1348
1620
  protected getLocale(locale?: string): string;
1349
1621
  /**
1350
- * @description Gets the route for the component
1351
- * @summary Retrieves the route path for the component, generating one based on the model
1352
- * if no route is explicitly set. This method checks if a route is already defined, and if not,
1353
- * it creates a default route based on the model's constructor name. The generated route follows
1354
- * the pattern '/model/{ModelName}'. This is useful for automatic routing in CRUD operations.
1355
- *
1356
- * @return {string} The route path for the component, or empty string if no route is available
1622
+ * @description Retrieves or generates the route path for the component.
1623
+ * @summary Gets the navigation route associated with this component. If no route is explicitly
1624
+ * set and a model is available, it automatically generates a route based on the model's
1625
+ * class name using the pattern `/model/{ModelName}`. Returns an empty string if neither
1626
+ * a route nor a model is available.
1627
+ * @return {string} The route path for this component
1628
+ * @memberOf module:lib/engine/NgxComponentDirective
1357
1629
  */
1358
1630
  getRoute(): string;
1359
1631
  /**
1360
- * @description Resolves and sets the component's model
1361
- * @summary Processes the provided model parameter, which can be either a Model instance
1362
- * or a string identifier. If a string is provided, it attempts to resolve the actual model
1363
- * from the injectables registry. After resolving the model, it calls setModelDefinitions
1364
- * to configure the component based on the model's metadata.
1365
- *
1366
- * @param {string | Model} model - The model instance or identifier string
1632
+ * @description Resolves and initializes a model from various input formats.
1633
+ * @summary Accepts a model in multiple formats (string name, Model instance, or ModelConstructor)
1634
+ * and resolves it to a Model instance. When a string is provided, it looks up the model
1635
+ * by name in the Model registry. After resolution, it delegates to setModelDefinitions
1636
+ * to complete the model initialization and configuration.
1637
+ * @template M - The model type extending from Model
1638
+ * @param {string | Model | ModelConstructor<M>} model - The model to resolve and initialize
1367
1639
  * @return {void}
1640
+ * @memberOf module:lib/engine/NgxComponentDirective
1368
1641
  */
1369
1642
  getModel<M extends Model>(model: string | Model | ModelConstructor<M>): void;
1370
1643
  /**
1371
- * @description Configures component properties based on model metadata
1372
- * @summary Extracts and applies configuration from the model's decorators to set up
1373
- * the component. This method uses the rendering engine to retrieve decorator metadata
1374
- * from the model, then configures the component's mapper and item properties accordingly.
1375
- * It ensures the route is properly set and merges various properties from the model's
1376
- * metadata into the component's configuration.
1377
- *
1378
- * @param {Model} model - The model to extract configuration from
1379
- * @return {void}
1380
- */
1644
+ * @description Configures component properties based on model decorators and metadata.
1645
+ * @summary Extracts rendering configuration from the model's decorators using the rendering
1646
+ * engine. This includes props, item configuration, and child component definitions. It sets
1647
+ * up the mapper for field transformations, configures the item renderer with appropriate
1648
+ * properties, and establishes the route for navigation. This method bridges the model's
1649
+ * decorator metadata with the component's runtime configuration.
1650
+ * @param {Model} model - The model instance to extract definitions from
1651
+ * @return {void}
1652
+ * @memberOf module:lib/engine/NgxComponentDirective
1653
+ */
1381
1654
  setModelDefinitions(model: Model): void;
1382
1655
  /**
1383
1656
  * @description Parses and applies properties from the props object to the component instance.
@@ -1386,212 +1659,505 @@ declare abstract class NgxDecafComponentDirective extends LoggedClass implements
1386
1659
  * component instance. This allows for dynamic property assignment based on configuration
1387
1660
  * stored in the props object, enabling flexible component customization without requiring
1388
1661
  * explicit property binding for every possible configuration option.
1389
- *
1390
1662
  * The method performs a safe property assignment by checking if each key from the instance
1391
1663
  * exists in the props object before applying it. This prevents accidental property
1392
1664
  * overwriting and ensures only intended properties are modified.
1393
- *
1394
1665
  * @param {KeyValue} instance - The component instance object to process
1666
+ * @param {string[]} [skip=[]] - Array of property names to skip during parsing
1395
1667
  * @return {void}
1396
- *
1397
1668
  * @mermaid
1398
1669
  * sequenceDiagram
1399
1670
  * participant C as Component
1400
- * participant B as NgxBaseComponentDirective
1671
+ * participant D as NgxComponentDirective
1401
1672
  * participant P as Props Object
1402
1673
  *
1403
- * C->>B: parseProps(instance)
1404
- * B->>B: Get Object.keys(instance)
1674
+ * C->>D: parseProps(instance, skip)
1675
+ * D->>D: Get Object.keys(instance)
1405
1676
  * loop For each key in instance
1406
- * B->>P: Check if key exists in this.props
1407
- * alt Key exists in props
1408
- * B->>B: Set this[key] = this.props[key]
1409
- * else Key not in props
1410
- * Note over B: Skip this key
1677
+ * D->>D: Check if key in skip array
1678
+ * alt Key not in skip
1679
+ * D->>P: Check if key exists in this.props
1680
+ * alt Key exists in props
1681
+ * D->>D: Set this[key] = this.props[key]
1682
+ * D->>P: delete this.props[key]
1683
+ * else Key not in props
1684
+ * Note over D: Skip this key
1685
+ * end
1411
1686
  * end
1412
1687
  * end
1413
- *
1414
1688
  * @protected
1415
- * @memberOf NgxBaseComponentDirective
1689
+ * @memberOf module:lib/engine/NgxComponentDirective
1416
1690
  */
1417
1691
  protected parseProps(instance: KeyValue, skip?: string[]): void;
1418
1692
  /**
1419
- * @description Tracks items in ngFor loops for optimal change detection.
1693
+ * @description Tracks items in ngFor loops for optimal change detection performance.
1420
1694
  * @summary Provides a tracking function for Angular's *ngFor directive to optimize rendering
1421
1695
  * performance. This method generates unique identifiers for list items based on their index
1422
1696
  * and content, allowing Angular to efficiently track changes and minimize DOM manipulations
1423
1697
  * during list updates. The tracking function is essential for maintaining component state
1424
1698
  * and preventing unnecessary re-rendering of unchanged items.
1425
- *
1699
+ * @protected
1426
1700
  * @param {number} index - The index of the item in the list
1427
1701
  * @param {KeyValue | string | number} item - The item data to track
1428
- * @returns {string | number} A unique identifier for the item
1429
- * @memberOf NgxDecafComponentDirective
1702
+ * @return {string | number} A unique identifier for the item
1703
+ * @memberOf module:lib/engine/NgxComponentDirective
1430
1704
  */
1431
1705
  protected trackItemFn(index: number, item: KeyValue | string | number): string | number;
1706
+ /**
1707
+ * @description Handles custom events from child components or DOM elements.
1708
+ * @summary Processes custom events by extracting event handlers and delegating to appropriate
1709
+ * handler classes. Supports both CustomEvent format with detail property and direct event
1710
+ * objects. If specific handlers are defined in the event, it instantiates the handler class
1711
+ * and invokes its handle method. If no handler is found or defined, the event is emitted
1712
+ * up the component hierarchy via the listenEvent output.
1713
+ * @param {IBaseCustomEvent | ICrudFormEvent | CustomEvent} event - The event to handle
1714
+ * @return {Promise<void>} A promise that resolves when event handling is complete
1715
+ * @mermaid
1716
+ * sequenceDiagram
1717
+ * participant C as Child Component
1718
+ * participant D as NgxComponentDirective
1719
+ * participant H as Event Handler
1720
+ * participant P as Parent Component
1721
+ *
1722
+ * C->>D: handleEvent(event)
1723
+ * alt Event is CustomEvent
1724
+ * D->>D: Extract event.detail
1725
+ * end
1726
+ * D->>D: Get event name and handlers
1727
+ * alt Handlers defined
1728
+ * alt Handler exists for event
1729
+ * D->>H: new Handler(router)
1730
+ * D->>H: handle(event)
1731
+ * H-->>D: return result
1732
+ * else No handler found
1733
+ * D->>D: log.debug("No handler found")
1734
+ * end
1735
+ * else No handlers
1736
+ * D->>P: listenEvent.emit(event)
1737
+ * end
1738
+ * @memberOf module:lib/engine/NgxComponentDirective
1739
+ */
1432
1740
  handleEvent(event: IBaseCustomEvent | ICrudFormEvent | CustomEvent): Promise<void>;
1433
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxDecafComponentDirective, never>;
1434
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDecafComponentDirective, never, never, { "name": { "alias": "name"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; "model": { "alias": "model"; "required": false; }; "modelId": { "alias": "modelId"; "required": false; }; "pk": { "alias": "pk"; "required": false; }; "mapper": { "alias": "mapper"; "required": false; }; "operations": { "alias": "operations"; "required": false; }; "row": { "alias": "row"; "required": false; }; "col": { "alias": "col"; "required": false; }; "className": { "alias": "className"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "item": { "alias": "item"; "required": false; }; "props": { "alias": "props"; "required": false; }; "route": { "alias": "route"; "required": false; }; }, { "listenEvent": "listenEvent"; }, never, never, true, never>;
1741
+ /**
1742
+ * @description Determines if a specific operation is allowed in the current context.
1743
+ * @summary This method checks if an operation is included in the list of available
1744
+ * CRUD operations and if it's not the current operation (unless the current operation
1745
+ * is CREATE). This is used to enable/disable or show/hide operation buttons in the UI.
1746
+ * Returns false if the operations array is undefined or the operation is not in the list.
1747
+ * @param {string} operation - The operation to check
1748
+ * @return {boolean} True if the operation is allowed, false otherwise
1749
+ * @mermaid
1750
+ * sequenceDiagram
1751
+ * participant D as NgxComponentDirective
1752
+ * participant U as UI
1753
+ *
1754
+ * U->>D: isAllowed(operation)
1755
+ * alt operations is undefined
1756
+ * D-->>U: Return false
1757
+ * else
1758
+ * D->>D: Check if operation is in operations
1759
+ * D->>D: Check if operation is not current operation
1760
+ * D-->>U: Return result
1761
+ * end
1762
+ * @memberOf module:lib/engine/NgxComponentDirective
1763
+ */
1764
+ isAllowed(operation: string): boolean;
1765
+ /**
1766
+ * @description Navigates to a different operation for the current model.
1767
+ * @summary This method constructs a navigation URL based on the component's base route,
1768
+ * the requested operation, and optionally a model ID. It then uses the Angular router
1769
+ * service to navigate to the constructed URL. This is typically used when switching
1770
+ * between different CRUD operations (create, read, update, delete) on a model.
1771
+ * The URL format is: {route}/{operation}/{id?}
1772
+ * @param {string} operation - The operation to navigate to (e.g., 'create', 'read', 'update', 'delete')
1773
+ * @param {string} [id] - Optional model ID to include in the navigation URL
1774
+ * @return {Promise<boolean>} A promise that resolves to true if navigation was successful
1775
+ * @mermaid
1776
+ * sequenceDiagram
1777
+ * participant U as UI
1778
+ * participant D as NgxComponentDirective
1779
+ * participant R as Router
1780
+ *
1781
+ * U->>D: Click operation button
1782
+ * D->>D: changeOperation(operation, id)
1783
+ * D->>D: Construct navigation URL
1784
+ * Note over D: URL: {route}/{operation}/{id?}
1785
+ * D->>R: navigateByUrl(page)
1786
+ * R->>R: Navigate to new route
1787
+ * R-->>D: Return navigation result
1788
+ * D-->>U: Display new operation view
1789
+ * @memberOf module:lib/engine/NgxComponentDirective
1790
+ */
1791
+ changeOperation(operation: string, id?: string): Promise<boolean>;
1792
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxComponentDirective, never>;
1793
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxComponentDirective, never, never, { "name": { "alias": "name"; "required": false; }; "childOf": { "alias": "childOf"; "required": false; }; "uid": { "alias": "uid"; "required": false; }; "model": { "alias": "model"; "required": false; }; "modelId": { "alias": "modelId"; "required": false; }; "pk": { "alias": "pk"; "required": false; }; "mapper": { "alias": "mapper"; "required": false; }; "operations": { "alias": "operations"; "required": false; }; "operation": { "alias": "operation"; "required": false; }; "row": { "alias": "row"; "required": false; }; "col": { "alias": "col"; "required": false; }; "className": { "alias": "className"; "required": false; }; "locale": { "alias": "locale"; "required": false; }; "item": { "alias": "item"; "required": false; }; "props": { "alias": "props"; "required": false; }; "route": { "alias": "route"; "required": false; }; }, { "listenEvent": "listenEvent"; }, never, never, true, never>;
1435
1794
  }
1436
1795
 
1437
1796
  /**
1438
- * @class NgxDecafFormFieldDirective
1439
- * @implements {FieldProperties}
1797
+ * @description Abstract base directive for CRUD form fields in Angular applications.
1798
+ * @summary Provides the foundation for all form field components in Decaf applications by implementing
1799
+ * Angular's ControlValueAccessor interface and FieldProperties for validation. This directive manages
1800
+ * form control integration, validation state, multi-entry forms (FormArrays), and CRUD operation context.
1801
+ * It handles form group lifecycle, error messaging, change detection, and parent-child form relationships.
1802
+ * Extend this class to create custom form field components that seamlessly integrate with Angular's
1803
+ * reactive forms and Decaf's validation system.
1804
+ * @class NgxFormFieldDirective
1805
+ * @extends {NgxComponentDirective}
1440
1806
  * @implements {ControlValueAccessor}
1441
- * @summary Abstract class representing a CRUD form field for Angular applications
1442
- * @description This class provides the base implementation for CRUD form fields in Angular,
1443
- * implementing both CrudFormField and ControlValueAccessor interfaces.
1807
+ * @implements {FieldProperties}
1808
+ * @example
1809
+ * ```typescript
1810
+ * @Component({
1811
+ * selector: 'app-text-field',
1812
+ * templateUrl: './text-field.component.html',
1813
+ * providers: [{
1814
+ * provide: NG_VALUE_ACCESSOR,
1815
+ * useExisting: forwardRef(() => TextFieldComponent),
1816
+ * multi: true
1817
+ * }]
1818
+ * })
1819
+ * export class TextFieldComponent extends NgxFormFieldDirective {
1820
+ * constructor() {
1821
+ * super();
1822
+ * }
1823
+ * }
1824
+ * ```
1444
1825
  */
1445
- declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirective implements ControlValueAccessor, FieldProperties {
1826
+ declare abstract class NgxFormFieldDirective extends NgxComponentDirective implements ControlValueAccessor, FieldProperties {
1446
1827
  /**
1447
1828
  * @description Index of the currently active form group in a form array.
1448
1829
  * @summary When working with multiple form groups (form arrays), this indicates
1449
1830
  * which form group is currently active or being edited. This is used to manage
1450
1831
  * focus and data binding in multi-entry scenarios.
1451
- *
1452
1832
  * @type {number}
1453
1833
  * @default 0
1454
- * @memberOf NgxDecafFormFieldDirective
1834
+ * @public
1455
1835
  */
1456
1836
  activeFormGroupIndex: number;
1837
+ operation: CrudOperations;
1457
1838
  /**
1458
- * @description FormArray containing multiple form groups for this field.
1459
- * @summary When this field is part of a multi-entry structure, this FormArray
1460
- * contains all the form groups. This enables management of multiple instances
1461
- * of the same field structure within a single form.
1462
- *
1463
- * @type {FormArray}
1464
- * @memberOf CrudFieldComponent
1839
+ * @description Parent form container for this field.
1840
+ * @summary Reference to the parent FormGroup or FormArray that contains this field.
1841
+ * When this field is part of a multi-entry structure, this contains the FormArray
1842
+ * with all form groups. This enables management of multiple instances of the same
1843
+ * field structure within a single form.
1844
+ * @type {FormParent}
1845
+ * @public
1465
1846
  */
1466
1847
  parentComponent: FormParent;
1467
1848
  /**
1468
- * @description Field mapping configuration.
1849
+ * @description Field mapping configuration for options.
1469
1850
  * @summary Defines how fields from the data model should be mapped to properties used by the component.
1470
1851
  * This allows for flexible data binding between the model and the component's display logic.
1471
- *
1852
+ * Can be either a key-value mapping object or a function that performs the mapping.
1472
1853
  * @type {KeyValue | FunctionLike}
1473
- * @memberOf CrudFieldComponent
1854
+ * @public
1474
1855
  */
1475
1856
  optionsMapper: KeyValue | FunctionLike;
1476
1857
  /**
1477
- * @summary Current CRUD operation
1478
- * @description Represents the current CRUD operation being performed
1858
+ * @description Angular FormGroup instance for the field.
1859
+ * @summary The FormGroup that contains this field's FormControl. Used for managing
1860
+ * the field's validation state and value within the reactive forms structure.
1861
+ * @type {FormGroup | undefined}
1862
+ * @public
1479
1863
  */
1480
- operation: CrudOperations;
1864
+ formGroup: FormGroup | undefined;
1481
1865
  /**
1482
- * @summary Form group for the field
1483
- * @description Angular FormGroup instance for the field
1866
+ * @description Angular FormControl instance for this field.
1867
+ * @summary The FormControl that manages this field's value, validation state, and user interactions.
1868
+ * @type {FormControl}
1869
+ * @public
1484
1870
  */
1485
- formGroup: FormGroup | undefined;
1486
1871
  formControl: FormControl;
1872
+ /**
1873
+ * @description Dot-separated path to this field in the form structure.
1874
+ * @summary Used to locate this field within nested form structures.
1875
+ * @type {string}
1876
+ * @public
1877
+ */
1487
1878
  path: string;
1879
+ /**
1880
+ * @description The input type of this field.
1881
+ * @summary Determines the HTML input type or component type to render.
1882
+ * @type {PossibleInputTypes}
1883
+ * @public
1884
+ */
1488
1885
  type: PossibleInputTypes;
1886
+ /**
1887
+ * @description Whether the field is disabled.
1888
+ * @summary When true, the field cannot be edited by the user.
1889
+ * @type {boolean}
1890
+ * @public
1891
+ */
1489
1892
  disabled?: boolean;
1893
+ /**
1894
+ * @description Page number for multi-page forms.
1895
+ * @summary Indicates which page this field belongs to in a multi-page form structure.
1896
+ * @type {number}
1897
+ * @public
1898
+ */
1490
1899
  page: number;
1900
+ /**
1901
+ * @description Date/time format string for parsing and display.
1902
+ * @type {string}
1903
+ * @public
1904
+ */
1491
1905
  format?: string;
1906
+ /**
1907
+ * @description Controls field visibility based on CRUD operations.
1908
+ * @summary Can be a boolean or an array of operation keys where the field should be hidden.
1909
+ * @type {boolean | CrudOperationKeys[]}
1910
+ * @public
1911
+ */
1492
1912
  hidden?: boolean | CrudOperationKeys[];
1913
+ /**
1914
+ * @description Maximum value or date allowed.
1915
+ * @type {number | Date}
1916
+ * @public
1917
+ */
1493
1918
  max?: number | Date;
1919
+ /**
1920
+ * @description Maximum length for text input.
1921
+ * @type {number}
1922
+ * @public
1923
+ */
1494
1924
  maxlength?: number;
1925
+ /**
1926
+ * @description Minimum value or date allowed.
1927
+ * @type {number | Date}
1928
+ * @public
1929
+ */
1495
1930
  min?: number | Date;
1931
+ /**
1932
+ * @description Minimum length for text input.
1933
+ * @type {number}
1934
+ * @public
1935
+ */
1496
1936
  minlength?: number;
1497
- pattern?: string | undefined;
1937
+ /**
1938
+ * @description Regex pattern for validation.
1939
+ * @type {string | undefined}
1940
+ * @public
1941
+ */
1942
+ pattern?: string | undefined;
1943
+ /**
1944
+ * @description Whether the field is read-only.
1945
+ * @type {boolean}
1946
+ * @public
1947
+ */
1498
1948
  readonly?: boolean;
1949
+ /**
1950
+ * @description Whether the field is required.
1951
+ * @type {boolean}
1952
+ * @public
1953
+ */
1499
1954
  required?: boolean;
1955
+ /**
1956
+ * @description Step value for numeric inputs.
1957
+ * @type {number}
1958
+ * @public
1959
+ */
1500
1960
  step?: number;
1961
+ /**
1962
+ * @description Field name that this field's value must equal.
1963
+ * @type {string}
1964
+ * @public
1965
+ */
1501
1966
  equals?: string;
1967
+ /**
1968
+ * @description Field name that this field's value must differ from.
1969
+ * @type {string}
1970
+ * @public
1971
+ */
1502
1972
  different?: string;
1973
+ /**
1974
+ * @description Field name that this field's value must be less than.
1975
+ * @type {string}
1976
+ * @public
1977
+ */
1503
1978
  lessThan?: string;
1979
+ /**
1980
+ * @description Field name that this field's value must be less than or equal to.
1981
+ * @type {string}
1982
+ * @public
1983
+ */
1504
1984
  lessThanOrEqual?: string;
1985
+ /**
1986
+ * @description Field name that this field's value must be greater than.
1987
+ * @type {string}
1988
+ * @public
1989
+ */
1505
1990
  greaterThan?: string;
1991
+ /**
1992
+ * @description Field name that this field's value must be greater than or equal to.
1993
+ * @type {string}
1994
+ * @public
1995
+ */
1506
1996
  greaterThanOrEqual?: string;
1997
+ /**
1998
+ * @description Current value of the field.
1999
+ * @summary Can be a string, number, date, or array of strings for multi-select fields.
2000
+ * @type {string | number | Date | string[]}
2001
+ * @public
2002
+ */
1507
2003
  value: string | number | Date | string[];
2004
+ /**
2005
+ * @description Whether the field supports multiple values.
2006
+ * @summary When true, the field is rendered as part of a FormArray structure.
2007
+ * @type {boolean}
2008
+ * @public
2009
+ */
1508
2010
  multiple: boolean;
2011
+ /**
2012
+ * @description Flag tracking if validation error event has been dispatched.
2013
+ * @summary Prevents duplicate validation error events from being dispatched.
2014
+ * @type {boolean}
2015
+ * @private
2016
+ */
1509
2017
  private validationErrorEventDispatched;
1510
2018
  /**
1511
- * @summary Parent HTML element
1512
- * @description Reference to the parent HTML element of the field
2019
+ * @description Reference to the parent HTML element.
2020
+ * @summary Used for DOM manipulation and event handling.
2021
+ * @type {HTMLElement}
2022
+ * @protected
1513
2023
  */
1514
2024
  protected parent?: HTMLElement;
1515
- constructor();
2025
+ constructor(componentName?: string);
1516
2026
  /**
1517
2027
  * @description Gets the currently active form group based on context.
1518
2028
  * @summary Returns the appropriate FormGroup based on whether this field supports
1519
2029
  * multiple values. For single-value fields, returns the main form group.
1520
2030
  * For multi-value fields, returns the form group at the active index from the parent FormArray.
1521
- *
1522
- * @returns {FormGroup} The currently active FormGroup for this field
1523
- * @memberOf CrudFieldComponent
2031
+ * If no formGroup is set, returns the parent of the formControl.
2032
+ * @return {FormGroup} The currently active FormGroup for this field
2033
+ * @public
1524
2034
  */
1525
2035
  get activeFormGroup(): FormGroup;
1526
2036
  /**
1527
- * @summary String formatting function
1528
- * @description Provides access to the sf function for error message formatting
1529
- * @prop {function(string, ...string): string} sf - String formatting function
2037
+ * @description String formatting utility function.
2038
+ * @summary Provides access to the sf (string format) function for formatting error messages
2039
+ * and other string templates. Used primarily for localizing and parameterizing validation messages.
2040
+ * @type {function(string, ...string): string}
2041
+ * @public
1530
2042
  */
1531
2043
  sf: typeof _decaf_ts_decorator_validation.stringFormat;
1532
2044
  /**
1533
- * @summary Change callback function
1534
- * @description Function called when the field value changes
1535
- * @property {function(): unknown} onChange - onChange event handler
2045
+ * @description Callback function invoked when the field value changes.
2046
+ * @summary Function registered by Angular's forms system through registerOnChange.
2047
+ * Called automatically when the field's value is updated to notify the form of the change.
2048
+ * @type {function(): unknown}
2049
+ * @public
1536
2050
  */
1537
2051
  onChange: () => unknown;
1538
2052
  /**
1539
- * @summary Touch callback function
1540
- * @description Function called when the field is touched
1541
- * @property {function(): unknown} onTouch - onTouch event handler
2053
+ * @description Callback function invoked when the field is touched.
2054
+ * @summary Function registered by Angular's forms system through registerOnTouched.
2055
+ * Called when the field is blurred or otherwise marked as touched.
2056
+ * @type {function(): unknown}
2057
+ * @public
1542
2058
  */
1543
2059
  onTouch: () => unknown;
1544
2060
  /**
1545
- * @summary Write value to the field
1546
- * @description Sets the value of the field
2061
+ * @description Writes a value to the form field.
2062
+ * @summary Part of Angular's ControlValueAccessor interface. Sets the field's value
2063
+ * when the form programmatically updates it. This is called by Angular forms when
2064
+ * the model value changes.
1547
2065
  * @param {string} obj - The value to be set
2066
+ * @return {void}
2067
+ * @public
1548
2068
  */
1549
2069
  writeValue(obj: string): void;
1550
2070
  /**
1551
- * @summary Register change callback
1552
- * @description Registers a function to be called when the field value changes
2071
+ * @description Registers the onChange callback function.
2072
+ * @summary Part of Angular's ControlValueAccessor interface. Stores the function
2073
+ * that Angular forms provides to be called when the field value changes.
1553
2074
  * @param {function(): unknown} fn - The function to be called on change
2075
+ * @return {void}
2076
+ * @public
1554
2077
  */
1555
2078
  registerOnChange(fn: () => unknown): void;
1556
2079
  /**
1557
- * @summary Register touch callback
1558
- * @description Registers a function to be called when the field is touched
2080
+ * @description Registers the onTouched callback function.
2081
+ * @summary Part of Angular's ControlValueAccessor interface. Stores the function
2082
+ * that Angular forms provides to be called when the field is touched/blurred.
1559
2083
  * @param {function(): unknown} fn - The function to be called on touch
2084
+ * @return {void}
2085
+ * @public
1560
2086
  */
1561
2087
  registerOnTouched(fn: () => unknown): void;
1562
2088
  /**
1563
- * @summary Set disabled state
1564
- * @description Sets the disabled state of the field
2089
+ * @description Sets the disabled state of the field.
2090
+ * @summary Part of Angular's ControlValueAccessor interface. Called by Angular forms
2091
+ * when the disabled state of the control changes.
1565
2092
  * @param {boolean} isDisabled - Whether the field should be disabled
2093
+ * @return {void}
2094
+ * @public
1566
2095
  */
1567
2096
  setDisabledState?(isDisabled: boolean): void;
1568
2097
  /**
1569
- * @summary After view initialization logic
1570
- * @description Performs necessary setup after the view has been initialized
1571
- * @returns {HTMLElement} The parent element of the field
2098
+ * @description Performs setup after the view has been initialized.
2099
+ * @summary Retrieves and returns the parent HTML element based on the current CRUD operation.
2100
+ * For READ and DELETE operations, returns the immediate parent element. For CREATE and UPDATE
2101
+ * operations, finds the parent div element and registers it with the form service.
2102
+ * @return {HTMLElement} The parent element of the field
2103
+ * @throws {RenderingError} If unable to retrieve parent form element for CREATE/UPDATE operations
2104
+ * @throws {InternalError} If the operation is invalid
2105
+ * @public
1572
2106
  */
1573
2107
  afterViewInit(): HTMLElement;
2108
+ /**
2109
+ * @description Angular lifecycle hook for detecting input property changes.
2110
+ * @summary Overrides the parent ngOnChanges to handle changes to activeFormGroupIndex and value.
2111
+ * When activeFormGroupIndex changes in a multiple field scenario, updates the active form group
2112
+ * and form control. When value changes, updates the form control value. Delegates to parent
2113
+ * implementation for initial change detection.
2114
+ * @param {SimpleChanges} changes - Object containing the changed properties
2115
+ * @return {void}
2116
+ * @public
2117
+ */
1574
2118
  ngOnChanges(changes: SimpleChanges): void;
2119
+ /**
2120
+ * @description Cleanup logic when the component is destroyed.
2121
+ * @summary Unregisters the form group from the form service to prevent memory leaks
2122
+ * and clean up form references.
2123
+ * @return {void}
2124
+ * @public
2125
+ */
1575
2126
  onDestroy(): void;
2127
+ /**
2128
+ * @description Sets the value of the form control.
2129
+ * @summary Updates the form control's value and triggers validation. This is used
2130
+ * when the value needs to be programmatically updated from outside the form control.
2131
+ * @param {unknown} value - The value to set
2132
+ * @return {void}
2133
+ * @public
2134
+ */
1576
2135
  setValue(value: unknown): void;
2136
+ /**
2137
+ * @description Retrieves validation error messages for the field.
2138
+ * @summary Checks the form control for validation errors and returns formatted error messages.
2139
+ * If errors exist, dispatches a validation error event to parent accordion components.
2140
+ * Error messages are translated and formatted with relevant field properties.
2141
+ * @param {HTMLElement} parent - The parent HTML element used to find accordion components
2142
+ * @return {string | void} Formatted error message string, or void if no errors
2143
+ * @public
2144
+ */
1577
2145
  getErrors(parent: HTMLElement): string | void;
1578
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxDecafFormFieldDirective, never>;
1579
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDecafFormFieldDirective, never, never, { "activeFormGroupIndex": { "alias": "activeFormGroupIndex"; "required": false; }; "parentComponent": { "alias": "parentComponent"; "required": false; }; "optionsMapper": { "alias": "optionsMapper"; "required": false; }; }, {}, never, never, true, never>;
2146
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxFormFieldDirective, never>;
2147
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxFormFieldDirective, never, never, { "activeFormGroupIndex": { "alias": "activeFormGroupIndex"; "required": false; }; "operation": { "alias": "operation"; "required": true; }; "parentComponent": { "alias": "parentComponent"; "required": false; }; "optionsMapper": { "alias": "optionsMapper"; "required": false; }; }, {}, never, never, true, never>;
1580
2148
  }
1581
2149
 
1582
2150
  /**
1583
- * @module module:lib/engine/NgxDecafFormService
2151
+ * @module lib/engine/NgxFormService
1584
2152
  * @description Utilities to create and manage Angular forms in Decaf components.
1585
- * @summary The NgxDecafFormService exposes helpers to build FormGroup/FormArray instances
2153
+ * @summary The NgxFormService exposes helpers to build FormGroup/FormArray instances
1586
2154
  * from component metadata or UI model definitions, register forms in a registry,
1587
2155
  * validate and extract form data, and create controls with appropriate validators.
1588
- *
1589
- * @link {@link NgxDecafFormService}
1590
2156
  */
1591
2157
 
1592
2158
  /**
1593
2159
  * @description Service for managing Angular forms and form controls.
1594
- * @summary The NgxDecafFormService provides utility methods for creating, managing, and validating Angular forms and form controls. It includes functionality for registering forms, adding controls, validating fields, and handling form data.
2160
+ * @summary The NgxFormService provides utility methods for creating, managing, and validating Angular forms and form controls. It includes functionality for registering forms, adding controls, validating fields, and handling form data.
1595
2161
  *
1596
2162
  * @class
1597
2163
  * @param {WeakMap<AbstractControl, FieldProperties>} controls - A WeakMap to store control properties.
@@ -1603,18 +2169,17 @@ declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirec
1603
2169
  * { inputs: { name: 'username', type: 'text', required: true } },
1604
2170
  * { inputs: { name: 'password', type: 'password', minLength: 8 } }
1605
2171
  * ];
1606
- * const form = NgxDecafFormService.createFormFromComponents('loginForm', components, true);
2172
+ * const form = NgxFormService.createFormFromComponents('loginForm', components, true);
1607
2173
  *
1608
2174
  * // Validating fields
1609
- * NgxDecafFormService.validateFields(form);
2175
+ * NgxFormService.validateFields(form);
1610
2176
  *
1611
2177
  * // Getting form data
1612
- * const formData = NgxDecafFormService.getFormData(form);
1613
- *
2178
+ * const formData = NgxFormService.getFormData(form);
1614
2179
  * @mermaid
1615
2180
  * sequenceDiagram
1616
2181
  * participant C as Component
1617
- * participant NFS as NgxDecafFormService
2182
+ * participant NFS as NgxFormService
1618
2183
  * participant AF as Angular Forms
1619
2184
  * C->>NFS: createFormFromComponents()
1620
2185
  * NFS->>AF: new FormGroup()
@@ -1627,51 +2192,47 @@ declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirec
1627
2192
  * NFS->>AF: Get control values
1628
2193
  * NFS-->>C: Return form data
1629
2194
  */
1630
- declare class NgxDecafFormService {
2195
+ declare class NgxFormService {
1631
2196
  /**
1632
2197
  * @description WeakMap that stores control properties for form controls.
1633
2198
  * @summary A WeakMap that associates AbstractControl instances with their corresponding FieldProperties.
1634
2199
  * This allows the service to track metadata for form controls without creating memory leaks.
1635
- *
1636
2200
  * @type {WeakMap<AbstractControl, FieldProperties>}
1637
2201
  * @private
1638
2202
  * @static
1639
- * @memberOf NgxDecafFormService
1640
2203
  */
1641
2204
  private static controls;
1642
2205
  /**
1643
2206
  * @description Registry of form groups indexed by their unique identifiers.
1644
2207
  * @summary A Map that stores FormGroup instances with their unique string identifiers.
1645
2208
  * This allows global access to registered forms throughout the application.
1646
- *
1647
2209
  * @type {Map<string, FormGroup>}
1648
2210
  * @private
1649
2211
  * @static
1650
- * @memberOf NgxDecafFormService
1651
2212
  */
1652
2213
  private static formRegistry;
1653
2214
  /**
1654
2215
  * @description Creates a new form group or form array with the specified identifier.
1655
- * @summary Generates a FormGroup or FormArray based on the provided properties. If pages are specified
1656
- * and greater than 1, creates a FormArray; otherwise creates a FormGroup. The form can optionally
1657
- * be registered in the global form registry for later access throughout the application.
1658
- *
2216
+ * @summary Generates a FormGroup or FormArray based on the provided parameters. If formArray is true,
2217
+ * creates a FormArray; otherwise creates a FormGroup. The form can optionally be registered in the
2218
+ * global form registry for later access throughout the application. If a form with the given id
2219
+ * already exists in the registry, it returns the existing form.
1659
2220
  * @param {string} id - Unique identifier for the form
1660
- * @param {Partial<IComponentInput>} [props={}] - Configuration properties for the form
2221
+ * @param {boolean} [formArray=false] - Whether to create a FormArray instead of a FormGroup
1661
2222
  * @param {boolean} [registry=true] - Whether to register the form in the global registry
1662
- * @return {FormGroup | FormArray} The created form instance
1663
- *
2223
+ * @return {FormGroup | FormArray} The created or existing form instance
1664
2224
  * @mermaid
1665
2225
  * sequenceDiagram
1666
2226
  * participant C as Component
1667
- * participant NFS as NgxDecafFormService
2227
+ * participant NFS as NgxFormService
1668
2228
  * participant FR as Form Registry
1669
2229
  * participant AF as Angular Forms
1670
- *
1671
- * C->>NFS: createForm(id, props, registry)
2230
+ * C->>NFS: createForm(id, formArray, registry)
1672
2231
  * NFS->>FR: Check if form exists
1673
- * alt Form doesn't exist
1674
- * alt props.pages > 1
2232
+ * alt Form exists
2233
+ * FR-->>NFS: Return existing form
2234
+ * else Form doesn't exist
2235
+ * alt formArray is true
1675
2236
  * NFS->>AF: new FormArray([])
1676
2237
  * else
1677
2238
  * NFS->>AF: new FormGroup({})
@@ -1681,9 +2242,7 @@ declare class NgxDecafFormService {
1681
2242
  * end
1682
2243
  * end
1683
2244
  * NFS-->>C: Return FormGroup | FormArray
1684
- *
1685
2245
  * @static
1686
- * @memberOf NgxDecafFormService
1687
2246
  */
1688
2247
  static createForm(id: string, formArray?: boolean, registry?: boolean): FormGroup | FormArray;
1689
2248
  /**
@@ -1691,28 +2250,31 @@ declare class NgxDecafFormService {
1691
2250
  * @summary Registers a FormGroup or FormArray with a unique identifier for global access throughout
1692
2251
  * the application. This allows forms to be retrieved and managed centrally. Throws an error if
1693
2252
  * the identifier is already in use to prevent conflicts.
1694
- *
1695
2253
  * @param {string} formId - The unique identifier for the form
1696
2254
  * @param {FormParent} formGroup - The FormGroup or FormArray to be registered
1697
2255
  * @return {void}
1698
2256
  * @throws {Error} If a FormGroup with the given id is already registered
1699
- *
1700
2257
  * @static
1701
- * @memberOf NgxDecafFormService
1702
2258
  */
1703
2259
  static addRegistry(formId: string, formGroup: FormParent): void;
2260
+ /**
2261
+ * @description Retrieves a form from the registry by its identifier.
2262
+ * @summary Gets a FormGroup or FormArray from the registry using its unique identifier.
2263
+ * Returns undefined if the form is not found in the registry. This method provides
2264
+ * safe access to registered forms without throwing errors.
2265
+ * @param {string} [id] - The unique identifier of the form to retrieve
2266
+ * @return {FormParent | undefined} The FormGroup or FormArray if found, undefined otherwise
2267
+ * @static
2268
+ */
1704
2269
  static getOnRegistry(id?: string): FormParent | undefined;
1705
2270
  /**
1706
2271
  * @description Removes a form from the registry.
1707
2272
  * @summary Deletes a FormGroup or FormArray from the registry using its unique identifier.
1708
2273
  * This cleans up the registry and allows the identifier to be reused. The form itself
1709
2274
  * is not destroyed, only removed from the central registry.
1710
- *
1711
2275
  * @param {string} formId - The unique identifier of the form to be removed
1712
2276
  * @return {void}
1713
- *
1714
2277
  * @static
1715
- * @memberOf NgxDecafFormService
1716
2278
  */
1717
2279
  static removeRegistry(formId: string): void;
1718
2280
  /**
@@ -1720,20 +2282,17 @@ declare class NgxDecafFormService {
1720
2282
  * @summary Traverses the form group structure to find the parent group and control name for a given path.
1721
2283
  * Handles complex nested structures including arrays and sub-groups. Creates missing intermediate
1722
2284
  * groups as needed and properly configures FormArray controls for multiple value scenarios.
1723
- *
1724
2285
  * @param {FormGroup} formGroup - The root FormGroup to traverse
1725
2286
  * @param {string} path - The dot-separated path to the control (e.g., 'user.address.street')
1726
2287
  * @param {IComponentInput} componentProps - Properties defining the component configuration
1727
2288
  * @param {KeyValue} parentProps - Properties from the parent component for context
1728
2289
  * @return {FormParentGroup} A tuple containing the parent FormGroup and the control name
1729
- *
1730
2290
  * @private
1731
2291
  * @mermaid
1732
2292
  * sequenceDiagram
1733
- * participant NFS as NgxDecafFormService
2293
+ * participant NFS as NgxFormService
1734
2294
  * participant FG as FormGroup
1735
2295
  * participant FA as FormArray
1736
- *
1737
2296
  * NFS->>NFS: Split path into parts
1738
2297
  * loop For each path part
1739
2298
  * alt Control doesn't exist
@@ -1747,95 +2306,90 @@ declare class NgxDecafFormService {
1747
2306
  * NFS->>NFS: Navigate to next level
1748
2307
  * end
1749
2308
  * NFS-->>NFS: Return [parentGroup, controlName]
1750
- *
1751
2309
  * @static
1752
- * @memberOf NgxDecafFormService
1753
2310
  */
1754
2311
  private static resolveParentGroup;
1755
2312
  /**
1756
2313
  * @description Retrieves component properties from a FormGroup or FormArray.
1757
2314
  * @summary Extracts component properties stored in the form group metadata. If a FormGroup is provided
1758
2315
  * and groupArrayName is specified, it will look for the FormArray within the form structure.
1759
- *
1760
2316
  * @param {FormGroup | FormArray} formGroup - The form group or form array to extract properties from
1761
2317
  * @param {string} [key] - Optional key to retrieve a specific property
1762
2318
  * @param {string} [groupArrayName] - Optional name of the group array if formGroup is not a FormArray
1763
2319
  * @return {Partial<FieldProperties>} The component properties or a specific property if key is provided
1764
- *
1765
2320
  * @static
1766
- * @memberOf NgxDecafFormService
1767
2321
  */
1768
2322
  static getComponentPropsFromGroupArray(formGroup: FormGroup | FormArray, key?: string, groupArrayName?: string | undefined): Partial<FieldProperties>;
1769
2323
  /**
1770
2324
  * @description Adds a new group to a parent FormArray.
1771
2325
  * @summary Creates and adds a new FormGroup to the specified parent FormArray based on the
1772
2326
  * component properties stored in the parent's metadata. This is used for dynamic form arrays
1773
- * where new groups need to be added at runtime.
1774
- *
1775
- * @param {FormParent} parentForm - The root form group containing the parent FormArray
1776
- * @param {number} index - The index position where the new group should be added
1777
- * @return {FormGroup} The newly created and added FormGroup
1778
- *
2327
+ * where new groups need to be added at runtime. Clones the control at the specified index
2328
+ * to maintain the same structure and validators.
2329
+ * @param {FormParent} parentForm - The FormArray or FormGroup containing the parent FormArray
2330
+ * @param {number} [index] - The index position to clone from; defaults to last index if length > 0, otherwise 0
2331
+ * @return {FormArray} The parent FormArray after adding the new group
1779
2332
  * @static
1780
- * @memberOf NgxDecafFormService
1781
2333
  */
1782
2334
  static addGroupToParent(parentForm: FormParent, index?: number): FormArray;
1783
2335
  /**
1784
2336
  * @description Retrieves a FormGroup from a parent FormArray at the specified index.
1785
2337
  * @summary Gets a FormGroup from the specified parent FormArray. If the group doesn't exist
1786
2338
  * at the given index, it will create a new one using addGroupToParent.
1787
- *
1788
- * @param {FormGroup} formGroup - The root form group containing the parent FormArray
2339
+ * @param {FormParent} formGroup - The root form group containing the parent FormArray
1789
2340
  * @param {string} parentName - The name of the parent FormArray to retrieve the group from
1790
2341
  * @param {number} [index=1] - The index of the group to retrieve
1791
2342
  * @return {FormGroup} The FormGroup at the specified index
1792
- *
1793
2343
  * @static
1794
- * @memberOf NgxDecafFormService
1795
2344
  */
1796
2345
  static getGroupFromParent(formGroup: FormParent, parentName: string, index?: number): FormGroup;
2346
+ /**
2347
+ * @description Clones a form control with its validators.
2348
+ * @summary Creates a deep copy of a FormControl, FormGroup, or FormArray, preserving
2349
+ * validators but resetting values and state. This is useful for creating new instances
2350
+ * of form controls with the same validation rules, particularly in dynamic FormArrays
2351
+ * where new groups need to be added with identical structure.
2352
+ * @param {AbstractControl} control - The control to clone (FormControl, FormGroup, or FormArray)
2353
+ * @return {AbstractControl} A new instance of the control with the same validators
2354
+ * @throws {Error} If the control type is not supported
2355
+ * @static
2356
+ */
1797
2357
  static cloneFormControl(control: AbstractControl): AbstractControl;
1798
2358
  /**
1799
2359
  * @description Checks if a value is unique within a FormArray group.
1800
2360
  * @summary Validates that the primary key value in a FormGroup is unique among all groups
1801
2361
  * in the parent FormArray. The uniqueness check behavior differs based on the operation type.
1802
- *
2362
+ * For both CREATE and UPDATE operations, it checks that no other group in the array has the same
2363
+ * primary key value.
1803
2364
  * @param {FormGroup} formGroup - The FormGroup to check for uniqueness
1804
- * @param {number} index - The index of the current group within the FormArray
1805
2365
  * @param {OperationKeys} [operation=OperationKeys.CREATE] - The type of operation being performed
2366
+ * @param {number} [index] - The index of the current group within the FormArray
1806
2367
  * @return {boolean} True if the value is unique, false otherwise
1807
- *
1808
2368
  * @static
1809
- * @memberOf NgxDecafFormService
1810
2369
  */
1811
2370
  static isUniqueOnGroup(formGroup: FormGroup, operation?: OperationKeys, index?: number): boolean;
1812
2371
  /**
1813
2372
  * @description Enables all controls within a FormGroup or FormArray.
1814
2373
  * @summary Recursively enables all form controls within the provided FormGroup or FormArray.
1815
2374
  * This is useful for making all controls interactive after they have been disabled.
1816
- *
1817
2375
  * @param {FormArray | FormGroup} formGroup - The FormGroup or FormArray to enable all controls for
1818
2376
  * @return {void}
1819
- *
1820
2377
  * @static
1821
- * @memberOf NgxDecafFormService
1822
2378
  */
1823
2379
  static enableAllGroupControls(formGroup: FormArray | FormGroup): void;
1824
2380
  /**
1825
2381
  * @description Adds a form control to a form group based on component properties.
1826
2382
  * @summary Creates and configures a FormControl within the specified FormGroup using the provided
1827
2383
  * component properties. Handles nested paths, multiple controls (FormArrays), and control registration.
1828
- * This method supports complex form structures with nested groups and arrays.
1829
- *
1830
- * @param {FormGroup} formGroup - The form group to add the control to
2384
+ * This method supports complex form structures with nested groups and arrays. It also manages
2385
+ * page-based forms and FormArray indexing.
2386
+ * @param {FormParent} formGroup - The form group or form array to add the control to
1831
2387
  * @param {IComponentInput} componentProps - The component properties defining the control configuration
1832
- * @param {KeyValue} [parentProps={}] - Properties from the parent component for context
2388
+ * @param {Partial<IComponentInput>} [parentProps={}] - Properties from the parent component for context
1833
2389
  * @param {number} [index=0] - The index for multiple controls in FormArrays
1834
- * @return {void}
1835
- *
2390
+ * @return {FormParent} The updated form parent (FormGroup or FormArray)
1836
2391
  * @private
1837
2392
  * @static
1838
- * @memberOf NgxDecafFormService
1839
2393
  */
1840
2394
  private static addFormControl;
1841
2395
  /**
@@ -1843,18 +2397,15 @@ declare class NgxDecafFormService {
1843
2397
  * @summary Finds and returns an AbstractControl from a registered form using the form id and optional path.
1844
2398
  * This method provides centralized access to form controls across the application by leveraging
1845
2399
  * the form registry system.
1846
- *
1847
2400
  * @param {string} formId - The unique identifier of the form in the registry
1848
2401
  * @param {string} [path] - The optional dot-separated path to a specific control within the form
1849
2402
  * @return {AbstractControl} The requested AbstractControl (FormGroup, FormArray, or FormControl)
1850
2403
  * @throws {Error} If the form is not found in the registry or the control is not found in the form
1851
- *
1852
2404
  * @mermaid
1853
2405
  * sequenceDiagram
1854
2406
  * participant C as Component
1855
- * participant NFS as NgxDecafFormService
2407
+ * participant NFS as NgxFormService
1856
2408
  * participant FR as Form Registry
1857
- *
1858
2409
  * C->>NFS: getControlFromForm(formId, path?)
1859
2410
  * NFS->>FR: Get form by formId
1860
2411
  * alt Form not found
@@ -1873,9 +2424,7 @@ declare class NgxDecafFormService {
1873
2424
  * NFS-->>C: Return form
1874
2425
  * end
1875
2426
  * end
1876
- *
1877
2427
  * @static
1878
- * @memberOf NgxDecafFormService
1879
2428
  */
1880
2429
  static getControlFromForm(formId: string, path?: string): AbstractControl;
1881
2430
  /**
@@ -1883,18 +2432,15 @@ declare class NgxDecafFormService {
1883
2432
  * @summary Generates a FormGroup from an array of UIModelMetadata objects, extracting component
1884
2433
  * properties and creating appropriate form controls. This method is specifically designed to work
1885
2434
  * with the UI decorator system and provides automatic form generation from metadata.
1886
- *
1887
2435
  * @param {string} id - Unique identifier for the form
1888
2436
  * @param {boolean} [registry=false] - Whether to register the created form in the global registry
1889
2437
  * @param {UIModelMetadata[]} [children] - Array of UI model metadata objects to create controls from
1890
2438
  * @return {FormGroup} The created FormGroup with controls for each child metadata
1891
- *
1892
2439
  * @mermaid
1893
2440
  * sequenceDiagram
1894
2441
  * participant C as Component
1895
- * participant NFS as NgxDecafFormService
2442
+ * participant NFS as NgxFormService
1896
2443
  * participant AF as Angular Forms
1897
- *
1898
2444
  * C->>NFS: createFormFromChildren(id, registry, children)
1899
2445
  * NFS->>AF: new FormGroup({})
1900
2446
  * loop For each child metadata
@@ -1905,9 +2451,7 @@ declare class NgxDecafFormService {
1905
2451
  * NFS->>NFS: addRegistry(id, form)
1906
2452
  * end
1907
2453
  * NFS-->>C: Return FormGroup
1908
- *
1909
2454
  * @static
1910
- * @memberOf NgxDecafFormService
1911
2455
  */
1912
2456
  static createFormFromChildren(id: string, registry?: boolean, children?: UIModelMetadata[]): FormGroup;
1913
2457
  /**
@@ -1915,18 +2459,15 @@ declare class NgxDecafFormService {
1915
2459
  * @summary Generates a FormGroup based on an array of component configurations and optionally registers it.
1916
2460
  * This method processes component input configurations to create appropriate form controls with
1917
2461
  * validation and initial values.
1918
- *
1919
2462
  * @param {string} id - The unique identifier for the form
1920
2463
  * @param {IComponentConfig[]} components - An array of component configurations defining the form structure
1921
2464
  * @param {boolean} [registry=false] - Whether to register the created form in the global registry
1922
2465
  * @return {FormGroup} The created FormGroup with controls for each component configuration
1923
- *
1924
2466
  * @mermaid
1925
2467
  * sequenceDiagram
1926
2468
  * participant C as Component
1927
- * participant NFS as NgxDecafFormService
2469
+ * participant NFS as NgxFormService
1928
2470
  * participant AF as Angular Forms
1929
- *
1930
2471
  * C->>NFS: createFormFromComponents(id, components, registry)
1931
2472
  * NFS->>AF: new FormGroup({})
1932
2473
  * loop For each component config
@@ -1937,42 +2478,39 @@ declare class NgxDecafFormService {
1937
2478
  * NFS->>NFS: addRegistry(id, form)
1938
2479
  * end
1939
2480
  * NFS-->>C: Return FormGroup
1940
- *
1941
2481
  * @static
1942
- * @memberOf NgxDecafFormService
1943
2482
  */
1944
2483
  static createFormFromComponents(id: string, components: IComponentConfig[], registry?: boolean): FormGroup;
1945
2484
  /**
1946
2485
  * @description Adds a control to a form based on component properties.
1947
2486
  * @summary Creates and adds a form control to a form (existing or new) based on the provided component properties.
1948
2487
  * Handles multi-page forms by managing FormArray structures and proper indexing. This method supports
1949
- * complex form scenarios including nested controls and page-based form organization.
1950
- *
2488
+ * complex form scenarios including nested controls and page-based form organization. It automatically
2489
+ * creates FormArrays for forms with multiple pages and manages page indexing.
1951
2490
  * @param {string} id - The unique identifier of the form
1952
2491
  * @param {FieldProperties} componentProperties - The properties of the component to create the control from
1953
2492
  * @param {FieldProperties} [parentProps] - Optional parent properties for context and configuration
1954
- * @return {AbstractControl} The form or created control
1955
- *
2493
+ * @return {FormParent} The form or created control (FormGroup or FormArray)
2494
+ * @throws {Error} If page property is required but not provided or is invalid
1956
2495
  * @mermaid
1957
2496
  * sequenceDiagram
1958
2497
  * participant C as Component
1959
- * participant NFS as NgxDecafFormService
2498
+ * participant NFS as NgxFormService
1960
2499
  * participant F as Form
1961
- *
1962
2500
  * C->>NFS: addControlFromProps(id, componentProps, parentProps?)
1963
- * NFS->>NFS: createForm(id, parentProps, true)
1964
- * alt Multi-page form (parentProps.pages > 1)
2501
+ * NFS->>NFS: createForm(id, formArray, true)
2502
+ * alt Multi-page form (parentProps.pages > 0)
1965
2503
  * NFS->>NFS: Calculate page index
1966
- * NFS->>F: Get or create FormGroup at index
2504
+ * alt Group doesn't exist at index
2505
+ * NFS->>F: Create new FormGroup at index
2506
+ * end
1967
2507
  * NFS->>NFS: Set form to page FormGroup
1968
2508
  * end
1969
2509
  * alt componentProperties has path
1970
2510
  * NFS->>NFS: addFormControl(form, componentProperties, parentProps)
1971
2511
  * end
1972
2512
  * NFS-->>C: Return form/control
1973
- *
1974
2513
  * @static
1975
- * @memberOf NgxDecafFormService
1976
2514
  */
1977
2515
  static addControlFromProps(id: string, componentProperties: FieldProperties, parentProps?: FieldProperties): FormParent;
1978
2516
  /**
@@ -1980,17 +2518,14 @@ declare class NgxDecafFormService {
1980
2518
  * @summary Extracts and processes the data from a FormGroup, handling different input types and nested form groups.
1981
2519
  * Performs type conversion for various HTML5 input types, validates nested controls, and manages
1982
2520
  * multiple control scenarios. Automatically enables all group controls after data extraction.
1983
- *
1984
2521
  * @param {FormGroup} formGroup - The FormGroup to extract data from
1985
2522
  * @return {Record<string, unknown>} An object containing the processed form data with proper type conversions
1986
- *
1987
2523
  * @mermaid
1988
2524
  * sequenceDiagram
1989
2525
  * participant C as Component
1990
- * participant NFS as NgxDecafFormService
2526
+ * participant NFS as NgxFormService
1991
2527
  * participant FG as FormGroup
1992
2528
  * participant FC as FormControl
1993
- *
1994
2529
  * C->>NFS: getFormData(formGroup)
1995
2530
  * loop For each control in formGroup
1996
2531
  * alt Control is not FormControl
@@ -2014,9 +2549,7 @@ declare class NgxDecafFormService {
2014
2549
  * end
2015
2550
  * NFS->>NFS: enableAllGroupControls(formGroup)
2016
2551
  * NFS-->>C: Return processed data object
2017
- *
2018
2552
  * @static
2019
- * @memberOf NgxDecafFormService
2020
2553
  */
2021
2554
  static getFormData(formGroup: FormGroup): Record<string, unknown>;
2022
2555
  /**
@@ -2024,21 +2557,18 @@ declare class NgxDecafFormService {
2024
2557
  * @summary Recursively validates all fields in a form control or form group, marking them as touched and dirty.
2025
2558
  * Performs comprehensive validation including uniqueness checks for primary keys in FormArray scenarios.
2026
2559
  * This method ensures all validation rules are applied and form state is properly updated.
2027
- *
2028
2560
  * @param {AbstractControl} control - The control or form group to validate
2029
2561
  * @param {string} [pk] - Optional primary key field name for uniqueness validation
2030
2562
  * @param {string} [path] - The path to the control within the form for error reporting
2031
2563
  * @return {boolean} True if all fields are valid, false otherwise
2032
2564
  * @throws {Error} If no control is found at the specified path or if the control type is unknown
2033
- *
2034
2565
  * @mermaid
2035
2566
  * sequenceDiagram
2036
2567
  * participant C as Component
2037
- * participant NFS as NgxDecafFormService
2568
+ * participant NFS as NgxFormService
2038
2569
  * participant FC as FormControl
2039
2570
  * participant FG as FormGroup
2040
2571
  * participant FA as FormArray
2041
- *
2042
2572
  * C->>NFS: validateFields(control, pk?, path?)
2043
2573
  * alt Control is FormControl
2044
2574
  * NFS->>FC: markAsTouched()
@@ -2064,16 +2594,18 @@ declare class NgxDecafFormService {
2064
2594
  * else Unknown control type
2065
2595
  * NFS-->>C: Throw Error
2066
2596
  * end
2067
- *
2068
2597
  * @static
2069
- * @memberOf NgxDecafFormService
2070
2598
  */
2071
2599
  static validateFields(control: AbstractControl, pk?: string, path?: string): boolean;
2072
2600
  /**
2073
2601
  * @description Generates validators from component properties.
2074
2602
  * @summary Creates an array of ValidatorFn based on the supported validation keys in the component properties.
2075
- * @param {KeyValue} props - The component properties.
2076
- * @return {ValidatorFn[]} An array of validator functions.
2603
+ * Maps each validation property to its corresponding Angular validator function using the ValidatorFactory.
2604
+ * Only processes properties that are recognized as validation keys by the Validation utility.
2605
+ * @param {KeyValue} props - The component properties containing validation rules
2606
+ * @return {ValidatorFn[]} An array of validator functions
2607
+ * @private
2608
+ * @static
2077
2609
  */
2078
2610
  private static validatorsFromProps;
2079
2611
  /**
@@ -2081,18 +2613,15 @@ declare class NgxDecafFormService {
2081
2613
  * @summary Generates a FormControl with validators and initial configuration based on the provided
2082
2614
  * component properties. Handles different input types, sets initial values, and configures
2083
2615
  * validation rules and update modes.
2084
- *
2085
2616
  * @param {FieldProperties} props - The component properties defining the control configuration
2086
2617
  * @param {FieldUpdateMode} [updateMode='change'] - The update mode for the control ('change', 'blur', 'submit')
2087
2618
  * @return {FormControl} The created FormControl with proper configuration and validators
2088
- *
2089
2619
  * @mermaid
2090
2620
  * sequenceDiagram
2091
2621
  * participant C as Component
2092
- * participant NFS as NgxDecafFormService
2622
+ * participant NFS as NgxFormService
2093
2623
  * participant VF as ValidatorFactory
2094
2624
  * participant AF as Angular Forms
2095
- *
2096
2625
  * C->>NFS: fromProps(props, updateMode?)
2097
2626
  * NFS->>NFS: validatorsFromProps(props)
2098
2627
  * NFS->>VF: Create validators from props
@@ -2107,9 +2636,7 @@ declare class NgxDecafFormService {
2107
2636
  * NFS->>AF: new FormControl(config)
2108
2637
  * AF-->>NFS: Return FormControl
2109
2638
  * NFS-->>C: Return configured FormControl
2110
- *
2111
2639
  * @static
2112
- * @memberOf NgxDecafFormService
2113
2640
  */
2114
2641
  static fromProps(props: FieldProperties, updateMode?: FieldUpdateMode): FormControl;
2115
2642
  /**
@@ -2117,12 +2644,9 @@ declare class NgxDecafFormService {
2117
2644
  * @summary Gets the FieldProperties associated with a form control from the internal WeakMap.
2118
2645
  * This method provides access to the original component properties that were used to create
2119
2646
  * the control, enabling validation, rendering, and behavior configuration.
2120
- *
2121
2647
  * @param {FormControl | FormArray | FormGroup} control - The form control to get properties for
2122
2648
  * @return {FieldProperties} The properties associated with the control, or empty object if not found
2123
- *
2124
2649
  * @static
2125
- * @memberOf NgxDecafFormService
2126
2650
  */
2127
2651
  static getPropsFromControl(control: FormControl | FormArray | FormGroup): FieldProperties;
2128
2652
  /**
@@ -2130,18 +2654,15 @@ declare class NgxDecafFormService {
2130
2654
  * @summary Traverses up the DOM tree to find the nearest parent element with the specified tag name.
2131
2655
  * This is useful for finding container elements or specific parent components in the DOM hierarchy.
2132
2656
  * The search is case-insensitive for tag name matching.
2133
- *
2134
2657
  * @param {HTMLElement} el - The starting element to traverse from
2135
2658
  * @param {string} tag - The tag name to search for (case-insensitive)
2136
2659
  * @return {HTMLElement} The found parent element with the specified tag
2137
2660
  * @throws {Error} If no parent with the specified tag is found in the DOM tree
2138
- *
2139
2661
  * @mermaid
2140
2662
  * sequenceDiagram
2141
2663
  * participant C as Component
2142
- * participant NFS as NgxDecafFormService
2664
+ * participant NFS as NgxFormService
2143
2665
  * participant DOM as DOM Tree
2144
- *
2145
2666
  * C->>NFS: getParentEl(element, tagName)
2146
2667
  * loop Traverse up DOM tree
2147
2668
  * NFS->>DOM: Get parentElement
@@ -2152,9 +2673,7 @@ declare class NgxDecafFormService {
2152
2673
  * NFS-->>C: Throw Error
2153
2674
  * end
2154
2675
  * end
2155
- *
2156
2676
  * @static
2157
- * @memberOf NgxDecafFormService
2158
2677
  */
2159
2678
  static getParentEl(el: HTMLElement, tag: string): HTMLElement;
2160
2679
  /**
@@ -2162,26 +2681,31 @@ declare class NgxDecafFormService {
2162
2681
  * @summary Associates a form control with its component properties for later retrieval.
2163
2682
  * This enables the service to maintain metadata about controls without creating memory leaks,
2164
2683
  * as WeakMap automatically cleans up references when controls are garbage collected.
2165
- *
2166
2684
  * @param {AbstractControl} control - The control to register (FormControl, FormGroup, or FormArray)
2167
2685
  * @param {FieldProperties} props - The properties to associate with the control
2168
2686
  * @return {void}
2169
- *
2170
2687
  * @static
2171
- * @memberOf NgxDecafFormService
2172
2688
  */
2173
2689
  static register(control: AbstractControl, props: FieldProperties): void;
2174
2690
  /**
2175
- * @description Unregisters a control.
2691
+ * @description Unregisters a control from the internal WeakMap.
2176
2692
  * @summary Removes a control and its associated properties from the internal WeakMap.
2177
- * @param {AbstractControl} control - The control to unregister.
2178
- * @return {boolean} True if the control was successfully unregistered, false otherwise.
2693
+ * This cleans up the metadata tracking for the control and frees up memory. Returns
2694
+ * true if the control was found and removed, false if it was not in the registry.
2695
+ * @param {AbstractControl} control - The control to unregister (FormControl, FormGroup, or FormArray)
2696
+ * @return {boolean} True if the control was successfully unregistered, false otherwise
2697
+ * @static
2179
2698
  */
2180
2699
  static unregister(control: AbstractControl): boolean;
2181
2700
  /**
2182
- * @description Resets a form group.
2183
- * @summary Recursively resets all controls in a form group, clearing values, errors, and marking them as pristine and untouched.
2184
- * @param {FormGroup} formGroup - The form group to reset.
2701
+ * @description Resets a form group or form control.
2702
+ * @summary Recursively resets all controls in a form group or a single form control, clearing values,
2703
+ * errors, and marking them as pristine and untouched. For FormControls, it sets the value to empty
2704
+ * string (except for checkbox types) and clears validation errors. For FormGroups, it recursively
2705
+ * resets all child controls.
2706
+ * @param {FormGroup | FormControl} formGroup - The form group or form control to reset
2707
+ * @return {void}
2708
+ * @static
2185
2709
  */
2186
2710
  static reset(formGroup: FormGroup | FormControl): void;
2187
2711
  }
@@ -2199,114 +2723,589 @@ declare abstract class NgxEventHandler<PAYLOAD> extends LoggedClass {
2199
2723
  abstract handle(evt: IBaseCustomEvent | CustomEvent<PAYLOAD>): Promise<unknown>;
2200
2724
  }
2201
2725
 
2202
- declare abstract class NgxPageDirective extends NgxDecafComponentDirective {
2203
- protected localeRoot?: string | undefined;
2204
- protected hasMenu: boolean;
2726
+ /**
2727
+ * @module lib/engine/NgxPageDirective
2728
+ * @description Base page component for Decaf Angular applications.
2729
+ * @summary Provides a page-level base class (NgxPageDirective) that extends NgxComponentDirective and
2730
+ * offers page-focused utilities such as menu management, title handling and router event hooks.
2731
+ * @link {@link NgxPageDirective}
2732
+ */
2733
+
2734
+ /**
2735
+ * @description Base directive for page-level components in Decaf Angular applications.
2736
+ * @summary Abstract directive that provides foundational functionality for page components.
2737
+ * Extends NgxComponentDirective to add page-specific features including menu management,
2738
+ * page title handling, and Ionic lifecycle hooks. This directive serves as the base class for
2739
+ * all page-level components, providing consistent behavior for navigation, routing, and UI state.
2740
+ * @class NgxPageDirective
2741
+ * @extends {NgxComponentDirective}
2742
+ * @memberOf module:lib/engine/NgxPageDirective
2743
+ */
2744
+ declare abstract class NgxPageDirective extends NgxComponentDirective implements AfterViewInit {
2745
+ /**
2746
+ * @description Page title text for the current view.
2747
+ * @summary Stores the title text to be displayed for this page. This can be set dynamically
2748
+ * based on the current route or menu configuration and is used to update the browser's
2749
+ * title bar or page header.
2750
+ * @type {string}
2751
+ * @default ''
2752
+ * @memberOf module:lib/engine/NgxPageDirective
2753
+ */
2205
2754
  title: string;
2755
+ /**
2756
+ * @description Menu items array for page navigation.
2757
+ * @summary Contains the collection of menu items available for this page. Each menu item
2758
+ * defines a navigation option with properties like label, URL, icon, and visibility settings.
2759
+ * This array is used to construct the application's navigation menu and can be filtered or
2760
+ * customized per page.
2761
+ * @protected
2762
+ * @type {IMenuItem[]}
2763
+ * @default []
2764
+ * @memberOf module:lib/engine/NgxPageDirective
2765
+ */
2206
2766
  protected menu: IMenuItem[];
2767
+ /**
2768
+ * @description Angular Title service for browser title management.
2769
+ * @summary Injected service that provides control over the browser's document title.
2770
+ * Used to dynamically set the page title based on the current route or active menu item,
2771
+ * improving SEO and user experience.
2772
+ * @protected
2773
+ * @type {Title}
2774
+ * @memberOf module:lib/engine/NgxPageDirective
2775
+ */
2207
2776
  protected titleService: Title;
2208
- constructor(localeRoot?: string | undefined, hasMenu?: boolean);
2209
- ionViewWillEnter(): Promise<void>;
2210
- protected setPageTitle(route: string, menu?: IMenuItem[]): void;
2777
+ /**
2778
+ * @description Flag indicating whether the page should display the navigation menu.
2779
+ * @summary Controls the visibility and availability of the application menu for this page.
2780
+ * When set to true, the menu is enabled and accessible to users. When false, the menu
2781
+ * is disabled, which is useful for pages like login screens or standalone views that
2782
+ * should not show navigation options.
2783
+ * @protected
2784
+ * @type {boolean}
2785
+ * @default true
2786
+ * @memberOf module:lib/engine/NgxPageDirective
2787
+ */
2788
+ protected hasMenu: boolean;
2789
+ /**
2790
+ * @description Constructor for NgxPageDirective.
2791
+ * @summary Initializes the page directive with optional locale root and menu visibility settings.
2792
+ * Calls the parent NgxComponentDirective constructor to set up base functionality including
2793
+ * logging, localization, and component identification.
2794
+ * @param {string} [localeRoot] - Optional locale root key for internationalization
2795
+ * @param {boolean} [hasMenu=true] - Whether this page should display the menu
2796
+ * @memberOf module:lib/engine/NgxPageDirective
2797
+ */
2798
+ constructor(localeRoot?: string, hasMenu?: boolean);
2799
+ /**
2800
+ * @description Ionic lifecycle hook called when the page is about to enter view.
2801
+ * @summary This lifecycle hook is triggered just before the page becomes visible to the user.
2802
+ * It enables or disables the application menu based on the hasMenu property, allowing pages
2803
+ * to control whether the menu should be accessible. This is useful for pages like login screens
2804
+ * where the menu should be hidden.
2805
+ * @return {Promise<void>} A promise that resolves when menu state is updated
2806
+ * @memberOf module:lib/engine/NgxPageDirective
2807
+ */
2808
+ ngAfterViewInit(): Promise<void>;
2809
+ /**
2810
+ * @description Sets the browser page title based on the current route.
2811
+ * @summary Updates the browser's document title by finding the active menu item that matches
2812
+ * the provided route. If a matching menu item is found, it sets the title using the format
2813
+ * "Decaf For Angular - {menu title or label}". This improves SEO and provides clear context
2814
+ * to users about the current page. If a custom menu array is provided, it uses that instead
2815
+ * of the component's default menu.
2816
+ * @protected
2817
+ * @param {string} route - The current route path to match against menu items
2818
+ * @param {IMenuItem[]} [menu] - Optional custom menu array to search (uses this.menu if not provided)
2819
+ * @return {void}
2820
+ * @memberOf module:lib/engine/NgxPageDirective
2821
+ */
2822
+ protected setPageTitle(route?: string, menu?: IMenuItem[]): void;
2211
2823
  static ɵfac: i0.ɵɵFactoryDeclaration<NgxPageDirective, never>;
2212
2824
  static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPageDirective, never, never, {}, {}, never, never, true, never>;
2213
2825
  }
2214
2826
 
2215
- /**
2216
- * @description Dynamic component renderer for Decaf Angular applications.
2217
- * @summary This component provides a flexible way to dynamically render Angular components
2218
- * at runtime based on a tag name. It handles the creation, property binding, and event
2219
- * subscription for dynamically loaded components. This is particularly useful for
2220
- * building configurable UIs where components need to be determined at runtime.
2221
- *
2222
- * @component {ComponentRendererComponent}
2223
- * @example
2224
- * <ngx-decaf-component-renderer
2225
- * [tag]="tag"
2226
- * [globals]="globals"
2227
- * (listenEvent)="listenEvent($event)">
2228
- * </ngx-decaf-component-renderer>
2229
- *
2230
- * @mermaid
2231
- * classDiagram
2232
- * class ComponentRendererComponent {
2233
- * +ViewContainerRef vcr
2234
- * +string tag
2235
- * +Record~string, unknown~ globals
2236
- * +EnvironmentInjector injector
2237
- * +ComponentRef~unknown~ component
2238
- * +EventEmitter~IBaseCustomEvent~ listenEvent
2239
- * +ngOnInit()
2240
- * +ngOnDestroy()
2241
- * +ngOnChanges(changes)
2242
- * -createComponent(tag, globals)
2243
- * -subscribeEvents()
2244
- * -unsubscribeEvents()
2245
- * }
2246
- * ComponentRendererComponent --|> OnInit
2247
- * ComponentRendererComponent --|> OnChanges
2248
- * ComponentRendererComponent --|> OnDestroy
2249
- *
2250
- * @implements {OnInit}
2251
- * @implements {OnChanges}
2252
- * @implements {OnDestroy}
2253
- */
2254
- declare class ComponentRendererComponent implements OnInit, OnDestroy {
2827
+ declare abstract class NgxModelPageDirective extends NgxPageDirective {
2255
2828
  /**
2256
- * @description Reference to the container where the dynamic component will be rendered.
2257
- * @summary This ViewContainerRef provides the container where the dynamically created
2258
- * component will be inserted into the DOM. It's marked as static to ensure it's available
2259
- * during the ngOnInit lifecycle hook when the component is created.
2829
+ * @description Primary key value of the current model instance.
2830
+ * @summary Specifies the primary key value for the current model record being displayed or
2831
+ * manipulated by the component. This identifier is used for CRUD operations that target
2832
+ * specific records, such as read, update, and delete operations. The value corresponds to
2833
+ * the field designated as the primary key in the model definition.
2834
+ * @type {EventIds}
2835
+ * @memberOf module:lib/engine/NgxComponentDirective
2836
+ */
2837
+ modelId: EventIds;
2838
+ /**
2839
+ * @description The CRUD operation type to be performed on the model.
2840
+ * @summary Specifies which operation (Create, Read, Update, Delete) this component instance
2841
+ * should perform. This determines the UI behavior, form configuration, and available actions.
2842
+ * The operation affects form validation, field availability, and the specific repository
2843
+ * method called during data submission.
2260
2844
  *
2261
- * @type {ViewContainerRef}
2262
- * @memberOf ComponentRendererComponent
2845
+ * @type {OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE}
2846
+ * @default OperationKeys.READ
2847
+ * @memberOf ModelPage
2263
2848
  */
2264
- vcr: ViewContainerRef;
2849
+ operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE;
2265
2850
  /**
2266
- * @description The tag name of the component to be dynamically rendered.
2267
- * @summary This input property specifies which component should be rendered by providing
2268
- * its registered tag name. The tag must correspond to a component that has been registered
2269
- * with the NgxRenderingEngine. This is a required input as it determines which component
2270
- * to create.
2851
+ * @description The name of the model class to operate on.
2852
+ * @summary Identifies which registered model class this component should work with.
2853
+ * This name is used to resolve the model constructor from the global model registry
2854
+ * and instantiate the appropriate repository for data operations. The model must
2855
+ * be properly registered using the @Model decorator for resolution to work.
2271
2856
  *
2272
2857
  * @type {string}
2273
- * @required
2274
- * @memberOf ComponentRendererComponent
2858
+ * @memberOf ModelPage
2859
+ */
2860
+ modelName: string;
2861
+ /**
2862
+ * @description Array of operations allowed for the current model instance.
2863
+ * @summary Dynamically determined list of operations that are permitted based on
2864
+ * the current context and model state. Initially contains CREATE and READ operations,
2865
+ * with UPDATE and DELETE added when a modelId is present. This controls which
2866
+ * action buttons are displayed and which operations are accessible to the user.
2867
+ *
2868
+ * @type {OperationKeys[]}
2869
+ * @default [OperationKeys.CREATE, OperationKeys.READ]
2870
+ * @memberOf ModelPage
2871
+ */
2872
+ allowedOperations: OperationKeys[];
2873
+ /**
2874
+ * @description Current model data loaded from the repository.
2875
+ * @summary Stores the raw data object representing the current model instance retrieved
2876
+ * from the repository. This property holds the actual data values for the model being
2877
+ * displayed or edited, and is set to undefined when no data is available or when an
2878
+ * error occurs during data loading.
2879
+ * @type {KeyValue | undefined}
2880
+ * @default undefined
2881
+ * @memberOf NgxModelPageDirective
2882
+ */
2883
+ modelData: KeyValue | undefined;
2884
+ /**
2885
+ * @description Error message from failed operations.
2886
+ * @summary Stores error messages that occur during repository operations such as
2887
+ * data loading, creation, update, or deletion. When set, this indicates an error
2888
+ * state that should be displayed to the user. Cleared on successful operations.
2889
+ * @type {string | undefined}
2890
+ * @default undefined
2891
+ * @memberOf NgxModelPageDirective
2275
2892
  */
2276
- tag: string;
2893
+ errorMessage: string | undefined;
2277
2894
  /**
2278
- * @description Global properties to pass to the rendered component.
2279
- * @summary This input property allows passing a set of properties to the dynamically
2280
- * rendered component. These properties will be mapped to the component's inputs if they
2281
- * match. Properties that don't match any input on the target component will be filtered out
2282
- * with a warning.
2895
+ * @description Lazy-initialized repository getter with model resolution.
2896
+ * @summary Creates and returns a repository instance for the specified model name.
2897
+ * Resolves the model constructor from the global registry, instantiates the repository,
2898
+ * and creates a new model instance. Throws an InternalError if the model is not
2899
+ * properly registered with the @Model decorator.
2283
2900
  *
2284
- * @type {Record<string, unknown>}
2285
- * @default {}
2286
- * @memberOf ComponentRendererComponent
2901
+ * @return {DecafRepository<Model>} The repository instance for the current model
2902
+ *
2903
+ * @throws {InternalError} When the model is not found in the registry
2287
2904
  */
2288
- globals: Record<string, unknown>;
2905
+ protected get repository(): DecafRepository<Model>;
2289
2906
  /**
2290
- * @description Injector used for dependency injection in the dynamic component.
2291
- * @summary This injector is used when creating the dynamic component to provide it with
2292
- * access to the application's dependency injection system. It ensures that the dynamically
2293
- * created component can access the same services and dependencies as statically created
2294
- * components.
2907
+ * @description Angular lifecycle hook for component initialization.
2908
+ * @summary Initializes the component by setting up the logger instance using the getLogger
2909
+ * utility. This ensures that logging is available throughout the component's lifecycle
2910
+ * for error tracking and debugging purposes.
2911
+ */
2912
+ ionViewWillEnter(): Promise<void>;
2913
+ /**
2914
+ * @description Refreshes the component data by loading the specified model instance.
2915
+ * @summary Loads model data from the repository based on the current operation type.
2916
+ * For READ, UPDATE, and DELETE operations, fetches the existing model data using
2917
+ * the provided unique identifier. Handles errors gracefully by logging them through
2918
+ * the logger instance.
2295
2919
  *
2296
- * @type {EnvironmentInjector}
2297
- * @memberOf ComponentRendererComponent
2920
+ * @param {string} [uid] - The unique identifier of the model to load; defaults to modelId
2298
2921
  */
2299
- injector: EnvironmentInjector;
2922
+ refresh(uid?: EventIds): Promise<void>;
2300
2923
  /**
2301
- * @description Reference to the dynamically created component.
2302
- * @summary This property holds a reference to the ComponentRef of the dynamically created
2303
- * component. It's used to interact with the component instance, subscribe to its events,
2304
- * and properly destroy it when the renderer is destroyed.
2924
+ * @description Generic event handler for component events.
2925
+ * @summary Processes incoming events from child components and routes them to appropriate
2926
+ * handlers based on the event name. Currently handles SUBMIT events by delegating to
2927
+ * the handleSubmit method. This centralized event handling approach allows for easy
2928
+ * extension and consistent event processing.
2305
2929
  *
2306
- * @type {ComponentRef<unknown>}
2307
- * @memberOf ComponentRendererComponent
2930
+ * @param {IBaseCustomEvent} event - The event object containing event data and metadata
2308
2931
  */
2309
- component: ComponentRef<unknown>;
2932
+ handleEvent(event: IBaseCustomEvent): Promise<void>;
2933
+ /**
2934
+ * @description Handles form submission events for CRUD operations.
2935
+ * @summary Processes form submission by executing the appropriate repository operation
2936
+ * based on the current operation type. Handles CREATE, UPDATE, and DELETE operations,
2937
+ * processes the form data, refreshes the repository cache, navigates back to the previous
2938
+ * page, and displays success notifications. Comprehensive error handling ensures robust
2939
+ * operation with detailed logging.
2940
+ *
2941
+ * @param {IBaseCustomEvent} event - The submit event containing form data
2942
+ * @return {Promise<IModelPageCustomEvent|void>} Promise that resolves on success or throws on error
2943
+ */
2944
+ handleSubmit(event: IBaseCustomEvent): Promise<IModelPageCustomEvent | void>;
2945
+ /**
2946
+ * @description Retrieves a model instance from the repository by unique identifier.
2947
+ * @summary Fetches a specific model instance using the repository's read method.
2948
+ * Handles both string and numeric identifiers by automatically converting numeric
2949
+ * strings to numbers. If no identifier is provided, logs an informational message
2950
+ * and navigates back to the previous page. Returns undefined for missing instances.
2951
+ *
2952
+ * @param {string} uid - The unique identifier of the model instance to retrieve
2953
+ * @return {Promise<Model | undefined>} Promise resolving to the model instance or undefined
2954
+ */
2955
+ handleGet(uid?: EventIds): Promise<Model | undefined>;
2956
+ /**
2957
+ * @description Parses and transforms form data for repository operations.
2958
+ * @summary Converts raw form data into the appropriate format for repository operations.
2959
+ * For DELETE operations, returns the primary key value (string or number). For CREATE
2960
+ * and UPDATE operations, builds a complete model instance using the Model.build method
2961
+ * with proper primary key assignment for updates.
2962
+ *
2963
+ * @param {Partial<Model>} data - The raw form data to be processed
2964
+ * @return {Model | string | number} Processed data ready for repository operations
2965
+ * @private
2966
+ */
2967
+ private parseData;
2968
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxModelPageDirective, never>;
2969
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxModelPageDirective, never, never, { "modelId": { "alias": "modelId"; "required": false; }; "operation": { "alias": "operation"; "required": false; }; "modelName": { "alias": "modelName"; "required": false; }; }, {}, never, never, true, never>;
2970
+ }
2971
+
2972
+ /**
2973
+ * @module module:lib/engine/NgxParentComponentDirective
2974
+ * @description Directive base for parent container components used by the rendering system.
2975
+ * @summary Provides NgxParentComponentDirective which offers inputs for children metadata,
2976
+ * column/row configuration and parent component wiring used by layout and container components.
2977
+ *
2978
+ * @link {@link NgxParentComponentDirective}
2979
+ */
2980
+
2981
+ /**
2982
+ * @description Layout component for creating responsive grid layouts in Angular applications.
2983
+ * @summary This component provides a flexible grid system that can be configured with dynamic
2984
+ * rows and columns. It supports responsive breakpoints and can render child components within
2985
+ * the grid structure. The component extends NgxComponentDirective to inherit common functionality
2986
+ * and integrates with the model and component renderer systems.
2987
+ *
2988
+ * @class NgxParentComponentDirective
2989
+ * @extends {NgxParentComponentDirective}
2990
+ * @implements {OnInit}
2991
+ */
2992
+ declare class NgxParentComponentDirective extends NgxComponentDirective implements OnInit {
2993
+ /**
2994
+ * @description The display name or title of the fieldset section.
2995
+ * @summary Sets the legend or header text that appears in the accordion header. This text
2996
+ * provides a clear label for the collapsible section, helping users understand what content
2997
+ * is contained within. The name is displayed prominently and serves as the clickable area
2998
+ * for expanding/collapsing the fieldset.
2999
+ *
3000
+ * @type {string}
3001
+ * @default 'Child'
3002
+ */
3003
+ parentComponent: FormParent;
3004
+ /**
3005
+ * @description Array of UI model metadata for all form fields.
3006
+ * @summary Contains the complete collection of UI model metadata that defines
3007
+ * the structure, validation, and presentation of form fields across all pages.
3008
+ * Each metadata object contains information about field type, validation rules,
3009
+ * page assignment, and display properties.
3010
+ *
3011
+ * @type {UIModelMetadata[]}
3012
+ */
3013
+ children: UIModelMetadata[] | KeyValue[];
3014
+ /**
3015
+ * @description Number of columns or array of column definitions for the grid layout.
3016
+ * @summary Defines the column structure of the grid. When a number is provided, it creates
3017
+ * that many equal-width columns. When an array is provided, each element can define specific
3018
+ * column properties or sizing. This allows for flexible grid layouts that can adapt to
3019
+ * different content requirements.
3020
+ *
3021
+ * @type {(number | string[])}
3022
+ * @default 1
3023
+ */
3024
+ cols: number | string[];
3025
+ /**
3026
+ * @description Number of rows or array of row definitions for the grid layout.
3027
+ * @summary Defines the row structure of the grid. When a number is provided, it creates
3028
+ * that many equal-height rows. When an array is provided, each element can define specific
3029
+ * row properties or sizing. This provides control over vertical spacing and content organization.
3030
+ *
3031
+ * @type {(number | string[])}
3032
+ * @default 1
3033
+ */
3034
+ rows: number | KeyValue[] | string[];
3035
+ ngOnInit(model?: Model | string): Promise<void>;
3036
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxParentComponentDirective, never>;
3037
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxParentComponentDirective, never, never, { "parentComponent": { "alias": "parentComponent"; "required": false; }; "children": { "alias": "children"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; }, {}, never, never, true, never>;
3038
+ }
3039
+
3040
+ declare abstract class NgxFormDirective extends NgxParentComponentDirective implements OnInit, IFormElement, OnDestroy, IRenderedModel {
3041
+ crudFieldComponent: string;
3042
+ /**
3043
+ * @description Reactive form group associated with this fieldset.
3044
+ * @summary The FormGroup instance that contains all form controls within this fieldset.
3045
+ * Used for form validation, value management, and integration with Angular's reactive forms.
3046
+ *
3047
+ * @type {FormGroup}
3048
+ */
3049
+ parentFormId: string;
3050
+ /**
3051
+ * @description Reference to the reactive form DOM element.
3052
+ * @summary ViewChild reference that provides direct access to the form's DOM element.
3053
+ * This enables programmatic manipulation of the form element and access to native
3054
+ * HTML form properties and methods when needed.
3055
+ *
3056
+ * @type {ElementRef}
3057
+ */
3058
+ component: ElementRef;
3059
+ /**
3060
+ * @description Field update trigger mode for form validation.
3061
+ * @summary Determines when form field validation should be triggered. Options include
3062
+ * 'change', 'blur', or 'submit'. This affects the user experience by controlling
3063
+ * when validation feedback is shown to the user during form interaction.
3064
+ *
3065
+ * @type {FieldUpdateMode}
3066
+ * @default 'change'
3067
+ */
3068
+ updateOn: FieldUpdateMode;
3069
+ /**
3070
+ * @description Form submission target specification.
3071
+ * @summary Specifies where to display the response after form submission, similar
3072
+ * to the HTML form target attribute. Options include '_self', '_blank', '_parent',
3073
+ * '_top', or a named frame. Controls the browser behavior for form responses.
3074
+ *
3075
+ * @type {HTMLFormTarget}
3076
+ * @default '_self'
3077
+ */
3078
+ target: HTMLFormTarget;
3079
+ /**
3080
+ * @description HTTP method or submission strategy for the form.
3081
+ * @summary Defines how the form should be submitted. 'get' and 'post' correspond
3082
+ * to standard HTTP methods for traditional form submission, while 'event' uses
3083
+ * Angular event-driven submission for single-page application workflows.
3084
+ *
3085
+ * @type {'get' | 'post' | 'event'}
3086
+ * @default 'event'
3087
+ */
3088
+ method: 'get' | 'post' | 'event';
3089
+ /**
3090
+ * @description Configuration options for the CRUD form behavior.
3091
+ * @summary Contains various configuration settings that control form rendering,
3092
+ * validation, and behavior. These options are merged with default settings
3093
+ * during component initialization to customize the form's functionality.
3094
+ *
3095
+ * @type {ICrudFormOptions}
3096
+ */
3097
+ options: ICrudFormOptions;
3098
+ /**
3099
+ * @description Optional action identifier for form submission context.
3100
+ * @summary Specifies a custom action name that will be included in the submit event.
3101
+ * If not provided, defaults to the standard submit event constant. Used to
3102
+ * distinguish between different types of form submissions within the same component.
3103
+ *
3104
+ * @type {string | undefined}
3105
+ */
3106
+ action?: string;
3107
+ /**
3108
+ * @description The current CRUD operation being performed.
3109
+ * @summary Specifies the type of operation this form is handling (CREATE, READ, UPDATE, DELETE).
3110
+ * This is a required input that determines form behavior, validation rules, and available actions.
3111
+ * The operation affects form state, button visibility, and submission logic.
3112
+ *
3113
+ * @type {CrudOperations}
3114
+ * @required
3115
+ */
3116
+ operation: CrudOperations;
3117
+ /**
3118
+ * @description Custom event handlers for form actions.
3119
+ * @summary A record of event handler functions keyed by event names that can be
3120
+ * triggered during form operations. These handlers provide extensibility for
3121
+ * custom business logic and can be invoked for various form events and actions.
3122
+ *
3123
+ * @type {HandlerLike}
3124
+ */
3125
+ handlers: HandlerLike;
3126
+ /**
3127
+ * @description Angular reactive FormGroup for form state management.
3128
+ * @summary The FormGroup instance that manages all form controls, validation,
3129
+ * and form state. This is the main interface for accessing form values and
3130
+ * controlling form behavior. May be undefined for read-only operations.
3131
+ *
3132
+ * @type {FormGroup | undefined}
3133
+ */
3134
+ formGroup: FormParent | undefined;
3135
+ /**
3136
+ * @description Unique identifier for the form renderer.
3137
+ * @summary A unique string identifier used to register and manage this form
3138
+ * instance within the NgxFormService. This ID is also used as the HTML id
3139
+ * attribute for the form element, enabling DOM queries and form management.
3140
+ *
3141
+ * @type {string}
3142
+ */
3143
+ rendererId: string;
3144
+ /**
3145
+ * @description Event emitter for form submission events.
3146
+ * @summary Emits ICrudFormEvent objects when the form is submitted, providing
3147
+ * form data, component information, and any associated handlers to parent
3148
+ * components. This enables decoupled handling of form submission logic.
3149
+ *
3150
+ * @type {EventEmitter<ICrudFormEvent>}
3151
+ */
3152
+ submitEvent: EventEmitter<ICrudFormEvent>;
3153
+ /**
3154
+ * @description Unique identifier for the current record instance.
3155
+ * @summary This property holds a unique string value that identifies the specific record being managed by the form.
3156
+ * It is automatically generated if not provided, ensuring each form instance has a distinct identifier.
3157
+ * The uid is used for tracking, referencing, and emitting events related to the current record, and may be used
3158
+ * in conjunction with the primary key for CRUD operations.
3159
+ *
3160
+ * @type {string}
3161
+ * @default Randomly generated 12-character string
3162
+ */
3163
+ allowClear: boolean;
3164
+ protected activeFormGroupIndex: number;
3165
+ get activeFormGroup(): FormParent;
3166
+ /**
3167
+ * @description Component initialization lifecycle method.
3168
+ * @summary Initializes the component by setting up the logger, configuring form state
3169
+ * based on the operation type, and merging configuration options. For READ and DELETE
3170
+ * operations, the formGroup is set to undefined since these operations don't require
3171
+ * form input. Configuration options are merged with default settings.
3172
+ *
3173
+ * @returns {Promise<void>}
3174
+ */
3175
+ ngOnInit(model?: Model | string): Promise<void>;
3176
+ /**
3177
+ * @description Component cleanup lifecycle method.
3178
+ * @summary Performs cleanup operations when the component is destroyed.
3179
+ * Unregisters the FormGroup from the NgxFormService to prevent memory leaks
3180
+ * and ensure proper resource cleanup.
3181
+ *
3182
+ * @returns {void}
3183
+ */
3184
+ ngOnDestroy(): void;
3185
+ getFormArrayIndex(index: number): FormParent | undefined;
3186
+ /**
3187
+ * @description Handles form reset or navigation back functionality.
3188
+ * @summary Provides different reset behavior based on the current operation.
3189
+ * For CREATE and UPDATE operations, resets the form to its initial state.
3190
+ * For READ and DELETE operations, navigates back in the browser history
3191
+ * since these operations don't have modifiable form data to reset.
3192
+ *
3193
+ * @returns {void}
3194
+ */
3195
+ handleReset(): void;
3196
+ handleSubmit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void>;
3197
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxFormDirective, never>;
3198
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxFormDirective, never, never, { "parentFormId": { "alias": "parentFormId"; "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; }; "rendererId": { "alias": "rendererId"; "required": false; }; "allowClear": { "alias": "allowClear"; "required": false; }; }, { "submitEvent": "submitEvent"; }, never, never, true, never>;
3199
+ }
3200
+
3201
+ declare abstract class NgxMediaDirective extends NgxComponentDirective implements OnDestroy {
3202
+ private destroy$;
3203
+ private resizeSubject;
3204
+ resize$: Observable<IWindowResizeEvent>;
3205
+ colorScheme$: Observable<WindowColorScheme>;
3206
+ protected zone: NgZone;
3207
+ constructor(localeRoot?: string);
3208
+ isDarkMode(): Promise<boolean>;
3209
+ ngOnDestroy(): void;
3210
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxMediaDirective, never>;
3211
+ static ɵdir: i0.ɵɵDirectiveDeclaration<NgxMediaDirective, never, never, {}, {}, never, never, true, never>;
3212
+ }
3213
+
3214
+ /**
3215
+ * @description Dynamic component renderer for Decaf Angular applications.
3216
+ * @summary This component provides a flexible way to dynamically render Angular components
3217
+ * at runtime based on a tag name. It handles the creation, property binding, and event
3218
+ * subscription for dynamically loaded components. This is particularly useful for
3219
+ * building configurable UIs where components need to be determined at runtime.
3220
+ *
3221
+ * @component {ComponentRendererComponent}
3222
+ * @example
3223
+ * <ngx-decaf-component-renderer
3224
+ * [tag]="tag"
3225
+ * [globals]="globals"
3226
+ * (listenEvent)="listenEvent($event)">
3227
+ * </ngx-decaf-component-renderer>
3228
+ *
3229
+ * @mermaid
3230
+ * classDiagram
3231
+ * class ComponentRendererComponent {
3232
+ * +ViewContainerRef vcr
3233
+ * +string tag
3234
+ * +Record~string, unknown~ globals
3235
+ * +EnvironmentInjector injector
3236
+ * +ComponentRef~unknown~ component
3237
+ * +EventEmitter~IBaseCustomEvent~ listenEvent
3238
+ * +ngOnInit()
3239
+ * +ngOnDestroy()
3240
+ * +ngOnChanges(changes)
3241
+ * -createComponent(tag, globals)
3242
+ * -subscribeEvents()
3243
+ * -unsubscribeEvents()
3244
+ * }
3245
+ * ComponentRendererComponent --|> OnInit
3246
+ * ComponentRendererComponent --|> OnChanges
3247
+ * ComponentRendererComponent --|> OnDestroy
3248
+ *
3249
+ * @implements {OnInit}
3250
+ * @implements {OnChanges}
3251
+ * @implements {OnDestroy}
3252
+ */
3253
+ declare class ComponentRendererComponent implements OnInit, OnDestroy {
3254
+ /**
3255
+ * @description Reference to the container where the dynamic component will be rendered.
3256
+ * @summary This ViewContainerRef provides the container where the dynamically created
3257
+ * component will be inserted into the DOM. It's marked as static to ensure it's available
3258
+ * during the ngOnInit lifecycle hook when the component is created.
3259
+ *
3260
+ * @type {ViewContainerRef}
3261
+ * @memberOf ComponentRendererComponent
3262
+ */
3263
+ vcr: ViewContainerRef;
3264
+ /**
3265
+ * @description The tag name of the component to be dynamically rendered.
3266
+ * @summary This input property specifies which component should be rendered by providing
3267
+ * its registered tag name. The tag must correspond to a component that has been registered
3268
+ * with the NgxRenderingEngine. This is a required input as it determines which component
3269
+ * to create.
3270
+ *
3271
+ * @type {string}
3272
+ * @required
3273
+ * @memberOf ComponentRendererComponent
3274
+ */
3275
+ tag: string;
3276
+ /**
3277
+ * @description Global properties to pass to the rendered component.
3278
+ * @summary This input property allows passing a set of properties to the dynamically
3279
+ * rendered component. These properties will be mapped to the component's inputs if they
3280
+ * match. Properties that don't match any input on the target component will be filtered out
3281
+ * with a warning.
3282
+ *
3283
+ * @type {Record<string, unknown>}
3284
+ * @default {}
3285
+ * @memberOf ComponentRendererComponent
3286
+ */
3287
+ globals: Record<string, unknown>;
3288
+ /**
3289
+ * @description Injector used for dependency injection in the dynamic component.
3290
+ * @summary This injector is used when creating the dynamic component to provide it with
3291
+ * access to the application's dependency injection system. It ensures that the dynamically
3292
+ * created component can access the same services and dependencies as statically created
3293
+ * components.
3294
+ *
3295
+ * @type {EnvironmentInjector}
3296
+ * @memberOf ComponentRendererComponent
3297
+ */
3298
+ injector: EnvironmentInjector;
3299
+ /**
3300
+ * @description Reference to the dynamically created component.
3301
+ * @summary This property holds a reference to the ComponentRef of the dynamically created
3302
+ * component. It's used to interact with the component instance, subscribe to its events,
3303
+ * and properly destroy it when the renderer is destroyed.
3304
+ *
3305
+ * @type {ComponentRef<unknown>}
3306
+ * @memberOf ComponentRendererComponent
3307
+ */
3308
+ component: ComponentRef<unknown>;
2310
3309
  children: KeyValue[];
2311
3310
  projectable: boolean;
2312
3311
  /**
@@ -2499,7 +3498,7 @@ declare class ComponentRendererComponent implements OnInit, OnDestroy {
2499
3498
  * @module module:lib/components/crud-field/crud-field.component
2500
3499
  * @description CRUD field component module.
2501
3500
  * @summary Exposes `CrudFieldComponent`, a dynamic form field used in CRUD forms supporting
2502
- * many input types, validation and integration with `NgxDecafFormFieldDirective` utilities.
3501
+ * many input types, validation and integration with `NgxFormFieldDirective` utilities.
2503
3502
  *
2504
3503
  * @link {@link CrudFieldComponent}
2505
3504
  */
@@ -2507,7 +3506,7 @@ declare class ComponentRendererComponent implements OnInit, OnDestroy {
2507
3506
  /**
2508
3507
  * @description A dynamic form field component for CRUD operations.
2509
3508
  * @summary The CrudFieldComponent is a versatile form field component that adapts to different
2510
- * input types and CRUD operations. It extends NgxDecafFormFieldDirective to inherit form handling capabilities
3509
+ * input types and CRUD operations. It extends NgxFormFieldDirective to inherit form handling capabilities
2511
3510
  * and implements lifecycle hooks to properly initialize, render, and clean up. This component
2512
3511
  * supports various input types (text, number, date, select, etc.), validation rules, and styling
2513
3512
  * options, making it suitable for building dynamic forms for create, read, update, and delete
@@ -2547,7 +3546,7 @@ declare class ComponentRendererComponent implements OnInit, OnDestroy {
2547
3546
  *
2548
3547
  * @memberOf module:for-angular
2549
3548
  */
2550
- declare class CrudFieldComponent extends NgxDecafFormFieldDirective implements OnInit, OnDestroy, AfterViewInit {
3549
+ declare class CrudFieldComponent extends NgxFormFieldDirective implements OnInit, OnDestroy, AfterViewInit {
2551
3550
  /**
2552
3551
  * @description The CRUD operation being performed.
2553
3552
  * @summary Specifies which CRUD operation (Create, Read, Update, Delete) the field is being used for.
@@ -2748,581 +3747,285 @@ declare class CrudFieldComponent extends NgxDecafFormFieldDirective implements O
2748
3747
  * @description Field name for inequality validation comparison.
2749
3748
  * @summary Specifies another field name that this field's value must be different from for validation.
2750
3749
  * This is used to ensure that two fields do not contain the same value, which might be
2751
- * required for certain business rules or security constraints.
2752
- *
2753
- * @type {string | undefined}
2754
- * @memberOf CrudFieldComponent
2755
- */
2756
- different?: string;
2757
- /**
2758
- * @description Field name for less-than validation comparison.
2759
- * @summary Specifies another field name that this field's value must be less than for validation.
2760
- * This is commonly used for date ranges, numeric ranges, or other scenarios where
2761
- * one field must have a smaller value than another.
2762
- *
2763
- * @type {string | undefined}
2764
- * @memberOf CrudFieldComponent
2765
- */
2766
- lessThan?: string;
2767
- /**
2768
- * @description Field name for less-than-or-equal validation comparison.
2769
- * @summary Specifies another field name that this field's value must be less than or equal to
2770
- * for validation. This provides inclusive upper bound validation for numeric or date comparisons.
2771
- *
2772
- * @type {string | undefined}
2773
- * @memberOf CrudFieldComponent
2774
- */
2775
- lessThanOrEqual?: string;
2776
- /**
2777
- * @description Field name for greater-than validation comparison.
2778
- * @summary Specifies another field name that this field's value must be greater than for validation.
2779
- * This is commonly used for date ranges, numeric ranges, or other scenarios where
2780
- * one field must have a larger value than another.
2781
- *
2782
- * @type {string | undefined}
2783
- * @memberOf CrudFieldComponent
2784
- */
2785
- greaterThan?: string;
2786
- /**
2787
- * @description Field name for greater-than-or-equal validation comparison.
2788
- * @summary Specifies another field name that this field's value must be greater than or equal to
2789
- * for validation. This provides inclusive lower bound validation for numeric or date comparisons.
2790
- *
2791
- * @type {string | undefined}
2792
- * @memberOf CrudFieldComponent
2793
- */
2794
- greaterThanOrEqual?: string;
2795
- /**
2796
- * @description Alignment of the field content.
2797
- * @summary Controls the horizontal alignment of the field content.
2798
- * This affects how the content is positioned within the field container.
2799
- *
2800
- * @type {'start' | 'center'}
2801
- * @memberOf CrudFieldComponent
2802
- */
2803
- alignment?: 'start' | 'center';
2804
- /**
2805
- * @description Initial checked state for checkbox or toggle inputs.
2806
- * @summary For checkbox or toggle inputs, this sets the initial checked state.
2807
- * When true, the checkbox or toggle will be initially checked.
2808
- *
2809
- * @type {boolean}
2810
- * @memberOf CrudFieldComponent
2811
- */
2812
- checked?: boolean;
2813
- /**
2814
- * @description Justification of items within the field.
2815
- * @summary Controls how items are justified within the field container.
2816
- * This is particularly useful for fields with multiple elements, such as radio groups.
2817
- *
2818
- * @type {'start' | 'end' | 'space-between'}
2819
- * @memberOf CrudFieldComponent
2820
- */
2821
- justify?: 'start' | 'end' | 'space-between';
2822
- /**
2823
- * @description Text for the cancel button in select inputs.
2824
- * @summary For select inputs with a cancel button, this sets the text displayed on the cancel button.
2825
- * This is typically used in select dialogs to provide a way for users to dismiss the selection without making a change.
2826
- *
2827
- * @type {string}
2828
- * @memberOf CrudFieldComponent
2829
- */
2830
- cancelText?: string;
2831
- /**
2832
- * @description Interface style for select inputs.
2833
- * @summary Specifies the interface style for select inputs, such as 'alert', 'action-sheet', or 'popover'.
2834
- * This determines how the select options are presented to the user.
2835
- *
2836
- * @type {SelectInterface}
2837
- * @memberOf CrudFieldComponent
2838
- */
2839
- interface: SelectInterface;
2840
- /**
2841
- * @description Options for select or radio inputs.
2842
- * @summary Provides the list of options for select or radio inputs. Each option can have a value and a label.
2843
- * This is used to populate the dropdown or radio group with choices.
2844
- *
2845
- * @type {CrudFieldOption[]}
2846
- * @memberOf CrudFieldComponent
2847
- */
2848
- options: FunctionLike | CrudFieldOption[] | KeyValue[];
2849
- /**
2850
- * @description Mode of the field.
2851
- * @summary Specifies the visual mode of the field, such as 'ios' or 'md'.
2852
- * This affects the styling and appearance of the field to match the platform style.
2853
- *
2854
- * @type {'ios' | 'md'}
2855
- * @memberOf CrudFieldComponent
2856
- */
2857
- mode?: 'ios' | 'md';
2858
- /**
2859
- * @description Spellcheck attribute for text inputs.
2860
- * @summary Enables or disables spellchecking for text inputs.
2861
- * When true, the browser will check the spelling of the input text.
2862
- *
2863
- * @type {boolean}
2864
- * @default false
2865
- * @memberOf CrudFieldComponent
2866
- */
2867
- spellcheck: boolean;
2868
- /**
2869
- * @description Input mode for text inputs.
2870
- * @summary Hints at the type of data that might be entered by the user while editing the element.
2871
- * This can affect the virtual keyboard layout on mobile devices.
2872
- *
2873
- * @type {'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'}
2874
- * @default 'none'
2875
- * @memberOf CrudFieldComponent
2876
- */
2877
- inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
2878
- /**
2879
- * @description Autocomplete behavior for the field.
2880
- * @summary Specifies whether and how the browser should automatically complete the input.
2881
- * This can improve user experience by suggesting previously entered values.
2882
- *
2883
- * @type {AutocompleteTypes}
2884
- * @default 'off'
2885
- * @memberOf CrudFieldComponent
2886
- */
2887
- autocomplete: AutocompleteTypes;
2888
- /**
2889
- * @description Fill style for the field.
2890
- * @summary Determines the fill style of the field, such as 'outline' or 'solid'.
2891
- * This affects the border and background of the field.
2892
- *
2893
- * @type {'outline' | 'solid'}
2894
- * @default 'outline'
2895
- * @memberOf CrudFieldComponent
2896
- */
2897
- fill: 'outline' | 'solid';
2898
- /**
2899
- * @description Placement of the label relative to the field.
2900
- * @summary Specifies where the label should be placed relative to the field.
2901
- * Options include 'start', 'end', 'floating', 'stacked', and 'fixed'.
2902
- *
2903
- * @type {'start' | 'end' | 'floating' | 'stacked' | 'fixed'}
2904
- * @default 'floating'
2905
- * @memberOf CrudFieldComponent
2906
- */
2907
- labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
2908
- /**
2909
- * @description Update mode for the field.
2910
- * @summary Determines when the field value should be updated in the form model.
2911
- * Options include 'change', 'blur', and 'submit'.
2912
- *
2913
- * @type {FieldUpdateMode}
2914
- * @default 'change'
2915
- * @memberOf CrudFieldComponent
2916
- */
2917
- updateOn: FieldUpdateMode;
2918
- /**
2919
- * @description Reference to the field component.
2920
- * @summary Provides a reference to the field component element, allowing direct access to its properties and methods.
2921
- *
2922
- * @type {ElementRef}
2923
- * @memberOf CrudFieldComponent
2924
- */
2925
- component: ElementRef;
2926
- /**
2927
- * @description Parent form group.
2928
- * @summary References the parent form group to which this field belongs.
2929
- * This is necessary for integrating the field with Angular's reactive forms.
2930
- *
2931
- * @type {FormGroup}
2932
- * @memberOf CrudFieldComponent
2933
- */
2934
- formGroup: FormGroup | undefined;
2935
- /**
2936
- * @description Angular FormControl instance for this field.
2937
- * @summary The specific FormControl instance that manages this field's state, validation,
2938
- * and value. This provides direct access to Angular's reactive forms functionality
2939
- * for this individual field within the broader form structure.
2940
- *
2941
- * @type {FormControl}
2942
- * @memberOf CrudFieldComponent
2943
- */
2944
- formControl: FormControl;
2945
- /**
2946
- * @description Indicates if this field supports multiple values.
2947
- * @summary When true, this field can handle multiple values, typically used in
2948
- * multi-select scenarios or when the field is part of a form array structure
2949
- * that allows multiple entries of the same field type.
2950
- *
2951
- * @type {boolean}
2952
- * @default false
2953
- * @memberOf CrudFieldComponent
2954
- */
2955
- multiple: boolean;
2956
- /**
2957
- * @description Unique identifier for the current record.
2958
- * @summary A unique identifier for the current record being displayed or manipulated.
2959
- * This is typically used in conjunction with the primary key for operations on specific records.
2960
- *
2961
- * @type {string | number}
2962
- */
2963
- uid: string;
2964
- page: number;
2965
- /**
2966
- * @description Translatability of field labels.
2967
- * @summary Indicates whether the field labels should be translated based on the current language settings.
2968
- * This is useful for applications supporting multiple languages.
3750
+ * required for certain business rules or security constraints.
2969
3751
  *
2970
- * @type {StringOrBoolean}
2971
- * @default true
3752
+ * @type {string | undefined}
2972
3753
  * @memberOf CrudFieldComponent
2973
3754
  */
2974
- translatable: StringOrBoolean;
3755
+ different?: string;
2975
3756
  /**
2976
- * @description Component initialization lifecycle method.
2977
- * @summary Initializes the field component based on the operation type and field configuration.
2978
- * For READ and DELETE operations, removes the form group to make fields read-only.
2979
- * For other operations, sets up icons, configures multi-value support if needed,
2980
- * and sets default values for radio buttons if no value is provided.
3757
+ * @description Field name for less-than validation comparison.
3758
+ * @summary Specifies another field name that this field's value must be less than for validation.
3759
+ * This is commonly used for date ranges, numeric ranges, or other scenarios where
3760
+ * one field must have a smaller value than another.
2981
3761
  *
2982
- * @returns {void}
3762
+ * @type {string | undefined}
2983
3763
  * @memberOf CrudFieldComponent
2984
3764
  */
2985
- ngOnInit(): Promise<void>;
2986
- /**
2987
- * Returns a list of options for select or radio inputs, with their `text` property
2988
- * localized if it does not already include the word 'options'. The localization key
2989
- * is generated from the component's label, replacing 'label' with 'options'.
2990
- *
2991
- * @returns {CrudFieldOption[]} The array of parsed and localized options.
2992
- * @memberOf CrudFieldComponent
2993
- */
2994
- getOptions(): Promise<CrudFieldOption[]>;
3765
+ lessThan?: string;
2995
3766
  /**
2996
- * @description Component after view initialization lifecycle method.
2997
- * @summary Calls the parent afterViewInit method for READ and DELETE operations.
2998
- * This ensures proper initialization of read-only fields that don't require
2999
- * form functionality but still need view setup.
3767
+ * @description Field name for less-than-or-equal validation comparison.
3768
+ * @summary Specifies another field name that this field's value must be less than or equal to
3769
+ * for validation. This provides inclusive upper bound validation for numeric or date comparisons.
3000
3770
  *
3001
- * @returns {void}
3771
+ * @type {string | undefined}
3002
3772
  * @memberOf CrudFieldComponent
3003
3773
  */
3004
- ngAfterViewInit(): void;
3774
+ lessThanOrEqual?: string;
3005
3775
  /**
3006
- * @description Component cleanup lifecycle method.
3007
- * @summary Performs cleanup operations for READ and DELETE operations by calling
3008
- * the parent onDestroy method. This ensures proper resource cleanup for
3009
- * read-only field components.
3776
+ * @description Field name for greater-than validation comparison.
3777
+ * @summary Specifies another field name that this field's value must be greater than for validation.
3778
+ * This is commonly used for date ranges, numeric ranges, or other scenarios where
3779
+ * one field must have a larger value than another.
3010
3780
  *
3011
- * @returns {void}
3781
+ * @type {string | undefined}
3012
3782
  * @memberOf CrudFieldComponent
3013
3783
  */
3014
- ngOnDestroy(): void;
3015
- toggleOptionSelection(val: string, event: CheckboxCustomEvent): void;
3016
- isOptionChecked(value: string): boolean;
3784
+ greaterThan?: string;
3017
3785
  /**
3018
- * @description Handles fieldset group creation events from parent fieldsets.
3019
- * @summary Processes events triggered when a new group needs to be added to a fieldset.
3020
- * Validates the current form group, checks for uniqueness if applicable, and either
3021
- * creates a new group or provides validation feedback. Updates the active form group
3022
- * and resets the field for new input after successful creation.
3786
+ * @description Field name for greater-than-or-equal validation comparison.
3787
+ * @summary Specifies another field name that this field's value must be greater than or equal to
3788
+ * for validation. This provides inclusive lower bound validation for numeric or date comparisons.
3023
3789
  *
3024
- * @param {CustomEvent} event - The fieldset create group event containing group details
3025
- * @returns {void}
3790
+ * @type {string | undefined}
3026
3791
  * @memberOf CrudFieldComponent
3027
3792
  */
3028
- handleFieldsetCreateGroupEvent(event: CustomEvent): void;
3793
+ greaterThanOrEqual?: string;
3029
3794
  /**
3030
- * @description Handles fieldset group update events from parent fieldsets.
3031
- * @summary Processes events triggered when an existing group needs to be updated.
3032
- * Updates the active form group index and refreshes the form group and form control
3033
- * references to point to the group being edited.
3795
+ * @description Alignment of the field content.
3796
+ * @summary Controls the horizontal alignment of the field content.
3797
+ * This affects how the content is positioned within the field container.
3034
3798
  *
3035
- * @param {CustomEvent} event - The fieldset update group event containing update details
3036
- * @returns {void}
3799
+ * @type {'start' | 'center'}
3037
3800
  * @memberOf CrudFieldComponent
3038
3801
  */
3039
- handleFieldsetUpdateGroupEvent(event: CustomEvent): void;
3802
+ alignment?: 'start' | 'center';
3040
3803
  /**
3041
- * @description Handles fieldset group removal events from parent fieldsets.
3042
- * @summary Processes events triggered when a group needs to be removed from a fieldset.
3043
- * Removes the specified group from the form array, updates the active form group index,
3044
- * and refreshes the form references. Dispatches a confirmation event back to the component.
3804
+ * @description Initial checked state for checkbox or toggle inputs.
3805
+ * @summary For checkbox or toggle inputs, this sets the initial checked state.
3806
+ * When true, the checkbox or toggle will be initially checked.
3045
3807
  *
3046
- * @param {CustomEvent} event - The fieldset remove group event containing removal details
3047
- * @returns {void}
3808
+ * @type {boolean}
3048
3809
  * @memberOf CrudFieldComponent
3049
3810
  */
3050
- handleFieldsetRemoveGroupEvent(event: CustomEvent): void;
3051
- static ɵfac: i0.ɵɵFactoryDeclaration<CrudFieldComponent, never>;
3052
- static ɵcmp: i0.ɵɵComponentDeclaration<CrudFieldComponent, "ngx-decaf-crud-field", never, { "operation": { "alias": "operation"; "required": true; }; "name": { "alias": "name"; "required": true; }; "className": { "alias": "className"; "required": false; }; "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; }; "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; }; "page": { "alias": "page"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; }, {}, never, never, true, never>;
3053
- }
3054
-
3055
- /**
3056
- * @module module:lib/engine/NgxParentComponentDirective
3057
- * @description Directive base for parent container components used by the rendering system.
3058
- * @summary Provides NgxParentComponentDirective which offers inputs for children metadata,
3059
- * column/row configuration and parent component wiring used by layout and container components.
3060
- *
3061
- * @link {@link NgxParentComponentDirective}
3062
- */
3063
-
3064
- /**
3065
- * @description Layout component for creating responsive grid layouts in Angular applications.
3066
- * @summary This component provides a flexible grid system that can be configured with dynamic
3067
- * rows and columns. It supports responsive breakpoints and can render child components within
3068
- * the grid structure. The component extends NgxDecafComponentDirective to inherit common functionality
3069
- * and integrates with the model and component renderer systems.
3070
- *
3071
- * @class NgxParentComponentDirective
3072
- * @extends {NgxParentComponentDirective}
3073
- * @implements {OnInit}
3074
- * @memberOf NgxParentComponentDirective
3075
- */
3076
- declare class NgxParentComponentDirective extends NgxDecafComponentDirective implements OnInit {
3811
+ checked?: boolean;
3077
3812
  /**
3078
- * @description The display name or title of the fieldset section.
3079
- * @summary Sets the legend or header text that appears in the accordion header. This text
3080
- * provides a clear label for the collapsible section, helping users understand what content
3081
- * is contained within. The name is displayed prominently and serves as the clickable area
3082
- * for expanding/collapsing the fieldset.
3813
+ * @description Justification of items within the field.
3814
+ * @summary Controls how items are justified within the field container.
3815
+ * This is particularly useful for fields with multiple elements, such as radio groups.
3083
3816
  *
3084
- * @type {string}
3085
- * @default 'Child'
3086
- * @memberOf FieldsetComponent
3817
+ * @type {'start' | 'end' | 'space-between'}
3818
+ * @memberOf CrudFieldComponent
3087
3819
  */
3088
- parentComponent: FormParent;
3820
+ justify?: 'start' | 'end' | 'space-between';
3089
3821
  /**
3090
- * @description Array of UI model metadata for all form fields.
3091
- * @summary Contains the complete collection of UI model metadata that defines
3092
- * the structure, validation, and presentation of form fields across all pages.
3093
- * Each metadata object contains information about field type, validation rules,
3094
- * page assignment, and display properties.
3822
+ * @description Text for the cancel button in select inputs.
3823
+ * @summary For select inputs with a cancel button, this sets the text displayed on the cancel button.
3824
+ * This is typically used in select dialogs to provide a way for users to dismiss the selection without making a change.
3095
3825
  *
3096
- * @type {UIModelMetadata[]}
3097
- * @memberOf NgxParentComponentDirective
3826
+ * @type {string}
3827
+ * @memberOf CrudFieldComponent
3098
3828
  */
3099
- children: UIModelMetadata[] | KeyValue[];
3829
+ cancelText?: string;
3100
3830
  /**
3101
- * @description Number of columns or array of column definitions for the grid layout.
3102
- * @summary Defines the column structure of the grid. When a number is provided, it creates
3103
- * that many equal-width columns. When an array is provided, each element can define specific
3104
- * column properties or sizing. This allows for flexible grid layouts that can adapt to
3105
- * different content requirements.
3831
+ * @description Interface style for select inputs.
3832
+ * @summary Specifies the interface style for select inputs, such as 'alert', 'action-sheet', or 'popover'.
3833
+ * This determines how the select options are presented to the user.
3106
3834
  *
3107
- * @type {(number | string[])}
3108
- * @default 1
3109
- * @memberOf NgxParentComponentDirective
3835
+ * @type {SelectInterface}
3836
+ * @memberOf CrudFieldComponent
3110
3837
  */
3111
- cols: number | string[];
3838
+ interface: SelectInterface;
3112
3839
  /**
3113
- * @description Number of rows or array of row definitions for the grid layout.
3114
- * @summary Defines the row structure of the grid. When a number is provided, it creates
3115
- * that many equal-height rows. When an array is provided, each element can define specific
3116
- * row properties or sizing. This provides control over vertical spacing and content organization.
3840
+ * @description Options for select or radio inputs.
3841
+ * @summary Provides the list of options for select or radio inputs. Each option can have a value and a label.
3842
+ * This is used to populate the dropdown or radio group with choices.
3117
3843
  *
3118
- * @type {(number | string[])}
3119
- * @default 1
3120
- * @memberOf NgxParentComponentDirective
3844
+ * @type {CrudFieldOption[]}
3845
+ * @memberOf CrudFieldComponent
3121
3846
  */
3122
- rows: number | KeyValue[] | string[];
3123
- ngOnInit(model?: Model | string): Promise<void>;
3124
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxParentComponentDirective, never>;
3125
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxParentComponentDirective, never, never, { "parentComponent": { "alias": "parentComponent"; "required": false; }; "children": { "alias": "children"; "required": false; }; "cols": { "alias": "cols"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; }, {}, never, never, true, never>;
3126
- }
3127
-
3128
- declare abstract class NgxFormDirective extends NgxParentComponentDirective implements OnInit, IFormElement, OnDestroy, IRenderedModel {
3129
- crudFieldComponent: string;
3847
+ options: FunctionLike | CrudFieldOption[] | KeyValue[];
3130
3848
  /**
3131
- * @description Reactive form group associated with this fieldset.
3132
- * @summary The FormGroup instance that contains all form controls within this fieldset.
3133
- * Used for form validation, value management, and integration with Angular's reactive forms.
3849
+ * @description Mode of the field.
3850
+ * @summary Specifies the visual mode of the field, such as 'ios' or 'md'.
3851
+ * This affects the styling and appearance of the field to match the platform style.
3134
3852
  *
3135
- * @type {FormGroup}
3136
- * @memberOf CrudFormComponent
3853
+ * @type {'ios' | 'md'}
3854
+ * @memberOf CrudFieldComponent
3137
3855
  */
3138
- parentFormId: string;
3856
+ mode?: 'ios' | 'md';
3139
3857
  /**
3140
- * @description Reference to the reactive form DOM element.
3141
- * @summary ViewChild reference that provides direct access to the form's DOM element.
3142
- * This enables programmatic manipulation of the form element and access to native
3143
- * HTML form properties and methods when needed.
3858
+ * @description Spellcheck attribute for text inputs.
3859
+ * @summary Enables or disables spellchecking for text inputs.
3860
+ * When true, the browser will check the spelling of the input text.
3144
3861
  *
3145
- * @type {ElementRef}
3146
- * @memberOf CrudFormComponent
3862
+ * @type {boolean}
3863
+ * @default false
3864
+ * @memberOf CrudFieldComponent
3147
3865
  */
3148
- component: ElementRef;
3866
+ spellcheck: boolean;
3149
3867
  /**
3150
- * @description Angular Location service.
3151
- * @summary Injected service that provides access to the browser's URL and history.
3152
- * This service is used for interacting with the browser's history API, allowing
3153
- * for back navigation and URL manipulation outside of Angular's router.
3868
+ * @description Input mode for text inputs.
3869
+ * @summary Hints at the type of data that might be entered by the user while editing the element.
3870
+ * This can affect the virtual keyboard layout on mobile devices.
3154
3871
  *
3155
- * @private
3156
- * @type {Location}
3157
- * @memberOf CrudFormComponent
3872
+ * @type {'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search'}
3873
+ * @default 'none'
3874
+ * @memberOf CrudFieldComponent
3158
3875
  */
3159
- private location;
3876
+ inputmode: 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
3160
3877
  /**
3161
- * @description Field update trigger mode for form validation.
3162
- * @summary Determines when form field validation should be triggered. Options include
3163
- * 'change', 'blur', or 'submit'. This affects the user experience by controlling
3164
- * when validation feedback is shown to the user during form interaction.
3878
+ * @description Autocomplete behavior for the field.
3879
+ * @summary Specifies whether and how the browser should automatically complete the input.
3880
+ * This can improve user experience by suggesting previously entered values.
3165
3881
  *
3166
- * @type {FieldUpdateMode}
3167
- * @default 'change'
3168
- * @memberOf CrudFormComponent
3882
+ * @type {AutocompleteTypes}
3883
+ * @default 'off'
3884
+ * @memberOf CrudFieldComponent
3169
3885
  */
3170
- updateOn: FieldUpdateMode;
3886
+ autocomplete: AutocompleteTypes;
3171
3887
  /**
3172
- * @description Form submission target specification.
3173
- * @summary Specifies where to display the response after form submission, similar
3174
- * to the HTML form target attribute. Options include '_self', '_blank', '_parent',
3175
- * '_top', or a named frame. Controls the browser behavior for form responses.
3888
+ * @description Fill style for the field.
3889
+ * @summary Determines the fill style of the field, such as 'outline' or 'solid'.
3890
+ * This affects the border and background of the field.
3176
3891
  *
3177
- * @type {HTMLFormTarget}
3178
- * @default '_self'
3179
- * @memberOf CrudFormComponent
3892
+ * @type {'outline' | 'solid'}
3893
+ * @default 'outline'
3894
+ * @memberOf CrudFieldComponent
3180
3895
  */
3181
- target: HTMLFormTarget;
3896
+ fill: 'outline' | 'solid';
3182
3897
  /**
3183
- * @description HTTP method or submission strategy for the form.
3184
- * @summary Defines how the form should be submitted. 'get' and 'post' correspond
3185
- * to standard HTTP methods for traditional form submission, while 'event' uses
3186
- * Angular event-driven submission for single-page application workflows.
3898
+ * @description Placement of the label relative to the field.
3899
+ * @summary Specifies where the label should be placed relative to the field.
3900
+ * Options include 'start', 'end', 'floating', 'stacked', and 'fixed'.
3187
3901
  *
3188
- * @type {'get' | 'post' | 'event'}
3189
- * @default 'event'
3190
- * @memberOf CrudFormComponent
3902
+ * @type {'start' | 'end' | 'floating' | 'stacked' | 'fixed'}
3903
+ * @default 'floating'
3904
+ * @memberOf CrudFieldComponent
3191
3905
  */
3192
- method: 'get' | 'post' | 'event';
3906
+ labelPlacement: 'start' | 'end' | 'floating' | 'stacked' | 'fixed';
3193
3907
  /**
3194
- * @description Configuration options for the CRUD form behavior.
3195
- * @summary Contains various configuration settings that control form rendering,
3196
- * validation, and behavior. These options are merged with default settings
3197
- * during component initialization to customize the form's functionality.
3908
+ * @description Update mode for the field.
3909
+ * @summary Determines when the field value should be updated in the form model.
3910
+ * Options include 'change', 'blur', and 'submit'.
3198
3911
  *
3199
- * @type {ICrudFormOptions}
3200
- * @memberOf CrudFormComponent
3912
+ * @type {FieldUpdateMode}
3913
+ * @default 'change'
3914
+ * @memberOf CrudFieldComponent
3201
3915
  */
3202
- options: ICrudFormOptions;
3916
+ updateOn: FieldUpdateMode;
3203
3917
  /**
3204
- * @description Optional action identifier for form submission context.
3205
- * @summary Specifies a custom action name that will be included in the submit event.
3206
- * If not provided, defaults to the standard submit event constant. Used to
3207
- * distinguish between different types of form submissions within the same component.
3918
+ * @description Reference to the field component.
3919
+ * @summary Provides a reference to the field component element, allowing direct access to its properties and methods.
3208
3920
  *
3209
- * @type {string | undefined}
3210
- * @memberOf CrudFormComponent
3921
+ * @type {ElementRef}
3922
+ * @memberOf CrudFieldComponent
3211
3923
  */
3212
- action?: string;
3924
+ component: ElementRef;
3213
3925
  /**
3214
- * @description The current CRUD operation being performed.
3215
- * @summary Specifies the type of operation this form is handling (CREATE, READ, UPDATE, DELETE).
3216
- * This is a required input that determines form behavior, validation rules, and available actions.
3217
- * The operation affects form state, button visibility, and submission logic.
3926
+ * @description Parent form group.
3927
+ * @summary References the parent form group to which this field belongs.
3928
+ * This is necessary for integrating the field with Angular's reactive forms.
3218
3929
  *
3219
- * @type {CrudOperations}
3220
- * @required
3221
- * @memberOf CrudFormComponent
3930
+ * @type {FormGroup}
3931
+ * @memberOf CrudFieldComponent
3222
3932
  */
3223
- operation: CrudOperations;
3933
+ formGroup: FormGroup | undefined;
3224
3934
  /**
3225
- * @description Custom event handlers for form actions.
3226
- * @summary A record of event handler functions keyed by event names that can be
3227
- * triggered during form operations. These handlers provide extensibility for
3228
- * custom business logic and can be invoked for various form events and actions.
3935
+ * @description Angular FormControl instance for this field.
3936
+ * @summary The specific FormControl instance that manages this field's state, validation,
3937
+ * and value. This provides direct access to Angular's reactive forms functionality
3938
+ * for this individual field within the broader form structure.
3229
3939
  *
3230
- * @type {HandlerLike}
3231
- * @memberOf CrudFormComponent
3940
+ * @type {FormControl}
3941
+ * @memberOf CrudFieldComponent
3232
3942
  */
3233
- handlers: HandlerLike;
3943
+ formControl: FormControl;
3234
3944
  /**
3235
- * @description Angular reactive FormGroup for form state management.
3236
- * @summary The FormGroup instance that manages all form controls, validation,
3237
- * and form state. This is the main interface for accessing form values and
3238
- * controlling form behavior. May be undefined for read-only operations.
3945
+ * @description Indicates if this field supports multiple values.
3946
+ * @summary When true, this field can handle multiple values, typically used in
3947
+ * multi-select scenarios or when the field is part of a form array structure
3948
+ * that allows multiple entries of the same field type.
3239
3949
  *
3240
- * @type {FormGroup | undefined}
3241
- * @memberOf CrudFormComponent
3950
+ * @type {boolean}
3951
+ * @default false
3952
+ * @memberOf CrudFieldComponent
3242
3953
  */
3243
- formGroup: FormParent | undefined;
3954
+ multiple: boolean;
3244
3955
  /**
3245
- * @description Unique identifier for the form renderer.
3246
- * @summary A unique string identifier used to register and manage this form
3247
- * instance within the NgxDecafFormService. This ID is also used as the HTML id
3248
- * attribute for the form element, enabling DOM queries and form management.
3956
+ * @description Unique identifier for the current record.
3957
+ * @summary A unique identifier for the current record being displayed or manipulated.
3958
+ * This is typically used in conjunction with the primary key for operations on specific records.
3249
3959
  *
3250
- * @type {string}
3251
- * @memberOf CrudFormComponent
3960
+ * @type {string | number}
3252
3961
  */
3253
- rendererId: string;
3962
+ uid: string;
3963
+ page: number;
3254
3964
  /**
3255
- * @description Event emitter for form submission events.
3256
- * @summary Emits ICrudFormEvent objects when the form is submitted, providing
3257
- * form data, component information, and any associated handlers to parent
3258
- * components. This enables decoupled handling of form submission logic.
3259
- *
3260
- * @type {EventEmitter<ICrudFormEvent>}
3261
- * @memberOf CrudFormComponent
3262
- */
3263
- submitEvent: EventEmitter<ICrudFormEvent>;
3965
+ * @description Translatability of field labels.
3966
+ * @summary Indicates whether the field labels should be translated based on the current language settings.
3967
+ * This is useful for applications supporting multiple languages.
3968
+ *
3969
+ * @type {StringOrBoolean}
3970
+ * @default true
3971
+ * @memberOf CrudFieldComponent
3972
+ */
3973
+ translatable: StringOrBoolean;
3264
3974
  /**
3265
- * @description Unique identifier for the current record instance.
3266
- * @summary This property holds a unique string value that identifies the specific record being managed by the form.
3267
- * It is automatically generated if not provided, ensuring each form instance has a distinct identifier.
3268
- * The uid is used for tracking, referencing, and emitting events related to the current record, and may be used
3269
- * in conjunction with the primary key for CRUD operations.
3975
+ * @description Component initialization lifecycle method.
3976
+ * @summary Initializes the field component based on the operation type and field configuration.
3977
+ * For READ and DELETE operations, removes the form group to make fields read-only.
3978
+ * For other operations, sets up icons, configures multi-value support if needed,
3979
+ * and sets default values for radio buttons if no value is provided.
3270
3980
  *
3271
- * @type {string}
3272
- * @default Randomly generated 12-character string
3273
- * @memberOf CrudFormComponent
3981
+ * @returns {void}
3982
+ * @memberOf CrudFieldComponent
3274
3983
  */
3275
- allowClear: boolean;
3984
+ ngOnInit(): Promise<void>;
3276
3985
  /**
3277
- * @description Reference to CRUD operation constants for template usage.
3278
- * @summary Exposes the OperationKeys enum to the component template, enabling
3279
- * conditional rendering and behavior based on operation types. This protected
3280
- * readonly property ensures that template logic can access operation constants
3281
- * while maintaining encapsulation and preventing accidental modification.
3986
+ * Returns a list of options for select or radio inputs, with their `text` property
3987
+ * localized if it does not already include the word 'options'. The localization key
3988
+ * is generated from the component's label, replacing 'label' with 'options'.
3282
3989
  *
3283
- * @protected
3284
- * @readonly
3285
- * @memberOf CrudFormComponent
3990
+ * @returns {CrudFieldOption[]} The array of parsed and localized options.
3991
+ * @memberOf CrudFieldComponent
3286
3992
  */
3287
- protected readonly OperationKeys: typeof OperationKeys;
3288
- protected activeFormGroupIndex: number;
3289
- get activeFormGroup(): FormParent;
3993
+ getOptions(): Promise<CrudFieldOption[]>;
3290
3994
  /**
3291
- * @description Component initialization lifecycle method.
3292
- * @summary Initializes the component by setting up the logger, configuring form state
3293
- * based on the operation type, and merging configuration options. For READ and DELETE
3294
- * operations, the formGroup is set to undefined since these operations don't require
3295
- * form input. Configuration options are merged with default settings.
3296
- *
3297
- * @returns {Promise<void>}
3298
- * @memberOf CrudFormComponent
3299
- */
3300
- ngOnInit(model?: Model | string): Promise<void>;
3995
+ * @description Component after view initialization lifecycle method.
3996
+ * @summary Calls the parent afterViewInit method for READ and DELETE operations.
3997
+ * This ensures proper initialization of read-only fields that don't require
3998
+ * form functionality but still need view setup.
3999
+ *
4000
+ * @returns {void}
4001
+ * @memberOf CrudFieldComponent
4002
+ */
4003
+ ngAfterViewInit(): void;
3301
4004
  /**
3302
4005
  * @description Component cleanup lifecycle method.
3303
- * @summary Performs cleanup operations when the component is destroyed.
3304
- * Unregisters the FormGroup from the NgxDecafFormService to prevent memory leaks
3305
- * and ensure proper resource cleanup.
4006
+ * @summary Performs cleanup operations for READ and DELETE operations by calling
4007
+ * the parent onDestroy method. This ensures proper resource cleanup for
4008
+ * read-only field components.
3306
4009
  *
3307
4010
  * @returns {void}
3308
- * @memberOf CrudFormComponent
4011
+ * @memberOf CrudFieldComponent
3309
4012
  */
3310
4013
  ngOnDestroy(): void;
3311
- getFormArrayIndex(index: number): FormParent | undefined;
4014
+ toggleOptionSelection(val: string, event: CheckboxCustomEvent): void;
4015
+ isOptionChecked(value: string): boolean;
3312
4016
  /**
3313
- * @description Handles form reset or navigation back functionality.
3314
- * @summary Provides different reset behavior based on the current operation.
3315
- * For CREATE and UPDATE operations, resets the form to its initial state.
3316
- * For READ and DELETE operations, navigates back in the browser history
3317
- * since these operations don't have modifiable form data to reset.
4017
+ * @description Handles fieldset group update events from parent fieldsets.
4018
+ * @summary Processes events triggered when an existing group needs to be updated.
4019
+ * Updates the active form group index and refreshes the form group and form control
4020
+ * references to point to the group being edited.
3318
4021
  *
4022
+ * @param {CustomEvent} event - The fieldset update group event containing update details
3319
4023
  * @returns {void}
3320
- * @memberOf CrudFormComponent
4024
+ * @memberOf CrudFieldComponent
3321
4025
  */
3322
- handleReset(): void;
3323
- handleSubmit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void>;
3324
- static ɵfac: i0.ɵɵFactoryDeclaration<NgxFormDirective, never>;
3325
- static ɵdir: i0.ɵɵDirectiveDeclaration<NgxFormDirective, never, never, { "parentFormId": { "alias": "parentFormId"; "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; }; "rendererId": { "alias": "rendererId"; "required": false; }; "allowClear": { "alias": "allowClear"; "required": false; }; }, { "submitEvent": "submitEvent"; }, never, never, true, never>;
4026
+ handleFieldsetUpdateGroupEvent(event: CustomEvent): void;
4027
+ static ɵfac: i0.ɵɵFactoryDeclaration<CrudFieldComponent, never>;
4028
+ static ɵcmp: i0.ɵɵComponentDeclaration<CrudFieldComponent, "ngx-decaf-crud-field", never, { "operation": { "alias": "operation"; "required": true; }; "name": { "alias": "name"; "required": true; }; "className": { "alias": "className"; "required": false; }; "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; }; "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; }; "page": { "alias": "page"; "required": false; }; "translatable": { "alias": "translatable"; "required": false; }; }, {}, never, never, true, never>;
3326
4029
  }
3327
4030
 
3328
4031
  declare class CrudFormComponent extends NgxFormDirective {
@@ -3341,7 +4044,7 @@ declare class CrudFormComponent extends NgxFormDirective {
3341
4044
  /**
3342
4045
  * @description Handles form submission with validation and event emission.
3343
4046
  * @summary Processes form submission by first preventing default browser behavior,
3344
- * then validating all form fields using NgxDecafFormService. If validation passes,
4047
+ * then validating all form fields using NgxFormService. If validation passes,
3345
4048
  * extracts form data and emits a submitEvent with the data, component information,
3346
4049
  * and any associated handlers. Returns false if validation fails.
3347
4050
  *
@@ -3410,7 +4113,7 @@ declare class CrudFormComponent extends NgxFormDirective {
3410
4113
  * @extends {NgxBaseComponentDirective}
3411
4114
  * @implements {OnInit}
3412
4115
  */
3413
- declare class EmptyStateComponent extends NgxDecafComponentDirective implements OnInit {
4116
+ declare class EmptyStateComponent extends NgxComponentDirective implements OnInit {
3414
4117
  /**
3415
4118
  * @description The main title displayed in the empty state.
3416
4119
  * @summary Specifies the primary message to show in the empty state component.
@@ -3472,7 +4175,7 @@ declare class EmptyStateComponent extends NgxDecafComponentDirective implements
3472
4175
  * and this value should correspond to an available icon name.
3473
4176
  *
3474
4177
  * @type {string}
3475
- * @default "ti-info-square-rounded"
4178
+ * @default "folder-open-outline"
3476
4179
  * @memberOf EmptyStateComponent
3477
4180
  */
3478
4181
  icon: string;
@@ -3559,6 +4262,7 @@ declare class EmptyStateComponent extends NgxDecafComponentDirective implements
3559
4262
  searchValue: string;
3560
4263
  private sanitizer;
3561
4264
  searchSubtitle: SafeHtml;
4265
+ enableCreationByModelRoute: boolean;
3562
4266
  /**
3563
4267
  * @description Creates an instance of EmptyStateComponent.
3564
4268
  * @summary Initializes a new EmptyStateComponent by calling the parent class constructor
@@ -3997,7 +4701,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
3997
4701
  * ```
3998
4702
  */
3999
4703
  handleCreateItem(event?: CustomEvent<IFieldSetValidationEvent>): Promise<void>;
4000
- handleUpdateItem(index: number, save?: boolean): void;
4704
+ handleUpdateItem(index: number): void;
4001
4705
  /**
4002
4706
  * @description Cancels the update mode and resets the UI state.
4003
4707
  * @summary Exits the update mode by resetting the button label and clearing the updating item,
@@ -4113,7 +4817,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
4113
4817
  */
4114
4818
  private getMapper;
4115
4819
  static ɵfac: i0.ɵɵFactoryDeclaration<FieldsetComponent, never>;
4116
- static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetComponent, "ngx-decaf-fieldset", never, { "formControl": { "alias": "formControl"; "required": false; }; "collapsable": { "alias": "collapsable"; "required": false; }; "page": { "alias": "page"; "required": false; }; "customTypes": { "alias": "customTypes"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "value": { "alias": "value"; "required": false; }; "borders": { "alias": "borders"; "required": false; }; }, {}, never, ["[slot=content]"], true, never>;
4820
+ static ɵcmp: i0.ɵɵComponentDeclaration<FieldsetComponent, "ngx-decaf-fieldset", never, { "formControl": { "alias": "formControl"; "required": false; }; "collapsable": { "alias": "collapsable"; "required": false; }; "page": { "alias": "page"; "required": false; }; "customTypes": { "alias": "customTypes"; "required": false; }; "title": { "alias": "title"; "required": false; }; "description": { "alias": "description"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "value": { "alias": "value"; "required": false; }; "borders": { "alias": "borders"; "required": false; }; }, {}, never, never, true, never>;
4117
4821
  }
4118
4822
 
4119
4823
  /**
@@ -4167,7 +4871,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
4167
4871
  *
4168
4872
  * @memberOf ForAngularCommonModule
4169
4873
  */
4170
- declare class FilterComponent extends NgxDecafComponentDirective implements OnInit, OnDestroy {
4874
+ declare class FilterComponent extends NgxComponentDirective implements OnInit, OnDestroy {
4171
4875
  /**
4172
4876
  * @description Reference to the dropdown options container element.
4173
4877
  * @summary ViewChild reference used to access and manipulate the dropdown options element
@@ -4658,7 +5362,6 @@ declare class FilterComponent extends NgxDecafComponentDirective implements OnIn
4658
5362
  * @memberOf LayoutComponent
4659
5363
  */
4660
5364
  declare class LayoutComponent extends NgxParentComponentDirective implements OnInit {
4661
- initializeProps: boolean;
4662
5365
  /**
4663
5366
  * @description Media breakpoint for responsive behavior.
4664
5367
  * @summary Determines the responsive breakpoint at which the layout should adapt.
@@ -4671,7 +5374,6 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
4671
5374
  * @memberOf LayoutComponent
4672
5375
  */
4673
5376
  gap: 'small' | 'medium' | 'large' | 'collapse';
4674
- match: boolean;
4675
5377
  /**
4676
5378
  * @description Media breakpoint for responsive behavior.
4677
5379
  * @summary Determines the responsive breakpoint at which the layout should adapt.
@@ -4684,6 +5386,30 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
4684
5386
  * @memberOf LayoutComponent
4685
5387
  */
4686
5388
  breakpoint: UIMediaBreakPointsType | string;
5389
+ /**
5390
+ * @description Media breakpoint for responsive behavior.
5391
+ * @summary Determines the responsive breakpoint at which the layout should adapt.
5392
+ * This affects how the grid behaves on different screen sizes, allowing for
5393
+ * mobile-first or desktop-first responsive design patterns. The breakpoint
5394
+ * is automatically processed to ensure compatibility with the UI framework.
5395
+ *
5396
+ * @type {UIMediaBreakPointsType}
5397
+ * @default 'medium'
5398
+ * @memberOf LayoutComponent
5399
+ */
5400
+ grid: boolean;
5401
+ /**
5402
+ * @description Media breakpoint for responsive behavior.
5403
+ * @summary Determines the responsive breakpoint at which the layout should adapt.
5404
+ * This affects how the grid behaves on different screen sizes, allowing for
5405
+ * mobile-first or desktop-first responsive design patterns. The breakpoint
5406
+ * is automatically processed to ensure compatibility with the UI framework.
5407
+ *
5408
+ * @type {UIMediaBreakPointsType}
5409
+ * @default 'medium'
5410
+ * @memberOf LayoutComponent
5411
+ */
5412
+ match: boolean;
4687
5413
  /**
4688
5414
  * @description Creates an instance of LayoutComponent.
4689
5415
  * @summary Initializes a new LayoutComponent with the component name "LayoutComponent".
@@ -4727,7 +5453,7 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
4727
5453
  */
4728
5454
  ngOnInit(): Promise<void>;
4729
5455
  static ɵfac: i0.ɵɵFactoryDeclaration<LayoutComponent, never>;
4730
- static ɵcmp: i0.ɵɵComponentDeclaration<LayoutComponent, "ngx-decaf-layout", never, { "initializeProps": { "alias": "initializeProps"; "required": false; }; "gap": { "alias": "gap"; "required": false; }; "match": { "alias": "match"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; }, {}, never, never, true, never>;
5456
+ static ɵcmp: i0.ɵɵComponentDeclaration<LayoutComponent, "ngx-decaf-layout", never, { "gap": { "alias": "gap"; "required": false; }; "breakpoint": { "alias": "breakpoint"; "required": false; }; "grid": { "alias": "grid"; "required": false; }; "match": { "alias": "match"; "required": false; }; }, {}, never, never, true, never>;
4731
5457
  }
4732
5458
 
4733
5459
  /**
@@ -4811,7 +5537,7 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
4811
5537
  * @extends {NgxBaseComponentDirective}
4812
5538
  * @implements {OnInit}
4813
5539
  */
4814
- declare class ListComponent extends NgxDecafComponentDirective implements OnInit, OnDestroy {
5540
+ declare class ListComponent extends NgxComponentDirective implements OnInit, OnDestroy {
4815
5541
  /**
4816
5542
  * @description The display mode for the list component.
4817
5543
  * @summary Determines how the list data is loaded and displayed. Options include:
@@ -5001,32 +5727,22 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
5001
5727
  */
5002
5728
  disableSort: StringOrBoolean;
5003
5729
  /**
5004
- * @description Icon to display when the list is empty.
5005
- * @summary Specifies the icon shown in the empty state when no data is available.
5006
- * This can be any icon name supported by the application's icon system.
5007
- *
5008
- * @type {string | undefined}
5009
- * @default 'ti-database-exclamation'
5010
- * @memberOf ListComponent
5011
- */
5012
- emptyIcon?: string;
5013
- /**
5014
- * @description Configuration for the empty state display.
5015
- * @summary Customizes how the empty state is displayed when no data is available.
5016
- * This includes the title, subtitle, button text, icon, and navigation link.
5017
- *
5018
- * @type {Partial<IListEmptyResult>}
5019
- * @default {
5020
- * title: 'empty.title',
5021
- * subtitle: 'empty.subtitle',
5022
- * showButton: false,
5023
- * icon: 'alert-circle-outline',
5024
- * buttonText: 'locale.empty.button',
5025
- * link: ''
5026
- * }
5027
- * @memberOf ListComponent
5028
- */
5029
- empty: Partial<IListEmptyResult>;
5730
+ * @description Configuration for the empty state display.
5731
+ * @summary Customizes how the empty state is displayed when no data is available.
5732
+ * This includes the title, subtitle, button text, icon, and navigation link.
5733
+ *
5734
+ * @type {Partial<IListEmptyOptions>}
5735
+ * @default {
5736
+ * title: 'empty.title',
5737
+ * subtitle: 'empty.subtitle',
5738
+ * showButton: false,
5739
+ * icon: 'alert-circle-outline',
5740
+ * buttonText: 'locale.empty.button',
5741
+ * link: ''
5742
+ * }
5743
+ * @memberOf ListComponent
5744
+ */
5745
+ empty: Partial<IListEmptyOptions>;
5030
5746
  /**
5031
5747
  * @description The current page number in paginated mode.
5032
5748
  * @summary Tracks which page is currently being displayed when the component
@@ -5086,6 +5802,7 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
5086
5802
  * @memberOf ListComponent
5087
5803
  */
5088
5804
  searchValue?: string | IFilterQuery | undefined;
5805
+ searching: boolean;
5089
5806
  /**
5090
5807
  * @description A paginator object for handling pagination operations.
5091
5808
  * @summary Provides a paginator object that can be used to retrieve and navigate
@@ -5566,8 +6283,9 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
5566
6283
  * @memberOf ListComponent
5567
6284
  */
5568
6285
  mapResults(data: KeyValue[]): KeyValue[];
6286
+ parseSearchValue(): string | IFilterQuery;
5569
6287
  static ɵfac: i0.ɵɵFactoryDeclaration<ListComponent, never>;
5570
- static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ngx-decaf-list", never, { "type": { "alias": "type"; "required": false; }; "showSearchbar": { "alias": "showSearchbar"; "required": false; }; "data": { "alias": "data"; "required": false; }; "source": { "alias": "source"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "loadMoreData": { "alias": "loadMoreData"; "required": false; }; "lines": { "alias": "lines"; "required": false; }; "inset": { "alias": "inset"; "required": false; }; "scrollThreshold": { "alias": "scrollThreshold"; "required": false; }; "scrollPosition": { "alias": "scrollPosition"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "showRefresher": { "alias": "showRefresher"; "required": false; }; "loadingSpinner": { "alias": "loadingSpinner"; "required": false; }; "enableFilter": { "alias": "enableFilter"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; "emptyIcon": { "alias": "emptyIcon"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, { "refreshEvent": "refreshEvent"; "clickEvent": "clickEvent"; }, never, ["*"], true, never>;
6288
+ static ɵcmp: i0.ɵɵComponentDeclaration<ListComponent, "ngx-decaf-list", never, { "type": { "alias": "type"; "required": false; }; "showSearchbar": { "alias": "showSearchbar"; "required": false; }; "data": { "alias": "data"; "required": false; }; "source": { "alias": "source"; "required": false; }; "start": { "alias": "start"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; "loadMoreData": { "alias": "loadMoreData"; "required": false; }; "lines": { "alias": "lines"; "required": false; }; "inset": { "alias": "inset"; "required": false; }; "scrollThreshold": { "alias": "scrollThreshold"; "required": false; }; "scrollPosition": { "alias": "scrollPosition"; "required": false; }; "loadingText": { "alias": "loadingText"; "required": false; }; "showRefresher": { "alias": "showRefresher"; "required": false; }; "loadingSpinner": { "alias": "loadingSpinner"; "required": false; }; "enableFilter": { "alias": "enableFilter"; "required": false; }; "sortDirection": { "alias": "sortDirection"; "required": false; }; "sortBy": { "alias": "sortBy"; "required": false; }; "disableSort": { "alias": "disableSort"; "required": false; }; "empty": { "alias": "empty"; "required": false; }; }, { "refreshEvent": "refreshEvent"; "clickEvent": "clickEvent"; }, never, ["*"], true, never>;
5571
6289
  }
5572
6290
 
5573
6291
  /**
@@ -5619,7 +6337,7 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
5619
6337
  * C->>C: Process action
5620
6338
  * C->>V: Update view or navigate
5621
6339
  */
5622
- declare class ListItemComponent extends NgxDecafComponentDirective implements OnInit {
6340
+ declare class ListItemComponent extends NgxComponentDirective implements OnInit {
5623
6341
  /**
5624
6342
  * @description Reference to the action menu popover component.
5625
6343
  * @summary ViewChild reference that provides access to the HTMLIonPopoverElement
@@ -5765,17 +6483,6 @@ declare class ListItemComponent extends NgxDecafComponentDirective implements On
5765
6483
  * @memberOf ListItemComponent
5766
6484
  */
5767
6485
  actionMenuOpen: boolean;
5768
- /**
5769
- * @description Angular NavController service for handling navigation.
5770
- * @summary Injected service that provides methods for programmatic navigation
5771
- * within the Ionic application. Used for navigating to different routes when
5772
- * list item actions are performed or when the item itself is clicked.
5773
- *
5774
- * @private
5775
- * @type {NavController}
5776
- * @memberOf ListItemComponent
5777
- */
5778
- private navController;
5779
6486
  /**
5780
6487
  * @description Creates an instance of ListItemComponent.
5781
6488
  * @summary Initializes a new ListItemComponent by calling the parent class constructor
@@ -5830,7 +6537,7 @@ declare class ListItemComponent extends NgxDecafComponentDirective implements On
5830
6537
  * participant U as User
5831
6538
  * participant L as ListItemComponent
5832
6539
  * participant P as Parent Component
5833
- * participant N as NavController
6540
+ * participant N as Router
5834
6541
  * participant E as Event System
5835
6542
  *
5836
6543
  * U->>L: Perform action (click/swipe)
@@ -5910,7 +6617,7 @@ declare class ListItemComponent extends NgxDecafComponentDirective implements On
5910
6617
  /**
5911
6618
  * @description Navigates to a new route based on the specified action and item ID.
5912
6619
  * @summary This method constructs a navigation URL using the component's route configuration,
5913
- * the specified action, and an item identifier. It uses Ionic's NavController to perform
6620
+ * the specified action, and an item identifier. It uses Ionic's Router to perform
5914
6621
  * forward navigation with appropriate animations. This method is typically used for
5915
6622
  * CRUD operations where each action (create, read, update, delete) has its own route.
5916
6623
  *
@@ -5921,7 +6628,7 @@ declare class ListItemComponent extends NgxDecafComponentDirective implements On
5921
6628
  * @mermaid
5922
6629
  * sequenceDiagram
5923
6630
  * participant L as ListItemComponent
5924
- * participant N as NavController
6631
+ * participant N as Router
5925
6632
  * participant R as Router
5926
6633
  *
5927
6634
  * L->>L: redirect(action, id)
@@ -6004,7 +6711,7 @@ declare class ListItemComponent extends NgxDecafComponentDirective implements On
6004
6711
  * ModelRenderer->>ModelRenderer: Subscribe to events
6005
6712
  * ModelRenderer-->>App: Emit events
6006
6713
  */
6007
- declare class ModelRendererComponent<M extends Model> extends NgxDecafComponentDirective implements OnChanges, OnDestroy, IRenderedModel {
6714
+ declare class ModelRendererComponent<M extends Model> extends NgxComponentDirective implements OnChanges, OnDestroy, IRenderedModel {
6008
6715
  /**
6009
6716
  * @description Global variables to be passed to the rendered component
6010
6717
  */
@@ -6111,7 +6818,7 @@ declare class ModelRendererComponent<M extends Model> extends NgxDecafComponentD
6111
6818
  * @extends {NgxBaseComponentDirective}
6112
6819
  * @implements {OnInit}
6113
6820
  */
6114
- declare class PaginationComponent extends NgxDecafComponentDirective implements OnInit {
6821
+ declare class PaginationComponent extends NgxComponentDirective implements OnInit {
6115
6822
  /**
6116
6823
  * @description The total number of pages to display in the pagination component.
6117
6824
  * @summary Specifies the total number of pages available for navigation. This is a required
@@ -6343,7 +7050,7 @@ declare class PaginationComponent extends NgxDecafComponentDirective implements
6343
7050
  * @implements {OnInit}
6344
7051
  * @memberOf SearchbarComponent
6345
7052
  */
6346
- declare class SearchbarComponent extends NgxDecafComponentDirective implements OnInit {
7053
+ declare class SearchbarComponent extends NgxComponentDirective implements OnInit {
6347
7054
  /**
6348
7055
  * @description The mode of the searchbar.
6349
7056
  * @summary Determines the visual style of the searchbar, either iOS or Material Design.
@@ -6781,7 +7488,10 @@ declare class SteppedFormComponent extends NgxParentComponentDirective implement
6781
7488
  * @default 1
6782
7489
  * @memberOf SteppedFormComponent
6783
7490
  */
6784
- pages: number;
7491
+ pages: number | {
7492
+ title: string;
7493
+ description: string;
7494
+ }[];
6785
7495
  /**
6786
7496
  * List of titles and descriptions for each page of the stepped form.
6787
7497
  * Each object in the array represents a page, containing a title and a description.
@@ -6879,17 +7589,6 @@ declare class SteppedFormComponent extends NgxParentComponentDirective implement
6879
7589
  * @memberOf SteppedFormComponent
6880
7590
  */
6881
7591
  private timerSubscription;
6882
- /**
6883
- * @description Angular Location service.
6884
- * @summary Injected service that provides access to the browser's URL and history.
6885
- * This service is used for interacting with the browser's history API, allowing
6886
- * for back navigation and URL manipulation outside of Angular's router.
6887
- *
6888
- * @private
6889
- * @type {Location}
6890
- * @memberOf CrudFormComponent
6891
- */
6892
- private location;
6893
7592
  /**
6894
7593
  * @description Event emitter for form submission.
6895
7594
  * @summary Emits events when the form is submitted, typically on the last page
@@ -7236,58 +7935,107 @@ declare function getLocaleLanguage(): string;
7236
7935
  */
7237
7936
  declare function generateRandomValue(length?: number, onlyNumbers?: boolean): string;
7238
7937
  /**
7239
- * Converts a string representation of a boolean or a boolean value to a boolean type.
7938
+ * @description Converts a string representation of a boolean or a boolean value to a boolean type.
7939
+ * @summary This utility function handles conversion of string-based boolean values ('true', 'false')
7940
+ * to actual boolean types. It performs case-insensitive string comparison and returns the
7941
+ * corresponding boolean value. This is particularly useful when parsing configuration values,
7942
+ * URL parameters, or form inputs that may come as strings but need to be used as booleans.
7240
7943
  *
7241
- * @export
7242
- * @param {('true' | 'false' | boolean)} prop - The value to convert. Can be the string 'true', 'false', or a boolean.
7243
- * @returns {boolean} The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise.
7944
+ * @param {'true' | 'false' | boolean} prop - The value to convert. Can be the string 'true', 'false', or a boolean
7945
+ * @returns {boolean} The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise
7946
+ *
7947
+ * @function stringToBoolean
7948
+ * @memberOf module:lib/helpers/utils
7244
7949
  */
7245
7950
  declare function stringToBoolean(prop: 'true' | 'false' | boolean): boolean;
7246
7951
  /**
7247
- * Checks if a value is a valid Date object
7952
+ * @description Checks if a value is a valid Date object.
7953
+ * @summary This validation function determines whether a given value represents a valid date.
7954
+ * It handles multiple input types including Date objects, timestamp numbers, and date strings.
7955
+ * For string inputs, it supports ISO 8601 format (YYYY-MM-DD) with or without time components.
7956
+ * The function performs comprehensive validation including regex pattern matching and Date
7957
+ * object creation to ensure the date is not only parseable but also represents a real date.
7958
+ *
7959
+ * @param {string | Date | number} date - The value to check. Can be a Date object, a timestamp number, or a date string
7960
+ * @returns {boolean} Returns true if the value is a valid Date object (not NaN), otherwise false
7248
7961
  *
7249
- * @param {(string | Date | number)} date - The value to check. Can be a Date object, a timestamp number, or a date string
7250
- * @return {boolean} Returns true if the value is a valid Date object (not NaN), otherwise false
7962
+ * @function isValidDate
7963
+ * @memberOf module:lib/helpers/utils
7251
7964
  */
7252
7965
  declare function isValidDate(date: string | Date | number): boolean;
7253
7966
  /**
7254
- * Formats a date into a localized string representation
7967
+ * @description Formats a date into a localized string representation.
7968
+ * @summary This function converts a date value into a formatted string according to a specified
7969
+ * or system locale. It accepts multiple input formats (Date objects, timestamps, or date strings)
7970
+ * and returns a consistently formatted date string in DD/MM/YYYY format. If the input date is
7971
+ * invalid, the function returns the original input as a string. The function automatically
7972
+ * uses the system locale if none is provided and handles string format conversions by replacing
7973
+ * forward slashes with hyphens for proper Date parsing.
7255
7974
  *
7256
- * @param {(string | Date | number)} date - The date to format. Can be a Date object, a timestamp number, or a date string
7975
+ * @param {string | Date | number} date - The date to format. Can be a Date object, a timestamp number, or a date string
7257
7976
  * @param {string} [locale] - The locale to use for formatting. If not provided, the system's locale will be used
7258
- * @return {(Date | string)} A formatted date string in the format DD/MM/YYYY according to the specified locale,
7259
- * or the original input as a string if the date is invalid
7977
+ * @returns {Date | string} A formatted date string in the format DD/MM/YYYY according to the specified locale,
7978
+ * or the original input as a string if the date is invalid
7979
+ *
7980
+ * @function formatDate
7981
+ * @memberOf module:lib/helpers/utils
7260
7982
  */
7261
7983
  declare function formatDate(date: string | Date | number, locale?: string | undefined): Date | string;
7262
7984
  /**
7263
- * Attempts to parse a date string, Date object, or number into a valid Date object
7985
+ * @description Attempts to parse a date string, Date object, or number into a valid Date object.
7986
+ * @summary This function provides robust date parsing functionality that handles the specific
7987
+ * format "DD/MM/YYYY HH:MM:SS:MS". It first validates the input date, and if already valid,
7988
+ * returns it as-is. For string inputs, it parses the date and time components separately,
7989
+ * extracts numeric values, and constructs a new Date object. The function includes validation
7990
+ * to ensure the resulting Date object is valid and logs a warning if parsing fails.
7991
+ * Returns null for invalid or unsupported date formats.
7992
+ *
7993
+ * @param {string | Date | number} date - The date to parse. Can be a Date object, a timestamp number,
7994
+ * or a date string in the format "DD/MM/YYYY HH:MM:SS:MS"
7995
+ * @returns {Date | null} A valid Date object if parsing is successful, or null if the date is invalid
7996
+ * or doesn't match the expected format
7264
7997
  *
7265
- * @param {(string | Date | number)} date - The date to parse. Can be a Date object, a timestamp number,
7266
- * or a date string in the format "DD/MM/YYYY HH:MM:SS:MS"
7267
- * @return {(Date | null)} A valid Date object if parsing is successful, or null if the date is invalid
7268
- * or doesn't match the expected format
7998
+ * @function parseToValidDate
7999
+ * @memberOf module:lib/helpers/utils
7269
8000
  */
7270
8001
  declare function parseToValidDate(date: string | Date | number): Date | null;
7271
8002
  /**
7272
- * Maps an item object using a provided mapper object and optional additional properties.
8003
+ * @description Maps an item object using a provided mapper object and optional additional properties.
8004
+ * @summary This function transforms a source object into a new object based on mapping rules defined
8005
+ * in the mapper parameter. It supports dot notation for nested property access (e.g., 'user.name.first')
8006
+ * and handles various data types including strings and complex objects. For date values, it automatically
8007
+ * formats them using the formatDate function. The function also allows merging additional properties
8008
+ * into the result. When a mapped value is null or undefined, it uses the original mapper value as
8009
+ * a fallback.
7273
8010
  *
7274
- * @param {KeyValue} item - The source object to be mapped.
8011
+ * @param {KeyValue} item - The source object to be mapped
7275
8012
  * @param {KeyValue} mapper - An object that defines the mapping rules. Keys represent the new property names,
7276
- * and values represent the path to the corresponding values in the source object.
7277
- * @param {KeyValue} [props] - Optional additional properties to be included in the mapped object.
7278
- * @returns {KeyValue} A new object with properties mapped according to the mapper object and including any additional properties.
8013
+ * and values represent the path to the corresponding values in the source object
8014
+ * @param {KeyValue} [props] - Optional additional properties to be included in the mapped object
8015
+ * @returns {KeyValue} A new object with properties mapped according to the mapper object and including any additional properties
8016
+ *
8017
+ * @function itemMapper
8018
+ * @memberOf module:lib/helpers/utils
7279
8019
  */
7280
8020
  declare function itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue;
7281
8021
  /**
7282
- * Maps an array of data objects using a provided mapper object.
8022
+ * @description Maps an array of data objects using a provided mapper object.
8023
+ * @summary This function transforms an array of objects by applying mapping rules to each item
8024
+ * using the itemMapper function. It processes each element in the data array and creates
8025
+ * new mapped objects based on the mapper configuration. The function includes validation
8026
+ * to ensure meaningful data: if a mapped item contains only null/undefined values, it
8027
+ * preserves the original item instead. This prevents data loss during transformation.
8028
+ * Returns an empty array if the input data is null, undefined, or empty.
7283
8029
  *
7284
- * @template T - The type of the resulting mapped items.
7285
- * @param {any[]} data - The array of data objects to be mapped.
7286
- * @param {KeyValue} mapper - An object that defines the mapping rules.
7287
- * @param {KeyValue} [props] - Additional properties to be included in the mapped items.
8030
+ * @template T - The type of the resulting mapped items
8031
+ * @param {T[]} data - The array of data objects to be mapped
8032
+ * @param {KeyValue} mapper - An object that defines the mapping rules
8033
+ * @param {KeyValue} [props] - Additional properties to be included in the mapped items
8034
+ * @returns {T[]} The array of mapped items. If an item in the original array does not have any non-null values after mapping,
8035
+ * the original item is returned instead
7288
8036
  *
7289
- * @returns {T[]} - The array of mapped items. If an item in the original array does not have any non-null values after mapping,
7290
- * the original item is returned instead.
8037
+ * @function dataMapper
8038
+ * @memberOf module:lib/helpers/utils
7291
8039
  */
7292
8040
  declare function dataMapper<T>(data: T[], mapper: KeyValue, props?: KeyValue): T[];
7293
8041
  /**
@@ -7383,39 +8131,152 @@ declare function provideI18n(config?: RootTranslateServiceConfig, resources?: I1
7383
8131
  } | i0.EnvironmentProviders | i0.Provider[])[];
7384
8132
 
7385
8133
  /**
7386
- * @module module:lib/for-angular-common.module
8134
+ * @module lib/for-angular-common.module
7387
8135
  * @description Core Angular module and providers for Decaf's for-angular package.
7388
8136
  * @summary Provides the shared Angular module, injection tokens and helper functions used
7389
8137
  * by the for-angular integration. This module wires up common imports (forms, translation)
7390
8138
  * and exposes helper providers such as DB adapter registration and logger utilities.
7391
- *
7392
8139
  * @link {@link ForAngularCommonModule}
7393
8140
  */
7394
8141
 
7395
- /** */
7396
8142
  declare const DB_ADAPTER_PROVIDER = "DB_ADAPTER_PROVIDER";
8143
+ /**
8144
+ * @description Injection token for registering the database adapter provider.
8145
+ * @summary Used to inject the database adapter instance that implements DecafRepositoryAdapter.
8146
+ * This token allows the framework to locate and use the application's specific database implementation.
8147
+ * @const {InjectionToken<DecafRepositoryAdapter>}
8148
+ * @memberOf module:lib/for-angular-common.module
8149
+ */
7397
8150
  declare const DB_ADAPTER_PROVIDER_TOKEN: InjectionToken<DecafRepositoryAdapter>;
8151
+ /**
8152
+ * @description Injection token for the root path of locale translation files.
8153
+ * @summary Used to configure the base path where i18n translation files are located.
8154
+ * This allows the translation loader to locate JSON files for different languages.
8155
+ * @const {InjectionToken<string>}
8156
+ * @memberOf module:lib/for-angular-common.module
8157
+ * @example
8158
+ * // Typical usage when providing the token
8159
+ * { provide: LOCALE_ROOT_TOKEN, useValue: './assets/i18n/' }
8160
+ */
7398
8161
  declare const LOCALE_ROOT_TOKEN: InjectionToken<string>;
8162
+ /**
8163
+ * @description Generic injection token for providing arbitrary values to constructors.
8164
+ * @summary Used to inject classes, strings, or any other value into component or service constructors.
8165
+ * This is a flexible token that can be used to provide any type of dependency when more specific
8166
+ * tokens are not appropriate. The actual type and purpose of the injected value is determined by
8167
+ * the provider configuration.
8168
+ * @const {InjectionToken<unknown>}
8169
+ * @memberOf module:lib/for-angular-common.module
8170
+ * @example
8171
+ * // Inject a string value
8172
+ * { provide: CPTKN, useValue: 'some-config-value' }
8173
+ *
8174
+ * // Inject a class
8175
+ * { provide: CPTKN, useClass: MyService }
8176
+ *
8177
+ * // Inject any arbitrary value
8178
+ * { provide: CPTKN, useValue: { key: 'value', data: [1, 2, 3] } }
8179
+ */
7399
8180
  declare const CPTKN: InjectionToken<unknown>;
8181
+ /**
8182
+ * @description Injection token for i18n resource configuration.
8183
+ * @summary Used to provide configuration for internationalization resources, including
8184
+ * translation file locations and supported languages. This token configures how the
8185
+ * application loads and manages translation resources.
8186
+ * @const {InjectionToken<{resources: I18nResourceConfig[]; versionedSuffix: boolean}>}
8187
+ * @memberOf module:lib/for-angular-common.module
8188
+ */
7400
8189
  declare const I18N_CONFIG_TOKEN: InjectionToken<{
7401
8190
  resources: I18nResourceConfig[];
7402
8191
  versionedSuffix: boolean;
7403
8192
  }>;
8193
+ /**
8194
+ * @description Provides an array of component types for dynamic rendering.
8195
+ * @summary Helper function to package component constructors for registration with the
8196
+ * rendering engine. This function accepts component classes and returns them as an array
8197
+ * suitable for use with the CPTKN injection token.
8198
+ * @param {...Constructor<unknown>[]} components - Component constructor classes to register
8199
+ * @return {Constructor<unknown>[]} Array of component constructors
8200
+ * @memberOf module:lib/for-angular-common.module
8201
+ * @example
8202
+ * // Register multiple custom components
8203
+ * providers: [
8204
+ * { provide: CPTKN, useValue: provideDynamicComponents(MyComponent, AnotherComponent) }
8205
+ * ]
8206
+ */
8207
+ declare function provideDynamicComponents(...components: Constructor<unknown>[]): Constructor<unknown>[];
8208
+ /**
8209
+ * @description Retrieves the repository instance for a given model.
8210
+ * @summary Creates or retrieves a DecafRepository instance for the specified model. This function
8211
+ * resolves the model by name or class, locates the registered database adapter, and returns
8212
+ * a fully initialized repository instance for performing CRUD operations.
8213
+ * @param {Model | string} model - The model class or model name string
8214
+ * @return {DecafRepository<Model>} Repository instance for the model
8215
+ * @throws {InternalError} If model is not found or not registered with @model decorator
8216
+ * @memberOf module:lib/for-angular-common.module
8217
+ * @example
8218
+ * // Get repository by model class
8219
+ * const userRepo = getModelRepository(User);
8220
+ *
8221
+ * // Get repository by model name
8222
+ * const productRepo = getModelRepository('Product');
8223
+ *
8224
+ * // Use repository for queries
8225
+ * const users = await userRepo.findAll();
8226
+ */
7404
8227
  declare function getModelRepository(model: Model | string): DecafRepository<Model>;
8228
+ /**
8229
+ * @description Provides a database adapter for dependency injection.
8230
+ * @summary Creates an Angular provider that registers a database adapter instance. This function
8231
+ * instantiates the adapter class, registers its flavour globally, and returns a provider object
8232
+ * for use in Angular's dependency injection system.
8233
+ * @template DbAdapter - The database adapter class type extending {flavour: string}
8234
+ * @param {Constructor<DbAdapter>} adapterClass - Database adapter constructor class
8235
+ * @param {KeyValue} [options={}] - Configuration options passed to adapter constructor
8236
+ * @param {string} [flavour] - Optional flavour override; uses adapter.flavour if not provided
8237
+ * @return {Provider} Angular provider object for DB_ADAPTER_PROVIDER_TOKEN
8238
+ * @memberOf module:lib/for-angular-common.module
8239
+ * @example
8240
+ * // Register a SQLite adapter
8241
+ * providers: [
8242
+ * provideDbAdapter(SqliteAdapter, { database: 'myapp.db' }, 'sqlite')
8243
+ * ]
8244
+ *
8245
+ * // Register with default flavour from adapter
8246
+ * providers: [
8247
+ * provideDbAdapter(PostgresAdapter, { host: 'localhost', port: 5432 })
8248
+ * ]
8249
+ */
7405
8250
  declare function provideDbAdapter<DbAdapter extends {
7406
8251
  flavour: string;
7407
8252
  }>(adapterClass: Constructor<DbAdapter>, options?: KeyValue, flavour?: string): Provider;
8253
+ /**
8254
+ * @description Retrieves a logger instance for the given context.
8255
+ * @summary Creates or retrieves a namespaced logger instance using the Decaf logging system.
8256
+ * The logger is automatically namespaced under "for-angular" and can be further scoped
8257
+ * to a specific instance, function, or string identifier.
8258
+ * @param {string | FunctionLike | unknown} instance - The instance, function, or string to scope the logger to
8259
+ * @return {Logger} Logger instance for the specified context
8260
+ * @memberOf module:lib/for-angular-common.module
8261
+ * @example
8262
+ * // Get logger for a class
8263
+ * const logger = getLogger(MyComponent);
8264
+ * logger.info('Component initialized');
8265
+ *
8266
+ * // Get logger with string identifier
8267
+ * const serviceLogger = getLogger('UserService');
8268
+ * serviceLogger.error('Operation failed', error);
8269
+ */
7408
8270
  declare function getLogger(instance: string | FunctionLike | unknown): Logger;
7409
8271
  /**
7410
- * @description Main Angular module for the Decaf framework
8272
+ * @description Main Angular module for the Decaf framework.
7411
8273
  * @summary The ForAngularCommonModule provides the core functionality for integrating Decaf with Angular applications.
7412
8274
  * It imports and exports common Angular and Ionic components and modules needed for Decaf applications,
7413
8275
  * including form handling, translation support, and Ionic UI components. This module can be imported
7414
8276
  * directly or via the forRoot() method for proper initialization in the application's root module.
7415
- *
7416
8277
  * @class ForAngularCommonModule
8278
+ * @memberOf module:lib/for-angular-common.module
7417
8279
  * @example
7418
- * ```typescript
7419
8280
  * // In your app module:
7420
8281
  * @NgModule({
7421
8282
  * imports: [
@@ -7425,17 +8286,24 @@ declare function getLogger(instance: string | FunctionLike | unknown): Logger;
7425
8286
  * // ...
7426
8287
  * })
7427
8288
  * export class AppModule {}
7428
- * ```
7429
8289
  */
7430
8290
  declare class ForAngularCommonModule {
7431
8291
  /**
7432
- * @description Creates a module with providers for root module import
8292
+ * @description Creates a module with providers for root module import.
7433
8293
  * @summary This static method provides the proper way to import the ForAngularCommonModule in the application's
7434
8294
  * root module. It returns a ModuleWithProviders object that includes the ForAngularCommonModule itself.
7435
8295
  * Using forRoot() ensures that the module and its providers are properly initialized and only
7436
8296
  * instantiated once in the application.
7437
- *
7438
8297
  * @return {ModuleWithProviders<ForAngularCommonModule>} The module with its providers
8298
+ * @memberOf ForAngularCommonModule
8299
+ * @static
8300
+ * @example
8301
+ * // Import in root module
8302
+ * @NgModule({
8303
+ * imports: [ForAngularCommonModule.forRoot()],
8304
+ * // ...
8305
+ * })
8306
+ * export class AppModule {}
7439
8307
  */
7440
8308
  static forRoot(): ModuleWithProviders<ForAngularCommonModule>;
7441
8309
  static ɵfac: i0.ɵɵFactoryDeclaration<ForAngularCommonModule, never>;
@@ -7443,5 +8311,5 @@ declare class ForAngularCommonModule {
7443
8311
  static ɵinj: i0.ɵɵInjectorDeclaration<ForAngularCommonModule>;
7444
8312
  }
7445
8313
 
7446
- export { AngularEngineKeys, BaseComponentProps, CPTKN, CollapsableDirective, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DefaultFormReactiveOptions, Dynamic, DynamicModule, EmptyStateComponent, EventConstants, FieldsetComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, LOCALE_ROOT_TOKEN, LayoutComponent, ListComponent, ListComponentsTypes, ListItemComponent, LoggerLevels, ModelRendererComponent, NgxDecafComponentDirective, NgxDecafFormFieldDirective, NgxDecafFormService, NgxEventHandler, NgxPageDirective, NgxRenderingEngine, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, cleanSpaces, dataMapper, formatDate, generateRandomValue, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelRepository, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, provideDbAdapter, provideI18n, provideI18nLoader, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
7447
- export type { AngularDynamicOutput, AngularFieldDefinition, CheckboxOption, ComponentMetadata, CrudFieldOption, DecafRepository, DecafRepositoryAdapter, ElementPositions, ElementSizes, FieldUpdateMode, FlexPositions, FormParent, FormParentGroup, FormServiceControl, FormServiceControls, FunctionLike, HTMLFormTarget, HandlerLike, I18nResourceConfig, I18nResourceConfigType, IBaseCustomEvent, IComponentConfig, IComponentHolder, IComponentInput, ICrudFormEvent, ICrudFormOptions, IFieldSetItem, IFieldSetValidationEvent, IFilterQuery, IFilterQueryItem, IFormElement, IFormReactiveSubmitEvent, IListComponentRefreshEvent, IListEmptyResult, IMenuItem, IPaginationCustomEvent, IRenderedModel, ISortObject, InputOption, KeyValue, ListItemCustomEvent, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean };
8314
+ export { AngularEngineKeys, BaseComponentProps, CPTKN, CollapsableDirective, ComponentRendererComponent, ComponentsTagNames, CrudFieldComponent, CrudFormComponent, CssClasses, DB_ADAPTER_PROVIDER, DB_ADAPTER_PROVIDER_TOKEN, DefaultFormReactiveOptions, DefaultListEmptyOptions, Dynamic, DynamicModule, EmptyStateComponent, EventConstants, FieldsetComponent, FilterComponent, ForAngularCommonModule, ForAngularComponentsModule, FormConstants, I18N_CONFIG_TOKEN, I18nLoader, I18nLoaderFactory, I18nParser, LOCALE_ROOT_TOKEN, LayoutComponent, ListComponent, ListComponentsTypes, ListItemComponent, LoggerLevels, ModelRendererComponent, NgxComponentDirective, NgxEventHandler, NgxFormDirective, NgxFormFieldDirective, NgxFormService, NgxMediaDirective, NgxModelPageDirective, NgxPageDirective, NgxParentComponentDirective, NgxRenderingEngine, PaginationComponent, RouteDirections, SearchbarComponent, SteppedFormComponent, cleanSpaces, dataMapper, formatDate, generateRandomValue, getInjectablesRegistry, getLocaleContext, getLocaleContextByKey, getLocaleFromClassName, getLocaleLanguage, getLogger, getModelRepository, getOnWindow, getOnWindowDocument, getWindow, getWindowDocument, getWindowWidth, isDarkMode, isDevelopmentMode, isNotUndefined, isValidDate, itemMapper, parseToValidDate, provideDbAdapter, provideDynamicComponents, provideI18n, provideI18nLoader, removeFocusTrap, setOnWindow, stringToBoolean, windowEventEmitter };
8315
+ export type { AngularDynamicOutput, AngularFieldDefinition, CheckboxOption, ComponentMetadata, CrudFieldOption, DecafRepository, DecafRepositoryAdapter, ElementPositions, ElementSizes, FieldUpdateMode, FlexPositions, FormParent, FormParentGroup, FormServiceControl, FormServiceControls, FunctionLike, HTMLFormTarget, HandlerLike, I18nResourceConfig, I18nResourceConfigType, IBaseCustomEvent, IComponentConfig, IComponentHolder, IComponentInput, ICrudFormEvent, ICrudFormOptions, IFieldSetItem, IFieldSetValidationEvent, IFilterQuery, IFilterQueryItem, IFormElement, IFormReactiveSubmitEvent, IListComponentRefreshEvent, IListEmptyOptions, IMenuItem, IModelPageCustomEvent, IPaginationCustomEvent, IRenderedModel, ISortObject, IWindowResizeEvent, InputOption, KeyValue, ListItemCustomEvent, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean, WindowColorScheme };