@decaf-ts/for-angular 0.0.36 → 0.0.37
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/fesm2022/decaf-ts-for-angular.mjs +997 -719
- package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
- package/index.d.ts +1173 -591
- package/package.json +3 -2
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,
|
|
2
|
+
import { ElementRef, Type, Injector, EnvironmentInjector, ComponentMirror, ViewContainerRef, ComponentRef, TemplateRef, OnChanges, ChangeDetectorRef, Renderer2, EventEmitter, SimpleChanges, AfterViewInit, OnInit, OnDestroy, 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,6 +11,8 @@ 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';
|
|
@@ -18,7 +20,6 @@ import { IonAccordionGroup, ItemReorderEventDetail } from '@ionic/angular/standa
|
|
|
18
20
|
import { Subscription, Observable } 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
|
|
@@ -194,12 +195,10 @@ type FormParentGroup = [FormParent, string];
|
|
|
194
195
|
type I18nResourceConfigType = I18nResourceConfig | I18nResourceConfig[];
|
|
195
196
|
|
|
196
197
|
/**
|
|
197
|
-
* @module
|
|
198
|
+
* @module lib/engine/interfaces
|
|
198
199
|
* @description Type and interface definitions used by the Angular rendering engine.
|
|
199
200
|
* @summary Exposes interfaces for component input metadata, rendering outputs, form events,
|
|
200
201
|
* and supporting types used across the engine and components.
|
|
201
|
-
*
|
|
202
|
-
* @link {@link AngularDynamicOutput}
|
|
203
202
|
*/
|
|
204
203
|
|
|
205
204
|
/**
|
|
@@ -326,6 +325,9 @@ interface IComponentInput extends FieldProperties {
|
|
|
326
325
|
formControl?: FormControl;
|
|
327
326
|
model?: Model | string;
|
|
328
327
|
operation?: CrudOperationKeys | undefined;
|
|
328
|
+
pages?: number;
|
|
329
|
+
cols?: number;
|
|
330
|
+
rows?: number;
|
|
329
331
|
}
|
|
330
332
|
/**
|
|
331
333
|
* @description Component configuration structure
|
|
@@ -392,6 +394,7 @@ interface AngularDynamicOutput {
|
|
|
392
394
|
children?: AngularDynamicOutput[];
|
|
393
395
|
instance?: Type<unknown>;
|
|
394
396
|
formGroup?: FormGroup;
|
|
397
|
+
page?: number;
|
|
395
398
|
formControl?: FormControl;
|
|
396
399
|
projectable?: boolean;
|
|
397
400
|
}
|
|
@@ -473,10 +476,13 @@ interface IBaseCustomEvent {
|
|
|
473
476
|
target?: HTMLElement;
|
|
474
477
|
}
|
|
475
478
|
/**
|
|
476
|
-
* Configuration for internationalization (i18n) resource file paths
|
|
477
|
-
*
|
|
478
|
-
*
|
|
479
|
-
* @
|
|
479
|
+
* @description Configuration for internationalization (i18n) resource file paths
|
|
480
|
+
* @summary Defines the structure for configuring i18n resource file paths with prefix and suffix.
|
|
481
|
+
* Used by the translation system to locate and load language resource files.
|
|
482
|
+
* @interface I18nResourceConfig
|
|
483
|
+
* @property {string} prefix - The prefix to be used for the resource file path
|
|
484
|
+
* @property {string} suffix - The suffix to be appended to the resource file path
|
|
485
|
+
* @memberOf module:engine
|
|
480
486
|
*/
|
|
481
487
|
interface I18nResourceConfig {
|
|
482
488
|
prefix: string;
|
|
@@ -486,8 +492,12 @@ interface I18nResourceConfig {
|
|
|
486
492
|
* @description CRUD form event type
|
|
487
493
|
* @summary Extends IBaseCustomEvent to include optional handlers for CRUD form operations.
|
|
488
494
|
* This event type is used for form-related actions like create, read, update, and delete operations.
|
|
489
|
-
* @
|
|
490
|
-
* @property {Record<string,
|
|
495
|
+
* @interface ICrudFormEvent
|
|
496
|
+
* @property {Record<string, unknown>} [handlers] - Optional handlers for form operations
|
|
497
|
+
* @property {string} name - The name of the event (inherited from IBaseCustomEvent)
|
|
498
|
+
* @property {string} [component] - The component that triggered the event (inherited from IBaseCustomEvent)
|
|
499
|
+
* @property {unknown} [data] - The data associated with the event (inherited from IBaseCustomEvent)
|
|
500
|
+
* @property {HTMLElement} [target] - The target element (inherited from IBaseCustomEvent)
|
|
491
501
|
* @memberOf module:engine
|
|
492
502
|
*/
|
|
493
503
|
interface ICrudFormEvent extends IBaseCustomEvent {
|
|
@@ -498,6 +508,9 @@ interface ICrudFormEvent extends IBaseCustomEvent {
|
|
|
498
508
|
* @summary Event emitted by pagination components to signal page navigation.
|
|
499
509
|
* Extends IBaseCustomEvent and carries a payload with the target page number and navigation direction.
|
|
500
510
|
* @interface IPaginationCustomEvent
|
|
511
|
+
* @property {Object} data - The pagination data payload
|
|
512
|
+
* @property {number} data.page - The target page number
|
|
513
|
+
* @property {'next' | 'previous'} data.direction - The navigation direction
|
|
501
514
|
* @memberOf module:engine
|
|
502
515
|
*/
|
|
503
516
|
interface IPaginationCustomEvent extends IBaseCustomEvent {
|
|
@@ -511,6 +524,11 @@ interface IPaginationCustomEvent extends IBaseCustomEvent {
|
|
|
511
524
|
* @summary Represents a single item in a navigation or contextual menu.
|
|
512
525
|
* Includes the visible label and optional metadata such as accessibility title, target URL, icon, and color.
|
|
513
526
|
* @interface IMenuItem
|
|
527
|
+
* @property {string} label - The visible text label for the menu item
|
|
528
|
+
* @property {string} [title] - Optional accessibility title or tooltip text
|
|
529
|
+
* @property {string} [url] - Optional target URL for navigation
|
|
530
|
+
* @property {string} [icon] - Optional icon identifier to display with the menu item
|
|
531
|
+
* @property {string} [color] - Optional color theme for the menu item
|
|
514
532
|
* @memberOf module:engine
|
|
515
533
|
*/
|
|
516
534
|
interface IMenuItem {
|
|
@@ -520,9 +538,33 @@ interface IMenuItem {
|
|
|
520
538
|
icon?: string;
|
|
521
539
|
color?: string;
|
|
522
540
|
}
|
|
541
|
+
/**
|
|
542
|
+
* @description Form reactive submit event data
|
|
543
|
+
* @summary Defines the structure of data emitted when a reactive form is submitted.
|
|
544
|
+
* Contains the processed form data as key-value pairs.
|
|
545
|
+
* @interface IFormReactiveSubmitEvent
|
|
546
|
+
* @property {Record<string, unknown>} data - The form data as key-value pairs
|
|
547
|
+
* @memberOf module:engine
|
|
548
|
+
*/
|
|
523
549
|
interface IFormReactiveSubmitEvent {
|
|
524
550
|
data: Record<string, unknown>;
|
|
525
551
|
}
|
|
552
|
+
/**
|
|
553
|
+
* @description CRUD form options configuration
|
|
554
|
+
* @summary Defines the configuration options for CRUD form buttons including submit and clear buttons.
|
|
555
|
+
* Each button can be customized with text, icon, and icon position.
|
|
556
|
+
* @interface ICrudFormOptions
|
|
557
|
+
* @property {Object} buttons - Configuration for form action buttons
|
|
558
|
+
* @property {Object} buttons.submit - Submit button configuration
|
|
559
|
+
* @property {string} [buttons.submit.icon] - Optional icon for the submit button
|
|
560
|
+
* @property {'start' | 'end'} [buttons.submit.iconSlot] - Position of the icon relative to text
|
|
561
|
+
* @property {string} [buttons.submit.text] - Text label for the submit button
|
|
562
|
+
* @property {Object} [buttons.clear] - Optional clear button configuration
|
|
563
|
+
* @property {string} [buttons.clear.icon] - Optional icon for the clear button
|
|
564
|
+
* @property {'start' | 'end'} [buttons.clear.iconSlot] - Position of the icon relative to text
|
|
565
|
+
* @property {string} [buttons.clear.text] - Text label for the clear button
|
|
566
|
+
* @memberOf module:engine
|
|
567
|
+
*/
|
|
526
568
|
interface ICrudFormOptions {
|
|
527
569
|
buttons: {
|
|
528
570
|
submit: {
|
|
@@ -537,7 +579,20 @@ interface ICrudFormOptions {
|
|
|
537
579
|
};
|
|
538
580
|
};
|
|
539
581
|
}
|
|
540
|
-
|
|
582
|
+
/**
|
|
583
|
+
* @description Empty list display options
|
|
584
|
+
* @summary Defines the configuration for displaying an empty state in list components
|
|
585
|
+
* when no data is available. Includes text, button, icon, and link settings.
|
|
586
|
+
* @interface IListEmptyOptions
|
|
587
|
+
* @property {string} title - Title text or translation key for empty state
|
|
588
|
+
* @property {string} subtitle - Subtitle text or translation key for empty state
|
|
589
|
+
* @property {boolean} showButton - Whether to show an action button in empty state
|
|
590
|
+
* @property {string} buttonText - Button text or translation key
|
|
591
|
+
* @property {string} link - Navigation link for the button
|
|
592
|
+
* @property {string} icon - Icon identifier for the empty state
|
|
593
|
+
* @memberOf module:engine
|
|
594
|
+
*/
|
|
595
|
+
interface IListEmptyOptions {
|
|
541
596
|
title: string;
|
|
542
597
|
subtitle: string;
|
|
543
598
|
showButton: boolean;
|
|
@@ -547,9 +602,11 @@ interface IListEmptyResult {
|
|
|
547
602
|
}
|
|
548
603
|
|
|
549
604
|
/**
|
|
550
|
-
* @description Angular engine key constants
|
|
605
|
+
* @description Angular engine key constants.
|
|
551
606
|
* @summary Contains key strings used by the Angular rendering engine for reflection,
|
|
552
|
-
* dynamic component creation, and other engine operations.
|
|
607
|
+
* dynamic component creation, and other engine operations. These constants provide
|
|
608
|
+
* consistent naming for metadata keys, DOM attributes, and component identification
|
|
609
|
+
* throughout the rendering system.
|
|
553
610
|
* @typedef {Object} AngularEngineKeys
|
|
554
611
|
* @property {string} REFLECT - Prefix for reflection metadata keys
|
|
555
612
|
* @property {string} DYNAMIC - Key for dynamic component identification
|
|
@@ -563,8 +620,10 @@ interface IListEmptyResult {
|
|
|
563
620
|
* @property {string} RENDER - Key for renderable components
|
|
564
621
|
* @property {string} RENDERED_ID - Template for rendered component IDs
|
|
565
622
|
* @property {string} PARENT - Key for comparison decorators and validators
|
|
623
|
+
* @property {string} VALIDATION_PARENT_KEY - Key for validation parent reference
|
|
624
|
+
* @property {string} FLAVOUR - Identifier for the Angular engine flavor
|
|
566
625
|
* @const AngularEngineKeys
|
|
567
|
-
* @memberOf module:engine
|
|
626
|
+
* @memberOf module:lib/engine/constants
|
|
568
627
|
*/
|
|
569
628
|
declare const AngularEngineKeys: {
|
|
570
629
|
REFLECT: string;
|
|
@@ -580,32 +639,40 @@ declare const AngularEngineKeys: {
|
|
|
580
639
|
RENDERED_ID: string;
|
|
581
640
|
PARENT: string;
|
|
582
641
|
VALIDATION_PARENT_KEY: symbol;
|
|
642
|
+
FLAVOUR: string;
|
|
583
643
|
};
|
|
584
644
|
/**
|
|
585
|
-
* @description Form validation state constants
|
|
645
|
+
* @description Form validation state constants.
|
|
586
646
|
* @summary Contains constants representing the possible validation states of a form.
|
|
587
647
|
* These are used to check and handle form validation throughout the application.
|
|
648
|
+
* The VALID state indicates all form controls pass validation, while INVALID
|
|
649
|
+
* indicates one or more validation errors exist.
|
|
588
650
|
* @typedef {Object} FormConstants
|
|
589
651
|
* @property {string} VALID - Constant representing a valid form state
|
|
590
652
|
* @property {string} INVALID - Constant representing an invalid form state
|
|
591
653
|
* @const FormConstants
|
|
592
|
-
* @memberOf module:engine
|
|
654
|
+
* @memberOf module:lib/engine/constants
|
|
593
655
|
*/
|
|
594
656
|
declare const FormConstants: {
|
|
595
657
|
readonly VALID: "VALID";
|
|
596
658
|
readonly INVALID: "INVALID";
|
|
597
659
|
};
|
|
598
660
|
/**
|
|
599
|
-
* @description Event name constants
|
|
600
|
-
* @summary
|
|
601
|
-
* These
|
|
602
|
-
*
|
|
603
|
-
* @
|
|
661
|
+
* @description Event name constants.
|
|
662
|
+
* @summary Contains constants for standardized event names used throughout the application.
|
|
663
|
+
* These constants ensure consistent event naming across components and make it easier to
|
|
664
|
+
* track and handle events. Each constant represents a specific application event type.
|
|
665
|
+
* @typedef {Object} EventConstants
|
|
604
666
|
* @property {string} BACK_BUTTON_NAVIGATION - Event fired when back button navigation ends
|
|
605
|
-
* @property {string}
|
|
606
|
-
* @property {string}
|
|
607
|
-
* @property {string}
|
|
608
|
-
* @
|
|
667
|
+
* @property {string} REFRESH - Event fired when a refresh action occurs
|
|
668
|
+
* @property {string} CLICK - Event fired when a click action occurs
|
|
669
|
+
* @property {string} SUBMIT - Event fired when a form submission occurs
|
|
670
|
+
* @property {string} VALIDATION_ERROR - Event fired when a validation error occurs
|
|
671
|
+
* @property {string} FIELDSET_ADD_GROUP - Event fired when adding a group to a fieldset
|
|
672
|
+
* @property {string} FIELDSET_UPDATE_GROUP - Event fired when updating a fieldset group
|
|
673
|
+
* @property {string} FIELDSET_REMOVE_GROUP - Event fired when removing a fieldset group
|
|
674
|
+
* @const EventConstants
|
|
675
|
+
* @memberOf module:lib/engine/constants
|
|
609
676
|
*/
|
|
610
677
|
declare const EventConstants: {
|
|
611
678
|
readonly BACK_BUTTON_NAVIGATION: "backButtonNavigationEndEvent";
|
|
@@ -618,9 +685,11 @@ declare const EventConstants: {
|
|
|
618
685
|
readonly FIELDSET_REMOVE_GROUP: "fieldsetRemoveGroupEvent";
|
|
619
686
|
};
|
|
620
687
|
/**
|
|
621
|
-
* @description Logger level constants
|
|
622
|
-
* @summary
|
|
623
|
-
* Lower values represent more verbose logging, while higher values represent
|
|
688
|
+
* @description Logger level constants.
|
|
689
|
+
* @summary Defines the logging levels used in the application's logging system.
|
|
690
|
+
* Lower numeric values represent more verbose logging, while higher values represent
|
|
691
|
+
* more critical logs. These levels control which log messages are output based on
|
|
692
|
+
* the configured logging threshold.
|
|
624
693
|
* @enum {number}
|
|
625
694
|
* @readonly
|
|
626
695
|
* @property {number} ALL - Log everything (most verbose)
|
|
@@ -629,7 +698,7 @@ declare const EventConstants: {
|
|
|
629
698
|
* @property {number} WARN - Log warnings
|
|
630
699
|
* @property {number} ERROR - Log errors
|
|
631
700
|
* @property {number} CRITICAL - Log critical errors (least verbose)
|
|
632
|
-
* @memberOf module:engine
|
|
701
|
+
* @memberOf module:lib/engine/constants
|
|
633
702
|
*/
|
|
634
703
|
declare enum LoggerLevels {
|
|
635
704
|
ALL = 0,
|
|
@@ -640,15 +709,16 @@ declare enum LoggerLevels {
|
|
|
640
709
|
CRITICAL = 5
|
|
641
710
|
}
|
|
642
711
|
/**
|
|
643
|
-
* @description Route direction constants
|
|
644
|
-
* @summary
|
|
645
|
-
* Used for controlling navigation flow and animation directions.
|
|
712
|
+
* @description Route direction constants.
|
|
713
|
+
* @summary Defines the possible navigation directions in the application.
|
|
714
|
+
* Used for controlling navigation flow and animation directions during route transitions.
|
|
715
|
+
* These constants help maintain consistent navigation behavior throughout the app.
|
|
646
716
|
* @enum {string}
|
|
647
717
|
* @readonly
|
|
648
718
|
* @property {string} BACK - Navigate back to the previous page
|
|
649
719
|
* @property {string} FORWARD - Navigate forward to the next page
|
|
650
720
|
* @property {string} ROOT - Navigate to the root/home page
|
|
651
|
-
* @memberOf module:engine
|
|
721
|
+
* @memberOf module:lib/engine/constants
|
|
652
722
|
*/
|
|
653
723
|
declare enum RouteDirections {
|
|
654
724
|
BACK = "back",
|
|
@@ -656,15 +726,18 @@ declare enum RouteDirections {
|
|
|
656
726
|
ROOT = "root"
|
|
657
727
|
}
|
|
658
728
|
/**
|
|
659
|
-
* @description Component tag name constants
|
|
660
|
-
* @summary
|
|
661
|
-
* These tag names are used for component
|
|
729
|
+
* @description Component tag name constants.
|
|
730
|
+
* @summary Defines the custom HTML tag names for specialized components used in the application.
|
|
731
|
+
* These tag names are registered with Angular and used for component rendering and identification.
|
|
732
|
+
* Each constant represents the selector for a specific custom component type.
|
|
662
733
|
* @enum {string}
|
|
663
734
|
* @readonly
|
|
664
735
|
* @property {string} LIST_ITEM - Tag name for list item component
|
|
665
736
|
* @property {string} LIST_INFINITE - Tag name for infinite scrolling list component
|
|
666
737
|
* @property {string} LIST_PAGINATED - Tag name for paginated list component
|
|
667
|
-
* @
|
|
738
|
+
* @property {string} CRUD_FIELD - Tag name for CRUD form field component
|
|
739
|
+
* @property {string} LAYOUT_COMPONENT - Tag name for layout container component
|
|
740
|
+
* @memberOf module:lib/engine/constants
|
|
668
741
|
*/
|
|
669
742
|
declare enum ComponentsTagNames {
|
|
670
743
|
LIST_ITEM = "ngx-decaf-list-item",
|
|
@@ -674,13 +747,16 @@ declare enum ComponentsTagNames {
|
|
|
674
747
|
LAYOUT_COMPONENT = "ngx-decaf-layout"
|
|
675
748
|
}
|
|
676
749
|
/**
|
|
677
|
-
* @description Base component property name constants
|
|
678
|
-
* @summary
|
|
679
|
-
* These
|
|
750
|
+
* @description Base component property name constants.
|
|
751
|
+
* @summary Defines the standard property names used by base components throughout the application.
|
|
752
|
+
* These constants ensure consistent property naming across components and facilitate
|
|
753
|
+
* property access, validation, and data binding. Used primarily for component input
|
|
754
|
+
* properties and change detection.
|
|
680
755
|
* @enum {string}
|
|
681
756
|
* @readonly
|
|
682
757
|
* @property {string} MODEL - Property name for the component's data model
|
|
683
758
|
* @property {string} LOCALE - Property name for localization settings
|
|
759
|
+
* @property {string} LOCALE_ROOT - Property name for the locale root identifier
|
|
684
760
|
* @property {string} PK - Property name for primary key
|
|
685
761
|
* @property {string} ITEMS - Property name for collection items
|
|
686
762
|
* @property {string} ROUTE - Property name for routing information
|
|
@@ -689,7 +765,10 @@ declare enum ComponentsTagNames {
|
|
|
689
765
|
* @property {string} TRANSLATABLE - Property name for translation flag
|
|
690
766
|
* @property {string} MAPPER - Property name for property mapper
|
|
691
767
|
* @property {string} INITIALIZED - Property name for initialization state
|
|
692
|
-
* @
|
|
768
|
+
* @property {string} COMPONENT_NAME - Property name for component identifier
|
|
769
|
+
* @property {string} PARENT_COMPONENT - Property name for parent component reference
|
|
770
|
+
* @property {string} FORM_GROUP_COMPONENT_PROPS - Property name for form group component properties
|
|
771
|
+
* @memberOf module:lib/engine/constants
|
|
693
772
|
*/
|
|
694
773
|
declare enum BaseComponentProps {
|
|
695
774
|
MODEL = "model",
|
|
@@ -707,14 +786,65 @@ declare enum BaseComponentProps {
|
|
|
707
786
|
PARENT_COMPONENT = "parentComponent",
|
|
708
787
|
FORM_GROUP_COMPONENT_PROPS = "componentProps"
|
|
709
788
|
}
|
|
789
|
+
/**
|
|
790
|
+
* @description List component type constants.
|
|
791
|
+
* @summary Defines the available types for list components, determining their
|
|
792
|
+
* pagination and scrolling behavior. Used to configure list rendering strategies.
|
|
793
|
+
* @enum {string}
|
|
794
|
+
* @readonly
|
|
795
|
+
* @property {string} INFINITE - Infinite scroll list type
|
|
796
|
+
* @property {string} PAGINATED - Paginated list type with page navigation
|
|
797
|
+
* @memberOf module:lib/engine/constants
|
|
798
|
+
*/
|
|
710
799
|
declare enum ListComponentsTypes {
|
|
711
800
|
INFINITE = "infinite",
|
|
712
801
|
PAGINATED = "paginated"
|
|
713
802
|
}
|
|
803
|
+
/**
|
|
804
|
+
* @description CSS class name constants.
|
|
805
|
+
* @summary Contains predefined CSS class names used for consistent styling
|
|
806
|
+
* across components. These constants help maintain a unified visual language
|
|
807
|
+
* and make it easier to apply standard styles.
|
|
808
|
+
* @typedef {Object} CssClasses
|
|
809
|
+
* @property {string} BUTTONS_CONTAINER - CSS class for button container elements
|
|
810
|
+
* @const CssClasses
|
|
811
|
+
* @memberOf module:lib/engine/constants
|
|
812
|
+
*/
|
|
714
813
|
declare const CssClasses: {
|
|
715
814
|
BUTTONS_CONTAINER: string;
|
|
716
815
|
};
|
|
816
|
+
/**
|
|
817
|
+
* @description Default options for reactive CRUD forms.
|
|
818
|
+
* @summary Provides default configuration for form buttons in CRUD operations.
|
|
819
|
+
* Includes default text labels for submit and clear buttons, which can be
|
|
820
|
+
* overridden by individual form implementations.
|
|
821
|
+
* @type {ICrudFormOptions}
|
|
822
|
+
* @property {Object} buttons - Configuration for form action buttons
|
|
823
|
+
* @property {Object} buttons.submit - Submit button configuration
|
|
824
|
+
* @property {string} buttons.submit.text - Default text for submit button
|
|
825
|
+
* @property {Object} buttons.clear - Clear button configuration
|
|
826
|
+
* @property {string} buttons.clear.text - Default text for clear button
|
|
827
|
+
* @const DefaultFormReactiveOptions
|
|
828
|
+
* @memberOf module:lib/engine/constants
|
|
829
|
+
*/
|
|
717
830
|
declare const DefaultFormReactiveOptions: ICrudFormOptions;
|
|
831
|
+
/**
|
|
832
|
+
* @description Default options for empty list state display.
|
|
833
|
+
* @summary Provides default configuration for displaying empty state in list components
|
|
834
|
+
* when no data is available. Includes default text for title and subtitle, icon name,
|
|
835
|
+
* button text and visibility settings. These defaults can be overridden by individual
|
|
836
|
+
* list component implementations to customize the empty state presentation.
|
|
837
|
+
* @type {IListEmptyOptions}
|
|
838
|
+
* @property {string} title - Default translation key for empty list title
|
|
839
|
+
* @property {string} subtitle - Default translation key for empty list subtitle
|
|
840
|
+
* @property {boolean} showButton - Whether to show action button in empty state
|
|
841
|
+
* @property {string} icon - Default Ionic icon name for empty state
|
|
842
|
+
* @property {string} buttonText - Default translation key for button text
|
|
843
|
+
* @property {string} link - Default navigation link (empty string)
|
|
844
|
+
* @const DefaultListEmptyOptions
|
|
845
|
+
* @memberOf module:lib/engine/constants
|
|
846
|
+
*/
|
|
847
|
+
declare const DefaultListEmptyOptions: IListEmptyOptions;
|
|
718
848
|
|
|
719
849
|
/**
|
|
720
850
|
* @description Marks an Angular component as dynamically loadable
|
|
@@ -761,33 +891,30 @@ declare abstract class DynamicModule {
|
|
|
761
891
|
}
|
|
762
892
|
|
|
763
893
|
/**
|
|
764
|
-
* @module
|
|
894
|
+
* @module lib/engine/NgxRenderingEngine
|
|
765
895
|
* @description Angular rendering engine for Decaf model-driven UIs.
|
|
766
896
|
* @summary Implements NgxRenderingEngine which converts model decorator metadata
|
|
767
897
|
* into Angular components, manages component registration, and orchestrates
|
|
768
898
|
* dynamic component creation and input mapping.
|
|
769
|
-
*
|
|
770
899
|
* @link {@link NgxRenderingEngine}
|
|
771
900
|
*/
|
|
772
901
|
|
|
773
902
|
/**
|
|
774
|
-
* @description Angular implementation of the RenderingEngine
|
|
775
|
-
* @summary This class extends the base RenderingEngine to provide Angular-specific rendering capabilities
|
|
776
|
-
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
779
|
-
*
|
|
903
|
+
* @description Angular implementation of the RenderingEngine for Decaf components.
|
|
904
|
+
* @summary This class extends the base RenderingEngine to provide Angular-specific rendering capabilities.
|
|
905
|
+
* It handles the conversion of field definitions to Angular components, manages component registration,
|
|
906
|
+
* and provides utilities for component creation and input handling. The engine converts model decorator
|
|
907
|
+
* metadata into dynamically created Angular components with proper input binding and lifecycle management.
|
|
780
908
|
* @template AngularFieldDefinition - Type for Angular-specific field definitions
|
|
781
909
|
* @template AngularDynamicOutput - Type for Angular-specific component output
|
|
782
|
-
*
|
|
783
910
|
* @class NgxRenderingEngine
|
|
911
|
+
* @extends {RenderingEngine<AngularFieldDefinition, AngularDynamicOutput>}
|
|
784
912
|
* @example
|
|
785
913
|
* ```typescript
|
|
786
914
|
* const engine = NgxRenderingEngine.get();
|
|
787
915
|
* engine.initialize();
|
|
788
916
|
* const output = engine.render(myModel, {}, viewContainerRef, injector, templateRef);
|
|
789
917
|
* ```
|
|
790
|
-
*
|
|
791
918
|
* @mermaid
|
|
792
919
|
* sequenceDiagram
|
|
793
920
|
* participant Client
|
|
@@ -803,83 +930,95 @@ declare abstract class DynamicModule {
|
|
|
803
930
|
* Components-->>Engine: component constructor
|
|
804
931
|
* Engine->>Engine: createComponent(component, inputs, metadata, vcr, injector, template)
|
|
805
932
|
* Engine-->>Client: return AngularDynamicOutput
|
|
933
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
806
934
|
*/
|
|
807
935
|
declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition, AngularDynamicOutput> {
|
|
808
936
|
/**
|
|
809
|
-
* @description Registry of components available for rendering
|
|
937
|
+
* @description Registry of components available for dynamic rendering.
|
|
810
938
|
* @summary Static registry that stores all registered components indexed by their selector name.
|
|
811
939
|
* Each component entry contains a constructor reference that can be used to instantiate
|
|
812
940
|
* the component during the rendering process. This registry is shared across all instances
|
|
813
941
|
* of the rendering engine and is populated through the registerComponent method.
|
|
814
|
-
*
|
|
815
942
|
* @private
|
|
816
943
|
* @static
|
|
817
944
|
* @type {Record<string, { constructor: Constructor<unknown> }>}
|
|
945
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
818
946
|
*/
|
|
819
947
|
private static _components;
|
|
820
948
|
/**
|
|
821
|
-
* @description Currently active model being rendered
|
|
949
|
+
* @description Currently active model being rendered by the engine.
|
|
822
950
|
* @summary Stores a reference to the model instance that is currently being processed
|
|
823
951
|
* by the rendering engine. This property is set during the render method execution
|
|
824
952
|
* and is used throughout the rendering lifecycle to access model data and metadata.
|
|
825
953
|
* The definite assignment assertion (!) is used because this property is always
|
|
826
954
|
* initialized before use within the render method.
|
|
827
|
-
*
|
|
828
955
|
* @private
|
|
829
956
|
* @type {Model}
|
|
957
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
830
958
|
*/
|
|
831
959
|
private _model;
|
|
832
960
|
/**
|
|
833
|
-
* @description Current operation context for component visibility control
|
|
961
|
+
* @description Current operation context for component visibility control.
|
|
834
962
|
* @summary Static property that stores the current operation being performed,
|
|
835
963
|
* which is used to determine component visibility through the 'hidden' property.
|
|
836
964
|
* Components can specify operations where they should be hidden, and this property
|
|
837
965
|
* provides the context for those visibility checks. The value is typically extracted
|
|
838
966
|
* from the global properties during the rendering process.
|
|
839
|
-
*
|
|
840
967
|
* @private
|
|
841
968
|
* @static
|
|
842
969
|
* @type {string | undefined}
|
|
970
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
843
971
|
*/
|
|
844
972
|
private static _operation;
|
|
845
973
|
/**
|
|
846
|
-
* @description Reference to the currently active component instance
|
|
974
|
+
* @description Reference to the currently active component instance.
|
|
847
975
|
* @summary Static property that maintains a reference to the most recently created
|
|
848
976
|
* component instance. This is used internally for component lifecycle management
|
|
849
977
|
* and can be cleared through the destroy method. The reference allows access to
|
|
850
978
|
* the active component instance for operations that need to interact with the
|
|
851
979
|
* currently rendered component.
|
|
852
|
-
*
|
|
853
980
|
* @private
|
|
854
981
|
* @static
|
|
855
982
|
* @type {Type<unknown> | undefined}
|
|
983
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
856
984
|
*/
|
|
857
985
|
private static _instance;
|
|
986
|
+
/**
|
|
987
|
+
* @description Parent component properties for child component inheritance.
|
|
988
|
+
* @summary Static property that stores parent component properties that should be
|
|
989
|
+
* inherited by child components. This is particularly used for passing page configuration
|
|
990
|
+
* down to child components in multi-page forms. The property is cleared after rendering
|
|
991
|
+
* to prevent property leakage between unrelated component trees.
|
|
992
|
+
* @private
|
|
993
|
+
* @static
|
|
994
|
+
* @type {KeyValue | undefined}
|
|
995
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
996
|
+
*/
|
|
858
997
|
private static _parentProps;
|
|
859
998
|
/**
|
|
860
|
-
* @description Constructs a new NgxRenderingEngine instance
|
|
999
|
+
* @description Constructs a new NgxRenderingEngine instance.
|
|
861
1000
|
* @summary Initializes a new instance of the Angular rendering engine by calling the parent
|
|
862
1001
|
* constructor with the 'angular' engine type identifier. This constructor sets up the base
|
|
863
1002
|
* rendering engine functionality with Angular-specific configurations and prepares the
|
|
864
1003
|
* instance for component registration and rendering operations.
|
|
865
|
-
*
|
|
866
1004
|
* @constructor
|
|
1005
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
867
1006
|
*/
|
|
868
1007
|
constructor();
|
|
869
1008
|
/**
|
|
870
|
-
* @description Converts a field definition to an Angular component output
|
|
1009
|
+
* @description Converts a field definition to an Angular component output.
|
|
871
1010
|
* @summary This private method takes a field definition and creates the corresponding Angular component.
|
|
872
|
-
* It handles component instantiation, input property mapping,
|
|
873
|
-
* The method validates input properties against the component's metadata and processes
|
|
1011
|
+
* It handles component instantiation, input property mapping, child component rendering, and visibility
|
|
1012
|
+
* control. The method validates input properties against the component's metadata and processes
|
|
874
1013
|
* child components recursively.
|
|
875
|
-
*
|
|
876
1014
|
* @param {FieldDefinition<AngularFieldDefinition>} fieldDef - The field definition to convert
|
|
877
1015
|
* @param {ViewContainerRef} vcr - The view container reference for component creation
|
|
878
1016
|
* @param {Injector} injector - The Angular injector for dependency injection
|
|
879
1017
|
* @param {TemplateRef<any>} tpl - The template reference for content projection
|
|
880
1018
|
* @param {string} registryFormId - Form identifier for the component renderer
|
|
1019
|
+
* @param {boolean} createComponent - Whether to create the component instance
|
|
1020
|
+
* @param {FormParent} [formGroup] - Optional form group for form components
|
|
881
1021
|
* @return {AngularDynamicOutput} The Angular component output with component reference and inputs
|
|
882
|
-
*
|
|
883
1022
|
* @mermaid
|
|
884
1023
|
* sequenceDiagram
|
|
885
1024
|
* participant Method as fromFieldDefinition
|
|
@@ -900,14 +1039,15 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
|
|
|
900
1039
|
* Method->>Method: Create component instance
|
|
901
1040
|
* end
|
|
902
1041
|
* Method-->>Caller: return AngularDynamicOutput
|
|
1042
|
+
* @private
|
|
1043
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
903
1044
|
*/
|
|
904
1045
|
private fromFieldDefinition;
|
|
905
1046
|
/**
|
|
906
|
-
* @description Creates an Angular component instance
|
|
1047
|
+
* @description Creates an Angular component instance with inputs and template projection.
|
|
907
1048
|
* @summary This static utility method creates an Angular component instance with the specified
|
|
908
1049
|
* inputs and template. It uses Angular's component creation API to instantiate the component
|
|
909
1050
|
* and then sets the input properties using the provided metadata.
|
|
910
|
-
*
|
|
911
1051
|
* @param {Type<unknown>} component - The component type to create
|
|
912
1052
|
* @param {KeyValue} [inputs={}] - The input properties to set on the component
|
|
913
1053
|
* @param {ComponentMirror<unknown>} metadata - The component metadata for input validation
|
|
@@ -915,36 +1055,40 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
|
|
|
915
1055
|
* @param {Injector} injector - The Angular injector for dependency injection
|
|
916
1056
|
* @param {Node[]} [template=[]] - The template nodes to project into the component
|
|
917
1057
|
* @return {ComponentRef<unknown>} The created component reference
|
|
1058
|
+
* @static
|
|
1059
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
918
1060
|
*/
|
|
919
1061
|
static createComponent(component: Type<unknown>, inputs: KeyValue | undefined, metadata: ComponentMirror<unknown>, vcr: ViewContainerRef, injector: Injector, template?: Node[]): ComponentRef<unknown>;
|
|
920
1062
|
/**
|
|
921
|
-
* @description Extracts decorator metadata from a model
|
|
1063
|
+
* @description Extracts decorator metadata from a model.
|
|
922
1064
|
* @summary This method provides access to the field definition generated from a model's
|
|
923
1065
|
* decorators. It's a convenience wrapper around the toFieldDefinition method that
|
|
924
1066
|
* converts a model to a field definition based on its decorators and the provided
|
|
925
1067
|
* global properties.
|
|
926
|
-
*
|
|
927
1068
|
* @param {Model} model - The model to extract decorators from
|
|
928
1069
|
* @param {Record<string, unknown>} globalProps - Global properties to include in the field definition
|
|
929
1070
|
* @return {FieldDefinition<AngularFieldDefinition>} The field definition generated from the model
|
|
1071
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
930
1072
|
*/
|
|
931
1073
|
getDecorators(model: Model, globalProps: Record<string, unknown>): FieldDefinition<AngularFieldDefinition>;
|
|
932
1074
|
/**
|
|
933
|
-
* @description Destroys the current engine instance
|
|
934
|
-
* @summary This static method clears the current instance reference,
|
|
935
|
-
* destroying the singleton instance of the rendering engine.
|
|
936
|
-
*
|
|
937
|
-
*
|
|
1075
|
+
* @description Destroys the current engine instance and cleans up resources.
|
|
1076
|
+
* @summary This static method clears the current instance reference and parent props,
|
|
1077
|
+
* effectively destroying the singleton instance of the rendering engine. Optionally
|
|
1078
|
+
* removes the form registry for the specified form ID. This can be used to reset the
|
|
1079
|
+
* engine state or to prepare for a new instance creation.
|
|
1080
|
+
* @param {string} [formId] - Optional form ID to remove from registry
|
|
938
1081
|
* @return {Promise<void>} A promise that resolves when the instance is destroyed
|
|
1082
|
+
* @static
|
|
1083
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
939
1084
|
*/
|
|
940
1085
|
static destroy(formId?: string): Promise<void>;
|
|
941
1086
|
/**
|
|
942
|
-
* @description Renders a model into an Angular component output
|
|
1087
|
+
* @description Renders a model into an Angular component output.
|
|
943
1088
|
* @summary This method takes a model and converts it to an Angular component output.
|
|
944
1089
|
* It first stores a reference to the model, then converts it to a field definition
|
|
945
1090
|
* using the base RenderingEngine's toFieldDefinition method, and finally converts
|
|
946
1091
|
* that field definition to an Angular component output using fromFieldDefinition.
|
|
947
|
-
*
|
|
948
1092
|
* @template M - Type extending Model
|
|
949
1093
|
* @param {M} model - The model to render
|
|
950
1094
|
* @param {Record<string, unknown>} globalProps - Global properties to pass to the component
|
|
@@ -952,7 +1096,6 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
|
|
|
952
1096
|
* @param {Injector} injector - The Angular injector for dependency injection
|
|
953
1097
|
* @param {TemplateRef<any>} tpl - The template reference for content projection
|
|
954
1098
|
* @return {AngularDynamicOutput} The Angular component output with component reference and inputs
|
|
955
|
-
*
|
|
956
1099
|
* @mermaid
|
|
957
1100
|
* sequenceDiagram
|
|
958
1101
|
* participant Client as Client Code
|
|
@@ -967,63 +1110,68 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
|
|
|
967
1110
|
* Render->>FromField: fromFieldDefinition(fieldDef, vcr, injector, tpl)
|
|
968
1111
|
* FromField-->>Render: AngularDynamicOutput
|
|
969
1112
|
* Render-->>Client: return AngularDynamicOutput
|
|
1113
|
+
* @override
|
|
1114
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
970
1115
|
*/
|
|
971
1116
|
render<M extends Model>(model: M, globalProps: Record<string, unknown>, vcr: ViewContainerRef, injector: Injector, tpl: TemplateRef<unknown>): AngularDynamicOutput;
|
|
972
1117
|
/**
|
|
973
|
-
* @description Initializes the rendering engine
|
|
1118
|
+
* @description Initializes the rendering engine.
|
|
974
1119
|
* @summary This method initializes the rendering engine. It checks if the engine is already initialized
|
|
975
1120
|
* and sets the initialized flag to true. This method is called before the engine is used
|
|
976
1121
|
* to ensure it's properly set up for rendering operations.
|
|
977
|
-
*
|
|
978
1122
|
* @return {Promise<void>} A promise that resolves when initialization is complete
|
|
1123
|
+
* @override
|
|
1124
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
979
1125
|
*/
|
|
980
1126
|
initialize(): Promise<void>;
|
|
981
1127
|
/**
|
|
982
|
-
* @description Registers a component with the rendering engine
|
|
1128
|
+
* @description Registers a component with the rendering engine.
|
|
983
1129
|
* @summary This static method registers a component constructor with the rendering engine
|
|
984
1130
|
* under a specific name. It initializes the components registry if needed and throws
|
|
985
1131
|
* an error if a component is already registered under the same name to prevent
|
|
986
1132
|
* accidental overrides.
|
|
987
|
-
*
|
|
988
1133
|
* @param {string} name - The name to register the component under
|
|
989
1134
|
* @param {Constructor<unknown>} constructor - The component constructor
|
|
990
1135
|
* @return {void}
|
|
1136
|
+
* @static
|
|
1137
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
991
1138
|
*/
|
|
992
1139
|
static registerComponent(name: string, constructor: Constructor<unknown>): void;
|
|
993
1140
|
/**
|
|
994
|
-
* @description Retrieves registered components from the rendering engine
|
|
1141
|
+
* @description Retrieves registered components from the rendering engine.
|
|
995
1142
|
* @summary This static method retrieves either all registered components or a specific component
|
|
996
1143
|
* by its selector. When called without a selector, it returns an array of all registered
|
|
997
1144
|
* components. When called with a selector, it returns the specific component if found,
|
|
998
1145
|
* or throws an error if the component is not registered.
|
|
999
|
-
*
|
|
1000
1146
|
* @param {string} [selector] - Optional selector to retrieve a specific component
|
|
1001
1147
|
* @return {Object|Array} Either a specific component or an array of all components
|
|
1148
|
+
* @static
|
|
1149
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
1002
1150
|
*/
|
|
1003
1151
|
static components(selector?: string): object | string[];
|
|
1004
1152
|
/**
|
|
1005
|
-
* @description Generates a key for reflection metadata
|
|
1153
|
+
* @description Generates a key for reflection metadata storage.
|
|
1006
1154
|
* @summary This static method generates a key for reflection metadata by prefixing the input key
|
|
1007
1155
|
* with the Angular engine's reflection prefix. This is used for storing and retrieving
|
|
1008
1156
|
* metadata in a namespaced way to avoid conflicts with other metadata.
|
|
1009
|
-
*
|
|
1010
1157
|
* @param {string} key - The base key to prefix
|
|
1011
1158
|
* @return {string} The prefixed key for reflection metadata
|
|
1159
|
+
* @static
|
|
1160
|
+
* @override
|
|
1161
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
1012
1162
|
*/
|
|
1013
1163
|
static key(key: string): string;
|
|
1014
1164
|
/**
|
|
1015
|
-
* @description Sets input properties on a component instance
|
|
1165
|
+
* @description Sets input properties on a component instance.
|
|
1016
1166
|
* @summary This static utility method sets input properties on a component instance
|
|
1017
1167
|
* based on the provided inputs object and component metadata. It handles both simple
|
|
1018
1168
|
* values and nested objects, recursively processing object properties. The method
|
|
1019
1169
|
* validates each input against the component's metadata to ensure only valid inputs
|
|
1020
1170
|
* are set.
|
|
1021
|
-
*
|
|
1022
1171
|
* @param {ComponentRef<unknown>} component - The component reference to set inputs on
|
|
1023
1172
|
* @param {KeyValue} inputs - The input properties to set
|
|
1024
1173
|
* @param {ComponentMirror<unknown>} metadata - The component metadata for input validation
|
|
1025
1174
|
* @return {void}
|
|
1026
|
-
*
|
|
1027
1175
|
* @mermaid
|
|
1028
1176
|
* sequenceDiagram
|
|
1029
1177
|
* participant Caller
|
|
@@ -1043,341 +1191,457 @@ declare class NgxRenderingEngine extends RenderingEngine<AngularFieldDefinition,
|
|
|
1043
1191
|
* SetInputs->>Component: setInput(key, value)
|
|
1044
1192
|
* end
|
|
1045
1193
|
* end
|
|
1194
|
+
* @static
|
|
1195
|
+
* @memberOf module:lib/engine/NgxRenderingEngine
|
|
1046
1196
|
*/
|
|
1047
1197
|
static setInputs(component: ComponentRef<unknown>, inputs: KeyValue, metadata: ComponentMirror<unknown>): void;
|
|
1048
1198
|
}
|
|
1049
1199
|
|
|
1050
1200
|
/**
|
|
1051
|
-
* @module
|
|
1201
|
+
* @module lib/engine/NgxDecafComponentDirective
|
|
1052
1202
|
* @description Base decaf component abstraction providing shared inputs and utilities.
|
|
1053
1203
|
* @summary NgxDecafComponentDirective is the abstract foundation for Decaf components and provides common
|
|
1054
1204
|
* inputs (model, mapper, pk, props), logging, repository resolution, and event dispatch helpers.
|
|
1055
1205
|
* It centralizes shared behavior for child components and simplifies integration with the rendering engine.
|
|
1056
|
-
*
|
|
1057
1206
|
* @link {@link NgxDecafComponentDirective}
|
|
1058
1207
|
*/
|
|
1059
1208
|
|
|
1209
|
+
/**
|
|
1210
|
+
* @description Base directive for Decaf components in Angular applications.
|
|
1211
|
+
* @summary Abstract base class that provides common functionality for all Decaf components.
|
|
1212
|
+
* This directive establishes a foundation for component development by offering shared inputs
|
|
1213
|
+
* (model, mapper, pk, props), logging infrastructure, repository access, event handling, and
|
|
1214
|
+
* internationalization support. It implements OnChanges to respond to input property changes
|
|
1215
|
+
* and includes utilities for navigation, localization, and dynamic property binding. All Decaf
|
|
1216
|
+
* components should extend this directive to inherit its foundational capabilities.
|
|
1217
|
+
* @class NgxDecafComponentDirective
|
|
1218
|
+
* @extends {LoggedClass}
|
|
1219
|
+
* @implements {OnChanges}
|
|
1220
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1221
|
+
*/
|
|
1060
1222
|
declare abstract class NgxDecafComponentDirective extends LoggedClass implements OnChanges {
|
|
1061
|
-
protected componentName?: string | undefined;
|
|
1062
|
-
protected localeRoot?: string | undefined;
|
|
1063
1223
|
/**
|
|
1064
|
-
* @description Reference to the component's element.
|
|
1224
|
+
* @description Reference to the component's native DOM element.
|
|
1065
1225
|
* @summary Provides direct access to the native DOM element of the component through Angular's
|
|
1066
1226
|
* ViewChild decorator. This reference can be used to manipulate the DOM element directly,
|
|
1067
1227
|
* apply custom styles, or access native element properties and methods. The element is
|
|
1068
1228
|
* identified by the 'component' template reference variable.
|
|
1069
|
-
*
|
|
1070
1229
|
* @type {ElementRef}
|
|
1071
|
-
* @memberOf NgxDecafComponentDirective
|
|
1230
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1072
1231
|
*/
|
|
1073
1232
|
component: ElementRef;
|
|
1233
|
+
/**
|
|
1234
|
+
* @description Name identifier for the component instance.
|
|
1235
|
+
* @summary Provides a string identifier that can be used to name or label the component
|
|
1236
|
+
* instance. This name can be used for debugging purposes, logging, or to identify specific
|
|
1237
|
+
* component instances within a larger application structure. It serves as a human-readable
|
|
1238
|
+
* identifier that helps distinguish between multiple instances of the same component type.
|
|
1239
|
+
* @type {string}
|
|
1240
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1241
|
+
*/
|
|
1074
1242
|
name: string;
|
|
1243
|
+
/**
|
|
1244
|
+
* @description Parent component identifier for hierarchical component relationships.
|
|
1245
|
+
* @summary Specifies the identifier of the parent component in a hierarchical component structure.
|
|
1246
|
+
* This property establishes a parent-child relationship between components, allowing for
|
|
1247
|
+
* proper nesting and organization of components within a layout. It can be used to track
|
|
1248
|
+
* component dependencies and establish component hierarchies for rendering and event propagation.
|
|
1249
|
+
* @type {string | undefined}
|
|
1250
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1251
|
+
*/
|
|
1075
1252
|
childOf: string | undefined;
|
|
1076
1253
|
/**
|
|
1077
|
-
* @description Unique identifier for the
|
|
1078
|
-
* @summary A unique identifier
|
|
1079
|
-
* This is
|
|
1080
|
-
*
|
|
1254
|
+
* @description Unique identifier for the component instance.
|
|
1255
|
+
* @summary A unique identifier automatically generated for each component instance.
|
|
1256
|
+
* This UID is used for DOM element identification, component tracking, and debugging purposes.
|
|
1257
|
+
* By default, it generates a random 16-character value, but it can be explicitly set via input.
|
|
1081
1258
|
* @type {string | number}
|
|
1082
|
-
* @
|
|
1259
|
+
* @default generateRandomValue(16)
|
|
1260
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1083
1261
|
*/
|
|
1084
1262
|
uid: string | number;
|
|
1085
1263
|
/**
|
|
1086
|
-
* @description
|
|
1087
|
-
* @summary The data model
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
*
|
|
1091
|
-
* @
|
|
1264
|
+
* @description Data model or model name for component operations.
|
|
1265
|
+
* @summary The data model that this component will use for CRUD operations. This can be provided
|
|
1266
|
+
* as a Model instance, a model constructor, or a string representing the model's registered name.
|
|
1267
|
+
* When set, this property provides the component with access to the model's schema, validation rules,
|
|
1268
|
+
* and metadata needed for rendering and data operations.
|
|
1269
|
+
* @type {Model | string | undefined}
|
|
1270
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1092
1271
|
*/
|
|
1093
1272
|
model: Model | string | undefined;
|
|
1094
1273
|
/**
|
|
1095
|
-
* @description
|
|
1096
|
-
* @summary
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1100
|
-
*
|
|
1101
|
-
* @
|
|
1102
|
-
* @memberOf NgxDecafComponentDirective
|
|
1274
|
+
* @description Primary key value of the current model instance.
|
|
1275
|
+
* @summary Specifies the primary key value for the current model record being displayed or
|
|
1276
|
+
* manipulated by the component. This identifier is used for CRUD operations that target
|
|
1277
|
+
* specific records, such as read, update, and delete operations. The value corresponds to
|
|
1278
|
+
* the field designated as the primary key in the model definition.
|
|
1279
|
+
* @type {EventIds}
|
|
1280
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1103
1281
|
*/
|
|
1104
|
-
modelId?:
|
|
1282
|
+
modelId?: EventIds;
|
|
1105
1283
|
/**
|
|
1106
|
-
* @description Primary key field name for the model.
|
|
1284
|
+
* @description Primary key field name for the data model.
|
|
1107
1285
|
* @summary Specifies which field in the model should be used as the primary key.
|
|
1108
1286
|
* This is typically used for identifying unique records in operations like update and delete.
|
|
1109
|
-
*
|
|
1287
|
+
* If not explicitly set, it defaults to the repository's configured primary key or 'id'.
|
|
1110
1288
|
* @type {string}
|
|
1111
1289
|
* @default 'id'
|
|
1112
|
-
* @memberOf NgxDecafComponentDirective
|
|
1290
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1113
1291
|
*/
|
|
1114
1292
|
pk: string;
|
|
1115
1293
|
/**
|
|
1116
|
-
* @description Field mapping configuration.
|
|
1294
|
+
* @description Field mapping configuration object or function.
|
|
1117
1295
|
* @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
|
-
* @
|
|
1296
|
+
* This allows for flexible data binding between the model and the component's display logic. Can be
|
|
1297
|
+
* provided as a static object mapping or as a function for dynamic mapping transformations.
|
|
1298
|
+
* @type {Record<string, string> | FunctionLike}
|
|
1299
|
+
* @default {}
|
|
1300
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1122
1301
|
*/
|
|
1123
1302
|
mapper: Record<string, string> | FunctionLike;
|
|
1124
1303
|
/**
|
|
1125
|
-
* @description Available CRUD operations for this component.
|
|
1304
|
+
* @description Available CRUD operations for this component instance.
|
|
1126
1305
|
* @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
|
-
*
|
|
1306
|
+
* for this component. This affects which operations can be performed on the data and
|
|
1307
|
+
* which operation buttons are displayed in the UI. By default, only READ operations are enabled.
|
|
1308
|
+
* @type {CrudOperations[]}
|
|
1129
1309
|
* @default [OperationKeys.READ]
|
|
1130
|
-
* @memberOf NgxDecafComponentDirective
|
|
1310
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1131
1311
|
*/
|
|
1132
1312
|
operations: CrudOperations[];
|
|
1133
1313
|
/**
|
|
1134
|
-
* @description
|
|
1135
|
-
* @summary Specifies which
|
|
1136
|
-
*
|
|
1314
|
+
* @description The CRUD operation type to be performed on the model.
|
|
1315
|
+
* @summary Specifies which operation (Create, Read, Update, Delete) this component instance
|
|
1316
|
+
* should perform. This determines the UI behavior, form configuration, and available actions.
|
|
1317
|
+
* The operation affects form validation, field availability, and the specific repository
|
|
1318
|
+
* method called during data submission.
|
|
1137
1319
|
*
|
|
1320
|
+
* @type {OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE}
|
|
1321
|
+
* @default OperationKeys.READ
|
|
1322
|
+
* @memberOf ModelPage
|
|
1323
|
+
*/
|
|
1324
|
+
operation: OperationKeys.CREATE | OperationKeys.READ | OperationKeys.UPDATE | OperationKeys.DELETE;
|
|
1325
|
+
/**
|
|
1326
|
+
* @description Row position in a grid-based layout system.
|
|
1327
|
+
* @summary Specifies the row position of this component when rendered within a grid-based layout.
|
|
1328
|
+
* This property is used for positioning components in multi-row, multi-column layouts and helps
|
|
1329
|
+
* establish the component's vertical placement within the grid structure.
|
|
1138
1330
|
* @type {number}
|
|
1139
1331
|
* @default 1
|
|
1140
|
-
* @memberOf NgxDecafComponentDirective
|
|
1332
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1141
1333
|
*/
|
|
1142
1334
|
row: number;
|
|
1143
1335
|
/**
|
|
1144
|
-
* @description
|
|
1145
|
-
* @summary Specifies
|
|
1146
|
-
* This is
|
|
1147
|
-
*
|
|
1336
|
+
* @description Column position in a grid-based layout system.
|
|
1337
|
+
* @summary Specifies the column position of this component when rendered within a grid-based layout.
|
|
1338
|
+
* This property is used for positioning components in multi-row, multi-column layouts and helps
|
|
1339
|
+
* establish the component's horizontal placement within the grid structure.
|
|
1148
1340
|
* @type {number}
|
|
1149
1341
|
* @default 1
|
|
1150
|
-
* @memberOf NgxDecafComponentDirective
|
|
1342
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1151
1343
|
*/
|
|
1152
1344
|
col: number;
|
|
1153
1345
|
/**
|
|
1154
|
-
* @description Additional CSS class names
|
|
1346
|
+
* @description Additional CSS class names for component styling.
|
|
1155
1347
|
* @summary Allows custom CSS classes to be added to the component's root element.
|
|
1156
1348
|
* These classes are appended to any automatically generated classes based on other
|
|
1157
1349
|
* component properties. Multiple classes can be provided as a space-separated string.
|
|
1158
1350
|
* This provides a way to customize the component's appearance beyond the built-in styling options.
|
|
1159
|
-
*
|
|
1160
1351
|
* @type {string}
|
|
1161
1352
|
* @default ""
|
|
1162
|
-
* @memberOf NgxDecafComponentDirective
|
|
1353
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1163
1354
|
*/
|
|
1164
1355
|
className: string;
|
|
1165
1356
|
/**
|
|
1166
|
-
* @description
|
|
1357
|
+
* @description Repository instance for data layer operations.
|
|
1167
1358
|
* @summary Provides a connection to the data layer for retrieving and manipulating data.
|
|
1168
|
-
* This is an instance of the
|
|
1169
|
-
* which is initialized in the `repository` getter method.
|
|
1170
|
-
*
|
|
1359
|
+
* This is an instance of the DecafRepository class, initialized lazily in the repository getter.
|
|
1171
1360
|
* The repository is used to perform CRUD (Create, Read, Update, Delete) operations on the
|
|
1172
|
-
* data model
|
|
1173
|
-
* items. It also provides methods for querying and filtering data based on specific criteria.
|
|
1174
|
-
*
|
|
1361
|
+
* data model and provides methods for querying and filtering data based on specific criteria.
|
|
1175
1362
|
* @type {DecafRepository<Model>}
|
|
1176
1363
|
* @private
|
|
1177
|
-
* @memberOf NgxDecafComponentDirective
|
|
1364
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1178
1365
|
*/
|
|
1179
1366
|
protected _repository?: DecafRepository<Model>;
|
|
1180
1367
|
/**
|
|
1181
|
-
* @description
|
|
1182
|
-
* @summary
|
|
1183
|
-
*
|
|
1184
|
-
* the application
|
|
1185
|
-
*
|
|
1186
|
-
* @
|
|
1368
|
+
* @description Ionic menu controller service for menu management.
|
|
1369
|
+
* @summary Injected service that provides programmatic control over Ionic menu components.
|
|
1370
|
+
* This service allows the component to open, close, toggle, and manage menu states within
|
|
1371
|
+
* the application. It provides access to menu functionality for implementing navigation
|
|
1372
|
+
* and layout features that require menu interaction.
|
|
1373
|
+
* @protected
|
|
1187
1374
|
* @type {MenuController}
|
|
1188
|
-
* @memberOf NgxDecafComponentDirective
|
|
1375
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1189
1376
|
*/
|
|
1190
1377
|
protected menuController: MenuController;
|
|
1191
1378
|
/**
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
*/
|
|
1379
|
+
* @description Angular change detection service for manual change detection control.
|
|
1380
|
+
* @summary Injected service that provides manual control over change detection cycles.
|
|
1381
|
+
* This is essential for ensuring that programmatic DOM changes (like setting accordion
|
|
1382
|
+
* attributes) are properly reflected in the component's state and trigger appropriate
|
|
1383
|
+
* view updates when modifications occur outside the normal Angular change detection flow.
|
|
1384
|
+
* @protected
|
|
1385
|
+
* @type {ChangeDetectorRef}
|
|
1386
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1387
|
+
*/
|
|
1202
1388
|
protected changeDetectorRef: ChangeDetectorRef;
|
|
1203
1389
|
/**
|
|
1204
|
-
* @description Angular Renderer2 service for
|
|
1390
|
+
* @description Angular Renderer2 service for platform-agnostic DOM manipulation.
|
|
1205
1391
|
* @summary Injected service that provides a safe, platform-agnostic way to manipulate DOM elements.
|
|
1206
1392
|
* This service ensures proper handling of DOM operations across different platforms and environments,
|
|
1207
|
-
* including server-side rendering and web workers.
|
|
1208
|
-
*
|
|
1393
|
+
* including server-side rendering and web workers, without direct DOM access.
|
|
1209
1394
|
* @protected
|
|
1210
1395
|
* @type {Renderer2}
|
|
1211
|
-
* @memberOf
|
|
1396
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1212
1397
|
*/
|
|
1213
1398
|
protected renderer: Renderer2;
|
|
1214
1399
|
/**
|
|
1215
|
-
* @description Translation service for internationalization.
|
|
1400
|
+
* @description Translation service for application internationalization.
|
|
1216
1401
|
* @summary Injected service that provides translation capabilities for UI text.
|
|
1217
|
-
* Used to translate button labels
|
|
1218
|
-
*
|
|
1402
|
+
* Used to translate button labels, validation messages, and other text content based
|
|
1403
|
+
* on the current locale setting, enabling multilingual support throughout the application.
|
|
1219
1404
|
* @protected
|
|
1220
1405
|
* @type {TranslateService}
|
|
1221
|
-
* @memberOf
|
|
1406
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1222
1407
|
*/
|
|
1223
1408
|
protected translateService: TranslateService;
|
|
1224
1409
|
/**
|
|
1225
|
-
* @description Logger instance for
|
|
1410
|
+
* @description Logger instance for structured component logging.
|
|
1226
1411
|
* @summary Provides logging capabilities for the component, allowing for consistent
|
|
1227
|
-
* and structured logging of information, warnings, and errors. This logger is
|
|
1228
|
-
*
|
|
1229
|
-
*
|
|
1412
|
+
* and structured logging of information, warnings, and errors. This logger is inherited
|
|
1413
|
+
* from the LoggedClass and provides access to structured logging functionality.
|
|
1230
1414
|
* The logger is used throughout the component to record important events, debug information,
|
|
1231
|
-
* and potential issues
|
|
1232
|
-
* of operations, and facilitating easier debugging and maintenance.
|
|
1233
|
-
*
|
|
1415
|
+
* and potential issues, facilitating easier debugging and maintenance.
|
|
1234
1416
|
* @type {Logger}
|
|
1235
|
-
* @
|
|
1236
|
-
* @memberOf NgxDecafComponentDirective
|
|
1417
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1237
1418
|
*/
|
|
1238
1419
|
logger: Logger;
|
|
1239
1420
|
/**
|
|
1240
|
-
* @description Event emitter for custom
|
|
1241
|
-
* @summary Emits custom events that occur within child components or the
|
|
1421
|
+
* @description Event emitter for custom component events.
|
|
1422
|
+
* @summary Emits custom events that occur within child components or the component itself.
|
|
1242
1423
|
* This allows parent components to listen for and respond to user interactions or
|
|
1243
|
-
* state changes
|
|
1244
|
-
*
|
|
1245
|
-
*
|
|
1424
|
+
* state changes. Events are passed up the component hierarchy to enable coordinated
|
|
1425
|
+
* behavior across the application.
|
|
1246
1426
|
* @type {EventEmitter<IBaseCustomEvent>}
|
|
1247
|
-
* @memberOf NgxDecafComponentDirective
|
|
1427
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1248
1428
|
*/
|
|
1249
1429
|
listenEvent: EventEmitter<IBaseCustomEvent>;
|
|
1250
1430
|
/**
|
|
1251
|
-
* @description Angular Router instance for navigation
|
|
1252
|
-
* @summary Injected Router service used for programmatic navigation
|
|
1253
|
-
*
|
|
1254
|
-
*
|
|
1255
|
-
* @
|
|
1431
|
+
* @description Angular Router instance for programmatic navigation.
|
|
1432
|
+
* @summary Injected Router service used for programmatic navigation between routes
|
|
1433
|
+
* in the application. This service enables navigation to different views and operations,
|
|
1434
|
+
* handles route parameters, and manages the browser's navigation history.
|
|
1435
|
+
* @protected
|
|
1256
1436
|
* @type {Router}
|
|
1257
|
-
* @memberOf NgxDecafComponentDirective
|
|
1437
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1258
1438
|
*/
|
|
1259
1439
|
protected router: Router;
|
|
1260
1440
|
/**
|
|
1261
|
-
* @description
|
|
1262
|
-
* @summary
|
|
1263
|
-
* to
|
|
1264
|
-
*
|
|
1265
|
-
*
|
|
1266
|
-
* @type {
|
|
1267
|
-
* @memberOf NgxDecafComponentDirective
|
|
1441
|
+
* @description Current locale identifier for component internationalization.
|
|
1442
|
+
* @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text
|
|
1443
|
+
* and formatting data according to regional conventions. This property can be set to override
|
|
1444
|
+
* the default application locale for this specific component instance, enabling per-component
|
|
1445
|
+
* localization when needed.
|
|
1446
|
+
* @type {string | undefined}
|
|
1447
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1268
1448
|
*/
|
|
1269
1449
|
locale?: string;
|
|
1270
1450
|
/**
|
|
1271
|
-
* @description Configuration for list item rendering
|
|
1451
|
+
* @description Configuration for list item rendering behavior.
|
|
1272
1452
|
* @summary Defines how list items should be rendered in the component.
|
|
1273
1453
|
* This property holds a configuration object that specifies the tag name
|
|
1274
1454
|
* and other properties needed to render list items correctly. The tag property
|
|
1275
1455
|
* identifies which component should be used to render each item in a list.
|
|
1276
1456
|
* Additional properties can be included to customize the rendering behavior.
|
|
1277
|
-
*
|
|
1278
1457
|
* @type {Record<string, unknown>}
|
|
1279
1458
|
* @default {tag: ""}
|
|
1280
|
-
* @memberOf NgxDecafComponentDirective
|
|
1459
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1281
1460
|
*/
|
|
1282
1461
|
item: Record<string, unknown>;
|
|
1283
1462
|
/**
|
|
1284
|
-
* @description Dynamic properties configuration
|
|
1463
|
+
* @description Dynamic properties configuration for runtime customization.
|
|
1285
1464
|
* @summary Contains key-value pairs of dynamic properties that can be applied to the component
|
|
1286
1465
|
* at runtime. This flexible configuration object allows for dynamic property assignment without
|
|
1287
1466
|
* requiring explicit input bindings for every possible configuration option. Properties from
|
|
1288
1467
|
* this object are parsed and applied to the component instance through the parseProps method,
|
|
1289
1468
|
* enabling customizable component behavior based on external configuration.
|
|
1290
|
-
*
|
|
1291
1469
|
* @type {Record<string, unknown>}
|
|
1292
1470
|
* @default {}
|
|
1293
|
-
* @memberOf NgxDecafComponentDirective
|
|
1471
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1294
1472
|
*/
|
|
1295
1473
|
props: Record<string, unknown>;
|
|
1296
1474
|
/**
|
|
1297
|
-
* @description Base route for navigation
|
|
1475
|
+
* @description Base route path for component navigation.
|
|
1298
1476
|
* @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
|
-
*
|
|
1477
|
+
* This is often used as a prefix for constructing navigation URLs when transitioning between
|
|
1478
|
+
* different operations or views. The route helps establish the component's position in the
|
|
1479
|
+
* application's routing hierarchy.
|
|
1301
1480
|
* @type {string}
|
|
1302
|
-
* @memberOf NgxDecafComponentDirective
|
|
1481
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1303
1482
|
*/
|
|
1304
1483
|
route: string;
|
|
1305
1484
|
/**
|
|
1306
|
-
* @description
|
|
1485
|
+
* @description Initialization status flag for the component.
|
|
1307
1486
|
* @summary Tracks whether the component has completed its initialization process.
|
|
1308
1487
|
* This flag is used to prevent duplicate initialization and to determine if
|
|
1309
1488
|
* certain operations that require initialization can be performed.
|
|
1310
|
-
*
|
|
1311
1489
|
* @type {boolean}
|
|
1312
1490
|
* @default false
|
|
1313
|
-
* @memberOf NgxDecafComponentDirective
|
|
1491
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1314
1492
|
*/
|
|
1315
1493
|
initialized: boolean;
|
|
1316
|
-
constructor(componentName?: string | undefined, localeRoot?: string | undefined);
|
|
1317
|
-
get localeContext(): string;
|
|
1318
1494
|
/**
|
|
1319
|
-
* @description
|
|
1320
|
-
* @summary
|
|
1321
|
-
*
|
|
1322
|
-
*
|
|
1323
|
-
*
|
|
1324
|
-
*
|
|
1325
|
-
*
|
|
1326
|
-
|
|
1495
|
+
* @description Component name identifier for logging and localization contexts.
|
|
1496
|
+
* @summary Stores the component's name which is used as a key for logging contexts
|
|
1497
|
+
* and as a base for locale resolution. Can be injected via the CPTKN token or defaults
|
|
1498
|
+
* to "NgxDecafComponentDirective" if not provided.
|
|
1499
|
+
* @protected
|
|
1500
|
+
* @type {string | undefined}
|
|
1501
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1502
|
+
*/
|
|
1503
|
+
protected componentName?: string;
|
|
1504
|
+
/**
|
|
1505
|
+
* @description Root key for component locale context resolution.
|
|
1506
|
+
* @summary Defines the base key used to resolve localization contexts for this component.
|
|
1507
|
+
* If not explicitly provided, it defaults to the component's name. This key is used to
|
|
1508
|
+
* load appropriate translation resources and locale-specific configurations.
|
|
1509
|
+
* @protected
|
|
1510
|
+
* @type {string | undefined}
|
|
1511
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1512
|
+
*/
|
|
1513
|
+
protected localeRoot?: string;
|
|
1514
|
+
/**
|
|
1515
|
+
* @description Reference to CRUD operation constants for template usage.
|
|
1516
|
+
* @summary Exposes the OperationKeys enum to the component template, enabling
|
|
1517
|
+
* conditional rendering and behavior based on operation types. This protected
|
|
1518
|
+
* readonly property ensures that template logic can access operation constants
|
|
1519
|
+
* while maintaining encapsulation and preventing accidental modification.
|
|
1520
|
+
* @protected
|
|
1521
|
+
* @readonly
|
|
1522
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1523
|
+
*/
|
|
1524
|
+
protected readonly OperationKeys: typeof OperationKeys;
|
|
1525
|
+
/**
|
|
1526
|
+
* @description Angular Location service.
|
|
1527
|
+
* @summary Injected service that provides access to the browser's URL and history.
|
|
1528
|
+
* This service is used for interacting with the browser's history API, allowing
|
|
1529
|
+
* for back navigation and URL manipulation outside of Angular's router.
|
|
1327
1530
|
*
|
|
1328
|
-
* @returns {DecafRepository<Model>} The initialized repository instance.
|
|
1329
1531
|
* @private
|
|
1330
|
-
* @
|
|
1532
|
+
* @type {Location}
|
|
1533
|
+
*/
|
|
1534
|
+
protected location: Location;
|
|
1535
|
+
/**
|
|
1536
|
+
* @description Constructor for NgxDecafComponentDirective.
|
|
1537
|
+
* @summary Initializes the directive by setting up the component name, locale root,
|
|
1538
|
+
* and logger. Calls the parent LoggedClass constructor and configures localization
|
|
1539
|
+
* context. The component name and locale root can be optionally injected via the
|
|
1540
|
+
* CPTKN token, otherwise defaults are used.
|
|
1541
|
+
* @param {string} [componentName] - Optional component name for identification and logging
|
|
1542
|
+
* @param {string} [localeRoot] - Optional locale root key for internationalization
|
|
1543
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1544
|
+
*/
|
|
1545
|
+
constructor(componentName?: string, localeRoot?: string);
|
|
1546
|
+
/**
|
|
1547
|
+
* @description Getter for the current locale context identifier.
|
|
1548
|
+
* @summary Returns the current locale identifier by calling the getLocale method.
|
|
1549
|
+
* This property provides convenient access to the component's active locale setting.
|
|
1550
|
+
* @returns {string} The current locale identifier
|
|
1551
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1552
|
+
*/
|
|
1553
|
+
get localeContext(): string;
|
|
1554
|
+
/**
|
|
1555
|
+
* @description Getter for the data repository instance.
|
|
1556
|
+
* @summary Lazily initializes and returns the DecafRepository instance for the current model.
|
|
1557
|
+
* This getter ensures the repository is created only when needed and reused for subsequent
|
|
1558
|
+
* access. It also automatically sets the primary key field if not explicitly configured.
|
|
1559
|
+
* @protected
|
|
1560
|
+
* @returns {DecafRepository<Model>} The repository instance for the current model
|
|
1561
|
+
* @throws {InternalError} If repository initialization fails
|
|
1562
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1331
1563
|
*/
|
|
1332
1564
|
protected get repository(): DecafRepository<Model>;
|
|
1333
1565
|
/**
|
|
1334
|
-
* @description
|
|
1335
|
-
* @summary
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
* it
|
|
1339
|
-
*
|
|
1340
|
-
* the translation settings.
|
|
1341
|
-
*
|
|
1342
|
-
* @param {SimpleChanges} changes - Object containing changed properties
|
|
1566
|
+
* @description Angular lifecycle hook for handling input property changes.
|
|
1567
|
+
* @summary Responds to changes in component input properties, specifically monitoring changes
|
|
1568
|
+
* to the model, locale root, and component name properties. When the model changes, it triggers
|
|
1569
|
+
* model initialization and locale context updates. When locale-related properties change,
|
|
1570
|
+
* it updates the component's locale setting accordingly.
|
|
1571
|
+
* @param {SimpleChanges} changes - Object containing the changed properties with their previous and current values
|
|
1343
1572
|
* @return {void}
|
|
1573
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1344
1574
|
*/
|
|
1345
1575
|
ngOnChanges(changes: SimpleChanges): void;
|
|
1576
|
+
/**
|
|
1577
|
+
* @description Translates text phrases using the translation service.
|
|
1578
|
+
* @summary Provides a promise-based wrapper around the translation service to translate
|
|
1579
|
+
* UI text based on the current locale. Supports both single phrases and arrays of phrases,
|
|
1580
|
+
* and accepts optional parameters for template interpolation. When a string parameter is
|
|
1581
|
+
* provided, it's automatically converted to an object format for the translation service.
|
|
1582
|
+
* @protected
|
|
1583
|
+
* @param {string | string[]} phrase - The translation key or array of keys to translate
|
|
1584
|
+
* @param {object | string} [params] - Optional parameters for interpolation in translated text
|
|
1585
|
+
* @return {Promise<string>} A promise that resolves to the translated text
|
|
1586
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1587
|
+
*/
|
|
1346
1588
|
protected translate(phrase: string | string[], params?: object | string): Promise<string>;
|
|
1589
|
+
/**
|
|
1590
|
+
* @description Initializes the component asynchronously with custom logic.
|
|
1591
|
+
* @summary Abstract initialization method that can be overridden by child components to perform
|
|
1592
|
+
* custom initialization logic. By default, it simply sets the initialized flag to true.
|
|
1593
|
+
* Child components can extend this method to load data, configure settings, or perform
|
|
1594
|
+
* other setup operations required before the component is fully functional.
|
|
1595
|
+
* @protected
|
|
1596
|
+
* @param {...unknown[]} args - Variable number of arguments that can be used by child implementations
|
|
1597
|
+
* @return {Promise<void>} A promise that resolves when initialization is complete
|
|
1598
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1599
|
+
*/
|
|
1347
1600
|
protected initialize(...args: unknown[]): Promise<void>;
|
|
1601
|
+
/**
|
|
1602
|
+
* @description Retrieves or sets the locale context for the component.
|
|
1603
|
+
* @summary Gets the locale identifier from the locale context system. If a locale parameter
|
|
1604
|
+
* is provided, it updates the localeRoot property and resolves the new locale context.
|
|
1605
|
+
* If no locale is currently set, it initializes it from the localeRoot.
|
|
1606
|
+
* @protected
|
|
1607
|
+
* @param {string} [locale] - Optional locale identifier to set
|
|
1608
|
+
* @return {string} The current locale identifier
|
|
1609
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1610
|
+
*/
|
|
1348
1611
|
protected getLocale(locale?: string): string;
|
|
1349
1612
|
/**
|
|
1350
|
-
* @description
|
|
1351
|
-
* @summary
|
|
1352
|
-
*
|
|
1353
|
-
*
|
|
1354
|
-
*
|
|
1355
|
-
*
|
|
1356
|
-
* @
|
|
1613
|
+
* @description Retrieves or generates the route path for the component.
|
|
1614
|
+
* @summary Gets the navigation route associated with this component. If no route is explicitly
|
|
1615
|
+
* set and a model is available, it automatically generates a route based on the model's
|
|
1616
|
+
* class name using the pattern `/model/{ModelName}`. Returns an empty string if neither
|
|
1617
|
+
* a route nor a model is available.
|
|
1618
|
+
* @return {string} The route path for this component
|
|
1619
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1357
1620
|
*/
|
|
1358
1621
|
getRoute(): string;
|
|
1359
1622
|
/**
|
|
1360
|
-
* @description Resolves and
|
|
1361
|
-
* @summary
|
|
1362
|
-
*
|
|
1363
|
-
*
|
|
1364
|
-
* to
|
|
1365
|
-
*
|
|
1366
|
-
* @param {string | Model} model - The model
|
|
1623
|
+
* @description Resolves and initializes a model from various input formats.
|
|
1624
|
+
* @summary Accepts a model in multiple formats (string name, Model instance, or ModelConstructor)
|
|
1625
|
+
* and resolves it to a Model instance. When a string is provided, it looks up the model
|
|
1626
|
+
* by name in the Model registry. After resolution, it delegates to setModelDefinitions
|
|
1627
|
+
* to complete the model initialization and configuration.
|
|
1628
|
+
* @template M - The model type extending from Model
|
|
1629
|
+
* @param {string | Model | ModelConstructor<M>} model - The model to resolve and initialize
|
|
1367
1630
|
* @return {void}
|
|
1631
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1368
1632
|
*/
|
|
1369
1633
|
getModel<M extends Model>(model: string | Model | ModelConstructor<M>): void;
|
|
1370
1634
|
/**
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1635
|
+
* @description Configures component properties based on model decorators and metadata.
|
|
1636
|
+
* @summary Extracts rendering configuration from the model's decorators using the rendering
|
|
1637
|
+
* engine. This includes props, item configuration, and child component definitions. It sets
|
|
1638
|
+
* up the mapper for field transformations, configures the item renderer with appropriate
|
|
1639
|
+
* properties, and establishes the route for navigation. This method bridges the model's
|
|
1640
|
+
* decorator metadata with the component's runtime configuration.
|
|
1641
|
+
* @param {Model} model - The model instance to extract definitions from
|
|
1642
|
+
* @return {void}
|
|
1643
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1644
|
+
*/
|
|
1381
1645
|
setModelDefinitions(model: Model): void;
|
|
1382
1646
|
/**
|
|
1383
1647
|
* @description Parses and applies properties from the props object to the component instance.
|
|
@@ -1386,61 +1650,169 @@ declare abstract class NgxDecafComponentDirective extends LoggedClass implements
|
|
|
1386
1650
|
* component instance. This allows for dynamic property assignment based on configuration
|
|
1387
1651
|
* stored in the props object, enabling flexible component customization without requiring
|
|
1388
1652
|
* explicit property binding for every possible configuration option.
|
|
1389
|
-
*
|
|
1390
1653
|
* The method performs a safe property assignment by checking if each key from the instance
|
|
1391
1654
|
* exists in the props object before applying it. This prevents accidental property
|
|
1392
1655
|
* overwriting and ensures only intended properties are modified.
|
|
1393
|
-
*
|
|
1394
1656
|
* @param {KeyValue} instance - The component instance object to process
|
|
1657
|
+
* @param {string[]} [skip=[]] - Array of property names to skip during parsing
|
|
1395
1658
|
* @return {void}
|
|
1396
|
-
*
|
|
1397
1659
|
* @mermaid
|
|
1398
1660
|
* sequenceDiagram
|
|
1399
1661
|
* participant C as Component
|
|
1400
|
-
* participant
|
|
1662
|
+
* participant D as NgxDecafComponentDirective
|
|
1401
1663
|
* participant P as Props Object
|
|
1402
1664
|
*
|
|
1403
|
-
* C->>
|
|
1404
|
-
*
|
|
1665
|
+
* C->>D: parseProps(instance, skip)
|
|
1666
|
+
* D->>D: Get Object.keys(instance)
|
|
1405
1667
|
* loop For each key in instance
|
|
1406
|
-
*
|
|
1407
|
-
* alt Key
|
|
1408
|
-
*
|
|
1409
|
-
*
|
|
1410
|
-
*
|
|
1668
|
+
* D->>D: Check if key in skip array
|
|
1669
|
+
* alt Key not in skip
|
|
1670
|
+
* D->>P: Check if key exists in this.props
|
|
1671
|
+
* alt Key exists in props
|
|
1672
|
+
* D->>D: Set this[key] = this.props[key]
|
|
1673
|
+
* D->>P: delete this.props[key]
|
|
1674
|
+
* else Key not in props
|
|
1675
|
+
* Note over D: Skip this key
|
|
1676
|
+
* end
|
|
1411
1677
|
* end
|
|
1412
1678
|
* end
|
|
1413
|
-
*
|
|
1414
1679
|
* @protected
|
|
1415
|
-
* @memberOf
|
|
1680
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1416
1681
|
*/
|
|
1417
1682
|
protected parseProps(instance: KeyValue, skip?: string[]): void;
|
|
1418
1683
|
/**
|
|
1419
|
-
* @description Tracks items in ngFor loops for optimal change detection.
|
|
1684
|
+
* @description Tracks items in ngFor loops for optimal change detection performance.
|
|
1420
1685
|
* @summary Provides a tracking function for Angular's *ngFor directive to optimize rendering
|
|
1421
1686
|
* performance. This method generates unique identifiers for list items based on their index
|
|
1422
1687
|
* and content, allowing Angular to efficiently track changes and minimize DOM manipulations
|
|
1423
1688
|
* during list updates. The tracking function is essential for maintaining component state
|
|
1424
1689
|
* and preventing unnecessary re-rendering of unchanged items.
|
|
1425
|
-
*
|
|
1690
|
+
* @protected
|
|
1426
1691
|
* @param {number} index - The index of the item in the list
|
|
1427
1692
|
* @param {KeyValue | string | number} item - The item data to track
|
|
1428
|
-
* @
|
|
1429
|
-
* @memberOf NgxDecafComponentDirective
|
|
1693
|
+
* @return {string | number} A unique identifier for the item
|
|
1694
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1430
1695
|
*/
|
|
1431
1696
|
protected trackItemFn(index: number, item: KeyValue | string | number): string | number;
|
|
1697
|
+
/**
|
|
1698
|
+
* @description Handles custom events from child components or DOM elements.
|
|
1699
|
+
* @summary Processes custom events by extracting event handlers and delegating to appropriate
|
|
1700
|
+
* handler classes. Supports both CustomEvent format with detail property and direct event
|
|
1701
|
+
* objects. If specific handlers are defined in the event, it instantiates the handler class
|
|
1702
|
+
* and invokes its handle method. If no handler is found or defined, the event is emitted
|
|
1703
|
+
* up the component hierarchy via the listenEvent output.
|
|
1704
|
+
* @param {IBaseCustomEvent | ICrudFormEvent | CustomEvent} event - The event to handle
|
|
1705
|
+
* @return {Promise<void>} A promise that resolves when event handling is complete
|
|
1706
|
+
* @mermaid
|
|
1707
|
+
* sequenceDiagram
|
|
1708
|
+
* participant C as Child Component
|
|
1709
|
+
* participant D as NgxDecafComponentDirective
|
|
1710
|
+
* participant H as Event Handler
|
|
1711
|
+
* participant P as Parent Component
|
|
1712
|
+
*
|
|
1713
|
+
* C->>D: handleEvent(event)
|
|
1714
|
+
* alt Event is CustomEvent
|
|
1715
|
+
* D->>D: Extract event.detail
|
|
1716
|
+
* end
|
|
1717
|
+
* D->>D: Get event name and handlers
|
|
1718
|
+
* alt Handlers defined
|
|
1719
|
+
* alt Handler exists for event
|
|
1720
|
+
* D->>H: new Handler(router)
|
|
1721
|
+
* D->>H: handle(event)
|
|
1722
|
+
* H-->>D: return result
|
|
1723
|
+
* else No handler found
|
|
1724
|
+
* D->>D: log.debug("No handler found")
|
|
1725
|
+
* end
|
|
1726
|
+
* else No handlers
|
|
1727
|
+
* D->>P: listenEvent.emit(event)
|
|
1728
|
+
* end
|
|
1729
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1730
|
+
*/
|
|
1432
1731
|
handleEvent(event: IBaseCustomEvent | ICrudFormEvent | CustomEvent): Promise<void>;
|
|
1732
|
+
/**
|
|
1733
|
+
* @description Determines if a specific operation is allowed in the current context.
|
|
1734
|
+
* @summary This method checks if an operation is included in the list of available
|
|
1735
|
+
* CRUD operations and if it's not the current operation (unless the current operation
|
|
1736
|
+
* is CREATE). This is used to enable/disable or show/hide operation buttons in the UI.
|
|
1737
|
+
* Returns false if the operations array is undefined or the operation is not in the list.
|
|
1738
|
+
* @param {string} operation - The operation to check
|
|
1739
|
+
* @return {boolean} True if the operation is allowed, false otherwise
|
|
1740
|
+
* @mermaid
|
|
1741
|
+
* sequenceDiagram
|
|
1742
|
+
* participant D as NgxDecafComponentDirective
|
|
1743
|
+
* participant U as UI
|
|
1744
|
+
*
|
|
1745
|
+
* U->>D: isAllowed(operation)
|
|
1746
|
+
* alt operations is undefined
|
|
1747
|
+
* D-->>U: Return false
|
|
1748
|
+
* else
|
|
1749
|
+
* D->>D: Check if operation is in operations
|
|
1750
|
+
* D->>D: Check if operation is not current operation
|
|
1751
|
+
* D-->>U: Return result
|
|
1752
|
+
* end
|
|
1753
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1754
|
+
*/
|
|
1755
|
+
isAllowed(operation: string): boolean;
|
|
1756
|
+
/**
|
|
1757
|
+
* @description Navigates to a different operation for the current model.
|
|
1758
|
+
* @summary This method constructs a navigation URL based on the component's base route,
|
|
1759
|
+
* the requested operation, and optionally a model ID. It then uses the Angular router
|
|
1760
|
+
* service to navigate to the constructed URL. This is typically used when switching
|
|
1761
|
+
* between different CRUD operations (create, read, update, delete) on a model.
|
|
1762
|
+
* The URL format is: {route}/{operation}/{id?}
|
|
1763
|
+
* @param {string} operation - The operation to navigate to (e.g., 'create', 'read', 'update', 'delete')
|
|
1764
|
+
* @param {string} [id] - Optional model ID to include in the navigation URL
|
|
1765
|
+
* @return {Promise<boolean>} A promise that resolves to true if navigation was successful
|
|
1766
|
+
* @mermaid
|
|
1767
|
+
* sequenceDiagram
|
|
1768
|
+
* participant U as UI
|
|
1769
|
+
* participant D as NgxDecafComponentDirective
|
|
1770
|
+
* participant R as Router
|
|
1771
|
+
*
|
|
1772
|
+
* U->>D: Click operation button
|
|
1773
|
+
* D->>D: changeOperation(operation, id)
|
|
1774
|
+
* D->>D: Construct navigation URL
|
|
1775
|
+
* Note over D: URL: {route}/{operation}/{id?}
|
|
1776
|
+
* D->>R: navigateByUrl(page)
|
|
1777
|
+
* R->>R: Navigate to new route
|
|
1778
|
+
* R-->>D: Return navigation result
|
|
1779
|
+
* D-->>U: Display new operation view
|
|
1780
|
+
* @memberOf module:lib/engine/NgxDecafComponentDirective
|
|
1781
|
+
*/
|
|
1782
|
+
changeOperation(operation: string, id?: string): Promise<boolean>;
|
|
1433
1783
|
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>;
|
|
1784
|
+
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; }; "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
1785
|
}
|
|
1436
1786
|
|
|
1437
1787
|
/**
|
|
1788
|
+
* @description Abstract base directive for CRUD form fields in Angular applications.
|
|
1789
|
+
* @summary Provides the foundation for all form field components in Decaf applications by implementing
|
|
1790
|
+
* Angular's ControlValueAccessor interface and FieldProperties for validation. This directive manages
|
|
1791
|
+
* form control integration, validation state, multi-entry forms (FormArrays), and CRUD operation context.
|
|
1792
|
+
* It handles form group lifecycle, error messaging, change detection, and parent-child form relationships.
|
|
1793
|
+
* Extend this class to create custom form field components that seamlessly integrate with Angular's
|
|
1794
|
+
* reactive forms and Decaf's validation system.
|
|
1438
1795
|
* @class NgxDecafFormFieldDirective
|
|
1439
|
-
* @
|
|
1796
|
+
* @extends {NgxDecafComponentDirective}
|
|
1440
1797
|
* @implements {ControlValueAccessor}
|
|
1441
|
-
* @
|
|
1442
|
-
* @
|
|
1443
|
-
*
|
|
1798
|
+
* @implements {FieldProperties}
|
|
1799
|
+
* @example
|
|
1800
|
+
* ```typescript
|
|
1801
|
+
* @Component({
|
|
1802
|
+
* selector: 'app-text-field',
|
|
1803
|
+
* templateUrl: './text-field.component.html',
|
|
1804
|
+
* providers: [{
|
|
1805
|
+
* provide: NG_VALUE_ACCESSOR,
|
|
1806
|
+
* useExisting: forwardRef(() => TextFieldComponent),
|
|
1807
|
+
* multi: true
|
|
1808
|
+
* }]
|
|
1809
|
+
* })
|
|
1810
|
+
* export class TextFieldComponent extends NgxDecafFormFieldDirective {
|
|
1811
|
+
* constructor() {
|
|
1812
|
+
* super();
|
|
1813
|
+
* }
|
|
1814
|
+
* }
|
|
1815
|
+
* ```
|
|
1444
1816
|
*/
|
|
1445
1817
|
declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirective implements ControlValueAccessor, FieldProperties {
|
|
1446
1818
|
/**
|
|
@@ -1448,68 +1820,197 @@ declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirec
|
|
|
1448
1820
|
* @summary When working with multiple form groups (form arrays), this indicates
|
|
1449
1821
|
* which form group is currently active or being edited. This is used to manage
|
|
1450
1822
|
* focus and data binding in multi-entry scenarios.
|
|
1451
|
-
*
|
|
1452
1823
|
* @type {number}
|
|
1453
1824
|
* @default 0
|
|
1454
|
-
* @
|
|
1825
|
+
* @public
|
|
1455
1826
|
*/
|
|
1456
1827
|
activeFormGroupIndex: number;
|
|
1828
|
+
operation: CrudOperations;
|
|
1457
1829
|
/**
|
|
1458
|
-
* @description
|
|
1459
|
-
* @summary
|
|
1460
|
-
*
|
|
1461
|
-
*
|
|
1462
|
-
*
|
|
1463
|
-
* @type {
|
|
1464
|
-
* @
|
|
1830
|
+
* @description Parent form container for this field.
|
|
1831
|
+
* @summary Reference to the parent FormGroup or FormArray that contains this field.
|
|
1832
|
+
* When this field is part of a multi-entry structure, this contains the FormArray
|
|
1833
|
+
* with all form groups. This enables management of multiple instances of the same
|
|
1834
|
+
* field structure within a single form.
|
|
1835
|
+
* @type {FormParent}
|
|
1836
|
+
* @public
|
|
1465
1837
|
*/
|
|
1466
1838
|
parentComponent: FormParent;
|
|
1467
1839
|
/**
|
|
1468
|
-
* @description Field mapping configuration.
|
|
1840
|
+
* @description Field mapping configuration for options.
|
|
1469
1841
|
* @summary Defines how fields from the data model should be mapped to properties used by the component.
|
|
1470
1842
|
* This allows for flexible data binding between the model and the component's display logic.
|
|
1471
|
-
*
|
|
1843
|
+
* Can be either a key-value mapping object or a function that performs the mapping.
|
|
1472
1844
|
* @type {KeyValue | FunctionLike}
|
|
1473
|
-
* @
|
|
1845
|
+
* @public
|
|
1474
1846
|
*/
|
|
1475
1847
|
optionsMapper: KeyValue | FunctionLike;
|
|
1476
1848
|
/**
|
|
1477
|
-
* @
|
|
1478
|
-
* @
|
|
1849
|
+
* @description Angular FormGroup instance for the field.
|
|
1850
|
+
* @summary The FormGroup that contains this field's FormControl. Used for managing
|
|
1851
|
+
* the field's validation state and value within the reactive forms structure.
|
|
1852
|
+
* @type {FormGroup | undefined}
|
|
1853
|
+
* @public
|
|
1479
1854
|
*/
|
|
1480
|
-
|
|
1855
|
+
formGroup: FormGroup | undefined;
|
|
1481
1856
|
/**
|
|
1482
|
-
* @
|
|
1483
|
-
* @
|
|
1857
|
+
* @description Angular FormControl instance for this field.
|
|
1858
|
+
* @summary The FormControl that manages this field's value, validation state, and user interactions.
|
|
1859
|
+
* @type {FormControl}
|
|
1860
|
+
* @public
|
|
1484
1861
|
*/
|
|
1485
|
-
formGroup: FormGroup | undefined;
|
|
1486
1862
|
formControl: FormControl;
|
|
1863
|
+
/**
|
|
1864
|
+
* @description Dot-separated path to this field in the form structure.
|
|
1865
|
+
* @summary Used to locate this field within nested form structures.
|
|
1866
|
+
* @type {string}
|
|
1867
|
+
* @public
|
|
1868
|
+
*/
|
|
1487
1869
|
path: string;
|
|
1870
|
+
/**
|
|
1871
|
+
* @description The input type of this field.
|
|
1872
|
+
* @summary Determines the HTML input type or component type to render.
|
|
1873
|
+
* @type {PossibleInputTypes}
|
|
1874
|
+
* @public
|
|
1875
|
+
*/
|
|
1488
1876
|
type: PossibleInputTypes;
|
|
1877
|
+
/**
|
|
1878
|
+
* @description Whether the field is disabled.
|
|
1879
|
+
* @summary When true, the field cannot be edited by the user.
|
|
1880
|
+
* @type {boolean}
|
|
1881
|
+
* @public
|
|
1882
|
+
*/
|
|
1489
1883
|
disabled?: boolean;
|
|
1884
|
+
/**
|
|
1885
|
+
* @description Page number for multi-page forms.
|
|
1886
|
+
* @summary Indicates which page this field belongs to in a multi-page form structure.
|
|
1887
|
+
* @type {number}
|
|
1888
|
+
* @public
|
|
1889
|
+
*/
|
|
1490
1890
|
page: number;
|
|
1891
|
+
/**
|
|
1892
|
+
* @description Date/time format string for parsing and display.
|
|
1893
|
+
* @type {string}
|
|
1894
|
+
* @public
|
|
1895
|
+
*/
|
|
1491
1896
|
format?: string;
|
|
1897
|
+
/**
|
|
1898
|
+
* @description Controls field visibility based on CRUD operations.
|
|
1899
|
+
* @summary Can be a boolean or an array of operation keys where the field should be hidden.
|
|
1900
|
+
* @type {boolean | CrudOperationKeys[]}
|
|
1901
|
+
* @public
|
|
1902
|
+
*/
|
|
1492
1903
|
hidden?: boolean | CrudOperationKeys[];
|
|
1904
|
+
/**
|
|
1905
|
+
* @description Maximum value or date allowed.
|
|
1906
|
+
* @type {number | Date}
|
|
1907
|
+
* @public
|
|
1908
|
+
*/
|
|
1493
1909
|
max?: number | Date;
|
|
1910
|
+
/**
|
|
1911
|
+
* @description Maximum length for text input.
|
|
1912
|
+
* @type {number}
|
|
1913
|
+
* @public
|
|
1914
|
+
*/
|
|
1494
1915
|
maxlength?: number;
|
|
1916
|
+
/**
|
|
1917
|
+
* @description Minimum value or date allowed.
|
|
1918
|
+
* @type {number | Date}
|
|
1919
|
+
* @public
|
|
1920
|
+
*/
|
|
1495
1921
|
min?: number | Date;
|
|
1922
|
+
/**
|
|
1923
|
+
* @description Minimum length for text input.
|
|
1924
|
+
* @type {number}
|
|
1925
|
+
* @public
|
|
1926
|
+
*/
|
|
1496
1927
|
minlength?: number;
|
|
1928
|
+
/**
|
|
1929
|
+
* @description Regex pattern for validation.
|
|
1930
|
+
* @type {string | undefined}
|
|
1931
|
+
* @public
|
|
1932
|
+
*/
|
|
1497
1933
|
pattern?: string | undefined;
|
|
1934
|
+
/**
|
|
1935
|
+
* @description Whether the field is read-only.
|
|
1936
|
+
* @type {boolean}
|
|
1937
|
+
* @public
|
|
1938
|
+
*/
|
|
1498
1939
|
readonly?: boolean;
|
|
1940
|
+
/**
|
|
1941
|
+
* @description Whether the field is required.
|
|
1942
|
+
* @type {boolean}
|
|
1943
|
+
* @public
|
|
1944
|
+
*/
|
|
1499
1945
|
required?: boolean;
|
|
1946
|
+
/**
|
|
1947
|
+
* @description Step value for numeric inputs.
|
|
1948
|
+
* @type {number}
|
|
1949
|
+
* @public
|
|
1950
|
+
*/
|
|
1500
1951
|
step?: number;
|
|
1952
|
+
/**
|
|
1953
|
+
* @description Field name that this field's value must equal.
|
|
1954
|
+
* @type {string}
|
|
1955
|
+
* @public
|
|
1956
|
+
*/
|
|
1501
1957
|
equals?: string;
|
|
1958
|
+
/**
|
|
1959
|
+
* @description Field name that this field's value must differ from.
|
|
1960
|
+
* @type {string}
|
|
1961
|
+
* @public
|
|
1962
|
+
*/
|
|
1502
1963
|
different?: string;
|
|
1964
|
+
/**
|
|
1965
|
+
* @description Field name that this field's value must be less than.
|
|
1966
|
+
* @type {string}
|
|
1967
|
+
* @public
|
|
1968
|
+
*/
|
|
1503
1969
|
lessThan?: string;
|
|
1970
|
+
/**
|
|
1971
|
+
* @description Field name that this field's value must be less than or equal to.
|
|
1972
|
+
* @type {string}
|
|
1973
|
+
* @public
|
|
1974
|
+
*/
|
|
1504
1975
|
lessThanOrEqual?: string;
|
|
1976
|
+
/**
|
|
1977
|
+
* @description Field name that this field's value must be greater than.
|
|
1978
|
+
* @type {string}
|
|
1979
|
+
* @public
|
|
1980
|
+
*/
|
|
1505
1981
|
greaterThan?: string;
|
|
1982
|
+
/**
|
|
1983
|
+
* @description Field name that this field's value must be greater than or equal to.
|
|
1984
|
+
* @type {string}
|
|
1985
|
+
* @public
|
|
1986
|
+
*/
|
|
1506
1987
|
greaterThanOrEqual?: string;
|
|
1988
|
+
/**
|
|
1989
|
+
* @description Current value of the field.
|
|
1990
|
+
* @summary Can be a string, number, date, or array of strings for multi-select fields.
|
|
1991
|
+
* @type {string | number | Date | string[]}
|
|
1992
|
+
* @public
|
|
1993
|
+
*/
|
|
1507
1994
|
value: string | number | Date | string[];
|
|
1995
|
+
/**
|
|
1996
|
+
* @description Whether the field supports multiple values.
|
|
1997
|
+
* @summary When true, the field is rendered as part of a FormArray structure.
|
|
1998
|
+
* @type {boolean}
|
|
1999
|
+
* @public
|
|
2000
|
+
*/
|
|
1508
2001
|
multiple: boolean;
|
|
2002
|
+
/**
|
|
2003
|
+
* @description Flag tracking if validation error event has been dispatched.
|
|
2004
|
+
* @summary Prevents duplicate validation error events from being dispatched.
|
|
2005
|
+
* @type {boolean}
|
|
2006
|
+
* @private
|
|
2007
|
+
*/
|
|
1509
2008
|
private validationErrorEventDispatched;
|
|
1510
2009
|
/**
|
|
1511
|
-
* @
|
|
1512
|
-
* @
|
|
2010
|
+
* @description Reference to the parent HTML element.
|
|
2011
|
+
* @summary Used for DOM manipulation and event handling.
|
|
2012
|
+
* @type {HTMLElement}
|
|
2013
|
+
* @protected
|
|
1513
2014
|
*/
|
|
1514
2015
|
protected parent?: HTMLElement;
|
|
1515
2016
|
constructor();
|
|
@@ -1518,75 +2019,131 @@ declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirec
|
|
|
1518
2019
|
* @summary Returns the appropriate FormGroup based on whether this field supports
|
|
1519
2020
|
* multiple values. For single-value fields, returns the main form group.
|
|
1520
2021
|
* For multi-value fields, returns the form group at the active index from the parent FormArray.
|
|
1521
|
-
*
|
|
1522
|
-
* @
|
|
1523
|
-
* @
|
|
2022
|
+
* If no formGroup is set, returns the parent of the formControl.
|
|
2023
|
+
* @return {FormGroup} The currently active FormGroup for this field
|
|
2024
|
+
* @public
|
|
1524
2025
|
*/
|
|
1525
2026
|
get activeFormGroup(): FormGroup;
|
|
1526
2027
|
/**
|
|
1527
|
-
* @
|
|
1528
|
-
* @
|
|
1529
|
-
*
|
|
2028
|
+
* @description String formatting utility function.
|
|
2029
|
+
* @summary Provides access to the sf (string format) function for formatting error messages
|
|
2030
|
+
* and other string templates. Used primarily for localizing and parameterizing validation messages.
|
|
2031
|
+
* @type {function(string, ...string): string}
|
|
2032
|
+
* @public
|
|
1530
2033
|
*/
|
|
1531
2034
|
sf: typeof _decaf_ts_decorator_validation.stringFormat;
|
|
1532
2035
|
/**
|
|
1533
|
-
* @
|
|
1534
|
-
* @
|
|
1535
|
-
*
|
|
2036
|
+
* @description Callback function invoked when the field value changes.
|
|
2037
|
+
* @summary Function registered by Angular's forms system through registerOnChange.
|
|
2038
|
+
* Called automatically when the field's value is updated to notify the form of the change.
|
|
2039
|
+
* @type {function(): unknown}
|
|
2040
|
+
* @public
|
|
1536
2041
|
*/
|
|
1537
2042
|
onChange: () => unknown;
|
|
1538
2043
|
/**
|
|
1539
|
-
* @
|
|
1540
|
-
* @
|
|
1541
|
-
*
|
|
2044
|
+
* @description Callback function invoked when the field is touched.
|
|
2045
|
+
* @summary Function registered by Angular's forms system through registerOnTouched.
|
|
2046
|
+
* Called when the field is blurred or otherwise marked as touched.
|
|
2047
|
+
* @type {function(): unknown}
|
|
2048
|
+
* @public
|
|
1542
2049
|
*/
|
|
1543
2050
|
onTouch: () => unknown;
|
|
1544
2051
|
/**
|
|
1545
|
-
* @
|
|
1546
|
-
* @
|
|
2052
|
+
* @description Writes a value to the form field.
|
|
2053
|
+
* @summary Part of Angular's ControlValueAccessor interface. Sets the field's value
|
|
2054
|
+
* when the form programmatically updates it. This is called by Angular forms when
|
|
2055
|
+
* the model value changes.
|
|
1547
2056
|
* @param {string} obj - The value to be set
|
|
2057
|
+
* @return {void}
|
|
2058
|
+
* @public
|
|
1548
2059
|
*/
|
|
1549
2060
|
writeValue(obj: string): void;
|
|
1550
2061
|
/**
|
|
1551
|
-
* @
|
|
1552
|
-
* @
|
|
2062
|
+
* @description Registers the onChange callback function.
|
|
2063
|
+
* @summary Part of Angular's ControlValueAccessor interface. Stores the function
|
|
2064
|
+
* that Angular forms provides to be called when the field value changes.
|
|
1553
2065
|
* @param {function(): unknown} fn - The function to be called on change
|
|
2066
|
+
* @return {void}
|
|
2067
|
+
* @public
|
|
1554
2068
|
*/
|
|
1555
2069
|
registerOnChange(fn: () => unknown): void;
|
|
1556
2070
|
/**
|
|
1557
|
-
* @
|
|
1558
|
-
* @
|
|
2071
|
+
* @description Registers the onTouched callback function.
|
|
2072
|
+
* @summary Part of Angular's ControlValueAccessor interface. Stores the function
|
|
2073
|
+
* that Angular forms provides to be called when the field is touched/blurred.
|
|
1559
2074
|
* @param {function(): unknown} fn - The function to be called on touch
|
|
2075
|
+
* @return {void}
|
|
2076
|
+
* @public
|
|
1560
2077
|
*/
|
|
1561
2078
|
registerOnTouched(fn: () => unknown): void;
|
|
1562
2079
|
/**
|
|
1563
|
-
* @
|
|
1564
|
-
* @
|
|
2080
|
+
* @description Sets the disabled state of the field.
|
|
2081
|
+
* @summary Part of Angular's ControlValueAccessor interface. Called by Angular forms
|
|
2082
|
+
* when the disabled state of the control changes.
|
|
1565
2083
|
* @param {boolean} isDisabled - Whether the field should be disabled
|
|
2084
|
+
* @return {void}
|
|
2085
|
+
* @public
|
|
1566
2086
|
*/
|
|
1567
2087
|
setDisabledState?(isDisabled: boolean): void;
|
|
1568
2088
|
/**
|
|
1569
|
-
* @
|
|
1570
|
-
* @
|
|
1571
|
-
*
|
|
2089
|
+
* @description Performs setup after the view has been initialized.
|
|
2090
|
+
* @summary Retrieves and returns the parent HTML element based on the current CRUD operation.
|
|
2091
|
+
* For READ and DELETE operations, returns the immediate parent element. For CREATE and UPDATE
|
|
2092
|
+
* operations, finds the parent div element and registers it with the form service.
|
|
2093
|
+
* @return {HTMLElement} The parent element of the field
|
|
2094
|
+
* @throws {RenderingError} If unable to retrieve parent form element for CREATE/UPDATE operations
|
|
2095
|
+
* @throws {InternalError} If the operation is invalid
|
|
2096
|
+
* @public
|
|
1572
2097
|
*/
|
|
1573
2098
|
afterViewInit(): HTMLElement;
|
|
2099
|
+
/**
|
|
2100
|
+
* @description Angular lifecycle hook for detecting input property changes.
|
|
2101
|
+
* @summary Overrides the parent ngOnChanges to handle changes to activeFormGroupIndex and value.
|
|
2102
|
+
* When activeFormGroupIndex changes in a multiple field scenario, updates the active form group
|
|
2103
|
+
* and form control. When value changes, updates the form control value. Delegates to parent
|
|
2104
|
+
* implementation for initial change detection.
|
|
2105
|
+
* @param {SimpleChanges} changes - Object containing the changed properties
|
|
2106
|
+
* @return {void}
|
|
2107
|
+
* @public
|
|
2108
|
+
*/
|
|
1574
2109
|
ngOnChanges(changes: SimpleChanges): void;
|
|
2110
|
+
/**
|
|
2111
|
+
* @description Cleanup logic when the component is destroyed.
|
|
2112
|
+
* @summary Unregisters the form group from the form service to prevent memory leaks
|
|
2113
|
+
* and clean up form references.
|
|
2114
|
+
* @return {void}
|
|
2115
|
+
* @public
|
|
2116
|
+
*/
|
|
1575
2117
|
onDestroy(): void;
|
|
2118
|
+
/**
|
|
2119
|
+
* @description Sets the value of the form control.
|
|
2120
|
+
* @summary Updates the form control's value and triggers validation. This is used
|
|
2121
|
+
* when the value needs to be programmatically updated from outside the form control.
|
|
2122
|
+
* @param {unknown} value - The value to set
|
|
2123
|
+
* @return {void}
|
|
2124
|
+
* @public
|
|
2125
|
+
*/
|
|
1576
2126
|
setValue(value: unknown): void;
|
|
2127
|
+
/**
|
|
2128
|
+
* @description Retrieves validation error messages for the field.
|
|
2129
|
+
* @summary Checks the form control for validation errors and returns formatted error messages.
|
|
2130
|
+
* If errors exist, dispatches a validation error event to parent accordion components.
|
|
2131
|
+
* Error messages are translated and formatted with relevant field properties.
|
|
2132
|
+
* @param {HTMLElement} parent - The parent HTML element used to find accordion components
|
|
2133
|
+
* @return {string | void} Formatted error message string, or void if no errors
|
|
2134
|
+
* @public
|
|
2135
|
+
*/
|
|
1577
2136
|
getErrors(parent: HTMLElement): string | void;
|
|
1578
2137
|
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>;
|
|
2138
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxDecafFormFieldDirective, 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
2139
|
}
|
|
1581
2140
|
|
|
1582
2141
|
/**
|
|
1583
|
-
* @module
|
|
2142
|
+
* @module lib/engine/NgxDecafFormService
|
|
1584
2143
|
* @description Utilities to create and manage Angular forms in Decaf components.
|
|
1585
2144
|
* @summary The NgxDecafFormService exposes helpers to build FormGroup/FormArray instances
|
|
1586
2145
|
* from component metadata or UI model definitions, register forms in a registry,
|
|
1587
2146
|
* validate and extract form data, and create controls with appropriate validators.
|
|
1588
|
-
*
|
|
1589
|
-
* @link {@link NgxDecafFormService}
|
|
1590
2147
|
*/
|
|
1591
2148
|
|
|
1592
2149
|
/**
|
|
@@ -1610,7 +2167,6 @@ declare abstract class NgxDecafFormFieldDirective extends NgxDecafComponentDirec
|
|
|
1610
2167
|
*
|
|
1611
2168
|
* // Getting form data
|
|
1612
2169
|
* const formData = NgxDecafFormService.getFormData(form);
|
|
1613
|
-
*
|
|
1614
2170
|
* @mermaid
|
|
1615
2171
|
* sequenceDiagram
|
|
1616
2172
|
* participant C as Component
|
|
@@ -1632,46 +2188,42 @@ declare class NgxDecafFormService {
|
|
|
1632
2188
|
* @description WeakMap that stores control properties for form controls.
|
|
1633
2189
|
* @summary A WeakMap that associates AbstractControl instances with their corresponding FieldProperties.
|
|
1634
2190
|
* This allows the service to track metadata for form controls without creating memory leaks.
|
|
1635
|
-
*
|
|
1636
2191
|
* @type {WeakMap<AbstractControl, FieldProperties>}
|
|
1637
2192
|
* @private
|
|
1638
2193
|
* @static
|
|
1639
|
-
* @memberOf NgxDecafFormService
|
|
1640
2194
|
*/
|
|
1641
2195
|
private static controls;
|
|
1642
2196
|
/**
|
|
1643
2197
|
* @description Registry of form groups indexed by their unique identifiers.
|
|
1644
2198
|
* @summary A Map that stores FormGroup instances with their unique string identifiers.
|
|
1645
2199
|
* This allows global access to registered forms throughout the application.
|
|
1646
|
-
*
|
|
1647
2200
|
* @type {Map<string, FormGroup>}
|
|
1648
2201
|
* @private
|
|
1649
2202
|
* @static
|
|
1650
|
-
* @memberOf NgxDecafFormService
|
|
1651
2203
|
*/
|
|
1652
2204
|
private static formRegistry;
|
|
1653
2205
|
/**
|
|
1654
2206
|
* @description Creates a new form group or form array with the specified identifier.
|
|
1655
|
-
* @summary Generates a FormGroup or FormArray based on the provided
|
|
1656
|
-
*
|
|
1657
|
-
*
|
|
1658
|
-
*
|
|
2207
|
+
* @summary Generates a FormGroup or FormArray based on the provided parameters. If formArray is true,
|
|
2208
|
+
* creates a FormArray; otherwise creates a FormGroup. The form can optionally be registered in the
|
|
2209
|
+
* global form registry for later access throughout the application. If a form with the given id
|
|
2210
|
+
* already exists in the registry, it returns the existing form.
|
|
1659
2211
|
* @param {string} id - Unique identifier for the form
|
|
1660
|
-
* @param {
|
|
2212
|
+
* @param {boolean} [formArray=false] - Whether to create a FormArray instead of a FormGroup
|
|
1661
2213
|
* @param {boolean} [registry=true] - Whether to register the form in the global registry
|
|
1662
|
-
* @return {FormGroup | FormArray} The created form instance
|
|
1663
|
-
*
|
|
2214
|
+
* @return {FormGroup | FormArray} The created or existing form instance
|
|
1664
2215
|
* @mermaid
|
|
1665
2216
|
* sequenceDiagram
|
|
1666
2217
|
* participant C as Component
|
|
1667
2218
|
* participant NFS as NgxDecafFormService
|
|
1668
2219
|
* participant FR as Form Registry
|
|
1669
2220
|
* participant AF as Angular Forms
|
|
1670
|
-
*
|
|
1671
|
-
* C->>NFS: createForm(id, props, registry)
|
|
2221
|
+
* C->>NFS: createForm(id, formArray, registry)
|
|
1672
2222
|
* NFS->>FR: Check if form exists
|
|
1673
|
-
* alt Form
|
|
1674
|
-
*
|
|
2223
|
+
* alt Form exists
|
|
2224
|
+
* FR-->>NFS: Return existing form
|
|
2225
|
+
* else Form doesn't exist
|
|
2226
|
+
* alt formArray is true
|
|
1675
2227
|
* NFS->>AF: new FormArray([])
|
|
1676
2228
|
* else
|
|
1677
2229
|
* NFS->>AF: new FormGroup({})
|
|
@@ -1681,9 +2233,7 @@ declare class NgxDecafFormService {
|
|
|
1681
2233
|
* end
|
|
1682
2234
|
* end
|
|
1683
2235
|
* NFS-->>C: Return FormGroup | FormArray
|
|
1684
|
-
*
|
|
1685
2236
|
* @static
|
|
1686
|
-
* @memberOf NgxDecafFormService
|
|
1687
2237
|
*/
|
|
1688
2238
|
static createForm(id: string, formArray?: boolean, registry?: boolean): FormGroup | FormArray;
|
|
1689
2239
|
/**
|
|
@@ -1691,28 +2241,31 @@ declare class NgxDecafFormService {
|
|
|
1691
2241
|
* @summary Registers a FormGroup or FormArray with a unique identifier for global access throughout
|
|
1692
2242
|
* the application. This allows forms to be retrieved and managed centrally. Throws an error if
|
|
1693
2243
|
* the identifier is already in use to prevent conflicts.
|
|
1694
|
-
*
|
|
1695
2244
|
* @param {string} formId - The unique identifier for the form
|
|
1696
2245
|
* @param {FormParent} formGroup - The FormGroup or FormArray to be registered
|
|
1697
2246
|
* @return {void}
|
|
1698
2247
|
* @throws {Error} If a FormGroup with the given id is already registered
|
|
1699
|
-
*
|
|
1700
2248
|
* @static
|
|
1701
|
-
* @memberOf NgxDecafFormService
|
|
1702
2249
|
*/
|
|
1703
2250
|
static addRegistry(formId: string, formGroup: FormParent): void;
|
|
2251
|
+
/**
|
|
2252
|
+
* @description Retrieves a form from the registry by its identifier.
|
|
2253
|
+
* @summary Gets a FormGroup or FormArray from the registry using its unique identifier.
|
|
2254
|
+
* Returns undefined if the form is not found in the registry. This method provides
|
|
2255
|
+
* safe access to registered forms without throwing errors.
|
|
2256
|
+
* @param {string} [id] - The unique identifier of the form to retrieve
|
|
2257
|
+
* @return {FormParent | undefined} The FormGroup or FormArray if found, undefined otherwise
|
|
2258
|
+
* @static
|
|
2259
|
+
*/
|
|
1704
2260
|
static getOnRegistry(id?: string): FormParent | undefined;
|
|
1705
2261
|
/**
|
|
1706
2262
|
* @description Removes a form from the registry.
|
|
1707
2263
|
* @summary Deletes a FormGroup or FormArray from the registry using its unique identifier.
|
|
1708
2264
|
* This cleans up the registry and allows the identifier to be reused. The form itself
|
|
1709
2265
|
* is not destroyed, only removed from the central registry.
|
|
1710
|
-
*
|
|
1711
2266
|
* @param {string} formId - The unique identifier of the form to be removed
|
|
1712
2267
|
* @return {void}
|
|
1713
|
-
*
|
|
1714
2268
|
* @static
|
|
1715
|
-
* @memberOf NgxDecafFormService
|
|
1716
2269
|
*/
|
|
1717
2270
|
static removeRegistry(formId: string): void;
|
|
1718
2271
|
/**
|
|
@@ -1720,20 +2273,17 @@ declare class NgxDecafFormService {
|
|
|
1720
2273
|
* @summary Traverses the form group structure to find the parent group and control name for a given path.
|
|
1721
2274
|
* Handles complex nested structures including arrays and sub-groups. Creates missing intermediate
|
|
1722
2275
|
* groups as needed and properly configures FormArray controls for multiple value scenarios.
|
|
1723
|
-
*
|
|
1724
2276
|
* @param {FormGroup} formGroup - The root FormGroup to traverse
|
|
1725
2277
|
* @param {string} path - The dot-separated path to the control (e.g., 'user.address.street')
|
|
1726
2278
|
* @param {IComponentInput} componentProps - Properties defining the component configuration
|
|
1727
2279
|
* @param {KeyValue} parentProps - Properties from the parent component for context
|
|
1728
2280
|
* @return {FormParentGroup} A tuple containing the parent FormGroup and the control name
|
|
1729
|
-
*
|
|
1730
2281
|
* @private
|
|
1731
2282
|
* @mermaid
|
|
1732
2283
|
* sequenceDiagram
|
|
1733
2284
|
* participant NFS as NgxDecafFormService
|
|
1734
2285
|
* participant FG as FormGroup
|
|
1735
2286
|
* participant FA as FormArray
|
|
1736
|
-
*
|
|
1737
2287
|
* NFS->>NFS: Split path into parts
|
|
1738
2288
|
* loop For each path part
|
|
1739
2289
|
* alt Control doesn't exist
|
|
@@ -1747,95 +2297,90 @@ declare class NgxDecafFormService {
|
|
|
1747
2297
|
* NFS->>NFS: Navigate to next level
|
|
1748
2298
|
* end
|
|
1749
2299
|
* NFS-->>NFS: Return [parentGroup, controlName]
|
|
1750
|
-
*
|
|
1751
2300
|
* @static
|
|
1752
|
-
* @memberOf NgxDecafFormService
|
|
1753
2301
|
*/
|
|
1754
2302
|
private static resolveParentGroup;
|
|
1755
2303
|
/**
|
|
1756
2304
|
* @description Retrieves component properties from a FormGroup or FormArray.
|
|
1757
2305
|
* @summary Extracts component properties stored in the form group metadata. If a FormGroup is provided
|
|
1758
2306
|
* and groupArrayName is specified, it will look for the FormArray within the form structure.
|
|
1759
|
-
*
|
|
1760
2307
|
* @param {FormGroup | FormArray} formGroup - The form group or form array to extract properties from
|
|
1761
2308
|
* @param {string} [key] - Optional key to retrieve a specific property
|
|
1762
2309
|
* @param {string} [groupArrayName] - Optional name of the group array if formGroup is not a FormArray
|
|
1763
2310
|
* @return {Partial<FieldProperties>} The component properties or a specific property if key is provided
|
|
1764
|
-
*
|
|
1765
2311
|
* @static
|
|
1766
|
-
* @memberOf NgxDecafFormService
|
|
1767
2312
|
*/
|
|
1768
2313
|
static getComponentPropsFromGroupArray(formGroup: FormGroup | FormArray, key?: string, groupArrayName?: string | undefined): Partial<FieldProperties>;
|
|
1769
2314
|
/**
|
|
1770
2315
|
* @description Adds a new group to a parent FormArray.
|
|
1771
2316
|
* @summary Creates and adds a new FormGroup to the specified parent FormArray based on the
|
|
1772
2317
|
* 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
|
|
1776
|
-
* @param {number} index - The index position
|
|
1777
|
-
* @return {
|
|
1778
|
-
*
|
|
2318
|
+
* where new groups need to be added at runtime. Clones the control at the specified index
|
|
2319
|
+
* to maintain the same structure and validators.
|
|
2320
|
+
* @param {FormParent} parentForm - The FormArray or FormGroup containing the parent FormArray
|
|
2321
|
+
* @param {number} [index] - The index position to clone from; defaults to last index if length > 0, otherwise 0
|
|
2322
|
+
* @return {FormArray} The parent FormArray after adding the new group
|
|
1779
2323
|
* @static
|
|
1780
|
-
* @memberOf NgxDecafFormService
|
|
1781
2324
|
*/
|
|
1782
2325
|
static addGroupToParent(parentForm: FormParent, index?: number): FormArray;
|
|
1783
2326
|
/**
|
|
1784
2327
|
* @description Retrieves a FormGroup from a parent FormArray at the specified index.
|
|
1785
2328
|
* @summary Gets a FormGroup from the specified parent FormArray. If the group doesn't exist
|
|
1786
2329
|
* 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
|
|
2330
|
+
* @param {FormParent} formGroup - The root form group containing the parent FormArray
|
|
1789
2331
|
* @param {string} parentName - The name of the parent FormArray to retrieve the group from
|
|
1790
2332
|
* @param {number} [index=1] - The index of the group to retrieve
|
|
1791
2333
|
* @return {FormGroup} The FormGroup at the specified index
|
|
1792
|
-
*
|
|
1793
2334
|
* @static
|
|
1794
|
-
* @memberOf NgxDecafFormService
|
|
1795
2335
|
*/
|
|
1796
2336
|
static getGroupFromParent(formGroup: FormParent, parentName: string, index?: number): FormGroup;
|
|
2337
|
+
/**
|
|
2338
|
+
* @description Clones a form control with its validators.
|
|
2339
|
+
* @summary Creates a deep copy of a FormControl, FormGroup, or FormArray, preserving
|
|
2340
|
+
* validators but resetting values and state. This is useful for creating new instances
|
|
2341
|
+
* of form controls with the same validation rules, particularly in dynamic FormArrays
|
|
2342
|
+
* where new groups need to be added with identical structure.
|
|
2343
|
+
* @param {AbstractControl} control - The control to clone (FormControl, FormGroup, or FormArray)
|
|
2344
|
+
* @return {AbstractControl} A new instance of the control with the same validators
|
|
2345
|
+
* @throws {Error} If the control type is not supported
|
|
2346
|
+
* @static
|
|
2347
|
+
*/
|
|
1797
2348
|
static cloneFormControl(control: AbstractControl): AbstractControl;
|
|
1798
2349
|
/**
|
|
1799
2350
|
* @description Checks if a value is unique within a FormArray group.
|
|
1800
2351
|
* @summary Validates that the primary key value in a FormGroup is unique among all groups
|
|
1801
2352
|
* in the parent FormArray. The uniqueness check behavior differs based on the operation type.
|
|
1802
|
-
*
|
|
2353
|
+
* For both CREATE and UPDATE operations, it checks that no other group in the array has the same
|
|
2354
|
+
* primary key value.
|
|
1803
2355
|
* @param {FormGroup} formGroup - The FormGroup to check for uniqueness
|
|
1804
|
-
* @param {number} index - The index of the current group within the FormArray
|
|
1805
2356
|
* @param {OperationKeys} [operation=OperationKeys.CREATE] - The type of operation being performed
|
|
2357
|
+
* @param {number} [index] - The index of the current group within the FormArray
|
|
1806
2358
|
* @return {boolean} True if the value is unique, false otherwise
|
|
1807
|
-
*
|
|
1808
2359
|
* @static
|
|
1809
|
-
* @memberOf NgxDecafFormService
|
|
1810
2360
|
*/
|
|
1811
2361
|
static isUniqueOnGroup(formGroup: FormGroup, operation?: OperationKeys, index?: number): boolean;
|
|
1812
2362
|
/**
|
|
1813
2363
|
* @description Enables all controls within a FormGroup or FormArray.
|
|
1814
2364
|
* @summary Recursively enables all form controls within the provided FormGroup or FormArray.
|
|
1815
2365
|
* This is useful for making all controls interactive after they have been disabled.
|
|
1816
|
-
*
|
|
1817
2366
|
* @param {FormArray | FormGroup} formGroup - The FormGroup or FormArray to enable all controls for
|
|
1818
2367
|
* @return {void}
|
|
1819
|
-
*
|
|
1820
2368
|
* @static
|
|
1821
|
-
* @memberOf NgxDecafFormService
|
|
1822
2369
|
*/
|
|
1823
2370
|
static enableAllGroupControls(formGroup: FormArray | FormGroup): void;
|
|
1824
2371
|
/**
|
|
1825
2372
|
* @description Adds a form control to a form group based on component properties.
|
|
1826
2373
|
* @summary Creates and configures a FormControl within the specified FormGroup using the provided
|
|
1827
2374
|
* 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 {
|
|
2375
|
+
* This method supports complex form structures with nested groups and arrays. It also manages
|
|
2376
|
+
* page-based forms and FormArray indexing.
|
|
2377
|
+
* @param {FormParent} formGroup - The form group or form array to add the control to
|
|
1831
2378
|
* @param {IComponentInput} componentProps - The component properties defining the control configuration
|
|
1832
|
-
* @param {
|
|
2379
|
+
* @param {Partial<IComponentInput>} [parentProps={}] - Properties from the parent component for context
|
|
1833
2380
|
* @param {number} [index=0] - The index for multiple controls in FormArrays
|
|
1834
|
-
* @return {
|
|
1835
|
-
*
|
|
2381
|
+
* @return {FormParent} The updated form parent (FormGroup or FormArray)
|
|
1836
2382
|
* @private
|
|
1837
2383
|
* @static
|
|
1838
|
-
* @memberOf NgxDecafFormService
|
|
1839
2384
|
*/
|
|
1840
2385
|
private static addFormControl;
|
|
1841
2386
|
/**
|
|
@@ -1843,18 +2388,15 @@ declare class NgxDecafFormService {
|
|
|
1843
2388
|
* @summary Finds and returns an AbstractControl from a registered form using the form id and optional path.
|
|
1844
2389
|
* This method provides centralized access to form controls across the application by leveraging
|
|
1845
2390
|
* the form registry system.
|
|
1846
|
-
*
|
|
1847
2391
|
* @param {string} formId - The unique identifier of the form in the registry
|
|
1848
2392
|
* @param {string} [path] - The optional dot-separated path to a specific control within the form
|
|
1849
2393
|
* @return {AbstractControl} The requested AbstractControl (FormGroup, FormArray, or FormControl)
|
|
1850
2394
|
* @throws {Error} If the form is not found in the registry or the control is not found in the form
|
|
1851
|
-
*
|
|
1852
2395
|
* @mermaid
|
|
1853
2396
|
* sequenceDiagram
|
|
1854
2397
|
* participant C as Component
|
|
1855
2398
|
* participant NFS as NgxDecafFormService
|
|
1856
2399
|
* participant FR as Form Registry
|
|
1857
|
-
*
|
|
1858
2400
|
* C->>NFS: getControlFromForm(formId, path?)
|
|
1859
2401
|
* NFS->>FR: Get form by formId
|
|
1860
2402
|
* alt Form not found
|
|
@@ -1873,9 +2415,7 @@ declare class NgxDecafFormService {
|
|
|
1873
2415
|
* NFS-->>C: Return form
|
|
1874
2416
|
* end
|
|
1875
2417
|
* end
|
|
1876
|
-
*
|
|
1877
2418
|
* @static
|
|
1878
|
-
* @memberOf NgxDecafFormService
|
|
1879
2419
|
*/
|
|
1880
2420
|
static getControlFromForm(formId: string, path?: string): AbstractControl;
|
|
1881
2421
|
/**
|
|
@@ -1883,18 +2423,15 @@ declare class NgxDecafFormService {
|
|
|
1883
2423
|
* @summary Generates a FormGroup from an array of UIModelMetadata objects, extracting component
|
|
1884
2424
|
* properties and creating appropriate form controls. This method is specifically designed to work
|
|
1885
2425
|
* with the UI decorator system and provides automatic form generation from metadata.
|
|
1886
|
-
*
|
|
1887
2426
|
* @param {string} id - Unique identifier for the form
|
|
1888
2427
|
* @param {boolean} [registry=false] - Whether to register the created form in the global registry
|
|
1889
2428
|
* @param {UIModelMetadata[]} [children] - Array of UI model metadata objects to create controls from
|
|
1890
2429
|
* @return {FormGroup} The created FormGroup with controls for each child metadata
|
|
1891
|
-
*
|
|
1892
2430
|
* @mermaid
|
|
1893
2431
|
* sequenceDiagram
|
|
1894
2432
|
* participant C as Component
|
|
1895
2433
|
* participant NFS as NgxDecafFormService
|
|
1896
2434
|
* participant AF as Angular Forms
|
|
1897
|
-
*
|
|
1898
2435
|
* C->>NFS: createFormFromChildren(id, registry, children)
|
|
1899
2436
|
* NFS->>AF: new FormGroup({})
|
|
1900
2437
|
* loop For each child metadata
|
|
@@ -1905,9 +2442,7 @@ declare class NgxDecafFormService {
|
|
|
1905
2442
|
* NFS->>NFS: addRegistry(id, form)
|
|
1906
2443
|
* end
|
|
1907
2444
|
* NFS-->>C: Return FormGroup
|
|
1908
|
-
*
|
|
1909
2445
|
* @static
|
|
1910
|
-
* @memberOf NgxDecafFormService
|
|
1911
2446
|
*/
|
|
1912
2447
|
static createFormFromChildren(id: string, registry?: boolean, children?: UIModelMetadata[]): FormGroup;
|
|
1913
2448
|
/**
|
|
@@ -1915,18 +2450,15 @@ declare class NgxDecafFormService {
|
|
|
1915
2450
|
* @summary Generates a FormGroup based on an array of component configurations and optionally registers it.
|
|
1916
2451
|
* This method processes component input configurations to create appropriate form controls with
|
|
1917
2452
|
* validation and initial values.
|
|
1918
|
-
*
|
|
1919
2453
|
* @param {string} id - The unique identifier for the form
|
|
1920
2454
|
* @param {IComponentConfig[]} components - An array of component configurations defining the form structure
|
|
1921
2455
|
* @param {boolean} [registry=false] - Whether to register the created form in the global registry
|
|
1922
2456
|
* @return {FormGroup} The created FormGroup with controls for each component configuration
|
|
1923
|
-
*
|
|
1924
2457
|
* @mermaid
|
|
1925
2458
|
* sequenceDiagram
|
|
1926
2459
|
* participant C as Component
|
|
1927
2460
|
* participant NFS as NgxDecafFormService
|
|
1928
2461
|
* participant AF as Angular Forms
|
|
1929
|
-
*
|
|
1930
2462
|
* C->>NFS: createFormFromComponents(id, components, registry)
|
|
1931
2463
|
* NFS->>AF: new FormGroup({})
|
|
1932
2464
|
* loop For each component config
|
|
@@ -1937,42 +2469,39 @@ declare class NgxDecafFormService {
|
|
|
1937
2469
|
* NFS->>NFS: addRegistry(id, form)
|
|
1938
2470
|
* end
|
|
1939
2471
|
* NFS-->>C: Return FormGroup
|
|
1940
|
-
*
|
|
1941
2472
|
* @static
|
|
1942
|
-
* @memberOf NgxDecafFormService
|
|
1943
2473
|
*/
|
|
1944
2474
|
static createFormFromComponents(id: string, components: IComponentConfig[], registry?: boolean): FormGroup;
|
|
1945
2475
|
/**
|
|
1946
2476
|
* @description Adds a control to a form based on component properties.
|
|
1947
2477
|
* @summary Creates and adds a form control to a form (existing or new) based on the provided component properties.
|
|
1948
2478
|
* 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
|
-
*
|
|
2479
|
+
* complex form scenarios including nested controls and page-based form organization. It automatically
|
|
2480
|
+
* creates FormArrays for forms with multiple pages and manages page indexing.
|
|
1951
2481
|
* @param {string} id - The unique identifier of the form
|
|
1952
2482
|
* @param {FieldProperties} componentProperties - The properties of the component to create the control from
|
|
1953
2483
|
* @param {FieldProperties} [parentProps] - Optional parent properties for context and configuration
|
|
1954
|
-
* @return {
|
|
1955
|
-
*
|
|
2484
|
+
* @return {FormParent} The form or created control (FormGroup or FormArray)
|
|
2485
|
+
* @throws {Error} If page property is required but not provided or is invalid
|
|
1956
2486
|
* @mermaid
|
|
1957
2487
|
* sequenceDiagram
|
|
1958
2488
|
* participant C as Component
|
|
1959
2489
|
* participant NFS as NgxDecafFormService
|
|
1960
2490
|
* participant F as Form
|
|
1961
|
-
*
|
|
1962
2491
|
* C->>NFS: addControlFromProps(id, componentProps, parentProps?)
|
|
1963
|
-
* NFS->>NFS: createForm(id,
|
|
1964
|
-
* alt Multi-page form (parentProps.pages >
|
|
2492
|
+
* NFS->>NFS: createForm(id, formArray, true)
|
|
2493
|
+
* alt Multi-page form (parentProps.pages > 0)
|
|
1965
2494
|
* NFS->>NFS: Calculate page index
|
|
1966
|
-
*
|
|
2495
|
+
* alt Group doesn't exist at index
|
|
2496
|
+
* NFS->>F: Create new FormGroup at index
|
|
2497
|
+
* end
|
|
1967
2498
|
* NFS->>NFS: Set form to page FormGroup
|
|
1968
2499
|
* end
|
|
1969
2500
|
* alt componentProperties has path
|
|
1970
2501
|
* NFS->>NFS: addFormControl(form, componentProperties, parentProps)
|
|
1971
2502
|
* end
|
|
1972
2503
|
* NFS-->>C: Return form/control
|
|
1973
|
-
*
|
|
1974
2504
|
* @static
|
|
1975
|
-
* @memberOf NgxDecafFormService
|
|
1976
2505
|
*/
|
|
1977
2506
|
static addControlFromProps(id: string, componentProperties: FieldProperties, parentProps?: FieldProperties): FormParent;
|
|
1978
2507
|
/**
|
|
@@ -1980,17 +2509,14 @@ declare class NgxDecafFormService {
|
|
|
1980
2509
|
* @summary Extracts and processes the data from a FormGroup, handling different input types and nested form groups.
|
|
1981
2510
|
* Performs type conversion for various HTML5 input types, validates nested controls, and manages
|
|
1982
2511
|
* multiple control scenarios. Automatically enables all group controls after data extraction.
|
|
1983
|
-
*
|
|
1984
2512
|
* @param {FormGroup} formGroup - The FormGroup to extract data from
|
|
1985
2513
|
* @return {Record<string, unknown>} An object containing the processed form data with proper type conversions
|
|
1986
|
-
*
|
|
1987
2514
|
* @mermaid
|
|
1988
2515
|
* sequenceDiagram
|
|
1989
2516
|
* participant C as Component
|
|
1990
2517
|
* participant NFS as NgxDecafFormService
|
|
1991
2518
|
* participant FG as FormGroup
|
|
1992
2519
|
* participant FC as FormControl
|
|
1993
|
-
*
|
|
1994
2520
|
* C->>NFS: getFormData(formGroup)
|
|
1995
2521
|
* loop For each control in formGroup
|
|
1996
2522
|
* alt Control is not FormControl
|
|
@@ -2014,9 +2540,7 @@ declare class NgxDecafFormService {
|
|
|
2014
2540
|
* end
|
|
2015
2541
|
* NFS->>NFS: enableAllGroupControls(formGroup)
|
|
2016
2542
|
* NFS-->>C: Return processed data object
|
|
2017
|
-
*
|
|
2018
2543
|
* @static
|
|
2019
|
-
* @memberOf NgxDecafFormService
|
|
2020
2544
|
*/
|
|
2021
2545
|
static getFormData(formGroup: FormGroup): Record<string, unknown>;
|
|
2022
2546
|
/**
|
|
@@ -2024,13 +2548,11 @@ declare class NgxDecafFormService {
|
|
|
2024
2548
|
* @summary Recursively validates all fields in a form control or form group, marking them as touched and dirty.
|
|
2025
2549
|
* Performs comprehensive validation including uniqueness checks for primary keys in FormArray scenarios.
|
|
2026
2550
|
* This method ensures all validation rules are applied and form state is properly updated.
|
|
2027
|
-
*
|
|
2028
2551
|
* @param {AbstractControl} control - The control or form group to validate
|
|
2029
2552
|
* @param {string} [pk] - Optional primary key field name for uniqueness validation
|
|
2030
2553
|
* @param {string} [path] - The path to the control within the form for error reporting
|
|
2031
2554
|
* @return {boolean} True if all fields are valid, false otherwise
|
|
2032
2555
|
* @throws {Error} If no control is found at the specified path or if the control type is unknown
|
|
2033
|
-
*
|
|
2034
2556
|
* @mermaid
|
|
2035
2557
|
* sequenceDiagram
|
|
2036
2558
|
* participant C as Component
|
|
@@ -2038,7 +2560,6 @@ declare class NgxDecafFormService {
|
|
|
2038
2560
|
* participant FC as FormControl
|
|
2039
2561
|
* participant FG as FormGroup
|
|
2040
2562
|
* participant FA as FormArray
|
|
2041
|
-
*
|
|
2042
2563
|
* C->>NFS: validateFields(control, pk?, path?)
|
|
2043
2564
|
* alt Control is FormControl
|
|
2044
2565
|
* NFS->>FC: markAsTouched()
|
|
@@ -2064,16 +2585,18 @@ declare class NgxDecafFormService {
|
|
|
2064
2585
|
* else Unknown control type
|
|
2065
2586
|
* NFS-->>C: Throw Error
|
|
2066
2587
|
* end
|
|
2067
|
-
*
|
|
2068
2588
|
* @static
|
|
2069
|
-
* @memberOf NgxDecafFormService
|
|
2070
2589
|
*/
|
|
2071
2590
|
static validateFields(control: AbstractControl, pk?: string, path?: string): boolean;
|
|
2072
2591
|
/**
|
|
2073
2592
|
* @description Generates validators from component properties.
|
|
2074
2593
|
* @summary Creates an array of ValidatorFn based on the supported validation keys in the component properties.
|
|
2075
|
-
*
|
|
2076
|
-
*
|
|
2594
|
+
* Maps each validation property to its corresponding Angular validator function using the ValidatorFactory.
|
|
2595
|
+
* Only processes properties that are recognized as validation keys by the Validation utility.
|
|
2596
|
+
* @param {KeyValue} props - The component properties containing validation rules
|
|
2597
|
+
* @return {ValidatorFn[]} An array of validator functions
|
|
2598
|
+
* @private
|
|
2599
|
+
* @static
|
|
2077
2600
|
*/
|
|
2078
2601
|
private static validatorsFromProps;
|
|
2079
2602
|
/**
|
|
@@ -2081,18 +2604,15 @@ declare class NgxDecafFormService {
|
|
|
2081
2604
|
* @summary Generates a FormControl with validators and initial configuration based on the provided
|
|
2082
2605
|
* component properties. Handles different input types, sets initial values, and configures
|
|
2083
2606
|
* validation rules and update modes.
|
|
2084
|
-
*
|
|
2085
2607
|
* @param {FieldProperties} props - The component properties defining the control configuration
|
|
2086
2608
|
* @param {FieldUpdateMode} [updateMode='change'] - The update mode for the control ('change', 'blur', 'submit')
|
|
2087
2609
|
* @return {FormControl} The created FormControl with proper configuration and validators
|
|
2088
|
-
*
|
|
2089
2610
|
* @mermaid
|
|
2090
2611
|
* sequenceDiagram
|
|
2091
2612
|
* participant C as Component
|
|
2092
2613
|
* participant NFS as NgxDecafFormService
|
|
2093
2614
|
* participant VF as ValidatorFactory
|
|
2094
2615
|
* participant AF as Angular Forms
|
|
2095
|
-
*
|
|
2096
2616
|
* C->>NFS: fromProps(props, updateMode?)
|
|
2097
2617
|
* NFS->>NFS: validatorsFromProps(props)
|
|
2098
2618
|
* NFS->>VF: Create validators from props
|
|
@@ -2107,9 +2627,7 @@ declare class NgxDecafFormService {
|
|
|
2107
2627
|
* NFS->>AF: new FormControl(config)
|
|
2108
2628
|
* AF-->>NFS: Return FormControl
|
|
2109
2629
|
* NFS-->>C: Return configured FormControl
|
|
2110
|
-
*
|
|
2111
2630
|
* @static
|
|
2112
|
-
* @memberOf NgxDecafFormService
|
|
2113
2631
|
*/
|
|
2114
2632
|
static fromProps(props: FieldProperties, updateMode?: FieldUpdateMode): FormControl;
|
|
2115
2633
|
/**
|
|
@@ -2117,12 +2635,9 @@ declare class NgxDecafFormService {
|
|
|
2117
2635
|
* @summary Gets the FieldProperties associated with a form control from the internal WeakMap.
|
|
2118
2636
|
* This method provides access to the original component properties that were used to create
|
|
2119
2637
|
* the control, enabling validation, rendering, and behavior configuration.
|
|
2120
|
-
*
|
|
2121
2638
|
* @param {FormControl | FormArray | FormGroup} control - The form control to get properties for
|
|
2122
2639
|
* @return {FieldProperties} The properties associated with the control, or empty object if not found
|
|
2123
|
-
*
|
|
2124
2640
|
* @static
|
|
2125
|
-
* @memberOf NgxDecafFormService
|
|
2126
2641
|
*/
|
|
2127
2642
|
static getPropsFromControl(control: FormControl | FormArray | FormGroup): FieldProperties;
|
|
2128
2643
|
/**
|
|
@@ -2130,18 +2645,15 @@ declare class NgxDecafFormService {
|
|
|
2130
2645
|
* @summary Traverses up the DOM tree to find the nearest parent element with the specified tag name.
|
|
2131
2646
|
* This is useful for finding container elements or specific parent components in the DOM hierarchy.
|
|
2132
2647
|
* The search is case-insensitive for tag name matching.
|
|
2133
|
-
*
|
|
2134
2648
|
* @param {HTMLElement} el - The starting element to traverse from
|
|
2135
2649
|
* @param {string} tag - The tag name to search for (case-insensitive)
|
|
2136
2650
|
* @return {HTMLElement} The found parent element with the specified tag
|
|
2137
2651
|
* @throws {Error} If no parent with the specified tag is found in the DOM tree
|
|
2138
|
-
*
|
|
2139
2652
|
* @mermaid
|
|
2140
2653
|
* sequenceDiagram
|
|
2141
2654
|
* participant C as Component
|
|
2142
2655
|
* participant NFS as NgxDecafFormService
|
|
2143
2656
|
* participant DOM as DOM Tree
|
|
2144
|
-
*
|
|
2145
2657
|
* C->>NFS: getParentEl(element, tagName)
|
|
2146
2658
|
* loop Traverse up DOM tree
|
|
2147
2659
|
* NFS->>DOM: Get parentElement
|
|
@@ -2152,9 +2664,7 @@ declare class NgxDecafFormService {
|
|
|
2152
2664
|
* NFS-->>C: Throw Error
|
|
2153
2665
|
* end
|
|
2154
2666
|
* end
|
|
2155
|
-
*
|
|
2156
2667
|
* @static
|
|
2157
|
-
* @memberOf NgxDecafFormService
|
|
2158
2668
|
*/
|
|
2159
2669
|
static getParentEl(el: HTMLElement, tag: string): HTMLElement;
|
|
2160
2670
|
/**
|
|
@@ -2162,26 +2672,31 @@ declare class NgxDecafFormService {
|
|
|
2162
2672
|
* @summary Associates a form control with its component properties for later retrieval.
|
|
2163
2673
|
* This enables the service to maintain metadata about controls without creating memory leaks,
|
|
2164
2674
|
* as WeakMap automatically cleans up references when controls are garbage collected.
|
|
2165
|
-
*
|
|
2166
2675
|
* @param {AbstractControl} control - The control to register (FormControl, FormGroup, or FormArray)
|
|
2167
2676
|
* @param {FieldProperties} props - The properties to associate with the control
|
|
2168
2677
|
* @return {void}
|
|
2169
|
-
*
|
|
2170
2678
|
* @static
|
|
2171
|
-
* @memberOf NgxDecafFormService
|
|
2172
2679
|
*/
|
|
2173
2680
|
static register(control: AbstractControl, props: FieldProperties): void;
|
|
2174
2681
|
/**
|
|
2175
|
-
* @description Unregisters a control.
|
|
2682
|
+
* @description Unregisters a control from the internal WeakMap.
|
|
2176
2683
|
* @summary Removes a control and its associated properties from the internal WeakMap.
|
|
2177
|
-
*
|
|
2178
|
-
*
|
|
2684
|
+
* This cleans up the metadata tracking for the control and frees up memory. Returns
|
|
2685
|
+
* true if the control was found and removed, false if it was not in the registry.
|
|
2686
|
+
* @param {AbstractControl} control - The control to unregister (FormControl, FormGroup, or FormArray)
|
|
2687
|
+
* @return {boolean} True if the control was successfully unregistered, false otherwise
|
|
2688
|
+
* @static
|
|
2179
2689
|
*/
|
|
2180
2690
|
static unregister(control: AbstractControl): boolean;
|
|
2181
2691
|
/**
|
|
2182
|
-
* @description Resets a form group.
|
|
2183
|
-
* @summary Recursively resets all controls in a form group
|
|
2184
|
-
*
|
|
2692
|
+
* @description Resets a form group or form control.
|
|
2693
|
+
* @summary Recursively resets all controls in a form group or a single form control, clearing values,
|
|
2694
|
+
* errors, and marking them as pristine and untouched. For FormControls, it sets the value to empty
|
|
2695
|
+
* string (except for checkbox types) and clears validation errors. For FormGroups, it recursively
|
|
2696
|
+
* resets all child controls.
|
|
2697
|
+
* @param {FormGroup | FormControl} formGroup - The form group or form control to reset
|
|
2698
|
+
* @return {void}
|
|
2699
|
+
* @static
|
|
2185
2700
|
*/
|
|
2186
2701
|
static reset(formGroup: FormGroup | FormControl): void;
|
|
2187
2702
|
}
|
|
@@ -2199,15 +2714,93 @@ declare abstract class NgxEventHandler<PAYLOAD> extends LoggedClass {
|
|
|
2199
2714
|
abstract handle(evt: IBaseCustomEvent | CustomEvent<PAYLOAD>): Promise<unknown>;
|
|
2200
2715
|
}
|
|
2201
2716
|
|
|
2202
|
-
|
|
2717
|
+
/**
|
|
2718
|
+
* @module lib/engine/NgxPageDirective
|
|
2719
|
+
* @description Base page component for Decaf Angular applications.
|
|
2720
|
+
* @summary Provides a page-level base class (NgxPageDirective) that extends NgxDecafComponentDirective and
|
|
2721
|
+
* offers page-focused utilities such as menu management, title handling and router event hooks.
|
|
2722
|
+
* @link {@link NgxPageDirective}
|
|
2723
|
+
*/
|
|
2724
|
+
|
|
2725
|
+
/**
|
|
2726
|
+
* @description Base directive for page-level components in Decaf Angular applications.
|
|
2727
|
+
* @summary Abstract directive that provides foundational functionality for page components.
|
|
2728
|
+
* Extends NgxDecafComponentDirective to add page-specific features including menu management,
|
|
2729
|
+
* page title handling, and Ionic lifecycle hooks. This directive serves as the base class for
|
|
2730
|
+
* all page-level components, providing consistent behavior for navigation, routing, and UI state.
|
|
2731
|
+
* @class NgxPageDirective
|
|
2732
|
+
* @extends {NgxDecafComponentDirective}
|
|
2733
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2734
|
+
*/
|
|
2735
|
+
declare abstract class NgxPageDirective extends NgxDecafComponentDirective implements AfterViewInit {
|
|
2203
2736
|
protected localeRoot?: string | undefined;
|
|
2204
2737
|
protected hasMenu: boolean;
|
|
2738
|
+
/**
|
|
2739
|
+
* @description Page title text for the current view.
|
|
2740
|
+
* @summary Stores the title text to be displayed for this page. This can be set dynamically
|
|
2741
|
+
* based on the current route or menu configuration and is used to update the browser's
|
|
2742
|
+
* title bar or page header.
|
|
2743
|
+
* @type {string}
|
|
2744
|
+
* @default ''
|
|
2745
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2746
|
+
*/
|
|
2205
2747
|
title: string;
|
|
2748
|
+
/**
|
|
2749
|
+
* @description Menu items array for page navigation.
|
|
2750
|
+
* @summary Contains the collection of menu items available for this page. Each menu item
|
|
2751
|
+
* defines a navigation option with properties like label, URL, icon, and visibility settings.
|
|
2752
|
+
* This array is used to construct the application's navigation menu and can be filtered or
|
|
2753
|
+
* customized per page.
|
|
2754
|
+
* @protected
|
|
2755
|
+
* @type {IMenuItem[]}
|
|
2756
|
+
* @default []
|
|
2757
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2758
|
+
*/
|
|
2206
2759
|
protected menu: IMenuItem[];
|
|
2760
|
+
/**
|
|
2761
|
+
* @description Angular Title service for browser title management.
|
|
2762
|
+
* @summary Injected service that provides control over the browser's document title.
|
|
2763
|
+
* Used to dynamically set the page title based on the current route or active menu item,
|
|
2764
|
+
* improving SEO and user experience.
|
|
2765
|
+
* @protected
|
|
2766
|
+
* @type {Title}
|
|
2767
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2768
|
+
*/
|
|
2207
2769
|
protected titleService: Title;
|
|
2770
|
+
/**
|
|
2771
|
+
* @description Constructor for NgxPageDirective.
|
|
2772
|
+
* @summary Initializes the page directive with optional locale root and menu visibility settings.
|
|
2773
|
+
* Calls the parent NgxDecafComponentDirective constructor to set up base functionality including
|
|
2774
|
+
* logging, localization, and component identification.
|
|
2775
|
+
* @param {string} [localeRoot] - Optional locale root key for internationalization
|
|
2776
|
+
* @param {boolean} [hasMenu=true] - Whether this page should display the menu
|
|
2777
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2778
|
+
*/
|
|
2208
2779
|
constructor(localeRoot?: string | undefined, hasMenu?: boolean);
|
|
2209
|
-
|
|
2210
|
-
|
|
2780
|
+
/**
|
|
2781
|
+
* @description Ionic lifecycle hook called when the page is about to enter view.
|
|
2782
|
+
* @summary This lifecycle hook is triggered just before the page becomes visible to the user.
|
|
2783
|
+
* It enables or disables the application menu based on the hasMenu property, allowing pages
|
|
2784
|
+
* to control whether the menu should be accessible. This is useful for pages like login screens
|
|
2785
|
+
* where the menu should be hidden.
|
|
2786
|
+
* @return {Promise<void>} A promise that resolves when menu state is updated
|
|
2787
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2788
|
+
*/
|
|
2789
|
+
ngAfterViewInit(): Promise<void>;
|
|
2790
|
+
/**
|
|
2791
|
+
* @description Sets the browser page title based on the current route.
|
|
2792
|
+
* @summary Updates the browser's document title by finding the active menu item that matches
|
|
2793
|
+
* the provided route. If a matching menu item is found, it sets the title using the format
|
|
2794
|
+
* "Decaf For Angular - {menu title or label}". This improves SEO and provides clear context
|
|
2795
|
+
* to users about the current page. If a custom menu array is provided, it uses that instead
|
|
2796
|
+
* of the component's default menu.
|
|
2797
|
+
* @protected
|
|
2798
|
+
* @param {string} route - The current route path to match against menu items
|
|
2799
|
+
* @param {IMenuItem[]} [menu] - Optional custom menu array to search (uses this.menu if not provided)
|
|
2800
|
+
* @return {void}
|
|
2801
|
+
* @memberOf module:lib/engine/NgxPageDirective
|
|
2802
|
+
*/
|
|
2803
|
+
protected setPageTitle(route?: string, menu?: IMenuItem[]): void;
|
|
2211
2804
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxPageDirective, never>;
|
|
2212
2805
|
static ɵdir: i0.ɵɵDirectiveDeclaration<NgxPageDirective, never, never, {}, {}, never, never, true, never>;
|
|
2213
2806
|
}
|
|
@@ -3014,18 +3607,6 @@ declare class CrudFieldComponent extends NgxDecafFormFieldDirective implements O
|
|
|
3014
3607
|
ngOnDestroy(): void;
|
|
3015
3608
|
toggleOptionSelection(val: string, event: CheckboxCustomEvent): void;
|
|
3016
3609
|
isOptionChecked(value: string): boolean;
|
|
3017
|
-
/**
|
|
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.
|
|
3023
|
-
*
|
|
3024
|
-
* @param {CustomEvent} event - The fieldset create group event containing group details
|
|
3025
|
-
* @returns {void}
|
|
3026
|
-
* @memberOf CrudFieldComponent
|
|
3027
|
-
*/
|
|
3028
|
-
handleFieldsetCreateGroupEvent(event: CustomEvent): void;
|
|
3029
3610
|
/**
|
|
3030
3611
|
* @description Handles fieldset group update events from parent fieldsets.
|
|
3031
3612
|
* @summary Processes events triggered when an existing group needs to be updated.
|
|
@@ -3037,17 +3618,6 @@ declare class CrudFieldComponent extends NgxDecafFormFieldDirective implements O
|
|
|
3037
3618
|
* @memberOf CrudFieldComponent
|
|
3038
3619
|
*/
|
|
3039
3620
|
handleFieldsetUpdateGroupEvent(event: CustomEvent): void;
|
|
3040
|
-
/**
|
|
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.
|
|
3045
|
-
*
|
|
3046
|
-
* @param {CustomEvent} event - The fieldset remove group event containing removal details
|
|
3047
|
-
* @returns {void}
|
|
3048
|
-
* @memberOf CrudFieldComponent
|
|
3049
|
-
*/
|
|
3050
|
-
handleFieldsetRemoveGroupEvent(event: CustomEvent): void;
|
|
3051
3621
|
static ɵfac: i0.ɵɵFactoryDeclaration<CrudFieldComponent, never>;
|
|
3052
3622
|
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
3623
|
}
|
|
@@ -3071,7 +3641,6 @@ declare class CrudFieldComponent extends NgxDecafFormFieldDirective implements O
|
|
|
3071
3641
|
* @class NgxParentComponentDirective
|
|
3072
3642
|
* @extends {NgxParentComponentDirective}
|
|
3073
3643
|
* @implements {OnInit}
|
|
3074
|
-
* @memberOf NgxParentComponentDirective
|
|
3075
3644
|
*/
|
|
3076
3645
|
declare class NgxParentComponentDirective extends NgxDecafComponentDirective implements OnInit {
|
|
3077
3646
|
/**
|
|
@@ -3083,7 +3652,6 @@ declare class NgxParentComponentDirective extends NgxDecafComponentDirective imp
|
|
|
3083
3652
|
*
|
|
3084
3653
|
* @type {string}
|
|
3085
3654
|
* @default 'Child'
|
|
3086
|
-
* @memberOf FieldsetComponent
|
|
3087
3655
|
*/
|
|
3088
3656
|
parentComponent: FormParent;
|
|
3089
3657
|
/**
|
|
@@ -3094,7 +3662,6 @@ declare class NgxParentComponentDirective extends NgxDecafComponentDirective imp
|
|
|
3094
3662
|
* page assignment, and display properties.
|
|
3095
3663
|
*
|
|
3096
3664
|
* @type {UIModelMetadata[]}
|
|
3097
|
-
* @memberOf NgxParentComponentDirective
|
|
3098
3665
|
*/
|
|
3099
3666
|
children: UIModelMetadata[] | KeyValue[];
|
|
3100
3667
|
/**
|
|
@@ -3106,7 +3673,6 @@ declare class NgxParentComponentDirective extends NgxDecafComponentDirective imp
|
|
|
3106
3673
|
*
|
|
3107
3674
|
* @type {(number | string[])}
|
|
3108
3675
|
* @default 1
|
|
3109
|
-
* @memberOf NgxParentComponentDirective
|
|
3110
3676
|
*/
|
|
3111
3677
|
cols: number | string[];
|
|
3112
3678
|
/**
|
|
@@ -3117,7 +3683,6 @@ declare class NgxParentComponentDirective extends NgxDecafComponentDirective imp
|
|
|
3117
3683
|
*
|
|
3118
3684
|
* @type {(number | string[])}
|
|
3119
3685
|
* @default 1
|
|
3120
|
-
* @memberOf NgxParentComponentDirective
|
|
3121
3686
|
*/
|
|
3122
3687
|
rows: number | KeyValue[] | string[];
|
|
3123
3688
|
ngOnInit(model?: Model | string): Promise<void>;
|
|
@@ -3133,7 +3698,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3133
3698
|
* Used for form validation, value management, and integration with Angular's reactive forms.
|
|
3134
3699
|
*
|
|
3135
3700
|
* @type {FormGroup}
|
|
3136
|
-
* @memberOf CrudFormComponent
|
|
3137
3701
|
*/
|
|
3138
3702
|
parentFormId: string;
|
|
3139
3703
|
/**
|
|
@@ -3143,20 +3707,8 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3143
3707
|
* HTML form properties and methods when needed.
|
|
3144
3708
|
*
|
|
3145
3709
|
* @type {ElementRef}
|
|
3146
|
-
* @memberOf CrudFormComponent
|
|
3147
3710
|
*/
|
|
3148
3711
|
component: ElementRef;
|
|
3149
|
-
/**
|
|
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.
|
|
3154
|
-
*
|
|
3155
|
-
* @private
|
|
3156
|
-
* @type {Location}
|
|
3157
|
-
* @memberOf CrudFormComponent
|
|
3158
|
-
*/
|
|
3159
|
-
private location;
|
|
3160
3712
|
/**
|
|
3161
3713
|
* @description Field update trigger mode for form validation.
|
|
3162
3714
|
* @summary Determines when form field validation should be triggered. Options include
|
|
@@ -3165,7 +3717,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3165
3717
|
*
|
|
3166
3718
|
* @type {FieldUpdateMode}
|
|
3167
3719
|
* @default 'change'
|
|
3168
|
-
* @memberOf CrudFormComponent
|
|
3169
3720
|
*/
|
|
3170
3721
|
updateOn: FieldUpdateMode;
|
|
3171
3722
|
/**
|
|
@@ -3176,7 +3727,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3176
3727
|
*
|
|
3177
3728
|
* @type {HTMLFormTarget}
|
|
3178
3729
|
* @default '_self'
|
|
3179
|
-
* @memberOf CrudFormComponent
|
|
3180
3730
|
*/
|
|
3181
3731
|
target: HTMLFormTarget;
|
|
3182
3732
|
/**
|
|
@@ -3187,7 +3737,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3187
3737
|
*
|
|
3188
3738
|
* @type {'get' | 'post' | 'event'}
|
|
3189
3739
|
* @default 'event'
|
|
3190
|
-
* @memberOf CrudFormComponent
|
|
3191
3740
|
*/
|
|
3192
3741
|
method: 'get' | 'post' | 'event';
|
|
3193
3742
|
/**
|
|
@@ -3197,7 +3746,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3197
3746
|
* during component initialization to customize the form's functionality.
|
|
3198
3747
|
*
|
|
3199
3748
|
* @type {ICrudFormOptions}
|
|
3200
|
-
* @memberOf CrudFormComponent
|
|
3201
3749
|
*/
|
|
3202
3750
|
options: ICrudFormOptions;
|
|
3203
3751
|
/**
|
|
@@ -3207,7 +3755,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3207
3755
|
* distinguish between different types of form submissions within the same component.
|
|
3208
3756
|
*
|
|
3209
3757
|
* @type {string | undefined}
|
|
3210
|
-
* @memberOf CrudFormComponent
|
|
3211
3758
|
*/
|
|
3212
3759
|
action?: string;
|
|
3213
3760
|
/**
|
|
@@ -3218,7 +3765,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3218
3765
|
*
|
|
3219
3766
|
* @type {CrudOperations}
|
|
3220
3767
|
* @required
|
|
3221
|
-
* @memberOf CrudFormComponent
|
|
3222
3768
|
*/
|
|
3223
3769
|
operation: CrudOperations;
|
|
3224
3770
|
/**
|
|
@@ -3228,7 +3774,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3228
3774
|
* custom business logic and can be invoked for various form events and actions.
|
|
3229
3775
|
*
|
|
3230
3776
|
* @type {HandlerLike}
|
|
3231
|
-
* @memberOf CrudFormComponent
|
|
3232
3777
|
*/
|
|
3233
3778
|
handlers: HandlerLike;
|
|
3234
3779
|
/**
|
|
@@ -3238,7 +3783,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3238
3783
|
* controlling form behavior. May be undefined for read-only operations.
|
|
3239
3784
|
*
|
|
3240
3785
|
* @type {FormGroup | undefined}
|
|
3241
|
-
* @memberOf CrudFormComponent
|
|
3242
3786
|
*/
|
|
3243
3787
|
formGroup: FormParent | undefined;
|
|
3244
3788
|
/**
|
|
@@ -3248,7 +3792,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3248
3792
|
* attribute for the form element, enabling DOM queries and form management.
|
|
3249
3793
|
*
|
|
3250
3794
|
* @type {string}
|
|
3251
|
-
* @memberOf CrudFormComponent
|
|
3252
3795
|
*/
|
|
3253
3796
|
rendererId: string;
|
|
3254
3797
|
/**
|
|
@@ -3258,7 +3801,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3258
3801
|
* components. This enables decoupled handling of form submission logic.
|
|
3259
3802
|
*
|
|
3260
3803
|
* @type {EventEmitter<ICrudFormEvent>}
|
|
3261
|
-
* @memberOf CrudFormComponent
|
|
3262
3804
|
*/
|
|
3263
3805
|
submitEvent: EventEmitter<ICrudFormEvent>;
|
|
3264
3806
|
/**
|
|
@@ -3270,21 +3812,8 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3270
3812
|
*
|
|
3271
3813
|
* @type {string}
|
|
3272
3814
|
* @default Randomly generated 12-character string
|
|
3273
|
-
* @memberOf CrudFormComponent
|
|
3274
3815
|
*/
|
|
3275
3816
|
allowClear: boolean;
|
|
3276
|
-
/**
|
|
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.
|
|
3282
|
-
*
|
|
3283
|
-
* @protected
|
|
3284
|
-
* @readonly
|
|
3285
|
-
* @memberOf CrudFormComponent
|
|
3286
|
-
*/
|
|
3287
|
-
protected readonly OperationKeys: typeof OperationKeys;
|
|
3288
3817
|
protected activeFormGroupIndex: number;
|
|
3289
3818
|
get activeFormGroup(): FormParent;
|
|
3290
3819
|
/**
|
|
@@ -3295,7 +3824,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3295
3824
|
* form input. Configuration options are merged with default settings.
|
|
3296
3825
|
*
|
|
3297
3826
|
* @returns {Promise<void>}
|
|
3298
|
-
* @memberOf CrudFormComponent
|
|
3299
3827
|
*/
|
|
3300
3828
|
ngOnInit(model?: Model | string): Promise<void>;
|
|
3301
3829
|
/**
|
|
@@ -3305,7 +3833,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3305
3833
|
* and ensure proper resource cleanup.
|
|
3306
3834
|
*
|
|
3307
3835
|
* @returns {void}
|
|
3308
|
-
* @memberOf CrudFormComponent
|
|
3309
3836
|
*/
|
|
3310
3837
|
ngOnDestroy(): void;
|
|
3311
3838
|
getFormArrayIndex(index: number): FormParent | undefined;
|
|
@@ -3317,7 +3844,6 @@ declare abstract class NgxFormDirective extends NgxParentComponentDirective impl
|
|
|
3317
3844
|
* since these operations don't have modifiable form data to reset.
|
|
3318
3845
|
*
|
|
3319
3846
|
* @returns {void}
|
|
3320
|
-
* @memberOf CrudFormComponent
|
|
3321
3847
|
*/
|
|
3322
3848
|
handleReset(): void;
|
|
3323
3849
|
handleSubmit(event?: SubmitEvent, eventName?: string, componentName?: string): Promise<boolean | void>;
|
|
@@ -3472,7 +3998,7 @@ declare class EmptyStateComponent extends NgxDecafComponentDirective implements
|
|
|
3472
3998
|
* and this value should correspond to an available icon name.
|
|
3473
3999
|
*
|
|
3474
4000
|
* @type {string}
|
|
3475
|
-
* @default "
|
|
4001
|
+
* @default "folder-open-outline"
|
|
3476
4002
|
* @memberOf EmptyStateComponent
|
|
3477
4003
|
*/
|
|
3478
4004
|
icon: string;
|
|
@@ -3559,6 +4085,7 @@ declare class EmptyStateComponent extends NgxDecafComponentDirective implements
|
|
|
3559
4085
|
searchValue: string;
|
|
3560
4086
|
private sanitizer;
|
|
3561
4087
|
searchSubtitle: SafeHtml;
|
|
4088
|
+
enableCreationByModelRoute: boolean;
|
|
3562
4089
|
/**
|
|
3563
4090
|
* @description Creates an instance of EmptyStateComponent.
|
|
3564
4091
|
* @summary Initializes a new EmptyStateComponent by calling the parent class constructor
|
|
@@ -3997,7 +4524,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
|
|
|
3997
4524
|
* ```
|
|
3998
4525
|
*/
|
|
3999
4526
|
handleCreateItem(event?: CustomEvent<IFieldSetValidationEvent>): Promise<void>;
|
|
4000
|
-
handleUpdateItem(index: number
|
|
4527
|
+
handleUpdateItem(index: number): void;
|
|
4001
4528
|
/**
|
|
4002
4529
|
* @description Cancels the update mode and resets the UI state.
|
|
4003
4530
|
* @summary Exits the update mode by resetting the button label and clearing the updating item,
|
|
@@ -4113,7 +4640,7 @@ declare class FieldsetComponent extends NgxFormDirective implements OnInit, Afte
|
|
|
4113
4640
|
*/
|
|
4114
4641
|
private getMapper;
|
|
4115
4642
|
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,
|
|
4643
|
+
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
4644
|
}
|
|
4118
4645
|
|
|
4119
4646
|
/**
|
|
@@ -4658,7 +5185,6 @@ declare class FilterComponent extends NgxDecafComponentDirective implements OnIn
|
|
|
4658
5185
|
* @memberOf LayoutComponent
|
|
4659
5186
|
*/
|
|
4660
5187
|
declare class LayoutComponent extends NgxParentComponentDirective implements OnInit {
|
|
4661
|
-
initializeProps: boolean;
|
|
4662
5188
|
/**
|
|
4663
5189
|
* @description Media breakpoint for responsive behavior.
|
|
4664
5190
|
* @summary Determines the responsive breakpoint at which the layout should adapt.
|
|
@@ -4671,7 +5197,6 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
|
|
|
4671
5197
|
* @memberOf LayoutComponent
|
|
4672
5198
|
*/
|
|
4673
5199
|
gap: 'small' | 'medium' | 'large' | 'collapse';
|
|
4674
|
-
match: boolean;
|
|
4675
5200
|
/**
|
|
4676
5201
|
* @description Media breakpoint for responsive behavior.
|
|
4677
5202
|
* @summary Determines the responsive breakpoint at which the layout should adapt.
|
|
@@ -4684,6 +5209,30 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
|
|
|
4684
5209
|
* @memberOf LayoutComponent
|
|
4685
5210
|
*/
|
|
4686
5211
|
breakpoint: UIMediaBreakPointsType | string;
|
|
5212
|
+
/**
|
|
5213
|
+
* @description Media breakpoint for responsive behavior.
|
|
5214
|
+
* @summary Determines the responsive breakpoint at which the layout should adapt.
|
|
5215
|
+
* This affects how the grid behaves on different screen sizes, allowing for
|
|
5216
|
+
* mobile-first or desktop-first responsive design patterns. The breakpoint
|
|
5217
|
+
* is automatically processed to ensure compatibility with the UI framework.
|
|
5218
|
+
*
|
|
5219
|
+
* @type {UIMediaBreakPointsType}
|
|
5220
|
+
* @default 'medium'
|
|
5221
|
+
* @memberOf LayoutComponent
|
|
5222
|
+
*/
|
|
5223
|
+
grid: boolean;
|
|
5224
|
+
/**
|
|
5225
|
+
* @description Media breakpoint for responsive behavior.
|
|
5226
|
+
* @summary Determines the responsive breakpoint at which the layout should adapt.
|
|
5227
|
+
* This affects how the grid behaves on different screen sizes, allowing for
|
|
5228
|
+
* mobile-first or desktop-first responsive design patterns. The breakpoint
|
|
5229
|
+
* is automatically processed to ensure compatibility with the UI framework.
|
|
5230
|
+
*
|
|
5231
|
+
* @type {UIMediaBreakPointsType}
|
|
5232
|
+
* @default 'medium'
|
|
5233
|
+
* @memberOf LayoutComponent
|
|
5234
|
+
*/
|
|
5235
|
+
match: boolean;
|
|
4687
5236
|
/**
|
|
4688
5237
|
* @description Creates an instance of LayoutComponent.
|
|
4689
5238
|
* @summary Initializes a new LayoutComponent with the component name "LayoutComponent".
|
|
@@ -4727,7 +5276,7 @@ declare class LayoutComponent extends NgxParentComponentDirective implements OnI
|
|
|
4727
5276
|
*/
|
|
4728
5277
|
ngOnInit(): Promise<void>;
|
|
4729
5278
|
static ɵfac: i0.ɵɵFactoryDeclaration<LayoutComponent, never>;
|
|
4730
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<LayoutComponent, "ngx-decaf-layout", never, { "
|
|
5279
|
+
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
5280
|
}
|
|
4732
5281
|
|
|
4733
5282
|
/**
|
|
@@ -5001,32 +5550,22 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
|
|
|
5001
5550
|
*/
|
|
5002
5551
|
disableSort: StringOrBoolean;
|
|
5003
5552
|
/**
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
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>;
|
|
5553
|
+
* @description Configuration for the empty state display.
|
|
5554
|
+
* @summary Customizes how the empty state is displayed when no data is available.
|
|
5555
|
+
* This includes the title, subtitle, button text, icon, and navigation link.
|
|
5556
|
+
*
|
|
5557
|
+
* @type {Partial<IListEmptyOptions>}
|
|
5558
|
+
* @default {
|
|
5559
|
+
* title: 'empty.title',
|
|
5560
|
+
* subtitle: 'empty.subtitle',
|
|
5561
|
+
* showButton: false,
|
|
5562
|
+
* icon: 'alert-circle-outline',
|
|
5563
|
+
* buttonText: 'locale.empty.button',
|
|
5564
|
+
* link: ''
|
|
5565
|
+
* }
|
|
5566
|
+
* @memberOf ListComponent
|
|
5567
|
+
*/
|
|
5568
|
+
empty: Partial<IListEmptyOptions>;
|
|
5030
5569
|
/**
|
|
5031
5570
|
* @description The current page number in paginated mode.
|
|
5032
5571
|
* @summary Tracks which page is currently being displayed when the component
|
|
@@ -5086,6 +5625,7 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
|
|
|
5086
5625
|
* @memberOf ListComponent
|
|
5087
5626
|
*/
|
|
5088
5627
|
searchValue?: string | IFilterQuery | undefined;
|
|
5628
|
+
searching: boolean;
|
|
5089
5629
|
/**
|
|
5090
5630
|
* @description A paginator object for handling pagination operations.
|
|
5091
5631
|
* @summary Provides a paginator object that can be used to retrieve and navigate
|
|
@@ -5566,8 +6106,9 @@ declare class ListComponent extends NgxDecafComponentDirective implements OnInit
|
|
|
5566
6106
|
* @memberOf ListComponent
|
|
5567
6107
|
*/
|
|
5568
6108
|
mapResults(data: KeyValue[]): KeyValue[];
|
|
6109
|
+
parseSearchValue(): string | IFilterQuery;
|
|
5569
6110
|
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; }; "
|
|
6111
|
+
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
6112
|
}
|
|
5572
6113
|
|
|
5573
6114
|
/**
|
|
@@ -6781,7 +7322,10 @@ declare class SteppedFormComponent extends NgxParentComponentDirective implement
|
|
|
6781
7322
|
* @default 1
|
|
6782
7323
|
* @memberOf SteppedFormComponent
|
|
6783
7324
|
*/
|
|
6784
|
-
pages: number
|
|
7325
|
+
pages: number | {
|
|
7326
|
+
title: string;
|
|
7327
|
+
description: string;
|
|
7328
|
+
}[];
|
|
6785
7329
|
/**
|
|
6786
7330
|
* List of titles and descriptions for each page of the stepped form.
|
|
6787
7331
|
* Each object in the array represents a page, containing a title and a description.
|
|
@@ -6879,17 +7423,6 @@ declare class SteppedFormComponent extends NgxParentComponentDirective implement
|
|
|
6879
7423
|
* @memberOf SteppedFormComponent
|
|
6880
7424
|
*/
|
|
6881
7425
|
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
7426
|
/**
|
|
6894
7427
|
* @description Event emitter for form submission.
|
|
6895
7428
|
* @summary Emits events when the form is submitted, typically on the last page
|
|
@@ -7236,58 +7769,107 @@ declare function getLocaleLanguage(): string;
|
|
|
7236
7769
|
*/
|
|
7237
7770
|
declare function generateRandomValue(length?: number, onlyNumbers?: boolean): string;
|
|
7238
7771
|
/**
|
|
7239
|
-
* Converts a string representation of a boolean or a boolean value to a boolean type.
|
|
7772
|
+
* @description Converts a string representation of a boolean or a boolean value to a boolean type.
|
|
7773
|
+
* @summary This utility function handles conversion of string-based boolean values ('true', 'false')
|
|
7774
|
+
* to actual boolean types. It performs case-insensitive string comparison and returns the
|
|
7775
|
+
* corresponding boolean value. This is particularly useful when parsing configuration values,
|
|
7776
|
+
* URL parameters, or form inputs that may come as strings but need to be used as booleans.
|
|
7240
7777
|
*
|
|
7241
|
-
* @
|
|
7242
|
-
* @
|
|
7243
|
-
*
|
|
7778
|
+
* @param {'true' | 'false' | boolean} prop - The value to convert. Can be the string 'true', 'false', or a boolean
|
|
7779
|
+
* @returns {boolean} The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise
|
|
7780
|
+
*
|
|
7781
|
+
* @function stringToBoolean
|
|
7782
|
+
* @memberOf module:lib/helpers/utils
|
|
7244
7783
|
*/
|
|
7245
7784
|
declare function stringToBoolean(prop: 'true' | 'false' | boolean): boolean;
|
|
7246
7785
|
/**
|
|
7247
|
-
* Checks if a value is a valid Date object
|
|
7786
|
+
* @description Checks if a value is a valid Date object.
|
|
7787
|
+
* @summary This validation function determines whether a given value represents a valid date.
|
|
7788
|
+
* It handles multiple input types including Date objects, timestamp numbers, and date strings.
|
|
7789
|
+
* For string inputs, it supports ISO 8601 format (YYYY-MM-DD) with or without time components.
|
|
7790
|
+
* The function performs comprehensive validation including regex pattern matching and Date
|
|
7791
|
+
* object creation to ensure the date is not only parseable but also represents a real date.
|
|
7792
|
+
*
|
|
7793
|
+
* @param {string | Date | number} date - The value to check. Can be a Date object, a timestamp number, or a date string
|
|
7794
|
+
* @returns {boolean} Returns true if the value is a valid Date object (not NaN), otherwise false
|
|
7248
7795
|
*
|
|
7249
|
-
* @
|
|
7250
|
-
* @
|
|
7796
|
+
* @function isValidDate
|
|
7797
|
+
* @memberOf module:lib/helpers/utils
|
|
7251
7798
|
*/
|
|
7252
7799
|
declare function isValidDate(date: string | Date | number): boolean;
|
|
7253
7800
|
/**
|
|
7254
|
-
* Formats a date into a localized string representation
|
|
7801
|
+
* @description Formats a date into a localized string representation.
|
|
7802
|
+
* @summary This function converts a date value into a formatted string according to a specified
|
|
7803
|
+
* or system locale. It accepts multiple input formats (Date objects, timestamps, or date strings)
|
|
7804
|
+
* and returns a consistently formatted date string in DD/MM/YYYY format. If the input date is
|
|
7805
|
+
* invalid, the function returns the original input as a string. The function automatically
|
|
7806
|
+
* uses the system locale if none is provided and handles string format conversions by replacing
|
|
7807
|
+
* forward slashes with hyphens for proper Date parsing.
|
|
7255
7808
|
*
|
|
7256
|
-
* @param {
|
|
7809
|
+
* @param {string | Date | number} date - The date to format. Can be a Date object, a timestamp number, or a date string
|
|
7257
7810
|
* @param {string} [locale] - The locale to use for formatting. If not provided, the system's locale will be used
|
|
7258
|
-
* @
|
|
7259
|
-
*
|
|
7811
|
+
* @returns {Date | string} A formatted date string in the format DD/MM/YYYY according to the specified locale,
|
|
7812
|
+
* or the original input as a string if the date is invalid
|
|
7813
|
+
*
|
|
7814
|
+
* @function formatDate
|
|
7815
|
+
* @memberOf module:lib/helpers/utils
|
|
7260
7816
|
*/
|
|
7261
7817
|
declare function formatDate(date: string | Date | number, locale?: string | undefined): Date | string;
|
|
7262
7818
|
/**
|
|
7263
|
-
* Attempts to parse a date string, Date object, or number into a valid Date object
|
|
7819
|
+
* @description Attempts to parse a date string, Date object, or number into a valid Date object.
|
|
7820
|
+
* @summary This function provides robust date parsing functionality that handles the specific
|
|
7821
|
+
* format "DD/MM/YYYY HH:MM:SS:MS". It first validates the input date, and if already valid,
|
|
7822
|
+
* returns it as-is. For string inputs, it parses the date and time components separately,
|
|
7823
|
+
* extracts numeric values, and constructs a new Date object. The function includes validation
|
|
7824
|
+
* to ensure the resulting Date object is valid and logs a warning if parsing fails.
|
|
7825
|
+
* Returns null for invalid or unsupported date formats.
|
|
7826
|
+
*
|
|
7827
|
+
* @param {string | Date | number} date - The date to parse. Can be a Date object, a timestamp number,
|
|
7828
|
+
* or a date string in the format "DD/MM/YYYY HH:MM:SS:MS"
|
|
7829
|
+
* @returns {Date | null} A valid Date object if parsing is successful, or null if the date is invalid
|
|
7830
|
+
* or doesn't match the expected format
|
|
7264
7831
|
*
|
|
7265
|
-
* @
|
|
7266
|
-
*
|
|
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
|
|
7832
|
+
* @function parseToValidDate
|
|
7833
|
+
* @memberOf module:lib/helpers/utils
|
|
7269
7834
|
*/
|
|
7270
7835
|
declare function parseToValidDate(date: string | Date | number): Date | null;
|
|
7271
7836
|
/**
|
|
7272
|
-
* Maps an item object using a provided mapper object and optional additional properties.
|
|
7837
|
+
* @description Maps an item object using a provided mapper object and optional additional properties.
|
|
7838
|
+
* @summary This function transforms a source object into a new object based on mapping rules defined
|
|
7839
|
+
* in the mapper parameter. It supports dot notation for nested property access (e.g., 'user.name.first')
|
|
7840
|
+
* and handles various data types including strings and complex objects. For date values, it automatically
|
|
7841
|
+
* formats them using the formatDate function. The function also allows merging additional properties
|
|
7842
|
+
* into the result. When a mapped value is null or undefined, it uses the original mapper value as
|
|
7843
|
+
* a fallback.
|
|
7273
7844
|
*
|
|
7274
|
-
* @param {KeyValue} item - The source object to be mapped
|
|
7845
|
+
* @param {KeyValue} item - The source object to be mapped
|
|
7275
7846
|
* @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
|
|
7847
|
+
* and values represent the path to the corresponding values in the source object
|
|
7848
|
+
* @param {KeyValue} [props] - Optional additional properties to be included in the mapped object
|
|
7849
|
+
* @returns {KeyValue} A new object with properties mapped according to the mapper object and including any additional properties
|
|
7850
|
+
*
|
|
7851
|
+
* @function itemMapper
|
|
7852
|
+
* @memberOf module:lib/helpers/utils
|
|
7279
7853
|
*/
|
|
7280
7854
|
declare function itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue;
|
|
7281
7855
|
/**
|
|
7282
|
-
* Maps an array of data objects using a provided mapper object.
|
|
7856
|
+
* @description Maps an array of data objects using a provided mapper object.
|
|
7857
|
+
* @summary This function transforms an array of objects by applying mapping rules to each item
|
|
7858
|
+
* using the itemMapper function. It processes each element in the data array and creates
|
|
7859
|
+
* new mapped objects based on the mapper configuration. The function includes validation
|
|
7860
|
+
* to ensure meaningful data: if a mapped item contains only null/undefined values, it
|
|
7861
|
+
* preserves the original item instead. This prevents data loss during transformation.
|
|
7862
|
+
* Returns an empty array if the input data is null, undefined, or empty.
|
|
7283
7863
|
*
|
|
7284
|
-
* @template T - The type of the resulting mapped items
|
|
7285
|
-
* @param {
|
|
7286
|
-
* @param {KeyValue} mapper - An object that defines the mapping rules
|
|
7287
|
-
* @param {KeyValue} [props] - Additional properties to be included in the mapped items
|
|
7864
|
+
* @template T - The type of the resulting mapped items
|
|
7865
|
+
* @param {T[]} data - The array of data objects to be mapped
|
|
7866
|
+
* @param {KeyValue} mapper - An object that defines the mapping rules
|
|
7867
|
+
* @param {KeyValue} [props] - Additional properties to be included in the mapped items
|
|
7868
|
+
* @returns {T[]} The array of mapped items. If an item in the original array does not have any non-null values after mapping,
|
|
7869
|
+
* the original item is returned instead
|
|
7288
7870
|
*
|
|
7289
|
-
* @
|
|
7290
|
-
*
|
|
7871
|
+
* @function dataMapper
|
|
7872
|
+
* @memberOf module:lib/helpers/utils
|
|
7291
7873
|
*/
|
|
7292
7874
|
declare function dataMapper<T>(data: T[], mapper: KeyValue, props?: KeyValue): T[];
|
|
7293
7875
|
/**
|
|
@@ -7443,5 +8025,5 @@ declare class ForAngularCommonModule {
|
|
|
7443
8025
|
static ɵinj: i0.ɵɵInjectorDeclaration<ForAngularCommonModule>;
|
|
7444
8026
|
}
|
|
7445
8027
|
|
|
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,
|
|
8028
|
+
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, 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 };
|
|
8029
|
+
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, IPaginationCustomEvent, IRenderedModel, ISortObject, InputOption, KeyValue, ListItemCustomEvent, PossibleInputTypes, RadioOption, RawQuery, SelectOption, StringOrBoolean };
|