@decaf-ts/for-angular 0.0.25 → 0.0.26

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 (78) hide show
  1. package/fesm2022/decaf-ts-for-angular.mjs +1465 -1488
  2. package/fesm2022/decaf-ts-for-angular.mjs.map +1 -1
  3. package/index.d.ts +7470 -3
  4. package/package.json +14 -17
  5. package/components/component-renderer/component-renderer.component.d.ts +0 -278
  6. package/components/crud-field/crud-field.component.d.ts +0 -611
  7. package/components/crud-form/constants.d.ts +0 -5
  8. package/components/crud-form/crud-form.component.d.ts +0 -288
  9. package/components/crud-form/types.d.ts +0 -17
  10. package/components/empty-state/empty-state.component.d.ts +0 -300
  11. package/components/fieldset/fieldset.component.d.ts +0 -555
  12. package/components/filter/filter.component.d.ts +0 -514
  13. package/components/for-angular-components.module.d.ts +0 -20
  14. package/components/index.d.ts +0 -16
  15. package/components/layout/layout.component.d.ts +0 -110
  16. package/components/list/list.component.d.ts +0 -848
  17. package/components/list-item/list-item.component.d.ts +0 -390
  18. package/components/model-renderer/model-renderer.component.d.ts +0 -97
  19. package/components/pagination/constants.d.ts +0 -7
  20. package/components/pagination/pagination.component.d.ts +0 -264
  21. package/components/searchbar/searchbar.component.d.ts +0 -407
  22. package/components/stepped-form/stepped-form.component.d.ts +0 -255
  23. package/directives/collapsable.directive.d.ts +0 -9
  24. package/directives/index.d.ts +0 -1
  25. package/engine/DynamicModule.d.ts +0 -17
  26. package/engine/NgxBaseComponent.d.ts +0 -541
  27. package/engine/NgxCrudFormField.d.ts +0 -123
  28. package/engine/NgxFormService.d.ts +0 -601
  29. package/engine/NgxRenderingEngine.d.ts +0 -282
  30. package/engine/ValidatorFactory.d.ts +0 -15
  31. package/engine/constants.d.ts +0 -168
  32. package/engine/decorators.d.ts +0 -25
  33. package/engine/index.d.ts +0 -18
  34. package/engine/interfaces.d.ts +0 -271
  35. package/engine/types.d.ts +0 -200
  36. package/esm2022/components/component-renderer/component-renderer.component.mjs +0 -321
  37. package/esm2022/components/crud-field/crud-field.component.mjs +0 -518
  38. package/esm2022/components/crud-form/constants.mjs +0 -14
  39. package/esm2022/components/crud-form/crud-form.component.mjs +0 -259
  40. package/esm2022/components/crud-form/types.mjs +0 -2
  41. package/esm2022/components/empty-state/empty-state.component.mjs +0 -345
  42. package/esm2022/components/fieldset/fieldset.component.mjs +0 -677
  43. package/esm2022/components/filter/filter.component.mjs +0 -700
  44. package/esm2022/components/for-angular-components.module.mjs +0 -84
  45. package/esm2022/components/index.mjs +0 -20
  46. package/esm2022/components/layout/layout.component.mjs +0 -150
  47. package/esm2022/components/list/list.component.mjs +0 -1238
  48. package/esm2022/components/list-item/list-item.component.mjs +0 -405
  49. package/esm2022/components/model-renderer/model-renderer.component.mjs +0 -144
  50. package/esm2022/components/pagination/constants.mjs +0 -2
  51. package/esm2022/components/pagination/pagination.component.mjs +0 -321
  52. package/esm2022/components/searchbar/searchbar.component.mjs +0 -491
  53. package/esm2022/components/stepped-form/stepped-form.component.mjs +0 -306
  54. package/esm2022/decaf-ts-for-angular.mjs +0 -5
  55. package/esm2022/directives/collapsable.directive.mjs +0 -29
  56. package/esm2022/directives/index.mjs +0 -2
  57. package/esm2022/engine/DynamicModule.mjs +0 -18
  58. package/esm2022/engine/NgxBaseComponent.mjs +0 -541
  59. package/esm2022/engine/NgxCrudFormField.mjs +0 -137
  60. package/esm2022/engine/NgxFormService.mjs +0 -917
  61. package/esm2022/engine/NgxRenderingEngine.mjs +0 -376
  62. package/esm2022/engine/ValidatorFactory.mjs +0 -106
  63. package/esm2022/engine/constants.mjs +0 -170
  64. package/esm2022/engine/decorators.mjs +0 -38
  65. package/esm2022/engine/index.mjs +0 -19
  66. package/esm2022/engine/interfaces.mjs +0 -4
  67. package/esm2022/engine/types.mjs +0 -2
  68. package/esm2022/for-angular-common.module.mjs +0 -84
  69. package/esm2022/helpers/index.mjs +0 -13
  70. package/esm2022/helpers/utils.mjs +0 -436
  71. package/esm2022/i18n/Loader.mjs +0 -86
  72. package/esm2022/i18n/data/en.json +0 -85
  73. package/esm2022/public-apis.mjs +0 -15
  74. package/for-angular-common.module.d.ts +0 -50
  75. package/helpers/index.d.ts +0 -12
  76. package/helpers/utils.d.ts +0 -279
  77. package/i18n/Loader.d.ts +0 -43
  78. package/public-apis.d.ts +0 -14
