@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.
@@ -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
- * App settings
27
+ * Application settings.
28
28
  */
29
29
  appSetting: AppSetting;
30
30
  /**
31
- * settings: Any
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
- * The name of the project
39
+ * Name of the project, used for display or logging purposes.
40
40
  */
41
41
  projectName?: string;
42
42
  /**
43
- * The title of the current page
43
+ * Title of the current page, displayed in the page header.
44
44
  */
45
45
  title?: string;
46
46
  /**
47
- * The subtitle of the current outlet
47
+ * Subtitle of the current outlet, used for additional page context.
48
48
  */
49
49
  subtitle?: string;
50
50
  /**
51
- * If true, use some dummy data and show debug logs
51
+ * If true, dummy data is used for testing, and debug logs are enabled.
52
52
  */
53
53
  debug: boolean;
54
54
  /**
55
- * Loading status
55
+ * Indicates whether a loading process is active, often used to show a loading spinner.
56
56
  */
57
57
  isLoading: boolean;
58
58
  /**
59
- * handleExpansionPanelChanges: boolean
59
+ * Determines whether to handle changes in expansion panels.
60
60
  */
61
61
  handleExpansionPanelChanges: boolean;
62
62
  /**
63
- * Saving status
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
- * A flag eindicates that the editor is inited
69
+ * Indicates whether the editor has been initialized.
70
70
  */
71
- isEditorInitialzed: boolean;
71
+ isEditorInitialized: boolean;
72
72
  /**
73
- * Represents the request errors
73
+ * Stores any errors encountered during requests or operations.
74
74
  */
75
75
  errors: Array<string>;
76
76
  /**
77
- * Used to evaluate whether a given media query is true or false given the current device's screen / window size.
77
+ * Utility to evaluate media queries based on the current screen or window size.
78
78
  */
79
79
  media: VdMediaService;
80
80
  /**
81
- * Allowed file extensions
81
+ * List of permitted file extensions for upload or selection.
82
82
  */
83
83
  allowedExtensions: string[];
84
84
  /**
85
- * tinyMCE plugins
85
+ * Plugins enabled in the TinyMCE editor.
86
86
  */
87
87
  editorPlugins: string;
88
88
  /**
89
- * tinyMCE editor
89
+ * Toolbar configuration for TinyMCE editor.
90
90
  */
91
91
  editorToolbar: string;
92
92
  /**
93
- * Editor configuration
93
+ * Additional configuration settings for the editor.
94
94
  */
95
95
  editorConfig: any;
96
96
  /**
97
- * Provides the navigation and url manipulation capabilities.
97
+ * Service for navigation and URL manipulation.
98
98
  */
99
99
  router: Router;
100
100
  /**
101
- * urlHash: string
101
+ * Optional hash value appended to URLs for bookmarking or state management.
102
102
  */
103
103
  urlHash?: string;
104
104
  /**
105
- * Class name
105
+ * CSS class name(s) applied to the component.
106
106
  */
107
107
  className?: string;
108
108
  /**
109
- * Create permission
109
+ * Permission flag for creating new entries.
110
110
  */
111
111
  canCreate: boolean;
112
112
  /**
113
- * Update permission
113
+ * Permission flag for updating existing entries.
114
114
  */
115
115
  canUpdate: boolean;
116
116
  /**
117
- * Delete permission
117
+ * Permission flag for deleting entries.
118
118
  */
119
119
  canDelete: boolean;
120
120
  /**
121
- * Current route
121
+ * Full path of the current route.
122
122
  */
123
123
  currentRoute?: string;
124
124
  /**
125
- * Current base route
125
+ * Base path of the current route, excluding specific parameters or sub-paths.
126
126
  */
127
127
  currentBaseRoute?: string;
128
128
  /**
129
- * A url to return to after save
129
+ * URL to navigate back to after saving changes.
130
130
  */
131
131
  returnUrl?: string;
132
132
  /**
133
- * Current user object
133
+ * Object representing the current authenticated user.
134
134
  */
135
135
  currentUser: AuthUser;
136
136
  /**
137
- * Is the current user a client admin
137
+ * Indicates if the current user has admin privileges.
138
138
  */
139
139
  isAdmin: boolean;
140
140
  /**
141
- * Is the current user a client admin
141
+ * Indicates if the current user has client admin privileges.
142
142
  */
143
143
  isClientAdmin: boolean;
144
144
  /**
145
- * Is the current user a department admin
145
+ * Indicates if the current user has department admin privileges.
146
146
  */
147
147
  isDepartmentAdmin: boolean;
148
148
  /**
149
- * reload?: function
149
+ * Event emitter for reload actions, useful for refreshing data.
150
150
  */
151
151
  reload: EventEmitter<any>;
152
152
  /**
153
- * A service that can be used to get and set the title of a current HTML document.
153
+ * Service for setting the document's title.
154
154
  */
155
155
  protected titleService: Title;
156
156
  /**
157
- * A service to dispatch Material Design snack bar messages.
157
+ * Service for displaying snack bar notifications.
158
158
  */
159
159
  protected snackBarService: MatSnackBar;
160
160
  /**
161
- * A service to show conirm and prompt dialogs.
161
+ * Service for displaying confirmation and prompt dialogs.
162
162
  */
163
163
  protected dialogService: VdDialogService;
164
164
  /**
165
- * A service to show conirm and prompt dialogs.
165
+ * Service for opening modal dialogs.
166
166
  */
167
167
  protected dialog: MatDialog;
168
168
  /**
169
- * location: Location
169
+ * Service for managing browser location and history.
170
170
  */
171
171
  protected location: Location;
172
172
  /**
173
- * If true, set url hash
173
+ * If true, sets a URL hash for navigation state.
174
174
  */
175
175
  protected setUrlHash: boolean;
176
176
  /**
177
- * MatExpansionPanel ref
177
+ * Query list for accessing expansion panel elements as DOM references.
178
178
  */
179
179
  protected matExpansionPanelElementQueryList?: QueryList<ElementRef>;
180
180
  /**
181
- * MatExpansionPanel ref
181
+ * Query list for accessing MatExpansionPanel component references.
182
182
  */
183
183
  protected matExpansionPanelQueryList?: QueryList<MatExpansionPanel>;
184
184
  /**
185
- * matExpansionPanelSubscriptions: Subscription[]
185
+ * Subscriptions for expansion panel changes, managed to avoid memory leaks.
186
186
  */
187
187
  protected matExpansionPanelSubscriptions: Subscription[];
188
188
  /**
189
- * Constructor
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
- * Refreshs this page/component
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 url
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 url
212
- * @param returnUrl
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 base route
229
- * @param snapshot
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 an item
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@messaia/cdk",
3
- "version": "18.1.0-rc21",
3
+ "version": "18.1.0-rc23",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.2.7",
6
6
  "@angular/core": "^18.2.7"