@decaf-ts/ui-decorators 0.13.0 → 0.15.0

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 (55) hide show
  1. package/lib/cjs/index.cjs +1 -1
  2. package/lib/esm/index.js +1 -1
  3. package/lib/types/index.d.cts +4 -4
  4. package/lib/types/index.d.mts +4 -4
  5. package/lib/types/model/decorators.d.cts +1 -1
  6. package/lib/types/model/decorators.d.mts +1 -1
  7. package/lib/types/model/index.d.cts +3 -3
  8. package/lib/types/model/index.d.mts +3 -3
  9. package/lib/types/model/model.d.cts +2 -2
  10. package/lib/types/model/model.d.mts +2 -2
  11. package/lib/types/overrides/index.d.cts +1 -1
  12. package/lib/types/overrides/index.d.mts +1 -1
  13. package/lib/types/ui/DecafComponent.d.cts +3 -3
  14. package/lib/types/ui/DecafComponent.d.mts +3 -3
  15. package/lib/types/ui/DecafEventHandler.d.cts +1 -1
  16. package/lib/types/ui/DecafEventHandler.d.mts +1 -1
  17. package/lib/types/ui/Rendering.d.cts +1 -1
  18. package/lib/types/ui/Rendering.d.mts +1 -1
  19. package/lib/types/ui/UIValidator.d.cts +1 -1
  20. package/lib/types/ui/UIValidator.d.mts +1 -1
  21. package/lib/types/ui/decorators.d.cts +2 -2
  22. package/lib/types/ui/decorators.d.mts +2 -2
  23. package/lib/types/ui/index.d.cts +11 -11
  24. package/lib/types/ui/index.d.mts +11 -11
  25. package/lib/types/ui/interfaces.d.cts +1 -1
  26. package/lib/types/ui/interfaces.d.mts +1 -1
  27. package/lib/types/ui/types.d.cts +2 -2
  28. package/lib/types/ui/types.d.mts +2 -2
  29. package/lib/types/ui/utils.d.cts +1 -1
  30. package/lib/types/ui/utils.d.mts +1 -1
  31. package/lib/types/ui/validator.d.cts +1 -1
  32. package/lib/types/ui/validator.d.mts +1 -1
  33. package/package.json +1 -1
  34. package/lib/types/index.d.ts +0 -19
  35. package/lib/types/model/Renderable.d.ts +0 -18
  36. package/lib/types/model/decorators.d.ts +0 -318
  37. package/lib/types/model/index.d.ts +0 -4
  38. package/lib/types/model/model.d.ts +0 -31
  39. package/lib/types/model/overrides.d.ts +0 -9
  40. package/lib/types/overrides/ModelBuilderExtensions.d.ts +0 -16
  41. package/lib/types/overrides/index.d.ts +0 -6
  42. package/lib/types/ui/DecafComponent.d.ts +0 -293
  43. package/lib/types/ui/DecafEventHandler.d.ts +0 -43
  44. package/lib/types/ui/DecafTranslateService.d.ts +0 -5
  45. package/lib/types/ui/Rendering.d.ts +0 -202
  46. package/lib/types/ui/UIValidator.d.ts +0 -6
  47. package/lib/types/ui/constants.d.ts +0 -355
  48. package/lib/types/ui/decorators.d.ts +0 -482
  49. package/lib/types/ui/errors.d.ts +0 -32
  50. package/lib/types/ui/index.d.ts +0 -11
  51. package/lib/types/ui/interfaces.d.ts +0 -64
  52. package/lib/types/ui/overrides.d.ts +0 -1
  53. package/lib/types/ui/types.d.ts +0 -186
  54. package/lib/types/ui/utils.d.ts +0 -27
  55. package/lib/types/ui/validator.d.ts +0 -9
