@decaf-ts/for-angular 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/LICENSE.md +646 -144
  2. package/README.md +37 -242
  3. package/dist/lib/README.md +92 -0
  4. package/dist/lib/assets/i18n/en.json +131 -0
  5. package/dist/lib/assets/images/angular-logo.svg +45 -0
  6. package/dist/lib/assets/images/decaf-logo-black.svg +22 -0
  7. package/dist/lib/assets/images/decaf-logo-lw.svg +50 -0
  8. package/dist/lib/assets/images/decaf-logo-white.svg +22 -0
  9. package/dist/lib/assets/images/decaf-logo.svg +54 -0
  10. package/dist/lib/components/component-renderer/component-renderer.component.d.ts +267 -0
  11. package/dist/lib/components/crud-field/crud-field.component.d.ts +445 -0
  12. package/dist/{for-angular/components/decaf-crud-form → lib/components/crud-form}/constants.d.ts +0 -0
  13. package/dist/lib/components/crud-form/crud-form.component.d.ts +102 -0
  14. package/dist/{for-angular/components/decaf-crud-form → lib/components/crud-form}/types.d.ts +0 -0
  15. package/dist/lib/components/model-renderer/model-renderer.component.d.ts +96 -0
  16. package/dist/lib/engine/DynamicModule.d.ts +17 -0
  17. package/dist/{for-angular → lib}/engine/NgxCrudFormField.d.ts +21 -17
  18. package/dist/lib/engine/NgxFormService.d.ts +167 -0
  19. package/dist/lib/engine/NgxRenderingEngine.d.ts +127 -0
  20. package/dist/lib/engine/NgxRenderingEngine2.d.ts +250 -0
  21. package/dist/lib/engine/ValidatorFactory.d.ts +15 -0
  22. package/dist/lib/engine/constants.d.ts +151 -0
  23. package/dist/lib/engine/decorators.d.ts +25 -0
  24. package/dist/lib/engine/index.d.ts +15 -0
  25. package/dist/lib/engine/types.d.ts +294 -0
  26. package/dist/lib/esm2022/components/component-renderer/component-renderer.component.mjs +312 -0
  27. package/dist/lib/esm2022/components/crud-field/crud-field.component.mjs +297 -0
  28. package/dist/lib/esm2022/components/crud-form/constants.mjs +14 -0
  29. package/dist/lib/esm2022/components/crud-form/crud-form.component.mjs +139 -0
  30. package/dist/lib/esm2022/components/crud-form/types.mjs +2 -0
  31. package/dist/lib/esm2022/components/model-renderer/model-renderer.component.mjs +138 -0
  32. package/dist/{for-angular → lib}/esm2022/decaf-ts-for-angular.mjs +0 -0
  33. package/dist/lib/esm2022/engine/DynamicModule.mjs +18 -0
  34. package/dist/lib/esm2022/engine/NgxCrudFormField.mjs +123 -0
  35. package/dist/lib/esm2022/engine/NgxFormService.mjs +315 -0
  36. package/dist/lib/esm2022/engine/NgxRenderingEngine.mjs +192 -0
  37. package/dist/lib/esm2022/engine/NgxRenderingEngine2.mjs +332 -0
  38. package/dist/lib/esm2022/engine/ValidatorFactory.mjs +102 -0
  39. package/dist/lib/esm2022/engine/constants.mjs +160 -0
  40. package/dist/lib/esm2022/engine/decorators.mjs +38 -0
  41. package/dist/lib/esm2022/engine/index.mjs +16 -0
  42. package/dist/lib/esm2022/engine/types.mjs +2 -0
  43. package/dist/lib/esm2022/for-angular.module.mjs +118 -0
  44. package/dist/lib/esm2022/interfaces.mjs +2 -0
  45. package/dist/lib/esm2022/public-apis.mjs +13 -0
  46. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs +2152 -0
  47. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs.map +1 -0
  48. package/dist/lib/for-angular.module.d.ts +45 -0
  49. package/dist/{for-angular → lib}/index.d.ts +0 -0
  50. package/dist/lib/interfaces.d.ts +28 -0
  51. package/dist/lib/public-apis.d.ts +12 -0
  52. package/package.json +71 -26
  53. package/dist/for-angular/README.md +0 -297
  54. package/dist/for-angular/assets/i18n/en.json +0 -21
  55. package/dist/for-angular/components/decaf-crud-field/decaf-crud-field.component.d.ts +0 -49
  56. package/dist/for-angular/components/decaf-crud-form/decaf-crud-form.component.d.ts +0 -28
  57. package/dist/for-angular/components/decaf-model-renderer/decaf-model-renderer.component.d.ts +0 -20
  58. package/dist/for-angular/engine/DynamicModule.d.ts +0 -2
  59. package/dist/for-angular/engine/NgxFormService.d.ts +0 -119
  60. package/dist/for-angular/engine/NgxRenderingEngine.d.ts +0 -18
  61. package/dist/for-angular/engine/ValidatorFactory.d.ts +0 -4
  62. package/dist/for-angular/engine/constants.d.ts +0 -13
  63. package/dist/for-angular/engine/decorators.d.ts +0 -1
  64. package/dist/for-angular/engine/index.d.ts +0 -5
  65. package/dist/for-angular/engine/types.d.ts +0 -44
  66. package/dist/for-angular/esm2022/components/decaf-crud-field/decaf-crud-field.component.mjs +0 -129
  67. package/dist/for-angular/esm2022/components/decaf-crud-form/constants.mjs +0 -14
  68. package/dist/for-angular/esm2022/components/decaf-crud-form/decaf-crud-form.component.mjs +0 -80
  69. package/dist/for-angular/esm2022/components/decaf-crud-form/types.mjs +0 -2
  70. package/dist/for-angular/esm2022/components/decaf-model-renderer/decaf-model-renderer.component.mjs +0 -47
  71. package/dist/for-angular/esm2022/engine/DynamicModule.mjs +0 -3
  72. package/dist/for-angular/esm2022/engine/NgxCrudFormField.mjs +0 -115
  73. package/dist/for-angular/esm2022/engine/NgxFormService.mjs +0 -235
  74. package/dist/for-angular/esm2022/engine/NgxRenderingEngine.mjs +0 -84
  75. package/dist/for-angular/esm2022/engine/ValidatorFactory.mjs +0 -48
  76. package/dist/for-angular/esm2022/engine/constants.mjs +0 -15
  77. package/dist/for-angular/esm2022/engine/decorators.mjs +0 -14
  78. package/dist/for-angular/esm2022/engine/index.mjs +0 -6
  79. package/dist/for-angular/esm2022/engine/types.mjs +0 -2
  80. package/dist/for-angular/esm2022/interfaces.mjs +0 -2
  81. package/dist/for-angular/esm2022/public-apis.mjs +0 -6
  82. package/dist/for-angular/fesm2022/decaf-ts-for-angular.mjs +0 -759
  83. package/dist/for-angular/fesm2022/decaf-ts-for-angular.mjs.map +0 -1
  84. package/dist/for-angular/interfaces.d.ts +0 -8
  85. package/dist/for-angular/public-apis.d.ts +0 -5
