@messaia/cdk 18.1.0-rc21 → 18.1.0-rc23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/base/components/base.component.mjs +110 -69
- package/esm2022/lib/base/components/generic-form-base.component.mjs +18 -3
- package/esm2022/lib/common/models/action-item.mjs +11 -1
- package/esm2022/lib/layout/dynamic-menu/dynamic-menu.component.mjs +3 -3
- package/fesm2022/messaia-cdk.mjs +138 -72
- package/fesm2022/messaia-cdk.mjs.map +1 -1
- package/lib/base/components/base.component.d.ts +72 -55
- package/lib/base/components/generic-form-base.component.d.ts +4 -1
- package/lib/common/models/action-item.d.ts +10 -0
- package/package.json +1 -1
|
@@ -18,198 +18,208 @@ import { AuthUser } from '../models/auth-user';
|
|
|
18
18
|
import { VdTaskDialogComponent } from './task-dialog/task-dialog.component';
|
|
19
19
|
import * as i0 from "@angular/core";
|
|
20
20
|
/**
|
|
21
|
-
* A base list component for components with pagination support
|
|
21
|
+
* A base list component for components with pagination support.
|
|
22
22
|
*/
|
|
23
23
|
export declare abstract class BaseComponent implements IBaseComponent, OnInit, AfterViewInit {
|
|
24
24
|
protected route: ActivatedRoute;
|
|
25
25
|
protected changeDetectorRef: ChangeDetectorRef;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Application settings.
|
|
28
28
|
*/
|
|
29
29
|
appSetting: AppSetting;
|
|
30
30
|
/**
|
|
31
|
-
* settings
|
|
31
|
+
* General configuration settings, with a flexible type to accommodate different configurations.
|
|
32
32
|
*/
|
|
33
33
|
settings: any;
|
|
34
34
|
/**
|
|
35
|
-
* Menu items
|
|
35
|
+
* Menu items for navigation.
|
|
36
36
|
*/
|
|
37
37
|
menu?: Menu;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Name of the project, used for display or logging purposes.
|
|
40
40
|
*/
|
|
41
41
|
projectName?: string;
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Title of the current page, displayed in the page header.
|
|
44
44
|
*/
|
|
45
45
|
title?: string;
|
|
46
46
|
/**
|
|
47
|
-
*
|
|
47
|
+
* Subtitle of the current outlet, used for additional page context.
|
|
48
48
|
*/
|
|
49
49
|
subtitle?: string;
|
|
50
50
|
/**
|
|
51
|
-
* If true,
|
|
51
|
+
* If true, dummy data is used for testing, and debug logs are enabled.
|
|
52
52
|
*/
|
|
53
53
|
debug: boolean;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Indicates whether a loading process is active, often used to show a loading spinner.
|
|
56
56
|
*/
|
|
57
57
|
isLoading: boolean;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* Determines whether to handle changes in expansion panels.
|
|
60
60
|
*/
|
|
61
61
|
handleExpansionPanelChanges: boolean;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* Indicates whether a save operation is currently in progress.
|
|
64
64
|
*/
|
|
65
65
|
_isSaving: boolean;
|
|
66
66
|
get isSaving(): boolean;
|
|
67
67
|
set isSaving(isSaving: boolean);
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Indicates whether the editor has been initialized.
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
isEditorInitialized: boolean;
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Stores any errors encountered during requests or operations.
|
|
74
74
|
*/
|
|
75
75
|
errors: Array<string>;
|
|
76
76
|
/**
|
|
77
|
-
*
|
|
77
|
+
* Utility to evaluate media queries based on the current screen or window size.
|
|
78
78
|
*/
|
|
79
79
|
media: VdMediaService;
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* List of permitted file extensions for upload or selection.
|
|
82
82
|
*/
|
|
83
83
|
allowedExtensions: string[];
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* Plugins enabled in the TinyMCE editor.
|
|
86
86
|
*/
|
|
87
87
|
editorPlugins: string;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Toolbar configuration for TinyMCE editor.
|
|
90
90
|
*/
|
|
91
91
|
editorToolbar: string;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Additional configuration settings for the editor.
|
|
94
94
|
*/
|
|
95
95
|
editorConfig: any;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* Service for navigation and URL manipulation.
|
|
98
98
|
*/
|
|
99
99
|
router: Router;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* Optional hash value appended to URLs for bookmarking or state management.
|
|
102
102
|
*/
|
|
103
103
|
urlHash?: string;
|
|
104
104
|
/**
|
|
105
|
-
*
|
|
105
|
+
* CSS class name(s) applied to the component.
|
|
106
106
|
*/
|
|
107
107
|
className?: string;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* Permission flag for creating new entries.
|
|
110
110
|
*/
|
|
111
111
|
canCreate: boolean;
|
|
112
112
|
/**
|
|
113
|
-
*
|
|
113
|
+
* Permission flag for updating existing entries.
|
|
114
114
|
*/
|
|
115
115
|
canUpdate: boolean;
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
117
|
+
* Permission flag for deleting entries.
|
|
118
118
|
*/
|
|
119
119
|
canDelete: boolean;
|
|
120
120
|
/**
|
|
121
|
-
*
|
|
121
|
+
* Full path of the current route.
|
|
122
122
|
*/
|
|
123
123
|
currentRoute?: string;
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
125
|
+
* Base path of the current route, excluding specific parameters or sub-paths.
|
|
126
126
|
*/
|
|
127
127
|
currentBaseRoute?: string;
|
|
128
128
|
/**
|
|
129
|
-
*
|
|
129
|
+
* URL to navigate back to after saving changes.
|
|
130
130
|
*/
|
|
131
131
|
returnUrl?: string;
|
|
132
132
|
/**
|
|
133
|
-
*
|
|
133
|
+
* Object representing the current authenticated user.
|
|
134
134
|
*/
|
|
135
135
|
currentUser: AuthUser;
|
|
136
136
|
/**
|
|
137
|
-
*
|
|
137
|
+
* Indicates if the current user has admin privileges.
|
|
138
138
|
*/
|
|
139
139
|
isAdmin: boolean;
|
|
140
140
|
/**
|
|
141
|
-
*
|
|
141
|
+
* Indicates if the current user has client admin privileges.
|
|
142
142
|
*/
|
|
143
143
|
isClientAdmin: boolean;
|
|
144
144
|
/**
|
|
145
|
-
*
|
|
145
|
+
* Indicates if the current user has department admin privileges.
|
|
146
146
|
*/
|
|
147
147
|
isDepartmentAdmin: boolean;
|
|
148
148
|
/**
|
|
149
|
-
* reload
|
|
149
|
+
* Event emitter for reload actions, useful for refreshing data.
|
|
150
150
|
*/
|
|
151
151
|
reload: EventEmitter<any>;
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
153
|
+
* Service for setting the document's title.
|
|
154
154
|
*/
|
|
155
155
|
protected titleService: Title;
|
|
156
156
|
/**
|
|
157
|
-
*
|
|
157
|
+
* Service for displaying snack bar notifications.
|
|
158
158
|
*/
|
|
159
159
|
protected snackBarService: MatSnackBar;
|
|
160
160
|
/**
|
|
161
|
-
*
|
|
161
|
+
* Service for displaying confirmation and prompt dialogs.
|
|
162
162
|
*/
|
|
163
163
|
protected dialogService: VdDialogService;
|
|
164
164
|
/**
|
|
165
|
-
*
|
|
165
|
+
* Service for opening modal dialogs.
|
|
166
166
|
*/
|
|
167
167
|
protected dialog: MatDialog;
|
|
168
168
|
/**
|
|
169
|
-
* location
|
|
169
|
+
* Service for managing browser location and history.
|
|
170
170
|
*/
|
|
171
171
|
protected location: Location;
|
|
172
172
|
/**
|
|
173
|
-
* If true,
|
|
173
|
+
* If true, sets a URL hash for navigation state.
|
|
174
174
|
*/
|
|
175
175
|
protected setUrlHash: boolean;
|
|
176
176
|
/**
|
|
177
|
-
*
|
|
177
|
+
* Query list for accessing expansion panel elements as DOM references.
|
|
178
178
|
*/
|
|
179
179
|
protected matExpansionPanelElementQueryList?: QueryList<ElementRef>;
|
|
180
180
|
/**
|
|
181
|
-
* MatExpansionPanel
|
|
181
|
+
* Query list for accessing MatExpansionPanel component references.
|
|
182
182
|
*/
|
|
183
183
|
protected matExpansionPanelQueryList?: QueryList<MatExpansionPanel>;
|
|
184
184
|
/**
|
|
185
|
-
*
|
|
185
|
+
* Subscriptions for expansion panel changes, managed to avoid memory leaks.
|
|
186
186
|
*/
|
|
187
187
|
protected matExpansionPanelSubscriptions: Subscription[];
|
|
188
188
|
/**
|
|
189
|
-
*
|
|
189
|
+
* Initializes services and application settings, sets up context helpers,
|
|
190
|
+
* and initializes the editor with default configurations.
|
|
191
|
+
*
|
|
192
|
+
* @param route - ActivatedRoute instance for accessing route parameters and data.
|
|
193
|
+
* @param changeDetectorRef - ChangeDetectorRef instance for manually triggering change detection.
|
|
190
194
|
*/
|
|
191
195
|
constructor(route: ActivatedRoute, changeDetectorRef: ChangeDetectorRef);
|
|
192
196
|
/**
|
|
193
|
-
* Lifecycle hook that is called after data-bound properties
|
|
194
|
-
* of a directive are initialized.
|
|
197
|
+
* Lifecycle hook that is called after data-bound properties of a directive are initialized
|
|
195
198
|
*/
|
|
196
199
|
ngOnInit(): void;
|
|
197
200
|
/**
|
|
198
|
-
* Lifecycle hook that is called after a component's view has been fully initialized
|
|
201
|
+
* Lifecycle hook that is called after a component's view has been fully initialized
|
|
199
202
|
*/
|
|
200
203
|
ngAfterViewInit(): void;
|
|
201
204
|
/**
|
|
202
|
-
*
|
|
205
|
+
* Reloads the current page or component.
|
|
206
|
+
*
|
|
207
|
+
* This method navigates temporarily to the root URL and then
|
|
208
|
+
* navigates back to the current URL to effectively refresh the page or component.
|
|
209
|
+
*
|
|
210
|
+
* @param callback - A function to be called after the navigation is successful,
|
|
211
|
+
* receives the current URL as an argument.
|
|
203
212
|
*/
|
|
204
|
-
reloadPage(): void;
|
|
213
|
+
reloadPage(callback?: (currentUrl: string) => void): void;
|
|
205
214
|
/**
|
|
206
|
-
* Navigates back to return
|
|
215
|
+
* Navigates back to the return URL if it exists.
|
|
207
216
|
*/
|
|
208
217
|
navigateToReturnUrl(): void;
|
|
209
218
|
detectChanges(): void;
|
|
210
219
|
/**
|
|
211
|
-
* Sets return
|
|
212
|
-
*
|
|
220
|
+
* Sets the return URL after decoding it.
|
|
221
|
+
*
|
|
222
|
+
* @param returnUrl - The encoded return URL to set.
|
|
213
223
|
*/
|
|
214
224
|
protected setReturnUrl(returnUrl: string): void;
|
|
215
225
|
/**
|
|
@@ -225,16 +235,23 @@ export declare abstract class BaseComponent implements IBaseComponent, OnInit, A
|
|
|
225
235
|
*/
|
|
226
236
|
protected getService<T>(token: Type<T>): T;
|
|
227
237
|
/**
|
|
228
|
-
* Gets
|
|
229
|
-
*
|
|
238
|
+
* Gets the main route from the given snapshot by traversing up to the parent routes
|
|
239
|
+
* if the current snapshot does not have a menu defined.
|
|
240
|
+
*
|
|
241
|
+
* @param snapshot - The activated route snapshot to evaluate.
|
|
242
|
+
* @returns The main route snapshot that has a menu defined.
|
|
230
243
|
*/
|
|
231
244
|
protected getMainRoute(snapshot: ActivatedRouteSnapshot): ActivatedRouteSnapshot;
|
|
232
245
|
/**
|
|
233
|
-
* Shows a confirm dialog to delete
|
|
246
|
+
* Shows a confirm dialog to delete a single item.
|
|
247
|
+
*
|
|
248
|
+
* @returns An observable that emits the result of the dialog after it is closed.
|
|
234
249
|
*/
|
|
235
250
|
protected showDeleteItemDialog(): Observable<any>;
|
|
236
251
|
/**
|
|
237
|
-
* Shows a confirm dialog to delete multiple items
|
|
252
|
+
* Shows a confirm dialog to delete multiple selected items.
|
|
253
|
+
*
|
|
254
|
+
* @returns An observable that emits the result of the dialog after it is closed.
|
|
238
255
|
*/
|
|
239
256
|
protected showDeleteItemsDialog(): Observable<any>;
|
|
240
257
|
/**
|
|
@@ -208,8 +208,11 @@ export declare abstract class GenericFormBaseComponent<TEntity extends IEntity,
|
|
|
208
208
|
/**
|
|
209
209
|
* Loads an item by ID.
|
|
210
210
|
* This method fetches the item if the component is in edit mode and the service endpoint is defined.
|
|
211
|
+
*
|
|
212
|
+
* @param callback - A function to be called after the item has been successfully loaded.
|
|
213
|
+
* This function will receive the loaded item as an argument.
|
|
211
214
|
*/
|
|
212
|
-
loadItem(): void;
|
|
215
|
+
loadItem(callback?: (item: any) => void): void;
|
|
213
216
|
/**
|
|
214
217
|
* Loads an item by ID asynchronously.
|
|
215
218
|
* @returns An Observable of the loaded entity.
|
|
@@ -26,6 +26,11 @@ export declare class ActionItem<TEntity = any, TContext = any> {
|
|
|
26
26
|
* @type {((x?: TEntity, ctx?: TContext) => any) | string}
|
|
27
27
|
*/
|
|
28
28
|
iconClass?: ((x?: TEntity, ctx?: TContext) => any) | string;
|
|
29
|
+
/**
|
|
30
|
+
* The color for the icon, which can be set as a string (e.g., hex, rgb).
|
|
31
|
+
* @type {string}
|
|
32
|
+
*/
|
|
33
|
+
iconColor?: string;
|
|
29
34
|
/**
|
|
30
35
|
* Event handler to execute when the action item is triggered.
|
|
31
36
|
* @param {x} The entity associated with the action item.
|
|
@@ -56,6 +61,11 @@ export declare class ActionItem<TEntity = any, TContext = any> {
|
|
|
56
61
|
* @type {number}
|
|
57
62
|
*/
|
|
58
63
|
index?: number;
|
|
64
|
+
/**
|
|
65
|
+
* The text color for the action item, specified as a hex string or a color name.
|
|
66
|
+
* @type {string}
|
|
67
|
+
*/
|
|
68
|
+
textColor?: string;
|
|
59
69
|
/**
|
|
60
70
|
* Constructor to initialize an ActionItem instance with optional properties.
|
|
61
71
|
* @param init - Partial properties to initialize the action item.
|