@@ -1,318 +0,0 @@
1
- import { IPagedComponentProperties } from "../ui/interfaces";
2
- /**
3
- * @description Decorator that tags a class as a UI model
4
- * @summary Adds rendering capabilities to a model class by providing a render method
5
- * This decorator applies metadata to the class that enables it to be rendered by the UI rendering engine.
6
- * The model will be rendered with the specified tag and properties.
7
- *
8
- * @param {string} [tag] The HTML tag to use when rendering this model (defaults to class name)
9
- * @param {Record<string, any>} [props] Additional properties to pass to the rendered element
10
- * @return {Function} A class decorator function
11
- *
12
- * @function uimodel
13
- * @category Class Decorators
14
- *
15
- * @example
16
- * // Basic usage with default tag (class name)
17
- * @uimodel()
18
- * class UserProfile extends Model {
19
- * @attribute()
20
- * name: string;
21
- *
22
- * @attribute()
23
- * email: string;
24
- * }
25
- *
26
- * // Usage with custom tag and properties
27
- * @uimodel('div', { class: 'user-card' })
28
- * class UserCard extends Model {
29
- * @attribute()
30
- * username: string;
31
- * }
32
- *
33
- * @mermaid
34
- * sequenceDiagram
35
- * participant System
36
- * participant uimodel
37
- * participant constructor
38
- * participant instance
39
- * System->>uimodel:do(constructor)
40
- * uimodel->>constructor: Executes the constructor
41
- * constructor->>uimodel: returns instance
42
- * uimodel->>instance: adds the render method
43
- * uimodel->>System: returns UIModel instance
44
- */
45
- export declare function uimodel(tag?: string, props?: Record<string, any>): (original: any, propertyKey?: any) => void;
46
- /**
47
- * @description Decorator that specifies which rendering engine to use for a model
48
- * @summary Associates a model with a specific rendering engine implementation
49
- * This decorator allows you to override the default rendering engine for a specific model class,
50
- * enabling different rendering strategies for different models.
51
- *
52
- * @param {string} engine The name of the rendering engine to use
53
- * @return {Function} A class decorator function
54
- *
55
- * @function renderedBy
56
- * @category Class Decorators
57
- *
58
- * @example
59
- * // Specify a custom rendering engine for a model
60
- * @uimodel()
61
- * @renderedBy('react')
62
- * class ReactComponent extends Model {
63
- * @attribute()
64
- * title: string;
65
- * }
66
- *
67
- * @mermaid
68
- * sequenceDiagram
69
- * participant System
70
- * participant renderedBy
71
- * participant Model
72
- * participant RenderingEngine
73
- * System->>renderedBy: apply to Model
74
- * renderedBy->>Model: adds engine metadata
75
- * Model->>RenderingEngine: uses specified engine
76
- * RenderingEngine->>System: renders with custom engine
77
- */
78
- export declare function renderedBy(engine: string): (target: object, propertyKey?: string | symbol | unknown, descriptor?: PropertyDescriptor | number) => void;
79
- /**
80
- * @description Decorator that tags a model as a list item for UI rendering
81
- * @summary Specifies how a model should be rendered when displayed in a list context
82
- * This decorator applies metadata to the class that enables it to be rendered as a list item
83
- * by the UI rendering engine. The model will be rendered with the specified tag and properties
84
- * when it appears in a list.
85
- *
86
- * @param {string} [tag] The HTML tag to use when rendering this model as a list item (defaults to class name)
87
- * @param {Record<string, any>} [props] Additional properties to pass to the rendered list item element
88
- * @return {Function} A class decorator function
89
- *
90
- * @function uilistmodel
91
- * @category Class Decorators
92
- *
93
- * @example
94
- * // Basic usage with default tag (class name)
95
- * @uimodel()
96
- * @uilistmodel()
97
- * class TodoItem extends Model {
98
- * @attribute()
99
- * title: string;
100
- *
101
- * @attribute()
102
- * completed: boolean;
103
- * }
104
- *
105
- * // Usage with custom tag and properties
106
- * @uimodel()
107
- * @uilistmodel('li', { class: 'list-group-item' })
108
- * class ListItem extends Model {
109
- * @attribute()
110
- * text: string;
111
- * }
112
- *
113
- * @mermaid
114
- * sequenceDiagram
115
- * participant System
116
- * participant uilistmodel
117
- * participant Model
118
- * participant RenderingEngine
119
- * System->>uilistmodel: apply to Model
120
- * uilistmodel->>Model: adds list item metadata
121
- * Model->>RenderingEngine: uses list item metadata when in list context
122
- * RenderingEngine->>System: renders with list item styling
123
- */
124
- export declare function uilistmodel(name?: string, props?: Record<string, any>): (original: any, propertyKey?: any) => void;
125
- /**
126
- * @description Decorator that adds event handlers to a UI model
127
- * @summary Specifies event handlers that should be attached to the rendered model
128
- * This decorator allows you to define event handlers that will be automatically
129
- * attached to the rendered UI element. The handlers are passed as properties
130
- * to the rendering engine.
131
- *
132
- * @param {Record<string, any>} [props] Object containing event handler functions and other properties
133
- * @return {Function} A class decorator function
134
- *
135
- * @function uihandlers
136
- * @category Class Decorators
137
- *
138
- * @example
139
- * // Add event handlers to a model
140
- * @uimodel('button')
141
- * @uihandlers({
142
- * onClick: (event) => console.log('Button clicked'),
143
- * onMouseOver: (event) => console.log('Mouse over button'),
144
- * disabled: false
145
- * })
146
- * class ClickableButton extends Model {
147
- * @attribute()
148
- * label: string;
149
- * }
150
- *
151
- * // Add form submission handlers
152
- * @uimodel('form')
153
- * @uihandlers({
154
- * onSubmit: (event) => {
155
- * event.preventDefault();
156
- * console.log('Form submitted');
157
- * },
158
- * onReset: (event) => console.log('Form reset')
159
- * })
160
- * class ContactForm extends Model {
161
- * @attribute()
162
- * email: string;
163
- * }
164
- *
165
- * @mermaid
166
- * sequenceDiagram
167
- * participant System
168
- * participant uihandlers
169
- * participant Model
170
- * participant RenderingEngine
171
- * participant UI
172
- * System->>uihandlers: apply to Model
173
- * uihandlers->>Model: adds handler metadata
174
- * Model->>RenderingEngine: requests rendering with handlers
175
- * RenderingEngine->>UI: renders element with event handlers attached
176
- * UI->>Model: triggers handlers on events
177
- */
178
- export declare function uihandlers(props?: Record<string, any>): (original: any) => void;
179
- /**
180
- * @description Decorator that creates a layout container with grid specifications
181
- * @summary Combines UI model functionality with layout grid configuration
182
- * This decorator creates a UI model that acts as a layout container with specified
183
- * column and row configurations. It's a convenience decorator that combines.
184
- * @uimodel with layout-specific properties for responsive grid layouts.
185
- *
186
- * @param {string} tag The HTML tag to use for the layout container
187
- * @param {number|boolean} [colsMode=1] Number of columns in the grid layout or a boolean for flex mode
188
- * @param {number|string[]} [rows=1] Number of rows or array of row definitions
189
- * @param {UIMediaBreakPoints} [breakpoint='m'] Media breakpoint for responsive behavior
190
- * @return {Function} A class decorator function
191
- *
192
- * @function uilayout
193
- * @category Class Decorators
194
- *
195
- * @example
196
- * // Create a simple 2-column layout
197
- * @uilayout('div', 2, 3)
198
- * class TwoColumnLayout extends Model {
199
- * @attribute()
200
- * @uilayoutprop(1, 1)
201
- * header: string;
202
- *
203
- * @attribute()
204
- * @uilayoutprop(1, 2)
205
- * leftContent: string;
206
- *
207
- * @attribute()
208
- * @uilayoutprop(2, 2)
209
- * rightContent: string;
210
- * }
211
- *
212
- * // Create a responsive layout with custom breakpoint
213
- * @uilayout('section', true, 2, 'l')
214
- * class ResponsiveLayout extends Model {
215
- * @attribute()
216
- * @uilayoutprop(1, 1)
217
- * title: string;
218
- *
219
- * @attribute()
220
- * @uilayoutprop(2, 1)
221
- * subtitle: string;
222
- * }
223
- *
224
- * @mermaid
225
- * sequenceDiagram
226
- * participant System
227
- * participant uilayout
228
- * participant uimodel
229
- * participant Model
230
- * participant RenderingEngine
231
- * System->>uilayout: apply to Model
232
- * uilayout->>uimodel: call with layout props
233
- * uimodel->>Model: adds model metadata with layout config
234
- * Model->>RenderingEngine: requests rendering as layout container
235
- * RenderingEngine->>System: renders grid layout with specified dimensions
236
- */
237
- export declare function uilayout(tag: string, colsMode?: number | boolean, rows?: number | string[], props?: any): (original: any, propertyKey?: any) => void;
238
- /**
239
- * @description Decorator that creates a multi-step form model with page navigation
240
- * @summary Combines UI model functionality with stepped/wizard form configuration
241
- * This decorator creates a UI model that acts as a multi-step container with page navigation
242
- * capabilities. It is designed for wizard-style forms or multi-page workflows where users
243
- * progress through sequential steps. The decorator combines @uimodel with page-specific
244
- * properties and optional pagination controls.
245
- *
246
- * @param {string} tag - The HTML tag to use for the stepped form container
247
- * @param {number | IPagedComponentProperties[]} [pages=1] - Number of pages or an array of page definitions with metadata
248
- * @param {boolean} [paginated=false] - Whether to show pagination controls (e.g., prev/next buttons)
249
- * @param {any} [props={}] - Additional properties to pass to the container element
250
- * @return {Function} A class decorator function
251
- *
252
- * @function uisteppedmodel
253
- * @category Class Decorators
254
- *
255
- * @example
256
- * // Create a simple 3-step wizard form
257
- * @uisteppedmodel('div', 3, true)
258
- * class RegistrationWizard extends Model {
259
- * // Page 1: Personal Info
260
- * @attribute()
261
- * @uipageprop(1)
262
- * firstName: string;
263
- *
264
- * @attribute()
265
- * @uipageprop(1)
266
- * lastName: string;
267
- *
268
- * // Page 2: Contact Info
269
- * @attribute()
270
- * @uipageprop(2)
271
- * email: string;
272
- *
273
- * @attribute()
274
- * @uipageprop(2)
275
- * phone: string;
276
- *
277
- * // Page 3: Confirmation
278
- * @attribute()
279
- * @uipageprop(3)
280
- * acceptTerms: boolean;
281
- * }
282
- *
283
- * // Create a wizard with custom page definitions
284
- * @uisteppedmodel('section', [
285
- * { title: 'Personal', icon: 'user' },
286
- * { title: 'Contact', icon: 'email' },
287
- * { title: 'Review', icon: 'check' }
288
- * ], true, { class: 'wizard-container' })
289
- * class OnboardingWizard extends Model {
290
- * @attribute()
291
- * @uipageprop(1)
292
- * username: string;
293
- *
294
- * @attribute()
295
- * @uipageprop(2)
296
- * email: string;
297
- *
298
- * @attribute()
299
- * @uipageprop(3)
300
- * preferences: string;
301
- * }
302
- *
303
- * @mermaid
304
- * sequenceDiagram
305
- * participant System
306
- * participant uisteppedmodel
307
- * participant uimodel
308
- * participant Model
309
- * participant RenderingEngine
310
- * participant PaginationController
311
- * System->>uisteppedmodel: apply to Model
312
- * uisteppedmodel->>uimodel: call with page config
313
- * uimodel->>Model: adds model metadata with pages and pagination
314
- * Model->>RenderingEngine: requests rendering as stepped form
315
- * RenderingEngine->>PaginationController: initialize page navigation
316
- * PaginationController->>System: renders current page with navigation controls
317
- */
318
- export declare function uisteppedmodel(tag: string, pages?: number | IPagedComponentProperties[], paginated?: boolean, props?: any): (original: any, propertyKey?: any) => void;
@@ -1,4 +0,0 @@
1
- import "./model";
2
- export * from "./decorators";
3
- export * from "./overrides";
4
- export * from "./Renderable";
@@ -1,31 +0,0 @@
1
- import { Renderable } from "./Renderable";
2
- import { Constructor } from "@decaf-ts/decoration";
3
- import { CrudOperationKeys, UIElementMetadata, UIHandlerMetadata, UILayoutMetadata, UIListModelMetadata, UIModelMetadata } from "../ui/index";
4
- declare module "@decaf-ts/decorator-validation" {
5
- interface Model extends Renderable {
6
- /**
7
- * @description Checks if a property of a model is itself a model or has a model type
8
- * @summary Determines whether a specific property of a model instance is either a model instance
9
- * or has a type that is registered as a model. This function is used for model serialization
10
- * and deserialization to properly handle nested models.
11
- * @template R the expected UI code according to each rendering engine
12
- * @param {any[]} args - optional engine specific args
13
- */
14
- render<R>(...args: any[]): R;
15
- }
16
- namespace Model {
17
- function renderedBy<M extends Model>(model: Constructor<M>): string | undefined;
18
- function uiPropertiesOf<M extends Model>(model: Constructor<M>): string[] | undefined;
19
- function uiDecorationOf<M extends Model>(model: Constructor<M>, prop: keyof M, key?: string): any;
20
- function uiModelOf<M extends Model>(model: Constructor<M>): UIModelMetadata | undefined;
21
- function uiElementOf<M extends Model>(model: Constructor<M>, prop: keyof M): UIElementMetadata | undefined;
22
- function uiListModelOf<M extends Model>(model: Constructor<M>): UIListModelMetadata | undefined;
23
- function uiHandlersFor<M extends Model>(model: Constructor<M>): UIHandlerMetadata | undefined;
24
- function uiLayoutOf<M extends Model>(model: Constructor<M>): UILayoutMetadata | undefined;
25
- function uiTypeOf<M extends Model>(model: Constructor<M>, prop: keyof M): UILayoutMetadata | undefined;
26
- function uiIsHidden<M extends Model>(model: Constructor<M>, prop: keyof M): boolean;
27
- function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M): CrudOperationKeys[] | false;
28
- function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M, op: CrudOperationKeys): boolean;
29
- function uiHiddenOn<M extends Model>(model: Constructor<M>, prop: keyof M, op?: CrudOperationKeys): CrudOperationKeys[] | boolean;
30
- }
31
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * @description Module that extends the Model prototype with rendering capabilities
3
- * @summary Adds the render method to all Model instances from decorator-validation
4
- * This module implements the Renderable interface for the Model class by adding a render method
5
- * to its prototype. This allows any Model instance to be rendered using the RenderingEngine.
6
- * @module model/overrides
7
- * @memberOf module:ui-decorators/model
8
- */
9
- import "./model";
@@ -1,16 +0,0 @@
1
- import "@decaf-ts/decorator-validation";
2
- declare module "@decaf-ts/decorator-validation" {
3
- interface ModelBuilder<M> {
4
- decorateClass(decorator: ClassDecorator): ModelBuilder<M>;
5
- }
6
- }
7
- declare module "@decaf-ts/decorator-validation" {
8
- interface ModelBuilder<M> {
9
- uimodel(tag?: string, props?: Record<string, any>): ModelBuilder<M>;
10
- renderedBy(engine: string): ModelBuilder<M>;
11
- uilistmodel(name?: string, props?: Record<string, any>): ModelBuilder<M>;
12
- uihandlers(props?: Record<string, any>): ModelBuilder<M>;
13
- uilayout(tag: string, colsMode?: number | boolean, rows?: number | string[], props?: any): ModelBuilder<M>;
14
- uisteppedmodel(tag: string, pages?: number | any[], paginated?: boolean, props?: any): ModelBuilder<M>;
15
- }
16
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * @description UI overrides exports
3
- * @module ui-decorators/overrides
4
- */
5
- import "../model/overrides";
6
- export * from "./ModelBuilderExtensions";
@@ -1,293 +0,0 @@
1
- import { LoggedClass } from "@decaf-ts/logging";
2
- import { CrudOperationKeys, UIEventProperty } from "./types";
3
- import { Model } from "@decaf-ts/decorator-validation";
4
- import { IRepository, OperationKeys } from "@decaf-ts/db-decorators";
5
- import { DecafEventHandler } from "./DecafEventHandler";
6
- import { DecafTranslateService } from "./DecafTranslateService";
7
- type PrimaryKeyType = string | number | bigint;
8
- /**
9
- * @description Base class for all Decaf UI components
10
- * @summary Base class for all Decaf UI components, providing common state management,
11
- * logging, localization, navigation hooks, CRUD context metadata, and
12
- * repository integration used by higher-level decorators and renderers.
13
- */
14
- export declare abstract class DecafComponent<M extends Model> extends LoggedClass {
15
- /**
16
- * @description Data model or model name for component operations.
17
- * @summary The data model that this component will use for CRUD operations. This can be provided
18
- * as a Model instance, a model constructor, or a string representing the model's registered name.
19
- * When set, this property provides the component with access to the model's schema, validation rules,
20
- * and metadata needed for rendering and data operations.
21
- */
22
- model: M | Model | string | undefined;
23
- /**
24
- * @description Primary key value of the current model instance.
25
- * @summary Specifies the primary key value for the current model record being displayed or
26
- * manipulated by the component. This identifier is used for CRUD operations that target
27
- * specific records, such as read, update, and delete operations. The value corresponds to
28
- * the field designated as the primary key in the model definition.
29
- */
30
- modelId?: PrimaryKeyType | PrimaryKeyType[];
31
- /**
32
- * @description Pre-built filtering expression applied to repository queries.
33
- * @summary Supply a custom `AttributeOption` to control how records are constrained. When omitted,
34
- * the directive derives a condition from `filterBy` or `pk`, comparing it against `modelId`.
35
- */
36
- filter: any;
37
- /**
38
- * @description Model field used when generating the default condition.
39
- * @summary Indicates which key should be compared to `modelId` when `filter` is not provided.
40
- * Defaults to the configured primary key so overrides are only needed for custom lookups.
41
- */
42
- filterBy: string;
43
- /**
44
- * @description The CRUD operation type to be performed on the model.
45
- * @summary Specifies which operation (Create, Read, Update, Delete) this component instance
46
- * should perform. This determines the UI behavior, form configuration, and available actions.
47
- * The operation affects form validation, field availability, and the specific repository
48
- * method called during data submission.
49
- *
50
- * @type {OperationKeys}
51
- */
52
- operation?: OperationKeys;
53
- /**
54
- * @description Router instance for programmatic navigation.
55
- * @summary Injected Router service used for programmatic navigation between routes
56
- * in the application. This service enables navigation to different views and operations,
57
- * handles route parameters, and manages the browser's navigation history.
58
- * @protected
59
- */
60
- router?: any;
61
- /**
62
- * @description Name identifier for the component instance.
63
- * @summary Provides a string identifier that can be used to name or label the component
64
- * instance. This name can be used for debugging purposes, logging, or to identify specific
65
- * component instances within a larger application structure. It serves as a human-readable
66
- * identifier that helps distinguish between multiple instances of the same component type.
67
- */
68
- name: string;
69
- /**
70
- * @description Parent component identifier for hierarchical component relationships.
71
- * @summary Specifies the identifier of the parent component in a hierarchical component structure.
72
- * This property establishes a parent-child relationship between components, allowing for
73
- * proper nesting and organization of components within a layout. It can be used to track
74
- * component dependencies and establish component hierarchies for rendering and event propagation.
75
- */
76
- childOf: string | undefined;
77
- /**
78
- * @description Unique identifier for the component instance.
79
- * @summary A unique identifier automatically generated for each component instance.
80
- * This UID is used for DOM element identification, component tracking, and debugging purposes.
81
- * By default, it generates a random 16-character value, but it can be explicitly set via input.
82
- */
83
- uid?: PrimaryKeyType;
84
- /**
85
- * @description Primary key field name for the data model.
86
- * @summary Specifies which field in the model should be used as the primary key.
87
- * This is typically used for identifying unique records in operations like update and delete.
88
- * If not explicitly set, it defaults to the repository's configured primary key or 'id'.
89
- 1 */
90
- pk: string;
91
- /**
92
- * @description Translation service for application internationalization.
93
- * @summary Injected service that provides translation capabilities for UI text.
94
- * Used to translate button labels, validation messages, and other text content based
95
- * on the current locale setting, enabling multilingual support throughout the application.
96
- * @protected
97
- */
98
- translateService: DecafTranslateService;
99
- /**
100
- * @description Angular change detection service for manual change detection control.
101
- * @summary Injected service that provides manual control over change detection cycles.
102
- * This is essential for ensuring that programmatic DOM changes (like setting accordion
103
- * attributes) are properly reflected in the component's state and trigger appropriate
104
- * view updates when modifications occur outside the normal Angular change detection flow.
105
- * @protected
106
- */
107
- protected changeDetectorRef?: any;
108
- /**
109
- * @description Controls field visibility based on CRUD operations.
110
- * @summary Can be a boolean or an array of operation keys where the field should be hidden.
111
- */
112
- hidden?: boolean | CrudOperationKeys[];
113
- /**
114
- * @description Label for the file upload field.
115
- * @summary Provides a user-friendly label for the file upload input.
116
- */
117
- label?: string;
118
- /**
119
- * @description Whether the field is read-only.
120
- */
121
- readonly?: boolean;
122
- /**
123
- * @description Flag to enable or disable dark mode support for the component.
124
- * @summary When enabled, the component will automatically detect the system's dark mode
125
- * preference using the media service and apply appropriate styling classes. This flag
126
- * controls whether the component should respond to dark mode changes and apply the
127
- * dark palette class to its DOM element. By default, dark mode support is disabled.
128
- * @protected
129
- */
130
- protected enableDarkMode: boolean;
131
- /**
132
- * @description Flag to enable or disable dark mode support for the component.
133
- * @summary When enabled, the component will automatically detect the system's dark mode
134
- * preference using the media service and apply appropriate styling classes. This flag
135
- * controls whether the component should respond to dark mode changes and apply the
136
- * dark palette class to its DOM element. By default, dark mode support is disabled.
137
- * @protected
138
- */
139
- protected isDarkMode: boolean;
140
- /**
141
- * @description Current locale identifier for component internationalization.
142
- * @summary Specifies the locale code (e.g., 'en-US', 'pt-BR') used for translating UI text
143
- * and formatting data according to regional conventions. This property can be set to override
144
- * the default application locale for this specific component instance, enabling per-component
145
- * localization when needed.
146
- */
147
- locale?: string;
148
- /**
149
- * @description Configuration for list item rendering behavior.
150
- * @summary Defines how list items should be rendered in the component.
151
- * This property holds a configuration object that specifies the tag name
152
- * and other properties needed to render list items correctly. The tag property
153
- * identifies which component should be used to render each item in a list.
154
- * Additional properties can be included to customize the rendering behavior.
155
- */
156
- item: Record<string, unknown>;
157
- /**
158
- * @description Dynamic properties configuration for runtime customization.
159
- * @summary Contains key-value pairs of dynamic properties that can be applied to the component
160
- * at runtime. This flexible configuration object allows for dynamic property assignment without
161
- * requiring explicit input bindings for every possible configuration option. Properties from
162
- * this object are parsed and applied to the component instance through the parseProps method,
163
- * enabling customizable component behavior based on external configuration.
164
- */
165
- props: Record<string, unknown>;
166
- /**
167
- * @description Base route path for component navigation.
168
- * @summary Defines the base route path used for navigation actions related to this component.
169
- * This is often used as a prefix for constructing navigation URLs when transitioning between
170
- * different operations or views. The route helps establish the component's position in the
171
- * application's routing hierarchy.
172
- */
173
- route?: string;
174
- /**
175
- * @description Controls whether borders are displayed around the component.
176
- * @summary Boolean flag that determines if the component should be visually outlined with borders.
177
- * When true, borders are shown to visually separate the component from surrounding content.
178
- */
179
- borders: boolean;
180
- /**
181
- * @description Component name identifier for logging and localization contexts.
182
- * @summary Stores the component's name which is used as a key for logging contexts
183
- * and as a base for locale resolution.
184
- * @protected
185
- */
186
- protected componentName?: string;
187
- /**
188
- * @description Root key for component locale context resolution.
189
- * @summary Defines the base key used to resolve localization contexts for this component.
190
- * If not explicitly provided, it defaults to the component's name. This key is used to
191
- * load appropriate translation resources and locale-specific configurations.
192
- * @protected
193
- */
194
- protected localeRoot?: string;
195
- /**
196
- * @description Current value of the component.
197
- * @summary Can be a string, number, date, or array of string or objects.
198
- */
199
- value?: any;
200
- /**
201
- * @description Reference to CRUD operation constants for template usage.
202
- * @summary Exposes the OperationKeys enum to the component template, enabling
203
- * conditional rendering and behavior based on operation types. This protected
204
- * readonly property ensures that template logic can access operation constants
205
- * while maintaining encapsulation and preventing accidental modification.
206
- * @protected
207
- * @readonly
208
- */
209
- protected readonly OperationKeys: typeof OperationKeys;
210
- /**
211
- * @description Angular Location service.
212
- * @summary Injected service that provides direct access to the browser's URL and history.
213
- * Unlike the Router, Location allows for low-level manipulation of the browser's history stack
214
- * and URL path, such as programmatically navigating back or forward, or updating the URL without
215
- * triggering a route change. This is useful for scenarios where you need to interact with the
216
- * browser history or URL outside of Angular's routing system, such as closing modals, handling
217
- * popstate events, or supporting custom navigation logic.
218
- *
219
- */
220
- location: any;
221
- /**
222
- * @description Repository instance for data layer operations.
223
- * @summary Provides a connection to the data layer for retrieving and manipulating data.
224
- * This is an instance of the DecafRepository class, initialized lazily in the repository getter.
225
- * The repository is used to perform CRUD (Create, Read, Update, Delete) operations on the
226
- * data model and provides methods for querying and filtering data based on specific criteria.
227
- *
228
- * @protected
229
- */
230
- protected _repository?: IRepository<M>;
231
- /**
232
- * @description Initialization status flag for the component.
233
- * @summary Tracks whether the component has completed its initialization process.
234
- * This flag is used to prevent duplicate initialization and to determine if
235
- * certain operations that require initialization can be performed.
236
- * @default false
237
- */
238
- protected initialized: boolean;
239
- protected events: UIEventProperty;
240
- protected handlers: UIEventProperty;
241
- protected constructor();
242
- get repository(): IRepository<M>;
243
- set repository(repository: IRepository<M>);
244
- render(...args: unknown[]): Promise<any>;
245
- refresh(...args: unknown[]): Promise<any>;
246
- /**
247
- * Asynchronously initializes the component with the provided arguments.
248
- * This method sets the `initialized` property to `true` once the initialization is complete.
249
- *
250
- * @param args - A variable number of arguments of unknown types that can be used for initialization.
251
- * @returns A promise that resolves when the initialization is complete.
252
- */
253
- initialize(...args: unknown[]): Promise<any>;
254
- /**
255
- * Translates content based on the provided arguments.
256
- * Logs the translation request with the component name and arguments.
257
- *
258
- * @param args - A variable number of arguments used for translation.
259
- * @returns A promise that resolves with the translation result.
260
- */
261
- translate(...args: unknown[]): Promise<any>;
262
- preview(...args: unknown[]): Promise<void>;
263
- /**
264
- * Submits data or performs an action associated with the component.
265
- *
266
- * @param args - A variable number of arguments of any type to be passed to the submit operation.
267
- * @returns A promise that resolves with the result of the submit operation.
268
- */
269
- submit(...args: unknown[]): Promise<any>;
270
- /**
271
- * @description Normalizes handler definitions into executable functions.
272
- * @summary Iterates through a handlers map and ensures each entry is stored as a callable
273
- * function on the component. Plain functions are stored directly, while handler classes are
274
- * instantiated so their `handle` method (or a keyed override) becomes the registered handler.
275
- * This allows decorators to accept either inline functions or handler classes transparently.
276
- * @template T Extends `DecafEventHandler` to constrain handler class types.
277
- * @param handlers - Dictionary of handler names mapped to functions or handler constructors.
278
- * @param instance - Optional target handler instance; defaults to the current component.
279
- */
280
- protected parseHandlers<T extends DecafEventHandler>(handlers: UIEventProperty, instance: T): UIEventProperty;
281
- /**
282
- * @description Registers event callbacks on the component instance.
283
- * @summary Processes an events map produced by decorators where each value can be a factory
284
- * returning a function or a component constructor. When a constructor is returned, the method
285
- * matching the event key is instantiated and stored; otherwise the produced function is
286
- * assigned directly. This enables flexible event binding definitions for derived components.
287
- * @template T Extends `DecafComponent<Model>` to scope acceptable event owners.
288
- * @param events - Dictionary of event names mapped to function factories or component constructors.
289
- * @param instance - Optional component instance to receive the events; defaults to `this`.
290
- */
291
- protected parseEvents<T extends DecafComponent<Model>>(events: UIEventProperty, instance: T): UIEventProperty;
292
- }
293
- export {};