@flusys/ng-shared 5.0.3 → 5.0.4
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/README.md +29 -25
- package/fesm2022/flusys-ng-shared.mjs +417 -197
- package/fesm2022/flusys-ng-shared.mjs.map +1 -1
- package/package.json +2 -2
- package/types/flusys-ng-shared.d.ts +209 -179
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/ng-shared",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"description": "Shared components and utilities for FLUSYS Angular packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"peerDependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"@angular/core": ">=21.0.0",
|
|
9
9
|
"@angular/forms": ">=21.0.0",
|
|
10
10
|
"@angular/router": ">=21.0.0",
|
|
11
|
-
"@flusys/ng-core": ">=5.0.
|
|
11
|
+
"@flusys/ng-core": ">=5.0.4",
|
|
12
12
|
"@primeuix/themes": ">=1.0.0",
|
|
13
13
|
"primeicons": ">=7.0.0",
|
|
14
14
|
"primeng": ">=21.0.0",
|
|
@@ -2,6 +2,7 @@ import * as rxjs from 'rxjs';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { Signal, PipeTransform, ResourceRef, ResourceStatus, Injector, model, OnDestroy, ElementRef, TemplateRef, DestroyRef, InjectionToken } from '@angular/core';
|
|
5
|
+
import { HttpContextToken, HttpRequest, HttpHandlerFn, HttpEvent, HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
5
6
|
import * as i3 from '@angular/router';
|
|
6
7
|
import { ResolveFn, CanActivateFn, Router, ActivatedRoute } from '@angular/router';
|
|
7
8
|
import * as i1 from '@angular/common';
|
|
@@ -49,9 +50,9 @@ import * as i38 from 'primeng/treetable';
|
|
|
49
50
|
import * as i39 from 'primeng/progressspinner';
|
|
50
51
|
import * as i40 from 'primeng/colorpicker';
|
|
51
52
|
import * as _flusys_ng_shared from '@flusys/ng-shared';
|
|
52
|
-
import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
53
|
-
import { FormValueControl } from '@angular/forms/signals';
|
|
54
53
|
import * as _flusys_ng_core from '@flusys/ng-core';
|
|
54
|
+
import { ServiceName } from '@flusys/ng-core';
|
|
55
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
55
56
|
import { MessageService, ConfirmationService } from 'primeng/api';
|
|
56
57
|
|
|
57
58
|
declare const SHARED_MESSAGES: Record<string, string>;
|
|
@@ -120,6 +121,9 @@ declare const STORAGE_CONFIG_PERMISSIONS: {
|
|
|
120
121
|
readonly UPDATE: "storage-config.update";
|
|
121
122
|
readonly DELETE: "storage-config.delete";
|
|
122
123
|
};
|
|
124
|
+
declare const UPLOAD_CONFIG_PERMISSIONS: {
|
|
125
|
+
readonly DELETE: "upload-config.delete";
|
|
126
|
+
};
|
|
123
127
|
declare const EMAIL_CONFIG_PERMISSIONS: {
|
|
124
128
|
readonly CREATE: "email-config.create";
|
|
125
129
|
readonly READ: "email-config.read";
|
|
@@ -138,18 +142,18 @@ declare const FORM_PERMISSIONS: {
|
|
|
138
142
|
readonly UPDATE: "form.update";
|
|
139
143
|
readonly DELETE: "form.delete";
|
|
140
144
|
};
|
|
145
|
+
declare const FORM_RESULT_PERMISSIONS: {
|
|
146
|
+
readonly CREATE: "form-result.create";
|
|
147
|
+
readonly READ: "form-result.read";
|
|
148
|
+
readonly UPDATE: "form-result.update";
|
|
149
|
+
readonly DELETE: "form-result.delete";
|
|
150
|
+
};
|
|
141
151
|
declare const EVENT_PERMISSIONS: {
|
|
142
152
|
readonly CREATE: "event.create";
|
|
143
153
|
readonly READ: "event.read";
|
|
144
154
|
readonly UPDATE: "event.update";
|
|
145
155
|
readonly DELETE: "event.delete";
|
|
146
156
|
};
|
|
147
|
-
declare const EVENT_PARTICIPANT_PERMISSIONS: {
|
|
148
|
-
readonly CREATE: "event-participant.create";
|
|
149
|
-
readonly READ: "event-participant.read";
|
|
150
|
-
readonly UPDATE: "event-participant.update";
|
|
151
|
-
readonly DELETE: "event-participant.delete";
|
|
152
|
-
};
|
|
153
157
|
declare const NOTIFICATION_PERMISSIONS: {
|
|
154
158
|
readonly CREATE: "notification.create";
|
|
155
159
|
readonly READ: "notification.read";
|
|
@@ -174,6 +178,127 @@ declare const TRANSLATION_PERMISSIONS: {
|
|
|
174
178
|
readonly UPDATE: "translation.update";
|
|
175
179
|
readonly DELETE: "translation.delete";
|
|
176
180
|
};
|
|
181
|
+
declare const PERMISSIONS: {
|
|
182
|
+
readonly USER: {
|
|
183
|
+
readonly CREATE: "user.create";
|
|
184
|
+
readonly READ: "user.read";
|
|
185
|
+
readonly UPDATE: "user.update";
|
|
186
|
+
readonly DELETE: "user.delete";
|
|
187
|
+
};
|
|
188
|
+
readonly COMPANY: {
|
|
189
|
+
readonly CREATE: "company.create";
|
|
190
|
+
readonly READ: "company.read";
|
|
191
|
+
readonly UPDATE: "company.update";
|
|
192
|
+
readonly DELETE: "company.delete";
|
|
193
|
+
};
|
|
194
|
+
readonly BRANCH: {
|
|
195
|
+
readonly CREATE: "branch.create";
|
|
196
|
+
readonly READ: "branch.read";
|
|
197
|
+
readonly UPDATE: "branch.update";
|
|
198
|
+
readonly DELETE: "branch.delete";
|
|
199
|
+
};
|
|
200
|
+
readonly ACTION: {
|
|
201
|
+
readonly CREATE: "action.create";
|
|
202
|
+
readonly READ: "action.read";
|
|
203
|
+
readonly UPDATE: "action.update";
|
|
204
|
+
readonly DELETE: "action.delete";
|
|
205
|
+
};
|
|
206
|
+
readonly ROLE: {
|
|
207
|
+
readonly CREATE: "role.create";
|
|
208
|
+
readonly READ: "role.read";
|
|
209
|
+
readonly UPDATE: "role.update";
|
|
210
|
+
readonly DELETE: "role.delete";
|
|
211
|
+
};
|
|
212
|
+
readonly ROLE_ACTION: {
|
|
213
|
+
readonly READ: "role-action.read";
|
|
214
|
+
readonly ASSIGN: "role-action.assign";
|
|
215
|
+
};
|
|
216
|
+
readonly USER_ROLE: {
|
|
217
|
+
readonly READ: "user-role.read";
|
|
218
|
+
readonly ASSIGN: "user-role.assign";
|
|
219
|
+
};
|
|
220
|
+
readonly USER_ACTION: {
|
|
221
|
+
readonly READ: "user-action.read";
|
|
222
|
+
readonly ASSIGN: "user-action.assign";
|
|
223
|
+
};
|
|
224
|
+
readonly COMPANY_ACTION: {
|
|
225
|
+
readonly READ: "company-action.read";
|
|
226
|
+
readonly ASSIGN: "company-action.assign";
|
|
227
|
+
};
|
|
228
|
+
readonly FILE: {
|
|
229
|
+
readonly CREATE: "file.create";
|
|
230
|
+
readonly READ: "file.read";
|
|
231
|
+
readonly UPDATE: "file.update";
|
|
232
|
+
readonly DELETE: "file.delete";
|
|
233
|
+
};
|
|
234
|
+
readonly FOLDER: {
|
|
235
|
+
readonly CREATE: "folder.create";
|
|
236
|
+
readonly READ: "folder.read";
|
|
237
|
+
readonly UPDATE: "folder.update";
|
|
238
|
+
readonly DELETE: "folder.delete";
|
|
239
|
+
};
|
|
240
|
+
readonly STORAGE_CONFIG: {
|
|
241
|
+
readonly CREATE: "storage-config.create";
|
|
242
|
+
readonly READ: "storage-config.read";
|
|
243
|
+
readonly UPDATE: "storage-config.update";
|
|
244
|
+
readonly DELETE: "storage-config.delete";
|
|
245
|
+
};
|
|
246
|
+
readonly EMAIL_CONFIG: {
|
|
247
|
+
readonly CREATE: "email-config.create";
|
|
248
|
+
readonly READ: "email-config.read";
|
|
249
|
+
readonly UPDATE: "email-config.update";
|
|
250
|
+
readonly DELETE: "email-config.delete";
|
|
251
|
+
};
|
|
252
|
+
readonly EMAIL_TEMPLATE: {
|
|
253
|
+
readonly CREATE: "email-template.create";
|
|
254
|
+
readonly READ: "email-template.read";
|
|
255
|
+
readonly UPDATE: "email-template.update";
|
|
256
|
+
readonly DELETE: "email-template.delete";
|
|
257
|
+
};
|
|
258
|
+
readonly FORM: {
|
|
259
|
+
readonly CREATE: "form.create";
|
|
260
|
+
readonly READ: "form.read";
|
|
261
|
+
readonly UPDATE: "form.update";
|
|
262
|
+
readonly DELETE: "form.delete";
|
|
263
|
+
};
|
|
264
|
+
readonly FORM_RESULT: {
|
|
265
|
+
readonly CREATE: "form-result.create";
|
|
266
|
+
readonly READ: "form-result.read";
|
|
267
|
+
readonly UPDATE: "form-result.update";
|
|
268
|
+
readonly DELETE: "form-result.delete";
|
|
269
|
+
};
|
|
270
|
+
readonly EVENT: {
|
|
271
|
+
readonly CREATE: "event.create";
|
|
272
|
+
readonly READ: "event.read";
|
|
273
|
+
readonly UPDATE: "event.update";
|
|
274
|
+
readonly DELETE: "event.delete";
|
|
275
|
+
};
|
|
276
|
+
readonly NOTIFICATION: {
|
|
277
|
+
readonly CREATE: "notification.create";
|
|
278
|
+
readonly READ: "notification.read";
|
|
279
|
+
readonly UPDATE: "notification.update";
|
|
280
|
+
readonly DELETE: "notification.delete";
|
|
281
|
+
};
|
|
282
|
+
readonly LANGUAGE: {
|
|
283
|
+
readonly CREATE: "language.create";
|
|
284
|
+
readonly READ: "language.read";
|
|
285
|
+
readonly UPDATE: "language.update";
|
|
286
|
+
readonly DELETE: "language.delete";
|
|
287
|
+
};
|
|
288
|
+
readonly TRANSLATION_KEY: {
|
|
289
|
+
readonly CREATE: "translation-key.create";
|
|
290
|
+
readonly READ: "translation-key.read";
|
|
291
|
+
readonly UPDATE: "translation-key.update";
|
|
292
|
+
readonly DELETE: "translation-key.delete";
|
|
293
|
+
};
|
|
294
|
+
readonly TRANSLATION: {
|
|
295
|
+
readonly CREATE: "translation.create";
|
|
296
|
+
readonly READ: "translation.read";
|
|
297
|
+
readonly UPDATE: "translation.update";
|
|
298
|
+
readonly DELETE: "translation.delete";
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
type PermissionCode = (typeof PERMISSIONS)[keyof typeof PERMISSIONS][keyof (typeof PERMISSIONS)[keyof typeof PERMISSIONS]];
|
|
177
302
|
|
|
178
303
|
/**
|
|
179
304
|
* Base entity interface - matches backend Identity entity
|
|
@@ -290,14 +415,6 @@ interface IBulkMeta {
|
|
|
290
415
|
failed?: number;
|
|
291
416
|
total?: number;
|
|
292
417
|
}
|
|
293
|
-
/**
|
|
294
|
-
* Validation error detail
|
|
295
|
-
*/
|
|
296
|
-
interface IValidationError {
|
|
297
|
-
field: string;
|
|
298
|
-
message: string;
|
|
299
|
-
constraint?: string;
|
|
300
|
-
}
|
|
301
418
|
/**
|
|
302
419
|
* Single item response (insert, update, get-by-id)
|
|
303
420
|
*/
|
|
@@ -343,32 +460,6 @@ interface IMessageResponse {
|
|
|
343
460
|
messageVariables?: Record<string, unknown>;
|
|
344
461
|
_meta?: IRequestMeta;
|
|
345
462
|
}
|
|
346
|
-
/**
|
|
347
|
-
* Error response
|
|
348
|
-
*/
|
|
349
|
-
interface IErrorResponse {
|
|
350
|
-
success: false;
|
|
351
|
-
message: string;
|
|
352
|
-
messageKey?: string;
|
|
353
|
-
messageVariables?: Record<string, unknown>;
|
|
354
|
-
errors?: IValidationError[];
|
|
355
|
-
_meta?: IRequestMeta;
|
|
356
|
-
}
|
|
357
|
-
/**
|
|
358
|
-
* Union type for all API responses
|
|
359
|
-
*/
|
|
360
|
-
type ApiResponse<T> = ISingleResponse<T> | IListResponse<T> | IBulkResponse<T> | IMessageResponse | IErrorResponse;
|
|
361
|
-
interface IFileData {
|
|
362
|
-
id: string;
|
|
363
|
-
name: string;
|
|
364
|
-
originalName: string;
|
|
365
|
-
contentType: string;
|
|
366
|
-
size: number;
|
|
367
|
-
key: string;
|
|
368
|
-
url?: string;
|
|
369
|
-
thumbnailUrl?: string;
|
|
370
|
-
createdAt: Date;
|
|
371
|
-
}
|
|
372
463
|
|
|
373
464
|
interface IFileBasicInfo {
|
|
374
465
|
id: string;
|
|
@@ -413,10 +504,8 @@ interface IFileSelectFilter extends ISelectFilter {
|
|
|
413
504
|
folderId?: string;
|
|
414
505
|
storageConfigId?: string;
|
|
415
506
|
}
|
|
416
|
-
type LoadFilesFn = (filter: IFileSelectFilter) => Observable<IListResponse<IFileBasicInfo>>;
|
|
417
507
|
type UploadFileFn = (file: File, options?: IFileUploadOptions) => Observable<ISingleResponse<IUploadedFile>>;
|
|
418
508
|
type UploadMultipleFilesFn = (files: File[], options?: IFileUploadOptions) => Observable<ISingleResponse<IUploadedFile[]>>;
|
|
419
|
-
type GetFileUrlsFn = (fileIds: string[]) => Observable<ISingleResponse<IFileBasicInfo[]>>;
|
|
420
509
|
declare const FILE_TYPE_FILTERS: {
|
|
421
510
|
readonly IMAGES: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"];
|
|
422
511
|
readonly DOCUMENTS: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
|
|
@@ -540,65 +629,6 @@ interface IProfilePermissionProvider {
|
|
|
540
629
|
getUserRoles(userId: string, branchId?: string): Observable<ISingleResponse<IProfileRoleInfo[]>>;
|
|
541
630
|
getUserActions(userId: string, branchId?: string): Observable<ISingleResponse<IProfileActionInfo[]>>;
|
|
542
631
|
}
|
|
543
|
-
/**
|
|
544
|
-
* Base user interface for list operations
|
|
545
|
-
*/
|
|
546
|
-
interface IUserListItem {
|
|
547
|
-
id: string;
|
|
548
|
-
name: string;
|
|
549
|
-
email: string;
|
|
550
|
-
phone?: string;
|
|
551
|
-
isActive?: boolean;
|
|
552
|
-
}
|
|
553
|
-
/**
|
|
554
|
-
* User list action definition
|
|
555
|
-
*/
|
|
556
|
-
interface IUserListAction<T = IUserListItem> {
|
|
557
|
-
id: string;
|
|
558
|
-
label: string;
|
|
559
|
-
icon?: string;
|
|
560
|
-
severity?: 'primary' | 'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'help' | 'contrast';
|
|
561
|
-
permission?: string;
|
|
562
|
-
tooltip?: string;
|
|
563
|
-
disabled?: boolean | ((user: T) => boolean);
|
|
564
|
-
visible?: boolean | ((user: T) => boolean);
|
|
565
|
-
}
|
|
566
|
-
/**
|
|
567
|
-
* Extra column definition for user list
|
|
568
|
-
*/
|
|
569
|
-
interface IUserListColumn {
|
|
570
|
-
field: string;
|
|
571
|
-
header: string;
|
|
572
|
-
width?: string;
|
|
573
|
-
sortable?: boolean;
|
|
574
|
-
filterable?: boolean;
|
|
575
|
-
templateType?: 'text' | 'badge' | 'date' | 'boolean' | 'custom';
|
|
576
|
-
}
|
|
577
|
-
/**
|
|
578
|
-
* Extra filter definition for user list
|
|
579
|
-
*/
|
|
580
|
-
interface IUserListFilter {
|
|
581
|
-
field: string;
|
|
582
|
-
label: string;
|
|
583
|
-
type: 'text' | 'dropdown' | 'multiselect' | 'date' | 'boolean';
|
|
584
|
-
options?: {
|
|
585
|
-
label: string;
|
|
586
|
-
value: string | number | boolean;
|
|
587
|
-
}[];
|
|
588
|
-
placeholder?: string;
|
|
589
|
-
}
|
|
590
|
-
/**
|
|
591
|
-
* User List Provider Interface - Allows apps to extend user list pages.
|
|
592
|
-
*/
|
|
593
|
-
interface IUserListProvider<T extends IUserListItem = IUserListItem> {
|
|
594
|
-
getExtraColumns?(): IUserListColumn[];
|
|
595
|
-
getExtraRowActions?(): IUserListAction<T>[];
|
|
596
|
-
getExtraToolbarActions?(): IUserListAction<T>[];
|
|
597
|
-
onRowAction?(actionId: string, user: T): void;
|
|
598
|
-
onToolbarAction?(actionId: string, selectedUsers: T[]): void;
|
|
599
|
-
enrichListData?(users: T[]): Observable<T[]>;
|
|
600
|
-
getExtraFilters?(): IUserListFilter[];
|
|
601
|
-
}
|
|
602
632
|
/**
|
|
603
633
|
* File Provider Interface - Provides file loading and upload functionality.
|
|
604
634
|
* Used by FileSelectorDialogComponent to load files and handle uploads.
|
|
@@ -647,19 +677,11 @@ declare class FileUrlService {
|
|
|
647
677
|
private readonly http;
|
|
648
678
|
private readonly appConfig;
|
|
649
679
|
private readonly _cache;
|
|
650
|
-
readonly cache: Signal<Map<string, FilesResponseDto>>;
|
|
651
|
-
/** Get file URL by ID from cache (synchronous) */
|
|
652
|
-
getFileUrl(fileId: string | null | undefined): string | null;
|
|
653
|
-
/** Get file URL as computed signal */
|
|
654
|
-
fileUrlSignal(fileId: string | null | undefined): Signal<string | null>;
|
|
680
|
+
readonly cache: _angular_core.Signal<Map<string, FilesResponseDto>>;
|
|
655
681
|
/** Fetch file URLs from backend and update cache */
|
|
656
682
|
fetchFileUrls(fileIds: string[], forceRefresh?: boolean): Observable<FilesResponseDto[]>;
|
|
657
683
|
/** Fetch single file URL (delegates to fetchFileUrls) */
|
|
658
684
|
fetchSingleFileUrl(fileId: string, forceRefresh?: boolean): Observable<FilesResponseDto | null>;
|
|
659
|
-
/** Clear entire cache */
|
|
660
|
-
clearCache(): void;
|
|
661
|
-
/** Remove specific file from cache */
|
|
662
|
-
removeFromCache(fileId: string): void;
|
|
663
685
|
private addToCache;
|
|
664
686
|
private getFromCache;
|
|
665
687
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileUrlService, never>;
|
|
@@ -681,6 +703,8 @@ declare class PermissionValidatorService {
|
|
|
681
703
|
clearPermissions(): void;
|
|
682
704
|
/** Check if user has permission (supports wildcards: '*', 'module.*') */
|
|
683
705
|
hasPermission(code: string): boolean;
|
|
706
|
+
/** Check if user has ANY of the specified permissions (OR logic) */
|
|
707
|
+
hasAnyPermission(code: string[]): boolean;
|
|
684
708
|
isPermissionsLoaded(): boolean;
|
|
685
709
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PermissionValidatorService, never>;
|
|
686
710
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PermissionValidatorService>;
|
|
@@ -693,6 +717,16 @@ declare class PlatformService {
|
|
|
693
717
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PlatformService>;
|
|
694
718
|
}
|
|
695
719
|
|
|
720
|
+
declare class TranslateService {
|
|
721
|
+
private readonly localizationState;
|
|
722
|
+
translate(key: string, params?: Record<string, string | unknown>): string;
|
|
723
|
+
translateSignal(key: string, params?: Record<string, string | number>): Signal<string>;
|
|
724
|
+
private getFromFallback;
|
|
725
|
+
private interpolate;
|
|
726
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TranslateService, never>;
|
|
727
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<TranslateService>;
|
|
728
|
+
}
|
|
729
|
+
|
|
696
730
|
declare class EditModeElementChangerDirective {
|
|
697
731
|
private readonly el;
|
|
698
732
|
private readonly ngControl;
|
|
@@ -803,14 +837,52 @@ declare class PreventDefaultDirective {
|
|
|
803
837
|
|
|
804
838
|
declare class TranslatePipe implements PipeTransform {
|
|
805
839
|
private readonly translateAdapter;
|
|
806
|
-
private readonly fallbackMessages;
|
|
807
840
|
transform(key: string | null | undefined, params?: Record<string, string | number> | null, fallback?: string): string;
|
|
808
|
-
private getFromFallback;
|
|
809
|
-
private interpolate;
|
|
810
841
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TranslatePipe, never>;
|
|
811
842
|
static ɵpipe: _angular_core.ɵɵPipeDeclaration<TranslatePipe, "translate", true>;
|
|
812
843
|
}
|
|
813
844
|
|
|
845
|
+
/**
|
|
846
|
+
* HTTP context token to skip global error toast.
|
|
847
|
+
* Use when component handles error display locally.
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* ```typescript
|
|
851
|
+
* this.http.post(url, data, {
|
|
852
|
+
* context: new HttpContext().set(SKIP_ERROR_TOAST, true)
|
|
853
|
+
* });
|
|
854
|
+
* ```
|
|
855
|
+
*/
|
|
856
|
+
declare const SKIP_ERROR_TOAST: HttpContextToken<boolean>;
|
|
857
|
+
/**
|
|
858
|
+
* Error Catching Interceptor
|
|
859
|
+
* Displays error messages for failed HTTP requests using backend response.
|
|
860
|
+
*
|
|
861
|
+
* Features:
|
|
862
|
+
* - Uses backend's error title (error.error.error) as summary
|
|
863
|
+
* - Uses backend's error message (error.error.message) as detail
|
|
864
|
+
* - Falls back to sensible defaults based on status code
|
|
865
|
+
* - Skip with SKIP_ERROR_TOAST context token for local handling
|
|
866
|
+
*
|
|
867
|
+
* NOTE: This interceptor only handles error display.
|
|
868
|
+
* For 401 handling and token refresh, use tokenRefreshInterceptor from @flusys/ng-auth.
|
|
869
|
+
*
|
|
870
|
+
* @example
|
|
871
|
+
* ```typescript
|
|
872
|
+
* // In app.config.ts
|
|
873
|
+
* provideHttpClient(
|
|
874
|
+
* withFetch(),
|
|
875
|
+
* withInterceptors([
|
|
876
|
+
* authInterceptor, // from @flusys/ng-auth
|
|
877
|
+
* tokenRefreshInterceptor, // from @flusys/ng-auth
|
|
878
|
+
* errorCatchingInterceptor, // from @flusys/ng-core
|
|
879
|
+
* apiLoaderInterceptor, // from @flusys/ng-core
|
|
880
|
+
* ])
|
|
881
|
+
* )
|
|
882
|
+
* ```
|
|
883
|
+
*/
|
|
884
|
+
declare function errorCatchingInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn): Observable<HttpEvent<unknown>>;
|
|
885
|
+
|
|
814
886
|
interface IResolverModuleConfig {
|
|
815
887
|
modules: string[];
|
|
816
888
|
fallbackMessages?: Record<string, string>;
|
|
@@ -829,7 +901,6 @@ declare class PrimeModule {
|
|
|
829
901
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<PrimeModule>;
|
|
830
902
|
}
|
|
831
903
|
|
|
832
|
-
type ServiceName = 'auth' | 'administration' | 'iam' | 'storage' | 'formBuilder' | 'email' | 'eventManager' | 'notification' | 'localization';
|
|
833
904
|
interface IApiService<DtoT, InterfaceT> {
|
|
834
905
|
insert(dto: DtoT): Promise<ISingleResponse<InterfaceT>>;
|
|
835
906
|
insertMany(dtos: DtoT[]): Promise<IBulkResponse<InterfaceT>>;
|
|
@@ -839,12 +910,13 @@ interface IApiService<DtoT, InterfaceT> {
|
|
|
839
910
|
getByFilter(filter: Record<string, unknown>): Promise<ISingleResponse<InterfaceT>>;
|
|
840
911
|
update(dto: DtoT): Promise<ISingleResponse<InterfaceT>>;
|
|
841
912
|
updateMany(dtos: DtoT[]): Promise<IBulkResponse<InterfaceT>>;
|
|
842
|
-
bulkUpsert(toInsert:
|
|
913
|
+
bulkUpsert(toInsert: DtoT[], toUpdate: DtoT[]): Promise<InterfaceT[]>;
|
|
843
914
|
delete(deleteDto: IDeleteData): Promise<IMessageResponse>;
|
|
844
915
|
}
|
|
845
916
|
declare abstract class ApiResourceService<DtoT, InterfaceT> implements IApiService<DtoT, InterfaceT> {
|
|
846
|
-
protected readonly baseUrl: string;
|
|
847
917
|
protected readonly http: HttpClient;
|
|
918
|
+
private readonly _config;
|
|
919
|
+
protected readonly baseUrl: string;
|
|
848
920
|
protected readonly moduleApiName: string;
|
|
849
921
|
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
850
922
|
readonly filterData: _angular_core.WritableSignal<IFilterData>;
|
|
@@ -857,97 +929,55 @@ declare abstract class ApiResourceService<DtoT, InterfaceT> implements IApiServi
|
|
|
857
929
|
readonly hasMore: _angular_core.Signal<boolean>;
|
|
858
930
|
readonly error: _angular_core.Signal<Error | undefined>;
|
|
859
931
|
readonly status: _angular_core.Signal<ResourceStatus>;
|
|
860
|
-
constructor(moduleApiName: string,
|
|
932
|
+
constructor(moduleApiName: string, serviceName?: ServiceName);
|
|
861
933
|
protected getHttpOptions(endpoint: string, params?: HttpParams): {
|
|
862
934
|
params?: HttpParams | undefined;
|
|
863
935
|
headers: HttpHeaders;
|
|
864
936
|
};
|
|
865
937
|
private _getAllObs;
|
|
938
|
+
private _activate;
|
|
866
939
|
fetchList(search?: string, filter?: Partial<IFilterData>): void;
|
|
867
940
|
setPagination(pagination: IPagination): void;
|
|
868
941
|
nextPage(): void;
|
|
869
942
|
resetPagination(): void;
|
|
870
943
|
reload(): void;
|
|
944
|
+
private _post;
|
|
871
945
|
insert(dto: DtoT): Promise<ISingleResponse<InterfaceT>>;
|
|
872
946
|
insertMany(dtos: DtoT[]): Promise<IBulkResponse<InterfaceT>>;
|
|
873
947
|
findById(id: string, select?: string[]): Promise<ISingleResponse<InterfaceT>>;
|
|
874
948
|
getAll(filter: IFilterData, search?: string): Promise<IListResponse<InterfaceT>>;
|
|
875
949
|
update(dto: DtoT): Promise<ISingleResponse<InterfaceT>>;
|
|
876
950
|
updateMany(dtos: DtoT[]): Promise<IBulkResponse<InterfaceT>>;
|
|
951
|
+
delete(deleteDto: IDeleteData): Promise<IMessageResponse>;
|
|
877
952
|
findByIds(ids: string[], select?: string[] | string): Promise<IListResponse<InterfaceT>>;
|
|
878
|
-
bulkUpsert(toInsert: Array<DtoT>, toUpdate: Array<DtoT>): Promise<Array<InterfaceT>>;
|
|
879
953
|
getByFilter(filter: Record<string, unknown>): Promise<ISingleResponse<InterfaceT>>;
|
|
880
|
-
|
|
954
|
+
bulkUpsert(toInsert: DtoT[], toUpdate: DtoT[]): Promise<InterfaceT[]>;
|
|
881
955
|
}
|
|
882
956
|
|
|
883
|
-
/**
|
|
884
|
-
* Base class for form controls that support ALL Angular form patterns:
|
|
885
|
-
*
|
|
886
|
-
* 1. **Template-driven forms:** `[(value)]="mySignal"` or `[(ngModel)]="myValue"`
|
|
887
|
-
* 2. **Reactive forms:** `[formControl]="ctrl"` or `formControlName="field"`
|
|
888
|
-
* 3. **Signal forms (Angular 21+):** `[formField]="formTree.field"`
|
|
889
|
-
*
|
|
890
|
-
* Implements both `ControlValueAccessor` (reactive forms) and `FormValueControl` (signal forms).
|
|
891
|
-
*
|
|
892
|
-
* @example
|
|
893
|
-
* ```typescript
|
|
894
|
-
* @Component({
|
|
895
|
-
* providers: [provideValueAccessor(MySelectComponent)]
|
|
896
|
-
* })
|
|
897
|
-
* export class MySelectComponent extends BaseFormControl<string | null> {
|
|
898
|
-
* override readonly value = model<string | null>(null);
|
|
899
|
-
*
|
|
900
|
-
* constructor() {
|
|
901
|
-
* super();
|
|
902
|
-
* this.initializeFormControl();
|
|
903
|
-
* }
|
|
904
|
-
* }
|
|
905
|
-
*
|
|
906
|
-
* // Usage:
|
|
907
|
-
* // Template-driven: <my-select [(value)]="selectedId" />
|
|
908
|
-
* // Reactive forms: <my-select [formControl]="myControl" />
|
|
909
|
-
* // Signal forms: <my-select [formField]="formTree.myField" />
|
|
910
|
-
* ```
|
|
911
|
-
*/
|
|
912
957
|
declare abstract class BaseFormControl<T> implements ControlValueAccessor, FormValueControl<T> {
|
|
913
958
|
protected readonly injector: Injector;
|
|
914
|
-
/**
|
|
915
|
-
* The value model - must be overridden in subclass with model<T>().
|
|
916
|
-
* This property satisfies both:
|
|
917
|
-
* - FormValueControl interface (signal forms)
|
|
918
|
-
* - Internal state for ControlValueAccessor (reactive forms)
|
|
919
|
-
*/
|
|
920
959
|
abstract readonly value: ReturnType<typeof model<T>>;
|
|
921
|
-
/**
|
|
922
|
-
* Disabled state model - bound to form control disabled state.
|
|
923
|
-
* Using model() to satisfy FormValueControl interface requirements.
|
|
924
|
-
*/
|
|
925
960
|
readonly disabled: _angular_core.ModelSignal<boolean>;
|
|
926
|
-
/**
|
|
927
|
-
* Touched state model - for validation styling.
|
|
928
|
-
* Using model() to satisfy FormValueControl interface requirements.
|
|
929
|
-
*/
|
|
930
961
|
readonly touched: _angular_core.ModelSignal<boolean>;
|
|
931
962
|
private onChange;
|
|
932
963
|
private onTouched;
|
|
933
|
-
private
|
|
964
|
+
private writeDepth;
|
|
934
965
|
/**
|
|
935
|
-
*
|
|
936
|
-
*
|
|
966
|
+
* Wire up the ControlValueAccessor ↔ signal bridge.
|
|
967
|
+
* Call once at the end of the subclass constructor.
|
|
968
|
+
*
|
|
969
|
+
* Signal-form consumers ([formField]) don't need this — Angular's
|
|
970
|
+
* FormField directive binds directly to `value`.
|
|
937
971
|
*
|
|
938
|
-
*
|
|
939
|
-
*
|
|
972
|
+
* @example
|
|
973
|
+
* constructor() { super(); this.initializeFormControl(); }
|
|
940
974
|
*/
|
|
941
975
|
protected initializeFormControl(): void;
|
|
942
|
-
/** ControlValueAccessor: Write value from form control to signal */
|
|
943
976
|
writeValue(value: T): void;
|
|
944
|
-
/** ControlValueAccessor: Register change callback */
|
|
945
977
|
registerOnChange(fn: (value: T) => void): void;
|
|
946
|
-
/** ControlValueAccessor: Register touched callback */
|
|
947
978
|
registerOnTouched(fn: () => void): void;
|
|
948
|
-
/** ControlValueAccessor: Set disabled state from form control */
|
|
949
979
|
setDisabledState(isDisabled: boolean): void;
|
|
950
|
-
/**
|
|
980
|
+
/** Call on blur / panel-close to propagate touched state. */
|
|
951
981
|
protected markAsTouched(): void;
|
|
952
982
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<BaseFormControl<any>, never>;
|
|
953
983
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<BaseFormControl<any>, never, never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "touched": "touchedChange"; }, never, never, true, never>;
|
|
@@ -1189,7 +1219,7 @@ declare abstract class BaseUserSelectComponent {
|
|
|
1189
1219
|
protected readonly destroyRef: DestroyRef;
|
|
1190
1220
|
protected readonly injector: Injector;
|
|
1191
1221
|
protected readonly userProvider: IUserProvider;
|
|
1192
|
-
protected readonly translateAdapter:
|
|
1222
|
+
protected readonly translateAdapter: TranslateService;
|
|
1193
1223
|
protected abortController: AbortController | null;
|
|
1194
1224
|
readonly loadUsers: _angular_core.InputSignal<LoadUsersFn | undefined>;
|
|
1195
1225
|
readonly placeHolder: _angular_core.InputSignal<string>;
|
|
@@ -1480,7 +1510,7 @@ declare abstract class BaseFormPage<T, TFormModel> {
|
|
|
1480
1510
|
protected readonly route: ActivatedRoute;
|
|
1481
1511
|
protected readonly messageService: MessageService;
|
|
1482
1512
|
protected readonly destroyRef: DestroyRef;
|
|
1483
|
-
protected readonly translateAdapter:
|
|
1513
|
+
protected readonly translateAdapter: TranslateService | null;
|
|
1484
1514
|
protected readonly routeParams: Signal<i3.ParamMap | undefined>;
|
|
1485
1515
|
protected initialized: boolean;
|
|
1486
1516
|
/** Loading state for async operations */
|
|
@@ -1590,7 +1620,7 @@ declare abstract class BaseListPage<T> {
|
|
|
1590
1620
|
protected readonly appConfig: _flusys_ng_core.IAppConfig;
|
|
1591
1621
|
protected readonly confirmationService: ConfirmationService;
|
|
1592
1622
|
protected readonly destroyRef: DestroyRef;
|
|
1593
|
-
protected readonly translateAdapter:
|
|
1623
|
+
protected readonly translateAdapter: TranslateService | null;
|
|
1594
1624
|
/** Items list */
|
|
1595
1625
|
readonly items: _angular_core.WritableSignal<T[]>;
|
|
1596
1626
|
/** Loading state */
|
|
@@ -1752,5 +1782,5 @@ interface ScrollPaginationConfig {
|
|
|
1752
1782
|
*/
|
|
1753
1783
|
declare function checkScrollPagination(event: Event, config: ScrollPaginationConfig): IPagination | null;
|
|
1754
1784
|
|
|
1755
|
-
export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormControl, BaseFormPage, BaseListPage, BaseUserSelectComponent, COMPANY_ACTION_PERMISSIONS, COMPANY_API_PROVIDER, COMPANY_PERMISSIONS, CookieService, EMAIL_CONFIG_PERMISSIONS, EMAIL_TEMPLATE_PERMISSIONS,
|
|
1756
|
-
export type {
|
|
1785
|
+
export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormControl, BaseFormPage, BaseListPage, BaseUserSelectComponent, COMPANY_ACTION_PERMISSIONS, COMPANY_API_PROVIDER, COMPANY_PERMISSIONS, CookieService, EMAIL_CONFIG_PERMISSIONS, EMAIL_TEMPLATE_PERMISSIONS, EVENT_PERMISSIONS, EditModeElementChangerDirective, FILE_PERMISSIONS, FILE_PROVIDER, FILE_TYPE_FILTERS, FOLDER_PERMISSIONS, FORM_PERMISSIONS, FORM_RESULT_PERMISSIONS, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, IsEmptyImageDirective, LANGUAGE_PERMISSIONS, LazyMultiSelectComponent, LazySelectComponent, NOTIFICATION_PERMISSIONS, PERMISSIONS, PROFILE_PERMISSION_PROVIDER, PermissionValidatorService, PlatformService, PreventDefaultDirective, PrimeModule, ROLE_ACTION_PERMISSIONS, ROLE_PERMISSIONS, SHARED_MESSAGES, SKIP_ERROR_TOAST, STORAGE_CONFIG_PERMISSIONS, TRANSLATION_KEY_PERMISSIONS, TRANSLATION_PERMISSIONS, TranslatePipe, TranslateService, UPLOAD_CONFIG_PERMISSIONS, USER_ACTION_PERMISSIONS, USER_PERMISSIONS, USER_PERMISSION_PROVIDER, USER_PROVIDER, USER_ROLE_PERMISSIONS, UserMultiSelectComponent, UserSelectComponent, allPermissionsGuard, anyPermissionGuard, checkScrollPagination, errorCatchingInterceptor, evaluateLogicNode, evaluatePermission, formatFileSize, formatInTimezone, getAcceptString, getFileIconClass, getUserTimezone, hasAllPermissions, hasAnyPermission, hasPermission, isFileTypeAllowed, localToUtc, permissionGuard, provideValueAccessor, resolveTranslationModule, utcToLocal };
|
|
1786
|
+
export type { DeleteType, FilesResponseDto, IActionNode, IActivatable, IApiService, IAuthStateProvider, IBaseEntity, IBulkMeta, IBulkResponse, ICompanyApiProvider, ICompanyBasicInfo, IDeleteData, IDropDown, IFileBasicInfo, IFileProvider, IFileSelectFilter, IFileUploadOptions, IFilter, IFilterData, IFolderBasicInfo, IGroupNode, IListResponse, ILoggedUserInfo, ILogicNode, IMessageResponse, IOrderable, IPagination, IPaginationMeta, IProfileActionInfo, IProfilePermissionProvider, IProfileRoleInfo, IRequestMeta, IResolverModuleConfig, ISelectFilter, ISingleResponse, ISoftDeletable, ISort, IStorageConfigBasicInfo, ITimestampable, IUploadedFile, IUserBasicInfo, IUserBranchPermission, IUserPermissionProvider, IUserProvider, IUserSelectFilter, LoadUsersFn, PermissionCode, ScrollPaginationConfig, UploadFileFn, UploadMultipleFilesFn };
|