@flusys/ng-shared 0.1.0-beta.2 → 1.0.0-beta
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 +1 -2
- package/fesm2022/flusys-ng-shared.mjs +1407 -117
- package/fesm2022/flusys-ng-shared.mjs.map +1 -1
- package/package.json +2 -2
- package/types/flusys-ng-shared.d.ts +441 -19
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flusys/ng-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-beta",
|
|
4
4
|
"description": "Shared components and utilities for FLUSYS Angular packages",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"@angular/common": "^21.0.0",
|
|
8
8
|
"@angular/core": "^21.0.0",
|
|
9
9
|
"@angular/forms": "^21.0.0",
|
|
10
|
-
"@flusys/ng-core": "^
|
|
10
|
+
"@flusys/ng-core": "^1.0.0-beta",
|
|
11
11
|
"@primeuix/themes": "^1.0.0",
|
|
12
12
|
"primeicons": "^7.0.0",
|
|
13
13
|
"primeng": "^21.0.0"
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Observable } from 'rxjs';
|
|
2
1
|
import * as _angular_core from '@angular/core';
|
|
3
|
-
import {
|
|
2
|
+
import { Signal, Injector, ResourceRef, model, ElementRef, InjectionToken } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
4
|
import * as i1 from '@angular/common';
|
|
5
|
-
import * as i2 from '@angular/
|
|
6
|
-
import { CanActivateFn } from '@angular/router';
|
|
7
|
-
import * as i5 from '@angular/forms';
|
|
5
|
+
import * as i2 from '@angular/forms';
|
|
8
6
|
import { ControlValueAccessor } from '@angular/forms';
|
|
7
|
+
import * as i3 from '@angular/router';
|
|
8
|
+
import { CanActivateFn } from '@angular/router';
|
|
9
9
|
import * as i1$1 from 'primeng/inputtext';
|
|
10
10
|
import * as i2$1 from 'primeng/tag';
|
|
11
|
-
import * as i3 from 'primeng/selectbutton';
|
|
11
|
+
import * as i3$1 from 'primeng/selectbutton';
|
|
12
12
|
import * as i4 from 'primeng/password';
|
|
13
|
-
import * as i5
|
|
13
|
+
import * as i5 from 'primeng/button';
|
|
14
14
|
import * as i6 from 'primeng/tooltip';
|
|
15
15
|
import * as i7 from 'primeng/checkbox';
|
|
16
16
|
import { CheckboxChangeEvent } from 'primeng/checkbox';
|
|
@@ -45,6 +45,43 @@ import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
|
45
45
|
import { ApiLoaderService } from '@flusys/ng-core';
|
|
46
46
|
import { FormValueControl } from '@angular/forms/signals';
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Auth State Provider Interface
|
|
50
|
+
*
|
|
51
|
+
* Abstracts auth state access for feature packages (form-builder, etc.)
|
|
52
|
+
* that need to check authentication status without depending on ng-auth directly.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* // In form-builder component
|
|
56
|
+
* class PublicFormPageComponent {
|
|
57
|
+
* private readonly authStateProvider = inject(AUTH_STATE_PROVIDER);
|
|
58
|
+
*
|
|
59
|
+
* ngOnInit() {
|
|
60
|
+
* this.authStateProvider.initialize().subscribe({
|
|
61
|
+
* next: () => this.checkFormAccess(),
|
|
62
|
+
* error: () => this.checkFormAccess(),
|
|
63
|
+
* });
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* checkAccess() {
|
|
67
|
+
* if (this.authStateProvider.isAuthenticated()) {
|
|
68
|
+
* // User is logged in
|
|
69
|
+
* }
|
|
70
|
+
* }
|
|
71
|
+
* }
|
|
72
|
+
*/
|
|
73
|
+
interface IAuthStateProvider {
|
|
74
|
+
/**
|
|
75
|
+
* Signal indicating if user is currently authenticated
|
|
76
|
+
*/
|
|
77
|
+
isAuthenticated: Signal<boolean>;
|
|
78
|
+
/**
|
|
79
|
+
* Initialize auth state (restore session from cookies/storage)
|
|
80
|
+
* Call this before checking isAuthenticated for users returning after login
|
|
81
|
+
*/
|
|
82
|
+
initialize(): Observable<void>;
|
|
83
|
+
}
|
|
84
|
+
|
|
48
85
|
/**
|
|
49
86
|
* Base entity interface - matches backend Identity entity
|
|
50
87
|
*/
|
|
@@ -385,6 +422,96 @@ interface IUserProvider {
|
|
|
385
422
|
}): Observable<IListResponse<IUserBasicInfo>>;
|
|
386
423
|
}
|
|
387
424
|
|
|
425
|
+
/** Filter params passed to loadUsers function */
|
|
426
|
+
interface IUserSelectFilter {
|
|
427
|
+
page: number;
|
|
428
|
+
pageSize: number;
|
|
429
|
+
search: string;
|
|
430
|
+
[key: string]: unknown;
|
|
431
|
+
}
|
|
432
|
+
/** Function type for loading users */
|
|
433
|
+
type LoadUsersFn = (filter: IUserSelectFilter) => Observable<IListResponse<IUserBasicInfo>>;
|
|
434
|
+
|
|
435
|
+
/**
|
|
436
|
+
* Basic file info for selectors and displays
|
|
437
|
+
*/
|
|
438
|
+
interface IFileBasicInfo {
|
|
439
|
+
id: string;
|
|
440
|
+
name: string;
|
|
441
|
+
contentType: string;
|
|
442
|
+
size: string;
|
|
443
|
+
url: string | null;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Upload options for file uploader
|
|
447
|
+
*/
|
|
448
|
+
interface IFileUploadOptions {
|
|
449
|
+
storageConfigId?: string;
|
|
450
|
+
folderPath?: string;
|
|
451
|
+
maxWidth?: number;
|
|
452
|
+
maxHeight?: number;
|
|
453
|
+
quality?: number;
|
|
454
|
+
compress?: boolean;
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Uploaded file response
|
|
458
|
+
*/
|
|
459
|
+
interface IUploadedFile {
|
|
460
|
+
name: string;
|
|
461
|
+
key: string;
|
|
462
|
+
size: number;
|
|
463
|
+
contentType: string;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Filter params for file selector
|
|
467
|
+
*/
|
|
468
|
+
interface IFileSelectFilter {
|
|
469
|
+
page: number;
|
|
470
|
+
pageSize: number;
|
|
471
|
+
search: string;
|
|
472
|
+
contentTypes?: string[];
|
|
473
|
+
folderId?: string;
|
|
474
|
+
[key: string]: unknown;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Function type for loading files
|
|
478
|
+
*/
|
|
479
|
+
type LoadFilesFn = (filter: IFileSelectFilter) => Observable<IListResponse<IFileBasicInfo>>;
|
|
480
|
+
/**
|
|
481
|
+
* Function type for uploading a file
|
|
482
|
+
*/
|
|
483
|
+
type UploadFileFn = (file: File, options?: IFileUploadOptions) => Observable<ISingleResponse<IUploadedFile>>;
|
|
484
|
+
/**
|
|
485
|
+
* Function type for getting file URLs (presigned URL refresh)
|
|
486
|
+
*/
|
|
487
|
+
type GetFileUrlsFn = (fileIds: string[]) => Observable<ISingleResponse<IFileBasicInfo[]>>;
|
|
488
|
+
/**
|
|
489
|
+
* Common file type filters
|
|
490
|
+
*/
|
|
491
|
+
declare const FILE_TYPE_FILTERS: {
|
|
492
|
+
readonly IMAGES: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"];
|
|
493
|
+
readonly DOCUMENTS: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"];
|
|
494
|
+
readonly VIDEOS: readonly ["video/mp4", "video/webm", "video/ogg", "video/quicktime"];
|
|
495
|
+
readonly AUDIO: readonly ["audio/mpeg", "audio/wav", "audio/ogg", "audio/webm"];
|
|
496
|
+
readonly ALL: string[];
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* Get accept string for file input from content types
|
|
500
|
+
*/
|
|
501
|
+
declare function getAcceptString(contentTypes: string[]): string;
|
|
502
|
+
/**
|
|
503
|
+
* Check if file matches allowed content types
|
|
504
|
+
*/
|
|
505
|
+
declare function isFileTypeAllowed(file: File, allowedTypes: string[]): boolean;
|
|
506
|
+
/**
|
|
507
|
+
* Get file icon class based on content type
|
|
508
|
+
*/
|
|
509
|
+
declare function getFileIconClass(contentType: string): string;
|
|
510
|
+
/**
|
|
511
|
+
* Format file size for display
|
|
512
|
+
*/
|
|
513
|
+
declare function formatFileSize(sizeInKb: string | number): string;
|
|
514
|
+
|
|
388
515
|
declare enum ContactTypeEnum {
|
|
389
516
|
PHONE = 1,
|
|
390
517
|
EMAIL = 2
|
|
@@ -539,12 +666,11 @@ declare class PlatformService {
|
|
|
539
666
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<PlatformService>;
|
|
540
667
|
}
|
|
541
668
|
|
|
542
|
-
declare class EditModeElementChangerDirective
|
|
543
|
-
private el;
|
|
544
|
-
private ngControl;
|
|
669
|
+
declare class EditModeElementChangerDirective {
|
|
670
|
+
private readonly el;
|
|
671
|
+
private readonly ngControl;
|
|
545
672
|
readonly isEditMode: _angular_core.InputSignal<boolean>;
|
|
546
673
|
constructor();
|
|
547
|
-
ngAfterViewInit(): void;
|
|
548
674
|
private updateControl;
|
|
549
675
|
private updateElement;
|
|
550
676
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EditModeElementChangerDirective, never>;
|
|
@@ -652,13 +778,13 @@ declare class PreventDefaultDirective {
|
|
|
652
778
|
|
|
653
779
|
declare class AngularModule {
|
|
654
780
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AngularModule, never>;
|
|
655
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AngularModule, never, [typeof i1.CommonModule, typeof i2.
|
|
781
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<AngularModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.RouterOutlet, typeof i3.RouterLink, typeof IsEmptyImageDirective, typeof i1.NgOptimizedImage, typeof i1.NgComponentOutlet, typeof PreventDefaultDirective], [typeof i1.CommonModule, typeof i2.FormsModule, typeof i2.ReactiveFormsModule, typeof i3.RouterOutlet, typeof i3.RouterLink, typeof IsEmptyImageDirective, typeof i1.NgOptimizedImage, typeof i1.NgComponentOutlet, typeof PreventDefaultDirective]>;
|
|
656
782
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<AngularModule>;
|
|
657
783
|
}
|
|
658
784
|
|
|
659
785
|
declare class PrimeModule {
|
|
660
786
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PrimeModule, never>;
|
|
661
|
-
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<PrimeModule, never, never, [typeof i1$1.InputTextModule, typeof i2$1.TagModule, typeof i3.SelectButtonModule, typeof i4.PasswordModule, typeof i5
|
|
787
|
+
static ɵmod: _angular_core.ɵɵNgModuleDeclaration<PrimeModule, never, never, [typeof i1$1.InputTextModule, typeof i2$1.TagModule, typeof i3$1.SelectButtonModule, typeof i4.PasswordModule, typeof i5.ButtonModule, typeof i6.TooltipModule, typeof i7.CheckboxModule, typeof i8.StepsModule, typeof i9.RippleModule, typeof i10.PanelModule, typeof i11.PaginatorModule, typeof i12.TableModule, typeof i13.InputNumberModule, typeof i14.TextareaModule, typeof i15.ProgressBarModule, typeof i16.FileUploadModule, typeof i17.CardModule, typeof i18.SelectModule, typeof i19.InputIconModule, typeof i20.IconFieldModule, typeof i21.PopoverModule, typeof i22.ListboxModule, typeof i23.RadioButtonModule, typeof i24.ToggleSwitchModule, typeof i25.ImageModule, typeof i26.DatePickerModule, typeof i27.SplitButtonModule, typeof i28.DividerModule, typeof i29.MultiSelectModule, typeof i30.AutoCompleteModule, typeof i31.TabsModule, typeof i32.DialogModule, typeof i33.TreeTableModule]>;
|
|
662
788
|
static ɵinj: _angular_core.ɵɵInjectorDeclaration<PrimeModule>;
|
|
663
789
|
}
|
|
664
790
|
|
|
@@ -729,14 +855,28 @@ interface IApiService<DtoT, InterfaceT> {
|
|
|
729
855
|
declare abstract class ApiResourceService<DtoT, InterfaceT> implements IApiService<DtoT, InterfaceT> {
|
|
730
856
|
protected readonly baseUrl: string;
|
|
731
857
|
protected readonly loaderService: ApiLoaderService;
|
|
858
|
+
protected readonly injector: Injector;
|
|
732
859
|
protected readonly http: HttpClient;
|
|
733
860
|
protected readonly moduleApiName: string;
|
|
734
861
|
/** Current search term */
|
|
735
862
|
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
736
863
|
/** Current filter and pagination state */
|
|
737
864
|
readonly filterData: _angular_core.WritableSignal<IFilterData>;
|
|
738
|
-
/**
|
|
739
|
-
|
|
865
|
+
/**
|
|
866
|
+
* Resource for list data - lazy initialized to prevent auto-fetch on service injection.
|
|
867
|
+
* Call initListResource() or any list method (fetchList, reload, etc.) to initialize.
|
|
868
|
+
*/
|
|
869
|
+
private _listResource;
|
|
870
|
+
/** Whether the list resource has been initialized */
|
|
871
|
+
private _resourceInitialized;
|
|
872
|
+
/** Get or create the list resource (lazy initialization) */
|
|
873
|
+
get listResource(): ResourceRef<IListResponse<InterfaceT> | undefined>;
|
|
874
|
+
/**
|
|
875
|
+
* Initialize the list resource. Called automatically when accessing listResource
|
|
876
|
+
* or any list-related computed signals/methods.
|
|
877
|
+
* Uses runInInjectionContext to support lazy initialization outside constructor.
|
|
878
|
+
*/
|
|
879
|
+
initListResource(): void;
|
|
740
880
|
/** Whether data is currently loading */
|
|
741
881
|
readonly isLoading: _angular_core.Signal<boolean>;
|
|
742
882
|
/** List data array */
|
|
@@ -753,7 +893,7 @@ declare abstract class ApiResourceService<DtoT, InterfaceT> implements IApiServi
|
|
|
753
893
|
headers: HttpHeaders;
|
|
754
894
|
};
|
|
755
895
|
/**
|
|
756
|
-
* Fetch list data (triggers resource reload)
|
|
896
|
+
* Fetch list data (triggers resource initialization and reload)
|
|
757
897
|
*/
|
|
758
898
|
fetchList(search?: string, filter?: Partial<IFilterData>): void;
|
|
759
899
|
/**
|
|
@@ -944,7 +1084,6 @@ declare class LazyMultiSelectComponent extends BaseFormControl<string[] | null>
|
|
|
944
1084
|
/** Computed: Whether all items are selected (replaces isSelectAll signal) */
|
|
945
1085
|
readonly isSelectAll: _angular_core.Signal<boolean>;
|
|
946
1086
|
constructor();
|
|
947
|
-
scrollTargetEl: HTMLElement | null;
|
|
948
1087
|
private readonly onScrollBound;
|
|
949
1088
|
readonly multiScrollContainer: _angular_core.Signal<ElementRef<HTMLDivElement>>;
|
|
950
1089
|
onScroll(event: Event): void;
|
|
@@ -996,6 +1135,283 @@ declare class LazySelectComponent extends BaseFormControl<string | null> {
|
|
|
996
1135
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<LazySelectComponent, "lib-lazy-select", never, { "placeHolder": { "alias": "placeHolder"; "required": false; "isSignal": true; }; "optionLabel": { "alias": "optionLabel"; "required": true; "isSignal": true; }; "optionValue": { "alias": "optionValue"; "required": true; "isSignal": true; }; "isEditMode": { "alias": "isEditMode"; "required": true; "isSignal": true; }; "isLoading": { "alias": "isLoading"; "required": true; "isSignal": true; }; "total": { "alias": "total"; "required": true; "isSignal": true; }; "pagination": { "alias": "pagination"; "required": true; "isSignal": true; }; "selectDataList": { "alias": "selectDataList"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "onSearch": "onSearch"; "onPagination": "onPagination"; }, never, never, true, never>;
|
|
997
1136
|
}
|
|
998
1137
|
|
|
1138
|
+
/**
|
|
1139
|
+
* User Select Component - Single user selection with lazy loading.
|
|
1140
|
+
*
|
|
1141
|
+
* Uses USER_PROVIDER internally by default, or accepts custom `loadUsers` function.
|
|
1142
|
+
*
|
|
1143
|
+
* Features:
|
|
1144
|
+
* - Search with debouncing (handled by lazy-select)
|
|
1145
|
+
* - Infinite scroll pagination
|
|
1146
|
+
* - Filter active users by default (configurable)
|
|
1147
|
+
* - Supports additional filters via `additionalFilters` input
|
|
1148
|
+
*
|
|
1149
|
+
* @example
|
|
1150
|
+
* ```html
|
|
1151
|
+
* <!-- Simple usage - uses USER_PROVIDER internally -->
|
|
1152
|
+
* <lib-user-select
|
|
1153
|
+
* [(value)]="selectedUserId"
|
|
1154
|
+
* [isEditMode]="true"
|
|
1155
|
+
* />
|
|
1156
|
+
*
|
|
1157
|
+
* <!-- With custom loadUsers function -->
|
|
1158
|
+
* <lib-user-select
|
|
1159
|
+
* [(value)]="selectedUserId"
|
|
1160
|
+
* [isEditMode]="true"
|
|
1161
|
+
* [loadUsers]="customLoadUsers"
|
|
1162
|
+
* />
|
|
1163
|
+
* ```
|
|
1164
|
+
*/
|
|
1165
|
+
declare class UserSelectComponent {
|
|
1166
|
+
private readonly destroyRef;
|
|
1167
|
+
private readonly userProvider;
|
|
1168
|
+
private abortController;
|
|
1169
|
+
readonly loadUsers: _angular_core.InputSignal<LoadUsersFn | undefined>;
|
|
1170
|
+
readonly placeHolder: _angular_core.InputSignal<string>;
|
|
1171
|
+
readonly isEditMode: _angular_core.InputSignal<boolean>;
|
|
1172
|
+
readonly filterActive: _angular_core.InputSignal<boolean>;
|
|
1173
|
+
readonly additionalFilters: _angular_core.InputSignal<Record<string, unknown>>;
|
|
1174
|
+
readonly pageSize: _angular_core.InputSignal<number>;
|
|
1175
|
+
readonly value: _angular_core.ModelSignal<string | null>;
|
|
1176
|
+
readonly userSelected: _angular_core.OutputEmitterRef<IUserBasicInfo | null>;
|
|
1177
|
+
readonly onError: _angular_core.OutputEmitterRef<Error>;
|
|
1178
|
+
readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
1179
|
+
readonly users: _angular_core.WritableSignal<IUserBasicInfo[]>;
|
|
1180
|
+
readonly total: _angular_core.WritableSignal<number | undefined>;
|
|
1181
|
+
readonly pagination: _angular_core.WritableSignal<IPagination>;
|
|
1182
|
+
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
1183
|
+
readonly dropdownUsers: _angular_core.Signal<IDropDown[]>;
|
|
1184
|
+
constructor();
|
|
1185
|
+
handleSearch(search: string): void;
|
|
1186
|
+
handlePagination(pagination: IPagination): void;
|
|
1187
|
+
private fetchUsers;
|
|
1188
|
+
/** Load users from USER_PROVIDER with active filter */
|
|
1189
|
+
private loadUsersFromProvider;
|
|
1190
|
+
/** Reload users (useful when filters change externally) */
|
|
1191
|
+
reload(): void;
|
|
1192
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserSelectComponent, never>;
|
|
1193
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserSelectComponent, "lib-user-select", never, { "loadUsers": { "alias": "loadUsers"; "required": false; "isSignal": true; }; "placeHolder": { "alias": "placeHolder"; "required": false; "isSignal": true; }; "isEditMode": { "alias": "isEditMode"; "required": true; "isSignal": true; }; "filterActive": { "alias": "filterActive"; "required": false; "isSignal": true; }; "additionalFilters": { "alias": "additionalFilters"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "userSelected": "userSelected"; "onError": "onError"; }, never, never, true, never>;
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
/**
|
|
1197
|
+
* User Multi-Select Component - Multiple user selection with lazy loading.
|
|
1198
|
+
*
|
|
1199
|
+
* Uses USER_PROVIDER internally by default, or accepts custom `loadUsers` function.
|
|
1200
|
+
*
|
|
1201
|
+
* Features:
|
|
1202
|
+
* - Search with debouncing (handled by lazy-multi-select)
|
|
1203
|
+
* - Infinite scroll pagination
|
|
1204
|
+
* - Select all / deselect all
|
|
1205
|
+
* - Filter active users by default (configurable)
|
|
1206
|
+
* - Supports additional filters via `additionalFilters` input
|
|
1207
|
+
*
|
|
1208
|
+
* @example
|
|
1209
|
+
* ```html
|
|
1210
|
+
* <!-- Simple usage - uses USER_PROVIDER internally -->
|
|
1211
|
+
* <lib-user-multi-select
|
|
1212
|
+
* [(value)]="selectedUserIds"
|
|
1213
|
+
* [isEditMode]="true"
|
|
1214
|
+
* />
|
|
1215
|
+
*
|
|
1216
|
+
* <!-- With custom loadUsers function -->
|
|
1217
|
+
* <lib-user-multi-select
|
|
1218
|
+
* [(value)]="selectedUserIds"
|
|
1219
|
+
* [isEditMode]="true"
|
|
1220
|
+
* [loadUsers]="customLoadUsers"
|
|
1221
|
+
* />
|
|
1222
|
+
* ```
|
|
1223
|
+
*/
|
|
1224
|
+
declare class UserMultiSelectComponent {
|
|
1225
|
+
private readonly destroyRef;
|
|
1226
|
+
private readonly userProvider;
|
|
1227
|
+
private abortController;
|
|
1228
|
+
readonly loadUsers: _angular_core.InputSignal<LoadUsersFn | undefined>;
|
|
1229
|
+
readonly placeHolder: _angular_core.InputSignal<string>;
|
|
1230
|
+
readonly isEditMode: _angular_core.InputSignal<boolean>;
|
|
1231
|
+
readonly filterActive: _angular_core.InputSignal<boolean>;
|
|
1232
|
+
readonly additionalFilters: _angular_core.InputSignal<Record<string, unknown>>;
|
|
1233
|
+
readonly pageSize: _angular_core.InputSignal<number>;
|
|
1234
|
+
readonly value: _angular_core.ModelSignal<string[] | null>;
|
|
1235
|
+
readonly usersSelected: _angular_core.OutputEmitterRef<IUserBasicInfo[]>;
|
|
1236
|
+
readonly onError: _angular_core.OutputEmitterRef<Error>;
|
|
1237
|
+
readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
1238
|
+
readonly users: _angular_core.WritableSignal<IUserBasicInfo[]>;
|
|
1239
|
+
readonly total: _angular_core.WritableSignal<number | undefined>;
|
|
1240
|
+
readonly pagination: _angular_core.WritableSignal<IPagination>;
|
|
1241
|
+
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
1242
|
+
readonly dropdownUsers: _angular_core.Signal<IDropDown[]>;
|
|
1243
|
+
constructor();
|
|
1244
|
+
handleSearch(search: string): void;
|
|
1245
|
+
handlePagination(pagination: IPagination): void;
|
|
1246
|
+
private fetchUsers;
|
|
1247
|
+
/** Load users from USER_PROVIDER with active filter */
|
|
1248
|
+
private loadUsersFromProvider;
|
|
1249
|
+
/** Reload users (useful when filters change externally) */
|
|
1250
|
+
reload(): void;
|
|
1251
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UserMultiSelectComponent, never>;
|
|
1252
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UserMultiSelectComponent, "lib-user-multi-select", never, { "loadUsers": { "alias": "loadUsers"; "required": false; "isSignal": true; }; "placeHolder": { "alias": "placeHolder"; "required": false; "isSignal": true; }; "isEditMode": { "alias": "isEditMode"; "required": true; "isSignal": true; }; "filterActive": { "alias": "filterActive"; "required": false; "isSignal": true; }; "additionalFilters": { "alias": "additionalFilters"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "usersSelected": "usersSelected"; "onError": "onError"; }, never, never, true, never>;
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
/**
|
|
1256
|
+
* File Uploader Component - Drag & drop file upload with type filtering.
|
|
1257
|
+
*
|
|
1258
|
+
* Pass your own `uploadFile` function - works with any storage API.
|
|
1259
|
+
*
|
|
1260
|
+
* Features:
|
|
1261
|
+
* - Drag & drop support
|
|
1262
|
+
* - File type filtering (images, documents, etc.)
|
|
1263
|
+
* - Upload progress indication
|
|
1264
|
+
* - Multiple file support (optional)
|
|
1265
|
+
* - Image compression options
|
|
1266
|
+
*
|
|
1267
|
+
* @example
|
|
1268
|
+
* ```typescript
|
|
1269
|
+
* // In component
|
|
1270
|
+
* readonly uploadService = inject(UploadService);
|
|
1271
|
+
*
|
|
1272
|
+
* readonly uploadFile: UploadFileFn = (file, options) =>
|
|
1273
|
+
* this.uploadService.uploadSingleFile(file, options);
|
|
1274
|
+
* ```
|
|
1275
|
+
*
|
|
1276
|
+
* ```html
|
|
1277
|
+
* <!-- Single image upload -->
|
|
1278
|
+
* <lib-file-uploader
|
|
1279
|
+
* [uploadFile]="uploadFile"
|
|
1280
|
+
* [acceptTypes]="['image/*']"
|
|
1281
|
+
* [multiple]="false"
|
|
1282
|
+
* (fileUploaded)="onFileUploaded($event)"
|
|
1283
|
+
* />
|
|
1284
|
+
*
|
|
1285
|
+
* <!-- Multiple document upload -->
|
|
1286
|
+
* <lib-file-uploader
|
|
1287
|
+
* [uploadFile]="uploadFile"
|
|
1288
|
+
* [acceptTypes]="FILE_TYPE_FILTERS.DOCUMENTS"
|
|
1289
|
+
* [multiple]="true"
|
|
1290
|
+
* [maxFiles]="5"
|
|
1291
|
+
* (filesUploaded)="onFilesUploaded($event)"
|
|
1292
|
+
* />
|
|
1293
|
+
* ```
|
|
1294
|
+
*/
|
|
1295
|
+
declare class FileUploaderComponent {
|
|
1296
|
+
private readonly messageService;
|
|
1297
|
+
readonly uploadFile: _angular_core.InputSignal<UploadFileFn>;
|
|
1298
|
+
readonly acceptTypes: _angular_core.InputSignal<string[]>;
|
|
1299
|
+
readonly multiple: _angular_core.InputSignal<boolean>;
|
|
1300
|
+
readonly maxFiles: _angular_core.InputSignal<number>;
|
|
1301
|
+
readonly maxSizeMb: _angular_core.InputSignal<number>;
|
|
1302
|
+
readonly uploadOptions: _angular_core.InputSignal<IFileUploadOptions>;
|
|
1303
|
+
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
1304
|
+
readonly showPreview: _angular_core.InputSignal<boolean>;
|
|
1305
|
+
readonly autoUpload: _angular_core.InputSignal<boolean>;
|
|
1306
|
+
readonly fileUploaded: _angular_core.OutputEmitterRef<IUploadedFile>;
|
|
1307
|
+
readonly filesUploaded: _angular_core.OutputEmitterRef<IUploadedFile[]>;
|
|
1308
|
+
readonly onError: _angular_core.OutputEmitterRef<Error>;
|
|
1309
|
+
readonly fileSelected: _angular_core.OutputEmitterRef<File[]>;
|
|
1310
|
+
readonly isUploading: _angular_core.WritableSignal<boolean>;
|
|
1311
|
+
readonly isDragOver: _angular_core.WritableSignal<boolean>;
|
|
1312
|
+
readonly uploadProgress: _angular_core.WritableSignal<number>;
|
|
1313
|
+
readonly uploadingFileName: _angular_core.WritableSignal<string>;
|
|
1314
|
+
readonly selectedFiles: _angular_core.WritableSignal<File[]>;
|
|
1315
|
+
readonly acceptString: _angular_core.Signal<string>;
|
|
1316
|
+
readonly acceptTypesDisplay: _angular_core.Signal<string>;
|
|
1317
|
+
onDragOver(event: DragEvent): void;
|
|
1318
|
+
onDragLeave(event: DragEvent): void;
|
|
1319
|
+
onDrop(event: DragEvent): void;
|
|
1320
|
+
onFileSelected(event: Event): void;
|
|
1321
|
+
private handleFiles;
|
|
1322
|
+
removeFile(file: File): void;
|
|
1323
|
+
uploadFiles(files?: File[]): Promise<void>;
|
|
1324
|
+
getFileIcon(file: File): string;
|
|
1325
|
+
formatSize(bytes: number): string;
|
|
1326
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileUploaderComponent, never>;
|
|
1327
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileUploaderComponent, "lib-file-uploader", never, { "uploadFile": { "alias": "uploadFile"; "required": true; "isSignal": true; }; "acceptTypes": { "alias": "acceptTypes"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxFiles": { "alias": "maxFiles"; "required": false; "isSignal": true; }; "maxSizeMb": { "alias": "maxSizeMb"; "required": false; "isSignal": true; }; "uploadOptions": { "alias": "uploadOptions"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "showPreview": { "alias": "showPreview"; "required": false; "isSignal": true; }; "autoUpload": { "alias": "autoUpload"; "required": false; "isSignal": true; }; }, { "fileUploaded": "fileUploaded"; "filesUploaded": "filesUploaded"; "onError": "onError"; "fileSelected": "fileSelected"; }, never, never, true, never>;
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
/**
|
|
1331
|
+
* File Selector Dialog - Browse and select existing files with filtering.
|
|
1332
|
+
*
|
|
1333
|
+
* Pass your own `loadFiles` function - works with any storage API.
|
|
1334
|
+
*
|
|
1335
|
+
* Features:
|
|
1336
|
+
* - Search with debouncing
|
|
1337
|
+
* - File type filtering
|
|
1338
|
+
* - Infinite scroll pagination
|
|
1339
|
+
* - Single or multiple selection
|
|
1340
|
+
* - File preview with icons
|
|
1341
|
+
*
|
|
1342
|
+
* @example
|
|
1343
|
+
* ```typescript
|
|
1344
|
+
* // In component
|
|
1345
|
+
* readonly fileService = inject(FileManagerApiService);
|
|
1346
|
+
*
|
|
1347
|
+
* readonly loadFiles: LoadFilesFn = (filter) =>
|
|
1348
|
+
* this.fileService.getAll(filter.search, {
|
|
1349
|
+
* pagination: { currentPage: filter.page, pageSize: filter.pageSize },
|
|
1350
|
+
* filter: { contentTypes: filter.contentTypes },
|
|
1351
|
+
* }).pipe(
|
|
1352
|
+
* map(res => ({
|
|
1353
|
+
* ...res,
|
|
1354
|
+
* data: res.data?.map(f => ({
|
|
1355
|
+
* id: f.id,
|
|
1356
|
+
* name: f.name,
|
|
1357
|
+
* contentType: f.contentType,
|
|
1358
|
+
* size: f.size,
|
|
1359
|
+
* url: f.url
|
|
1360
|
+
* }))
|
|
1361
|
+
* }))
|
|
1362
|
+
* );
|
|
1363
|
+
* ```
|
|
1364
|
+
*
|
|
1365
|
+
* ```html
|
|
1366
|
+
* <lib-file-selector-dialog
|
|
1367
|
+
* [(visible)]="showFileSelector"
|
|
1368
|
+
* [loadFiles]="loadFiles"
|
|
1369
|
+
* [acceptTypes]="['image/*']"
|
|
1370
|
+
* [multiple]="false"
|
|
1371
|
+
* (fileSelected)="onFileSelected($event)"
|
|
1372
|
+
* />
|
|
1373
|
+
* ```
|
|
1374
|
+
*/
|
|
1375
|
+
declare class FileSelectorDialogComponent {
|
|
1376
|
+
private readonly destroyRef;
|
|
1377
|
+
private abortController;
|
|
1378
|
+
private searchDebounceTimer;
|
|
1379
|
+
readonly loadFiles: _angular_core.InputSignal<LoadFilesFn>;
|
|
1380
|
+
readonly header: _angular_core.InputSignal<string>;
|
|
1381
|
+
readonly acceptTypes: _angular_core.InputSignal<string[]>;
|
|
1382
|
+
readonly multiple: _angular_core.InputSignal<boolean>;
|
|
1383
|
+
readonly maxSelection: _angular_core.InputSignal<number>;
|
|
1384
|
+
readonly pageSize: _angular_core.InputSignal<number>;
|
|
1385
|
+
readonly visible: _angular_core.ModelSignal<boolean>;
|
|
1386
|
+
readonly fileSelected: _angular_core.OutputEmitterRef<IFileBasicInfo>;
|
|
1387
|
+
readonly filesSelected: _angular_core.OutputEmitterRef<IFileBasicInfo[]>;
|
|
1388
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
1389
|
+
readonly onError: _angular_core.OutputEmitterRef<Error>;
|
|
1390
|
+
readonly isLoading: _angular_core.WritableSignal<boolean>;
|
|
1391
|
+
readonly files: _angular_core.WritableSignal<IFileBasicInfo[]>;
|
|
1392
|
+
readonly selectedFiles: _angular_core.WritableSignal<IFileBasicInfo[]>;
|
|
1393
|
+
readonly total: _angular_core.WritableSignal<number | undefined>;
|
|
1394
|
+
readonly pagination: _angular_core.WritableSignal<IPagination>;
|
|
1395
|
+
readonly searchTerm: _angular_core.WritableSignal<string>;
|
|
1396
|
+
readonly acceptString: _angular_core.Signal<string>;
|
|
1397
|
+
constructor();
|
|
1398
|
+
onSearchChange(value: string): void;
|
|
1399
|
+
onScroll(event: Event): void;
|
|
1400
|
+
toggleSelection(file: IFileBasicInfo): void;
|
|
1401
|
+
isSelected(file: IFileBasicInfo): boolean;
|
|
1402
|
+
isFileAllowed(file: IFileBasicInfo): boolean;
|
|
1403
|
+
isImage(file: IFileBasicInfo): boolean;
|
|
1404
|
+
getFileIcon(file: IFileBasicInfo): string;
|
|
1405
|
+
formatSize(size: string): string;
|
|
1406
|
+
onCancel(): void;
|
|
1407
|
+
onConfirm(): void;
|
|
1408
|
+
onDialogHide(): void;
|
|
1409
|
+
private resetState;
|
|
1410
|
+
private fetchFiles;
|
|
1411
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<FileSelectorDialogComponent, never>;
|
|
1412
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<FileSelectorDialogComponent, "lib-file-selector-dialog", never, { "loadFiles": { "alias": "loadFiles"; "required": true; "isSignal": true; }; "header": { "alias": "header"; "required": false; "isSignal": true; }; "acceptTypes": { "alias": "acceptTypes"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "maxSelection": { "alias": "maxSelection"; "required": false; "isSignal": true; }; "pageSize": { "alias": "pageSize"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; }, { "visible": "visibleChange"; "fileSelected": "fileSelected"; "filesSelected": "filesSelected"; "closed": "closed"; "onError": "onError"; }, never, never, true, never>;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
999
1415
|
/**
|
|
1000
1416
|
* Injection Tokens for Provider Interfaces
|
|
1001
1417
|
*
|
|
@@ -1035,6 +1451,12 @@ declare const COMPANY_API_PROVIDER: InjectionToken<ICompanyApiProvider>;
|
|
|
1035
1451
|
* Provides user permission assignment operations for IAM.
|
|
1036
1452
|
*/
|
|
1037
1453
|
declare const USER_PERMISSION_PROVIDER: InjectionToken<IUserPermissionProvider>;
|
|
1454
|
+
/**
|
|
1455
|
+
* Auth State Provider Token
|
|
1456
|
+
*
|
|
1457
|
+
* Provides auth state access for feature packages (form-builder, etc.)
|
|
1458
|
+
*/
|
|
1459
|
+
declare const AUTH_STATE_PROVIDER: InjectionToken<IAuthStateProvider>;
|
|
1038
1460
|
|
|
1039
1461
|
/**
|
|
1040
1462
|
* Permission Guard
|
|
@@ -1103,5 +1525,5 @@ declare function hasAnyPermission(permissionCodes: string[], permissions: string
|
|
|
1103
1525
|
/** Check if user has ALL of the specified permissions (AND logic) */
|
|
1104
1526
|
declare function hasAllPermissions(permissionCodes: string[], permissions: string[]): boolean;
|
|
1105
1527
|
|
|
1106
|
-
export { AngularModule, ApiResourceService, ApiResourceService as ApiService, COMPANY_API_PROVIDER, ContactTypeEnum, CookieService, EditModeElementChangerDirective, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, IsEmptyImageDirective, LazyMultiSelectComponent, LazySelectComponent, PermissionValidatorService, PlatformService, PreventDefaultDirective, PrimeModule, USER_PERMISSION_PROVIDER, USER_PROVIDER, allPermissionsGuard, anyPermissionGuard, evaluateLogicNode, evaluatePermission, hasAllPermissions, hasAnyPermission, permissionGuard };
|
|
1107
|
-
export type { ApiResponse, DeleteType, FilesResponseDto, GetFilesRequestDto, IActionNode, IActivatable, IApiService, IBaseEntity, IBulkMeta, IBulkResponse, ICompanyApiProvider, ICompanyBasicInfo, IDeleteData, IDropDown, IErrorResponse, IFileData, IFilter, IFilterData, IGroupNode, IListResponse, ILoggedUserInfo, ILogicNode, ILoginResponse, ILoginUserData, IMessageResponse, IMetadata, IOrderable, IPagination, IPaginationMeta, IRefreshTokenResponse, IRequestMeta, ISingleResponse, ISoftDeletable, ISort, ITimestampable, IUserBasicInfo, IUserBranchPayload, IUserCompanyPayload, IUserPermissionProvider, IUserProvider, IValidationError };
|
|
1528
|
+
export { AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, COMPANY_API_PROVIDER, ContactTypeEnum, CookieService, EditModeElementChangerDirective, FILE_TYPE_FILTERS, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, IsEmptyImageDirective, LazyMultiSelectComponent, LazySelectComponent, PermissionValidatorService, PlatformService, PreventDefaultDirective, PrimeModule, USER_PERMISSION_PROVIDER, USER_PROVIDER, UserMultiSelectComponent, UserSelectComponent, allPermissionsGuard, anyPermissionGuard, evaluateLogicNode, evaluatePermission, formatFileSize, getAcceptString, getFileIconClass, hasAllPermissions, hasAnyPermission, isFileTypeAllowed, permissionGuard };
|
|
1529
|
+
export type { ApiResponse, DeleteType, FilesResponseDto, GetFileUrlsFn, GetFilesRequestDto, IActionNode, IActivatable, IApiService, IAuthStateProvider, IBaseEntity, IBulkMeta, IBulkResponse, ICompanyApiProvider, ICompanyBasicInfo, IDeleteData, IDropDown, IErrorResponse, IFileBasicInfo, IFileData, IFileSelectFilter, IFileUploadOptions, IFilter, IFilterData, IGroupNode, IListResponse, ILoggedUserInfo, ILogicNode, ILoginResponse, ILoginUserData, IMessageResponse, IMetadata, IOrderable, IPagination, IPaginationMeta, IRefreshTokenResponse, IRequestMeta, ISingleResponse, ISoftDeletable, ISort, ITimestampable, IUploadedFile, IUserBasicInfo, IUserBranchPayload, IUserCompanyPayload, IUserPermissionProvider, IUserProvider, IUserSelectFilter, IValidationError, LoadFilesFn, LoadUsersFn, UploadFileFn };
|