@decaf-ts/for-angular 0.0.4 → 0.0.5

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 +447 -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 +97 -0
  16. package/dist/lib/engine/DynamicModule.d.ts +17 -0
  17. package/dist/{for-angular → lib}/engine/NgxCrudFormField.d.ts +22 -14
  18. package/dist/lib/engine/NgxFormService.d.ts +167 -0
  19. package/dist/lib/engine/NgxRenderingEngine.d.ts +128 -0
  20. package/dist/lib/engine/NgxRenderingEngine2.d.ts +251 -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 +293 -0
  26. package/dist/lib/esm2022/components/component-renderer/component-renderer.component.mjs +309 -0
  27. package/dist/lib/esm2022/components/crud-field/crud-field.component.mjs +288 -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 +140 -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 +137 -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 +117 -0
  35. package/dist/lib/esm2022/engine/NgxFormService.mjs +315 -0
  36. package/dist/lib/esm2022/engine/NgxRenderingEngine.mjs +194 -0
  37. package/dist/lib/esm2022/engine/NgxRenderingEngine2.mjs +333 -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 +2138 -0
  47. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs.map +1 -0
  48. package/dist/lib/for-angular.module.d.ts +44 -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 +73 -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,293 @@
1
+ import { IonCheckbox, IonInput, IonSelect, IonTextarea } from '@ionic/angular';
2
+ import { TextFieldTypes } from '@ionic/core';
3
+ import { 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
+ /**
8
+ * @description Element size options for UI components
9
+ * @summary Defines the possible size values that can be applied to UI elements.
10
+ * These sizes control the dimensions and layout behavior of components.
11
+ * @typedef {('small'|'medium'|'large'|'xlarge'|'2xlarge'|'auto'|'expand'|'block')} ElementSizes
12
+ * @memberOf module:engine
13
+ */
14
+ export type ElementSizes = 'small' | 'medium' | 'large' | 'xlarge' | '2xlarge' | 'auto' | 'expand' | 'block';
15
+ /**
16
+ * @description Basic position options for UI elements
17
+ * @summary Defines the possible position values that can be applied to UI elements.
18
+ * These positions control the alignment and placement of components.
19
+ * @typedef {('left'|'center'|'right'|'top'|'bottom')} ElementPositions
20
+ * @memberOf module:engine
21
+ */
22
+ export type ElementPositions = 'left' | 'center' | 'right' | 'top' | 'bottom';
23
+ /**
24
+ * @description Extended position options for flex layouts
25
+ * @summary Extends the basic ElementPositions with additional flex-specific position values.
26
+ * These positions are used for controlling alignment and distribution in flex containers.
27
+ * @typedef {(ElementPositions|'stretch'|'middle'|'around'|'between')} FlexPositions
28
+ * @memberOf module:engine
29
+ */
30
+ export type FlexPositions = ElementPositions | 'stretch' | 'middle' | 'around' | 'between';
31
+ /**
32
+ * @description Update mode options for form fields
33
+ * @summary Defines when form field values should be updated in the model.
34
+ * - 'change': Update on every change event
35
+ * - 'blur': Update when the field loses focus
36
+ * - 'submit': Update only when the form is submitted
37
+ * @typedef {('change'|'blur'|'submit')} FieldUpdateMode
38
+ * @memberOf module:engine
39
+ */
40
+ export type FieldUpdateMode = 'change' | 'blur' | 'submit';
41
+ /**
42
+ * @description Metadata structure for Angular components
43
+ * @summary Defines the structure of metadata for Angular components, including
44
+ * change detection strategy, selector, standalone status, imports, template, and styles.
45
+ * This is used for reflection and dynamic component creation.
46
+ * @interface ComponentMetadata
47
+ * @property {number} changeDetection - The change detection strategy number
48
+ * @property {string} selector - The CSS selector for the component
49
+ * @property {boolean} standalone - Whether the component is standalone
50
+ * @property imports - Array of imported modules/components
51
+ * @property {string} template - The HTML template for the component
52
+ * @property {string[]} styles - Array of CSS styles for the component
53
+ * @memberOf module:engine
54
+ */
55
+ export interface ComponentMetadata {
56
+ changeDetection: number;
57
+ selector: string;
58
+ standalone: boolean;
59
+ imports: (new (...args: unknown[]) => unknown)[];
60
+ template: string;
61
+ styles: string[];
62
+ }
63
+ /**
64
+ * @description Output structure from the Angular rendering engine
65
+ * @summary Defines the structure of the output produced by the NgxRenderingEngine
66
+ * when rendering a component. Contains the component type, inputs, injector,
67
+ * content nodes, and child components.
68
+ * @typedef {Object} AngularDynamicOutput
69
+ * @property {Type<unknown>} component - The Angular component type
70
+ * @property {string} [rendererId] - Optional unique ID for the rendered component
71
+ * @property {Record<string, unknown>} [inputs] - Optional input properties for the component
72
+ * @property {Injector} [injector] - Optional Angular injector for dependency injection
73
+ * @property {Node[][]} [content] - Optional content nodes for projection
74
+ * @property {AngularDynamicOutput[]} [children] - Optional child components
75
+ * @property {Type<unknown>} [instance] - Optional component instance
76
+ * @property {FormGroup} [formGroup] - Optional component FormGroup
77
+ * @property {FormControl} [formControl] - Optional component FormControl
78
+ * @memberOf module:engine
79
+ */
80
+ export interface AngularDynamicOutput {
81
+ component: Type<unknown>;
82
+ rendererId?: string;
83
+ inputs?: Record<string, unknown>;
84
+ injector?: Injector;
85
+ content?: Node[][];
86
+ children?: AngularDynamicOutput[];
87
+ instance?: Type<unknown>;
88
+ formGroup?: FormGroup;
89
+ formControl?: FormControl;
90
+ }
91
+ /**
92
+ * @description Interface for models that can be rendered
93
+ * @summary Defines the basic structure for models that can be rendered by the engine.
94
+ * Contains an optional rendererId that uniquely identifies the rendered instance.
95
+ * @interface RenderedModel
96
+ * @property {string} [rendererId] - Optional unique ID for the rendered model instance
97
+ * @memberOf module:engine
98
+ */
99
+ export interface RenderedModel {
100
+ rendererId?: string;
101
+ }
102
+ /**
103
+ * @description Possible input types for form fields
104
+ * @summary Defines the possible input types that can be used in form fields.
105
+ * Includes standard HTML input types like checkbox, radio, and select,
106
+ * as well as Ionic's TextFieldTypes and textarea.
107
+ * @typedef {('checkbox'|'radio'|'select'|TextFieldTypes|'textarea')} PossibleInputTypes
108
+ * @memberOf module:engine
109
+ */
110
+ export type PossibleInputTypes = 'checkbox' | 'radio' | 'select' | TextFieldTypes | 'textarea';
111
+ /**
112
+ * @description Field definition for Angular components
113
+ * @summary A comprehensive type that combines properties from various Ionic components
114
+ * to define the structure of a field in an Angular form. It omits certain properties
115
+ * from IonInput, picks specific properties from IonSelect, IonTextarea, and IonCheckbox,
116
+ * and adds custom properties like type and className.
117
+ * @typedef {Object} AngularFieldDefinition
118
+ * @property {PossibleInputTypes} type - The type of input field
119
+ * @property {string|string[]} className - CSS class name(s) for the field
120
+ * @property {string} [cancelText] - Text for the cancel button (from IonSelect)
121
+ * @property {string} [interface] - Interface style for select (from IonSelect)
122
+ * @property {string} [selectedText] - Text for selected option (from IonSelect)
123
+ * @property {Object} [interfaceOptions] - Options for the interface (from IonSelect)
124
+ * @property {number} [rows] - Number of rows for textarea (from IonTextarea)
125
+ * @property {number} [cols] - Number of columns for textarea (from IonTextarea)
126
+ * @property {string} [alignment] - Alignment of checkbox (from IonCheckbox)
127
+ * @property {string} [justify] - Justification of checkbox (from IonCheckbox)
128
+ * @property {boolean} [checked] - Whether checkbox is checked (from IonCheckbox)
129
+ * @memberOf module:engine
130
+ */
131
+ 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'> & {
132
+ type: PossibleInputTypes;
133
+ className: string | string[];
134
+ } & Record<string, unknown>;
135
+ /**
136
+ * @description String or boolean representation of a boolean value
137
+ * @summary Represents a value that can be either a boolean or a string representation of a boolean.
138
+ * This is useful for handling attribute values that can be specified as either strings or booleans.
139
+ * @typedef {('true'|'false'|boolean)} StringOrBoolean
140
+ * @memberOf module:engine
141
+ */
142
+ export type StringOrBoolean = 'true' | 'false' | boolean;
143
+ /**
144
+ * @description Option type for select inputs
145
+ * @summary Extends the InputOption interface with a selected property to indicate
146
+ * whether the option is selected by default.
147
+ * @memberOf module:engine
148
+ */
149
+ export type SelectOption = InputOption & {
150
+ selected?: boolean;
151
+ };
152
+ /**
153
+ * @description Option type for radio inputs
154
+ * @summary Extends the InputOption interface with a checked property to indicate
155
+ * whether the option is checked by default.
156
+ * @memberOf module:engine
157
+ */
158
+ export type RadioOption = InputOption & {
159
+ checked?: boolean;
160
+ };
161
+ /**
162
+ * @description Option type for checkbox inputs
163
+ * @summary Alias for RadioOption, as checkbox options have the same structure as radio options.
164
+ * @typedef {RadioOption} CheckboxOption
165
+ * @memberOf module:engine
166
+ */
167
+ export type CheckboxOption = RadioOption;
168
+ /**
169
+ * @description Base option type for input components
170
+ * @summary Defines the common structure for options used in select, radio, and checkbox inputs.
171
+ * Contains properties for the display text, value, disabled state, CSS class, and icon.
172
+ * @interface InputOption
173
+ * @property {string} text - The display text for the option
174
+ * @property {string|number} value - The value associated with the option
175
+ * @property {StringOrBoolean} [disabled] - Whether the option is disabled
176
+ * @property {string} [className] - CSS class name for styling the option
177
+ * @property {string} [icon] - Icon to display with the option
178
+ * @memberOf module:engine
179
+ */
180
+ export interface InputOption {
181
+ text: string;
182
+ value: string | number;
183
+ disabled?: StringOrBoolean;
184
+ className?: string;
185
+ icon?: string;
186
+ }
187
+ /**
188
+ * @description Target options for HTML forms
189
+ * @summary Defines the possible target values for HTML forms, including standard targets
190
+ * like '_blank', '_self', '_parent', and '_top', as well as custom string values.
191
+ * @typedef {('_blank'|'_self'|'_parent'|'_top'|string)} HTMLFormTarget
192
+ * @memberOf module:engine
193
+ */
194
+ export type HTMLFormTarget = '_blank' | '_self' | '_parent' | '_top' | string;
195
+ /**
196
+ * @description Interface for list component refresh events
197
+ * @summary Defines the structure of a refresh event for list components.
198
+ * Contains an array of key-value pairs representing the new data for the list.
199
+ * @interface IListComponentRefreshEvent
200
+ * @property {KeyValue[]} data - Array of key-value pairs representing the new data
201
+ * @memberOf module:engine
202
+ */
203
+ export interface IListComponentRefreshEvent {
204
+ data: KeyValue[];
205
+ }
206
+ export interface FormServiceControl {
207
+ control: FormGroup;
208
+ props: AngularFieldDefinition;
209
+ }
210
+ /**
211
+ * @description Type for form service controls
212
+ * @summary Defines the structure of form controls managed by the form service.
213
+ * It's a nested record where the outer key is the form group name, the inner key
214
+ * is the control name, and the value contains the form group and field properties.
215
+ * @typedef {Record<string, Record<string, { control: FormGroup; props: AngularFieldDefinition }>>} FormServiceControls
216
+ * @memberOf module:engine
217
+ */
218
+ export type FormServiceControls = Record<string, Record<string, FormServiceControl>>;
219
+ /**
220
+ * @description Interface for model render custom events
221
+ * @summary Defines the structure of custom events triggered during model rendering.
222
+ * Contains the event detail, component name, and event name.
223
+ * @interface ModelRenderCustomEvent
224
+ * @property {BaseCustomEvent} detail - The detailed event information
225
+ * @property {string} component - The component that triggered the event
226
+ * @property {string} name - The name of the event
227
+ * @memberOf module:engine
228
+ */
229
+ export interface ModelRenderCustomEvent {
230
+ detail: BaseCustomEvent;
231
+ component: string;
232
+ name: string;
233
+ }
234
+ /**
235
+ * @description Interface for list item custom events
236
+ * @summary Defines the structure of custom events triggered by list items.
237
+ * Extends BaseCustomEvent with additional properties for the action and primary key.
238
+ * @interface ListItemCustomEvent
239
+ * @property {string} action - The action performed on the list item
240
+ * @property {string} [pk] - Optional primary key of the affected item
241
+ * @property {any} data - The data associated with the event (inherited from BaseCustomEvent)
242
+ * @property {HTMLElement} [target] - The target element (inherited from BaseCustomEvent)
243
+ * @property {string} [name] - The name of the event (inherited from BaseCustomEvent)
244
+ * @property {string} component - The component that triggered the event (inherited from BaseCustomEvent)
245
+ * @memberOf module:engine
246
+ */
247
+ export interface ListItemCustomEvent extends BaseCustomEvent {
248
+ action: string;
249
+ pk?: string;
250
+ }
251
+ /**
252
+ * @description Base interface for custom events
253
+ * @summary Defines the base structure for custom events in the application.
254
+ * Contains properties for the event data, target element, name, and component.
255
+ * @interface BaseCustomEvent
256
+ * @property {any} data - The data associated with the event
257
+ * @property {HTMLElement} [target] - The target element that triggered the event
258
+ * @property {string} [name] - The name of the event
259
+ * @property {string} component - The component that triggered the event
260
+ * @memberOf module:engine
261
+ */
262
+ export interface BaseCustomEvent {
263
+ data: any;
264
+ target?: HTMLElement;
265
+ name?: string;
266
+ component: string;
267
+ }
268
+ /**
269
+ * @description Base interface for custom events
270
+ * @summary Defines the base structure for custom events in the application.
271
+ * Contains properties for the event data, target element, name, and component.
272
+ * @interface BaseCustomEvent
273
+ * @property {any} data - The data associated with the event
274
+ * @property {HTMLElement} [target] - The target element that triggered the event
275
+ * @property {string} [name] - The name of the event
276
+ * @property {string} component - The component that triggered the event
277
+ * @memberOf module:engine
278
+ */
279
+ export type CrudFormEvent = BaseCustomEvent & {
280
+ handlers?: Record<string, any>;
281
+ };
282
+ export interface ComponentInput extends FieldProperties {
283
+ updateMode?: FieldUpdateMode;
284
+ formGroup?: FormGroup;
285
+ formControl?: FormControl;
286
+ }
287
+ export interface ComponentConfig {
288
+ component: string;
289
+ inputs: ComponentInput;
290
+ injector: any;
291
+ children?: ComponentConfig[];
292
+ }
293
+ export type FormParentGroup = [FormGroup, string];