@flusys/ng-shared 5.4.1 → 6.0.0-beta.1
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/fesm2022/flusys-ng-shared.mjs +779 -847
- package/fesm2022/flusys-ng-shared.mjs.map +1 -1
- package/package.json +8 -9
- package/types/flusys-ng-shared.d.ts +121 -152
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, PLATFORM_ID, Injectable, DOCUMENT, REQUEST, signal, computed, ElementRef, input, effect, Directive, TemplateRef, ViewContainerRef, output, Pipe, Injector, isDevMode, NgModule, resource, model, runInInjectionContext, untracked, forwardRef, contentChildren, Component,
|
|
2
|
+
import { inject, PLATFORM_ID, Injectable, DOCUMENT, REQUEST, signal, computed, ElementRef, input, effect, Directive, TemplateRef, ViewContainerRef, output, Pipe, Injector, isDevMode, NgModule, resource, model, runInInjectionContext, untracked, forwardRef, contentChildren, Component, InjectionToken, DestroyRef, ViewEncapsulation, ApplicationRef, viewChild, afterNextRender } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { isPlatformServer, DOCUMENT as DOCUMENT$1, isPlatformBrowser, CommonModule, NgOptimizedImage, NgComponentOutlet, DatePipe } from '@angular/common';
|
|
5
5
|
import { HttpClient, HttpContextToken, HttpHeaders, HttpParams } from '@angular/common/http';
|
|
@@ -8,67 +8,9 @@ import { of, catchError as catchError$1, throwError, firstValueFrom, map as map$
|
|
|
8
8
|
import { map, tap, catchError } from 'rxjs/operators';
|
|
9
9
|
import * as i2 from '@angular/forms';
|
|
10
10
|
import { NgControl, FormsModule, ReactiveFormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
11
|
-
import * as i3
|
|
12
|
-
import { MessageService, ConfirmationService } from '
|
|
11
|
+
import * as i3 from '@flusys/ng-ui';
|
|
12
|
+
import { MessageService, UiModule, ConfirmationService, UiIconComponent } from '@flusys/ng-ui';
|
|
13
13
|
import { RouterOutlet, RouterLink, RouterLinkActive, Router } from '@angular/router';
|
|
14
|
-
import { AutoCompleteModule } from 'primeng/autocomplete';
|
|
15
|
-
import { AvatarModule } from 'primeng/avatar';
|
|
16
|
-
import * as i3 from 'primeng/button';
|
|
17
|
-
import { ButtonModule } from 'primeng/button';
|
|
18
|
-
import * as i4 from 'primeng/card';
|
|
19
|
-
import { CardModule } from 'primeng/card';
|
|
20
|
-
import * as i5$1 from 'primeng/checkbox';
|
|
21
|
-
import { CheckboxModule } from 'primeng/checkbox';
|
|
22
|
-
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
|
23
|
-
import * as i6$1 from 'primeng/datepicker';
|
|
24
|
-
import { DatePickerModule } from 'primeng/datepicker';
|
|
25
|
-
import * as i5$2 from 'primeng/dialog';
|
|
26
|
-
import { DialogModule } from 'primeng/dialog';
|
|
27
|
-
import { DividerModule } from 'primeng/divider';
|
|
28
|
-
import { FileUploadModule } from 'primeng/fileupload';
|
|
29
|
-
import * as i5 from 'primeng/iconfield';
|
|
30
|
-
import { IconFieldModule } from 'primeng/iconfield';
|
|
31
|
-
import { ImageModule } from 'primeng/image';
|
|
32
|
-
import * as i6 from 'primeng/inputicon';
|
|
33
|
-
import { InputIconModule } from 'primeng/inputicon';
|
|
34
|
-
import * as i7 from 'primeng/inputnumber';
|
|
35
|
-
import { InputNumberModule } from 'primeng/inputnumber';
|
|
36
|
-
import * as i8 from 'primeng/inputtext';
|
|
37
|
-
import { InputTextModule } from 'primeng/inputtext';
|
|
38
|
-
import { ListboxModule } from 'primeng/listbox';
|
|
39
|
-
import * as i9$1 from 'primeng/multiselect';
|
|
40
|
-
import { MultiSelectModule } from 'primeng/multiselect';
|
|
41
|
-
import { PaginatorModule } from 'primeng/paginator';
|
|
42
|
-
import { PanelModule } from 'primeng/panel';
|
|
43
|
-
import * as i10$1 from 'primeng/password';
|
|
44
|
-
import { PasswordModule } from 'primeng/password';
|
|
45
|
-
import { PopoverModule } from 'primeng/popover';
|
|
46
|
-
import * as i2$1 from 'primeng/progressbar';
|
|
47
|
-
import { ProgressBarModule } from 'primeng/progressbar';
|
|
48
|
-
import { RadioButtonModule } from 'primeng/radiobutton';
|
|
49
|
-
import { RippleModule } from 'primeng/ripple';
|
|
50
|
-
import * as i11 from 'primeng/select';
|
|
51
|
-
import { SelectModule } from 'primeng/select';
|
|
52
|
-
import { SelectButtonModule } from 'primeng/selectbutton';
|
|
53
|
-
import { SkeletonModule } from 'primeng/skeleton';
|
|
54
|
-
import { SplitButtonModule } from 'primeng/splitbutton';
|
|
55
|
-
import { StepsModule } from 'primeng/steps';
|
|
56
|
-
import * as i8$1 from 'primeng/table';
|
|
57
|
-
import { TableModule } from 'primeng/table';
|
|
58
|
-
import { TabsModule } from 'primeng/tabs';
|
|
59
|
-
import * as i9 from 'primeng/tag';
|
|
60
|
-
import { TagModule } from 'primeng/tag';
|
|
61
|
-
import * as i12 from 'primeng/textarea';
|
|
62
|
-
import { TextareaModule } from 'primeng/textarea';
|
|
63
|
-
import { ToastModule } from 'primeng/toast';
|
|
64
|
-
import { ToggleButtonModule } from 'primeng/togglebutton';
|
|
65
|
-
import * as i13 from 'primeng/toggleswitch';
|
|
66
|
-
import { ToggleSwitchModule } from 'primeng/toggleswitch';
|
|
67
|
-
import * as i10 from 'primeng/tooltip';
|
|
68
|
-
import { TooltipModule } from 'primeng/tooltip';
|
|
69
|
-
import { TreeTableModule } from 'primeng/treetable';
|
|
70
|
-
import { ProgressSpinnerModule } from 'primeng/progressspinner';
|
|
71
|
-
import { ColorPickerModule } from 'primeng/colorpicker';
|
|
72
14
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
73
15
|
|
|
74
16
|
const SHARED_MESSAGES = {
|
|
@@ -85,6 +27,10 @@ const SHARED_MESSAGES = {
|
|
|
85
27
|
'error.conflict': '{{entity}} with this {{field}} already exists',
|
|
86
28
|
'error.db.foreign.key': "Invalid reference for '{{field}}'",
|
|
87
29
|
'error.db.not.null': "Required field '{{field}}' cannot be null",
|
|
30
|
+
'error.db.invalid.input': "Invalid {{type}} value",
|
|
31
|
+
'error.db.value.too.long': "Value too long for '{{field}}'",
|
|
32
|
+
'error.db.check.constraint': '{{entity}} violates a validation rule',
|
|
33
|
+
'error.db.deadlock': 'The request could not be completed due to a conflict, please try again',
|
|
88
34
|
'error.internal': 'Internal server error',
|
|
89
35
|
'error.service.unavailable': 'Service temporarily unavailable',
|
|
90
36
|
'error.unknown': 'Unknown error occurred',
|
|
@@ -231,99 +177,6 @@ const SHARED_MESSAGES = {
|
|
|
231
177
|
'shared.view.details': 'View Details',
|
|
232
178
|
'shared.yes': 'Yes',
|
|
233
179
|
'shared.validation': 'Validation',
|
|
234
|
-
// cross-package shared keys (primeng.* — PrimeNG i18n provider)
|
|
235
|
-
'primeng.accept': 'Yes',
|
|
236
|
-
'primeng.add.rule': 'Add Rule',
|
|
237
|
-
'primeng.apply': 'Apply',
|
|
238
|
-
'primeng.aria.cancel.edit': 'Cancel Edit',
|
|
239
|
-
'primeng.aria.close': 'Close',
|
|
240
|
-
'primeng.aria.collapse.row': 'Row Collapsed',
|
|
241
|
-
'primeng.aria.edit.row': 'Edit Row',
|
|
242
|
-
'primeng.aria.expand.row': 'Row Expanded',
|
|
243
|
-
'primeng.aria.false.label': 'False',
|
|
244
|
-
'primeng.aria.filter.constraint': 'Filter Constraint',
|
|
245
|
-
'primeng.aria.filter.operator': 'Filter Operator',
|
|
246
|
-
'primeng.aria.first.page.label': 'First Page',
|
|
247
|
-
'primeng.aria.grid.view': 'Grid View',
|
|
248
|
-
'primeng.aria.hide.filter.menu': 'Hide Filter Menu',
|
|
249
|
-
'primeng.aria.jump.to.page.dropdown.label': 'Jump to Page Dropdown',
|
|
250
|
-
'primeng.aria.jump.to.page.input.label': 'Jump to Page Input',
|
|
251
|
-
'primeng.aria.last.page.label': 'Last Page',
|
|
252
|
-
'primeng.aria.list.view': 'List View',
|
|
253
|
-
'primeng.aria.move.all.to.source': 'Move All to Source',
|
|
254
|
-
'primeng.aria.move.all.to.target': 'Move All to Target',
|
|
255
|
-
'primeng.aria.move.bottom': 'Move Bottom',
|
|
256
|
-
'primeng.aria.move.down': 'Move Down',
|
|
257
|
-
'primeng.aria.move.to.source': 'Move to Source',
|
|
258
|
-
'primeng.aria.move.to.target': 'Move to Target',
|
|
259
|
-
'primeng.aria.move.top': 'Move Top',
|
|
260
|
-
'primeng.aria.move.up': 'Move Up',
|
|
261
|
-
'primeng.aria.navigation': 'Navigation',
|
|
262
|
-
'primeng.aria.next': 'Next',
|
|
263
|
-
'primeng.aria.next.page.label': 'Next Page',
|
|
264
|
-
'primeng.aria.null.label': 'Not Selected',
|
|
265
|
-
'primeng.aria.page.label': 'Page {page}',
|
|
266
|
-
'primeng.aria.prev.page.label': 'Previous Page',
|
|
267
|
-
'primeng.aria.previous': 'Previous',
|
|
268
|
-
'primeng.aria.rotate.left': 'Rotate Left',
|
|
269
|
-
'primeng.aria.rotate.right': 'Rotate Right',
|
|
270
|
-
'primeng.aria.rows.per.page.label': 'Rows per page',
|
|
271
|
-
'primeng.aria.save.edit': 'Save Edit',
|
|
272
|
-
'primeng.aria.scroll.top': 'Scroll Top',
|
|
273
|
-
'primeng.aria.select.all': 'All items selected',
|
|
274
|
-
'primeng.aria.select.row': 'Row Selected',
|
|
275
|
-
'primeng.aria.show.filter.menu': 'Show Filter Menu',
|
|
276
|
-
'primeng.aria.slide': 'Slide',
|
|
277
|
-
'primeng.aria.slide.number': '{slideNumber}',
|
|
278
|
-
'primeng.aria.star': '1 star',
|
|
279
|
-
'primeng.aria.stars': '{star} stars',
|
|
280
|
-
'primeng.aria.true.label': 'True',
|
|
281
|
-
'primeng.aria.unselect.all': 'All items unselected',
|
|
282
|
-
'primeng.aria.unselect.row': 'Row Unselected',
|
|
283
|
-
'primeng.aria.zoom.image': 'Zoom Image',
|
|
284
|
-
'primeng.aria.zoom.in': 'Zoom In',
|
|
285
|
-
'primeng.aria.zoom.out': 'Zoom Out',
|
|
286
|
-
'primeng.cancel': 'Cancel',
|
|
287
|
-
'primeng.choose': 'Choose',
|
|
288
|
-
'primeng.choose.date': 'Choose Date',
|
|
289
|
-
'primeng.clear': 'Clear',
|
|
290
|
-
'primeng.contains': 'Contains',
|
|
291
|
-
'primeng.date.after': 'Date is after',
|
|
292
|
-
'primeng.date.before': 'Date is before',
|
|
293
|
-
'primeng.date.is': 'Date is',
|
|
294
|
-
'primeng.date.is.not': 'Date is not',
|
|
295
|
-
'primeng.empty.filter.message': 'No results found',
|
|
296
|
-
'primeng.empty.message': 'No results found',
|
|
297
|
-
'primeng.empty.search.message': 'No results found',
|
|
298
|
-
'primeng.empty.selection.message': 'No selected item',
|
|
299
|
-
'primeng.ends.with': 'Ends with',
|
|
300
|
-
'primeng.equals': 'Equals',
|
|
301
|
-
'primeng.first.day.of.week': '0',
|
|
302
|
-
'primeng.gt': 'Greater than',
|
|
303
|
-
'primeng.gte': 'Greater than or equal to',
|
|
304
|
-
'primeng.lt': 'Less than',
|
|
305
|
-
'primeng.lte': 'Less than or equal to',
|
|
306
|
-
'primeng.match.all': 'Match All',
|
|
307
|
-
'primeng.match.any': 'Match Any',
|
|
308
|
-
'primeng.no.filter': 'No Filter',
|
|
309
|
-
'primeng.not.contains': 'Not contains',
|
|
310
|
-
'primeng.not.equals': 'Not equals',
|
|
311
|
-
'primeng.pending': 'Pending',
|
|
312
|
-
'primeng.reject': 'No',
|
|
313
|
-
'primeng.remove.rule': 'Remove Rule',
|
|
314
|
-
'primeng.selection.message': '{0} items selected',
|
|
315
|
-
'primeng.starts.with': 'Starts with',
|
|
316
|
-
'primeng.today': 'Today',
|
|
317
|
-
'primeng.upload': 'Upload',
|
|
318
|
-
'primeng.week.header': 'Wk',
|
|
319
|
-
'primeng.choose.year': 'Choose Year',
|
|
320
|
-
'primeng.choose.month': 'Choose Month',
|
|
321
|
-
'primeng.date.format': 'mm/dd/yy',
|
|
322
|
-
'primeng.weak': 'Weak',
|
|
323
|
-
'primeng.medium': 'Medium',
|
|
324
|
-
'primeng.strong': 'Strong',
|
|
325
|
-
'primeng.password.prompt': 'Enter a password',
|
|
326
|
-
'primeng.country.placeholder': 'Choose a country',
|
|
327
180
|
};
|
|
328
181
|
|
|
329
182
|
// ==================== AUTH MODULE ====================
|
|
@@ -521,18 +374,18 @@ function isFileTypeAllowed(file, allowedTypes) {
|
|
|
521
374
|
}
|
|
522
375
|
function getFileIconClass(contentType) {
|
|
523
376
|
if (contentType.startsWith('image/'))
|
|
524
|
-
return '
|
|
377
|
+
return 'image';
|
|
525
378
|
if (contentType.startsWith('video/'))
|
|
526
|
-
return '
|
|
379
|
+
return 'video';
|
|
527
380
|
if (contentType.startsWith('audio/'))
|
|
528
|
-
return '
|
|
381
|
+
return 'volume-up';
|
|
529
382
|
if (contentType.includes('pdf'))
|
|
530
|
-
return '
|
|
383
|
+
return 'file-pdf';
|
|
531
384
|
if (contentType.includes('word') || contentType.includes('document'))
|
|
532
|
-
return '
|
|
385
|
+
return 'file-word';
|
|
533
386
|
if (contentType.includes('excel') || contentType.includes('spreadsheet'))
|
|
534
|
-
return '
|
|
535
|
-
return '
|
|
387
|
+
return 'file-excel';
|
|
388
|
+
return 'file';
|
|
536
389
|
}
|
|
537
390
|
function formatFileSize(sizeInKb) {
|
|
538
391
|
const kb = typeof sizeInKb === 'string' ? parseFloat(sizeInKb) : sizeInKb;
|
|
@@ -546,9 +399,8 @@ function formatFileSize(sizeInKb) {
|
|
|
546
399
|
|
|
547
400
|
var IconTypeEnum;
|
|
548
401
|
(function (IconTypeEnum) {
|
|
549
|
-
IconTypeEnum[IconTypeEnum["
|
|
402
|
+
IconTypeEnum[IconTypeEnum["ICON_NAME"] = 1] = "ICON_NAME";
|
|
550
403
|
IconTypeEnum[IconTypeEnum["IMAGE_FILE_LINK"] = 2] = "IMAGE_FILE_LINK";
|
|
551
|
-
IconTypeEnum[IconTypeEnum["DIRECT_TAG_SVG"] = 3] = "DIRECT_TAG_SVG";
|
|
552
404
|
})(IconTypeEnum || (IconTypeEnum = {}));
|
|
553
405
|
|
|
554
406
|
class PlatformService {
|
|
@@ -556,10 +408,10 @@ class PlatformService {
|
|
|
556
408
|
get isServer() {
|
|
557
409
|
return isPlatformServer(this.platformId);
|
|
558
410
|
}
|
|
559
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
560
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
411
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PlatformService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
412
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PlatformService, providedIn: 'root' });
|
|
561
413
|
}
|
|
562
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PlatformService, decorators: [{
|
|
563
415
|
type: Injectable,
|
|
564
416
|
args: [{ providedIn: 'root' }]
|
|
565
417
|
}] });
|
|
@@ -571,10 +423,10 @@ class CookieService {
|
|
|
571
423
|
get() {
|
|
572
424
|
return !this.platformService.isServer ? this.doc.cookie : this.request?.headers.get('cookie') ?? "";
|
|
573
425
|
}
|
|
574
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
575
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
426
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CookieService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
427
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CookieService, providedIn: 'root' });
|
|
576
428
|
}
|
|
577
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
429
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: CookieService, decorators: [{
|
|
578
430
|
type: Injectable,
|
|
579
431
|
args: [{
|
|
580
432
|
providedIn: 'root',
|
|
@@ -588,7 +440,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
588
440
|
class FileUrlService {
|
|
589
441
|
http = inject(HttpClient);
|
|
590
442
|
appConfig = inject(APP_CONFIG);
|
|
591
|
-
_cache = signal(new Map(),
|
|
443
|
+
_cache = signal(new Map(), /* @ts-ignore */
|
|
444
|
+
...(ngDevMode ? [{ debugName: "_cache" }] : /* istanbul ignore next */ []));
|
|
592
445
|
cache = this._cache.asReadonly();
|
|
593
446
|
/** Fetch file URLs from backend and update cache */
|
|
594
447
|
fetchFileUrls(fileIds, forceRefresh = false) {
|
|
@@ -625,10 +478,10 @@ class FileUrlService {
|
|
|
625
478
|
.map((id) => cache.get(id))
|
|
626
479
|
.filter((f) => f !== undefined);
|
|
627
480
|
}
|
|
628
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
629
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
481
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileUrlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
482
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileUrlService, providedIn: 'root' });
|
|
630
483
|
}
|
|
631
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileUrlService, decorators: [{
|
|
632
485
|
type: Injectable,
|
|
633
486
|
args: [{ providedIn: 'root' }]
|
|
634
487
|
}] });
|
|
@@ -698,9 +551,11 @@ function hasAllPermissions(permissionCodes, permissions) {
|
|
|
698
551
|
* Provides signal-based storage and permission checking with wildcard support.
|
|
699
552
|
*/
|
|
700
553
|
class PermissionValidatorService {
|
|
701
|
-
_permissions = signal([],
|
|
554
|
+
_permissions = signal([], /* @ts-ignore */
|
|
555
|
+
...(ngDevMode ? [{ debugName: "_permissions" }] : /* istanbul ignore next */ []));
|
|
702
556
|
permissions = this._permissions.asReadonly();
|
|
703
|
-
_isLoaded = signal(false,
|
|
557
|
+
_isLoaded = signal(false, /* @ts-ignore */
|
|
558
|
+
...(ngDevMode ? [{ debugName: "_isLoaded" }] : /* istanbul ignore next */ []));
|
|
704
559
|
isLoaded = this._isLoaded.asReadonly();
|
|
705
560
|
/** Set permissions (replaces existing) */
|
|
706
561
|
setPermissions(permissions) {
|
|
@@ -723,10 +578,10 @@ class PermissionValidatorService {
|
|
|
723
578
|
isPermissionsLoaded() {
|
|
724
579
|
return this._isLoaded();
|
|
725
580
|
}
|
|
726
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
727
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
581
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PermissionValidatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
582
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PermissionValidatorService, providedIn: 'root' });
|
|
728
583
|
}
|
|
729
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
584
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PermissionValidatorService, decorators: [{
|
|
730
585
|
type: Injectable,
|
|
731
586
|
args: [{ providedIn: 'root' }]
|
|
732
587
|
}] });
|
|
@@ -764,10 +619,10 @@ class TranslateService {
|
|
|
764
619
|
return value !== undefined ? String(value) : match;
|
|
765
620
|
});
|
|
766
621
|
}
|
|
767
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
768
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
622
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
623
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslateService, providedIn: 'root' });
|
|
769
624
|
}
|
|
770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
625
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslateService, decorators: [{
|
|
771
626
|
type: Injectable,
|
|
772
627
|
args: [{ providedIn: 'root' }]
|
|
773
628
|
}] });
|
|
@@ -802,10 +657,10 @@ class FaviconService {
|
|
|
802
657
|
link.href = `data:image/svg+xml,${encodeURIComponent(resolved)}`;
|
|
803
658
|
}
|
|
804
659
|
}
|
|
805
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
806
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
660
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FaviconService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
661
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FaviconService, providedIn: 'root' });
|
|
807
662
|
}
|
|
808
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
663
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FaviconService, decorators: [{
|
|
809
664
|
type: Injectable,
|
|
810
665
|
args: [{ providedIn: 'root' }]
|
|
811
666
|
}] });
|
|
@@ -813,7 +668,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
813
668
|
class EditModeElementChangerDirective {
|
|
814
669
|
el = inject(ElementRef);
|
|
815
670
|
ngControl = inject(NgControl, { optional: true });
|
|
816
|
-
isEditMode = input.required(
|
|
671
|
+
isEditMode = input.required(/* @ts-ignore */
|
|
672
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
817
673
|
constructor() {
|
|
818
674
|
effect(() => {
|
|
819
675
|
const editMode = this.isEditMode();
|
|
@@ -839,23 +695,23 @@ class EditModeElementChangerDirective {
|
|
|
839
695
|
inputElement.classList.remove('edit-mode-element-css');
|
|
840
696
|
}
|
|
841
697
|
}
|
|
842
|
-
if (inputElement.tagName === '
|
|
843
|
-
const
|
|
844
|
-
const label = inputElement.querySelector('
|
|
698
|
+
if (inputElement.tagName === 'F-SELECT') {
|
|
699
|
+
const trigger = inputElement.querySelector('[data-select-trigger]');
|
|
700
|
+
const label = inputElement.querySelector('[data-select-label]');
|
|
845
701
|
if (!editMode) {
|
|
846
702
|
inputElement.classList.add('edit-mode-element-css', 'overflow-hidden');
|
|
847
|
-
if (
|
|
848
|
-
|
|
703
|
+
if (trigger)
|
|
704
|
+
trigger.style.display = 'none';
|
|
849
705
|
label?.classList.add('edit-mode-element-css');
|
|
850
706
|
}
|
|
851
707
|
else {
|
|
852
708
|
inputElement.classList.remove('edit-mode-element-css', 'overflow-hidden');
|
|
853
|
-
if (
|
|
854
|
-
|
|
709
|
+
if (trigger)
|
|
710
|
+
trigger.style.display = '';
|
|
855
711
|
label?.classList.remove('edit-mode-element-css');
|
|
856
712
|
}
|
|
857
713
|
}
|
|
858
|
-
if (inputElement.tagName === '
|
|
714
|
+
if (inputElement.tagName === 'F-DATEPICKER') {
|
|
859
715
|
const firstChild = inputElement.firstElementChild;
|
|
860
716
|
if (!editMode) {
|
|
861
717
|
firstChild?.children[0]?.classList.add('edit-mode-element-css', 'cursor-auto');
|
|
@@ -867,10 +723,10 @@ class EditModeElementChangerDirective {
|
|
|
867
723
|
}
|
|
868
724
|
}
|
|
869
725
|
}
|
|
870
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
871
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
726
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditModeElementChangerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
727
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: EditModeElementChangerDirective, isStandalone: true, selector: "[appEditModeElementChanger]", inputs: { isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
872
728
|
}
|
|
873
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
729
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: EditModeElementChangerDirective, decorators: [{
|
|
874
730
|
type: Directive,
|
|
875
731
|
args: [{
|
|
876
732
|
selector: '[appEditModeElementChanger]',
|
|
@@ -936,7 +792,8 @@ class HasPermissionDirective {
|
|
|
936
792
|
* - string: Single permission code to check
|
|
937
793
|
* - ILogicNode: Complex permission logic tree
|
|
938
794
|
*/
|
|
939
|
-
hasPermission = input(null,
|
|
795
|
+
hasPermission = input(null, /* @ts-ignore */
|
|
796
|
+
...(ngDevMode ? [{ debugName: "hasPermission" }] : /* istanbul ignore next */ []));
|
|
940
797
|
/**
|
|
941
798
|
* View created state
|
|
942
799
|
*/
|
|
@@ -988,10 +845,10 @@ class HasPermissionDirective {
|
|
|
988
845
|
this.viewCreated = false;
|
|
989
846
|
}
|
|
990
847
|
}
|
|
991
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
992
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
848
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: HasPermissionDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
849
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: HasPermissionDirective, isStandalone: true, selector: "[hasPermission]", inputs: { hasPermission: { classPropertyName: "hasPermission", publicName: "hasPermission", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
993
850
|
}
|
|
994
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
851
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: HasPermissionDirective, decorators: [{
|
|
995
852
|
type: Directive,
|
|
996
853
|
args: [{
|
|
997
854
|
selector: '[hasPermission]',
|
|
@@ -999,8 +856,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
999
856
|
}], ctorParameters: () => [], propDecorators: { hasPermission: [{ type: i0.Input, args: [{ isSignal: true, alias: "hasPermission", required: false }] }] } });
|
|
1000
857
|
|
|
1001
858
|
class IsEmptyImageDirective {
|
|
1002
|
-
src = input('',
|
|
1003
|
-
|
|
859
|
+
src = input('', /* @ts-ignore */
|
|
860
|
+
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
861
|
+
hasError = signal(false, /* @ts-ignore */
|
|
862
|
+
...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1004
863
|
defaultImg = 'lib/assets/images/default/default-image.jpg';
|
|
1005
864
|
imageSrc = computed(() => {
|
|
1006
865
|
if (this.hasError()) {
|
|
@@ -1008,14 +867,15 @@ class IsEmptyImageDirective {
|
|
|
1008
867
|
}
|
|
1009
868
|
const srcValue = this.src();
|
|
1010
869
|
return srcValue ? srcValue : this.defaultImg;
|
|
1011
|
-
},
|
|
870
|
+
}, /* @ts-ignore */
|
|
871
|
+
...(ngDevMode ? [{ debugName: "imageSrc" }] : /* istanbul ignore next */ []));
|
|
1012
872
|
onError() {
|
|
1013
873
|
this.hasError.set(true);
|
|
1014
874
|
}
|
|
1015
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1016
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
875
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IsEmptyImageDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
876
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: IsEmptyImageDirective, isStandalone: true, selector: "img", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "error": "onError()" }, properties: { "src": "imageSrc()" } }, ngImport: i0 });
|
|
1017
877
|
}
|
|
1018
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
878
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IsEmptyImageDirective, decorators: [{
|
|
1019
879
|
type: Directive,
|
|
1020
880
|
args: [{
|
|
1021
881
|
selector: 'img',
|
|
@@ -1027,8 +887,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1027
887
|
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }] } });
|
|
1028
888
|
|
|
1029
889
|
class PreventDefaultDirective {
|
|
1030
|
-
eventType = input('click',
|
|
1031
|
-
|
|
890
|
+
eventType = input('click', /* @ts-ignore */
|
|
891
|
+
...(ngDevMode ? [{ debugName: "eventType" }] : /* istanbul ignore next */ []));
|
|
892
|
+
preventKey = input(undefined, /* @ts-ignore */
|
|
893
|
+
...(ngDevMode ? [{ debugName: "preventKey" }] : /* istanbul ignore next */ []));
|
|
1032
894
|
action = output();
|
|
1033
895
|
onClick(event) {
|
|
1034
896
|
if (this.eventType() === 'click') {
|
|
@@ -1053,10 +915,10 @@ class PreventDefaultDirective {
|
|
|
1053
915
|
event.preventDefault();
|
|
1054
916
|
this.action.emit(event);
|
|
1055
917
|
}
|
|
1056
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1057
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PreventDefaultDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
919
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: PreventDefaultDirective, isStandalone: true, selector: "[appPreventDefault]", inputs: { eventType: { classPropertyName: "eventType", publicName: "eventType", isSignal: true, isRequired: false, transformFunction: null }, preventKey: { classPropertyName: "preventKey", publicName: "preventKey", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { action: "action" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeydown($event)", "keyup": "onKeyup($event)" } }, ngImport: i0 });
|
|
1058
920
|
}
|
|
1059
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
921
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: PreventDefaultDirective, decorators: [{
|
|
1060
922
|
type: Directive,
|
|
1061
923
|
args: [{
|
|
1062
924
|
selector: '[appPreventDefault]',
|
|
@@ -1076,10 +938,10 @@ class TranslatePipe {
|
|
|
1076
938
|
const result = this.translateAdapter.translate(key, params ?? undefined);
|
|
1077
939
|
return fallback !== undefined && result === key ? fallback : result;
|
|
1078
940
|
}
|
|
1079
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1080
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "
|
|
941
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
942
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: TranslatePipe, isStandalone: true, name: "translate", pure: false });
|
|
1081
943
|
}
|
|
1082
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
944
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: TranslatePipe, decorators: [{
|
|
1083
945
|
type: Pipe,
|
|
1084
946
|
args: [{
|
|
1085
947
|
name: 'translate',
|
|
@@ -1305,8 +1167,8 @@ function resolveTranslationModule(config) {
|
|
|
1305
1167
|
}
|
|
1306
1168
|
|
|
1307
1169
|
class AngularModule {
|
|
1308
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1309
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
1170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AngularModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1171
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.6", ngImport: i0, type: AngularModule, imports: [CommonModule,
|
|
1310
1172
|
FormsModule,
|
|
1311
1173
|
ReactiveFormsModule,
|
|
1312
1174
|
RouterOutlet,
|
|
@@ -1325,13 +1187,13 @@ class AngularModule {
|
|
|
1325
1187
|
NgOptimizedImage,
|
|
1326
1188
|
NgComponentOutlet,
|
|
1327
1189
|
PreventDefaultDirective] });
|
|
1328
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
1190
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AngularModule, providers: [DatePipe], imports: [CommonModule,
|
|
1329
1191
|
FormsModule,
|
|
1330
1192
|
ReactiveFormsModule, CommonModule,
|
|
1331
1193
|
FormsModule,
|
|
1332
1194
|
ReactiveFormsModule] });
|
|
1333
1195
|
}
|
|
1334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AngularModule, decorators: [{
|
|
1335
1197
|
type: NgModule,
|
|
1336
1198
|
args: [{
|
|
1337
1199
|
imports: [
|
|
@@ -1362,137 +1224,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
1362
1224
|
}]
|
|
1363
1225
|
}] });
|
|
1364
1226
|
|
|
1365
|
-
class PrimeModule {
|
|
1366
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PrimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1367
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.5", ngImport: i0, type: PrimeModule, exports: [AutoCompleteModule,
|
|
1368
|
-
AvatarModule,
|
|
1369
|
-
ButtonModule,
|
|
1370
|
-
CardModule,
|
|
1371
|
-
CheckboxModule,
|
|
1372
|
-
ConfirmDialogModule,
|
|
1373
|
-
DatePickerModule,
|
|
1374
|
-
DialogModule,
|
|
1375
|
-
DividerModule,
|
|
1376
|
-
FileUploadModule,
|
|
1377
|
-
IconFieldModule,
|
|
1378
|
-
ImageModule,
|
|
1379
|
-
InputIconModule,
|
|
1380
|
-
InputNumberModule,
|
|
1381
|
-
InputTextModule,
|
|
1382
|
-
ListboxModule,
|
|
1383
|
-
MultiSelectModule,
|
|
1384
|
-
PaginatorModule,
|
|
1385
|
-
PanelModule,
|
|
1386
|
-
PasswordModule,
|
|
1387
|
-
PopoverModule,
|
|
1388
|
-
ProgressBarModule,
|
|
1389
|
-
RadioButtonModule,
|
|
1390
|
-
RippleModule,
|
|
1391
|
-
SelectButtonModule,
|
|
1392
|
-
SelectModule,
|
|
1393
|
-
SkeletonModule,
|
|
1394
|
-
SplitButtonModule,
|
|
1395
|
-
StepsModule,
|
|
1396
|
-
TableModule,
|
|
1397
|
-
TabsModule,
|
|
1398
|
-
TagModule,
|
|
1399
|
-
TextareaModule,
|
|
1400
|
-
ToastModule,
|
|
1401
|
-
ToggleButtonModule,
|
|
1402
|
-
ToggleSwitchModule,
|
|
1403
|
-
TooltipModule,
|
|
1404
|
-
TreeTableModule,
|
|
1405
|
-
ProgressSpinnerModule,
|
|
1406
|
-
ColorPickerModule] });
|
|
1407
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PrimeModule, imports: [AutoCompleteModule,
|
|
1408
|
-
AvatarModule,
|
|
1409
|
-
ButtonModule,
|
|
1410
|
-
CardModule,
|
|
1411
|
-
CheckboxModule,
|
|
1412
|
-
ConfirmDialogModule,
|
|
1413
|
-
DatePickerModule,
|
|
1414
|
-
DialogModule,
|
|
1415
|
-
DividerModule,
|
|
1416
|
-
FileUploadModule,
|
|
1417
|
-
IconFieldModule,
|
|
1418
|
-
ImageModule,
|
|
1419
|
-
InputIconModule,
|
|
1420
|
-
InputNumberModule,
|
|
1421
|
-
InputTextModule,
|
|
1422
|
-
ListboxModule,
|
|
1423
|
-
MultiSelectModule,
|
|
1424
|
-
PaginatorModule,
|
|
1425
|
-
PanelModule,
|
|
1426
|
-
PasswordModule,
|
|
1427
|
-
PopoverModule,
|
|
1428
|
-
ProgressBarModule,
|
|
1429
|
-
RadioButtonModule,
|
|
1430
|
-
RippleModule,
|
|
1431
|
-
SelectButtonModule,
|
|
1432
|
-
SelectModule,
|
|
1433
|
-
SkeletonModule,
|
|
1434
|
-
SplitButtonModule,
|
|
1435
|
-
StepsModule,
|
|
1436
|
-
TableModule,
|
|
1437
|
-
TabsModule,
|
|
1438
|
-
TagModule,
|
|
1439
|
-
TextareaModule,
|
|
1440
|
-
ToastModule,
|
|
1441
|
-
ToggleButtonModule,
|
|
1442
|
-
ToggleSwitchModule,
|
|
1443
|
-
TooltipModule,
|
|
1444
|
-
TreeTableModule,
|
|
1445
|
-
ProgressSpinnerModule,
|
|
1446
|
-
ColorPickerModule] });
|
|
1447
|
-
}
|
|
1448
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: PrimeModule, decorators: [{
|
|
1449
|
-
type: NgModule,
|
|
1450
|
-
args: [{
|
|
1451
|
-
exports: [
|
|
1452
|
-
AutoCompleteModule,
|
|
1453
|
-
AvatarModule,
|
|
1454
|
-
ButtonModule,
|
|
1455
|
-
CardModule,
|
|
1456
|
-
CheckboxModule,
|
|
1457
|
-
ConfirmDialogModule,
|
|
1458
|
-
DatePickerModule,
|
|
1459
|
-
DialogModule,
|
|
1460
|
-
DividerModule,
|
|
1461
|
-
FileUploadModule,
|
|
1462
|
-
IconFieldModule,
|
|
1463
|
-
ImageModule,
|
|
1464
|
-
InputIconModule,
|
|
1465
|
-
InputNumberModule,
|
|
1466
|
-
InputTextModule,
|
|
1467
|
-
ListboxModule,
|
|
1468
|
-
MultiSelectModule,
|
|
1469
|
-
PaginatorModule,
|
|
1470
|
-
PanelModule,
|
|
1471
|
-
PasswordModule,
|
|
1472
|
-
PopoverModule,
|
|
1473
|
-
ProgressBarModule,
|
|
1474
|
-
RadioButtonModule,
|
|
1475
|
-
RippleModule,
|
|
1476
|
-
SelectButtonModule,
|
|
1477
|
-
SelectModule,
|
|
1478
|
-
SkeletonModule,
|
|
1479
|
-
SplitButtonModule,
|
|
1480
|
-
StepsModule,
|
|
1481
|
-
TableModule,
|
|
1482
|
-
TabsModule,
|
|
1483
|
-
TagModule,
|
|
1484
|
-
TextareaModule,
|
|
1485
|
-
ToastModule,
|
|
1486
|
-
ToggleButtonModule,
|
|
1487
|
-
ToggleSwitchModule,
|
|
1488
|
-
TooltipModule,
|
|
1489
|
-
TreeTableModule,
|
|
1490
|
-
ProgressSpinnerModule,
|
|
1491
|
-
ColorPickerModule,
|
|
1492
|
-
],
|
|
1493
|
-
}]
|
|
1494
|
-
}] });
|
|
1495
|
-
|
|
1496
1227
|
// ── Separate default filter into a named constant so it's sharable/testable ──
|
|
1497
1228
|
const DEFAULT_FILTER = {
|
|
1498
1229
|
pagination: { currentPage: 0, pageSize: 10 },
|
|
@@ -1507,29 +1238,36 @@ class ApiResourceService {
|
|
|
1507
1238
|
baseUrl;
|
|
1508
1239
|
moduleApiName;
|
|
1509
1240
|
// ── Public writable signals ───────────────────────────────────────────────
|
|
1510
|
-
searchTerm = signal('',
|
|
1511
|
-
|
|
1241
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
1242
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
1243
|
+
filterData = signal({ ...DEFAULT_FILTER }, /* @ts-ignore */
|
|
1244
|
+
...(ngDevMode ? [{ debugName: "filterData" }] : /* istanbul ignore next */ []));
|
|
1512
1245
|
// ── Private activation gate: avoids an initial fetch before fetchList() ──
|
|
1513
|
-
_active = signal(false,
|
|
1246
|
+
_active = signal(false, /* @ts-ignore */
|
|
1247
|
+
...(ngDevMode ? [{ debugName: "_active" }] : /* istanbul ignore next */ []));
|
|
1514
1248
|
// ── Resource (reactive list fetching with abort support) ──────────────────
|
|
1515
1249
|
listResource;
|
|
1516
1250
|
// ── Derived/computed signals (pure reads, no side-effects) ────────────────
|
|
1517
|
-
isLoading = computed(() => this.listResource.isLoading(),
|
|
1251
|
+
isLoading = computed(() => this.listResource.isLoading(), /* @ts-ignore */
|
|
1252
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
1518
1253
|
data = computed(() => {
|
|
1519
1254
|
if (this.listResource.error())
|
|
1520
1255
|
return [];
|
|
1521
1256
|
return this.listResource.value()?.data ?? [];
|
|
1522
|
-
},
|
|
1257
|
+
}, /* @ts-ignore */
|
|
1258
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1523
1259
|
total = computed(() => {
|
|
1524
1260
|
if (this.listResource.error())
|
|
1525
1261
|
return 0;
|
|
1526
1262
|
return this.listResource.value()?.meta?.total ?? 0;
|
|
1527
|
-
},
|
|
1263
|
+
}, /* @ts-ignore */
|
|
1264
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
1528
1265
|
pageInfo = computed(() => {
|
|
1529
1266
|
if (this.listResource.error())
|
|
1530
1267
|
return undefined;
|
|
1531
1268
|
return this.listResource.value()?.meta;
|
|
1532
|
-
},
|
|
1269
|
+
}, /* @ts-ignore */
|
|
1270
|
+
...(ngDevMode ? [{ debugName: "pageInfo" }] : /* istanbul ignore next */ []));
|
|
1533
1271
|
hasMore = computed(() => {
|
|
1534
1272
|
if (this.listResource.error())
|
|
1535
1273
|
return false;
|
|
@@ -1537,9 +1275,12 @@ class ApiResourceService {
|
|
|
1537
1275
|
if (!meta)
|
|
1538
1276
|
return false;
|
|
1539
1277
|
return meta.hasMore ?? (meta.page + 1) * meta.pageSize < meta.total;
|
|
1540
|
-
},
|
|
1541
|
-
|
|
1542
|
-
|
|
1278
|
+
}, /* @ts-ignore */
|
|
1279
|
+
...(ngDevMode ? [{ debugName: "hasMore" }] : /* istanbul ignore next */ []));
|
|
1280
|
+
error = computed(() => this.listResource.error(), /* @ts-ignore */
|
|
1281
|
+
...(ngDevMode ? [{ debugName: "error" }] : /* istanbul ignore next */ []));
|
|
1282
|
+
status = computed(() => this.listResource.status(), /* @ts-ignore */
|
|
1283
|
+
...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
1543
1284
|
constructor(moduleApiName, serviceName) {
|
|
1544
1285
|
this.moduleApiName = moduleApiName;
|
|
1545
1286
|
// ── Resolve base URL once at construction, not per-request ───────────────
|
|
@@ -1549,7 +1290,7 @@ class ApiResourceService {
|
|
|
1549
1290
|
this.baseUrl = moduleApiName
|
|
1550
1291
|
? `${serviceBaseUrl}/${moduleApiName}`
|
|
1551
1292
|
: serviceBaseUrl;
|
|
1552
|
-
this.listResource = resource({ ...(ngDevMode ? { debugName: "listResource" } : {}), params: () => {
|
|
1293
|
+
this.listResource = resource({ ...(ngDevMode ? { debugName: "listResource" } : /* istanbul ignore next */ {}), params: () => {
|
|
1553
1294
|
// Short-circuit: skip the loader entirely when not yet activated
|
|
1554
1295
|
if (!this._active())
|
|
1555
1296
|
return undefined;
|
|
@@ -1661,8 +1402,10 @@ class ApiResourceService {
|
|
|
1661
1402
|
|
|
1662
1403
|
class BaseFormControl {
|
|
1663
1404
|
injector = inject(Injector);
|
|
1664
|
-
disabled = model(false,
|
|
1665
|
-
|
|
1405
|
+
disabled = model(false, /* @ts-ignore */
|
|
1406
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1407
|
+
touched = model(false, /* @ts-ignore */
|
|
1408
|
+
...(ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []));
|
|
1666
1409
|
// ── CVA callbacks ─────────────────────────────────────────────────────────
|
|
1667
1410
|
// Initialised to no-ops so subclasses never need null-guards
|
|
1668
1411
|
onChange = () => { };
|
|
@@ -1724,10 +1467,10 @@ class BaseFormControl {
|
|
|
1724
1467
|
this.onTouched();
|
|
1725
1468
|
}
|
|
1726
1469
|
}
|
|
1727
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1728
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1470
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormControl, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1471
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BaseFormControl, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { disabled: "disabledChange", touched: "touchedChange" }, ngImport: i0 });
|
|
1729
1472
|
}
|
|
1730
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1473
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormControl, decorators: [{
|
|
1731
1474
|
type: Directive
|
|
1732
1475
|
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }, { type: i0.Output, args: ["disabledChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }] } });
|
|
1733
1476
|
/**
|
|
@@ -1750,177 +1493,13 @@ function provideValueAccessor(component) {
|
|
|
1750
1493
|
};
|
|
1751
1494
|
}
|
|
1752
1495
|
|
|
1753
|
-
class BaseListTemplateDirective {
|
|
1754
|
-
key = input.required({ ...(ngDevMode ? { debugName: "key" } : {}), alias: 'baseListTemplate' });
|
|
1755
|
-
templateRef = inject((TemplateRef));
|
|
1756
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: BaseListTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1757
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.5", type: BaseListTemplateDirective, isStandalone: true, selector: "ng-template[baseListTemplate]", inputs: { key: { classPropertyName: "key", publicName: "baseListTemplate", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
1758
|
-
}
|
|
1759
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: BaseListTemplateDirective, decorators: [{
|
|
1760
|
-
type: Directive,
|
|
1761
|
-
args: [{ selector: 'ng-template[baseListTemplate]' }]
|
|
1762
|
-
}], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseListTemplate", required: true }] }] } });
|
|
1763
|
-
|
|
1764
|
-
class BaseListComponent {
|
|
1765
|
-
translateAdapter = inject(TranslateService, { optional: true });
|
|
1766
|
-
router = inject(Router, { optional: true });
|
|
1767
|
-
messageService = inject(MessageService, { optional: true });
|
|
1768
|
-
confirmationService = inject(ConfirmationService, { optional: true });
|
|
1769
|
-
columns = input.required(...(ngDevMode ? [{ debugName: "columns" }] : []));
|
|
1770
|
-
actions = input([], ...(ngDevMode ? [{ debugName: "actions" }] : []));
|
|
1771
|
-
title = input('', ...(ngDevMode ? [{ debugName: "title" }] : []));
|
|
1772
|
-
showCreateButton = input(true, ...(ngDevMode ? [{ debugName: "showCreateButton" }] : []));
|
|
1773
|
-
searchable = input(false, ...(ngDevMode ? [{ debugName: "searchable" }] : []));
|
|
1774
|
-
pageSize = input(10, ...(ngDevMode ? [{ debugName: "pageSize" }] : []));
|
|
1775
|
-
emptyMessage = input('', ...(ngDevMode ? [{ debugName: "emptyMessage" }] : []));
|
|
1776
|
-
createButtonLabel = input('', ...(ngDevMode ? [{ debugName: "createButtonLabel" }] : []));
|
|
1777
|
-
createButtonIcon = input('pi pi-plus', ...(ngDevMode ? [{ debugName: "createButtonIcon" }] : []));
|
|
1778
|
-
data = input([], ...(ngDevMode ? [{ debugName: "data" }] : []));
|
|
1779
|
-
total = input(0, ...(ngDevMode ? [{ debugName: "total" }] : []));
|
|
1780
|
-
isLoading = input(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
|
|
1781
|
-
service = input(null, ...(ngDevMode ? [{ debugName: "service" }] : []));
|
|
1782
|
-
filter = input({}, ...(ngDevMode ? [{ debugName: "filter" }] : []));
|
|
1783
|
-
createRoute = input(null, ...(ngDevMode ? [{ debugName: "createRoute" }] : []));
|
|
1784
|
-
editRoute = input(null, ...(ngDevMode ? [{ debugName: "editRoute" }] : []));
|
|
1785
|
-
deleteConfirmField = input(null, ...(ngDevMode ? [{ debugName: "deleteConfirmField" }] : []));
|
|
1786
|
-
idField = input('id', ...(ngDevMode ? [{ debugName: "idField" }] : []));
|
|
1787
|
-
canEdit = input(null, ...(ngDevMode ? [{ debugName: "canEdit" }] : []));
|
|
1788
|
-
canDelete = input(null, ...(ngDevMode ? [{ debugName: "canDelete" }] : []));
|
|
1789
|
-
onCreate = output();
|
|
1790
|
-
onLazyLoad = output();
|
|
1791
|
-
onSearch = output();
|
|
1792
|
-
columnTemplates = contentChildren(BaseListTemplateDirective, ...(ngDevMode ? [{ debugName: "columnTemplates" }] : []));
|
|
1793
|
-
_first = signal(0, ...(ngDevMode ? [{ debugName: "_first" }] : []));
|
|
1794
|
-
_searchTerm = signal('', ...(ngDevMode ? [{ debugName: "_searchTerm" }] : []));
|
|
1795
|
-
first = this._first.asReadonly();
|
|
1796
|
-
searchTerm = this._searchTerm.asReadonly();
|
|
1797
|
-
effectiveData = computed(() => this.service()?.data() ?? this.data(), ...(ngDevMode ? [{ debugName: "effectiveData" }] : []));
|
|
1798
|
-
effectiveTotal = computed(() => this.service()?.total() ?? this.total(), ...(ngDevMode ? [{ debugName: "effectiveTotal" }] : []));
|
|
1799
|
-
effectiveIsLoading = computed(() => this.service()?.isLoading() ?? this.isLoading(), ...(ngDevMode ? [{ debugName: "effectiveIsLoading" }] : []));
|
|
1800
|
-
effectiveActions = computed(() => {
|
|
1801
|
-
const editRoute = this.editRoute();
|
|
1802
|
-
const deleteField = this.deleteConfirmField();
|
|
1803
|
-
const editAction = editRoute
|
|
1804
|
-
? [{ icon: 'pi pi-pencil', tooltip: 'shared.edit', severity: 'info',
|
|
1805
|
-
show: this.canEdit() ?? undefined, handler: (item) => this.handleEditItem(item) }]
|
|
1806
|
-
: [];
|
|
1807
|
-
const deleteAction = deleteField
|
|
1808
|
-
? [{ icon: 'pi pi-trash', tooltip: 'shared.delete', severity: 'danger',
|
|
1809
|
-
show: this.canDelete() ?? undefined, handler: (item) => this.handleDeleteItem(item) }]
|
|
1810
|
-
: [];
|
|
1811
|
-
return [...editAction, ...this.actions(), ...deleteAction];
|
|
1812
|
-
}, ...(ngDevMode ? [{ debugName: "effectiveActions" }] : []));
|
|
1813
|
-
visibleColumns = computed(() => this.columns().filter((c) => !c.hidden), ...(ngDevMode ? [{ debugName: "visibleColumns" }] : []));
|
|
1814
|
-
columnCount = computed(() => this.visibleColumns().length + (this.effectiveActions().length > 0 ? 1 : 0), ...(ngDevMode ? [{ debugName: "columnCount" }] : []));
|
|
1815
|
-
resolvedEmptyMessage = computed(() => this.emptyMessage() || this.t('shared.no.data'), ...(ngDevMode ? [{ debugName: "resolvedEmptyMessage" }] : []));
|
|
1816
|
-
resolvedCreateLabel = computed(() => this.createButtonLabel() || this.t('shared.create'), ...(ngDevMode ? [{ debugName: "resolvedCreateLabel" }] : []));
|
|
1817
|
-
handleLazyLoad(event) {
|
|
1818
|
-
const first = event.first ?? 0;
|
|
1819
|
-
const rows = event.rows ?? this.pageSize();
|
|
1820
|
-
this._first.set(first);
|
|
1821
|
-
const service = this.service();
|
|
1822
|
-
if (service) {
|
|
1823
|
-
service.fetchList(this.searchTerm(), {
|
|
1824
|
-
pagination: { currentPage: Math.floor(first / rows), pageSize: rows },
|
|
1825
|
-
filter: this.filter(),
|
|
1826
|
-
});
|
|
1827
|
-
}
|
|
1828
|
-
this.onLazyLoad.emit({ first, rows });
|
|
1829
|
-
}
|
|
1830
|
-
onSearchChange(value) {
|
|
1831
|
-
this._first.set(0);
|
|
1832
|
-
this._searchTerm.set(value);
|
|
1833
|
-
const service = this.service();
|
|
1834
|
-
if (service) {
|
|
1835
|
-
service.fetchList(value, {
|
|
1836
|
-
pagination: { currentPage: 0, pageSize: this.pageSize() },
|
|
1837
|
-
filter: this.filter(),
|
|
1838
|
-
});
|
|
1839
|
-
}
|
|
1840
|
-
this.onSearch.emit(value);
|
|
1841
|
-
}
|
|
1842
|
-
handleCreate() {
|
|
1843
|
-
const route = this.createRoute();
|
|
1844
|
-
if (route && this.router)
|
|
1845
|
-
this.router.navigate([route]);
|
|
1846
|
-
this.onCreate.emit();
|
|
1847
|
-
}
|
|
1848
|
-
handleEditItem(item) {
|
|
1849
|
-
const route = this.editRoute();
|
|
1850
|
-
const id = this.getFieldValueAsString(item, this.idField());
|
|
1851
|
-
if (route && id && this.router)
|
|
1852
|
-
this.router.navigate([route, id]);
|
|
1853
|
-
}
|
|
1854
|
-
handleDeleteItem(item) {
|
|
1855
|
-
const nameField = this.deleteConfirmField();
|
|
1856
|
-
const name = this.getFieldValueAsString(item, nameField);
|
|
1857
|
-
const id = this.getFieldValueAsString(item, this.idField());
|
|
1858
|
-
this.confirmationService?.confirm({
|
|
1859
|
-
message: this.t('shared.confirm.delete.item', { name }),
|
|
1860
|
-
header: this.t('shared.confirm.delete'),
|
|
1861
|
-
icon: 'pi pi-exclamation-triangle',
|
|
1862
|
-
acceptButtonStyleClass: 'p-button-danger',
|
|
1863
|
-
accept: async () => {
|
|
1864
|
-
try {
|
|
1865
|
-
const response = await this.service()?.delete({ id, type: 'delete' });
|
|
1866
|
-
this.messageService?.add({
|
|
1867
|
-
severity: 'success',
|
|
1868
|
-
summary: this.t('shared.success'),
|
|
1869
|
-
detail: response?.messageKey
|
|
1870
|
-
? this.t(response.messageKey, response.messageVariables)
|
|
1871
|
-
: (response?.message ?? ''),
|
|
1872
|
-
});
|
|
1873
|
-
this.service()?.reload();
|
|
1874
|
-
}
|
|
1875
|
-
catch {
|
|
1876
|
-
// handled by global interceptor
|
|
1877
|
-
}
|
|
1878
|
-
},
|
|
1879
|
-
});
|
|
1880
|
-
}
|
|
1881
|
-
getFieldValue(item, field) {
|
|
1882
|
-
return field
|
|
1883
|
-
.split('.')
|
|
1884
|
-
.reduce((obj, key) => (obj != null ? obj[key] : null), item);
|
|
1885
|
-
}
|
|
1886
|
-
getFieldValueAsString(item, field) {
|
|
1887
|
-
return String(this.getFieldValue(item, field) ?? '');
|
|
1888
|
-
}
|
|
1889
|
-
getTagConfig(col, value) {
|
|
1890
|
-
return col.tagMap?.[String(value)] ?? null;
|
|
1891
|
-
}
|
|
1892
|
-
getColumnTemplate(field) {
|
|
1893
|
-
return this.columnTemplates().find((t) => t.key() === field)?.templateRef ?? null;
|
|
1894
|
-
}
|
|
1895
|
-
truncateText(value, limit) {
|
|
1896
|
-
const str = String(value ?? '');
|
|
1897
|
-
return limit && str.length > limit ? `${str.slice(0, limit)}…` : str;
|
|
1898
|
-
}
|
|
1899
|
-
getCellClass(col) {
|
|
1900
|
-
switch (col.align) {
|
|
1901
|
-
case 'center': return 'text-center';
|
|
1902
|
-
case 'right': return 'text-right';
|
|
1903
|
-
default: return '';
|
|
1904
|
-
}
|
|
1905
|
-
}
|
|
1906
|
-
t(key, vars) {
|
|
1907
|
-
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
1908
|
-
}
|
|
1909
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: BaseListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1910
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: BaseListComponent, isStandalone: true, selector: "lib-base-list", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, createButtonLabel: { classPropertyName: "createButtonLabel", publicName: "createButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, createButtonIcon: { classPropertyName: "createButtonIcon", publicName: "createButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, createRoute: { classPropertyName: "createRoute", publicName: "createRoute", isSignal: true, isRequired: false, transformFunction: null }, editRoute: { classPropertyName: "editRoute", publicName: "editRoute", isSignal: true, isRequired: false, transformFunction: null }, deleteConfirmField: { classPropertyName: "deleteConfirmField", publicName: "deleteConfirmField", isSignal: true, isRequired: false, transformFunction: null }, idField: { classPropertyName: "idField", publicName: "idField", isSignal: true, isRequired: false, transformFunction: null }, canEdit: { classPropertyName: "canEdit", publicName: "canEdit", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onCreate: "onCreate", onLazyLoad: "onLazyLoad", onSearch: "onSearch" }, queries: [{ propertyName: "columnTemplates", predicate: BaseListTemplateDirective, isSignal: true }], ngImport: i0, template: "<p-card>\n <ng-template #header>\n @if (title() || searchable() || showCreateButton()) {\n <div class=\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 p-4\">\n @if (title()) {\n <h2 class=\"text-xl font-semibold m-0\">{{ title() }}</h2>\n }\n <div class=\"flex items-center gap-2\" [class.ml-auto]=\"!!title()\">\n @if (searchable()) {\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"t('shared.search')\"\n />\n </p-iconfield>\n }\n @if (showCreateButton()) {\n <p-button\n [icon]=\"createButtonIcon()\"\n [label]=\"resolvedCreateLabel()\"\n (onClick)=\"handleCreate()\"\n />\n }\n </div>\n </div>\n }\n </ng-template>\n\n <div class=\"overflow-x-auto\">\n <p-table\n [value]=\"effectiveData()\"\n [loading]=\"effectiveIsLoading()\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"effectiveTotal() > pageSize()\"\n [rows]=\"pageSize()\"\n [totalRecords]=\"effectiveTotal()\"\n [first]=\"first()\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"t('shared.pagination.report')\"\n class=\"p-datatable-striped\"\n >\n <ng-template #header>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <th [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" [class]=\"getCellClass(col)\">\n {{ col.header }}\n </th>\n }\n @if (effectiveActions().length > 0) {\n <th style=\"width: 120px; text-align: center;\">{{ t('shared.actions') }}</th>\n }\n </tr>\n </ng-template>\n\n <ng-template #body let-item>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <td [class]=\"getCellClass(col)\">\n @switch (col.type ?? 'text') {\n @case ('tag') {\n @if (getTagConfig(col, getFieldValue(item, col.field)); as tagCfg) {\n <p-tag [severity]=\"tagCfg.severity\" [value]=\"tagCfg.label ?? getFieldValueAsString(item, col.field)\" />\n } @else {\n {{ getFieldValueAsString(item, col.field) }}\n }\n }\n @case ('boolean') {\n <p-tag\n [severity]=\"getFieldValue(item, col.field) ? 'success' : 'danger'\"\n [value]=\"getFieldValue(item, col.field) ? t('shared.yes') : t('shared.no')\"\n />\n }\n @case ('date') {\n {{ getFieldValueAsString(item, col.field) | date: (col.dateFormat ?? 'dd/MM/yyyy') }}\n }\n @case ('number') {\n {{ getFieldValueAsString(item, col.field) | number }}\n }\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getColumnTemplate(col.field); context: { $implicit: item, field: col.field }\"\n />\n }\n @default {\n {{ truncateText(getFieldValue(item, col.field), col.truncate) }}\n }\n }\n </td>\n }\n @if (effectiveActions().length > 0) {\n <td>\n <div class=\"flex items-center justify-center gap-2\">\n @for (action of effectiveActions(); track $index) {\n @if (!action.show || action.show(item)) {\n <p-button\n [icon]=\"action.icon\"\n [severity]=\"action.severity\"\n [pTooltip]=\"action.tooltip ? t(action.tooltip) : ''\"\n [disabled]=\"action.disabled ? action.disabled(item) : false\"\n (onClick)=\"action.handler(item)\"\n [rounded]=\"true\"\n [text]=\"true\"\n />\n }\n }\n </div>\n </td>\n }\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnCount()\">\n <div class=\"flex flex-col items-center justify-center py-12 text-surface-400\">\n <i class=\"pi pi-inbox text-5xl mb-3\"></i>\n <span>{{ resolvedEmptyMessage() }}</span>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n</p-card>\n", dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i4.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "component", type: i5.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["hostName", "iconPosition", "styleClass"] }, { kind: "component", type: i6.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["hostName", "styleClass"] }, { kind: "directive", type: i8.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i8$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "directive", type: i10.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "showOnEllipsis", "pTooltip", "tooltipDisabled", "tooltipOptions", "appendTo", "ptTooltip", "pTooltipPT", "pTooltipUnstyled"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
1911
|
-
}
|
|
1912
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: BaseListComponent, decorators: [{
|
|
1913
|
-
type: Component,
|
|
1914
|
-
args: [{ selector: 'lib-base-list', imports: [AngularModule, PrimeModule], template: "<p-card>\n <ng-template #header>\n @if (title() || searchable() || showCreateButton()) {\n <div class=\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 p-4\">\n @if (title()) {\n <h2 class=\"text-xl font-semibold m-0\">{{ title() }}</h2>\n }\n <div class=\"flex items-center gap-2\" [class.ml-auto]=\"!!title()\">\n @if (searchable()) {\n <p-iconfield>\n <p-inputicon class=\"pi pi-search\" />\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"t('shared.search')\"\n />\n </p-iconfield>\n }\n @if (showCreateButton()) {\n <p-button\n [icon]=\"createButtonIcon()\"\n [label]=\"resolvedCreateLabel()\"\n (onClick)=\"handleCreate()\"\n />\n }\n </div>\n </div>\n }\n </ng-template>\n\n <div class=\"overflow-x-auto\">\n <p-table\n [value]=\"effectiveData()\"\n [loading]=\"effectiveIsLoading()\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"effectiveTotal() > pageSize()\"\n [rows]=\"pageSize()\"\n [totalRecords]=\"effectiveTotal()\"\n [first]=\"first()\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"t('shared.pagination.report')\"\n class=\"p-datatable-striped\"\n >\n <ng-template #header>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <th [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" [class]=\"getCellClass(col)\">\n {{ col.header }}\n </th>\n }\n @if (effectiveActions().length > 0) {\n <th style=\"width: 120px; text-align: center;\">{{ t('shared.actions') }}</th>\n }\n </tr>\n </ng-template>\n\n <ng-template #body let-item>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <td [class]=\"getCellClass(col)\">\n @switch (col.type ?? 'text') {\n @case ('tag') {\n @if (getTagConfig(col, getFieldValue(item, col.field)); as tagCfg) {\n <p-tag [severity]=\"tagCfg.severity\" [value]=\"tagCfg.label ?? getFieldValueAsString(item, col.field)\" />\n } @else {\n {{ getFieldValueAsString(item, col.field) }}\n }\n }\n @case ('boolean') {\n <p-tag\n [severity]=\"getFieldValue(item, col.field) ? 'success' : 'danger'\"\n [value]=\"getFieldValue(item, col.field) ? t('shared.yes') : t('shared.no')\"\n />\n }\n @case ('date') {\n {{ getFieldValueAsString(item, col.field) | date: (col.dateFormat ?? 'dd/MM/yyyy') }}\n }\n @case ('number') {\n {{ getFieldValueAsString(item, col.field) | number }}\n }\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getColumnTemplate(col.field); context: { $implicit: item, field: col.field }\"\n />\n }\n @default {\n {{ truncateText(getFieldValue(item, col.field), col.truncate) }}\n }\n }\n </td>\n }\n @if (effectiveActions().length > 0) {\n <td>\n <div class=\"flex items-center justify-center gap-2\">\n @for (action of effectiveActions(); track $index) {\n @if (!action.show || action.show(item)) {\n <p-button\n [icon]=\"action.icon\"\n [severity]=\"action.severity\"\n [pTooltip]=\"action.tooltip ? t(action.tooltip) : ''\"\n [disabled]=\"action.disabled ? action.disabled(item) : false\"\n (onClick)=\"action.handler(item)\"\n [rounded]=\"true\"\n [text]=\"true\"\n />\n }\n }\n </div>\n </td>\n }\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnCount()\">\n <div class=\"flex flex-col items-center justify-center py-12 text-surface-400\">\n <i class=\"pi pi-inbox text-5xl mb-3\"></i>\n <span>{{ resolvedEmptyMessage() }}</span>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n</p-card>\n" }]
|
|
1915
|
-
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], showCreateButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCreateButton", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], createButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "createButtonLabel", required: false }] }], createButtonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "createButtonIcon", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], service: [{ type: i0.Input, args: [{ isSignal: true, alias: "service", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], createRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "createRoute", required: false }] }], editRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "editRoute", required: false }] }], deleteConfirmField: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteConfirmField", required: false }] }], idField: [{ type: i0.Input, args: [{ isSignal: true, alias: "idField", required: false }] }], canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDelete", required: false }] }], onCreate: [{ type: i0.Output, args: ["onCreate"] }], onLazyLoad: [{ type: i0.Output, args: ["onLazyLoad"] }], onSearch: [{ type: i0.Output, args: ["onSearch"] }], columnTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BaseListTemplateDirective), { isSignal: true }] }] } });
|
|
1916
|
-
|
|
1917
1496
|
class BaseFormTemplateDirective {
|
|
1918
|
-
key = input.required({ ...(ngDevMode ? { debugName: "key" } : {}), alias: 'baseFormTemplate' });
|
|
1497
|
+
key = input.required({ ...(ngDevMode ? { debugName: "key" } : /* istanbul ignore next */ {}), alias: 'baseFormTemplate' });
|
|
1919
1498
|
templateRef = inject((TemplateRef));
|
|
1920
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1921
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
1499
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1500
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BaseFormTemplateDirective, isStandalone: true, selector: "ng-template[baseFormTemplate]", inputs: { key: { classPropertyName: "key", publicName: "baseFormTemplate", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
1922
1501
|
}
|
|
1923
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1502
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormTemplateDirective, decorators: [{
|
|
1924
1503
|
type: Directive,
|
|
1925
1504
|
args: [{ selector: 'ng-template[baseFormTemplate]' }]
|
|
1926
1505
|
}], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseFormTemplate", required: true }] }] } });
|
|
@@ -1929,47 +1508,75 @@ class BaseFormComponent {
|
|
|
1929
1508
|
translateAdapter = inject(TranslateService, { optional: true });
|
|
1930
1509
|
router = inject(Router, { optional: true });
|
|
1931
1510
|
messageService = inject(MessageService, { optional: true });
|
|
1932
|
-
fields = input.required(
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1511
|
+
fields = input.required(/* @ts-ignore */
|
|
1512
|
+
...(ngDevMode ? [{ debugName: "fields" }] : /* istanbul ignore next */ []));
|
|
1513
|
+
title = input('', /* @ts-ignore */
|
|
1514
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1515
|
+
createTitle = input('', /* @ts-ignore */
|
|
1516
|
+
...(ngDevMode ? [{ debugName: "createTitle" }] : /* istanbul ignore next */ []));
|
|
1517
|
+
editTitle = input('', /* @ts-ignore */
|
|
1518
|
+
...(ngDevMode ? [{ debugName: "editTitle" }] : /* istanbul ignore next */ []));
|
|
1519
|
+
columns = input(2, /* @ts-ignore */
|
|
1520
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1521
|
+
submitLabel = input('', /* @ts-ignore */
|
|
1522
|
+
...(ngDevMode ? [{ debugName: "submitLabel" }] : /* istanbul ignore next */ []));
|
|
1523
|
+
cancelLabel = input('', /* @ts-ignore */
|
|
1524
|
+
...(ngDevMode ? [{ debugName: "cancelLabel" }] : /* istanbul ignore next */ []));
|
|
1525
|
+
isLoading = input(false, /* @ts-ignore */
|
|
1526
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
1527
|
+
isEditMode = input(false, /* @ts-ignore */
|
|
1528
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
1529
|
+
initialValue = input({}, /* @ts-ignore */
|
|
1530
|
+
...(ngDevMode ? [{ debugName: "initialValue" }] : /* istanbul ignore next */ []));
|
|
1531
|
+
service = input(null, /* @ts-ignore */
|
|
1532
|
+
...(ngDevMode ? [{ debugName: "service" }] : /* istanbul ignore next */ []));
|
|
1533
|
+
editId = input(null, /* @ts-ignore */
|
|
1534
|
+
...(ngDevMode ? [{ debugName: "editId" }] : /* istanbul ignore next */ []));
|
|
1535
|
+
cancelRoute = input(null, /* @ts-ignore */
|
|
1536
|
+
...(ngDevMode ? [{ debugName: "cancelRoute" }] : /* istanbul ignore next */ []));
|
|
1537
|
+
navigateOnSuccess = input(null, /* @ts-ignore */
|
|
1538
|
+
...(ngDevMode ? [{ debugName: "navigateOnSuccess" }] : /* istanbul ignore next */ []));
|
|
1539
|
+
mapToRequest = input(null, /* @ts-ignore */
|
|
1540
|
+
...(ngDevMode ? [{ debugName: "mapToRequest" }] : /* istanbul ignore next */ []));
|
|
1541
|
+
mapFromEntity = input(null, /* @ts-ignore */
|
|
1542
|
+
...(ngDevMode ? [{ debugName: "mapFromEntity" }] : /* istanbul ignore next */ []));
|
|
1948
1543
|
onSubmit = output();
|
|
1949
1544
|
onCancel = output();
|
|
1950
1545
|
onValueChange = output();
|
|
1951
|
-
fieldTemplates = contentChildren(BaseFormTemplateDirective,
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1546
|
+
fieldTemplates = contentChildren(BaseFormTemplateDirective, /* @ts-ignore */
|
|
1547
|
+
...(ngDevMode ? [{ debugName: "fieldTemplates" }] : /* istanbul ignore next */ []));
|
|
1548
|
+
_formData = signal({}, /* @ts-ignore */
|
|
1549
|
+
...(ngDevMode ? [{ debugName: "_formData" }] : /* istanbul ignore next */ []));
|
|
1550
|
+
_submitted = signal(false, /* @ts-ignore */
|
|
1551
|
+
...(ngDevMode ? [{ debugName: "_submitted" }] : /* istanbul ignore next */ []));
|
|
1552
|
+
_isLoadingInternal = signal(false, /* @ts-ignore */
|
|
1553
|
+
...(ngDevMode ? [{ debugName: "_isLoadingInternal" }] : /* istanbul ignore next */ []));
|
|
1554
|
+
_touchedFields = signal(new Set(), /* @ts-ignore */
|
|
1555
|
+
...(ngDevMode ? [{ debugName: "_touchedFields" }] : /* istanbul ignore next */ []));
|
|
1556
|
+
_visiblePasswordFields = signal(new Set(), /* @ts-ignore */
|
|
1557
|
+
...(ngDevMode ? [{ debugName: "_visiblePasswordFields" }] : /* istanbul ignore next */ []));
|
|
1956
1558
|
formData = this._formData.asReadonly();
|
|
1957
1559
|
submitted = this._submitted.asReadonly();
|
|
1958
|
-
effectiveIsEditMode = computed(() => this.isEditMode() || !!this.editId(),
|
|
1959
|
-
|
|
1960
|
-
|
|
1560
|
+
effectiveIsEditMode = computed(() => this.isEditMode() || !!this.editId(), /* @ts-ignore */
|
|
1561
|
+
...(ngDevMode ? [{ debugName: "effectiveIsEditMode" }] : /* istanbul ignore next */ []));
|
|
1562
|
+
effectiveIsLoading = computed(() => this.isLoading() || this._isLoadingInternal(), /* @ts-ignore */
|
|
1563
|
+
...(ngDevMode ? [{ debugName: "effectiveIsLoading" }] : /* istanbul ignore next */ []));
|
|
1564
|
+
isFormValid = computed(() => this.checkValidity(), /* @ts-ignore */
|
|
1565
|
+
...(ngDevMode ? [{ debugName: "isFormValid" }] : /* istanbul ignore next */ []));
|
|
1961
1566
|
resolvedTitle = computed(() => {
|
|
1962
1567
|
if (this.effectiveIsEditMode())
|
|
1963
1568
|
return this.editTitle() || this.title();
|
|
1964
1569
|
return this.createTitle() || this.title();
|
|
1965
|
-
},
|
|
1570
|
+
}, /* @ts-ignore */
|
|
1571
|
+
...(ngDevMode ? [{ debugName: "resolvedTitle" }] : /* istanbul ignore next */ []));
|
|
1966
1572
|
gridClass = computed(() => {
|
|
1967
1573
|
switch (this.columns()) {
|
|
1968
1574
|
case 1: return 'grid-cols-1';
|
|
1969
1575
|
case 3: return 'grid-cols-1 md:grid-cols-3';
|
|
1970
1576
|
default: return 'grid-cols-1 md:grid-cols-2';
|
|
1971
1577
|
}
|
|
1972
|
-
},
|
|
1578
|
+
}, /* @ts-ignore */
|
|
1579
|
+
...(ngDevMode ? [{ debugName: "gridClass" }] : /* istanbul ignore next */ []));
|
|
1973
1580
|
constructor() {
|
|
1974
1581
|
effect(() => {
|
|
1975
1582
|
const fields = this.fields();
|
|
@@ -2016,6 +1623,19 @@ class BaseFormComponent {
|
|
|
2016
1623
|
markFieldTouched(key) {
|
|
2017
1624
|
this._touchedFields.update((set) => new Set([...set, key]));
|
|
2018
1625
|
}
|
|
1626
|
+
isPasswordVisible(key) {
|
|
1627
|
+
return this._visiblePasswordFields().has(key);
|
|
1628
|
+
}
|
|
1629
|
+
togglePasswordVisibility(key) {
|
|
1630
|
+
this._visiblePasswordFields.update((set) => {
|
|
1631
|
+
const next = new Set(set);
|
|
1632
|
+
if (next.has(key))
|
|
1633
|
+
next.delete(key);
|
|
1634
|
+
else
|
|
1635
|
+
next.add(key);
|
|
1636
|
+
return next;
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
2019
1639
|
isFieldInvalid(field) {
|
|
2020
1640
|
const isActive = this._submitted() || this._touchedFields().has(field.key);
|
|
2021
1641
|
if (!isActive || !field.required)
|
|
@@ -2107,35 +1727,208 @@ class BaseFormComponent {
|
|
|
2107
1727
|
return '';
|
|
2108
1728
|
}
|
|
2109
1729
|
}
|
|
2110
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2111
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: BaseFormComponent, isStandalone: true, selector: "lib-base-form", inputs: { fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, createTitle: { classPropertyName: "createTitle", publicName: "createTitle", isSignal: true, isRequired: false, transformFunction: null }, editTitle: { classPropertyName: "editTitle", publicName: "editTitle", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, submitLabel: { classPropertyName: "submitLabel", publicName: "submitLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null }, service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, editId: { classPropertyName: "editId", publicName: "editId", isSignal: true, isRequired: false, transformFunction: null }, cancelRoute: { classPropertyName: "cancelRoute", publicName: "cancelRoute", isSignal: true, isRequired: false, transformFunction: null }, navigateOnSuccess: { classPropertyName: "navigateOnSuccess", publicName: "navigateOnSuccess", isSignal: true, isRequired: false, transformFunction: null }, mapToRequest: { classPropertyName: "mapToRequest", publicName: "mapToRequest", isSignal: true, isRequired: false, transformFunction: null }, mapFromEntity: { classPropertyName: "mapFromEntity", publicName: "mapFromEntity", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSubmit: "onSubmit", onCancel: "onCancel", onValueChange: "onValueChange" }, queries: [{ propertyName: "fieldTemplates", predicate: BaseFormTemplateDirective, isSignal: true }], ngImport: i0, template: "<p-card>\n <ng-template #header>\n @if (resolvedTitle()) {\n <div class=\"flex justify-between items-center p-4\">\n <h2 class=\"text-xl font-semibold m-0\">{{ resolvedTitle() }}</h2>\n </div>\n }\n </ng-template>\n\n <form (ngSubmit)=\"handleSubmit()\" novalidate>\n <div class=\"grid gap-4\" [class]=\"gridClass()\">\n @for (field of fields(); track field.key) {\n <div class=\"flex flex-col gap-2\" [class.col-span-full]=\"field.fullWidth\">\n @if (field.type !== 'checkbox' && field.type !== 'toggle') {\n <label [for]=\"field.key\" class=\"font-medium\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n }\n\n @switch (field.type) {\n @case ('text') {\n <input\n pInputText\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('email') {\n <input\n pInputText\n type=\"email\"\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('password') {\n <p-password\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [feedback]=\"false\"\n [toggleMask]=\"true\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('number') {\n <p-inputnumber\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [min]=\"field.min ?? undefined\"\n [max]=\"field.max ?? undefined\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('textarea') {\n <textarea\n pTextarea\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [rows]=\"field.rows ?? 3\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n ></textarea>\n }\n\n @case ('select') {\n <p-select\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('multiselect') {\n <p-multiselect\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('date') {\n <p-datepicker\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [minDate]=\"field.minDate ?? undefined\"\n [maxDate]=\"field.maxDate ?? undefined\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('checkbox') {\n <div class=\"flex items-center gap-2 h-9\">\n <p-checkbox\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n [binary]=\"true\"\n [invalid]=\"isFieldInvalid(field)\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('toggle') {\n <div class=\"flex items-center gap-3 h-9\">\n <p-toggleswitch\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getFieldTemplate(field.key); context: { $implicit: getFieldValue(field.key), field: field }\"\n />\n }\n }\n\n @if (isFieldInvalid(field)) {\n <small class=\"text-red-500\">{{ field.label }} {{ t('shared.required') }}</small>\n }\n\n @if (field.hint && !isFieldInvalid(field)) {\n <small class=\"text-surface-400\">{{ field.hint }}</small>\n }\n </div>\n }\n\n <div class=\"col-span-full flex justify-end gap-4 pt-4\">\n <p-button\n type=\"button\"\n [label]=\"cancelLabel() || t('shared.cancel')\"\n severity=\"secondary\"\n [outlined]=\"true\"\n [disabled]=\"effectiveIsLoading()\"\n (onClick)=\"handleCancel()\"\n />\n <p-button\n type=\"submit\"\n [label]=\"submitLabel() || (effectiveIsEditMode() ? t('shared.update') : t('shared.save'))\"\n [loading]=\"effectiveIsLoading()\"\n [disabled]=\"!isFormValid() || effectiveIsLoading()\"\n />\n </div>\n </div>\n </form>\n</p-card>\n", dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: PrimeModule }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["hostName", "type", "badge", "disabled", "raised", "rounded", "text", "plain", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "iconPos", "icon", "label", "loading", "loadingIcon", "severity", "buttonProps", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: i4.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "component", type: i5$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["hostName", "value", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "inputStyle", "styleClass", "inputClass", "indeterminate", "formControl", "checkboxIcon", "readonly", "autofocus", "trueValue", "falseValue", "variant", "size"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "component", type: i6$1.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i7.InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "directive", type: i8.InputText, selector: "[pInputText]", inputs: ["hostName", "ptInputText", "pInputTextPT", "pInputTextUnstyled", "pSize", "variant", "fluid", "invalid"] }, { kind: "component", type: i9$1.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i10$1.Password, selector: "p-password", inputs: ["ariaLabel", "ariaLabelledBy", "label", "promptLabel", "mediumRegex", "strongRegex", "weakLabel", "mediumLabel", "maxLength", "strongLabel", "inputId", "feedback", "toggleMask", "inputStyleClass", "styleClass", "inputStyle", "showTransitionOptions", "hideTransitionOptions", "autocomplete", "placeholder", "showClear", "autofocus", "tabindex", "appendTo", "motionOptions", "overlayOptions"], outputs: ["onFocus", "onBlur", "onClear"] }, { kind: "component", type: i11.Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "directive", type: i12.Textarea, selector: "[pTextarea], [pInputTextarea]", inputs: ["pTextareaPT", "pTextareaUnstyled", "autoResize", "pSize", "variant", "fluid", "invalid"], outputs: ["onResize"] }, { kind: "component", type: i13.ToggleSwitch, selector: "p-toggleswitch, p-toggleSwitch, p-toggle-switch", inputs: ["styleClass", "tabindex", "inputId", "readonly", "trueValue", "falseValue", "ariaLabel", "size", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }] });
|
|
1730
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1731
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BaseFormComponent, isStandalone: true, selector: "lib-base-form", inputs: { fields: { classPropertyName: "fields", publicName: "fields", isSignal: true, isRequired: true, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, createTitle: { classPropertyName: "createTitle", publicName: "createTitle", isSignal: true, isRequired: false, transformFunction: null }, editTitle: { classPropertyName: "editTitle", publicName: "editTitle", isSignal: true, isRequired: false, transformFunction: null }, columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: false, transformFunction: null }, submitLabel: { classPropertyName: "submitLabel", publicName: "submitLabel", isSignal: true, isRequired: false, transformFunction: null }, cancelLabel: { classPropertyName: "cancelLabel", publicName: "cancelLabel", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: false, transformFunction: null }, initialValue: { classPropertyName: "initialValue", publicName: "initialValue", isSignal: true, isRequired: false, transformFunction: null }, service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, editId: { classPropertyName: "editId", publicName: "editId", isSignal: true, isRequired: false, transformFunction: null }, cancelRoute: { classPropertyName: "cancelRoute", publicName: "cancelRoute", isSignal: true, isRequired: false, transformFunction: null }, navigateOnSuccess: { classPropertyName: "navigateOnSuccess", publicName: "navigateOnSuccess", isSignal: true, isRequired: false, transformFunction: null }, mapToRequest: { classPropertyName: "mapToRequest", publicName: "mapToRequest", isSignal: true, isRequired: false, transformFunction: null }, mapFromEntity: { classPropertyName: "mapFromEntity", publicName: "mapFromEntity", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onSubmit: "onSubmit", onCancel: "onCancel", onValueChange: "onValueChange" }, queries: [{ propertyName: "fieldTemplates", predicate: BaseFormTemplateDirective, isSignal: true }], ngImport: i0, template: "<f-card>\n <ng-template #header>\n @if (resolvedTitle()) {\n <div class=\"flex justify-between items-center p-4\">\n <h2 class=\"text-xl font-semibold m-0\">{{ resolvedTitle() }}</h2>\n </div>\n }\n </ng-template>\n\n <form (ngSubmit)=\"handleSubmit()\" novalidate>\n <div class=\"grid gap-4\" [class]=\"gridClass()\">\n @for (field of fields(); track field.key) {\n <div class=\"flex flex-col gap-2\" [class.col-span-full]=\"field.fullWidth\">\n @if (field.type !== 'checkbox' && field.type !== 'toggle') {\n <label [for]=\"field.key\" class=\"font-medium\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n }\n\n @switch (field.type) {\n @case ('text') {\n <input\n fInputText\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('email') {\n <input\n fInputText\n type=\"email\"\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('password') {\n <f-iconfield iconPosition=\"right\" class=\"w-full\">\n <input\n fInputText\n fInputPassword\n [id]=\"field.key\"\n [name]=\"field.key\"\n [mask]=\"!isPasswordVisible(field.key)\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n <f-inputicon\n class=\"cursor-pointer\"\n (click)=\"togglePasswordVisibility(field.key)\"\n >\n <ui-icon [name]=\"isPasswordVisible(field.key) ? 'eye-slash' : 'eye'\"></ui-icon>\n </f-inputicon>\n </f-iconfield>\n }\n\n @case ('number') {\n <f-inputnumber\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [min]=\"field.min ?? null\"\n [max]=\"field.max ?? null\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('textarea') {\n <textarea\n fTextarea\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [rows]=\"field.rows ?? 3\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n ></textarea>\n }\n\n @case ('select') {\n <f-select\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('multiselect') {\n <f-multiselect\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('date') {\n <f-datepicker\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [minDate]=\"field.minDate ?? null\"\n [maxDate]=\"field.maxDate ?? null\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('checkbox') {\n <div class=\"flex items-center gap-2 h-9\">\n <f-checkbox\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n [binary]=\"true\"\n [invalid]=\"isFieldInvalid(field)\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('toggle') {\n <div class=\"flex items-center gap-3 h-9\">\n <f-toggleswitch\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getFieldTemplate(field.key); context: { $implicit: getFieldValue(field.key), field: field }\"\n />\n }\n }\n\n @if (isFieldInvalid(field)) {\n <small class=\"text-red-500\">{{ field.label }} {{ t('shared.required') }}</small>\n }\n\n @if (field.hint && !isFieldInvalid(field)) {\n <small class=\"text-surface-400\">{{ field.hint }}</small>\n }\n </div>\n }\n\n <div class=\"col-span-full flex justify-end gap-4 pt-4\">\n <button\n fButton\n type=\"button\"\n severity=\"secondary\"\n [outlined]=\"true\"\n [disabled]=\"effectiveIsLoading()\"\n (click)=\"handleCancel()\"\n >\n <span pButtonLabel>{{ cancelLabel() || t('shared.cancel') }}</span>\n </button>\n <button\n fButton\n type=\"submit\"\n [disabled]=\"!isFormValid() || effectiveIsLoading()\"\n >\n @if (effectiveIsLoading()) {\n <ui-icon pButtonIcon name=\"spinner\" [spin]=\"true\"></ui-icon>\n }\n <span pButtonLabel>{{ submitLabel() || (effectiveIsEditMode() ? t('shared.update') : t('shared.save')) }}</span>\n </button>\n </div>\n </div>\n </form>\n</f-card>\n", dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]):not([formArray]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i3.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i3.CheckboxComponent, selector: "f-checkbox", inputs: ["label", "binary", "disabled", "inputId", "invalid", "indeterminate", "touched", "styleClass", "checked"], outputs: ["onChange", "onBlur", "touch", "checkedChange"] }, { kind: "component", type: i3.DatePickerComponent, selector: "f-datepicker", inputs: ["placeholder", "dateFormat", "disabled", "showTime", "selectionMode", "minDate", "maxDate", "inputId", "invalid", "touched", "showClear", "inputStyleClass", "showIcon", "showButtonBar", "appendTo", "styleClass"], outputs: ["onBlur"] }, { kind: "component", type: i3.IconFieldComponent, selector: "f-iconfield" }, { kind: "component", type: i3.InputIconComponent, selector: "f-inputicon", inputs: ["styleClass"] }, { kind: "component", type: i3.InputNumberComponent, selector: "f-inputnumber", inputs: ["min", "max", "step", "showButtons", "disabled", "inputId", "invalid", "touched", "placeholder", "prefix", "suffix", "useGrouping", "buttonLayout", "inputStyleClass"], outputs: ["onBlur"] }, { kind: "directive", type: i3.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "directive", type: i3.InputPasswordDirective, selector: "[fInputPassword]", inputs: ["mask"] }, { kind: "component", type: i3.MultiSelectComponent, selector: "f-multiselect", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "inputId", "invalid", "touched", "showClear", "optionDisabled", "display", "maxSelectedLabels", "selectionLimit", "showToggleAll", "styleClass"], outputs: ["onBlur"] }, { kind: "component", type: i3.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "directive", type: i3.TextareaDirective, selector: "[fTextarea]", inputs: ["invalid", "touched"] }, { kind: "component", type: i3.ToggleSwitchComponent, selector: "f-toggleswitch", inputs: ["disabled", "readonly", "invalid", "ariaLabel", "trueValue", "falseValue", "inputId"] }, { kind: "component", type: i3.CardComponent, selector: "f-card", inputs: ["header", "subheader", "styleClass"] }, { kind: "component", type: i3.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }] });
|
|
2112
1732
|
}
|
|
2113
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1733
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseFormComponent, decorators: [{
|
|
2114
1734
|
type: Component,
|
|
2115
|
-
args: [{ selector: 'lib-base-form', imports: [AngularModule,
|
|
1735
|
+
args: [{ selector: 'lib-base-form', imports: [AngularModule, UiModule], template: "<f-card>\n <ng-template #header>\n @if (resolvedTitle()) {\n <div class=\"flex justify-between items-center p-4\">\n <h2 class=\"text-xl font-semibold m-0\">{{ resolvedTitle() }}</h2>\n </div>\n }\n </ng-template>\n\n <form (ngSubmit)=\"handleSubmit()\" novalidate>\n <div class=\"grid gap-4\" [class]=\"gridClass()\">\n @for (field of fields(); track field.key) {\n <div class=\"flex flex-col gap-2\" [class.col-span-full]=\"field.fullWidth\">\n @if (field.type !== 'checkbox' && field.type !== 'toggle') {\n <label [for]=\"field.key\" class=\"font-medium\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n }\n\n @switch (field.type) {\n @case ('text') {\n <input\n fInputText\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('email') {\n <input\n fInputText\n type=\"email\"\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('password') {\n <f-iconfield iconPosition=\"right\" class=\"w-full\">\n <input\n fInputText\n fInputPassword\n [id]=\"field.key\"\n [name]=\"field.key\"\n [mask]=\"!isPasswordVisible(field.key)\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n <f-inputicon\n class=\"cursor-pointer\"\n (click)=\"togglePasswordVisibility(field.key)\"\n >\n <ui-icon [name]=\"isPasswordVisible(field.key) ? 'eye-slash' : 'eye'\"></ui-icon>\n </f-inputicon>\n </f-iconfield>\n }\n\n @case ('number') {\n <f-inputnumber\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [min]=\"field.min ?? null\"\n [max]=\"field.max ?? null\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('textarea') {\n <textarea\n fTextarea\n [id]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (blur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [rows]=\"field.rows ?? 3\"\n [class.ng-invalid]=\"isFieldInvalid(field)\"\n [class.ng-dirty]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n ></textarea>\n }\n\n @case ('select') {\n <f-select\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('multiselect') {\n <f-multiselect\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [options]=\"field.options ?? []\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [placeholder]=\"field.placeholder ?? t('shared.select.placeholder')\"\n [disabled]=\"field.disabled ?? false\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n />\n }\n\n @case ('date') {\n <f-datepicker\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n (onBlur)=\"markFieldTouched(field.key)\"\n [placeholder]=\"field.placeholder ?? ''\"\n [disabled]=\"field.disabled ?? false\"\n [minDate]=\"field.minDate ?? null\"\n [maxDate]=\"field.maxDate ?? null\"\n [invalid]=\"isFieldInvalid(field)\"\n class=\"w-full\"\n inputStyleClass=\"w-full\"\n />\n }\n\n @case ('checkbox') {\n <div class=\"flex items-center gap-2 h-9\">\n <f-checkbox\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n [binary]=\"true\"\n [invalid]=\"isFieldInvalid(field)\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('toggle') {\n <div class=\"flex items-center gap-3 h-9\">\n <f-toggleswitch\n [inputId]=\"field.key\"\n [name]=\"field.key\"\n [ngModel]=\"getFieldValue(field.key)\"\n (ngModelChange)=\"setFieldValue(field.key, $event)\"\n [disabled]=\"field.disabled ?? false\"\n />\n <label [for]=\"field.key\" class=\"font-medium cursor-pointer select-none\">\n {{ field.label }}\n @if (field.required) {\n <span class=\"text-red-500 ml-1\">*</span>\n }\n </label>\n </div>\n }\n\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getFieldTemplate(field.key); context: { $implicit: getFieldValue(field.key), field: field }\"\n />\n }\n }\n\n @if (isFieldInvalid(field)) {\n <small class=\"text-red-500\">{{ field.label }} {{ t('shared.required') }}</small>\n }\n\n @if (field.hint && !isFieldInvalid(field)) {\n <small class=\"text-surface-400\">{{ field.hint }}</small>\n }\n </div>\n }\n\n <div class=\"col-span-full flex justify-end gap-4 pt-4\">\n <button\n fButton\n type=\"button\"\n severity=\"secondary\"\n [outlined]=\"true\"\n [disabled]=\"effectiveIsLoading()\"\n (click)=\"handleCancel()\"\n >\n <span pButtonLabel>{{ cancelLabel() || t('shared.cancel') }}</span>\n </button>\n <button\n fButton\n type=\"submit\"\n [disabled]=\"!isFormValid() || effectiveIsLoading()\"\n >\n @if (effectiveIsLoading()) {\n <ui-icon pButtonIcon name=\"spinner\" [spin]=\"true\"></ui-icon>\n }\n <span pButtonLabel>{{ submitLabel() || (effectiveIsEditMode() ? t('shared.update') : t('shared.save')) }}</span>\n </button>\n </div>\n </div>\n </form>\n</f-card>\n" }]
|
|
2116
1736
|
}], ctorParameters: () => [], propDecorators: { fields: [{ type: i0.Input, args: [{ isSignal: true, alias: "fields", required: true }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], createTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "createTitle", required: false }] }], editTitle: [{ type: i0.Input, args: [{ isSignal: true, alias: "editTitle", required: false }] }], columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: false }] }], submitLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "submitLabel", required: false }] }], cancelLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelLabel", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], isEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isEditMode", required: false }] }], initialValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "initialValue", required: false }] }], service: [{ type: i0.Input, args: [{ isSignal: true, alias: "service", required: false }] }], editId: [{ type: i0.Input, args: [{ isSignal: true, alias: "editId", required: false }] }], cancelRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancelRoute", required: false }] }], navigateOnSuccess: [{ type: i0.Input, args: [{ isSignal: true, alias: "navigateOnSuccess", required: false }] }], mapToRequest: [{ type: i0.Input, args: [{ isSignal: true, alias: "mapToRequest", required: false }] }], mapFromEntity: [{ type: i0.Input, args: [{ isSignal: true, alias: "mapFromEntity", required: false }] }], onSubmit: [{ type: i0.Output, args: ["onSubmit"] }], onCancel: [{ type: i0.Output, args: ["onCancel"] }], onValueChange: [{ type: i0.Output, args: ["onValueChange"] }], fieldTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BaseFormTemplateDirective), { isSignal: true }] }] } });
|
|
2117
1737
|
|
|
2118
|
-
class
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
1738
|
+
class BaseListTemplateDirective {
|
|
1739
|
+
key = input.required({ ...(ngDevMode ? { debugName: "key" } : /* istanbul ignore next */ {}), alias: 'baseListTemplate' });
|
|
1740
|
+
templateRef = inject((TemplateRef));
|
|
1741
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseListTemplateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1742
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BaseListTemplateDirective, isStandalone: true, selector: "ng-template[baseListTemplate]", inputs: { key: { classPropertyName: "key", publicName: "baseListTemplate", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0 });
|
|
1743
|
+
}
|
|
1744
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseListTemplateDirective, decorators: [{
|
|
1745
|
+
type: Directive,
|
|
1746
|
+
args: [{ selector: 'ng-template[baseListTemplate]' }]
|
|
1747
|
+
}], propDecorators: { key: [{ type: i0.Input, args: [{ isSignal: true, alias: "baseListTemplate", required: true }] }] } });
|
|
1748
|
+
|
|
1749
|
+
class BaseListComponent {
|
|
1750
|
+
translateAdapter = inject(TranslateService, { optional: true });
|
|
1751
|
+
router = inject(Router, { optional: true });
|
|
1752
|
+
messageService = inject(MessageService, { optional: true });
|
|
1753
|
+
confirmationService = inject(ConfirmationService, { optional: true });
|
|
1754
|
+
columns = input.required(/* @ts-ignore */
|
|
1755
|
+
...(ngDevMode ? [{ debugName: "columns" }] : /* istanbul ignore next */ []));
|
|
1756
|
+
actions = input([], /* @ts-ignore */
|
|
1757
|
+
...(ngDevMode ? [{ debugName: "actions" }] : /* istanbul ignore next */ []));
|
|
1758
|
+
title = input('', /* @ts-ignore */
|
|
1759
|
+
...(ngDevMode ? [{ debugName: "title" }] : /* istanbul ignore next */ []));
|
|
1760
|
+
showCreateButton = input(true, /* @ts-ignore */
|
|
1761
|
+
...(ngDevMode ? [{ debugName: "showCreateButton" }] : /* istanbul ignore next */ []));
|
|
1762
|
+
searchable = input(false, /* @ts-ignore */
|
|
1763
|
+
...(ngDevMode ? [{ debugName: "searchable" }] : /* istanbul ignore next */ []));
|
|
1764
|
+
pageSize = input(10, /* @ts-ignore */
|
|
1765
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
1766
|
+
emptyMessage = input('', /* @ts-ignore */
|
|
1767
|
+
...(ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []));
|
|
1768
|
+
createButtonLabel = input('', /* @ts-ignore */
|
|
1769
|
+
...(ngDevMode ? [{ debugName: "createButtonLabel" }] : /* istanbul ignore next */ []));
|
|
1770
|
+
createButtonIcon = input('plus', /* @ts-ignore */
|
|
1771
|
+
...(ngDevMode ? [{ debugName: "createButtonIcon" }] : /* istanbul ignore next */ []));
|
|
1772
|
+
data = input([], /* @ts-ignore */
|
|
1773
|
+
...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
1774
|
+
total = input(0, /* @ts-ignore */
|
|
1775
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
1776
|
+
isLoading = input(false, /* @ts-ignore */
|
|
1777
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
1778
|
+
service = input(null, /* @ts-ignore */
|
|
1779
|
+
...(ngDevMode ? [{ debugName: "service" }] : /* istanbul ignore next */ []));
|
|
1780
|
+
filter = input({}, /* @ts-ignore */
|
|
1781
|
+
...(ngDevMode ? [{ debugName: "filter" }] : /* istanbul ignore next */ []));
|
|
1782
|
+
createRoute = input(null, /* @ts-ignore */
|
|
1783
|
+
...(ngDevMode ? [{ debugName: "createRoute" }] : /* istanbul ignore next */ []));
|
|
1784
|
+
editRoute = input(null, /* @ts-ignore */
|
|
1785
|
+
...(ngDevMode ? [{ debugName: "editRoute" }] : /* istanbul ignore next */ []));
|
|
1786
|
+
deleteConfirmField = input(null, /* @ts-ignore */
|
|
1787
|
+
...(ngDevMode ? [{ debugName: "deleteConfirmField" }] : /* istanbul ignore next */ []));
|
|
1788
|
+
idField = input('id', /* @ts-ignore */
|
|
1789
|
+
...(ngDevMode ? [{ debugName: "idField" }] : /* istanbul ignore next */ []));
|
|
1790
|
+
canEdit = input(null, /* @ts-ignore */
|
|
1791
|
+
...(ngDevMode ? [{ debugName: "canEdit" }] : /* istanbul ignore next */ []));
|
|
1792
|
+
canDelete = input(null, /* @ts-ignore */
|
|
1793
|
+
...(ngDevMode ? [{ debugName: "canDelete" }] : /* istanbul ignore next */ []));
|
|
1794
|
+
onCreate = output();
|
|
1795
|
+
onLazyLoad = output();
|
|
1796
|
+
onSearch = output();
|
|
1797
|
+
columnTemplates = contentChildren(BaseListTemplateDirective, /* @ts-ignore */
|
|
1798
|
+
...(ngDevMode ? [{ debugName: "columnTemplates" }] : /* istanbul ignore next */ []));
|
|
1799
|
+
_first = signal(0, /* @ts-ignore */
|
|
1800
|
+
...(ngDevMode ? [{ debugName: "_first" }] : /* istanbul ignore next */ []));
|
|
1801
|
+
_searchTerm = signal('', /* @ts-ignore */
|
|
1802
|
+
...(ngDevMode ? [{ debugName: "_searchTerm" }] : /* istanbul ignore next */ []));
|
|
1803
|
+
first = this._first.asReadonly();
|
|
1804
|
+
searchTerm = this._searchTerm.asReadonly();
|
|
1805
|
+
effectiveData = computed(() => this.service()?.data() ?? this.data(), /* @ts-ignore */
|
|
1806
|
+
...(ngDevMode ? [{ debugName: "effectiveData" }] : /* istanbul ignore next */ []));
|
|
1807
|
+
effectiveTotal = computed(() => this.service()?.total() ?? this.total(), /* @ts-ignore */
|
|
1808
|
+
...(ngDevMode ? [{ debugName: "effectiveTotal" }] : /* istanbul ignore next */ []));
|
|
1809
|
+
effectiveIsLoading = computed(() => this.service()?.isLoading() ?? this.isLoading(), /* @ts-ignore */
|
|
1810
|
+
...(ngDevMode ? [{ debugName: "effectiveIsLoading" }] : /* istanbul ignore next */ []));
|
|
1811
|
+
effectiveActions = computed(() => {
|
|
1812
|
+
const editRoute = this.editRoute();
|
|
1813
|
+
const deleteField = this.deleteConfirmField();
|
|
1814
|
+
const editAction = editRoute
|
|
1815
|
+
? [{ icon: 'pencil', tooltip: 'shared.edit', severity: 'info',
|
|
1816
|
+
show: this.canEdit() ?? undefined, handler: (item) => this.handleEditItem(item) }]
|
|
1817
|
+
: [];
|
|
1818
|
+
const deleteAction = deleteField
|
|
1819
|
+
? [{ icon: 'trash', tooltip: 'shared.delete', severity: 'danger',
|
|
1820
|
+
show: this.canDelete() ?? undefined, handler: (item) => this.handleDeleteItem(item) }]
|
|
1821
|
+
: [];
|
|
1822
|
+
return [...editAction, ...this.actions(), ...deleteAction];
|
|
1823
|
+
}, /* @ts-ignore */
|
|
1824
|
+
...(ngDevMode ? [{ debugName: "effectiveActions" }] : /* istanbul ignore next */ []));
|
|
1825
|
+
visibleColumns = computed(() => this.columns().filter((c) => !c.hidden), /* @ts-ignore */
|
|
1826
|
+
...(ngDevMode ? [{ debugName: "visibleColumns" }] : /* istanbul ignore next */ []));
|
|
1827
|
+
columnCount = computed(() => this.visibleColumns().length + (this.effectiveActions().length > 0 ? 1 : 0), /* @ts-ignore */
|
|
1828
|
+
...(ngDevMode ? [{ debugName: "columnCount" }] : /* istanbul ignore next */ []));
|
|
1829
|
+
resolvedEmptyMessage = computed(() => this.emptyMessage() || this.t('shared.no.data'), /* @ts-ignore */
|
|
1830
|
+
...(ngDevMode ? [{ debugName: "resolvedEmptyMessage" }] : /* istanbul ignore next */ []));
|
|
1831
|
+
resolvedCreateLabel = computed(() => this.createButtonLabel() || this.t('shared.create'), /* @ts-ignore */
|
|
1832
|
+
...(ngDevMode ? [{ debugName: "resolvedCreateLabel" }] : /* istanbul ignore next */ []));
|
|
1833
|
+
handleLazyLoad(event) {
|
|
1834
|
+
const first = event.first ?? 0;
|
|
1835
|
+
const rows = event.rows ?? this.pageSize();
|
|
1836
|
+
this._first.set(first);
|
|
1837
|
+
const service = this.service();
|
|
1838
|
+
if (service) {
|
|
1839
|
+
service.fetchList(this.searchTerm(), {
|
|
1840
|
+
pagination: { currentPage: Math.floor(first / rows), pageSize: rows },
|
|
1841
|
+
filter: this.filter(),
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
this.onLazyLoad.emit({ first, rows });
|
|
2128
1845
|
}
|
|
2129
|
-
|
|
1846
|
+
onSearchChange(value) {
|
|
1847
|
+
this._first.set(0);
|
|
1848
|
+
this._searchTerm.set(value);
|
|
1849
|
+
const service = this.service();
|
|
1850
|
+
if (service) {
|
|
1851
|
+
service.fetchList(value, {
|
|
1852
|
+
pagination: { currentPage: 0, pageSize: this.pageSize() },
|
|
1853
|
+
filter: this.filter(),
|
|
1854
|
+
});
|
|
1855
|
+
}
|
|
1856
|
+
this.onSearch.emit(value);
|
|
1857
|
+
}
|
|
1858
|
+
handleCreate() {
|
|
1859
|
+
const route = this.createRoute();
|
|
1860
|
+
if (route && this.router)
|
|
1861
|
+
this.router.navigate([route]);
|
|
1862
|
+
this.onCreate.emit();
|
|
1863
|
+
}
|
|
1864
|
+
handleEditItem(item) {
|
|
1865
|
+
const route = this.editRoute();
|
|
1866
|
+
const id = this.getFieldValueAsString(item, this.idField());
|
|
1867
|
+
if (route && id && this.router)
|
|
1868
|
+
this.router.navigate([route, id]);
|
|
1869
|
+
}
|
|
1870
|
+
handleDeleteItem(item) {
|
|
1871
|
+
const nameField = this.deleteConfirmField();
|
|
1872
|
+
const name = this.getFieldValueAsString(item, nameField);
|
|
1873
|
+
const id = this.getFieldValueAsString(item, this.idField());
|
|
1874
|
+
this.confirmationService?.confirm({
|
|
1875
|
+
message: this.t('shared.confirm.delete.item', { name }),
|
|
1876
|
+
header: this.t('shared.confirm.delete'),
|
|
1877
|
+
icon: 'exclamation-triangle',
|
|
1878
|
+
acceptButtonStyleClass: 'p-button-danger',
|
|
1879
|
+
accept: async () => {
|
|
1880
|
+
try {
|
|
1881
|
+
const response = await this.service()?.delete({ id, type: 'delete' });
|
|
1882
|
+
this.messageService?.add({
|
|
1883
|
+
severity: 'success',
|
|
1884
|
+
summary: this.t('shared.success'),
|
|
1885
|
+
detail: response?.messageKey
|
|
1886
|
+
? this.t(response.messageKey, response.messageVariables)
|
|
1887
|
+
: (response?.message ?? ''),
|
|
1888
|
+
});
|
|
1889
|
+
this.service()?.reload();
|
|
1890
|
+
}
|
|
1891
|
+
catch {
|
|
1892
|
+
// handled by global interceptor
|
|
1893
|
+
}
|
|
1894
|
+
},
|
|
1895
|
+
});
|
|
1896
|
+
}
|
|
1897
|
+
getFieldValue(item, field) {
|
|
1898
|
+
return field
|
|
1899
|
+
.split('.')
|
|
1900
|
+
.reduce((obj, key) => (obj != null ? obj[key] : null), item);
|
|
1901
|
+
}
|
|
1902
|
+
getFieldValueAsString(item, field) {
|
|
1903
|
+
return String(this.getFieldValue(item, field) ?? '');
|
|
1904
|
+
}
|
|
1905
|
+
getTagConfig(col, value) {
|
|
1906
|
+
return col.tagMap?.[String(value)] ?? null;
|
|
1907
|
+
}
|
|
1908
|
+
getColumnTemplate(field) {
|
|
1909
|
+
return this.columnTemplates().find((t) => t.key() === field)?.templateRef ?? null;
|
|
1910
|
+
}
|
|
1911
|
+
truncateText(value, limit) {
|
|
1912
|
+
const str = String(value ?? '');
|
|
1913
|
+
return limit && str.length > limit ? `${str.slice(0, limit)}…` : str;
|
|
1914
|
+
}
|
|
1915
|
+
getCellClass(col) {
|
|
1916
|
+
switch (col.align) {
|
|
1917
|
+
case 'center': return 'text-center';
|
|
1918
|
+
case 'right': return 'text-right';
|
|
1919
|
+
default: return '';
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
t(key, vars) {
|
|
1923
|
+
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
1924
|
+
}
|
|
1925
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1926
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: BaseListComponent, isStandalone: true, selector: "lib-base-list", inputs: { columns: { classPropertyName: "columns", publicName: "columns", isSignal: true, isRequired: true, transformFunction: null }, actions: { classPropertyName: "actions", publicName: "actions", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, showCreateButton: { classPropertyName: "showCreateButton", publicName: "showCreateButton", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, createButtonLabel: { classPropertyName: "createButtonLabel", publicName: "createButtonLabel", isSignal: true, isRequired: false, transformFunction: null }, createButtonIcon: { classPropertyName: "createButtonIcon", publicName: "createButtonIcon", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: false, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, service: { classPropertyName: "service", publicName: "service", isSignal: true, isRequired: false, transformFunction: null }, filter: { classPropertyName: "filter", publicName: "filter", isSignal: true, isRequired: false, transformFunction: null }, createRoute: { classPropertyName: "createRoute", publicName: "createRoute", isSignal: true, isRequired: false, transformFunction: null }, editRoute: { classPropertyName: "editRoute", publicName: "editRoute", isSignal: true, isRequired: false, transformFunction: null }, deleteConfirmField: { classPropertyName: "deleteConfirmField", publicName: "deleteConfirmField", isSignal: true, isRequired: false, transformFunction: null }, idField: { classPropertyName: "idField", publicName: "idField", isSignal: true, isRequired: false, transformFunction: null }, canEdit: { classPropertyName: "canEdit", publicName: "canEdit", isSignal: true, isRequired: false, transformFunction: null }, canDelete: { classPropertyName: "canDelete", publicName: "canDelete", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onCreate: "onCreate", onLazyLoad: "onLazyLoad", onSearch: "onSearch" }, queries: [{ propertyName: "columnTemplates", predicate: BaseListTemplateDirective, isSignal: true }], ngImport: i0, template: "<f-card>\n <ng-template #header>\n @if (title() || searchable() || showCreateButton()) {\n <div class=\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 p-4\">\n @if (title()) {\n <h2 class=\"text-xl font-semibold m-0\">{{ title() }}</h2>\n }\n <div class=\"flex items-center gap-2\" [class.ml-auto]=\"!!title()\">\n @if (searchable()) {\n <f-iconfield>\n <f-inputicon><ui-icon name=\"search\" class=\"text-sm\"></ui-icon></f-inputicon>\n <input\n fInputText\n type=\"text\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"t('shared.search')\"\n />\n </f-iconfield>\n }\n @if (showCreateButton()) {\n <button\n fButton\n (click)=\"handleCreate()\"\n >\n <ui-icon pButtonIcon [name]=\"createButtonIcon()\"></ui-icon>\n <span pButtonLabel>{{ resolvedCreateLabel() }}</span>\n </button>\n }\n </div>\n </div>\n }\n </ng-template>\n\n <div class=\"overflow-x-auto\">\n <f-table\n [value]=\"effectiveData()\"\n [loading]=\"effectiveIsLoading()\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"effectiveTotal() > pageSize()\"\n [rows]=\"pageSize()\"\n [totalRecords]=\"effectiveTotal()\"\n [first]=\"first()\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"t('shared.pagination.report')\"\n class=\"p-datatable-striped\"\n >\n <ng-template #header>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <th [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" [class]=\"getCellClass(col)\">\n {{ col.header }}\n </th>\n }\n @if (effectiveActions().length > 0) {\n <th style=\"width: 120px; text-align: center;\">{{ t('shared.actions') }}</th>\n }\n </tr>\n </ng-template>\n\n <ng-template #body let-item>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <td [class]=\"getCellClass(col)\">\n @switch (col.type ?? 'text') {\n @case ('tag') {\n @if (getTagConfig(col, getFieldValue(item, col.field)); as tagCfg) {\n <f-tag [severity]=\"tagCfg.severity\" [value]=\"tagCfg.label ?? getFieldValueAsString(item, col.field)\" />\n } @else {\n {{ getFieldValueAsString(item, col.field) }}\n }\n }\n @case ('boolean') {\n <f-tag\n [severity]=\"getFieldValue(item, col.field) ? 'success' : 'danger'\"\n [value]=\"getFieldValue(item, col.field) ? t('shared.yes') : t('shared.no')\"\n />\n }\n @case ('date') {\n {{ getFieldValueAsString(item, col.field) | date: (col.dateFormat ?? 'dd/MM/yyyy') }}\n }\n @case ('number') {\n {{ getFieldValueAsString(item, col.field) | number }}\n }\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getColumnTemplate(col.field); context: { $implicit: item, field: col.field }\"\n />\n }\n @default {\n {{ truncateText(getFieldValue(item, col.field), col.truncate) }}\n }\n }\n </td>\n }\n @if (effectiveActions().length > 0) {\n <td>\n <div class=\"flex items-center justify-center gap-2\">\n @for (action of effectiveActions(); track $index) {\n @if (!action.show || action.show(item)) {\n <button\n fButton\n [severity]=\"action.severity ?? 'secondary'\"\n [fTooltip]=\"action.tooltip ? t(action.tooltip) : ''\"\n [disabled]=\"action.disabled ? action.disabled(item) : false\"\n (click)=\"action.handler(item)\"\n [rounded]=\"true\"\n [text]=\"true\"\n >\n <ui-icon pButtonIcon [name]=\"action.icon\"></ui-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnCount()\">\n <div class=\"flex flex-col items-center justify-center py-12 text-surface-400\">\n <ui-icon name=\"inbox\" class=\"text-5xl mb-3\"></ui-icon>\n <span>{{ resolvedEmptyMessage() }}</span>\n </div>\n </td>\n </tr>\n </ng-template>\n </f-table>\n </div>\n</f-card>\n", dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i3.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i3.TagComponent, selector: "f-tag", inputs: ["value", "severity", "icon", "rounded", "color"] }, { kind: "component", type: i3.IconFieldComponent, selector: "f-iconfield" }, { kind: "component", type: i3.InputIconComponent, selector: "f-inputicon", inputs: ["styleClass"] }, { kind: "directive", type: i3.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i3.CardComponent, selector: "f-card", inputs: ["header", "subheader", "styleClass"] }, { kind: "component", type: i3.TableComponent, selector: "f-table", inputs: ["value", "lazy", "loading", "rows", "totalRecords", "rowHover", "dataKey", "scrollable", "paginator", "first", "rowsPerPageOptions", "showCurrentPageReport", "currentPageReportTemplate", "tableStyle", "styleClass", "globalFilterFields", "sortField", "sortOrder"], outputs: ["sortFieldChange", "sortOrderChange", "onLazyLoad", "onSort"] }, { kind: "directive", type: i3.TooltipDirective, selector: "[fTooltip]", inputs: ["fTooltip", "tooltipPosition", "tooltipStyleClass", "disabled", "tooltipEvent", "showDelay", "hideDelay"] }, { kind: "component", type: i3.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
2130
1927
|
}
|
|
2131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1928
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseListComponent, decorators: [{
|
|
2132
1929
|
type: Component,
|
|
2133
|
-
args: [{ selector: '
|
|
2134
|
-
|
|
2135
|
-
<span [innerHTML]="svg.value()"></span>
|
|
2136
|
-
}
|
|
2137
|
-
`, styles: ["inline-svg{display:inline-flex;align-items:center}inline-svg span{display:inline-flex;align-items:center;height:100%;width:100%}inline-svg svg{height:100%;width:auto}\n"] }]
|
|
2138
|
-
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }] } });
|
|
1930
|
+
args: [{ selector: 'lib-base-list', imports: [AngularModule, UiModule], template: "<f-card>\n <ng-template #header>\n @if (title() || searchable() || showCreateButton()) {\n <div class=\"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-3 p-4\">\n @if (title()) {\n <h2 class=\"text-xl font-semibold m-0\">{{ title() }}</h2>\n }\n <div class=\"flex items-center gap-2\" [class.ml-auto]=\"!!title()\">\n @if (searchable()) {\n <f-iconfield>\n <f-inputicon><ui-icon name=\"search\" class=\"text-sm\"></ui-icon></f-inputicon>\n <input\n fInputText\n type=\"text\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"onSearchChange($event)\"\n [placeholder]=\"t('shared.search')\"\n />\n </f-iconfield>\n }\n @if (showCreateButton()) {\n <button\n fButton\n (click)=\"handleCreate()\"\n >\n <ui-icon pButtonIcon [name]=\"createButtonIcon()\"></ui-icon>\n <span pButtonLabel>{{ resolvedCreateLabel() }}</span>\n </button>\n }\n </div>\n </div>\n }\n </ng-template>\n\n <div class=\"overflow-x-auto\">\n <f-table\n [value]=\"effectiveData()\"\n [loading]=\"effectiveIsLoading()\"\n [lazy]=\"true\"\n [scrollable]=\"true\"\n [paginator]=\"effectiveTotal() > pageSize()\"\n [rows]=\"pageSize()\"\n [totalRecords]=\"effectiveTotal()\"\n [first]=\"first()\"\n (onLazyLoad)=\"handleLazyLoad($event)\"\n [showCurrentPageReport]=\"true\"\n [currentPageReportTemplate]=\"t('shared.pagination.report')\"\n class=\"p-datatable-striped\"\n >\n <ng-template #header>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <th [style.width]=\"col.width\" [style.min-width]=\"col.minWidth\" [class]=\"getCellClass(col)\">\n {{ col.header }}\n </th>\n }\n @if (effectiveActions().length > 0) {\n <th style=\"width: 120px; text-align: center;\">{{ t('shared.actions') }}</th>\n }\n </tr>\n </ng-template>\n\n <ng-template #body let-item>\n <tr>\n @for (col of visibleColumns(); track col.field) {\n <td [class]=\"getCellClass(col)\">\n @switch (col.type ?? 'text') {\n @case ('tag') {\n @if (getTagConfig(col, getFieldValue(item, col.field)); as tagCfg) {\n <f-tag [severity]=\"tagCfg.severity\" [value]=\"tagCfg.label ?? getFieldValueAsString(item, col.field)\" />\n } @else {\n {{ getFieldValueAsString(item, col.field) }}\n }\n }\n @case ('boolean') {\n <f-tag\n [severity]=\"getFieldValue(item, col.field) ? 'success' : 'danger'\"\n [value]=\"getFieldValue(item, col.field) ? t('shared.yes') : t('shared.no')\"\n />\n }\n @case ('date') {\n {{ getFieldValueAsString(item, col.field) | date: (col.dateFormat ?? 'dd/MM/yyyy') }}\n }\n @case ('number') {\n {{ getFieldValueAsString(item, col.field) | number }}\n }\n @case ('custom') {\n <ng-container\n *ngTemplateOutlet=\"getColumnTemplate(col.field); context: { $implicit: item, field: col.field }\"\n />\n }\n @default {\n {{ truncateText(getFieldValue(item, col.field), col.truncate) }}\n }\n }\n </td>\n }\n @if (effectiveActions().length > 0) {\n <td>\n <div class=\"flex items-center justify-center gap-2\">\n @for (action of effectiveActions(); track $index) {\n @if (!action.show || action.show(item)) {\n <button\n fButton\n [severity]=\"action.severity ?? 'secondary'\"\n [fTooltip]=\"action.tooltip ? t(action.tooltip) : ''\"\n [disabled]=\"action.disabled ? action.disabled(item) : false\"\n (click)=\"action.handler(item)\"\n [rounded]=\"true\"\n [text]=\"true\"\n >\n <ui-icon pButtonIcon [name]=\"action.icon\"></ui-icon>\n </button>\n }\n }\n </div>\n </td>\n }\n </tr>\n </ng-template>\n\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"columnCount()\">\n <div class=\"flex flex-col items-center justify-center py-12 text-surface-400\">\n <ui-icon name=\"inbox\" class=\"text-5xl mb-3\"></ui-icon>\n <span>{{ resolvedEmptyMessage() }}</span>\n </div>\n </td>\n </tr>\n </ng-template>\n </f-table>\n </div>\n</f-card>\n" }]
|
|
1931
|
+
}], propDecorators: { columns: [{ type: i0.Input, args: [{ isSignal: true, alias: "columns", required: true }] }], actions: [{ type: i0.Input, args: [{ isSignal: true, alias: "actions", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], showCreateButton: [{ type: i0.Input, args: [{ isSignal: true, alias: "showCreateButton", required: false }] }], searchable: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchable", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], emptyMessage: [{ type: i0.Input, args: [{ isSignal: true, alias: "emptyMessage", required: false }] }], createButtonLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "createButtonLabel", required: false }] }], createButtonIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "createButtonIcon", required: false }] }], data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }], service: [{ type: i0.Input, args: [{ isSignal: true, alias: "service", required: false }] }], filter: [{ type: i0.Input, args: [{ isSignal: true, alias: "filter", required: false }] }], createRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "createRoute", required: false }] }], editRoute: [{ type: i0.Input, args: [{ isSignal: true, alias: "editRoute", required: false }] }], deleteConfirmField: [{ type: i0.Input, args: [{ isSignal: true, alias: "deleteConfirmField", required: false }] }], idField: [{ type: i0.Input, args: [{ isSignal: true, alias: "idField", required: false }] }], canEdit: [{ type: i0.Input, args: [{ isSignal: true, alias: "canEdit", required: false }] }], canDelete: [{ type: i0.Input, args: [{ isSignal: true, alias: "canDelete", required: false }] }], onCreate: [{ type: i0.Output, args: ["onCreate"] }], onLazyLoad: [{ type: i0.Output, args: ["onLazyLoad"] }], onSearch: [{ type: i0.Output, args: ["onSearch"] }], columnTemplates: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => BaseListTemplateDirective), { isSignal: true }] }] } });
|
|
2139
1932
|
|
|
2140
1933
|
/**
|
|
2141
1934
|
* Injection Tokens for Provider Interfaces
|
|
@@ -2265,9 +2058,12 @@ class FileUploaderComponent {
|
|
|
2265
2058
|
optional: true,
|
|
2266
2059
|
});
|
|
2267
2060
|
fileProvider = inject(FILE_PROVIDER, { optional: true });
|
|
2268
|
-
uploadFile = input(
|
|
2269
|
-
|
|
2270
|
-
|
|
2061
|
+
uploadFile = input(/* @ts-ignore */
|
|
2062
|
+
...(ngDevMode ? [undefined, { debugName: "uploadFile" }] : /* istanbul ignore next */ []));
|
|
2063
|
+
uploadMultipleFiles = input(/* @ts-ignore */
|
|
2064
|
+
...(ngDevMode ? [undefined, { debugName: "uploadMultipleFiles" }] : /* istanbul ignore next */ []));
|
|
2065
|
+
hasUploadCapability = computed(() => !!this.uploadFile() || !!this.fileProvider, /* @ts-ignore */
|
|
2066
|
+
...(ngDevMode ? [{ debugName: "hasUploadCapability" }] : /* istanbul ignore next */ []));
|
|
2271
2067
|
getUploadFn() {
|
|
2272
2068
|
const inputFn = this.uploadFile();
|
|
2273
2069
|
if (inputFn)
|
|
@@ -2285,24 +2081,38 @@ class FileUploaderComponent {
|
|
|
2285
2081
|
}
|
|
2286
2082
|
return undefined;
|
|
2287
2083
|
}
|
|
2288
|
-
acceptTypes = input([],
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2084
|
+
acceptTypes = input([], /* @ts-ignore */
|
|
2085
|
+
...(ngDevMode ? [{ debugName: "acceptTypes" }] : /* istanbul ignore next */ []));
|
|
2086
|
+
multiple = input(false, /* @ts-ignore */
|
|
2087
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
2088
|
+
maxFiles = input(10, /* @ts-ignore */
|
|
2089
|
+
...(ngDevMode ? [{ debugName: "maxFiles" }] : /* istanbul ignore next */ []));
|
|
2090
|
+
maxSizeMb = input(10, /* @ts-ignore */
|
|
2091
|
+
...(ngDevMode ? [{ debugName: "maxSizeMb" }] : /* istanbul ignore next */ []));
|
|
2092
|
+
uploadOptions = input({}, /* @ts-ignore */
|
|
2093
|
+
...(ngDevMode ? [{ debugName: "uploadOptions" }] : /* istanbul ignore next */ []));
|
|
2094
|
+
disabled = input(false, /* @ts-ignore */
|
|
2095
|
+
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2096
|
+
showPreview = input(true, /* @ts-ignore */
|
|
2097
|
+
...(ngDevMode ? [{ debugName: "showPreview" }] : /* istanbul ignore next */ []));
|
|
2098
|
+
autoUpload = input(true, /* @ts-ignore */
|
|
2099
|
+
...(ngDevMode ? [{ debugName: "autoUpload" }] : /* istanbul ignore next */ []));
|
|
2296
2100
|
fileUploaded = output();
|
|
2297
2101
|
filesUploaded = output();
|
|
2298
2102
|
onError = output();
|
|
2299
2103
|
fileSelected = output();
|
|
2300
|
-
isUploading = signal(false,
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2104
|
+
isUploading = signal(false, /* @ts-ignore */
|
|
2105
|
+
...(ngDevMode ? [{ debugName: "isUploading" }] : /* istanbul ignore next */ []));
|
|
2106
|
+
isDragOver = signal(false, /* @ts-ignore */
|
|
2107
|
+
...(ngDevMode ? [{ debugName: "isDragOver" }] : /* istanbul ignore next */ []));
|
|
2108
|
+
uploadProgress = signal(0, /* @ts-ignore */
|
|
2109
|
+
...(ngDevMode ? [{ debugName: "uploadProgress" }] : /* istanbul ignore next */ []));
|
|
2110
|
+
uploadingFileName = signal('', /* @ts-ignore */
|
|
2111
|
+
...(ngDevMode ? [{ debugName: "uploadingFileName" }] : /* istanbul ignore next */ []));
|
|
2112
|
+
selectedFiles = signal([], /* @ts-ignore */
|
|
2113
|
+
...(ngDevMode ? [{ debugName: "selectedFiles" }] : /* istanbul ignore next */ []));
|
|
2114
|
+
acceptString = computed(() => getAcceptString(this.acceptTypes()), /* @ts-ignore */
|
|
2115
|
+
...(ngDevMode ? [{ debugName: "acceptString" }] : /* istanbul ignore next */ []));
|
|
2306
2116
|
acceptTypesDisplay = computed(() => {
|
|
2307
2117
|
const types = this.acceptTypes();
|
|
2308
2118
|
if (!types.length)
|
|
@@ -2317,7 +2127,8 @@ class FileUploaderComponent {
|
|
|
2317
2127
|
if (typesStr === JSON.stringify(FILE_TYPE_FILTERS.AUDIO))
|
|
2318
2128
|
return this.t('shared.file.type.audio');
|
|
2319
2129
|
return types.map((t) => t.split('/')[1] || t).join(', ');
|
|
2320
|
-
},
|
|
2130
|
+
}, /* @ts-ignore */
|
|
2131
|
+
...(ngDevMode ? [{ debugName: "acceptTypesDisplay" }] : /* istanbul ignore next */ []));
|
|
2321
2132
|
onDragOver(event) {
|
|
2322
2133
|
event.preventDefault();
|
|
2323
2134
|
event.stopPropagation();
|
|
@@ -2473,13 +2284,13 @@ class FileUploaderComponent {
|
|
|
2473
2284
|
}
|
|
2474
2285
|
return key;
|
|
2475
2286
|
}
|
|
2476
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2477
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
2287
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileUploaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2288
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FileUploaderComponent, isStandalone: true, selector: "lib-file-uploader", inputs: { uploadFile: { classPropertyName: "uploadFile", publicName: "uploadFile", isSignal: true, isRequired: false, transformFunction: null }, uploadMultipleFiles: { classPropertyName: "uploadMultipleFiles", publicName: "uploadMultipleFiles", isSignal: true, isRequired: false, transformFunction: null }, acceptTypes: { classPropertyName: "acceptTypes", publicName: "acceptTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxFiles: { classPropertyName: "maxFiles", publicName: "maxFiles", isSignal: true, isRequired: false, transformFunction: null }, maxSizeMb: { classPropertyName: "maxSizeMb", publicName: "maxSizeMb", isSignal: true, isRequired: false, transformFunction: null }, uploadOptions: { classPropertyName: "uploadOptions", publicName: "uploadOptions", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showPreview: { classPropertyName: "showPreview", publicName: "showPreview", isSignal: true, isRequired: false, transformFunction: null }, autoUpload: { classPropertyName: "autoUpload", publicName: "autoUpload", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fileUploaded: "fileUploaded", filesUploaded: "filesUploaded", onError: "onError", fileSelected: "fileSelected" }, ngImport: i0, template: `
|
|
2478
2289
|
@if (!hasUploadCapability()) {
|
|
2479
2290
|
<div
|
|
2480
2291
|
class="p-4 border border-dashed border-orange-300 bg-orange-50 dark:bg-orange-900/20 rounded-lg text-center"
|
|
2481
2292
|
>
|
|
2482
|
-
<
|
|
2293
|
+
<ui-icon name="exclamation-triangle" class="text-2xl text-orange-500 mb-2"></ui-icon>
|
|
2483
2294
|
<p class="text-sm text-orange-700 dark:text-orange-300">
|
|
2484
2295
|
{{
|
|
2485
2296
|
'shared.upload.provider.not.configured'
|
|
@@ -2503,9 +2314,7 @@ class FileUploaderComponent {
|
|
|
2503
2314
|
>
|
|
2504
2315
|
@if (isUploading()) {
|
|
2505
2316
|
<div class="flex flex-col items-center">
|
|
2506
|
-
<
|
|
2507
|
-
class="pi pi-spin pi-spinner text-3xl sm:text-4xl text-primary"
|
|
2508
|
-
></i>
|
|
2317
|
+
<ui-icon name="loader-circle" spin class="text-3xl sm:text-4xl text-primary"></ui-icon>
|
|
2509
2318
|
<p class="mt-2 text-sm sm:text-base break-all px-2">
|
|
2510
2319
|
{{
|
|
2511
2320
|
'shared.upload.uploading'
|
|
@@ -2513,7 +2322,7 @@ class FileUploaderComponent {
|
|
|
2513
2322
|
}}
|
|
2514
2323
|
</p>
|
|
2515
2324
|
@if (uploadProgress() > 0) {
|
|
2516
|
-
<
|
|
2325
|
+
<f-progressbar
|
|
2517
2326
|
[value]="uploadProgress()"
|
|
2518
2327
|
[showValue]="true"
|
|
2519
2328
|
class="w-full mt-2 max-w-xs"
|
|
@@ -2522,9 +2331,7 @@ class FileUploaderComponent {
|
|
|
2522
2331
|
</div>
|
|
2523
2332
|
} @else {
|
|
2524
2333
|
<div class="flex flex-col items-center">
|
|
2525
|
-
<
|
|
2526
|
-
class="pi pi-cloud-upload text-3xl sm:text-4xl text-primary"
|
|
2527
|
-
></i>
|
|
2334
|
+
<ui-icon name="cloud-upload" class="text-3xl sm:text-4xl text-primary"></ui-icon>
|
|
2528
2335
|
<p class="mt-2 mb-1 font-semibold text-sm sm:text-base">
|
|
2529
2336
|
{{
|
|
2530
2337
|
multiple()
|
|
@@ -2567,10 +2374,10 @@ class FileUploaderComponent {
|
|
|
2567
2374
|
<div
|
|
2568
2375
|
class="file-preview-item flex items-center gap-2 p-2 sm:p-3 rounded-lg"
|
|
2569
2376
|
>
|
|
2570
|
-
<
|
|
2571
|
-
[
|
|
2377
|
+
<ui-icon
|
|
2378
|
+
[name]="fileIcon"
|
|
2572
2379
|
class="text-lg sm:text-xl flex-shrink-0"
|
|
2573
|
-
></
|
|
2380
|
+
></ui-icon>
|
|
2574
2381
|
<span class="flex-1 truncate text-sm sm:text-base min-w-0">{{
|
|
2575
2382
|
file.name
|
|
2576
2383
|
}}</span>
|
|
@@ -2578,31 +2385,33 @@ class FileUploaderComponent {
|
|
|
2578
2385
|
class="text-xs sm:text-sm text-color-secondary whitespace-nowrap"
|
|
2579
2386
|
>{{ fileSize }}</span
|
|
2580
2387
|
>
|
|
2581
|
-
<
|
|
2582
|
-
|
|
2388
|
+
<button
|
|
2389
|
+
fButton
|
|
2583
2390
|
[text]="true"
|
|
2584
2391
|
[rounded]="true"
|
|
2585
2392
|
size="small"
|
|
2586
2393
|
severity="secondary"
|
|
2587
2394
|
[disabled]="isUploading()"
|
|
2588
|
-
(
|
|
2589
|
-
|
|
2395
|
+
(click)="removeFile(file)"
|
|
2396
|
+
>
|
|
2397
|
+
<ui-icon pButtonIcon name="times"></ui-icon>
|
|
2398
|
+
</button>
|
|
2590
2399
|
</div>
|
|
2591
2400
|
}
|
|
2592
2401
|
</div>
|
|
2593
2402
|
}
|
|
2594
2403
|
</div>
|
|
2595
2404
|
}
|
|
2596
|
-
`, isInline: true, styles: [".upload-zone{border-color:var(--
|
|
2405
|
+
`, isInline: true, styles: [".upload-zone{border-color:var(--f-surface-300);background:var(--f-surface-50)}.upload-zone:hover:not(.cursor-not-allowed){border-color:var(--f-primary-color);background:var(--f-surface-100)}.upload-zone.drag-over{border-color:var(--f-primary-color);background:var(--f-primary-50)}:host-context(.p-dark) .upload-zone,.dark .upload-zone{border-color:var(--f-surface-600);background:var(--f-surface-800)}:host-context(.p-dark) .upload-zone:hover:not(.cursor-not-allowed),.dark .upload-zone:hover:not(.cursor-not-allowed){border-color:var(--f-primary-color);background:var(--f-surface-700)}:host-context(.p-dark) .upload-zone.drag-over,.dark .upload-zone.drag-over{border-color:var(--f-primary-color);background:var(--f-primary-900)}.file-preview-item{border:1px solid var(--f-surface-200);background:var(--f-surface-0)}:host-context(.p-dark) .file-preview-item,.dark .file-preview-item{border-color:var(--f-surface-600);background:var(--f-surface-800)}\n"], dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i3.FButtonDirective, selector: "[fButton]", inputs: ["severity", "text", "outlined", "link", "rounded", "raised", "fluid", "disabled", "loading", "size", "label", "icon", "iconPos", "ariaLabel", "plain"] }, { kind: "component", type: i3.ProgressbarComponent, selector: "f-progressbar", inputs: ["value", "mode", "showValue"] }, { kind: "component", type: i3.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
2597
2406
|
}
|
|
2598
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2407
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileUploaderComponent, decorators: [{
|
|
2599
2408
|
type: Component,
|
|
2600
|
-
args: [{ selector: 'lib-file-uploader', imports: [AngularModule,
|
|
2409
|
+
args: [{ selector: 'lib-file-uploader', imports: [AngularModule, UiModule, TranslatePipe], template: `
|
|
2601
2410
|
@if (!hasUploadCapability()) {
|
|
2602
2411
|
<div
|
|
2603
2412
|
class="p-4 border border-dashed border-orange-300 bg-orange-50 dark:bg-orange-900/20 rounded-lg text-center"
|
|
2604
2413
|
>
|
|
2605
|
-
<
|
|
2414
|
+
<ui-icon name="exclamation-triangle" class="text-2xl text-orange-500 mb-2"></ui-icon>
|
|
2606
2415
|
<p class="text-sm text-orange-700 dark:text-orange-300">
|
|
2607
2416
|
{{
|
|
2608
2417
|
'shared.upload.provider.not.configured'
|
|
@@ -2626,9 +2435,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2626
2435
|
>
|
|
2627
2436
|
@if (isUploading()) {
|
|
2628
2437
|
<div class="flex flex-col items-center">
|
|
2629
|
-
<
|
|
2630
|
-
class="pi pi-spin pi-spinner text-3xl sm:text-4xl text-primary"
|
|
2631
|
-
></i>
|
|
2438
|
+
<ui-icon name="loader-circle" spin class="text-3xl sm:text-4xl text-primary"></ui-icon>
|
|
2632
2439
|
<p class="mt-2 text-sm sm:text-base break-all px-2">
|
|
2633
2440
|
{{
|
|
2634
2441
|
'shared.upload.uploading'
|
|
@@ -2636,7 +2443,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2636
2443
|
}}
|
|
2637
2444
|
</p>
|
|
2638
2445
|
@if (uploadProgress() > 0) {
|
|
2639
|
-
<
|
|
2446
|
+
<f-progressbar
|
|
2640
2447
|
[value]="uploadProgress()"
|
|
2641
2448
|
[showValue]="true"
|
|
2642
2449
|
class="w-full mt-2 max-w-xs"
|
|
@@ -2645,9 +2452,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2645
2452
|
</div>
|
|
2646
2453
|
} @else {
|
|
2647
2454
|
<div class="flex flex-col items-center">
|
|
2648
|
-
<
|
|
2649
|
-
class="pi pi-cloud-upload text-3xl sm:text-4xl text-primary"
|
|
2650
|
-
></i>
|
|
2455
|
+
<ui-icon name="cloud-upload" class="text-3xl sm:text-4xl text-primary"></ui-icon>
|
|
2651
2456
|
<p class="mt-2 mb-1 font-semibold text-sm sm:text-base">
|
|
2652
2457
|
{{
|
|
2653
2458
|
multiple()
|
|
@@ -2690,10 +2495,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2690
2495
|
<div
|
|
2691
2496
|
class="file-preview-item flex items-center gap-2 p-2 sm:p-3 rounded-lg"
|
|
2692
2497
|
>
|
|
2693
|
-
<
|
|
2694
|
-
[
|
|
2498
|
+
<ui-icon
|
|
2499
|
+
[name]="fileIcon"
|
|
2695
2500
|
class="text-lg sm:text-xl flex-shrink-0"
|
|
2696
|
-
></
|
|
2501
|
+
></ui-icon>
|
|
2697
2502
|
<span class="flex-1 truncate text-sm sm:text-base min-w-0">{{
|
|
2698
2503
|
file.name
|
|
2699
2504
|
}}</span>
|
|
@@ -2701,22 +2506,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
2701
2506
|
class="text-xs sm:text-sm text-color-secondary whitespace-nowrap"
|
|
2702
2507
|
>{{ fileSize }}</span
|
|
2703
2508
|
>
|
|
2704
|
-
<
|
|
2705
|
-
|
|
2509
|
+
<button
|
|
2510
|
+
fButton
|
|
2706
2511
|
[text]="true"
|
|
2707
2512
|
[rounded]="true"
|
|
2708
2513
|
size="small"
|
|
2709
2514
|
severity="secondary"
|
|
2710
2515
|
[disabled]="isUploading()"
|
|
2711
|
-
(
|
|
2712
|
-
|
|
2516
|
+
(click)="removeFile(file)"
|
|
2517
|
+
>
|
|
2518
|
+
<ui-icon pButtonIcon name="times"></ui-icon>
|
|
2519
|
+
</button>
|
|
2713
2520
|
</div>
|
|
2714
2521
|
}
|
|
2715
2522
|
</div>
|
|
2716
2523
|
}
|
|
2717
2524
|
</div>
|
|
2718
2525
|
}
|
|
2719
|
-
`, styles: [".upload-zone{border-color:var(--
|
|
2526
|
+
`, styles: [".upload-zone{border-color:var(--f-surface-300);background:var(--f-surface-50)}.upload-zone:hover:not(.cursor-not-allowed){border-color:var(--f-primary-color);background:var(--f-surface-100)}.upload-zone.drag-over{border-color:var(--f-primary-color);background:var(--f-primary-50)}:host-context(.p-dark) .upload-zone,.dark .upload-zone{border-color:var(--f-surface-600);background:var(--f-surface-800)}:host-context(.p-dark) .upload-zone:hover:not(.cursor-not-allowed),.dark .upload-zone:hover:not(.cursor-not-allowed){border-color:var(--f-primary-color);background:var(--f-surface-700)}:host-context(.p-dark) .upload-zone.drag-over,.dark .upload-zone.drag-over{border-color:var(--f-primary-color);background:var(--f-primary-900)}.file-preview-item{border:1px solid var(--f-surface-200);background:var(--f-surface-0)}:host-context(.p-dark) .file-preview-item,.dark .file-preview-item{border-color:var(--f-surface-600);background:var(--f-surface-800)}\n"] }]
|
|
2720
2527
|
}], propDecorators: { uploadFile: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadFile", required: false }] }], uploadMultipleFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadMultipleFiles", required: false }] }], acceptTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptTypes", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxFiles: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFiles", required: false }] }], maxSizeMb: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSizeMb", required: false }] }], uploadOptions: [{ type: i0.Input, args: [{ isSignal: true, alias: "uploadOptions", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], showPreview: [{ type: i0.Input, args: [{ isSignal: true, alias: "showPreview", required: false }] }], autoUpload: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoUpload", required: false }] }], fileUploaded: [{ type: i0.Output, args: ["fileUploaded"] }], filesUploaded: [{ type: i0.Output, args: ["filesUploaded"] }], onError: [{ type: i0.Output, args: ["onError"] }], fileSelected: [{ type: i0.Output, args: ["fileSelected"] }] } });
|
|
2721
2528
|
|
|
2722
2529
|
const DEFAULT_PAGE_SIZE$1 = 20;
|
|
@@ -2729,9 +2536,12 @@ class FileSelectorDialogComponent {
|
|
|
2729
2536
|
fileProvider = inject(FILE_PROVIDER, { optional: true });
|
|
2730
2537
|
abortController = null;
|
|
2731
2538
|
searchDebounceTimer = null;
|
|
2732
|
-
header = input(
|
|
2733
|
-
|
|
2734
|
-
|
|
2539
|
+
header = input(/* @ts-ignore */
|
|
2540
|
+
...(ngDevMode ? [undefined, { debugName: "header" }] : /* istanbul ignore next */ []));
|
|
2541
|
+
acceptTypes = input([], /* @ts-ignore */
|
|
2542
|
+
...(ngDevMode ? [{ debugName: "acceptTypes" }] : /* istanbul ignore next */ []));
|
|
2543
|
+
multiple = input(false, /* @ts-ignore */
|
|
2544
|
+
...(ngDevMode ? [{ debugName: "multiple" }] : /* istanbul ignore next */ []));
|
|
2735
2545
|
dialogHeader = computed(() => {
|
|
2736
2546
|
const customHeader = this.header();
|
|
2737
2547
|
if (customHeader)
|
|
@@ -2739,41 +2549,63 @@ class FileSelectorDialogComponent {
|
|
|
2739
2549
|
return this.t(this.multiple()
|
|
2740
2550
|
? 'shared.file.selector.select.files'
|
|
2741
2551
|
: 'shared.file.selector.select.file');
|
|
2742
|
-
},
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2552
|
+
}, /* @ts-ignore */
|
|
2553
|
+
...(ngDevMode ? [{ debugName: "dialogHeader" }] : /* istanbul ignore next */ []));
|
|
2554
|
+
maxSelection = input(10, /* @ts-ignore */
|
|
2555
|
+
...(ngDevMode ? [{ debugName: "maxSelection" }] : /* istanbul ignore next */ []));
|
|
2556
|
+
pageSize = input(DEFAULT_PAGE_SIZE$1, /* @ts-ignore */
|
|
2557
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
2558
|
+
folderId = input(/* @ts-ignore */
|
|
2559
|
+
...(ngDevMode ? [undefined, { debugName: "folderId" }] : /* istanbul ignore next */ [])); // Filter by folder
|
|
2560
|
+
withUploader = input(false, /* @ts-ignore */
|
|
2561
|
+
...(ngDevMode ? [{ debugName: "withUploader" }] : /* istanbul ignore next */ []));
|
|
2562
|
+
visible = model(false, /* @ts-ignore */
|
|
2563
|
+
...(ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []));
|
|
2748
2564
|
fileSelected = output();
|
|
2749
2565
|
filesSelected = output();
|
|
2750
2566
|
closed = output();
|
|
2751
2567
|
onError = output();
|
|
2752
|
-
isLoading = signal(false,
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2568
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
2569
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
2570
|
+
files = signal([], /* @ts-ignore */
|
|
2571
|
+
...(ngDevMode ? [{ debugName: "files" }] : /* istanbul ignore next */ []));
|
|
2572
|
+
selectedFiles = signal([], /* @ts-ignore */
|
|
2573
|
+
...(ngDevMode ? [{ debugName: "selectedFiles" }] : /* istanbul ignore next */ []));
|
|
2574
|
+
total = signal(undefined, /* @ts-ignore */
|
|
2575
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
2756
2576
|
pagination = signal({
|
|
2757
2577
|
pageSize: DEFAULT_PAGE_SIZE$1,
|
|
2758
2578
|
currentPage: 0,
|
|
2759
|
-
},
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2579
|
+
}, /* @ts-ignore */
|
|
2580
|
+
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
2581
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
2582
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
2583
|
+
folders = signal([], /* @ts-ignore */
|
|
2584
|
+
...(ngDevMode ? [{ debugName: "folders" }] : /* istanbul ignore next */ []));
|
|
2585
|
+
selectedFolderId = signal(null, /* @ts-ignore */
|
|
2586
|
+
...(ngDevMode ? [{ debugName: "selectedFolderId" }] : /* istanbul ignore next */ []));
|
|
2587
|
+
foldersLoading = signal(false, /* @ts-ignore */
|
|
2588
|
+
...(ngDevMode ? [{ debugName: "foldersLoading" }] : /* istanbul ignore next */ []));
|
|
2764
2589
|
foldersPagination = signal({
|
|
2765
2590
|
pageSize: DEFAULT_SELECTOR_PAGE_SIZE,
|
|
2766
2591
|
currentPage: 0,
|
|
2767
|
-
},
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2592
|
+
}, /* @ts-ignore */
|
|
2593
|
+
...(ngDevMode ? [{ debugName: "foldersPagination" }] : /* istanbul ignore next */ []));
|
|
2594
|
+
foldersTotal = signal(undefined, /* @ts-ignore */
|
|
2595
|
+
...(ngDevMode ? [{ debugName: "foldersTotal" }] : /* istanbul ignore next */ []));
|
|
2596
|
+
storageConfigs = signal([], /* @ts-ignore */
|
|
2597
|
+
...(ngDevMode ? [{ debugName: "storageConfigs" }] : /* istanbul ignore next */ []));
|
|
2598
|
+
selectedStorageConfigId = signal(null, /* @ts-ignore */
|
|
2599
|
+
...(ngDevMode ? [{ debugName: "selectedStorageConfigId" }] : /* istanbul ignore next */ []));
|
|
2600
|
+
storageConfigsLoading = signal(false, /* @ts-ignore */
|
|
2601
|
+
...(ngDevMode ? [{ debugName: "storageConfigsLoading" }] : /* istanbul ignore next */ []));
|
|
2772
2602
|
storageConfigsPagination = signal({
|
|
2773
2603
|
pageSize: DEFAULT_SELECTOR_PAGE_SIZE,
|
|
2774
2604
|
currentPage: 0,
|
|
2775
|
-
},
|
|
2776
|
-
|
|
2605
|
+
}, /* @ts-ignore */
|
|
2606
|
+
...(ngDevMode ? [{ debugName: "storageConfigsPagination" }] : /* istanbul ignore next */ []));
|
|
2607
|
+
storageConfigsTotal = signal(undefined, /* @ts-ignore */
|
|
2608
|
+
...(ngDevMode ? [{ debugName: "storageConfigsTotal" }] : /* istanbul ignore next */ []));
|
|
2777
2609
|
effectiveStorageConfigId = computed(() => {
|
|
2778
2610
|
const selected = this.selectedStorageConfigId();
|
|
2779
2611
|
if (selected)
|
|
@@ -2781,7 +2613,8 @@ class FileSelectorDialogComponent {
|
|
|
2781
2613
|
// Find default config
|
|
2782
2614
|
const defaultConfig = this.storageConfigs().find((c) => c.isDefault);
|
|
2783
2615
|
return defaultConfig?.id;
|
|
2784
|
-
},
|
|
2616
|
+
}, /* @ts-ignore */
|
|
2617
|
+
...(ngDevMode ? [{ debugName: "effectiveStorageConfigId" }] : /* istanbul ignore next */ []));
|
|
2785
2618
|
uploadFileFn = (file, options) => {
|
|
2786
2619
|
if (!this.fileProvider)
|
|
2787
2620
|
throw new Error('shared.file.selector.provider.not.configured');
|
|
@@ -3066,9 +2899,9 @@ class FileSelectorDialogComponent {
|
|
|
3066
2899
|
}
|
|
3067
2900
|
return key;
|
|
3068
2901
|
}
|
|
3069
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3070
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3071
|
-
<
|
|
2902
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileSelectorDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2903
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: FileSelectorDialogComponent, isStandalone: true, selector: "lib-file-selector-dialog", inputs: { header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, acceptTypes: { classPropertyName: "acceptTypes", publicName: "acceptTypes", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, maxSelection: { classPropertyName: "maxSelection", publicName: "maxSelection", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null }, folderId: { classPropertyName: "folderId", publicName: "folderId", isSignal: true, isRequired: false, transformFunction: null }, withUploader: { classPropertyName: "withUploader", publicName: "withUploader", isSignal: true, isRequired: false, transformFunction: null }, visible: { classPropertyName: "visible", publicName: "visible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { visible: "visibleChange", fileSelected: "fileSelected", filesSelected: "filesSelected", closed: "closed", onError: "onError" }, ngImport: i0, template: `
|
|
2904
|
+
<f-dialog
|
|
3072
2905
|
[header]="dialogHeader()"
|
|
3073
2906
|
[(visible)]="visible"
|
|
3074
2907
|
[modal]="true"
|
|
@@ -3082,9 +2915,7 @@ class FileSelectorDialogComponent {
|
|
|
3082
2915
|
>
|
|
3083
2916
|
@if (!fileProvider) {
|
|
3084
2917
|
<div class="p-6 text-center">
|
|
3085
|
-
<
|
|
3086
|
-
class="pi pi-exclamation-triangle text-4xl text-orange-500 mb-3"
|
|
3087
|
-
></i>
|
|
2918
|
+
<ui-icon name="exclamation-triangle" class="text-4xl text-orange-500 mb-3"></ui-icon>
|
|
3088
2919
|
<p class="text-lg font-medium text-color mb-2">
|
|
3089
2920
|
{{ 'shared.file.selector.provider.not.configured' | translate }}
|
|
3090
2921
|
</p>
|
|
@@ -3095,12 +2926,12 @@ class FileSelectorDialogComponent {
|
|
|
3095
2926
|
>provideStorageProviders()</code
|
|
3096
2927
|
>
|
|
3097
2928
|
</p>
|
|
3098
|
-
<button
|
|
3099
|
-
pButton
|
|
2929
|
+
<f-button
|
|
3100
2930
|
[label]="'shared.close' | translate"
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
2931
|
+
severity="secondary"
|
|
2932
|
+
[text]="true"
|
|
2933
|
+
(onClick)="onCancel()"
|
|
2934
|
+
/>
|
|
3104
2935
|
</div>
|
|
3105
2936
|
} @else {
|
|
3106
2937
|
@if (withUploader()) {
|
|
@@ -3122,10 +2953,10 @@ class FileSelectorDialogComponent {
|
|
|
3122
2953
|
<div
|
|
3123
2954
|
class="flex flex-col sm:flex-row gap-2 mb-3 items-stretch sm:items-center"
|
|
3124
2955
|
>
|
|
3125
|
-
<
|
|
3126
|
-
<
|
|
2956
|
+
<f-iconfield class="flex-1">
|
|
2957
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
3127
2958
|
<input
|
|
3128
|
-
|
|
2959
|
+
fInputText
|
|
3129
2960
|
type="text"
|
|
3130
2961
|
[ngModel]="searchTerm()"
|
|
3131
2962
|
(ngModelChange)="onSearchChange($event)"
|
|
@@ -3134,10 +2965,10 @@ class FileSelectorDialogComponent {
|
|
|
3134
2965
|
"
|
|
3135
2966
|
class="w-full"
|
|
3136
2967
|
/>
|
|
3137
|
-
</
|
|
2968
|
+
</f-iconfield>
|
|
3138
2969
|
|
|
3139
2970
|
@if (fileProvider.loadFolders) {
|
|
3140
|
-
<
|
|
2971
|
+
<f-select
|
|
3141
2972
|
[options]="folders()"
|
|
3142
2973
|
[ngModel]="selectedFolderId()"
|
|
3143
2974
|
(ngModelChange)="onFolderChange($event)"
|
|
@@ -3152,23 +2983,23 @@ class FileSelectorDialogComponent {
|
|
|
3152
2983
|
class="w-full sm:w-40"
|
|
3153
2984
|
(onShow)="loadFolders()"
|
|
3154
2985
|
>
|
|
3155
|
-
<ng-template
|
|
2986
|
+
<ng-template #selectedItem let-folder>
|
|
3156
2987
|
<div class="flex items-center gap-2">
|
|
3157
|
-
<
|
|
2988
|
+
<ui-icon name="folder" class="text-color-secondary"></ui-icon>
|
|
3158
2989
|
<span>{{ folder?.name }}</span>
|
|
3159
2990
|
</div>
|
|
3160
2991
|
</ng-template>
|
|
3161
|
-
<ng-template
|
|
2992
|
+
<ng-template #item let-folder>
|
|
3162
2993
|
<div class="flex items-center gap-2">
|
|
3163
|
-
<
|
|
2994
|
+
<ui-icon name="folder" class="text-color-secondary"></ui-icon>
|
|
3164
2995
|
<span>{{ folder.name }}</span>
|
|
3165
2996
|
</div>
|
|
3166
2997
|
</ng-template>
|
|
3167
|
-
</
|
|
2998
|
+
</f-select>
|
|
3168
2999
|
}
|
|
3169
3000
|
|
|
3170
3001
|
@if (fileProvider.loadStorageConfigs) {
|
|
3171
|
-
<
|
|
3002
|
+
<f-select
|
|
3172
3003
|
[options]="storageConfigs()"
|
|
3173
3004
|
[ngModel]="selectedStorageConfigId()"
|
|
3174
3005
|
(ngModelChange)="onStorageConfigChange($event)"
|
|
@@ -3183,9 +3014,9 @@ class FileSelectorDialogComponent {
|
|
|
3183
3014
|
class="w-full sm:w-40"
|
|
3184
3015
|
(onShow)="loadStorageConfigs()"
|
|
3185
3016
|
>
|
|
3186
|
-
<ng-template
|
|
3017
|
+
<ng-template #selectedItem let-config>
|
|
3187
3018
|
<div class="flex items-center gap-2">
|
|
3188
|
-
<
|
|
3019
|
+
<ui-icon name="database" class="text-color-secondary"></ui-icon>
|
|
3189
3020
|
<span>{{ config?.name }}</span>
|
|
3190
3021
|
@if (config?.isDefault) {
|
|
3191
3022
|
<span
|
|
@@ -3195,9 +3026,9 @@ class FileSelectorDialogComponent {
|
|
|
3195
3026
|
}
|
|
3196
3027
|
</div>
|
|
3197
3028
|
</ng-template>
|
|
3198
|
-
<ng-template
|
|
3029
|
+
<ng-template #item let-config>
|
|
3199
3030
|
<div class="flex items-center gap-2">
|
|
3200
|
-
<
|
|
3031
|
+
<ui-icon name="database" class="text-color-secondary"></ui-icon>
|
|
3201
3032
|
<span>{{ config.name }}</span>
|
|
3202
3033
|
@if (config.isDefault) {
|
|
3203
3034
|
<span
|
|
@@ -3207,7 +3038,7 @@ class FileSelectorDialogComponent {
|
|
|
3207
3038
|
}
|
|
3208
3039
|
</div>
|
|
3209
3040
|
</ng-template>
|
|
3210
|
-
</
|
|
3041
|
+
</f-select>
|
|
3211
3042
|
}
|
|
3212
3043
|
|
|
3213
3044
|
@if (multiple()) {
|
|
@@ -3225,13 +3056,11 @@ class FileSelectorDialogComponent {
|
|
|
3225
3056
|
<div class="file-grid" #scrollContainer (scroll)="onScroll($event)">
|
|
3226
3057
|
@if (isLoading() && files().length === 0) {
|
|
3227
3058
|
<div class="col-span-full flex justify-center p-4">
|
|
3228
|
-
<
|
|
3229
|
-
class="pi pi-spin pi-spinner text-4xl text-color-secondary"
|
|
3230
|
-
></i>
|
|
3059
|
+
<ui-icon name="loader-circle" spin class="text-4xl text-color-secondary"></ui-icon>
|
|
3231
3060
|
</div>
|
|
3232
3061
|
} @else if (files().length === 0) {
|
|
3233
3062
|
<div class="col-span-full text-center p-4 text-color-secondary">
|
|
3234
|
-
<
|
|
3063
|
+
<ui-icon name="inbox" class="text-4xl mb-2 block"></ui-icon>
|
|
3235
3064
|
<p>{{ 'shared.file.selector.no.files' | translate }}</p>
|
|
3236
3065
|
</div>
|
|
3237
3066
|
} @else {
|
|
@@ -3254,14 +3083,14 @@ class FileSelectorDialogComponent {
|
|
|
3254
3083
|
class="w-full h-full object-cover"
|
|
3255
3084
|
/>
|
|
3256
3085
|
} @else {
|
|
3257
|
-
<
|
|
3258
|
-
[
|
|
3086
|
+
<ui-icon
|
|
3087
|
+
[name]="fileIcon"
|
|
3259
3088
|
class="text-4xl sm:text-5xl text-color-secondary"
|
|
3260
|
-
></
|
|
3089
|
+
></ui-icon>
|
|
3261
3090
|
}
|
|
3262
3091
|
@if (fileSelected) {
|
|
3263
3092
|
<div class="selected-overlay">
|
|
3264
|
-
<
|
|
3093
|
+
<ui-icon name="check" class="text-xl sm:text-2xl"></ui-icon>
|
|
3265
3094
|
</div>
|
|
3266
3095
|
}
|
|
3267
3096
|
</div>
|
|
@@ -3282,26 +3111,24 @@ class FileSelectorDialogComponent {
|
|
|
3282
3111
|
|
|
3283
3112
|
@if (isLoading()) {
|
|
3284
3113
|
<div class="col-span-full flex justify-center p-2">
|
|
3285
|
-
<
|
|
3114
|
+
<ui-icon name="loader-circle" spin class="text-color-secondary"></ui-icon>
|
|
3286
3115
|
</div>
|
|
3287
3116
|
}
|
|
3288
3117
|
}
|
|
3289
3118
|
</div>
|
|
3290
3119
|
|
|
3291
|
-
<ng-template
|
|
3120
|
+
<ng-template #footer>
|
|
3292
3121
|
<div
|
|
3293
3122
|
class="flex flex-col-reverse sm:flex-row gap-2 w-full sm:w-auto sm:justify-end"
|
|
3294
3123
|
>
|
|
3295
|
-
<button
|
|
3296
|
-
pButton
|
|
3297
|
-
type="button"
|
|
3124
|
+
<f-button
|
|
3298
3125
|
[label]="'shared.cancel' | translate"
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3126
|
+
severity="secondary"
|
|
3127
|
+
[text]="true"
|
|
3128
|
+
class="w-full sm:w-auto"
|
|
3129
|
+
(onClick)="onCancel()"
|
|
3130
|
+
/>
|
|
3131
|
+
<f-button
|
|
3305
3132
|
[label]="
|
|
3306
3133
|
multiple()
|
|
3307
3134
|
? ('shared.file.selector.select.multiple'
|
|
@@ -3310,18 +3137,18 @@ class FileSelectorDialogComponent {
|
|
|
3310
3137
|
"
|
|
3311
3138
|
[disabled]="selectedFiles().length === 0"
|
|
3312
3139
|
class="w-full sm:w-auto"
|
|
3313
|
-
(
|
|
3314
|
-
|
|
3140
|
+
(onClick)="onConfirm()"
|
|
3141
|
+
/>
|
|
3315
3142
|
</div>
|
|
3316
3143
|
</ng-template>
|
|
3317
3144
|
}
|
|
3318
|
-
</
|
|
3319
|
-
`, isInline: true, styles: [".file-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;max-height:300px;overflow-y:auto;padding:.5rem}@media(min-width:480px){.file-grid{grid-template-columns:repeat(3,1fr);max-height:350px}}@media(min-width:640px){.file-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:1rem;max-height:400px}}.file-card{border:2px solid var(--
|
|
3145
|
+
</f-dialog>
|
|
3146
|
+
`, isInline: true, styles: [".file-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;max-height:300px;overflow-y:auto;padding:.5rem}@media(min-width:480px){.file-grid{grid-template-columns:repeat(3,1fr);max-height:350px}}@media(min-width:640px){.file-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:1rem;max-height:400px}}.file-card{border:2px solid var(--f-surface-300);border-radius:var(--f-border-radius);cursor:pointer;transition:all .2s ease;overflow:hidden;background:var(--f-surface-0)}:host-context(.p-dark) .file-card,.dark .file-card{border-color:var(--f-surface-600);background:var(--f-surface-800)}.file-card:hover:not(.disabled){border-color:var(--f-primary-color);transform:translateY(-2px);box-shadow:var(--f-overlay-shadow)}.file-card.selected{border-color:var(--f-primary-color);background:var(--f-primary-50)}:host-context(.p-dark) .file-card.selected,.dark .file-card.selected{background:var(--f-primary-900)}.file-card.disabled{opacity:.5;cursor:not-allowed}.file-preview{position:relative;height:80px;display:flex;align-items:center;justify-content:center;background:var(--f-surface-100)}@media(min-width:640px){.file-preview{height:100px}}:host-context(.p-dark) .file-preview,.dark .file-preview{background:var(--f-surface-700)}.selected-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(var(--f-primary-500-rgb, 59, 130, 246),.3)}.selected-overlay i{color:var(--f-primary-color);background:var(--f-surface-0);border-radius:50%;padding:.5rem}:host-context(.p-dark) .selected-overlay i,.dark .selected-overlay i{background:var(--f-surface-900)}\n"], dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: IsEmptyImageDirective, selector: "img", inputs: ["src"] }, { kind: "ngmodule", type: UiModule }, { kind: "component", type: i3.ButtonComponent, selector: "f-button", inputs: ["label", "icon", "iconPos", "severity", "type", "disabled", "loading", "text", "link", "outlined", "raised", "rounded", "fluid", "size"], outputs: ["onClick"] }, { kind: "component", type: i3.IconFieldComponent, selector: "f-iconfield" }, { kind: "component", type: i3.InputIconComponent, selector: "f-inputicon", inputs: ["styleClass"] }, { kind: "directive", type: i3.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i3.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "component", type: i3.DialogComponent, selector: "f-dialog", inputs: ["header", "visible", "modal", "closable", "dismissableMask", "resizable", "style", "breakpoints"], outputs: ["visibleChange", "onShow", "onHide"] }, { kind: "component", type: i3.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "component", type: FileUploaderComponent, selector: "lib-file-uploader", inputs: ["uploadFile", "uploadMultipleFiles", "acceptTypes", "multiple", "maxFiles", "maxSizeMb", "uploadOptions", "disabled", "showPreview", "autoUpload"], outputs: ["fileUploaded", "filesUploaded", "onError", "fileSelected"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
3320
3147
|
}
|
|
3321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: FileSelectorDialogComponent, decorators: [{
|
|
3322
3149
|
type: Component,
|
|
3323
|
-
args: [{ selector: 'lib-file-selector-dialog', imports: [AngularModule,
|
|
3324
|
-
<
|
|
3150
|
+
args: [{ selector: 'lib-file-selector-dialog', imports: [AngularModule, UiModule, FileUploaderComponent, TranslatePipe], template: `
|
|
3151
|
+
<f-dialog
|
|
3325
3152
|
[header]="dialogHeader()"
|
|
3326
3153
|
[(visible)]="visible"
|
|
3327
3154
|
[modal]="true"
|
|
@@ -3335,9 +3162,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3335
3162
|
>
|
|
3336
3163
|
@if (!fileProvider) {
|
|
3337
3164
|
<div class="p-6 text-center">
|
|
3338
|
-
<
|
|
3339
|
-
class="pi pi-exclamation-triangle text-4xl text-orange-500 mb-3"
|
|
3340
|
-
></i>
|
|
3165
|
+
<ui-icon name="exclamation-triangle" class="text-4xl text-orange-500 mb-3"></ui-icon>
|
|
3341
3166
|
<p class="text-lg font-medium text-color mb-2">
|
|
3342
3167
|
{{ 'shared.file.selector.provider.not.configured' | translate }}
|
|
3343
3168
|
</p>
|
|
@@ -3348,12 +3173,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3348
3173
|
>provideStorageProviders()</code
|
|
3349
3174
|
>
|
|
3350
3175
|
</p>
|
|
3351
|
-
<button
|
|
3352
|
-
pButton
|
|
3176
|
+
<f-button
|
|
3353
3177
|
[label]="'shared.close' | translate"
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3178
|
+
severity="secondary"
|
|
3179
|
+
[text]="true"
|
|
3180
|
+
(onClick)="onCancel()"
|
|
3181
|
+
/>
|
|
3357
3182
|
</div>
|
|
3358
3183
|
} @else {
|
|
3359
3184
|
@if (withUploader()) {
|
|
@@ -3375,10 +3200,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3375
3200
|
<div
|
|
3376
3201
|
class="flex flex-col sm:flex-row gap-2 mb-3 items-stretch sm:items-center"
|
|
3377
3202
|
>
|
|
3378
|
-
<
|
|
3379
|
-
<
|
|
3203
|
+
<f-iconfield class="flex-1">
|
|
3204
|
+
<f-inputicon><ui-icon name="search" /></f-inputicon>
|
|
3380
3205
|
<input
|
|
3381
|
-
|
|
3206
|
+
fInputText
|
|
3382
3207
|
type="text"
|
|
3383
3208
|
[ngModel]="searchTerm()"
|
|
3384
3209
|
(ngModelChange)="onSearchChange($event)"
|
|
@@ -3387,10 +3212,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3387
3212
|
"
|
|
3388
3213
|
class="w-full"
|
|
3389
3214
|
/>
|
|
3390
|
-
</
|
|
3215
|
+
</f-iconfield>
|
|
3391
3216
|
|
|
3392
3217
|
@if (fileProvider.loadFolders) {
|
|
3393
|
-
<
|
|
3218
|
+
<f-select
|
|
3394
3219
|
[options]="folders()"
|
|
3395
3220
|
[ngModel]="selectedFolderId()"
|
|
3396
3221
|
(ngModelChange)="onFolderChange($event)"
|
|
@@ -3405,23 +3230,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3405
3230
|
class="w-full sm:w-40"
|
|
3406
3231
|
(onShow)="loadFolders()"
|
|
3407
3232
|
>
|
|
3408
|
-
<ng-template
|
|
3233
|
+
<ng-template #selectedItem let-folder>
|
|
3409
3234
|
<div class="flex items-center gap-2">
|
|
3410
|
-
<
|
|
3235
|
+
<ui-icon name="folder" class="text-color-secondary"></ui-icon>
|
|
3411
3236
|
<span>{{ folder?.name }}</span>
|
|
3412
3237
|
</div>
|
|
3413
3238
|
</ng-template>
|
|
3414
|
-
<ng-template
|
|
3239
|
+
<ng-template #item let-folder>
|
|
3415
3240
|
<div class="flex items-center gap-2">
|
|
3416
|
-
<
|
|
3241
|
+
<ui-icon name="folder" class="text-color-secondary"></ui-icon>
|
|
3417
3242
|
<span>{{ folder.name }}</span>
|
|
3418
3243
|
</div>
|
|
3419
3244
|
</ng-template>
|
|
3420
|
-
</
|
|
3245
|
+
</f-select>
|
|
3421
3246
|
}
|
|
3422
3247
|
|
|
3423
3248
|
@if (fileProvider.loadStorageConfigs) {
|
|
3424
|
-
<
|
|
3249
|
+
<f-select
|
|
3425
3250
|
[options]="storageConfigs()"
|
|
3426
3251
|
[ngModel]="selectedStorageConfigId()"
|
|
3427
3252
|
(ngModelChange)="onStorageConfigChange($event)"
|
|
@@ -3436,9 +3261,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3436
3261
|
class="w-full sm:w-40"
|
|
3437
3262
|
(onShow)="loadStorageConfigs()"
|
|
3438
3263
|
>
|
|
3439
|
-
<ng-template
|
|
3264
|
+
<ng-template #selectedItem let-config>
|
|
3440
3265
|
<div class="flex items-center gap-2">
|
|
3441
|
-
<
|
|
3266
|
+
<ui-icon name="database" class="text-color-secondary"></ui-icon>
|
|
3442
3267
|
<span>{{ config?.name }}</span>
|
|
3443
3268
|
@if (config?.isDefault) {
|
|
3444
3269
|
<span
|
|
@@ -3448,9 +3273,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3448
3273
|
}
|
|
3449
3274
|
</div>
|
|
3450
3275
|
</ng-template>
|
|
3451
|
-
<ng-template
|
|
3276
|
+
<ng-template #item let-config>
|
|
3452
3277
|
<div class="flex items-center gap-2">
|
|
3453
|
-
<
|
|
3278
|
+
<ui-icon name="database" class="text-color-secondary"></ui-icon>
|
|
3454
3279
|
<span>{{ config.name }}</span>
|
|
3455
3280
|
@if (config.isDefault) {
|
|
3456
3281
|
<span
|
|
@@ -3460,7 +3285,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3460
3285
|
}
|
|
3461
3286
|
</div>
|
|
3462
3287
|
</ng-template>
|
|
3463
|
-
</
|
|
3288
|
+
</f-select>
|
|
3464
3289
|
}
|
|
3465
3290
|
|
|
3466
3291
|
@if (multiple()) {
|
|
@@ -3478,13 +3303,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3478
3303
|
<div class="file-grid" #scrollContainer (scroll)="onScroll($event)">
|
|
3479
3304
|
@if (isLoading() && files().length === 0) {
|
|
3480
3305
|
<div class="col-span-full flex justify-center p-4">
|
|
3481
|
-
<
|
|
3482
|
-
class="pi pi-spin pi-spinner text-4xl text-color-secondary"
|
|
3483
|
-
></i>
|
|
3306
|
+
<ui-icon name="loader-circle" spin class="text-4xl text-color-secondary"></ui-icon>
|
|
3484
3307
|
</div>
|
|
3485
3308
|
} @else if (files().length === 0) {
|
|
3486
3309
|
<div class="col-span-full text-center p-4 text-color-secondary">
|
|
3487
|
-
<
|
|
3310
|
+
<ui-icon name="inbox" class="text-4xl mb-2 block"></ui-icon>
|
|
3488
3311
|
<p>{{ 'shared.file.selector.no.files' | translate }}</p>
|
|
3489
3312
|
</div>
|
|
3490
3313
|
} @else {
|
|
@@ -3507,14 +3330,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3507
3330
|
class="w-full h-full object-cover"
|
|
3508
3331
|
/>
|
|
3509
3332
|
} @else {
|
|
3510
|
-
<
|
|
3511
|
-
[
|
|
3333
|
+
<ui-icon
|
|
3334
|
+
[name]="fileIcon"
|
|
3512
3335
|
class="text-4xl sm:text-5xl text-color-secondary"
|
|
3513
|
-
></
|
|
3336
|
+
></ui-icon>
|
|
3514
3337
|
}
|
|
3515
3338
|
@if (fileSelected) {
|
|
3516
3339
|
<div class="selected-overlay">
|
|
3517
|
-
<
|
|
3340
|
+
<ui-icon name="check" class="text-xl sm:text-2xl"></ui-icon>
|
|
3518
3341
|
</div>
|
|
3519
3342
|
}
|
|
3520
3343
|
</div>
|
|
@@ -3535,26 +3358,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3535
3358
|
|
|
3536
3359
|
@if (isLoading()) {
|
|
3537
3360
|
<div class="col-span-full flex justify-center p-2">
|
|
3538
|
-
<
|
|
3361
|
+
<ui-icon name="loader-circle" spin class="text-color-secondary"></ui-icon>
|
|
3539
3362
|
</div>
|
|
3540
3363
|
}
|
|
3541
3364
|
}
|
|
3542
3365
|
</div>
|
|
3543
3366
|
|
|
3544
|
-
<ng-template
|
|
3367
|
+
<ng-template #footer>
|
|
3545
3368
|
<div
|
|
3546
3369
|
class="flex flex-col-reverse sm:flex-row gap-2 w-full sm:w-auto sm:justify-end"
|
|
3547
3370
|
>
|
|
3548
|
-
<button
|
|
3549
|
-
pButton
|
|
3550
|
-
type="button"
|
|
3371
|
+
<f-button
|
|
3551
3372
|
[label]="'shared.cancel' | translate"
|
|
3552
|
-
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3556
|
-
|
|
3557
|
-
|
|
3373
|
+
severity="secondary"
|
|
3374
|
+
[text]="true"
|
|
3375
|
+
class="w-full sm:w-auto"
|
|
3376
|
+
(onClick)="onCancel()"
|
|
3377
|
+
/>
|
|
3378
|
+
<f-button
|
|
3558
3379
|
[label]="
|
|
3559
3380
|
multiple()
|
|
3560
3381
|
? ('shared.file.selector.select.multiple'
|
|
@@ -3563,51 +3384,72 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
3563
3384
|
"
|
|
3564
3385
|
[disabled]="selectedFiles().length === 0"
|
|
3565
3386
|
class="w-full sm:w-auto"
|
|
3566
|
-
(
|
|
3567
|
-
|
|
3387
|
+
(onClick)="onConfirm()"
|
|
3388
|
+
/>
|
|
3568
3389
|
</div>
|
|
3569
3390
|
</ng-template>
|
|
3570
3391
|
}
|
|
3571
|
-
</
|
|
3572
|
-
`, styles: [".file-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;max-height:300px;overflow-y:auto;padding:.5rem}@media(min-width:480px){.file-grid{grid-template-columns:repeat(3,1fr);max-height:350px}}@media(min-width:640px){.file-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:1rem;max-height:400px}}.file-card{border:2px solid var(--
|
|
3392
|
+
</f-dialog>
|
|
3393
|
+
`, styles: [".file-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:.75rem;max-height:300px;overflow-y:auto;padding:.5rem}@media(min-width:480px){.file-grid{grid-template-columns:repeat(3,1fr);max-height:350px}}@media(min-width:640px){.file-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:1rem;max-height:400px}}.file-card{border:2px solid var(--f-surface-300);border-radius:var(--f-border-radius);cursor:pointer;transition:all .2s ease;overflow:hidden;background:var(--f-surface-0)}:host-context(.p-dark) .file-card,.dark .file-card{border-color:var(--f-surface-600);background:var(--f-surface-800)}.file-card:hover:not(.disabled){border-color:var(--f-primary-color);transform:translateY(-2px);box-shadow:var(--f-overlay-shadow)}.file-card.selected{border-color:var(--f-primary-color);background:var(--f-primary-50)}:host-context(.p-dark) .file-card.selected,.dark .file-card.selected{background:var(--f-primary-900)}.file-card.disabled{opacity:.5;cursor:not-allowed}.file-preview{position:relative;height:80px;display:flex;align-items:center;justify-content:center;background:var(--f-surface-100)}@media(min-width:640px){.file-preview{height:100px}}:host-context(.p-dark) .file-preview,.dark .file-preview{background:var(--f-surface-700)}.selected-overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(var(--f-primary-500-rgb, 59, 130, 246),.3)}.selected-overlay i{color:var(--f-primary-color);background:var(--f-surface-0);border-radius:50%;padding:.5rem}:host-context(.p-dark) .selected-overlay i,.dark .selected-overlay i{background:var(--f-surface-900)}\n"] }]
|
|
3573
3394
|
}], ctorParameters: () => [], propDecorators: { header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], acceptTypes: [{ type: i0.Input, args: [{ isSignal: true, alias: "acceptTypes", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], maxSelection: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxSelection", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], folderId: [{ type: i0.Input, args: [{ isSignal: true, alias: "folderId", required: false }] }], withUploader: [{ type: i0.Input, args: [{ isSignal: true, alias: "withUploader", required: false }] }], visible: [{ type: i0.Input, args: [{ isSignal: true, alias: "visible", required: false }] }, { type: i0.Output, args: ["visibleChange"] }], fileSelected: [{ type: i0.Output, args: ["fileSelected"] }], filesSelected: [{ type: i0.Output, args: ["filesSelected"] }], closed: [{ type: i0.Output, args: ["closed"] }], onError: [{ type: i0.Output, args: ["onError"] }] } });
|
|
3574
3395
|
|
|
3575
3396
|
class IconComponent {
|
|
3576
|
-
icon = input.required(
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3397
|
+
icon = input.required(/* @ts-ignore */
|
|
3398
|
+
...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
3399
|
+
iconType = input(IconTypeEnum.ICON_NAME, /* @ts-ignore */
|
|
3400
|
+
...(ngDevMode ? [{ debugName: "iconType" }] : /* istanbul ignore next */ []));
|
|
3401
|
+
IconTypeEnum = IconTypeEnum;
|
|
3402
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: IconComponent, isStandalone: true, selector: "lib-icon", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: true, transformFunction: null }, iconType: { classPropertyName: "iconType", publicName: "iconType", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3581
3404
|
@if (icon()) {
|
|
3582
|
-
@if (iconType() === IconTypeEnum.
|
|
3583
|
-
<i [class]="icon()"></i>
|
|
3584
|
-
} @else if (iconType() === IconTypeEnum.IMAGE_FILE_LINK) {
|
|
3405
|
+
@if (iconType() === IconTypeEnum.IMAGE_FILE_LINK) {
|
|
3585
3406
|
<img [alt]="icon()" [src]="icon()" />
|
|
3586
3407
|
} @else {
|
|
3587
|
-
<
|
|
3408
|
+
<ui-icon [name]="icon()"></ui-icon>
|
|
3588
3409
|
}
|
|
3589
3410
|
}
|
|
3590
|
-
`, isInline: true, dependencies: [{ kind: "
|
|
3411
|
+
`, isInline: true, dependencies: [{ kind: "component", type: UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }] });
|
|
3591
3412
|
}
|
|
3592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: IconComponent, decorators: [{
|
|
3593
3414
|
type: Component,
|
|
3594
3415
|
args: [{
|
|
3595
3416
|
selector: 'lib-icon',
|
|
3596
|
-
imports: [
|
|
3417
|
+
imports: [UiIconComponent],
|
|
3597
3418
|
template: `
|
|
3598
3419
|
@if (icon()) {
|
|
3599
|
-
@if (iconType() === IconTypeEnum.
|
|
3600
|
-
<i [class]="icon()"></i>
|
|
3601
|
-
} @else if (iconType() === IconTypeEnum.IMAGE_FILE_LINK) {
|
|
3420
|
+
@if (iconType() === IconTypeEnum.IMAGE_FILE_LINK) {
|
|
3602
3421
|
<img [alt]="icon()" [src]="icon()" />
|
|
3603
3422
|
} @else {
|
|
3604
|
-
<
|
|
3423
|
+
<ui-icon [name]="icon()"></ui-icon>
|
|
3605
3424
|
}
|
|
3606
3425
|
}
|
|
3607
3426
|
`,
|
|
3608
3427
|
}]
|
|
3609
3428
|
}], propDecorators: { icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: true }] }], iconType: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconType", required: false }] }] } });
|
|
3610
3429
|
|
|
3430
|
+
class InlineSvgComponent {
|
|
3431
|
+
src = input.required(/* @ts-ignore */
|
|
3432
|
+
...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
3433
|
+
http = inject(HttpClient);
|
|
3434
|
+
sanitizer = inject(DomSanitizer);
|
|
3435
|
+
svg = resource({ ...(ngDevMode ? { debugName: "svg" } : /* istanbul ignore next */ {}), params: this.src,
|
|
3436
|
+
loader: ({ params: url }) => firstValueFrom(this.http.get(url, { responseType: 'text' })).then((text) => this.sanitizer.bypassSecurityTrustHtml(text)) });
|
|
3437
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: InlineSvgComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3438
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: InlineSvgComponent, isStandalone: true, selector: "inline-svg", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
|
3439
|
+
@if (svg.hasValue()) {
|
|
3440
|
+
<span [innerHTML]="svg.value()"></span>
|
|
3441
|
+
}
|
|
3442
|
+
`, isInline: true, styles: ["inline-svg{display:inline-flex;align-items:center}inline-svg span{display:inline-flex;align-items:center;height:100%;width:100%}inline-svg svg{height:100%;width:auto}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
3443
|
+
}
|
|
3444
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: InlineSvgComponent, decorators: [{
|
|
3445
|
+
type: Component,
|
|
3446
|
+
args: [{ selector: 'inline-svg', encapsulation: ViewEncapsulation.None, template: `
|
|
3447
|
+
@if (svg.hasValue()) {
|
|
3448
|
+
<span [innerHTML]="svg.value()"></span>
|
|
3449
|
+
}
|
|
3450
|
+
`, styles: ["inline-svg{display:inline-flex;align-items:center}inline-svg span{display:inline-flex;align-items:center;height:100%;width:100%}inline-svg svg{height:100%;width:auto}\n"] }]
|
|
3451
|
+
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: true }] }] } });
|
|
3452
|
+
|
|
3611
3453
|
/**
|
|
3612
3454
|
* Lazy-loading multi-select component with search, pagination, and select-all.
|
|
3613
3455
|
*
|
|
@@ -3624,33 +3466,46 @@ class LazyMultiSelectComponent extends BaseFormControl {
|
|
|
3624
3466
|
});
|
|
3625
3467
|
onDocumentClickBound = this.handleDocumentClick.bind(this);
|
|
3626
3468
|
// View references
|
|
3627
|
-
pSelectRef = viewChild.required('pSelect'
|
|
3628
|
-
|
|
3469
|
+
pSelectRef = viewChild.required('pSelect', /* @ts-ignore */
|
|
3470
|
+
...(ngDevMode ? [{ debugName: "pSelectRef" }] : /* istanbul ignore next */ []));
|
|
3471
|
+
overlayTemplate = viewChild.required('overlayTpl', /* @ts-ignore */
|
|
3472
|
+
...(ngDevMode ? [{ debugName: "overlayTemplate" }] : /* istanbul ignore next */ []));
|
|
3629
3473
|
// Portal state
|
|
3630
3474
|
overlayViewRef = null;
|
|
3631
3475
|
// Inputs
|
|
3632
|
-
placeHolder = input('',
|
|
3633
|
-
|
|
3476
|
+
placeHolder = input('', /* @ts-ignore */
|
|
3477
|
+
...(ngDevMode ? [{ debugName: "placeHolder" }] : /* istanbul ignore next */ []));
|
|
3478
|
+
showClear = input(true, /* @ts-ignore */
|
|
3479
|
+
...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
3634
3480
|
// Computed placeholder with translation fallback
|
|
3635
3481
|
displayPlaceholder = computed(() => {
|
|
3636
3482
|
const customPlaceholder = this.placeHolder();
|
|
3637
3483
|
if (customPlaceholder)
|
|
3638
3484
|
return customPlaceholder;
|
|
3639
3485
|
return this.t('shared.multi.select.placeholder');
|
|
3640
|
-
},
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3486
|
+
}, /* @ts-ignore */
|
|
3487
|
+
...(ngDevMode ? [{ debugName: "displayPlaceholder" }] : /* istanbul ignore next */ []));
|
|
3488
|
+
isEditMode = input.required(/* @ts-ignore */
|
|
3489
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
3490
|
+
isLoading = input.required(/* @ts-ignore */
|
|
3491
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
3492
|
+
total = input.required(/* @ts-ignore */
|
|
3493
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
3494
|
+
pagination = input.required(/* @ts-ignore */
|
|
3495
|
+
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
3496
|
+
selectDataList = input.required(/* @ts-ignore */
|
|
3497
|
+
...(ngDevMode ? [{ debugName: "selectDataList" }] : /* istanbul ignore next */ []));
|
|
3646
3498
|
// Two-way bound value
|
|
3647
|
-
value = model(null,
|
|
3499
|
+
value = model(null, /* @ts-ignore */
|
|
3500
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3648
3501
|
// Outputs
|
|
3649
3502
|
onSearch = output();
|
|
3650
3503
|
onPagination = output();
|
|
3651
3504
|
// UI state
|
|
3652
|
-
searchTerm = signal('',
|
|
3653
|
-
|
|
3505
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
3506
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
3507
|
+
openOptions = signal(false, /* @ts-ignore */
|
|
3508
|
+
...(ngDevMode ? [{ debugName: "openOptions" }] : /* istanbul ignore next */ []));
|
|
3654
3509
|
// Computed values
|
|
3655
3510
|
selectedValueDisplay = computed(() => {
|
|
3656
3511
|
const selectedValues = this.value() ?? [];
|
|
@@ -3665,18 +3520,21 @@ class LazyMultiSelectComponent extends BaseFormControl {
|
|
|
3665
3520
|
.filter((item) => selectedValues.includes(item.value))
|
|
3666
3521
|
.map((item) => item.label)
|
|
3667
3522
|
.join(', ');
|
|
3668
|
-
},
|
|
3523
|
+
}, /* @ts-ignore */
|
|
3524
|
+
...(ngDevMode ? [{ debugName: "selectedValueDisplay" }] : /* istanbul ignore next */ []));
|
|
3669
3525
|
hasSelectedValues = computed(() => {
|
|
3670
3526
|
const selectedValues = this.value() ?? [];
|
|
3671
3527
|
return selectedValues.length > 0;
|
|
3672
|
-
},
|
|
3528
|
+
}, /* @ts-ignore */
|
|
3529
|
+
...(ngDevMode ? [{ debugName: "hasSelectedValues" }] : /* istanbul ignore next */ []));
|
|
3673
3530
|
isSelectAll = computed(() => {
|
|
3674
3531
|
const selectedValues = this.value() ?? [];
|
|
3675
3532
|
const allValues = this.selectDataList().map((item) => item.value);
|
|
3676
3533
|
if (selectedValues.length === 0 || allValues.length === 0)
|
|
3677
3534
|
return false;
|
|
3678
3535
|
return allValues.every((val) => selectedValues.includes(val));
|
|
3679
|
-
},
|
|
3536
|
+
}, /* @ts-ignore */
|
|
3537
|
+
...(ngDevMode ? [{ debugName: "isSelectAll" }] : /* istanbul ignore next */ []));
|
|
3680
3538
|
constructor() {
|
|
3681
3539
|
super();
|
|
3682
3540
|
this.initializeFormControl();
|
|
@@ -3807,12 +3665,12 @@ class LazyMultiSelectComponent extends BaseFormControl {
|
|
|
3807
3665
|
}
|
|
3808
3666
|
return key;
|
|
3809
3667
|
}
|
|
3810
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3811
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
3668
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LazyMultiSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3669
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: LazyMultiSelectComponent, isStandalone: true, selector: "lib-lazy-multi-select", inputs: { placeHolder: { classPropertyName: "placeHolder", publicName: "placeHolder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null }, selectDataList: { classPropertyName: "selectDataList", publicName: "selectDataList", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onSearch: "onSearch", onPagination: "onPagination" }, providers: [provideValueAccessor(LazyMultiSelectComponent)], viewQueries: [{ propertyName: "pSelectRef", first: true, predicate: ["pSelect"], descendants: true, isSignal: true }, { propertyName: "overlayTemplate", first: true, predicate: ["overlayTpl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg border border-(--f-form-field-border-color) bg-(--f-form-field-background) cursor-pointer min-h-[38px]\"\n #pSelect\n (click)=\"onSelectClick()\"\n [class.opacity-50]=\"disabled()\"\n [class.pointer-events-none]=\"disabled()\"\n [class.edit-mode-element-css]=\"!isEditMode()\"\n [class.overflow-hidden]=\"!isEditMode()\"\n>\n @if (selectedValueDisplay()) {\n <span class=\"flex-1 truncate text-(--f-form-field-color)\" [class.edit-mode-element-css]=\"!isEditMode()\">\n {{ selectedValueDisplay() }}\n </span>\n } @else {\n <span class=\"flex-1 truncate text-(--f-form-field-placeholder-color)\">{{ displayPlaceholder() }}</span>\n }\n\n @if (showClear() && hasSelectedValues()) {\n <span class=\"inline-flex items-center px-1 text-(--f-text-muted-color) hover:text-(--f-text-hover-color) cursor-pointer\" (click)=\"clear($event)\">\n <ui-icon name=\"times\" class=\"text-xs\"></ui-icon>\n </span>\n }\n\n @if (isEditMode()) {\n <span class=\"inline-flex items-center px-1 text-(--f-form-field-placeholder-color)\">\n <ui-icon name=\"chevron-down\" class=\"text-xs\"></ui-icon>\n </span>\n }\n</div>\n\n<ng-template #overlayTpl>\n <div class=\"flex flex-col max-h-[250px] overflow-hidden\" (click)=\"onOverlayClick($event)\">\n <div class=\"p-3 border-b border-(--f-content-border-color) bg-(--f-content-hover-background) shrink-0 w-full flex flex-row gap-2 items-center\">\n <f-checkbox\n [binary]=\"true\"\n [ngModel]=\"isSelectAll()\"\n [disabled]=\"disabled()\"\n (onChange)=\"changeSelectAll($event)\"\n />\n <input\n type=\"text\"\n fInputText\n class=\"w-full\"\n [placeholder]=\"'shared.search' | translate\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"searchTerm.set($event)\"\n />\n </div>\n <div class=\"flex-1 overflow-y-auto min-h-0 w-full\" (scroll)=\"onScroll($event)\">\n <ul class=\"m-0 py-1 list-none bg-(--f-overlay-popover-background) text-(--f-text-color) w-full\">\n @for (data of selectDataList(); track data.value) {\n @let isItemSelected = isSelected(data);\n <li\n class=\"px-3 py-2 cursor-pointer transition-colors flex flex-row gap-2 items-center text-sm\"\n [class]=\"isItemSelected ? 'bg-primary/10 text-primary' : 'text-(--f-text-color) hover:bg-(--f-content-hover-background)'\"\n >\n <f-checkbox\n [binary]=\"true\"\n [ngModel]=\"isItemSelected\"\n [disabled]=\"disabled()\"\n (onChange)=\"selectValue($event, data)\"\n />\n <span>{{ data.label }}</span>\n </li>\n }\n </ul>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: UiModule }, { kind: "component", type: i3.CheckboxComponent, selector: "f-checkbox", inputs: ["label", "binary", "disabled", "inputId", "invalid", "indeterminate", "touched", "styleClass", "checked"], outputs: ["onChange", "onBlur", "touch", "checkedChange"] }, { kind: "directive", type: i3.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i3.UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }, { kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
|
|
3812
3670
|
}
|
|
3813
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3671
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LazyMultiSelectComponent, decorators: [{
|
|
3814
3672
|
type: Component,
|
|
3815
|
-
args: [{ selector: 'lib-lazy-multi-select', imports: [
|
|
3673
|
+
args: [{ selector: 'lib-lazy-multi-select', imports: [UiModule, AngularModule, TranslatePipe], providers: [provideValueAccessor(LazyMultiSelectComponent)], template: "<div\n class=\"w-full flex items-center justify-between px-3 py-2 text-sm rounded-lg border border-(--f-form-field-border-color) bg-(--f-form-field-background) cursor-pointer min-h-[38px]\"\n #pSelect\n (click)=\"onSelectClick()\"\n [class.opacity-50]=\"disabled()\"\n [class.pointer-events-none]=\"disabled()\"\n [class.edit-mode-element-css]=\"!isEditMode()\"\n [class.overflow-hidden]=\"!isEditMode()\"\n>\n @if (selectedValueDisplay()) {\n <span class=\"flex-1 truncate text-(--f-form-field-color)\" [class.edit-mode-element-css]=\"!isEditMode()\">\n {{ selectedValueDisplay() }}\n </span>\n } @else {\n <span class=\"flex-1 truncate text-(--f-form-field-placeholder-color)\">{{ displayPlaceholder() }}</span>\n }\n\n @if (showClear() && hasSelectedValues()) {\n <span class=\"inline-flex items-center px-1 text-(--f-text-muted-color) hover:text-(--f-text-hover-color) cursor-pointer\" (click)=\"clear($event)\">\n <ui-icon name=\"times\" class=\"text-xs\"></ui-icon>\n </span>\n }\n\n @if (isEditMode()) {\n <span class=\"inline-flex items-center px-1 text-(--f-form-field-placeholder-color)\">\n <ui-icon name=\"chevron-down\" class=\"text-xs\"></ui-icon>\n </span>\n }\n</div>\n\n<ng-template #overlayTpl>\n <div class=\"flex flex-col max-h-[250px] overflow-hidden\" (click)=\"onOverlayClick($event)\">\n <div class=\"p-3 border-b border-(--f-content-border-color) bg-(--f-content-hover-background) shrink-0 w-full flex flex-row gap-2 items-center\">\n <f-checkbox\n [binary]=\"true\"\n [ngModel]=\"isSelectAll()\"\n [disabled]=\"disabled()\"\n (onChange)=\"changeSelectAll($event)\"\n />\n <input\n type=\"text\"\n fInputText\n class=\"w-full\"\n [placeholder]=\"'shared.search' | translate\"\n [ngModel]=\"searchTerm()\"\n (ngModelChange)=\"searchTerm.set($event)\"\n />\n </div>\n <div class=\"flex-1 overflow-y-auto min-h-0 w-full\" (scroll)=\"onScroll($event)\">\n <ul class=\"m-0 py-1 list-none bg-(--f-overlay-popover-background) text-(--f-text-color) w-full\">\n @for (data of selectDataList(); track data.value) {\n @let isItemSelected = isSelected(data);\n <li\n class=\"px-3 py-2 cursor-pointer transition-colors flex flex-row gap-2 items-center text-sm\"\n [class]=\"isItemSelected ? 'bg-primary/10 text-primary' : 'text-(--f-text-color) hover:bg-(--f-content-hover-background)'\"\n >\n <f-checkbox\n [binary]=\"true\"\n [ngModel]=\"isItemSelected\"\n [disabled]=\"disabled()\"\n (onChange)=\"selectValue($event, data)\"\n />\n <span>{{ data.label }}</span>\n </li>\n }\n </ul>\n </div>\n </div>\n</ng-template>\n" }]
|
|
3816
3674
|
}], ctorParameters: () => [], propDecorators: { pSelectRef: [{ type: i0.ViewChild, args: ['pSelect', { isSignal: true }] }], overlayTemplate: [{ type: i0.ViewChild, args: ['overlayTpl', { isSignal: true }] }], placeHolder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], isEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isEditMode", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: true }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: true }] }], selectDataList: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectDataList", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], onSearch: [{ type: i0.Output, args: ["onSearch"] }], onPagination: [{ type: i0.Output, args: ["onPagination"] }] } });
|
|
3817
3675
|
|
|
3818
3676
|
/**
|
|
@@ -3832,32 +3690,46 @@ class LazySelectComponent extends BaseFormControl {
|
|
|
3832
3690
|
scrollTargetEl = null;
|
|
3833
3691
|
isDestroyed = false;
|
|
3834
3692
|
// View references
|
|
3835
|
-
scrollContainer = viewChild.required('scrollContainer'
|
|
3693
|
+
scrollContainer = viewChild.required('scrollContainer', /* @ts-ignore */
|
|
3694
|
+
...(ngDevMode ? [{ debugName: "scrollContainer" }] : /* istanbul ignore next */ []));
|
|
3836
3695
|
// Inputs
|
|
3837
|
-
placeHolder = input('',
|
|
3838
|
-
|
|
3696
|
+
placeHolder = input('', /* @ts-ignore */
|
|
3697
|
+
...(ngDevMode ? [{ debugName: "placeHolder" }] : /* istanbul ignore next */ []));
|
|
3698
|
+
showClear = input(true, /* @ts-ignore */
|
|
3699
|
+
...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
3839
3700
|
// Computed placeholder with translation fallback
|
|
3840
3701
|
displayPlaceholder = computed(() => {
|
|
3841
3702
|
const customPlaceholder = this.placeHolder();
|
|
3842
3703
|
if (customPlaceholder)
|
|
3843
3704
|
return customPlaceholder;
|
|
3844
3705
|
return this.t('shared.select.placeholder');
|
|
3845
|
-
},
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3706
|
+
}, /* @ts-ignore */
|
|
3707
|
+
...(ngDevMode ? [{ debugName: "displayPlaceholder" }] : /* istanbul ignore next */ []));
|
|
3708
|
+
optionLabel = input.required(/* @ts-ignore */
|
|
3709
|
+
...(ngDevMode ? [{ debugName: "optionLabel" }] : /* istanbul ignore next */ []));
|
|
3710
|
+
optionValue = input.required(/* @ts-ignore */
|
|
3711
|
+
...(ngDevMode ? [{ debugName: "optionValue" }] : /* istanbul ignore next */ []));
|
|
3712
|
+
isEditMode = input.required(/* @ts-ignore */
|
|
3713
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
3714
|
+
isLoading = input.required(/* @ts-ignore */
|
|
3715
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
3716
|
+
total = input.required(/* @ts-ignore */
|
|
3717
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
3718
|
+
pagination = input.required(/* @ts-ignore */
|
|
3719
|
+
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
3720
|
+
selectDataList = input.required(/* @ts-ignore */
|
|
3721
|
+
...(ngDevMode ? [{ debugName: "selectDataList" }] : /* istanbul ignore next */ []));
|
|
3853
3722
|
// Two-way bound value
|
|
3854
|
-
value = model(null,
|
|
3723
|
+
value = model(null, /* @ts-ignore */
|
|
3724
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
3855
3725
|
// Outputs
|
|
3856
3726
|
onSearch = output();
|
|
3857
3727
|
onPagination = output();
|
|
3858
3728
|
// UI state
|
|
3859
|
-
searchTerm = signal('',
|
|
3860
|
-
|
|
3729
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
3730
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
3731
|
+
isPanelShow = signal(false, /* @ts-ignore */
|
|
3732
|
+
...(ngDevMode ? [{ debugName: "isPanelShow" }] : /* istanbul ignore next */ []));
|
|
3861
3733
|
constructor() {
|
|
3862
3734
|
super();
|
|
3863
3735
|
this.initializeFormControl();
|
|
@@ -3910,7 +3782,7 @@ class LazySelectComponent extends BaseFormControl {
|
|
|
3910
3782
|
if (this.isDestroyed)
|
|
3911
3783
|
return;
|
|
3912
3784
|
const containerEl = this.scrollContainer().nativeElement;
|
|
3913
|
-
const target = containerEl.querySelector('
|
|
3785
|
+
const target = containerEl.querySelector('[data-select-list]');
|
|
3914
3786
|
if (target) {
|
|
3915
3787
|
target.addEventListener('scroll', this.onScrollBound);
|
|
3916
3788
|
this.scrollTargetEl = target;
|
|
@@ -3931,14 +3803,57 @@ class LazySelectComponent extends BaseFormControl {
|
|
|
3931
3803
|
}
|
|
3932
3804
|
return key;
|
|
3933
3805
|
}
|
|
3934
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3935
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
3806
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LazySelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3807
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.6", type: LazySelectComponent, isStandalone: true, selector: "lib-lazy-select", inputs: { placeHolder: { classPropertyName: "placeHolder", publicName: "placeHolder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: true, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: true, transformFunction: null }, isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: true, transformFunction: null }, total: { classPropertyName: "total", publicName: "total", isSignal: true, isRequired: true, transformFunction: null }, pagination: { classPropertyName: "pagination", publicName: "pagination", isSignal: true, isRequired: true, transformFunction: null }, selectDataList: { classPropertyName: "selectDataList", publicName: "selectDataList", isSignal: true, isRequired: true, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onSearch: "onSearch", onPagination: "onPagination" }, providers: [provideValueAccessor(LazySelectComponent)], viewQueries: [{ propertyName: "scrollContainer", first: true, predicate: ["scrollContainer"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div #scrollContainer class=\"lib-scroll-container\">\n <f-select\n class=\"w-full\"\n [options]=\"selectDataList()\"\n [optionLabel]=\"optionLabel()\"\n [optionValue]=\"optionValue()\"\n [filter]=\"true\"\n [showClear]=\"showClear()\"\n [placeholder]=\"displayPlaceholder()\"\n [disabled]=\"disabled()\"\n [(ngModel)]=\"value\"\n appEditModeElementChanger\n [isEditMode]=\"isEditMode()\"\n (click)=\"showPanel()\"\n (onBlur)=\"onBlur()\"\n >\n <ng-template #filter let-filter>\n <input\n fInputText\n class=\"w-full\"\n [ngModel]=\"searchTerm()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"searchTerm.set($event)\"\n />\n </ng-template>\n <ng-template #selectedItem let-selectedOption>\n {{ selectedOption[optionLabel()] }}\n </ng-template>\n <ng-template #item let-item>\n {{ item[optionLabel()] }}\n </ng-template>\n </f-select>\n</div>\n", styles: [""], dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: UiModule }, { kind: "directive", type: i3.InputTextDirective, selector: "[fInputText]", inputs: ["invalid", "touched"] }, { kind: "component", type: i3.SelectComponent, selector: "f-select", inputs: ["options", "optionLabel", "optionValue", "placeholder", "disabled", "filter", "showClear", "loading", "inputId", "invalid", "touched", "styleClass", "editable"], outputs: ["onFilter", "onChange", "onShow", "onHide", "onBlur"] }, { kind: "directive", type: EditModeElementChangerDirective, selector: "[appEditModeElementChanger]", inputs: ["isEditMode"] }] });
|
|
3936
3808
|
}
|
|
3937
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: LazySelectComponent, decorators: [{
|
|
3938
3810
|
type: Component,
|
|
3939
|
-
args: [{ selector: 'lib-lazy-select', imports: [AngularModule,
|
|
3811
|
+
args: [{ selector: 'lib-lazy-select', imports: [AngularModule, UiModule, EditModeElementChangerDirective], providers: [provideValueAccessor(LazySelectComponent)], template: "<div #scrollContainer class=\"lib-scroll-container\">\n <f-select\n class=\"w-full\"\n [options]=\"selectDataList()\"\n [optionLabel]=\"optionLabel()\"\n [optionValue]=\"optionValue()\"\n [filter]=\"true\"\n [showClear]=\"showClear()\"\n [placeholder]=\"displayPlaceholder()\"\n [disabled]=\"disabled()\"\n [(ngModel)]=\"value\"\n appEditModeElementChanger\n [isEditMode]=\"isEditMode()\"\n (click)=\"showPanel()\"\n (onBlur)=\"onBlur()\"\n >\n <ng-template #filter let-filter>\n <input\n fInputText\n class=\"w-full\"\n [ngModel]=\"searchTerm()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"searchTerm.set($event)\"\n />\n </ng-template>\n <ng-template #selectedItem let-selectedOption>\n {{ selectedOption[optionLabel()] }}\n </ng-template>\n <ng-template #item let-item>\n {{ item[optionLabel()] }}\n </ng-template>\n </f-select>\n</div>\n" }]
|
|
3940
3812
|
}], ctorParameters: () => [], propDecorators: { scrollContainer: [{ type: i0.ViewChild, args: ['scrollContainer', { isSignal: true }] }], placeHolder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolder", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: true }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: true }] }], isEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isEditMode", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: true }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: true }] }], pagination: [{ type: i0.Input, args: [{ isSignal: true, alias: "pagination", required: true }] }], selectDataList: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectDataList", required: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], onSearch: [{ type: i0.Output, args: ["onSearch"] }], onPagination: [{ type: i0.Output, args: ["onPagination"] }] } });
|
|
3941
3813
|
|
|
3814
|
+
class RouterTabsComponent {
|
|
3815
|
+
tabs = input([], /* @ts-ignore */
|
|
3816
|
+
...(ngDevMode ? [{ debugName: "tabs" }] : /* istanbul ignore next */ []));
|
|
3817
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RouterTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3818
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: RouterTabsComponent, isStandalone: true, selector: "lib-router-tabs", inputs: { tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "block" }, ngImport: i0, template: `
|
|
3819
|
+
<div class="router-tabs-scroll flex gap-1 border-b border-(--f-content-border-color) overflow-x-auto flex-nowrap">
|
|
3820
|
+
@for (tab of tabs(); track tab.id) {
|
|
3821
|
+
<a
|
|
3822
|
+
[routerLink]="tab.route"
|
|
3823
|
+
routerLinkActive="router-tab-active"
|
|
3824
|
+
[routerLinkActiveOptions]="{ exact: tab.routerLinkActiveExact ?? false }"
|
|
3825
|
+
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-(--f-text-muted-color) no-underline border-b-2 border-transparent -mb-px hover:bg-(--f-content-hover-background) [&.router-tab-active]:text-primary [&.router-tab-active]:border-primary [&.router-tab-active]:bg-(--f-content-hover-background) whitespace-nowrap shrink-0"
|
|
3826
|
+
>
|
|
3827
|
+
@if (tab.icon) {
|
|
3828
|
+
<ui-icon [name]="tab.icon"></ui-icon>
|
|
3829
|
+
}
|
|
3830
|
+
<span>{{ tab.label }}</span>
|
|
3831
|
+
</a>
|
|
3832
|
+
}
|
|
3833
|
+
</div>
|
|
3834
|
+
`, isInline: true, styles: [".router-tabs-scroll{-ms-overflow-style:none;scrollbar-width:none}.router-tabs-scroll::-webkit-scrollbar{display:none}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: UiIconComponent, selector: "ui-icon", inputs: ["name", "size", "spin", "fill"] }] });
|
|
3835
|
+
}
|
|
3836
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: RouterTabsComponent, decorators: [{
|
|
3837
|
+
type: Component,
|
|
3838
|
+
args: [{ selector: 'lib-router-tabs', imports: [RouterLink, RouterLinkActive, UiIconComponent], host: { class: 'block' }, template: `
|
|
3839
|
+
<div class="router-tabs-scroll flex gap-1 border-b border-(--f-content-border-color) overflow-x-auto flex-nowrap">
|
|
3840
|
+
@for (tab of tabs(); track tab.id) {
|
|
3841
|
+
<a
|
|
3842
|
+
[routerLink]="tab.route"
|
|
3843
|
+
routerLinkActive="router-tab-active"
|
|
3844
|
+
[routerLinkActiveOptions]="{ exact: tab.routerLinkActiveExact ?? false }"
|
|
3845
|
+
class="flex items-center gap-2 px-4 py-2 rounded-t-lg cursor-pointer transition-colors text-(--f-text-muted-color) no-underline border-b-2 border-transparent -mb-px hover:bg-(--f-content-hover-background) [&.router-tab-active]:text-primary [&.router-tab-active]:border-primary [&.router-tab-active]:bg-(--f-content-hover-background) whitespace-nowrap shrink-0"
|
|
3846
|
+
>
|
|
3847
|
+
@if (tab.icon) {
|
|
3848
|
+
<ui-icon [name]="tab.icon"></ui-icon>
|
|
3849
|
+
}
|
|
3850
|
+
<span>{{ tab.label }}</span>
|
|
3851
|
+
</a>
|
|
3852
|
+
}
|
|
3853
|
+
</div>
|
|
3854
|
+
`, styles: [".router-tabs-scroll{-ms-overflow-style:none;scrollbar-width:none}.router-tabs-scroll::-webkit-scrollbar{display:none}\n"] }]
|
|
3855
|
+
}], propDecorators: { tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }] } });
|
|
3856
|
+
|
|
3942
3857
|
const DEFAULT_PAGE_SIZE = 20;
|
|
3943
3858
|
/**
|
|
3944
3859
|
* Base class for user selection components.
|
|
@@ -3954,35 +3869,48 @@ class BaseUserSelectComponent {
|
|
|
3954
3869
|
translateAdapter = inject(TranslateService);
|
|
3955
3870
|
abortController = null;
|
|
3956
3871
|
// Inputs
|
|
3957
|
-
loadUsers = input(
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3872
|
+
loadUsers = input(/* @ts-ignore */
|
|
3873
|
+
...(ngDevMode ? [undefined, { debugName: "loadUsers" }] : /* istanbul ignore next */ []));
|
|
3874
|
+
placeHolder = input('', /* @ts-ignore */
|
|
3875
|
+
...(ngDevMode ? [{ debugName: "placeHolder" }] : /* istanbul ignore next */ []));
|
|
3876
|
+
isEditMode = input.required(/* @ts-ignore */
|
|
3877
|
+
...(ngDevMode ? [{ debugName: "isEditMode" }] : /* istanbul ignore next */ []));
|
|
3878
|
+
filterActive = input(true, /* @ts-ignore */
|
|
3879
|
+
...(ngDevMode ? [{ debugName: "filterActive" }] : /* istanbul ignore next */ []));
|
|
3880
|
+
additionalFilters = input({}, /* @ts-ignore */
|
|
3881
|
+
...(ngDevMode ? [{ debugName: "additionalFilters" }] : /* istanbul ignore next */ []));
|
|
3882
|
+
pageSize = input(DEFAULT_PAGE_SIZE, /* @ts-ignore */
|
|
3883
|
+
...(ngDevMode ? [{ debugName: "pageSize" }] : /* istanbul ignore next */ []));
|
|
3963
3884
|
// Outputs
|
|
3964
3885
|
onError = output();
|
|
3965
3886
|
// Internal state
|
|
3966
|
-
isLoading = signal(false,
|
|
3967
|
-
|
|
3968
|
-
|
|
3887
|
+
isLoading = signal(false, /* @ts-ignore */
|
|
3888
|
+
...(ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []));
|
|
3889
|
+
users = signal([], /* @ts-ignore */
|
|
3890
|
+
...(ngDevMode ? [{ debugName: "users" }] : /* istanbul ignore next */ []));
|
|
3891
|
+
total = signal(undefined, /* @ts-ignore */
|
|
3892
|
+
...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
3969
3893
|
pagination = signal({
|
|
3970
3894
|
pageSize: DEFAULT_PAGE_SIZE,
|
|
3971
3895
|
currentPage: 0,
|
|
3972
|
-
},
|
|
3973
|
-
|
|
3896
|
+
}, /* @ts-ignore */
|
|
3897
|
+
...(ngDevMode ? [{ debugName: "pagination" }] : /* istanbul ignore next */ []));
|
|
3898
|
+
searchTerm = signal('', /* @ts-ignore */
|
|
3899
|
+
...(ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []));
|
|
3974
3900
|
// Computed dropdown data
|
|
3975
3901
|
dropdownUsers = computed(() => this.users().map((user) => ({
|
|
3976
3902
|
label: user.name || user.email,
|
|
3977
3903
|
value: user.id,
|
|
3978
|
-
})),
|
|
3904
|
+
})), /* @ts-ignore */
|
|
3905
|
+
...(ngDevMode ? [{ debugName: "dropdownUsers" }] : /* istanbul ignore next */ []));
|
|
3979
3906
|
// Computed placeholder with translation fallback
|
|
3980
3907
|
displayPlaceholder = computed(() => {
|
|
3981
3908
|
const customPlaceholder = this.placeHolder();
|
|
3982
3909
|
if (customPlaceholder)
|
|
3983
3910
|
return customPlaceholder;
|
|
3984
3911
|
return this.t('shared.user.select.placeholder');
|
|
3985
|
-
},
|
|
3912
|
+
}, /* @ts-ignore */
|
|
3913
|
+
...(ngDevMode ? [{ debugName: "displayPlaceholder" }] : /* istanbul ignore next */ []));
|
|
3986
3914
|
constructor() {
|
|
3987
3915
|
// Cleanup on destroy
|
|
3988
3916
|
this.destroyRef.onDestroy(() => {
|
|
@@ -4085,10 +4013,10 @@ class BaseUserSelectComponent {
|
|
|
4085
4013
|
}
|
|
4086
4014
|
return key;
|
|
4087
4015
|
}
|
|
4088
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4089
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
4016
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseUserSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4017
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.6", type: BaseUserSelectComponent, isStandalone: true, inputs: { loadUsers: { classPropertyName: "loadUsers", publicName: "loadUsers", isSignal: true, isRequired: false, transformFunction: null }, placeHolder: { classPropertyName: "placeHolder", publicName: "placeHolder", isSignal: true, isRequired: false, transformFunction: null }, isEditMode: { classPropertyName: "isEditMode", publicName: "isEditMode", isSignal: true, isRequired: true, transformFunction: null }, filterActive: { classPropertyName: "filterActive", publicName: "filterActive", isSignal: true, isRequired: false, transformFunction: null }, additionalFilters: { classPropertyName: "additionalFilters", publicName: "additionalFilters", isSignal: true, isRequired: false, transformFunction: null }, pageSize: { classPropertyName: "pageSize", publicName: "pageSize", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onError: "onError" }, ngImport: i0 });
|
|
4090
4018
|
}
|
|
4091
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4019
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: BaseUserSelectComponent, decorators: [{
|
|
4092
4020
|
type: Directive
|
|
4093
4021
|
}], ctorParameters: () => [], propDecorators: { loadUsers: [{ type: i0.Input, args: [{ isSignal: true, alias: "loadUsers", required: false }] }], placeHolder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeHolder", required: false }] }], isEditMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "isEditMode", required: true }] }], filterActive: [{ type: i0.Input, args: [{ isSignal: true, alias: "filterActive", required: false }] }], additionalFilters: [{ type: i0.Input, args: [{ isSignal: true, alias: "additionalFilters", required: false }] }], pageSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageSize", required: false }] }], onError: [{ type: i0.Output, args: ["onError"] }] } });
|
|
4094
4022
|
|
|
@@ -4122,9 +4050,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
4122
4050
|
*/
|
|
4123
4051
|
class UserMultiSelectComponent extends BaseUserSelectComponent {
|
|
4124
4052
|
// Inputs
|
|
4125
|
-
showClear = input(true,
|
|
4053
|
+
showClear = input(true, /* @ts-ignore */
|
|
4054
|
+
...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
4126
4055
|
// Two-way bound value
|
|
4127
|
-
value = model(null,
|
|
4056
|
+
value = model(null, /* @ts-ignore */
|
|
4057
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4128
4058
|
// Outputs
|
|
4129
4059
|
usersSelected = output();
|
|
4130
4060
|
setupValueEffect() {
|
|
@@ -4138,8 +4068,8 @@ class UserMultiSelectComponent extends BaseUserSelectComponent {
|
|
|
4138
4068
|
});
|
|
4139
4069
|
});
|
|
4140
4070
|
}
|
|
4141
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4142
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
4071
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserMultiSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4072
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: UserMultiSelectComponent, isStandalone: true, selector: "lib-user-multi-select", inputs: { showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", usersSelected: "usersSelected" }, usesInheritance: true, ngImport: i0, template: `
|
|
4143
4073
|
<lib-lazy-multi-select
|
|
4144
4074
|
[(value)]="value"
|
|
4145
4075
|
[placeHolder]="displayPlaceholder()"
|
|
@@ -4152,13 +4082,13 @@ class UserMultiSelectComponent extends BaseUserSelectComponent {
|
|
|
4152
4082
|
(onSearch)="handleSearch($event)"
|
|
4153
4083
|
(onPagination)="handlePagination($event)"
|
|
4154
4084
|
/>
|
|
4155
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type:
|
|
4085
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: UiModule }, { kind: "component", type: LazyMultiSelectComponent, selector: "lib-lazy-multi-select", inputs: ["placeHolder", "showClear", "isEditMode", "isLoading", "total", "pagination", "selectDataList", "value"], outputs: ["valueChange", "onSearch", "onPagination"] }] });
|
|
4156
4086
|
}
|
|
4157
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserMultiSelectComponent, decorators: [{
|
|
4158
4088
|
type: Component,
|
|
4159
4089
|
args: [{
|
|
4160
4090
|
selector: 'lib-user-multi-select',
|
|
4161
|
-
imports: [AngularModule,
|
|
4091
|
+
imports: [AngularModule, UiModule, LazyMultiSelectComponent],
|
|
4162
4092
|
template: `
|
|
4163
4093
|
<lib-lazy-multi-select
|
|
4164
4094
|
[(value)]="value"
|
|
@@ -4205,9 +4135,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImpor
|
|
|
4205
4135
|
*/
|
|
4206
4136
|
class UserSelectComponent extends BaseUserSelectComponent {
|
|
4207
4137
|
// Inputs
|
|
4208
|
-
showClear = input(true,
|
|
4138
|
+
showClear = input(true, /* @ts-ignore */
|
|
4139
|
+
...(ngDevMode ? [{ debugName: "showClear" }] : /* istanbul ignore next */ []));
|
|
4209
4140
|
// Two-way bound value
|
|
4210
|
-
value = model(null,
|
|
4141
|
+
value = model(null, /* @ts-ignore */
|
|
4142
|
+
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
4211
4143
|
// Outputs
|
|
4212
4144
|
userSelected = output();
|
|
4213
4145
|
setupValueEffect() {
|
|
@@ -4226,8 +4158,8 @@ class UserSelectComponent extends BaseUserSelectComponent {
|
|
|
4226
4158
|
});
|
|
4227
4159
|
});
|
|
4228
4160
|
}
|
|
4229
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4230
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
4161
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserSelectComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
4162
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.6", type: UserSelectComponent, isStandalone: true, selector: "lib-user-select", inputs: { showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", userSelected: "userSelected" }, usesInheritance: true, ngImport: i0, template: `
|
|
4231
4163
|
<lib-lazy-select
|
|
4232
4164
|
[(value)]="value"
|
|
4233
4165
|
[placeHolder]="displayPlaceholder()"
|
|
@@ -4242,13 +4174,13 @@ class UserSelectComponent extends BaseUserSelectComponent {
|
|
|
4242
4174
|
(onSearch)="handleSearch($event)"
|
|
4243
4175
|
(onPagination)="handlePagination($event)"
|
|
4244
4176
|
/>
|
|
4245
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type:
|
|
4177
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AngularModule }, { kind: "ngmodule", type: UiModule }, { kind: "component", type: LazySelectComponent, selector: "lib-lazy-select", inputs: ["placeHolder", "showClear", "optionLabel", "optionValue", "isEditMode", "isLoading", "total", "pagination", "selectDataList", "value"], outputs: ["valueChange", "onSearch", "onPagination"] }] });
|
|
4246
4178
|
}
|
|
4247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4179
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: UserSelectComponent, decorators: [{
|
|
4248
4180
|
type: Component,
|
|
4249
4181
|
args: [{
|
|
4250
4182
|
selector: 'lib-user-select',
|
|
4251
|
-
imports: [AngularModule,
|
|
4183
|
+
imports: [AngularModule, UiModule, LazySelectComponent],
|
|
4252
4184
|
template: `
|
|
4253
4185
|
<lib-lazy-select
|
|
4254
4186
|
[(value)]="value"
|
|
@@ -4406,5 +4338,5 @@ function getUserTimezone() {
|
|
|
4406
4338
|
* Generated bundle index. Do not edit.
|
|
4407
4339
|
*/
|
|
4408
4340
|
|
|
4409
|
-
export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormComponent, BaseFormControl, BaseFormTemplateDirective, BaseListComponent, BaseListTemplateDirective, 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, FaviconService, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, InlineSvgComponent, IsEmptyImageDirective, LANGUAGE_PERMISSIONS, LazyMultiSelectComponent, LazySelectComponent, NOTIFICATION_PERMISSIONS, PERMISSIONS, PROFILE_PERMISSION_PROVIDER, PermissionValidatorService, PlatformService, PreventDefaultDirective,
|
|
4341
|
+
export { ACTION_PERMISSIONS, AUTH_STATE_PROVIDER, AngularModule, ApiResourceService, ApiResourceService as ApiService, BRANCH_PERMISSIONS, BaseFormComponent, BaseFormControl, BaseFormTemplateDirective, BaseListComponent, BaseListTemplateDirective, 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, FaviconService, FileSelectorDialogComponent, FileUploaderComponent, FileUrlService, HasPermissionDirective, IconComponent, IconTypeEnum, InlineSvgComponent, IsEmptyImageDirective, LANGUAGE_PERMISSIONS, LazyMultiSelectComponent, LazySelectComponent, NOTIFICATION_PERMISSIONS, PERMISSIONS, PROFILE_PERMISSION_PROVIDER, PermissionValidatorService, PlatformService, PreventDefaultDirective, ROLE_ACTION_PERMISSIONS, ROLE_PERMISSIONS, RouterTabsComponent, 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 };
|
|
4410
4342
|
//# sourceMappingURL=flusys-ng-shared.mjs.map
|