@@ -1,85 +0,0 @@
1
- {
2
- "errors": {
3
- "required": "This field is required.",
4
- "pattern": "The provided value does not match the pattern.",
5
- "min": "The minimum value for this field is {0}.",
6
- "max": "The maximum value for this field is {0}.",
7
- "minlength": "The minimum length for this field is {0}.",
8
- "maxlength": "The maximum length for this field is {0}.",
9
- "equal": "This field must be equal to {0}",
10
- "default": "This value appears to be invalid.",
11
- "unique": "Field {0} must be unique",
12
- "password": "Password must be at least 8 characters and contain one of number, lower and upper case letters, and special character (@$!%*?&_-.,)",
13
- "email": "This field must be a valid email address.",
14
- "url": "This field must be a valid URL.",
15
- "number": "This field must be a valid number.",
16
- "integer": "This field must be a valid integer.",
17
- "digits": "This field must contain only digits.",
18
- "alphanum": "This field must be alphanumeric.",
19
- "file": "Only {0} files are allowed",
20
- "equals": "This field must be equal to field {0}",
21
- "different": "This field must be different from field {0}",
22
- "lessThan": "This field must be less than field {0}",
23
- "lessThanOrEqual": "This field must be less than or equal to field {0}",
24
- "greaterThan": "This field must be greater than field {0}",
25
- "greaterThanOrEqual": "This field must be greater than or equal to field {0}"
26
- },
27
- "component": {
28
- "fieldset": {
29
- "add": "Add another",
30
- "update": "Update item",
31
- "cancel": "Cancel",
32
- "not_unique": "The value entered already exists. Value \"{{value}}\""
33
- },
34
- "list": {
35
- "pagination": "Showing page <span class=\"text-bold\">{{value0}} of {{value1}}</span>",
36
- "loading": "Loading data",
37
- "search": {
38
- "title": "Not data found for search",
39
- "subtitle": "You searched for: <ion-text color=\"primary\" class=\"display-block ion-text-center text-bold\">{{value0}}</ion-text>",
40
- "button": "Clear search"
41
- },
42
- "empty": {
43
- "title": "No data found",
44
- "subtitle": "",
45
- "button": "Create"
46
- }
47
- },
48
- "list_item": {
49
- "actions": "Actions",
50
- "operations": {
51
- "read": "Read",
52
- "create": "Create",
53
- "update": "Update",
54
- "delete": "Delete"
55
- }
56
- },
57
- "empty_state": {
58
- "title": "No data found",
59
- "button": "Create",
60
- "search": {
61
- "title": "Not data found for search",
62
- "subtitle": "You searched for: <ion-text color=\"primary\" class=\"display-block ion-text-center text-bold\">{{value0}}</ion-text>",
63
- "button": "Clear search"
64
- }
65
- },
66
- "pagination": {
67
- "resume": "Showing page <span class=\"text-bold\">{{value0}} of {{value1}}</span>"
68
- },
69
- "filter": {
70
- "title": "Filter",
71
- "type": "Type value",
72
- "select": "Filter selection",
73
- "step1": "Select an index",
74
- "step2": "Select a condition",
75
- "step3": "Type a value",
76
- "no_suggestions": "No suggestions",
77
- "sort": "Sort by"
78
- },
79
- "stepped_form": {
80
- "next": "Next",
81
- "previous": "Previous",
82
- "submit": "Submit"
83
- }
84
- }
85
- }
@@ -1,15 +0,0 @@
1
- import '@decaf-ts/ui-decorators';
2
- export * from './components';
3
- export * from './engine';
4
- export * from './directives';
5
- export * from './helpers';
6
- export * from './i18n/Loader';
7
- export * from './for-angular-common.module';
8
- /**
9
- * @description Angular integration for the Decaf framework
10
- * @summary This module provides Angular components and services for integrating with the Decaf framework.
11
- * It includes components for rendering models, CRUD operations, and form handling, as well as
12
- * rendering engines and utility functions to facilitate Angular application development with Decaf.
13
- * @module for-angular
14
- */
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL3B1YmxpYy1hcGlzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8seUJBQXlCLENBQUM7QUFDakMsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxVQUFVLENBQUM7QUFDekIsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyxXQUFXLENBQUM7QUFDMUIsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyw2QkFBNkIsQ0FBQztBQUM1Qzs7Ozs7O0dBTUciLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgJ0BkZWNhZi10cy91aS1kZWNvcmF0b3JzJztcbmV4cG9ydCAqIGZyb20gJy4vY29tcG9uZW50cyc7XG5leHBvcnQgKiBmcm9tICcuL2VuZ2luZSc7XG5leHBvcnQgKiBmcm9tICcuL2RpcmVjdGl2ZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9oZWxwZXJzJztcbmV4cG9ydCAqIGZyb20gJy4vaTE4bi9Mb2FkZXInO1xuZXhwb3J0ICogZnJvbSAnLi9mb3ItYW5ndWxhci1jb21tb24ubW9kdWxlJztcbi8qKlxuICogQGRlc2NyaXB0aW9uIEFuZ3VsYXIgaW50ZWdyYXRpb24gZm9yIHRoZSBEZWNhZiBmcmFtZXdvcmtcbiAqIEBzdW1tYXJ5IFRoaXMgbW9kdWxlIHByb3ZpZGVzIEFuZ3VsYXIgY29tcG9uZW50cyBhbmQgc2VydmljZXMgZm9yIGludGVncmF0aW5nIHdpdGggdGhlIERlY2FmIGZyYW1ld29yay5cbiAqIEl0IGluY2x1ZGVzIGNvbXBvbmVudHMgZm9yIHJlbmRlcmluZyBtb2RlbHMsIENSVUQgb3BlcmF0aW9ucywgYW5kIGZvcm0gaGFuZGxpbmcsIGFzIHdlbGwgYXNcbiAqIHJlbmRlcmluZyBlbmdpbmVzIGFuZCB1dGlsaXR5IGZ1bmN0aW9ucyB0byBmYWNpbGl0YXRlIEFuZ3VsYXIgYXBwbGljYXRpb24gZGV2ZWxvcG1lbnQgd2l0aCBEZWNhZi5cbiAqIEBtb2R1bGUgZm9yLWFuZ3VsYXJcbiAqL1xuIl19
@@ -1,50 +0,0 @@
1
- import { ModuleWithProviders, InjectionToken } from '@angular/core';
2
- import { Logger } from '@decaf-ts/logging';
3
- import { FunctionLike, I18nResourceConfig } from './engine';
4
- import { DecafRepositoryAdapter } from './engine/types';
5
- import * as i0 from "@angular/core";
6
- import * as i1 from "@angular/common";
7
- import * as i2 from "@angular/forms";
8
- import * as i3 from "@ngx-translate/core";
9
- export declare const DB_ADAPTER_PROVIDER_TOKEN: InjectionToken<DecafRepositoryAdapter>;
10
- export declare const I18N_CONFIG_TOKEN: InjectionToken<{
11
- resources: I18nResourceConfig[];
12
- versionedSuffix: boolean;
13
- }>;
14
- export declare function getLogger(instance: string | FunctionLike | unknown): Logger;
15
- /**
16
- * @description Main Angular module for the Decaf framework
17
- * @summary The ForAngularCommonModule provides the core functionality for integrating Decaf with Angular applications.
18
- * It imports and exports common Angular and Ionic components and modules needed for Decaf applications,
19
- * including form handling, translation support, and Ionic UI components. This module can be imported
20
- * directly or via the forRoot() method for proper initialization in the application's root module.
21
- *
22
- * @class ForAngularCommonModule
23
- * @example
24
- * ```typescript
25
- * // In your app module:
26
- * @NgModule({
27
- * imports: [
28
- * ForAngularCommonModule.forRoot(),
29
- * // other imports
30
- * ],
31
- * // ...
32
- * })
33
- * export class AppModule {}
34
- * ```
35
- */
36
- export declare class ForAngularCommonModule {
37
- /**
38
- * @description Creates a module with providers for root module import
39
- * @summary This static method provides the proper way to import the ForAngularCommonModule in the application's
40
- * root module. It returns a ModuleWithProviders object that includes the ForAngularCommonModule itself.
41
- * Using forRoot() ensures that the module and its providers are properly initialized and only
42
- * instantiated once in the application.
43
- *
44
- * @return {ModuleWithProviders<ForAngularCommonModule>} The module with its providers
45
- */
46
- static forRoot(): ModuleWithProviders<ForAngularCommonModule>;
47
- static ɵfac: i0.ɵɵFactoryDeclaration<ForAngularCommonModule, never>;
48
- static ɵmod: i0.ɵɵNgModuleDeclaration<ForAngularCommonModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.TranslateModule, typeof i3.TranslatePipe], [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.TranslateModule, typeof i3.TranslatePipe]>;
49
- static ɵinj: i0.ɵɵInjectorDeclaration<ForAngularCommonModule>;
50
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * @module helpers
3
- * @description Utility helpers for Angular Decaf applications
4
- * @summary The helpers module provides a collection of utility functions and types
5
- * that assist with common tasks in Decaf Angular applications. It includes functions
6
- * for array manipulation, date formatting, logging, string operations, and various
7
- * utility functions for working with Angular components and services. These helpers
8
- * simplify common operations and promote code reuse across the application.
9
- * Key exports include logging utilities, string manipulation functions, and component
10
- * utility functions.
11
- */
12
- export * from './utils';
@@ -1,279 +0,0 @@
1
- import { InjectablesRegistry } from '@decaf-ts/injectable-decorators';
2
- import { KeyValue, StringOrBoolean } from '../engine/types';
3
- import { FunctionLike } from '../engine/types';
4
- /**
5
- * @description Retrieves the singleton instance of the injectables registry
6
- * @summary This function implements the singleton pattern for the InjectablesRegistry.
7
- * It returns the existing registry instance if one exists, or creates a new instance
8
- * if none exists. The registry is used to store and retrieve injectable dependencies
9
- * throughout the application.
10
- *
11
- * @return {InjectablesRegistry} The singleton injectables registry instance
12
- *
13
- * @function getInjectablesRegistry
14
- * @memberOf module:for-angular
15
- */
16
- export declare function getInjectablesRegistry(): InjectablesRegistry;
17
- /**
18
- * @description Determines if the application is running in development mode
19
- * @summary This function checks whether the application is currently running in a development
20
- * environment. It uses Angular's isDevMode() function and also checks the window context
21
- * and hostname against the provided context parameter. This is useful for enabling
22
- * development-specific features or logging.
23
- *
24
- * @param {string} [context='localhost'] - The context string to check against the current environment
25
- * @return {boolean} True if the application is running in development mode, false otherwise
26
- *
27
- * @function isDevelopmentMode
28
- * @memberOf module:for-angular
29
- */
30
- export declare function isDevelopmentMode(context?: string): boolean;
31
- /**
32
- * @description Dispatches a custom event to the document window
33
- * @summary This function creates and dispatches a custom event to the browser window.
34
- * It's useful for cross-component communication or for triggering application-wide events.
35
- * The function allows specifying the event name, detail data, and additional event properties.
36
- *
37
- * @param {string} name - The name of the custom event to dispatch
38
- * @param {unknown} detail - The data to include in the event's detail property
39
- * @param {object} [props] - Optional additional properties for the custom event
40
- * @return {void}
41
- *
42
- * @function windowEventEmitter
43
- * @memberOf module:for-angular
44
- */
45
- export declare function windowEventEmitter(name: string, detail: unknown, props?: object): void;
46
- /**
47
- * @description Retrieves a property from the window's document object
48
- * @summary This function provides a safe way to access properties on the window's document object.
49
- * It uses the getWindowDocument function to get a reference to the document, then accesses
50
- * the specified property. This is useful for browser environment interactions that need
51
- * to access document properties.
52
- *
53
- * @param {string} key - The name of the property to retrieve from the document object
54
- * @return {any} The value of the specified property, or undefined if the document or property doesn't exist
55
- *
56
- * @function getOnWindowDocument
57
- * @memberOf module:for-angular
58
- */
59
- export declare function getOnWindowDocument(key: string): Document | undefined;
60
- /**
61
- * @description Retrieves the document object from the window
62
- * @summary This function provides a safe way to access the document object from the window.
63
- * It uses the getOnWindow function to retrieve the 'document' property from the window object.
64
- * This is useful for browser environment interactions that need access to the document.
65
- *
66
- * @return {Document | undefined} The window's document object, or undefined if it doesn't exist
67
- *
68
- * @function getWindowDocument
69
- * @memberOf module:for-angular
70
- */
71
- export declare function getWindowDocument(): Document | undefined;
72
- /**
73
- * @description Retrieves a property from the window object
74
- * @summary This function provides a safe way to access properties on the window object.
75
- * It uses the getWindow function to get a reference to the window, then accesses
76
- * the specified property. This is useful for browser environment interactions that need
77
- * to access window properties or APIs.
78
- *
79
- * @param {string} key - The name of the property to retrieve from the window object
80
- * @return {unknown | undefined} The value of the specified property, or undefined if the window or property doesn't exist
81
- *
82
- * @function getOnWindow
83
- * @memberOf module:for-angular
84
- */
85
- export declare function getOnWindow(key: string): unknown | undefined;
86
- /**
87
- * @description Sets a property on the window object
88
- * @summary This function provides a way to set properties on the window object.
89
- * It uses the getWindow function to get a reference to the window, then sets
90
- * the specified property to the provided value. This is useful for storing
91
- * global data or functions that need to be accessible across the application.
92
- *
93
- * @param {string} key - The name of the property to set on the window object
94
- * @param {any} value - The value to assign to the property
95
- * @return {void}
96
- *
97
- * @function setOnWindow
98
- * @memberOf module:for-angular
99
- */
100
- export declare function setOnWindow(key: string, value: unknown): void;
101
- /**
102
- * @description Retrieves the global window object
103
- * @summary This function provides a safe way to access the global window object.
104
- * It uses globalThis to ensure compatibility across different JavaScript environments.
105
- * This is the core function used by other window-related utility functions to
106
- * access the window object.
107
- *
108
- * @return {Window} The global window object
109
- *
110
- * @function getWindow
111
- * @memberOf module:for-angular
112
- */
113
- export declare function getWindow(): Window & KeyValue;
114
- /**
115
- * @description Retrieves the width of the browser window
116
- * @summary This function provides a convenient way to get the current width of the browser window.
117
- * It uses the getOnWindow function to access the 'innerWidth' property of the window object.
118
- * This is useful for responsive design implementations and viewport-based calculations.
119
- *
120
- * @return {number | undefined} The current width of the browser window in pixels
121
- *
122
- * @function getWindowWidth
123
- * @memberOf module:for-angular
124
- */
125
- export declare function getWindowWidth(): number;
126
- /**
127
- * @description Checks if a value is not undefined
128
- * @summary This utility function determines whether a given value is not undefined.
129
- * It's a simple wrapper that makes code more readable when checking for defined values.
130
- * The function is particularly useful for checking StringOrBoolean properties that might be undefined.
131
- *
132
- * @param {StringOrBoolean | undefined} prop - The property to check
133
- * @return {boolean} True if the property is not undefined, false otherwise
134
- *
135
- * @function isNotUndefined
136
- * @memberOf module:for-angular
137
- */
138
- export declare function isNotUndefined(prop: StringOrBoolean | undefined): boolean;
139
- /**
140
- * @description Generates a locale string from a class name or instance
141
- * @summary This utility function converts a class name or instance into a locale string
142
- * that can be used for internationalization purposes. It handles different input types
143
- * (string, function, or object) and applies formatting rules to generate a consistent
144
- * locale identifier. For short names (less than 3 parts), it reverses the dot-separated
145
- * string. For longer names, it uses the last part as a prefix and joins the rest with
146
- * underscores.
147
- *
148
- * @param {string|FunctionLike|object} instance - The input to generate the locale from (class name, constructor, or instance)
149
- * @param {string} [suffix] - Optional string to append to the instance name before processing
150
- * @return {string} A formatted locale string derived from the input
151
- *
152
- * @function getLocaleFromClassName
153
- * @memberOf module:for-angular
154
- */
155
- export declare function getLocaleFromClassName(instance: string | FunctionLike | KeyValue, suffix?: string): string;
156
- /**
157
- * @description Retrieves the current locale language
158
- * @summary This utility function gets the current locale language based on the user's browser settings.
159
- * It provides a consistent way to access the user's language preference throughout the application.
160
- * The function returns the browser's navigator.language value, defaulting to 'en' if not available.
161
- *
162
- * @return {string} The current locale language (e.g., 'en', 'fr')
163
- *
164
- * @function getLocaleLanguage
165
- * @memberOf module:for-angular
166
- */
167
- export declare function getLocaleLanguage(): string;
168
- /**
169
- * @description Generates a random string or number of specified length
170
- * @summary This utility function creates a random string of a specified length.
171
- * It can generate either alphanumeric strings (including uppercase and lowercase letters)
172
- * or numeric-only strings. This is useful for creating random IDs, temporary passwords,
173
- * or other random identifiers throughout the application.
174
- *
175
- * @param {number} [length=8] - The length of the random value to generate
176
- * @param {boolean} [onlyNumbers=false] - Whether to generate only numeric characters
177
- * @return {string} A randomly generated string of the specified length and character set
178
- *
179
- * @function generateRandomValue
180
- * @memberOf module:for-angular
181
- */
182
- export declare function generateRandomValue(length?: number, onlyNumbers?: boolean): string;
183
- /**
184
- * Converts a string representation of a boolean or a boolean value to a boolean type.
185
- *
186
- * @export
187
- * @param {('true' | 'false' | boolean)} prop - The value to convert. Can be the string 'true', 'false', or a boolean.
188
- * @returns {boolean} The boolean representation of the input value. Returns true if the input is the string 'true' or boolean true, false otherwise.
189
- */
190
- export declare function stringToBoolean(prop: 'true' | 'false' | boolean): boolean;
191
- /**
192
- * Checks if a value is a valid Date object
193
- *
194
- * @param {(string | Date | number)} date - The value to check. Can be a Date object, a timestamp number, or a date string
195
- * @return {boolean} Returns true if the value is a valid Date object (not NaN), otherwise false
196
- */
197
- export declare function isValidDate(date: string | Date | number): boolean;
198
- /**
199
- * Formats a date into a localized string representation
200
- *
201
- * @param {(string | Date | number)} date - The date to format. Can be a Date object, a timestamp number, or a date string
202
- * @param {string} [locale] - The locale to use for formatting. If not provided, the system's locale will be used
203
- * @return {(Date | string)} A formatted date string in the format DD/MM/YYYY according to the specified locale,
204
- * or the original input as a string if the date is invalid
205
- */
206
- export declare function formatDate(date: string | Date | number, locale?: string | undefined): Date | string;
207
- /**
208
- * Attempts to parse a date string, Date object, or number into a valid Date object
209
- *
210
- * @param {(string | Date | number)} date - The date to parse. Can be a Date object, a timestamp number,
211
- * or a date string in the format "DD/MM/YYYY HH:MM:SS:MS"
212
- * @return {(Date | null)} A valid Date object if parsing is successful, or null if the date is invalid
213
- * or doesn't match the expected format
214
- */
215
- export declare function parseToValidDate(date: string | Date | number): Date | null;
216
- /**
217
- * Maps an item object using a provided mapper object and optional additional properties.
218
- *
219
- * @param {KeyValue} item - The source object to be mapped.
220
- * @param {KeyValue} mapper - An object that defines the mapping rules. Keys represent the new property names,
221
- * and values represent the path to the corresponding values in the source object.
222
- * @param {KeyValue} [props] - Optional additional properties to be included in the mapped object.
223
- * @returns {KeyValue} A new object with properties mapped according to the mapper object and including any additional properties.
224
- */
225
- export declare function itemMapper(item: KeyValue, mapper: KeyValue, props?: KeyValue): KeyValue;
226
- /**
227
- * Maps an array of data objects using a provided mapper object.
228
- *
229
- * @template T - The type of the resulting mapped items.
230
- * @param {any[]} data - The array of data objects to be mapped.
231
- * @param {KeyValue} mapper - An object that defines the mapping rules.
232
- * @param {KeyValue} [props] - Additional properties to be included in the mapped items.
233
- *
234
- * @returns {T[]} - The array of mapped items. If an item in the original array does not have any non-null values after mapping,
235
- * the original item is returned instead.
236
- */
237
- export declare function dataMapper<T>(data: T[], mapper: KeyValue, props?: KeyValue): T[];
238
- /**
239
- * @description Removes focus from the currently active DOM element
240
- * @summary This utility function blurs the currently focused element in the document,
241
- * effectively removing focus traps that might prevent proper navigation or keyboard
242
- * interaction. It safely accesses the document's activeElement and calls blur() if
243
- * an element is currently focused. This is useful for accessibility and user experience
244
- * improvements, particularly when closing modals or dialogs.
245
- *
246
- * @return {void}
247
- *
248
- * @function removeFocusTrap
249
- * @memberOf module:for-angular
250
- */
251
- export declare function removeFocusTrap(): void;
252
- /**
253
- * @description Cleans and normalizes whitespace in a string value
254
- * @summary This utility function trims leading and trailing whitespace from a string
255
- * and replaces multiple consecutive whitespace characters with a single space.
256
- * Optionally converts the result to lowercase for consistent text processing.
257
- * This is useful for normalizing user input, search terms, or data sanitization.
258
- *
259
- * @param {string} value - The string value to clean and normalize
260
- * @param {boolean} [lowercase=false] - Whether to convert the result to lowercase
261
- * @return {string} The cleaned and normalized string
262
- *
263
- * @function cleanSpaces
264
- * @memberOf module:for-angular
265
- */
266
- export declare function cleanSpaces(value?: string, lowercase?: boolean): string;
267
- /**
268
- * @description Determines if the user's system is currently in dark mode
269
- * @summary This function checks the user's color scheme preference using the CSS media query
270
- * '(prefers-color-scheme: dark)'. It returns a boolean indicating whether the system is
271
- * currently set to dark mode. This is useful for implementing theme-aware functionality
272
- * and adjusting UI elements based on the user's preferred color scheme.
273
- *
274
- * @return {Promise<boolean>} True if the system is in dark mode, false otherwise
275
- *
276
- * @function isDarkMode
277
- * @memberOf module:for-angular
278
- */
279
- export declare function isDarkMode(): Promise<boolean>;
package/i18n/Loader.d.ts DELETED
@@ -1,43 +0,0 @@
1
- import { HttpClient } from '@angular/common/http';
2
- import { TranslateLoader, TranslationObject } from '@ngx-translate/core';
3
- import { Observable } from 'rxjs';
4
- import { I18nResourceConfig } from '../engine/interfaces';
5
- import { FunctionLike } from '../engine';
6
- export declare class I18nLoader {
7
- static loadFromHttp(http: HttpClient): TranslateLoader;
8
- }
9
- export declare function getLocaleContext(clazz: FunctionLike | object | string, suffix?: string): string;
10
- /**
11
- * @description Generates a localized string by combining locale and phrase
12
- * @summary This utility function creates a properly formatted locale string by combining
13
- * a locale identifier with a phrase. It handles edge cases such as empty phrases,
14
- * missing locales, and phrases that already include the locale prefix. This function
15
- * is useful for ensuring consistent formatting of localized strings throughout the application.
16
- *
17
- * @param {string} locale - The locale identifier (e.g., 'en', 'fr')
18
- * @param {string | undefined} phrase - The phrase to localize
19
- * @return {string} The formatted locale string, or empty string if phrase is undefined
20
- *
21
- * @function generateLocaleFromString
22
- * @memberOf module:for-angular
23
- */
24
- export declare function getLocaleContextByKey(locale: string, phrase: string | undefined): string;
25
- export declare function I18nLoaderFactory(http: HttpClient): TranslateLoader;
26
- export declare function getI18nLoaderFactoryProviderConfig(resources?: I18nResourceConfig | I18nResourceConfig[], versionedSuffix?: boolean): {
27
- provide: import("@angular/core").InjectionToken<{
28
- resources: I18nResourceConfig[];
29
- versionedSuffix: boolean;
30
- }>;
31
- useValue: {
32
- resources: I18nResourceConfig[];
33
- versionedSuffix: boolean;
34
- };
35
- };
36
- export declare class MultiI18nLoader implements I18nLoader {
37
- private http;
38
- private resources;
39
- private versionedSuffix;
40
- constructor(http: HttpClient, resources?: I18nResourceConfig[], versionedSuffix?: boolean);
41
- private getSuffix;
42
- getTranslation(lang: string): Observable<TranslationObject>;
43
- }
package/public-apis.d.ts DELETED
@@ -1,14 +0,0 @@
1
- import '@decaf-ts/ui-decorators';
2
- export * from './components';
3
- export * from './engine';
4
- export * from './directives';
5
- export * from './helpers';
6
- export * from './i18n/Loader';
7
- export * from './for-angular-common.module';
8
- /**
9
- * @description Angular integration for the Decaf framework
10
- * @summary This module provides Angular components and services for integrating with the Decaf framework.
11
- * It includes components for rendering models, CRUD operations, and form handling, as well as
12
- * rendering engines and utility functions to facilitate Angular application development with Decaf.
13
- * @module for-angular
14
- */