@@ -0,0 +1,151 @@
1
+ /**
2
+ * @description Angular engine key constants
3
+ * @summary Contains key strings used by the Angular rendering engine for reflection,
4
+ * dynamic component creation, and other engine operations.
5
+ * @typedef {Object} AngularEngineKeys
6
+ * @property {string} REFLECT - Prefix for reflection metadata keys
7
+ * @property {string} DYNAMIC - Key for dynamic component identification
8
+ * @property {string} ANNOTATIONS - Key for component annotations
9
+ * @property {string} ECMP - Key for embedded components
10
+ * @property {string} NG_REFLECT - Prefix for Angular reflection attributes
11
+ * @property {string} RENDERED - Prefix for rendered component markers
12
+ * @property {string} MAPPER - Key for property mappers
13
+ * @property {string} CHILDREN - Key for child components
14
+ * @property {string} LISTABLE - Key for listable components
15
+ * @property {string} RENDER - Key for renderable components
16
+ * @property {string} RENDERED_ID - Template for rendered component IDs
17
+ * @property {string} PARENT - Key for comparison decorators and validators
18
+ * @const AngularEngineKeys
19
+ * @memberOf module:engine
20
+ */
21
+ export declare const AngularEngineKeys: {
22
+ REFLECT: string;
23
+ DYNAMIC: string;
24
+ ANNOTATIONS: string;
25
+ ECMP: string;
26
+ NG_REFLECT: string;
27
+ RENDERED: string;
28
+ MAPPER: string;
29
+ CHILDREN: string;
30
+ LISTABLE: string;
31
+ RENDER: string;
32
+ RENDERED_ID: string;
33
+ PARENT: string;
34
+ VALIDATION_PARENT_KEY: symbol;
35
+ };
36
+ /**
37
+ * @description Form validation state constants
38
+ * @summary Contains constants representing the possible validation states of a form.
39
+ * These are used to check and handle form validation throughout the application.
40
+ * @typedef {Object} FormConstants
41
+ * @property {string} VALID - Constant representing a valid form state
42
+ * @property {string} INVALID - Constant representing an invalid form state
43
+ * @const FormConstants
44
+ * @memberOf module:engine
45
+ */
46
+ export declare const FormConstants: {
47
+ VALID: string;
48
+ INVALID: string;
49
+ };
50
+ /**
51
+ * @description Event name constants
52
+ * @summary Enum containing constants for event names used throughout the application.
53
+ * These are used to standardize event naming and handling.
54
+ * @enum {string}
55
+ * @readonly
56
+ * @property {string} BACK_BUTTON_NAVIGATION - Event fired when back button navigation ends
57
+ * @property {string} REFRESH_EVENT - Event fired when a refresh action occurs
58
+ * @property {string} CLICK_EVENT - Event fired when a click action occurs
59
+ * @property {string} SUBMIT_EVENT - Event fired when a form submission occurs
60
+ * @memberOf module:engine
61
+ */
62
+ export declare enum EventConstants {
63
+ BACK_BUTTON_NAVIGATION = "backButtonNavigationEndEvent",
64
+ REFRESH_EVENT = "RefreshEvent",
65
+ CLICK_EVENT = "ClickEvent",
66
+ SUBMIT_EVENT = "SubmitEvent"
67
+ }
68
+ /**
69
+ * @description Logger level constants
70
+ * @summary Enum defining the logging levels used in the application's logging system.
71
+ * Lower values represent more verbose logging, while higher values represent more critical logs.
72
+ * @enum {number}
73
+ * @readonly
74
+ * @property {number} ALL - Log everything (most verbose)
75
+ * @property {number} DEBUG - Log debug information
76
+ * @property {number} INFO - Log informational messages
77
+ * @property {number} WARN - Log warnings
78
+ * @property {number} ERROR - Log errors
79
+ * @property {number} CRITICAL - Log critical errors (least verbose)
80
+ * @memberOf module:engine
81
+ */
82
+ export declare enum LoggerLevels {
83
+ ALL = 0,
84
+ DEBUG = 1,
85
+ INFO = 2,
86
+ WARN = 3,
87
+ ERROR = 4,
88
+ CRITICAL = 5
89
+ }
90
+ /**
91
+ * @description Route direction constants
92
+ * @summary Enum defining the possible navigation directions in the application.
93
+ * Used for controlling navigation flow and animation directions.
94
+ * @enum {string}
95
+ * @readonly
96
+ * @property {string} BACK - Navigate back to the previous page
97
+ * @property {string} FORWARD - Navigate forward to the next page
98
+ * @property {string} ROOT - Navigate to the root/home page
99
+ * @memberOf module:engine
100
+ */
101
+ export declare enum RouteDirections {
102
+ BACK = "back",
103
+ FORWARD = "forward",
104
+ ROOT = "root"
105
+ }
106
+ /**
107
+ * @description Component tag name constants
108
+ * @summary Enum defining the tag names for custom components used in the application.
109
+ * These tag names are used for component registration and rendering.
110
+ * @enum {string}
111
+ * @readonly
112
+ * @property {string} LIST_ITEM - Tag name for list item component
113
+ * @property {string} LIST_INFINITE - Tag name for infinite scrolling list component
114
+ * @property {string} LIST_PAGINATED - Tag name for paginated list component
115
+ * @memberOf module:engine
116
+ */
117
+ export declare enum ComponentsTagNames {
118
+ LIST_ITEM = "ngx-decaf-list-item",
119
+ LIST_INFINITE = "ngx-decaf-list-infinite",
120
+ LIST_PAGINATED = "ngx-decaf-list-paginated"
121
+ }
122
+ /**
123
+ * @description Base component property name constants
124
+ * @summary Enum defining the standard property names used by base components in the application.
125
+ * These property names are used for consistent property access across components.
126
+ * @enum {string}
127
+ * @readonly
128
+ * @property {string} MODEL - Property name for the component's data model
129
+ * @property {string} LOCALE - Property name for localization settings
130
+ * @property {string} PK - Property name for primary key
131
+ * @property {string} ITEMS - Property name for collection items
132
+ * @property {string} ROUTE - Property name for routing information
133
+ * @property {string} OPERATIONS - Property name for available operations
134
+ * @property {string} UID - Property name for unique identifier
135
+ * @property {string} TRANSLATABLE - Property name for translation flag
136
+ * @property {string} MAPPER - Property name for property mapper
137
+ * @property {string} INITIALIZED - Property name for initialization state
138
+ * @memberOf module:engine
139
+ */
140
+ export declare enum BaseComponentProps {
141
+ MODEL = "model",
142
+ LOCALE = "locale",
143
+ PK = "pk",
144
+ ITEMS = "items",
145
+ ROUTE = "route",
146
+ OPERATIONS = "operations",
147
+ UID = "uid",
148
+ TRANSLATABLE = "translatable",
149
+ MAPPER = "mapper",
150
+ INITIALIZED = "initialized"
151
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @description Marks an Angular component as dynamically loadable
3
+ * @summary Decorator that registers an Angular component with the NgxRenderingEngine2 for dynamic loading.
4
+ * This decorator must be applied before the @Component decorator to properly extract component metadata.
5
+ * It adds metadata to the component class and registers it with the rendering engine using its selector.
6
+ * @function Dynamic
7
+ * @return {Function} A decorator function that can be applied to Angular component classes
8
+ * @mermaid
9
+ * sequenceDiagram
10
+ * participant C as Component Class
11
+ * participant D as Dynamic Decorator
12
+ * participant R as NgxRenderingEngine2
13
+ * participant M as Angular Metadata
14
+ * C->>D: Apply decorator
15
+ * D->>M: reflectComponentType()
16
+ * M-->>D: Return component metadata
17
+ * alt No metadata found
18
+ * D->>D: Throw InternalError
19
+ * else Metadata found
20
+ * D->>R: registerComponent(selector, constructor)
21
+ * D->>C: Apply metadata
22
+ * end
23
+ * @category Decorators
24
+ */
25
+ export declare function Dynamic(): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor) => void;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @module engine
3
+ * @description Angular rendering engine for Decaf applications
4
+ * @summary The engine module provides core functionality for rendering Angular components
5
+ * in Decaf applications. It includes constants, decorators, rendering engines, and utility types
6
+ * that enable dynamic component creation, property mapping, and component lifecycle management.
7
+ * Key exports include {@link NgxRenderingEngine}, {@link DynamicModule}, and various decorators
8
+ * for component configuration.
9
+ */
10
+ export * from './constants';
11
+ export * from './decorators';
12
+ export * from './DynamicModule';
13
+ export * from './NgxRenderingEngine';
14
+ export * from './NgxRenderingEngine2';
15
+ export * from './types';
@@ -0,0 +1,294 @@
1
+ import { IonCheckbox, IonInput, IonSelect, IonTextarea } from '@ionic/angular';
2
+ import { TextFieldTypes } from '@ionic/core';
3
+ import { EnvironmentInjector, Injector, Type } from '@angular/core';
4
+ import { FormControl, FormGroup } from '@angular/forms';
5
+ import { FieldProperties } from '@decaf-ts/ui-decorators';
6
+ export type KeyValue = Record<string, any>;
7
+ export type FunctionLike = (...args: any[]) => any;
8
+ /**
9
+ * @description Element size options for UI components
10
+ * @summary Defines the possible size values that can be applied to UI elements.
11
+ * These sizes control the dimensions and layout behavior of components.
12
+ * @typedef {('small'|'medium'|'large'|'xlarge'|'2xlarge'|'auto'|'expand'|'block')} ElementSizes
13
+ * @memberOf module:engine
14
+ */
15
+ export type ElementSizes = 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge' | 'auto' | 'expand' | 'block';
16
+ /**
17
+ * @description Basic position options for UI elements
18
+ * @summary Defines the possible position values that can be applied to UI elements.
19
+ * These positions control the alignment and placement of components.
20
+ * @typedef {('left'|'center'|'right'|'top'|'bottom')} ElementPositions
21
+ * @memberOf module:engine
22
+ */
23
+ export type ElementPositions = 'left' | 'center' | 'right' | 'top' | 'bottom';
24
+ /**
25
+ * @description Extended position options for flex layouts
26
+ * @summary Extends the basic ElementPositions with additional flex-specific position values.
27
+ * These positions are used for controlling alignment and distribution in flex containers.
28
+ * @typedef {(ElementPositions|'stretch'|'middle'|'around'|'between')} FlexPositions
29
+ * @memberOf module:engine
30
+ */
31
+ export type FlexPositions = ElementPositions | 'stretch' | 'middle' | 'around' | 'between';
32
+ /**
33
+ * @description Update mode options for form fields
34
+ * @summary Defines when form field values should be updated in the model.
35
+ * - 'change': Update on every change event
36
+ * - 'blur': Update when the field loses focus
37
+ * - 'submit': Update only when the form is submitted
38
+ * @typedef {('change'|'blur'|'submit')} FieldUpdateMode
39
+ * @memberOf module:engine
40
+ */
41
+ export type FieldUpdateMode = 'change' | 'blur' | 'submit';
42
+ /**
43
+ * @description Metadata structure for Angular components
44
+ * @summary Defines the structure of metadata for Angular components, including
45
+ * change detection strategy, selector, standalone status, imports, template, and styles.
46
+ * This is used for reflection and dynamic component creation.
47
+ * @interface ComponentMetadata
48
+ * @property {number} changeDetection - The change detection strategy number
49
+ * @property {string} selector - The CSS selector for the component
50
+ * @property {boolean} standalone - Whether the component is standalone
51
+ * @property imports - Array of imported modules/components
52
+ * @property {string} template - The HTML template for the component
53
+ * @property {string[]} styles - Array of CSS styles for the component
54
+ * @memberOf module:engine
55
+ */
56
+ export interface ComponentMetadata {
57
+ changeDetection: number;
58
+ selector: string;
59
+ standalone: boolean;
60
+ imports: (new (...args: unknown[]) => unknown)[];
61
+ template: string;
62
+ styles: string[];
63
+ }
64
+ /**
65
+ * @description Output structure from the Angular rendering engine
66
+ * @summary Defines the structure of the output produced by the NgxRenderingEngine
67
+ * when rendering a component. Contains the component type, inputs, injector,
68
+ * content nodes, and child components.
69
+ * @typedef {Object} AngularDynamicOutput
70
+ * @property {Type<unknown>} component - The Angular component type
71
+ * @property {string} [rendererId] - Optional unique ID for the rendered component
72
+ * @property {Record<string, unknown>} [inputs] - Optional input properties for the component
73
+ * @property {Injector} [injector] - Optional Angular injector for dependency injection
74
+ * @property {Node[][]} [content] - Optional content nodes for projection
75
+ * @property {AngularDynamicOutput[]} [children] - Optional child components
76
+ * @property {Type<unknown>} [instance] - Optional component instance
77
+ * @property {FormGroup} [formGroup] - Optional component FormGroup
78
+ * @property {FormControl} [formControl] - Optional component FormControl
79
+ * @memberOf module:engine
80
+ */
81
+ export interface AngularDynamicOutput {
82
+ component: Type<unknown>;
83
+ rendererId?: string;
84
+ inputs?: Record<string, unknown>;
85
+ injector?: Injector;
86
+ content?: Node[][];
87
+ children?: AngularDynamicOutput[];
88
+ instance?: Type<unknown>;
89
+ formGroup?: FormGroup;
90
+ formControl?: FormControl;
91
+ }
92
+ /**
93
+ * @description Interface for models that can be rendered
94
+ * @summary Defines the basic structure for models that can be rendered by the engine.
95
+ * Contains an optional rendererId that uniquely identifies the rendered instance.
96
+ * @interface RenderedModel
97
+ * @property {string} [rendererId] - Optional unique ID for the rendered model instance
98
+ * @memberOf module:engine
99
+ */
100
+ export interface RenderedModel {
101
+ rendererId?: string;
102
+ }
103
+ /**
104
+ * @description Possible input types for form fields
105
+ * @summary Defines the possible input types that can be used in form fields.
106
+ * Includes standard HTML input types like checkbox, radio, and select,
107
+ * as well as Ionic's TextFieldTypes and textarea.
108
+ * @typedef {('checkbox'|'radio'|'select'|TextFieldTypes|'textarea')} PossibleInputTypes
109
+ * @memberOf module:engine
110
+ */
111
+ export type PossibleInputTypes = 'checkbox' | 'radio' | 'select' | TextFieldTypes | 'textarea';
112
+ /**
113
+ * @description Field definition for Angular components
114
+ * @summary A comprehensive type that combines properties from various Ionic components
115
+ * to define the structure of a field in an Angular form. It omits certain properties
116
+ * from IonInput, picks specific properties from IonSelect, IonTextarea, and IonCheckbox,
117
+ * and adds custom properties like type and className.
118
+ * @typedef {Object} AngularFieldDefinition
119
+ * @property {PossibleInputTypes} type - The type of input field
120
+ * @property {string|string[]} className - CSS class name(s) for the field
121
+ * @property {string} [cancelText] - Text for the cancel button (from IonSelect)
122
+ * @property {string} [interface] - Interface style for select (from IonSelect)
123
+ * @property {string} [selectedText] - Text for selected option (from IonSelect)
124
+ * @property {Object} [interfaceOptions] - Options for the interface (from IonSelect)
125
+ * @property {number} [rows] - Number of rows for textarea (from IonTextarea)
126
+ * @property {number} [cols] - Number of columns for textarea (from IonTextarea)
127
+ * @property {string} [alignment] - Alignment of checkbox (from IonCheckbox)
128
+ * @property {string} [justify] - Justification of checkbox (from IonCheckbox)
129
+ * @property {boolean} [checked] - Whether checkbox is checked (from IonCheckbox)
130
+ * @memberOf module:engine
131
+ */
132
+ export type AngularFieldDefinition = Omit<IonInput, 'ionInput' | 'ionFocus' | 'ionChange' | 'ionBlur' | 'getInputElement' | 'setFocus' | 'label' | 'el' | 'z' | 'type'> & Pick<IonSelect, 'cancelText' | 'interface' | 'selectedText' | 'interfaceOptions'> & Pick<IonTextarea, 'rows' | 'cols'> & Pick<IonCheckbox, 'alignment' | 'justify' | 'checked'> & {
133
+ type: PossibleInputTypes;
134
+ className: string | string[];
135
+ } & Record<string, unknown>;
136
+ /**
137
+ * @description String or boolean representation of a boolean value
138
+ * @summary Represents a value that can be either a boolean or a string representation of a boolean.
139
+ * This is useful for handling attribute values that can be specified as either strings or booleans.
140
+ * @typedef {('true'|'false'|boolean)} StringOrBoolean
141
+ * @memberOf module:engine
142
+ */
143
+ export type StringOrBoolean = 'true' | 'false' | boolean;
144
+ /**
145
+ * @description Option type for select inputs
146
+ * @summary Extends the InputOption interface with a selected property to indicate
147
+ * whether the option is selected by default.
148
+ * @memberOf module:engine
149
+ */
150
+ export type SelectOption = InputOption & {
151
+ selected?: boolean;
152
+ };
153
+ /**
154
+ * @description Option type for radio inputs
155
+ * @summary Extends the InputOption interface with a checked property to indicate
156
+ * whether the option is checked by default.
157
+ * @memberOf module:engine
158
+ */
159
+ export type RadioOption = InputOption & {
160
+ checked?: boolean;
161
+ };
162
+ /**
163
+ * @description Option type for checkbox inputs
164
+ * @summary Alias for RadioOption, as checkbox options have the same structure as radio options.
165
+ * @typedef {RadioOption} CheckboxOption
166
+ * @memberOf module:engine
167
+ */
168
+ export type CheckboxOption = RadioOption;
169
+ /**
170
+ * @description Base option type for input components
171
+ * @summary Defines the common structure for options used in select, radio, and checkbox inputs.
172
+ * Contains properties for the display text, value, disabled state, CSS class, and icon.
173
+ * @interface InputOption
174
+ * @property {string} text - The display text for the option
175
+ * @property {string|number} value - The value associated with the option
176
+ * @property {StringOrBoolean} [disabled] - Whether the option is disabled
177
+ * @property {string} [className] - CSS class name for styling the option
178
+ * @property {string} [icon] - Icon to display with the option
179
+ * @memberOf module:engine
180
+ */
181
+ export interface InputOption {
182
+ text: string;
183
+ value: string | number;
184
+ disabled?: StringOrBoolean;
185
+ className?: string;
186
+ icon?: string;
187
+ }
188
+ /**
189
+ * @description Target options for HTML forms
190
+ * @summary Defines the possible target values for HTML forms, including standard targets
191
+ * like '_blank', '_self', '_parent', and '_top', as well as custom string values.
192
+ * @typedef {('_blank'|'_self'|'_parent'|'_top'|string)} HTMLFormTarget
193
+ * @memberOf module:engine
194
+ */
195
+ export type HTMLFormTarget = '_blank' | '_self' | '_parent' | '_top' | string;
196
+ /**
197
+ * @description Interface for list component refresh events
198
+ * @summary Defines the structure of a refresh event for list components.
199
+ * Contains an array of key-value pairs representing the new data for the list.
200
+ * @interface IListComponentRefreshEvent
201
+ * @property {KeyValue[]} data - Array of key-value pairs representing the new data
202
+ * @memberOf module:engine
203
+ */
204
+ export interface IListComponentRefreshEvent {
205
+ data: KeyValue[];
206
+ }
207
+ export interface FormServiceControl {
208
+ control: FormGroup;
209
+ props: AngularFieldDefinition;
210
+ }
211
+ /**
212
+ * @description Type for form service controls
213
+ * @summary Defines the structure of form controls managed by the form service.
214
+ * It's a nested record where the outer key is the form group name, the inner key
215
+ * is the control name, and the value contains the form group and field properties.
216
+ * @typedef {Record<string, Record<string, { control: FormGroup; props: AngularFieldDefinition }>>} FormServiceControls
217
+ * @memberOf module:engine
218
+ */
219
+ export type FormServiceControls = Record<string, Record<string, FormServiceControl>>;
220
+ /**
221
+ * @description Interface for model render custom events
222
+ * @summary Defines the structure of custom events triggered during model rendering.
223
+ * Contains the event detail, component name, and event name.
224
+ * @interface ModelRenderCustomEvent
225
+ * @property {BaseCustomEvent} detail - The detailed event information
226
+ * @property {string} component - The component that triggered the event
227
+ * @property {string} name - The name of the event
228
+ * @memberOf module:engine
229
+ */
230
+ export interface ModelRenderCustomEvent {
231
+ detail: BaseCustomEvent;
232
+ component: string;
233
+ name: string;
234
+ }
235
+ /**
236
+ * @description Interface for list item custom events
237
+ * @summary Defines the structure of custom events triggered by list items.
238
+ * Extends BaseCustomEvent with additional properties for the action and primary key.
239
+ * @interface ListItemCustomEvent
240
+ * @property {string} action - The action performed on the list item
241
+ * @property {string} [pk] - Optional primary key of the affected item
242
+ * @property {any} data - The data associated with the event (inherited from BaseCustomEvent)
243
+ * @property {HTMLElement} [target] - The target element (inherited from BaseCustomEvent)
244
+ * @property {string} [name] - The name of the event (inherited from BaseCustomEvent)
245
+ * @property {string} component - The component that triggered the event (inherited from BaseCustomEvent)
246
+ * @memberOf module:engine
247
+ */
248
+ export interface ListItemCustomEvent extends BaseCustomEvent {
249
+ action: string;
250
+ pk?: string;
251
+ }
252
+ /**
253
+ * @description Base interface for custom events
254
+ * @summary Defines the base structure for custom events in the application.
255
+ * Contains properties for the event data, target element, name, and component.
256
+ * @interface BaseCustomEvent
257
+ * @property {any} data - The data associated with the event
258
+ * @property {HTMLElement} [target] - The target element that triggered the event
259
+ * @property {string} [name] - The name of the event
260
+ * @property {string} component - The component that triggered the event
261
+ * @memberOf module:engine
262
+ */
263
+ export interface BaseCustomEvent {
264
+ data: unknown;
265
+ target?: HTMLElement;
266
+ name?: string;
267
+ component: string;
268
+ }
269
+ /**
270
+ * @description Base interface for custom events
271
+ * @summary Defines the base structure for custom events in the application.
272
+ * Contains properties for the event data, target element, name, and component.
273
+ * @interface BaseCustomEvent
274
+ * @property {any} data - The data associated with the event
275
+ * @property {HTMLElement} [target] - The target element that triggered the event
276
+ * @property {string} [name] - The name of the event
277
+ * @property {string} component - The component that triggered the event
278
+ * @memberOf module:engine
279
+ */
280
+ export type CrudFormEvent = BaseCustomEvent & {
281
+ handlers?: Record<string, any>;
282
+ };
283
+ export interface ComponentInput extends FieldProperties {
284
+ updateMode?: FieldUpdateMode;
285
+ formGroup?: FormGroup;
286
+ formControl?: FormControl;
287
+ }
288
+ export interface ComponentConfig {
289
+ component: string;
290
+ inputs: ComponentInput;
291
+ injector: EnvironmentInjector | Injector;
292
+ children?: ComponentConfig[];
293
+ }
294
+ export type FormParentGroup = [FormGroup, string];