ng-prime-tools 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -17
- package/esm2022/lib/enums/badge-type.enum.mjs +21 -0
- package/esm2022/lib/enums/form-input-type.enum.mjs +2 -1
- package/esm2022/lib/enums/public-api.mjs +2 -1
- package/esm2022/lib/models/badge.model.mjs +2 -0
- package/esm2022/lib/models/bread-crumb-config.model.mjs +2 -0
- package/esm2022/lib/models/button.model.mjs +2 -0
- package/esm2022/lib/models/card-config.model.mjs +1 -1
- package/esm2022/lib/models/dialog.model.mjs +2 -0
- package/esm2022/lib/models/footer-config.model.mjs +2 -0
- package/esm2022/lib/models/footer.model.mjs +2 -0
- package/esm2022/lib/models/form-text-field.model.mjs +1 -1
- package/esm2022/lib/models/image-style.model.mjs +2 -0
- package/esm2022/lib/models/login-model.mjs +2 -0
- package/esm2022/lib/models/login-page-config.model.mjs +2 -0
- package/esm2022/lib/models/menu-config.model.mjs +1 -1
- package/esm2022/lib/models/menu.model.mjs +2 -0
- package/esm2022/lib/models/nav-bar-menu-config.model.mjs +2 -0
- package/esm2022/lib/models/page-skeleton-config.model.mjs +2 -0
- package/esm2022/lib/models/pattern.model.mjs +2 -0
- package/esm2022/lib/models/public-api.mjs +24 -1
- package/esm2022/lib/models/side-menu-bar-config.model.mjs +2 -0
- package/esm2022/lib/models/table-column.model.mjs +1 -1
- package/esm2022/lib/multi-search-criteria/multi-search-criteria.component.mjs +3 -3
- package/esm2022/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.mjs +22 -3
- package/esm2022/lib/ng-prime-tools.module.mjs +116 -5
- package/esm2022/lib/pt-bread-crumb/index.mjs +2 -0
- package/esm2022/lib/pt-bread-crumb/pt-bread-crumb.component.mjs +50 -0
- package/esm2022/lib/pt-bread-crumb/pt-bread-crumb.module.mjs +19 -0
- package/esm2022/lib/pt-bread-crumb/pt-bread-crumb.service.mjs +92 -0
- package/esm2022/lib/pt-bread-crumb/public-api.mjs +3 -0
- package/esm2022/lib/pt-button/index.mjs +2 -0
- package/esm2022/lib/pt-button/pt-button.component.mjs +56 -0
- package/esm2022/lib/pt-button/pt-button.module.mjs +19 -0
- package/esm2022/lib/pt-button/public-api.mjs +3 -0
- package/esm2022/lib/pt-card/pt-card.component.mjs +33 -6
- package/esm2022/lib/pt-dialog/index.mjs +2 -0
- package/esm2022/lib/pt-dialog/pt-dialog.component.mjs +92 -0
- package/esm2022/lib/pt-dialog/pt-dialog.module.mjs +36 -0
- package/esm2022/lib/pt-dialog/public-api.mjs +3 -0
- package/esm2022/lib/pt-footer/index.mjs +2 -0
- package/esm2022/lib/pt-footer/pt-footer.component.mjs +41 -0
- package/esm2022/lib/pt-footer/pt-footer.module.mjs +19 -0
- package/esm2022/lib/pt-footer/public-api.mjs +3 -0
- package/esm2022/lib/pt-login-page/index.mjs +2 -0
- package/esm2022/lib/pt-login-page/pt-login-page.component.mjs +142 -0
- package/esm2022/lib/pt-login-page/pt-login-page.module.mjs +39 -0
- package/esm2022/lib/pt-login-page/public-api.mjs +3 -0
- package/esm2022/lib/pt-menu/pt-menu.component.mjs +20 -5
- package/esm2022/lib/pt-menu-fancy/index.mjs +2 -0
- package/esm2022/lib/pt-menu-fancy/pt-menu-fancy.component.mjs +92 -0
- package/esm2022/lib/pt-menu-fancy/pt-menu-fancy.module.mjs +19 -0
- package/esm2022/lib/pt-menu-fancy/public-api.mjs +3 -0
- package/esm2022/lib/pt-nav-bar-menu/index.mjs +2 -0
- package/esm2022/lib/pt-nav-bar-menu/pt-nav-bar-menu.component.mjs +97 -0
- package/esm2022/lib/pt-nav-bar-menu/pt-nav-bar-menu.module.mjs +20 -0
- package/esm2022/lib/pt-nav-bar-menu/public-api.mjs +3 -0
- package/esm2022/lib/pt-page-skeleton/index.mjs +2 -0
- package/esm2022/lib/pt-page-skeleton/pt-page-skeleton.component.mjs +53 -0
- package/esm2022/lib/pt-page-skeleton/pt-page-skeleton.module.mjs +44 -0
- package/esm2022/lib/pt-page-skeleton/public-api.mjs +3 -0
- package/esm2022/lib/pt-side-bar-menu/index.mjs +2 -0
- package/esm2022/lib/pt-side-bar-menu/pt-side-bar-menu.component.mjs +206 -0
- package/esm2022/lib/pt-side-bar-menu/pt-side-bar-menu.module.mjs +21 -0
- package/esm2022/lib/pt-side-bar-menu/public-api.mjs +3 -0
- package/esm2022/lib/pt-text-area-input/pt-text-area-input.component.mjs +2 -2
- package/esm2022/lib/pt-text-input/pt-text-input.component.mjs +20 -4
- package/esm2022/lib/utils/text.util.mjs +23 -0
- package/esm2022/public-api.mjs +18 -1
- package/fesm2022/ng-prime-tools.mjs +1310 -36
- package/fesm2022/ng-prime-tools.mjs.map +1 -1
- package/lib/enums/badge-type.enum.d.ts +20 -0
- package/lib/enums/badge-type.enum.d.ts.map +1 -0
- package/lib/enums/form-input-type.enum.d.ts +2 -1
- package/lib/enums/form-input-type.enum.d.ts.map +1 -1
- package/lib/enums/public-api.d.ts +1 -0
- package/lib/enums/public-api.d.ts.map +1 -1
- package/lib/models/badge.model.d.ts +8 -0
- package/lib/models/badge.model.d.ts.map +1 -0
- package/lib/models/bread-crumb-config.model.d.ts +7 -0
- package/lib/models/bread-crumb-config.model.d.ts.map +1 -0
- package/lib/models/button.model.d.ts +15 -0
- package/lib/models/button.model.d.ts.map +1 -0
- package/lib/models/card-config.model.d.ts +9 -0
- package/lib/models/card-config.model.d.ts.map +1 -1
- package/lib/models/dialog.model.d.ts +13 -0
- package/lib/models/dialog.model.d.ts.map +1 -0
- package/lib/models/footer-config.model.d.ts +8 -0
- package/lib/models/footer-config.model.d.ts.map +1 -0
- package/lib/models/footer.model.d.ts +5 -0
- package/lib/models/footer.model.d.ts.map +1 -0
- package/lib/models/form-text-field.model.d.ts +2 -0
- package/lib/models/form-text-field.model.d.ts.map +1 -1
- package/lib/models/image-style.model.d.ts +9 -0
- package/lib/models/image-style.model.d.ts.map +1 -0
- package/lib/models/login-model.d.ts +7 -0
- package/lib/models/login-model.d.ts.map +1 -0
- package/lib/models/login-page-config.model.d.ts +21 -0
- package/lib/models/login-page-config.model.d.ts.map +1 -0
- package/lib/models/menu-config.model.d.ts +1 -0
- package/lib/models/menu-config.model.d.ts.map +1 -1
- package/lib/models/menu.model.d.ts +13 -0
- package/lib/models/menu.model.d.ts.map +1 -0
- package/lib/models/nav-bar-menu-config.model.d.ts +11 -0
- package/lib/models/nav-bar-menu-config.model.d.ts.map +1 -0
- package/lib/models/page-skeleton-config.model.d.ts +14 -0
- package/lib/models/page-skeleton-config.model.d.ts.map +1 -0
- package/lib/models/pattern.model.d.ts +5 -0
- package/lib/models/pattern.model.d.ts.map +1 -0
- package/lib/models/public-api.d.ts +16 -0
- package/lib/models/public-api.d.ts.map +1 -1
- package/lib/models/side-menu-bar-config.model.d.ts +21 -0
- package/lib/models/side-menu-bar-config.model.d.ts.map +1 -0
- package/lib/models/table-column.model.d.ts +2 -0
- package/lib/models/table-column.model.d.ts.map +1 -1
- package/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.d.ts +3 -0
- package/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.d.ts.map +1 -1
- package/lib/ng-prime-tools.module.d.ts +10 -1
- package/lib/ng-prime-tools.module.d.ts.map +1 -1
- package/lib/pt-bread-crumb/index.d.ts +2 -0
- package/lib/pt-bread-crumb/index.d.ts.map +1 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.component.d.ts +23 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.component.d.ts.map +1 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.module.d.ts +10 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.module.d.ts.map +1 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.service.d.ts +17 -0
- package/lib/pt-bread-crumb/pt-bread-crumb.service.d.ts.map +1 -0
- package/lib/pt-bread-crumb/public-api.d.ts +3 -0
- package/lib/pt-bread-crumb/public-api.d.ts.map +1 -0
- package/lib/pt-button/index.d.ts +2 -0
- package/lib/pt-button/index.d.ts.map +1 -0
- package/lib/pt-button/pt-button.component.d.ts +17 -0
- package/lib/pt-button/pt-button.component.d.ts.map +1 -0
- package/lib/pt-button/pt-button.module.d.ts +10 -0
- package/lib/pt-button/pt-button.module.d.ts.map +1 -0
- package/lib/pt-button/public-api.d.ts +3 -0
- package/lib/pt-button/public-api.d.ts.map +1 -0
- package/lib/pt-card/pt-card.component.d.ts +14 -3
- package/lib/pt-card/pt-card.component.d.ts.map +1 -1
- package/lib/pt-dialog/index.d.ts +2 -0
- package/lib/pt-dialog/index.d.ts.map +1 -0
- package/lib/pt-dialog/pt-dialog.component.d.ts +20 -0
- package/lib/pt-dialog/pt-dialog.component.d.ts.map +1 -0
- package/lib/pt-dialog/pt-dialog.module.d.ts +13 -0
- package/lib/pt-dialog/pt-dialog.module.d.ts.map +1 -0
- package/lib/pt-dialog/public-api.d.ts +3 -0
- package/lib/pt-dialog/public-api.d.ts.map +1 -0
- package/lib/pt-footer/index.d.ts +2 -0
- package/lib/pt-footer/index.d.ts.map +1 -0
- package/lib/pt-footer/pt-footer.component.d.ts +11 -0
- package/lib/pt-footer/pt-footer.component.d.ts.map +1 -0
- package/lib/pt-footer/pt-footer.module.d.ts +10 -0
- package/lib/pt-footer/pt-footer.module.d.ts.map +1 -0
- package/lib/pt-footer/public-api.d.ts +3 -0
- package/lib/pt-footer/public-api.d.ts.map +1 -0
- package/lib/pt-login-page/index.d.ts +2 -0
- package/lib/pt-login-page/index.d.ts.map +1 -0
- package/lib/pt-login-page/pt-login-page.component.d.ts +20 -0
- package/lib/pt-login-page/pt-login-page.component.d.ts.map +1 -0
- package/lib/pt-login-page/pt-login-page.module.d.ts +13 -0
- package/lib/pt-login-page/pt-login-page.module.d.ts.map +1 -0
- package/lib/pt-login-page/public-api.d.ts +3 -0
- package/lib/pt-login-page/public-api.d.ts.map +1 -0
- package/lib/pt-menu/pt-menu.component.d.ts +2 -2
- package/lib/pt-menu/pt-menu.component.d.ts.map +1 -1
- package/lib/pt-menu-fancy/index.d.ts +2 -0
- package/lib/pt-menu-fancy/index.d.ts.map +1 -0
- package/lib/pt-menu-fancy/pt-menu-fancy.component.d.ts +33 -0
- package/lib/pt-menu-fancy/pt-menu-fancy.component.d.ts.map +1 -0
- package/lib/pt-menu-fancy/pt-menu-fancy.module.d.ts +10 -0
- package/lib/pt-menu-fancy/pt-menu-fancy.module.d.ts.map +1 -0
- package/lib/pt-menu-fancy/public-api.d.ts +3 -0
- package/lib/pt-menu-fancy/public-api.d.ts.map +1 -0
- package/lib/pt-nav-bar-menu/index.d.ts +2 -0
- package/lib/pt-nav-bar-menu/index.d.ts.map +1 -0
- package/lib/pt-nav-bar-menu/pt-nav-bar-menu.component.d.ts +44 -0
- package/lib/pt-nav-bar-menu/pt-nav-bar-menu.component.d.ts.map +1 -0
- package/lib/pt-nav-bar-menu/pt-nav-bar-menu.module.d.ts +11 -0
- package/lib/pt-nav-bar-menu/pt-nav-bar-menu.module.d.ts.map +1 -0
- package/lib/pt-nav-bar-menu/public-api.d.ts +3 -0
- package/lib/pt-nav-bar-menu/public-api.d.ts.map +1 -0
- package/lib/pt-page-skeleton/index.d.ts +2 -0
- package/lib/pt-page-skeleton/index.d.ts.map +1 -0
- package/lib/pt-page-skeleton/pt-page-skeleton.component.d.ts +15 -0
- package/lib/pt-page-skeleton/pt-page-skeleton.component.d.ts.map +1 -0
- package/lib/pt-page-skeleton/pt-page-skeleton.module.d.ts +15 -0
- package/lib/pt-page-skeleton/pt-page-skeleton.module.d.ts.map +1 -0
- package/lib/pt-page-skeleton/public-api.d.ts +3 -0
- package/lib/pt-page-skeleton/public-api.d.ts.map +1 -0
- package/lib/pt-side-bar-menu/index.d.ts +2 -0
- package/lib/pt-side-bar-menu/index.d.ts.map +1 -0
- package/lib/pt-side-bar-menu/pt-side-bar-menu.component.d.ts +41 -0
- package/lib/pt-side-bar-menu/pt-side-bar-menu.component.d.ts.map +1 -0
- package/lib/pt-side-bar-menu/pt-side-bar-menu.module.d.ts +12 -0
- package/lib/pt-side-bar-menu/pt-side-bar-menu.module.d.ts.map +1 -0
- package/lib/pt-side-bar-menu/public-api.d.ts +3 -0
- package/lib/pt-side-bar-menu/public-api.d.ts.map +1 -0
- package/lib/pt-text-input/pt-text-input.component.d.ts +1 -0
- package/lib/pt-text-input/pt-text-input.component.d.ts.map +1 -1
- package/lib/utils/text.util.d.ts +11 -0
- package/lib/utils/text.util.d.ts.map +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +9 -0
- package/public-api.d.ts.map +1 -1
@@ -3,13 +3,14 @@ import { Pipe, EventEmitter, Component, Input, Output, ViewChild, NgModule, Inje
|
|
3
3
|
import * as i1 from '@angular/common';
|
4
4
|
import { CommonModule } from '@angular/common';
|
5
5
|
import * as i2$1 from '@angular/forms';
|
6
|
-
import { FormsModule, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
|
6
|
+
import { FormsModule, FormControl, Validators, ReactiveFormsModule, FormGroup } from '@angular/forms';
|
7
7
|
import * as i2 from 'primeng/table';
|
8
8
|
import { TableModule } from 'primeng/table';
|
9
|
-
import * as
|
9
|
+
import * as i1$1 from 'primeng/api';
|
10
|
+
import { ConfirmEventType, ConfirmationService, MessageService } from 'primeng/api';
|
10
11
|
import * as i4 from 'primeng/inputtext';
|
11
12
|
import { InputTextModule } from 'primeng/inputtext';
|
12
|
-
import * as i3
|
13
|
+
import * as i3 from 'primeng/button';
|
13
14
|
import { ButtonModule } from 'primeng/button';
|
14
15
|
import * as i6 from 'primeng/calendar';
|
15
16
|
import { CalendarModule } from 'primeng/calendar';
|
@@ -26,20 +27,54 @@ import * as i8$1 from 'primeng/inputnumber';
|
|
26
27
|
import { InputNumberModule } from 'primeng/inputnumber';
|
27
28
|
import * as i9$1 from 'primeng/panel';
|
28
29
|
import { PanelModule } from 'primeng/panel';
|
29
|
-
import * as i3$
|
30
|
+
import * as i3$1 from 'primeng/checkbox';
|
30
31
|
import { CheckboxModule } from 'primeng/checkbox';
|
31
|
-
import * as i3$
|
32
|
+
import * as i3$2 from 'primeng/inputgroup';
|
32
33
|
import { InputGroupModule } from 'primeng/inputgroup';
|
33
34
|
import * as i4$1 from 'primeng/inputgroupaddon';
|
34
35
|
import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
35
|
-
import * as i3$
|
36
|
+
import * as i3$3 from 'primeng/inputswitch';
|
36
37
|
import { InputSwitchModule } from 'primeng/inputswitch';
|
37
|
-
import * as i3$
|
38
|
+
import * as i3$4 from 'primeng/inputtextarea';
|
38
39
|
import { InputTextareaModule } from 'primeng/inputtextarea';
|
39
|
-
import * as i3$
|
40
|
+
import * as i3$5 from 'primeng/dropdown';
|
40
41
|
import { DropdownModule } from 'primeng/dropdown';
|
41
42
|
import { Chart, registerables } from 'chart.js';
|
42
43
|
import ChartDataLabels from 'chartjs-plugin-datalabels';
|
44
|
+
import * as i2$2 from '@angular/router';
|
45
|
+
import { RouterModule, NavigationEnd } from '@angular/router';
|
46
|
+
import { filter } from 'rxjs/operators';
|
47
|
+
import { BehaviorSubject } from 'rxjs';
|
48
|
+
import * as i3$6 from 'primeng/breadcrumb';
|
49
|
+
import { BreadcrumbModule } from 'primeng/breadcrumb';
|
50
|
+
import * as i2$3 from 'primeng/toast';
|
51
|
+
import { ToastModule } from 'primeng/toast';
|
52
|
+
import * as i3$7 from 'primeng/confirmdialog';
|
53
|
+
import { ConfirmDialogModule } from 'primeng/confirmdialog';
|
54
|
+
import { DialogModule } from 'primeng/dialog';
|
55
|
+
|
56
|
+
/**
|
57
|
+
* Calculates the width required for a column based on the header text (column title).
|
58
|
+
* It uses the Canvas API to measure text width dynamically.
|
59
|
+
*
|
60
|
+
* @param {TableColumn} col - The column metadata containing the header title and code.
|
61
|
+
* @param {string} [font='16px Arial'] - The font to use for measurement (defaults to '16px Arial').
|
62
|
+
* @returns {number} - The calculated width of the column in pixels.
|
63
|
+
*/
|
64
|
+
function calculateTextWidth(col, font = '16px Arial') {
|
65
|
+
// Create a canvas context for measuring text
|
66
|
+
const canvas = document.createElement('canvas');
|
67
|
+
const context = canvas.getContext('2d');
|
68
|
+
if (!context) {
|
69
|
+
return 100; // Fallback width if canvas context is not available
|
70
|
+
}
|
71
|
+
// Set the font to match the provided font or the document body font
|
72
|
+
context.font = font || getComputedStyle(document.body).font;
|
73
|
+
// Measure the header text width
|
74
|
+
const headerWidth = context.measureText(col.title).width;
|
75
|
+
// Return the width with some padding
|
76
|
+
return Math.ceil(headerWidth + 20); // Add padding for extra space
|
77
|
+
}
|
43
78
|
|
44
79
|
class CustomCurrencyPipe {
|
45
80
|
transform(value, currency, decimalPlaces, thousandSeparator = 'comma', decimalSeparator = 'dot') {
|
@@ -148,6 +183,7 @@ class NgAdvancedPrimeTableComponent {
|
|
148
183
|
this.exportPdfEvent = new EventEmitter();
|
149
184
|
this.searchValue = '';
|
150
185
|
this.validCurrencyCodes = ['USD', 'EUR', 'MAD'];
|
186
|
+
this.iconWidth = 77;
|
151
187
|
// Component state properties
|
152
188
|
this.isDelete = false;
|
153
189
|
this.isEdit = false;
|
@@ -188,8 +224,25 @@ class NgAdvancedPrimeTableComponent {
|
|
188
224
|
if (col.isFilter !== false && col.code !== undefined) {
|
189
225
|
this.globalFilterFields.push(col.code);
|
190
226
|
}
|
227
|
+
if (!col.width) {
|
228
|
+
col.width = this.calculateColumnWidth(col);
|
229
|
+
}
|
191
230
|
});
|
192
231
|
}
|
232
|
+
// Function to calculate column width based on text in header and data
|
233
|
+
calculateColumnWidth(col) {
|
234
|
+
const calculatedWidth = calculateTextWidth(col, col.title);
|
235
|
+
const totalWidth = calculatedWidth + this.iconWidth + 20;
|
236
|
+
return `${totalWidth}px`;
|
237
|
+
}
|
238
|
+
getHeaderWidth(col) {
|
239
|
+
// Remove 'px' from col.width and convert it to a number
|
240
|
+
const widthWithoutPx = parseInt(col.width?.replace('px', '') || '0', 10);
|
241
|
+
// Add 20 to the calculated width
|
242
|
+
const headerWidth = widthWithoutPx + 20;
|
243
|
+
// Return the new width in 'px'
|
244
|
+
return `${headerWidth}px`;
|
245
|
+
}
|
193
246
|
// Initialization Methods
|
194
247
|
formatingDateFields() {
|
195
248
|
return this.data.map((item) => {
|
@@ -396,11 +449,11 @@ class NgAdvancedPrimeTableComponent {
|
|
396
449
|
this.exportPdfEvent.emit();
|
397
450
|
}
|
398
451
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
399
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: NgAdvancedPrimeTableComponent, selector: "ng-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasExportExcel: "hasExportExcel", hasExportPDF: "hasExportPDF", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", actions: "actions", isSortable: "isSortable", loading: "loading", maxHeight: "maxHeight" }, outputs: { filter: "filter", search: "search", exportExcelEvent: "exportExcelEvent", exportPdfEvent: "exportPdfEvent" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "<div class=\"table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <!-- Clear filters -->\n <button\n *ngIf=\"hasSearchFilter\"\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n\n <!-- Export to Excel Button -->\n <button\n *ngIf=\"hasExportExcel\"\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n\n <!-- Export to PDF Button -->\n <button\n *ngIf=\"hasExportPDF\"\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n <th *ngFor=\"let col of columns\">\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th pSortableColumn=\"{{ col.code }}\" style=\"width: 20%\">\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <!-- Empty message template -->\n <ng-template pTemplate=\"emptymessage\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr *ngIf=\"!loading\" [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td *ngIf=\"isEditable(col.code); else normalTD\">\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container *ngIf=\"isMultiSelect(col.code); else datePicker\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td>\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container *ngIf=\"col.type === 'AMOUNT'; else normalText\">\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", styles: [".date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.settings{display:flex;gap:1rem}.multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}::ng-deep p-table{min-width:50rem}::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}::ng-deep .header-container{display:flex;align-items:center}::ng-deep .header-container span{margin-right:.5em}::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.flex{display:flex;justify-content:space-between;align-items:center}.ml-auto{margin-left:auto}::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}::ng-deep .p-inputtext{padding-left:1.7rem}::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.table-row{text-align:center;display:flex;gap:1rem;justify-content:center}::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.table-container{display:flex;flex-direction:column;height:100%;overflow:hidden}::ng-deep .p-datatable{display:flex;flex-direction:column;width:100%;border-collapse:collapse}::ng-deep .p-datatable thead{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}::ng-deep .p-datatable tfoot{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}::ng-deep .p-datatable tbody{display:block;overflow-y:auto;overflow-x:hidden}::ng-deep .p-datatable tbody tr{display:table;width:100%;table-layout:fixed}.empty-message{text-align:center;padding:2rem;color:#888;font-size:1.2rem}.empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "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", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], 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: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i2.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i2.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i2.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i2.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i2.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: i3$1.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
|
452
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: NgAdvancedPrimeTableComponent, selector: "ng-advanced-prime-table", inputs: { data: "data", columns: "columns", totalRecords: "totalRecords", rowsPerPage: "rowsPerPage", hasSearchFilter: "hasSearchFilter", hasExportExcel: "hasExportExcel", hasExportPDF: "hasExportPDF", hasColumnFilter: "hasColumnFilter", isPaginated: "isPaginated", actions: "actions", isSortable: "isSortable", loading: "loading", maxHeight: "maxHeight" }, outputs: { filter: "filter", search: "search", exportExcelEvent: "exportExcelEvent", exportPdfEvent: "exportPdfEvent" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }], ngImport: i0, template: "<div class=\"ng-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <!-- Clear filters -->\n <button\n *ngIf=\"hasSearchFilter\"\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n\n <!-- Export to Excel Button -->\n <button\n *ngIf=\"hasExportExcel\"\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n\n <!-- Export to PDF Button -->\n <button\n *ngIf=\"hasExportPDF\"\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n <th\n *ngFor=\"let col of columns\"\n [style.width]=\"getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n >\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th\n pSortableColumn=\"{{ col.code }}\"\n [style.width]=\"getHeaderWidth(col)\"\n >\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span>{{ col.title }}</span>\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <!-- Empty message template -->\n <ng-template pTemplate=\"emptymessage\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr *ngIf=\"!loading\" [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td\n *ngIf=\"isEditable(col.code); else normalTD\"\n [style.width]=\"getHeaderWidth(col)\"\n >\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container *ngIf=\"isMultiSelect(col.code); else datePicker\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td [style.width]=\"getHeaderWidth(col)\">\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container *ngIf=\"col.type === 'AMOUNT'; else normalText\">\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", styles: [".ng-advanced-prime-table .bread-crumb{margin-bottom:15px}.ng-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.ng-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.ng-advanced-prime-table .settings{display:flex;gap:1rem}.ng-advanced-prime-table .multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}.ng-advanced-prime-table ::ng-deep p-table{min-width:50rem}.ng-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.ng-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.ng-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.ng-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.ng-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.ng-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.ng-advanced-prime-table .ml-auto{margin-left:auto}.ng-advanced-prime-table ::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}.ng-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.ng-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.ng-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.ng-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.ng-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.ng-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.ng-advanced-prime-table .table-container{display:flex;flex-direction:column;height:100%;overflow:hidden}.ng-advanced-prime-table ::ng-deep .p-datatable{display:flex;flex-direction:column;width:100%;border-collapse:collapse;table-layout:fixed}.ng-advanced-prime-table ::ng-deep .p-datatable thead{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}.ng-advanced-prime-table ::ng-deep .p-datatable tfoot{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}.ng-advanced-prime-table ::ng-deep .p-datatable tbody{display:block;overflow-y:auto;overflow-x:hidden}.ng-advanced-prime-table ::ng-deep .p-datatable tbody tr{display:table;width:100%;table-layout:fixed}.ng-advanced-prime-table .empty-message{text-align:center;padding:2rem;color:#888;font-size:1.2rem}.ng-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.ng-advanced-prime-table th{white-space:normal;word-wrap:break-word}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "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", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll", "virtualRowHeight"], 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: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i2.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "component", type: i2.CellEditor, selector: "p-cellEditor" }, { kind: "component", type: i2.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "directive", type: i2.EditableRow, selector: "[pEditableRow]", inputs: ["pEditableRow", "pEditableRowDisabled"] }, { kind: "directive", type: i2.InitEditableRow, selector: "[pInitEditableRow]" }, { kind: "directive", type: i2.SaveEditableRow, selector: "[pSaveEditableRow]" }, { kind: "directive", type: i2.CancelEditableRow, selector: "[pCancelEditableRow]" }, { kind: "component", type: i2.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel"], outputs: ["onShow", "onHide"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: i9.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }, { kind: "pipe", type: CustomCurrencyPipe, name: "customCurrency" }, { kind: "pipe", type: CustomDatePipe, name: "customDate" }] }); }
|
400
453
|
}
|
401
454
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, decorators: [{
|
402
455
|
type: Component,
|
403
|
-
args: [{ selector: 'ng-advanced-prime-table', template: "<div class=\"table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <!-- Clear filters -->\n <button\n *ngIf=\"hasSearchFilter\"\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n\n <!-- Export to Excel Button -->\n <button\n *ngIf=\"hasExportExcel\"\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n\n <!-- Export to PDF Button -->\n <button\n *ngIf=\"hasExportPDF\"\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n <th *ngFor=\"let col of columns\">\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th pSortableColumn=\"{{ col.code }}\" style=\"width: 20%\">\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <!-- Empty message template -->\n <ng-template pTemplate=\"emptymessage\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr *ngIf=\"!loading\" [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td *ngIf=\"isEditable(col.code); else normalTD\">\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container *ngIf=\"isMultiSelect(col.code); else datePicker\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td>\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container *ngIf=\"col.type === 'AMOUNT'; else normalText\">\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", styles: [".date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.settings{display:flex;gap:1rem}.multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}::ng-deep p-table{min-width:50rem}::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}::ng-deep .header-container{display:flex;align-items:center}::ng-deep .header-container span{margin-right:.5em}::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.flex{display:flex;justify-content:space-between;align-items:center}.ml-auto{margin-left:auto}::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}::ng-deep .p-inputtext{padding-left:1.7rem}::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.table-row{text-align:center;display:flex;gap:1rem;justify-content:center}::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.table-container{display:flex;flex-direction:column;height:100%;overflow:hidden}::ng-deep .p-datatable{display:flex;flex-direction:column;width:100%;border-collapse:collapse}::ng-deep .p-datatable thead{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}::ng-deep .p-datatable tfoot{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}::ng-deep .p-datatable tbody{display:block;overflow-y:auto;overflow-x:hidden}::ng-deep .p-datatable tbody tr{display:table;width:100%;table-layout:fixed}.empty-message{text-align:center;padding:2rem;color:#888;font-size:1.2rem}.empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}\n"] }]
|
456
|
+
args: [{ selector: 'ng-advanced-prime-table', template: "<div class=\"ng-advanced-prime-table table-container\">\n <p-table\n #dt\n [value]=\"data\"\n [loading]=\"loading\"\n [rows]=\"rows\"\n [paginator]=\"isPaginated\"\n [globalFilterFields]=\"globalFilterFields\"\n [rowsPerPageOptions]=\"rowsPerPage\"\n dataKey=\"id\"\n styleClass=\"p-datatable-gridlines\"\n styleClass=\"p-datatable-striped\"\n editMode=\"row\"\n [scrollable]=\"true\"\n [scrollHeight]=\"maxHeight !== null ? maxHeight : undefined\"\n >\n <ng-template pTemplate=\"caption\">\n <div class=\"flex\">\n <div>\n <h3>Total: {{ totalRecords }}</h3>\n </div>\n\n <div>\n <!-- Clear filters -->\n <button\n *ngIf=\"hasSearchFilter\"\n pButton\n icon=\"pi pi-filter-slash\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"clear(dt)\"\n title=\"Clear filters\"\n ></button>\n\n <!-- Export to Excel Button -->\n <button\n *ngIf=\"hasExportExcel\"\n pButton\n icon=\"pi pi-file-excel\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportExcel()\"\n title=\"Export to Excel\"\n ></button>\n\n <!-- Export to PDF Button -->\n <button\n *ngIf=\"hasExportPDF\"\n pButton\n icon=\"pi pi-file-pdf\"\n class=\"p-button-rounded p-button-text\"\n (click)=\"exportPdf()\"\n title=\"Export to PDF\"\n ></button>\n </div>\n <div class=\"ml-auto\" *ngIf=\"hasSearchFilter\">\n <!-- Add this wrapper div with ml-auto class -->\n <p-iconField iconPosition=\"left\" class=\"ml-auto\">\n <p-inputIcon>\n <i class=\"pi pi-search\"></i>\n </p-inputIcon>\n <input\n pInputText\n type=\"text\"\n [(ngModel)]=\"searchValue\"\n (input)=\"filterGlobal($event)\"\n placeholder=\"Search keyword\"\n />\n </p-iconField>\n </div>\n </div>\n </ng-template>\n\n <ng-template pTemplate=\"header\">\n <tr class=\"sticky-header\">\n <th\n *ngFor=\"let col of columns\"\n [style.width]=\"getHeaderWidth(col)\"\n [style.padding]=\"'0px'\"\n >\n <ng-container\n *ngIf=\"isSortable && col.isSortable !== false; else noSortHeader\"\n >\n <th\n pSortableColumn=\"{{ col.code }}\"\n [style.width]=\"getHeaderWidth(col)\"\n >\n <div\n class=\"header-container d-flex align-items-center justify-content-between\"\n [style.width]=\"col.width\"\n [style.padding]=\"'0px'\"\n [style.margin]=\"'10px'\"\n >\n <span>{{ col.title }}</span>\n <div\n class=\"icons d-flex align-items-center\"\n [style.width]=\"'77px'\"\n >\n <p-sortIcon field=\"{{ col.code }}\" />\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n display=\"menu\"\n [type]=\"getColumnFilterType(col)\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </div>\n </th>\n </ng-container>\n <ng-template #noSortHeader>\n <th>\n <div class=\"header-container\">\n <span>{{ col.title }}</span>\n <ng-container *ngIf=\"col.isFilter !== false\">\n <p-columnFilter\n *ngIf=\"col.type === 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n [currency]=\"getCurrencySymbol(col)\"\n ></p-columnFilter>\n\n <p-columnFilter\n *ngIf=\"col.type !== 'AMOUNT'\"\n display=\"menu\"\n [field]=\"col.code\"\n [type]=\"getColumnFilterType(col)\"\n >\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'date'\"\n >\n <p-calendar\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n\n <ng-template\n pTemplate=\"filter\"\n let-value\n let-filterCallback=\"filterCallback\"\n *ngIf=\"getColumnFilterType(col) === 'multiSelect'\"\n >\n <p-multiSelect\n [options]=\"col.filterOptions\"\n [ngModel]=\"value\"\n (ngModelChange)=\"filterCallback($event)\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n class=\"custom-multiselect\"\n ></p-multiSelect>\n </ng-template>\n </p-columnFilter>\n </ng-container>\n </div>\n </th>\n </ng-template>\n </th>\n </tr>\n </ng-template>\n\n <!-- Empty message template -->\n <ng-template pTemplate=\"emptymessage\">\n <div class=\"empty-message\">\n <i class=\"pi pi-info-circle\"></i>\n <p>No records available to display.</p>\n </div>\n </ng-template>\n\n <ng-template\n pTemplate=\"body\"\n let-data\n let-editing=\"editing\"\n let-ri=\"rowIndex\"\n >\n <!-- Render a table row and make it editable if `isEdit` is true -->\n <tr *ngIf=\"!loading\" [pEditableRow]=\"isEdit ? data : null\">\n <!-- Loop through each column and render corresponding table cells -->\n <ng-container *ngFor=\"let col of columns\">\n <ng-container *ngIf=\"col.code !== undefined\">\n <!-- Check if the data for the column exists -->\n <ng-container *ngIf=\"data[col.code] !== undefined\">\n <!-- Render an editable cell if the column is editable -->\n <td\n *ngIf=\"isEditable(col.code); else normalTD\"\n [style.width]=\"getHeaderWidth(col)\"\n >\n <!-- Multi-select input for columns that are multi-selectable -->\n <ng-container *ngIf=\"isMultiSelect(col.code); else datePicker\">\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-multiSelect\n appendTo=\"body\"\n [ngModel]=\"data[col.code]\"\n [style]=\"{ width: '100%' }\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [options]=\"optionValues\"\n ></p-multiSelect>\n </ng-template>\n <ng-template pTemplate=\"output\">\n <div class=\"multi-select-container\">\n <ng-container *ngFor=\"let rec of data[col.code]\">\n <p-tag [value]=\"rec\"></p-tag>\n </ng-container>\n </div>\n </ng-template>\n </p-cellEditor>\n </ng-container>\n\n <!-- Date picker input for columns that require date selection -->\n <ng-template #datePicker>\n <ng-container\n *ngIf=\"isDatePicker(col.code); else normalInput\"\n >\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <p-calendar\n [inputId]=\"data[col.code]\"\n [ngModel]=\"data[col.code]\"\n (ngModelChange)=\"\n changeHandler(data.id, col.code, $event)\n \"\n [dateFormat]=\"'dd/mm/yy'\"\n ></p-calendar>\n </ng-template>\n <ng-template pTemplate=\"output\">\n {{ data[col.code] | customDate }}\n </ng-template>\n </p-cellEditor>\n </ng-container>\n </ng-template>\n\n <!-- Normal text input for other columns -->\n <ng-template #normalInput>\n <p-cellEditor>\n <ng-template pTemplate=\"input\">\n <input\n pInputText\n type=\"text\"\n [ngModel]=\"data[col.code]\"\n (change)=\"onChange($event, data.id, col.code)\"\n />\n </ng-template>\n <ng-template pTemplate=\"output\">\n <!-- Use currency pipe to format the output for AMOUNT type -->\n <ng-container\n *ngIf=\"col.type === 'AMOUNT'; else normalOutput\"\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalOutput>\n {{ data[col.code] }}\n </ng-template>\n </ng-template>\n </p-cellEditor>\n </ng-template>\n </td>\n\n <!-- Render a normal table cell if the column is not editable -->\n <ng-template #normalTD>\n <td [style.width]=\"getHeaderWidth(col)\">\n <!-- Use customCurrency pipe to format the output for AMOUNT type with optional decimal places -->\n <ng-container *ngIf=\"col.type === 'AMOUNT'; else normalText\">\n >\n {{\n data[col.code]\n | customCurrency\n : getCurrencySymbol(col)\n : col.decimalPlaces\n : col.thousandSeparator\n : col.decimalSeparator\n }}\n </ng-container>\n <ng-template #normalText>\n {{ data[col.code] }}\n </ng-template>\n </td>\n </ng-template>\n </ng-container>\n </ng-container>\n </ng-container>\n\n <!-- Render action buttons if there are any actions defined -->\n <td *ngIf=\"actions?.length\">\n <div class=\"action-buttons-container\">\n <!-- Delete button if deletion is allowed -->\n <div *ngIf=\"isDelete\">\n <button\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-trash\"\n (click)=\"Delete(data.id)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n <!-- Edit, save, and cancel buttons for row editing -->\n <div>\n <button\n pInitEditableRow\n *ngIf=\"!editing\"\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-pencil\"\n (click)=\"initEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pSaveEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-check\"\n (click)=\"saveEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n <button\n *ngIf=\"editing\"\n pCancelEditableRow\n pButton\n pRipple\n type=\"button\"\n icon=\"pi pi-times\"\n (click)=\"cancelEditableRow(data)\"\n class=\"p-button-rounded p-button-text\"\n ></button>\n </div>\n </div>\n </td>\n </tr>\n </ng-template>\n </p-table>\n</div>\n", styles: [".ng-advanced-prime-table .bread-crumb{margin-bottom:15px}.ng-advanced-prime-table .date{width:100%;height:5rem;display:grid;justify-items:start;align-items:center}.ng-advanced-prime-table .filter-container{width:100%;display:flex;justify-content:space-between;align-items:center}.ng-advanced-prime-table .settings{display:flex;gap:1rem}.ng-advanced-prime-table .multi-select-container{display:flex;justify-content:center;align-items:center;gap:.3rem}.ng-advanced-prime-table ::ng-deep p-table{min-width:50rem}.ng-advanced-prime-table ::ng-deep .custom-multiselect .p-hidden-accessible input{display:none}.ng-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column.p-highlight:hover{background:none}.ng-advanced-prime-table ::ng-deep .p-datatable .p-sortable-column:focus{box-shadow:none;outline:0 none}.ng-advanced-prime-table ::ng-deep .header-container{display:flex;justify-content:space-between;align-items:center;width:100%}.ng-advanced-prime-table ::ng-deep p-columnfilter.p-element.ng-star-inserted{margin-top:4px}.ng-advanced-prime-table .flex{display:flex;justify-content:space-between;align-items:center}.ng-advanced-prime-table .ml-auto{margin-left:auto}.ng-advanced-prime-table ::ng-deep p-inputicon{margin-right:-1.5rem;z-index:2;position:relative}.ng-advanced-prime-table ::ng-deep .p-inputtext{padding-left:1.7rem}.ng-advanced-prime-table ::ng-deep .bt-filter-btn button{cursor:pointer;margin-left:1rem}.ng-advanced-prime-table ::ng-deep .p-icon-field-left .p-input-icon:first-of-type{left:-1rem}.ng-advanced-prime-table .table-row{text-align:center;display:flex;gap:1rem;justify-content:center}.ng-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-excel{font-size:1.25em;color:green}.ng-advanced-prime-table ::ng-deep span.p-button-icon.pi.pi-file-pdf{font-size:1.25em;color:red}.ng-advanced-prime-table .table-container{display:flex;flex-direction:column;height:100%;overflow:hidden}.ng-advanced-prime-table ::ng-deep .p-datatable{display:flex;flex-direction:column;width:100%;border-collapse:collapse;table-layout:fixed}.ng-advanced-prime-table ::ng-deep .p-datatable thead{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}.ng-advanced-prime-table ::ng-deep .p-datatable tfoot{display:table;width:100%;table-layout:fixed;background:#fff;z-index:2}.ng-advanced-prime-table ::ng-deep .p-datatable tbody{display:block;overflow-y:auto;overflow-x:hidden}.ng-advanced-prime-table ::ng-deep .p-datatable tbody tr{display:table;width:100%;table-layout:fixed}.ng-advanced-prime-table .empty-message{text-align:center;padding:2rem;color:#888;font-size:1.2rem}.ng-advanced-prime-table .empty-message i{display:block;font-size:2rem;margin-bottom:.5rem}.ng-advanced-prime-table th{white-space:normal;word-wrap:break-word}\n"] }]
|
404
457
|
}], ctorParameters: () => [], propDecorators: { data: [{
|
405
458
|
type: Input
|
406
459
|
}], columns: [{
|
@@ -522,6 +575,7 @@ var FormInputTypeEnum;
|
|
522
575
|
FormInputTypeEnum["CURRENCY"] = "CURRENCY";
|
523
576
|
FormInputTypeEnum["CHECKBOX"] = "CHECKBOX";
|
524
577
|
FormInputTypeEnum["SWITCH"] = "SWITCH";
|
578
|
+
FormInputTypeEnum["PASSWORD"] = "PASSWORD";
|
525
579
|
})(FormInputTypeEnum || (FormInputTypeEnum = {}));
|
526
580
|
|
527
581
|
var ButtonColorEnum;
|
@@ -542,6 +596,27 @@ var InputValidationEnum;
|
|
542
596
|
InputValidationEnum["PHONE_NUMBER"] = "^[0-9 ]+$";
|
543
597
|
})(InputValidationEnum || (InputValidationEnum = {}));
|
544
598
|
|
599
|
+
var BadgeType;
|
600
|
+
(function (BadgeType) {
|
601
|
+
BadgeType["Info"] = "info";
|
602
|
+
BadgeType["Danger"] = "danger";
|
603
|
+
BadgeType["Warning"] = "warning";
|
604
|
+
})(BadgeType || (BadgeType = {}));
|
605
|
+
const BadgeTypeStyles = {
|
606
|
+
[BadgeType.Info]: {
|
607
|
+
color: 'white',
|
608
|
+
backgroundColor: '#17a2b8', // Info blue
|
609
|
+
},
|
610
|
+
[BadgeType.Danger]: {
|
611
|
+
color: 'white',
|
612
|
+
backgroundColor: '#dc3545', // Danger red
|
613
|
+
},
|
614
|
+
[BadgeType.Warning]: {
|
615
|
+
color: 'white',
|
616
|
+
backgroundColor: '#ffc107', // Warning yellow
|
617
|
+
},
|
618
|
+
};
|
619
|
+
|
545
620
|
// projects/ng-prime-tools/src/lib/enums/public_api.ts
|
546
621
|
|
547
622
|
class MultiSearchCriteriaComponent {
|
@@ -649,11 +724,11 @@ class MultiSearchCriteriaComponent {
|
|
649
724
|
return null;
|
650
725
|
}
|
651
726
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: MultiSearchCriteriaComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
652
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: MultiSearchCriteriaComponent, selector: "multi-search-criteria", inputs: { title: "title", criteria: "criteria", inputsPerRow: "inputsPerRow", data: "data", mode: "mode" }, outputs: { filteredData: "filteredData", searchCriteria: "searchCriteria" }, ngImport: i0, template: "<p-panel
|
727
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: MultiSearchCriteriaComponent, selector: "multi-search-criteria", inputs: { title: "title", criteria: "criteria", inputsPerRow: "inputsPerRow", data: "data", mode: "mode" }, outputs: { filteredData: "filteredData", searchCriteria: "searchCriteria" }, ngImport: i0, template: "<p-panel\n header=\"{{ title }}\"\n [toggleable]=\"true\"\n [collapsed]=\"true\"\n class=\"multi-search-criteria\"\n>\n <div\n class=\"criteria-container\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputsPerRow + ', 1fr)' }\"\n >\n <div *ngFor=\"let input of criteria\" class=\"criteria-item\">\n <label class=\"bsc-label\">{{ input.title }}</label>\n\n <ng-container [ngSwitch]=\"input.type\">\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATERANGE\"\n [(ngModel)]=\"input.value\"\n selectionMode=\"range\"\n [dateFormat]=\"'dd/mm/yy'\"\n class=\"full-width-input\"\n [showIcon]=\"true\"\n (ngModelChange)=\"input.value = $event\"\n ></p-calendar>\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATE\"\n [ngModel]=\"input.value\"\n (ngModelChange)=\"input.value = $event\"\n [dateFormat]=\"'dd/mm/yy'\"\n [showIcon]=\"true\"\n class=\"full-width-input\"\n ></p-calendar>\n <input\n *ngSwitchCase=\"SearchCriteriaTypeEnum.STRING\"\n type=\"text\"\n pInputText\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n />\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.AMOUNT\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n mode=\"decimal\"\n inputId=\"minmaxfraction\"\n [minFractionDigits]=\"2\"\n [maxFractionDigits]=\"5\"\n [placeholder]=\"getCurrencySymbol(input)\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.NUMBER\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-multiSelect\n *ngSwitchCase=\"SearchCriteriaTypeEnum.MULTISELECT\"\n [options]=\"input.filterOptions\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n [selectAll]=\"selectAll\"\n [(ngModel)]=\"input.value\"\n optionLabel=\"label\"\n (onSelectAllChange)=\"onSelectAllChange($event, input)\"\n class=\"custom-multiselect full-width-input\"\n ></p-multiSelect>\n </ng-container>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"footer-buttons\">\n <p-button\n label=\"Effacer\"\n icon=\"pi pi-times\"\n (click)=\"clear()\"\n class=\"footer-button\"\n ></p-button>\n <p-button\n label=\"Rechercher\"\n icon=\"pi pi-search\"\n (click)=\"search()\"\n class=\"footer-button\"\n ></p-button>\n </div>\n </ng-template>\n</p-panel>\n", styles: [".multi-search-criteria ::ng-deep .p-element .p-hidden-accessible input{display:none}.multi-search-criteria ::ng-deep .bsc-label{display:block;margin-bottom:5px;font-weight:700}.multi-search-criteria ::ng-deep .custom-multiselect{width:100%}.multi-search-criteria ::ng-deep .p-multiselect .p-multiselect-label{font-size:14px;color:#333}.multi-search-criteria ::ng-deep .p-inputtext{width:100%}.multi-search-criteria ::ng-deep .p-calendar .p-inputtext{width:100%}.multi-search-criteria ::ng-deep .p-inputnumber{width:100%}.multi-search-criteria .criteria-container{display:grid;gap:10px}.multi-search-criteria .criteria-item{margin-bottom:10px;box-sizing:border-box}.multi-search-criteria .full-width-input,::ng-deep .p-calendar,::ng-deep .p-multiselect{width:100%}.multi-search-criteria ::ng-deep .p-calendar .p-inputtext,::ng-deep .p-multiselect .p-multiselect-label{width:100%}.multi-search-criteria .footer-buttons{display:flex;justify-content:flex-end;gap:10px}.multi-search-criteria ::ng-deep .footer-button button{width:140px;cursor:pointer}.multi-search-criteria ::ng-deep .p-panel .p-panel-footer{background:#f8f9fa}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "component", type: i6.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepYearPicker", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "variant", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i8.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i8$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: i9$1.Panel, selector: "p-panel", inputs: ["toggleable", "header", "collapsed", "style", "styleClass", "iconPos", "expandIcon", "collapseIcon", "showHeader", "toggler", "transitionOptions"], outputs: ["collapsedChange", "onBeforeToggle", "onAfterToggle"] }] }); }
|
653
728
|
}
|
654
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: MultiSearchCriteriaComponent, decorators: [{
|
655
730
|
type: Component,
|
656
|
-
args: [{ selector: 'multi-search-criteria', template: "<p-panel
|
731
|
+
args: [{ selector: 'multi-search-criteria', template: "<p-panel\n header=\"{{ title }}\"\n [toggleable]=\"true\"\n [collapsed]=\"true\"\n class=\"multi-search-criteria\"\n>\n <div\n class=\"criteria-container\"\n [ngStyle]=\"{ 'grid-template-columns': 'repeat(' + inputsPerRow + ', 1fr)' }\"\n >\n <div *ngFor=\"let input of criteria\" class=\"criteria-item\">\n <label class=\"bsc-label\">{{ input.title }}</label>\n\n <ng-container [ngSwitch]=\"input.type\">\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATERANGE\"\n [(ngModel)]=\"input.value\"\n selectionMode=\"range\"\n [dateFormat]=\"'dd/mm/yy'\"\n class=\"full-width-input\"\n [showIcon]=\"true\"\n (ngModelChange)=\"input.value = $event\"\n ></p-calendar>\n <p-calendar\n *ngSwitchCase=\"SearchCriteriaTypeEnum.DATE\"\n [ngModel]=\"input.value\"\n (ngModelChange)=\"input.value = $event\"\n [dateFormat]=\"'dd/mm/yy'\"\n [showIcon]=\"true\"\n class=\"full-width-input\"\n ></p-calendar>\n <input\n *ngSwitchCase=\"SearchCriteriaTypeEnum.STRING\"\n type=\"text\"\n pInputText\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n />\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.AMOUNT\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n mode=\"decimal\"\n inputId=\"minmaxfraction\"\n [minFractionDigits]=\"2\"\n [maxFractionDigits]=\"5\"\n [placeholder]=\"getCurrencySymbol(input)\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-inputNumber\n *ngSwitchCase=\"SearchCriteriaTypeEnum.NUMBER\"\n type=\"number\"\n [(ngModel)]=\"input.value\"\n class=\"full-width-input\"\n ></p-inputNumber>\n\n <p-multiSelect\n *ngSwitchCase=\"SearchCriteriaTypeEnum.MULTISELECT\"\n [options]=\"input.filterOptions\"\n [display]=\"'chip'\"\n placeholder=\"Select\"\n [selectAll]=\"selectAll\"\n [(ngModel)]=\"input.value\"\n optionLabel=\"label\"\n (onSelectAllChange)=\"onSelectAllChange($event, input)\"\n class=\"custom-multiselect full-width-input\"\n ></p-multiSelect>\n </ng-container>\n </div>\n </div>\n\n <ng-template pTemplate=\"footer\">\n <div class=\"footer-buttons\">\n <p-button\n label=\"Effacer\"\n icon=\"pi pi-times\"\n (click)=\"clear()\"\n class=\"footer-button\"\n ></p-button>\n <p-button\n label=\"Rechercher\"\n icon=\"pi pi-search\"\n (click)=\"search()\"\n class=\"footer-button\"\n ></p-button>\n </div>\n </ng-template>\n</p-panel>\n", styles: [".multi-search-criteria ::ng-deep .p-element .p-hidden-accessible input{display:none}.multi-search-criteria ::ng-deep .bsc-label{display:block;margin-bottom:5px;font-weight:700}.multi-search-criteria ::ng-deep .custom-multiselect{width:100%}.multi-search-criteria ::ng-deep .p-multiselect .p-multiselect-label{font-size:14px;color:#333}.multi-search-criteria ::ng-deep .p-inputtext{width:100%}.multi-search-criteria ::ng-deep .p-calendar .p-inputtext{width:100%}.multi-search-criteria ::ng-deep .p-inputnumber{width:100%}.multi-search-criteria .criteria-container{display:grid;gap:10px}.multi-search-criteria .criteria-item{margin-bottom:10px;box-sizing:border-box}.multi-search-criteria .full-width-input,::ng-deep .p-calendar,::ng-deep .p-multiselect{width:100%}.multi-search-criteria ::ng-deep .p-calendar .p-inputtext,::ng-deep .p-multiselect .p-multiselect-label{width:100%}.multi-search-criteria .footer-buttons{display:flex;justify-content:flex-end;gap:10px}.multi-search-criteria ::ng-deep .footer-button button{width:140px;cursor:pointer}.multi-search-criteria ::ng-deep .p-panel .p-panel-footer{background:#f8f9fa}\n"] }]
|
657
732
|
}], propDecorators: { title: [{
|
658
733
|
type: Input
|
659
734
|
}], criteria: [{
|
@@ -751,7 +826,7 @@ class PTCheckBoxInputComponent {
|
|
751
826
|
return '';
|
752
827
|
}
|
753
828
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
754
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTCheckBoxInputComponent, selector: "pt-check-box-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"checkbox-container\">\n <p-checkbox\n [formControlName]=\"formField.name\"\n [binary]=\"true\"\n [label]=\"formField.label || ''\"\n ></p-checkbox>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.checkbox-container{display:flex;align-items:center}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$
|
829
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTCheckBoxInputComponent, selector: "pt-check-box-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"checkbox-container\">\n <p-checkbox\n [formControlName]=\"formField.name\"\n [binary]=\"true\"\n [label]=\"formField.label || ''\"\n ></p-checkbox>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.checkbox-container{display:flex;align-items:center}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] }); }
|
755
830
|
}
|
756
831
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCheckBoxInputComponent, decorators: [{
|
757
832
|
type: Component,
|
@@ -1036,7 +1111,7 @@ class PTNumberInputComponent {
|
|
1036
1111
|
return '';
|
1037
1112
|
}
|
1038
1113
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1039
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTNumberInputComponent, selector: "pt-number-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$
|
1114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTNumberInputComponent, selector: "pt-number-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <p-inputNumber\n [formControlName]=\"formField.name\"\n mode=\"decimal\"\n [locale]=\"formField.numberFormat || undefined\"\n [useGrouping]=\"formField.numberFormat ? true : false\"\n [minFractionDigits]=\"formField.decimalDigits || 0\"\n [maxFractionDigits]=\"formField.decimalDigits || 0\"\n [placeholder]=\"formField.placeholder || ''\"\n ></p-inputNumber>\n <p-inputGroupAddon *ngIf=\"formField.iconClass || formField.currency\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n <span *ngIf=\"!formField.iconClass && formField.currency\">\n {{ formField.currency }}\n </span>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$2.InputGroup, selector: "p-inputGroup", inputs: ["style", "styleClass"] }, { kind: "component", type: i4$1.InputGroupAddon, selector: "p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "component", type: i8$1.InputNumber, selector: "p-inputNumber", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "style", "placeholder", "size", "maxlength", "tabindex", "title", "ariaLabelledBy", "ariaLabel", "ariaRequired", "name", "required", "autocomplete", "min", "max", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "step", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "variant", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus", "disabled"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }] }); }
|
1040
1115
|
}
|
1041
1116
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNumberInputComponent, decorators: [{
|
1042
1117
|
type: Component,
|
@@ -1092,7 +1167,7 @@ class PTSwitchInputComponent {
|
|
1092
1167
|
return '';
|
1093
1168
|
}
|
1094
1169
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1095
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTSwitchInputComponent, selector: "pt-switch-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"switch-container\" style=\"display: flex; align-items: center\">\n <p-inputSwitch [formControlName]=\"formField.name\"></p-inputSwitch>\n <label *ngIf=\"formField.label\" style=\"margin-left: 8px\">{{\n formField.label\n }}</label>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".switch-container{display:flex;align-items:center}.error-container{margin-top:5px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$
|
1170
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTSwitchInputComponent, selector: "pt-switch-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <div class=\"switch-container\" style=\"display: flex; align-items: center\">\n <p-inputSwitch [formControlName]=\"formField.name\"></p-inputSwitch>\n <label *ngIf=\"formField.label\" style=\"margin-left: 8px\">{{\n formField.label\n }}</label>\n </div>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.errors &&\n (formGroup.get(formField.name)?.touched ||\n formGroup.get(formField.name)?.dirty)\n \"\n class=\"error-container\"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".switch-container{display:flex;align-items:center}.error-container{margin-top:5px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$3.InputSwitch, selector: "p-inputSwitch", inputs: ["style", "styleClass", "tabindex", "inputId", "name", "disabled", "readonly", "trueValue", "falseValue", "ariaLabel", "ariaLabelledBy", "autofocus"], outputs: ["onChange"] }] }); }
|
1096
1171
|
}
|
1097
1172
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSwitchInputComponent, decorators: [{
|
1098
1173
|
type: Component,
|
@@ -1167,11 +1242,11 @@ class PTTextAreaInputComponent {
|
|
1167
1242
|
return '';
|
1168
1243
|
}
|
1169
1244
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1170
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextAreaInputComponent, selector: "pt-text-area-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:
|
1245
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextAreaInputComponent, selector: "pt-text-area-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i3$4.InputTextarea, selector: "[pInputTextarea]", inputs: ["autoResize", "variant"], outputs: ["onResize"] }, { kind: "component", type: i3$2.InputGroup, selector: "p-inputGroup", inputs: ["style", "styleClass"] }, { kind: "component", type: i4$1.InputGroupAddon, selector: "p-inputGroupAddon", inputs: ["style", "styleClass"] }] }); }
|
1171
1246
|
}
|
1172
1247
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextAreaInputComponent, decorators: [{
|
1173
1248
|
type: Component,
|
1174
|
-
args: [{ selector: 'pt-text-area-input', template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:
|
1249
|
+
args: [{ selector: 'pt-text-area-input', template: "<div\n [formGroup]=\"formGroup\"\n *ngIf=\"!formField.hidden\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-inputGroup>\n <ng-container\n *ngIf=\"!formField.iconPosition || formField.iconPosition === 'left'\"\n >\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n </ng-container>\n <ng-container *ngIf=\"formField.iconPosition === 'right'\">\n <textarea\n pInputTextarea\n [formControlName]=\"formField.name\"\n [rows]=\"formField.rows || 5\"\n [cols]=\"formField.cols || 30\"\n [autoResize]=\"formField.autoResize || false\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [placeholder]=\"formField.placeholder || ''\"\n ></textarea>\n <p-inputGroupAddon *ngIf=\"formField.iconClass\">\n <i *ngIf=\"formField.iconClass\" [ngClass]=\"formField.iconClass\"></i>\n </p-inputGroupAddon>\n </ng-container>\n </p-inputGroup>\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <!-- Spacer to ensure alignment -->\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}\n"] }]
|
1175
1250
|
}], propDecorators: { formGroup: [{
|
1176
1251
|
type: Input
|
1177
1252
|
}], formField: [{
|
@@ -1207,7 +1282,22 @@ class PTTextInputComponent {
|
|
1207
1282
|
}
|
1208
1283
|
updateCharacterCount() {
|
1209
1284
|
const control = this.formGroup.get(this.formField.name);
|
1210
|
-
|
1285
|
+
if (control && control.value !== null) {
|
1286
|
+
this.characterCount = control.value ? control.value.length : 0;
|
1287
|
+
}
|
1288
|
+
else {
|
1289
|
+
this.characterCount = 0;
|
1290
|
+
}
|
1291
|
+
}
|
1292
|
+
getInputType() {
|
1293
|
+
switch (this.formField.type) {
|
1294
|
+
case FormInputTypeEnum.PASSWORD:
|
1295
|
+
return 'password';
|
1296
|
+
case FormInputTypeEnum.NUMBER:
|
1297
|
+
return 'number';
|
1298
|
+
default:
|
1299
|
+
return 'text';
|
1300
|
+
}
|
1211
1301
|
}
|
1212
1302
|
getValidators() {
|
1213
1303
|
const validators = [];
|
@@ -1245,11 +1335,11 @@ class PTTextInputComponent {
|
|
1245
1335
|
return '';
|
1246
1336
|
}
|
1247
1337
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1248
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextInputComponent, selector: "pt-text-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{
|
1338
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTTextInputComponent, selector: "pt-text-input", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n\n <ng-container *ngIf=\"formField.iconClass; else noIcon\">\n <p-iconField [iconPosition]=\"formField.iconPosition || 'left'\">\n <p-inputIcon\n *ngIf=\"formField.iconClass\"\n [styleClass]=\"formField.iconClass\"\n ></p-inputIcon>\n <input\n [type]=\"getInputType()\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n />\n </p-iconField>\n </ng-container>\n\n <ng-template #noIcon>\n <input\n [type]=\"getInputType()\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n />\n </ng-template>\n\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}input:focus{outline:none;box-shadow:none;border-color:inherit}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.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$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i4.InputText, selector: "[pInputText]", inputs: ["variant"] }, { kind: "component", type: i10.IconField, selector: "p-iconField", inputs: ["iconPosition"] }, { kind: "component", type: i11.InputIcon, selector: "p-inputIcon", inputs: ["styleClass"] }] }); }
|
1249
1339
|
}
|
1250
1340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTTextInputComponent, decorators: [{
|
1251
1341
|
type: Component,
|
1252
|
-
args: [{ selector: 'pt-text-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{
|
1342
|
+
args: [{ selector: 'pt-text-input', template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n\n <ng-container *ngIf=\"formField.iconClass; else noIcon\">\n <p-iconField [iconPosition]=\"formField.iconPosition || 'left'\">\n <p-inputIcon\n *ngIf=\"formField.iconClass\"\n [styleClass]=\"formField.iconClass\"\n ></p-inputIcon>\n <input\n [type]=\"getInputType()\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n />\n </p-iconField>\n </ng-container>\n\n <ng-template #noIcon>\n <input\n [type]=\"getInputType()\"\n pInputText\n [formControlName]=\"formField.name\"\n [placeholder]=\"formField.placeholder ?? ''\"\n [attr.minlength]=\"formField.minLength\"\n [attr.maxlength]=\"formField.maxLength\"\n [ngStyle]=\"{\n width: formField.width || '100%',\n height: formField.height || 'auto'\n }\"\n />\n </ng-template>\n\n <div class=\"form-info-row\">\n <small\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n class=\"p-error\"\n >\n {{ getErrorMessage() }}\n </small>\n <div class=\"spacer\"></div>\n <div\n *ngIf=\"!formField.disabled && formField.maxLength !== undefined\"\n class=\"character-counter\"\n >\n {{ characterCount }}/{{ formField.maxLength }} characters\n </div>\n </div>\n</div>\n", styles: [".form-field{position:relative;margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700;font-size:1rem}.form-info-row{display:flex;justify-content:space-between;align-items:center;margin-top:.5rem}.spacer{flex-grow:1}.character-counter{font-size:.8rem;color:#888;text-align:right;margin-left:auto}.p-error{font-size:.8rem;color:#f44336}input:focus{outline:none;box-shadow:none;border-color:inherit}\n"] }]
|
1253
1343
|
}], propDecorators: { formGroup: [{
|
1254
1344
|
type: Input
|
1255
1345
|
}], formField: [{
|
@@ -1296,7 +1386,7 @@ class PTDropdownComponent {
|
|
1296
1386
|
return '';
|
1297
1387
|
}
|
1298
1388
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
1299
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDropdownComponent, selector: "pt-dropdown", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-dropdown\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select an option'\"\n optionLabel=\"label\"\n ></p-dropdown>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$
|
1389
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDropdownComponent, selector: "pt-dropdown", inputs: { formGroup: "formGroup", formField: "formField" }, ngImport: i0, template: "<div\n [formGroup]=\"formGroup\"\n class=\"form-field\"\n [ngStyle]=\"{ width: formField.width || '100%' }\"\n *ngIf=\"!formField.hidden\"\n>\n <label *ngIf=\"formField.label\">{{ formField.label }}</label>\n <p-dropdown\n [formControlName]=\"formField.name\"\n [options]=\"formField.options\"\n [placeholder]=\"formField.placeholder || 'Select an option'\"\n optionLabel=\"label\"\n ></p-dropdown>\n <div\n *ngIf=\"\n formGroup.get(formField.name)?.invalid &&\n formGroup.get(formField.name)?.touched\n \"\n >\n <small class=\"p-error\">{{ getErrorMessage() }}</small>\n </div>\n</div>\n", styles: [".form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i3$5.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }] }); }
|
1300
1390
|
}
|
1301
1391
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDropdownComponent, decorators: [{
|
1302
1392
|
type: Component,
|
@@ -1448,7 +1538,7 @@ class PTFormBuilderComponent {
|
|
1448
1538
|
this.form.reset();
|
1449
1539
|
}
|
1450
1540
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderComponent, deps: [{ token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
1451
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTFormBuilderComponent, selector: "pt-form-builder", inputs: { mainGroup: "mainGroup", buttons: "buttons", title: "title", titleStyle: "titleStyle", inputWidth: "inputWidth", language: "language" }, outputs: { formSubmit: "formSubmit" }, ngImport: i0, template: "<div *ngIf=\"title\" [ngStyle]=\"titleStyle\" class=\"form-title\">{{ title }}</div>\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngFor=\"let field of mainGroup.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n [inputWidth]=\"inputWidth\"\n ></pt-dynamic-form-field>\n </ng-container>\n\n <ng-container *ngFor=\"let group of mainGroup.groups\">\n <div class=\"form-field-group\" [ngStyle]=\"{ width: group.width || '100%' }\">\n <ng-container *ngFor=\"let field of group.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n class=\"flex-item\"\n ></pt-dynamic-form-field>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"button-group\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n pButton\n [label]=\"button.text\"\n [icon]=\"button.icon || ''\"\n [class]=\"button.color\"\n (click)=\"\n button.isSubmit\n ? onSubmit()\n : button.isClear\n ? onClear()\n : button.action\n ? button.action()\n : null\n \"\n ></button>\n </div>\n</form>\n", styles: [".form-title{text-align:center;margin-bottom:1rem;font-size:1.5rem;font-weight:700}.form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}::ng-deep .p-inputtext,::ng-deep .p-inputtextarea,::ng-deep .p-calendar,::ng-deep .p-inputnumber,::ng-deep .p-multiselect,::ng-deep .p-dropdown{width:100%!important}::ng-deep .p-inputnumber,::ng-deep p-inputnumber{display:flex!important}.button-group{display:flex;gap:1rem;margin-top:1rem;justify-content:space-between}.button-group button{flex:1;display:flex;align-items:center;justify-content:center}.button-group button i{margin-right:.5rem}.button-group button.p-button-primary{background-color:#007bff;color:#fff}.button-group button.p-button-secondary{background-color:#6c757d;color:#fff}.button-group button.p-button-success{background-color:#28a745;color:#fff}.button-group button:hover{opacity:.9}.form-field-group{display:flex;gap:1rem}.form-field-group .flex-item{flex:1}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3
|
1541
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTFormBuilderComponent, selector: "pt-form-builder", inputs: { mainGroup: "mainGroup", buttons: "buttons", title: "title", titleStyle: "titleStyle", inputWidth: "inputWidth", language: "language" }, outputs: { formSubmit: "formSubmit" }, ngImport: i0, template: "<div *ngIf=\"title\" [ngStyle]=\"titleStyle\" class=\"form-title\">{{ title }}</div>\n<form [formGroup]=\"form\" (ngSubmit)=\"onSubmit()\">\n <ng-container *ngFor=\"let field of mainGroup.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n [inputWidth]=\"inputWidth\"\n ></pt-dynamic-form-field>\n </ng-container>\n\n <ng-container *ngFor=\"let group of mainGroup.groups\">\n <div class=\"form-field-group\" [ngStyle]=\"{ width: group.width || '100%' }\">\n <ng-container *ngFor=\"let field of group.fields\">\n <pt-dynamic-form-field\n [field]=\"field\"\n [form]=\"form\"\n class=\"flex-item\"\n ></pt-dynamic-form-field>\n </ng-container>\n </div>\n </ng-container>\n\n <div class=\"button-group\">\n <button\n *ngFor=\"let button of buttons\"\n type=\"button\"\n pButton\n [label]=\"button.text\"\n [icon]=\"button.icon || ''\"\n [class]=\"button.color\"\n (click)=\"\n button.isSubmit\n ? onSubmit()\n : button.isClear\n ? onClear()\n : button.action\n ? button.action()\n : null\n \"\n ></button>\n </div>\n</form>\n", styles: [".form-title{text-align:center;margin-bottom:1rem;font-size:1.5rem;font-weight:700}.form-field{margin-bottom:1rem}.form-field label{display:block;margin-bottom:.5rem;font-weight:700}::ng-deep .p-inputtext,::ng-deep .p-inputtextarea,::ng-deep .p-calendar,::ng-deep .p-inputnumber,::ng-deep .p-multiselect,::ng-deep .p-dropdown{width:100%!important}::ng-deep .p-inputnumber,::ng-deep p-inputnumber{display:flex!important}.button-group{display:flex;gap:1rem;margin-top:1rem;justify-content:space-between}.button-group button{flex:1;display:flex;align-items:center;justify-content:center}.button-group button i{margin-right:.5rem}.button-group button.p-button-primary{background-color:#007bff;color:#fff}.button-group button.p-button-secondary{background-color:#6c757d;color:#fff}.button-group button.p-button-success{background-color:#28a745;color:#fff}.button-group button:hover{opacity:.9}.form-field-group{display:flex;gap:1rem}.form-field-group .flex-item{flex:1}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain"] }, { kind: "component", type: PTDynamicFormFieldComponent, selector: "pt-dynamic-form-field", inputs: ["field", "form", "inputWidth"] }] }); }
|
1452
1542
|
}
|
1453
1543
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFormBuilderComponent, decorators: [{
|
1454
1544
|
type: Component,
|
@@ -1964,6 +2054,7 @@ class PTMenuComponent {
|
|
1964
2054
|
constructor() {
|
1965
2055
|
this.config = {
|
1966
2056
|
icon: { code: 'pi pi-ellipsis-v', color: '#000', fontSize: '15px' },
|
2057
|
+
menuDirection: 'right',
|
1967
2058
|
};
|
1968
2059
|
this.isOpen = false;
|
1969
2060
|
}
|
@@ -1972,13 +2063,28 @@ class PTMenuComponent {
|
|
1972
2063
|
static { this.DEFAULT_ICON_COLOR = '#000'; }
|
1973
2064
|
static { this.DEFAULT_ICON_FONT_SIZE = '15px'; }
|
1974
2065
|
static { this.DEFAULT_ICON_CODE = 'pi pi-ellipsis-v'; }
|
2066
|
+
static { this.openMenuInstance = null; }
|
1975
2067
|
toggleMenu() {
|
2068
|
+
if (PTMenuComponent.openMenuInstance &&
|
2069
|
+
PTMenuComponent.openMenuInstance !== this) {
|
2070
|
+
PTMenuComponent.openMenuInstance.closeMenu();
|
2071
|
+
}
|
1976
2072
|
this.isOpen = !this.isOpen;
|
2073
|
+
if (this.isOpen) {
|
2074
|
+
PTMenuComponent.openMenuInstance = this;
|
2075
|
+
}
|
2076
|
+
else {
|
2077
|
+
PTMenuComponent.openMenuInstance = null;
|
2078
|
+
}
|
1977
2079
|
}
|
1978
2080
|
closeMenu() {
|
1979
2081
|
this.isOpen = false;
|
2082
|
+
if (PTMenuComponent.openMenuInstance === this) {
|
2083
|
+
PTMenuComponent.openMenuInstance = null;
|
2084
|
+
}
|
1980
2085
|
}
|
1981
2086
|
getMenuItemIconClass(item) {
|
2087
|
+
// Assuming that icons starting with "fa" are FontAwesome icons
|
1982
2088
|
return typeof item.icon === 'string' ? item.icon : item.icon?.code || '';
|
1983
2089
|
}
|
1984
2090
|
getMenuItemIconStyles(item) {
|
@@ -2012,19 +2118,18 @@ class PTMenuComponent {
|
|
2012
2118
|
fontSize: item.fontSize || PTMenuComponent.DEFAULT_TEXT_FONT_SIZE,
|
2013
2119
|
};
|
2014
2120
|
}
|
2015
|
-
// Listen to all clicks on the document
|
2016
2121
|
onDocumentClick(event) {
|
2017
|
-
const clickedInside = event.target.closest('.menu
|
2122
|
+
const clickedInside = event.target.closest('.pt-menu');
|
2018
2123
|
if (!clickedInside) {
|
2019
2124
|
this.closeMenu();
|
2020
2125
|
}
|
2021
2126
|
}
|
2022
2127
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2023
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMenuComponent, selector: "pt-menu", inputs: { config: "config" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<div
|
2128
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMenuComponent, selector: "pt-menu", inputs: { config: "config" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<div\n [ngClass]=\"{\n open: isOpen,\n 'menu-left': config.menuDirection === 'left',\n 'menu-right': config.menuDirection === 'right'\n }\"\n class=\"pt-menu\"\n>\n <i\n class=\"menu-icon\"\n (click)=\"toggleMenu()\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <div class=\"menu-dropdown\" *ngIf=\"isOpen\">\n <div\n class=\"menu-item\"\n *ngFor=\"let item of config.menuItems\"\n (click)=\"item.action()\"\n >\n <i\n [ngClass]=\"getMenuItemIconClass(item)\"\n [ngStyle]=\"getMenuItemIconStyles(item)\"\n ></i>\n <span [ngStyle]=\"getTextStyles(item)\">{{ item.text }}</span>\n </div>\n </div>\n</div>\n", styles: [".pt-menu{position:relative;display:inline-block}.pt-menu .menu-icon{font-style:normal;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;transition:background-color .2s,box-shadow .2s}.pt-menu .menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.pt-menu .menu-dropdown{display:none;position:absolute;background-color:#fff;box-shadow:0 8px 16px #0003;min-width:160px;z-index:1;border-radius:5px;overflow:hidden}.pt-menu .menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.pt-menu .menu-item i{margin-right:10px}.pt-menu .menu-item:hover{background-color:#f1f1f1}.pt-menu.open .menu-dropdown{display:block}.pt-menu.menu-left .menu-dropdown{right:0;left:auto}.pt-menu.menu-right .menu-dropdown{left:0;right:auto}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
|
2024
2129
|
}
|
2025
2130
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuComponent, decorators: [{
|
2026
2131
|
type: Component,
|
2027
|
-
args: [{ selector: 'pt-menu', template: "<div
|
2132
|
+
args: [{ selector: 'pt-menu', template: "<div\n [ngClass]=\"{\n open: isOpen,\n 'menu-left': config.menuDirection === 'left',\n 'menu-right': config.menuDirection === 'right'\n }\"\n class=\"pt-menu\"\n>\n <i\n class=\"menu-icon\"\n (click)=\"toggleMenu()\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <div class=\"menu-dropdown\" *ngIf=\"isOpen\">\n <div\n class=\"menu-item\"\n *ngFor=\"let item of config.menuItems\"\n (click)=\"item.action()\"\n >\n <i\n [ngClass]=\"getMenuItemIconClass(item)\"\n [ngStyle]=\"getMenuItemIconStyles(item)\"\n ></i>\n <span [ngStyle]=\"getTextStyles(item)\">{{ item.text }}</span>\n </div>\n </div>\n</div>\n", styles: [".pt-menu{position:relative;display:inline-block}.pt-menu .menu-icon{font-style:normal;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;transition:background-color .2s,box-shadow .2s}.pt-menu .menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.pt-menu .menu-dropdown{display:none;position:absolute;background-color:#fff;box-shadow:0 8px 16px #0003;min-width:160px;z-index:1;border-radius:5px;overflow:hidden}.pt-menu .menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.pt-menu .menu-item i{margin-right:10px}.pt-menu .menu-item:hover{background-color:#f1f1f1}.pt-menu.open .menu-dropdown{display:block}.pt-menu.menu-left .menu-dropdown{right:0;left:auto}.pt-menu.menu-right .menu-dropdown{left:0;right:auto}\n"] }]
|
2028
2133
|
}], propDecorators: { config: [{
|
2029
2134
|
type: Input
|
2030
2135
|
}], onDocumentClick: [{
|
@@ -2036,6 +2141,7 @@ class PTCardComponent {
|
|
2036
2141
|
constructor() {
|
2037
2142
|
this.config = {};
|
2038
2143
|
}
|
2144
|
+
// Default values as readonly variables
|
2039
2145
|
static { this.DEFAULT_TITLE_COLOR = '#333'; }
|
2040
2146
|
static { this.DEFAULT_TITLE_FONT_SIZE = '1.5em'; }
|
2041
2147
|
static { this.DEFAULT_ICON_COLOR = '#333'; }
|
@@ -2048,9 +2154,15 @@ class PTCardComponent {
|
|
2048
2154
|
static { this.DEFAULT_MENU_POSITION = 'right'; }
|
2049
2155
|
static { this.DEFAULT_BORDER_COLOR = '#ddd'; }
|
2050
2156
|
static { this.DEFAULT_BORDER_WIDTH = '1px'; }
|
2157
|
+
static { this.DEFAULT_TRANSPARENCY = '100'; }
|
2158
|
+
static { this.DEFAULT_PADDING = '16px'; }
|
2159
|
+
static { this.DEFAULT_MARGIN = '16px 0'; }
|
2051
2160
|
isTitleObject() {
|
2052
2161
|
return typeof this.config.title === 'object';
|
2053
2162
|
}
|
2163
|
+
hasTitle() {
|
2164
|
+
return this.config.title !== undefined && this.config.title !== null;
|
2165
|
+
}
|
2054
2166
|
getTitleText() {
|
2055
2167
|
return this.isTitleObject()
|
2056
2168
|
? this.config.title.text
|
@@ -2097,21 +2209,41 @@ class PTCardComponent {
|
|
2097
2209
|
return this.config.menuPosition || PTCardComponent.DEFAULT_MENU_POSITION;
|
2098
2210
|
}
|
2099
2211
|
getCardStyles() {
|
2212
|
+
const transparency = this.config.pattern?.transparencyPercentage ||
|
2213
|
+
PTCardComponent.DEFAULT_TRANSPARENCY;
|
2214
|
+
const backgroundImage = this.config.pattern
|
2215
|
+
? `linear-gradient(rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100}), rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100})), url(${this.config.pattern.imageUrl})`
|
2216
|
+
: '';
|
2217
|
+
// Apply border conditionally based on noBorder property
|
2218
|
+
const borderStyle = this.config.noBorder
|
2219
|
+
? 'none'
|
2220
|
+
: `solid ${this.config.borderWidth || PTCardComponent.DEFAULT_BORDER_WIDTH} ${this.config.borderColor || PTCardComponent.DEFAULT_BORDER_COLOR}`;
|
2100
2221
|
return {
|
2101
2222
|
backgroundColor: this.config.backgroundColor || PTCardComponent.DEFAULT_BACKGROUND_COLOR,
|
2223
|
+
backgroundImage: backgroundImage,
|
2224
|
+
backgroundSize: 'cover',
|
2225
|
+
backgroundPosition: 'center',
|
2102
2226
|
width: this.config.width || PTCardComponent.DEFAULT_WIDTH,
|
2103
2227
|
height: this.config.height || PTCardComponent.DEFAULT_HEIGHT,
|
2104
|
-
|
2105
|
-
|
2106
|
-
|
2228
|
+
border: borderStyle,
|
2229
|
+
padding: this.config.padding || PTCardComponent.DEFAULT_PADDING,
|
2230
|
+
margin: this.config.margin || PTCardComponent.DEFAULT_MARGIN,
|
2231
|
+
borderRadius: this.config.borderRadius || '8px',
|
2232
|
+
boxShadow: this.config.boxShadow || '0 2px 4px rgba(0, 0, 0, 0.1)',
|
2107
2233
|
};
|
2108
2234
|
}
|
2235
|
+
isScrollableHorizontal() {
|
2236
|
+
return !!this.config.scrollableHorizontal;
|
2237
|
+
}
|
2238
|
+
isScrollableVertical() {
|
2239
|
+
return !!this.config.scrollableVertical;
|
2240
|
+
}
|
2109
2241
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2110
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTCardComponent, selector: "pt-card", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"card\" [ngStyle]=\"getCardStyles()\">\n <div class=\"card-header\" [ngStyle]=\"getTitleStyles()\">\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'left'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-left\"\n ></i>\n <span>{{ getTitleText() }}</span>\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'right'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-right\"\n ></i>\n <pt-menu\n *ngIf=\"config.menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right'\n }\"\n ></pt-menu>\n </div>\n <div
|
2242
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTCardComponent, selector: "pt-card", inputs: { config: "config" }, ngImport: i0, template: "<div class=\"pt-card card\" [ngStyle]=\"getCardStyles()\">\n <div *ngIf=\"hasTitle()\" class=\"card-header\" [ngStyle]=\"getTitleStyles()\">\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'left'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-left\"\n ></i>\n <span>{{ getTitleText() }}</span>\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'right'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-right\"\n ></i>\n <pt-menu\n *ngIf=\"config.menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right'\n }\"\n ></pt-menu>\n </div>\n <div\n class=\"card-body\"\n [ngClass]=\"{\n 'card-body-scrollable-vertical': isScrollableVertical(),\n 'card-body-scrollable-horizontal': isScrollableHorizontal()\n }\"\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pt-card .card{padding:16px;margin:16px 0;display:flex;flex-direction:column;max-height:100vh;overflow:hidden;background-size:cover;background-position:center}.pt-card .card-body{flex-grow:1;max-width:100%}.pt-card .card-body-scrollable-horizontal{overflow-x:auto;padding-bottom:8px}.pt-card .card-body-scrollable-vertical{flex-grow:1;overflow-y:auto;padding-right:8px}.pt-card .card-header{margin-bottom:16px;display:flex;align-items:center;justify-content:var(--text-align, left);position:relative}.pt-card .card-header-icon-left{margin-right:6px}.pt-card .card-header-icon-right{margin-left:6px}.pt-card .menu-left{position:absolute;left:0;top:0}.pt-card .menu-right{position:absolute;right:0;top:-2px}.pt-card .card-menu{margin-left:auto;cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PTMenuComponent, selector: "pt-menu", inputs: ["config"] }] }); }
|
2111
2243
|
}
|
2112
2244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardComponent, decorators: [{
|
2113
2245
|
type: Component,
|
2114
|
-
args: [{ selector: 'pt-card', template: "<div class=\"card\" [ngStyle]=\"getCardStyles()\">\n <div class=\"card-header\" [ngStyle]=\"getTitleStyles()\">\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'left'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-left\"\n ></i>\n <span>{{ getTitleText() }}</span>\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'right'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-right\"\n ></i>\n <pt-menu\n *ngIf=\"config.menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right'\n }\"\n ></pt-menu>\n </div>\n <div
|
2246
|
+
args: [{ selector: 'pt-card', template: "<div class=\"pt-card card\" [ngStyle]=\"getCardStyles()\">\n <div *ngIf=\"hasTitle()\" class=\"card-header\" [ngStyle]=\"getTitleStyles()\">\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'left'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-left\"\n ></i>\n <span>{{ getTitleText() }}</span>\n <i\n *ngIf=\"getIconClass() && getIconPosition() === 'right'\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n class=\"card-header-icon-right\"\n ></i>\n <pt-menu\n *ngIf=\"config.menu\"\n [config]=\"config.menu\"\n [ngClass]=\"{\n 'menu-left': getMenuPosition() === 'left',\n 'menu-right': getMenuPosition() === 'right'\n }\"\n ></pt-menu>\n </div>\n <div\n class=\"card-body\"\n [ngClass]=\"{\n 'card-body-scrollable-vertical': isScrollableVertical(),\n 'card-body-scrollable-horizontal': isScrollableHorizontal()\n }\"\n >\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".pt-card .card{padding:16px;margin:16px 0;display:flex;flex-direction:column;max-height:100vh;overflow:hidden;background-size:cover;background-position:center}.pt-card .card-body{flex-grow:1;max-width:100%}.pt-card .card-body-scrollable-horizontal{overflow-x:auto;padding-bottom:8px}.pt-card .card-body-scrollable-vertical{flex-grow:1;overflow-y:auto;padding-right:8px}.pt-card .card-header{margin-bottom:16px;display:flex;align-items:center;justify-content:var(--text-align, left);position:relative}.pt-card .card-header-icon-left{margin-right:6px}.pt-card .card-header-icon-right{margin-left:6px}.pt-card .menu-left{position:absolute;left:0;top:0}.pt-card .menu-right{position:absolute;right:0;top:-2px}.pt-card .card-menu{margin-left:auto;cursor:pointer}\n"] }]
|
2115
2247
|
}], propDecorators: { config: [{
|
2116
2248
|
type: Input
|
2117
2249
|
}] } });
|
@@ -2144,6 +2276,1046 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
2144
2276
|
}]
|
2145
2277
|
}] });
|
2146
2278
|
|
2279
|
+
class PTMenuFancyComponent {
|
2280
|
+
constructor() {
|
2281
|
+
this.config = {
|
2282
|
+
icon: { code: 'pi pi-ellipsis-v', color: '#000', fontSize: '15px' },
|
2283
|
+
menuDirection: 'right',
|
2284
|
+
};
|
2285
|
+
this.cardMenuConfig = { noBorder: true };
|
2286
|
+
this.isOpen = false;
|
2287
|
+
}
|
2288
|
+
static { this.DEFAULT_TEXT_COLOR = '#000'; }
|
2289
|
+
static { this.DEFAULT_TEXT_FONT_SIZE = '15px'; }
|
2290
|
+
static { this.DEFAULT_ICON_COLOR = '#000'; }
|
2291
|
+
static { this.DEFAULT_ICON_FONT_SIZE = '15px'; }
|
2292
|
+
static { this.DEFAULT_ICON_CODE = 'pi pi-ellipsis-v'; }
|
2293
|
+
static { this.openMenuInstance = null; }
|
2294
|
+
toggleMenu() {
|
2295
|
+
if (PTMenuFancyComponent.openMenuInstance &&
|
2296
|
+
PTMenuFancyComponent.openMenuInstance !== this) {
|
2297
|
+
PTMenuFancyComponent.openMenuInstance.closeMenu();
|
2298
|
+
}
|
2299
|
+
this.isOpen = !this.isOpen;
|
2300
|
+
if (this.isOpen) {
|
2301
|
+
PTMenuFancyComponent.openMenuInstance = this;
|
2302
|
+
}
|
2303
|
+
else {
|
2304
|
+
PTMenuFancyComponent.openMenuInstance = null;
|
2305
|
+
}
|
2306
|
+
}
|
2307
|
+
closeMenu() {
|
2308
|
+
this.isOpen = false;
|
2309
|
+
if (PTMenuFancyComponent.openMenuInstance === this) {
|
2310
|
+
PTMenuFancyComponent.openMenuInstance = null;
|
2311
|
+
}
|
2312
|
+
}
|
2313
|
+
getMenuItemIconClass(item) {
|
2314
|
+
// Assuming that icons starting with "fa" are FontAwesome icons
|
2315
|
+
return typeof item.icon === 'string' ? item.icon : item.icon?.code || '';
|
2316
|
+
}
|
2317
|
+
getMenuItemIconStyles(item) {
|
2318
|
+
if (typeof item.icon !== 'string') {
|
2319
|
+
return {
|
2320
|
+
color: item.icon?.color || PTMenuFancyComponent.DEFAULT_ICON_COLOR,
|
2321
|
+
fontSize: item.icon?.fontSize || PTMenuFancyComponent.DEFAULT_ICON_FONT_SIZE,
|
2322
|
+
};
|
2323
|
+
}
|
2324
|
+
return {
|
2325
|
+
color: PTMenuFancyComponent.DEFAULT_ICON_COLOR,
|
2326
|
+
fontSize: PTMenuFancyComponent.DEFAULT_ICON_FONT_SIZE,
|
2327
|
+
};
|
2328
|
+
}
|
2329
|
+
getIconClass() {
|
2330
|
+
return this.config.icon?.code || PTMenuFancyComponent.DEFAULT_ICON_CODE;
|
2331
|
+
}
|
2332
|
+
getIconStyles() {
|
2333
|
+
return {
|
2334
|
+
color: this.config.color ||
|
2335
|
+
this.config.icon?.color ||
|
2336
|
+
PTMenuFancyComponent.DEFAULT_ICON_COLOR,
|
2337
|
+
fontSize: this.config.fontSize ||
|
2338
|
+
this.config.icon?.fontSize ||
|
2339
|
+
PTMenuFancyComponent.DEFAULT_ICON_FONT_SIZE,
|
2340
|
+
};
|
2341
|
+
}
|
2342
|
+
getTextStyles(item) {
|
2343
|
+
return {
|
2344
|
+
color: item.color || PTMenuFancyComponent.DEFAULT_TEXT_COLOR,
|
2345
|
+
fontSize: item.fontSize || PTMenuFancyComponent.DEFAULT_TEXT_FONT_SIZE,
|
2346
|
+
};
|
2347
|
+
}
|
2348
|
+
onDocumentClick(event) {
|
2349
|
+
const clickedInside = event.target.closest('.pt-menu-fancy');
|
2350
|
+
if (!clickedInside) {
|
2351
|
+
this.closeMenu();
|
2352
|
+
}
|
2353
|
+
}
|
2354
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2355
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMenuFancyComponent, selector: "pt-menu-fancy", inputs: { config: "config" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, ngImport: i0, template: "<div\n [ngClass]=\"{\n open: isOpen,\n 'menu-left': config.menuDirection === 'left',\n 'menu-right': config.menuDirection === 'right'\n }\"\n class=\"pt-menu-fancy\"\n>\n <i\n class=\"menu-icon\"\n (click)=\"toggleMenu()\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <div class=\"menu-dropdown\" *ngIf=\"isOpen\">\n <pt-card [config]=\"cardMenuConfig\">\n <div\n class=\"menu-item\"\n *ngFor=\"let item of config.menuItems\"\n (click)=\"item.action()\"\n >\n <i\n [ngClass]=\"getMenuItemIconClass(item)\"\n [ngStyle]=\"getMenuItemIconStyles(item)\"\n ></i>\n <span [ngStyle]=\"getTextStyles(item)\">{{ item.text }}</span>\n </div>\n </pt-card>\n </div>\n</div>\n", styles: [".pt-menu-fancy{position:relative;display:inline-block}.pt-menu-fancy .menu-icon{font-style:normal;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;transition:background-color .2s,box-shadow .2s}.pt-menu-fancy .menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.pt-menu-fancy .menu-dropdown{position:absolute;top:100%;background-color:#fff;box-shadow:0 8px 16px #0003;min-width:160px;z-index:1;border-radius:5px;overflow:hidden;opacity:0;transform:translateY(-20px);transition:transform .3s ease-out,opacity .3s ease-out}.pt-menu-fancy.open .menu-dropdown{display:block;opacity:1;transform:translateY(0)}.pt-menu-fancy.menu-left .menu-dropdown{right:0;left:auto}.pt-menu-fancy.menu-right .menu-dropdown{left:0;right:auto}.pt-menu-fancy .menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.pt-menu-fancy .menu-item i{margin-right:10px}.pt-menu-fancy .menu-item:hover{background-color:#f1f1f1}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }] }); }
|
2356
|
+
}
|
2357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyComponent, decorators: [{
|
2358
|
+
type: Component,
|
2359
|
+
args: [{ selector: 'pt-menu-fancy', template: "<div\n [ngClass]=\"{\n open: isOpen,\n 'menu-left': config.menuDirection === 'left',\n 'menu-right': config.menuDirection === 'right'\n }\"\n class=\"pt-menu-fancy\"\n>\n <i\n class=\"menu-icon\"\n (click)=\"toggleMenu()\"\n [ngClass]=\"getIconClass()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <div class=\"menu-dropdown\" *ngIf=\"isOpen\">\n <pt-card [config]=\"cardMenuConfig\">\n <div\n class=\"menu-item\"\n *ngFor=\"let item of config.menuItems\"\n (click)=\"item.action()\"\n >\n <i\n [ngClass]=\"getMenuItemIconClass(item)\"\n [ngStyle]=\"getMenuItemIconStyles(item)\"\n ></i>\n <span [ngStyle]=\"getTextStyles(item)\">{{ item.text }}</span>\n </div>\n </pt-card>\n </div>\n</div>\n", styles: [".pt-menu-fancy{position:relative;display:inline-block}.pt-menu-fancy .menu-icon{font-style:normal;font-weight:400;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;padding:8px;transition:background-color .2s,box-shadow .2s}.pt-menu-fancy .menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.pt-menu-fancy .menu-dropdown{position:absolute;top:100%;background-color:#fff;box-shadow:0 8px 16px #0003;min-width:160px;z-index:1;border-radius:5px;overflow:hidden;opacity:0;transform:translateY(-20px);transition:transform .3s ease-out,opacity .3s ease-out}.pt-menu-fancy.open .menu-dropdown{display:block;opacity:1;transform:translateY(0)}.pt-menu-fancy.menu-left .menu-dropdown{right:0;left:auto}.pt-menu-fancy.menu-right .menu-dropdown{left:0;right:auto}.pt-menu-fancy .menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.pt-menu-fancy .menu-item i{margin-right:10px}.pt-menu-fancy .menu-item:hover{background-color:#f1f1f1}\n"] }]
|
2360
|
+
}], propDecorators: { config: [{
|
2361
|
+
type: Input
|
2362
|
+
}], onDocumentClick: [{
|
2363
|
+
type: HostListener,
|
2364
|
+
args: ['document:click', ['$event']]
|
2365
|
+
}] } });
|
2366
|
+
|
2367
|
+
class PTNavbarMenuComponent {
|
2368
|
+
constructor() {
|
2369
|
+
this.navBarMenuConfig = {};
|
2370
|
+
this.toggleSidebar = new EventEmitter();
|
2371
|
+
}
|
2372
|
+
// Default values as readonly variables
|
2373
|
+
static { this.DEFAULT_LOGO_URL = ''; }
|
2374
|
+
static { this.DEFAULT_LOGO_ALT_TEXT = 'Logo'; }
|
2375
|
+
static { this.DEFAULT_LOGO_WIDTH = '40px'; }
|
2376
|
+
static { this.DEFAULT_LOGO_HEIGHT = 'auto'; }
|
2377
|
+
static { this.DEFAULT_APP_NAME = 'Application'; }
|
2378
|
+
static { this.DEFAULT_APP_NAME_COLOR = '#000'; }
|
2379
|
+
static { this.DEFAULT_APP_NAME_FONT_SIZE = '24px'; }
|
2380
|
+
static { this.DEFAULT_TRANSPARENCY = '100'; }
|
2381
|
+
static { this.DEFAULT_ICON_COLOR = '#333'; }
|
2382
|
+
isImageStyle(object) {
|
2383
|
+
return typeof object === 'object' && 'imageUrl' in object;
|
2384
|
+
}
|
2385
|
+
isTextStyle(object) {
|
2386
|
+
return typeof object === 'object' && 'text' in object;
|
2387
|
+
}
|
2388
|
+
getLogoUrl() {
|
2389
|
+
return this.isImageStyle(this.navBarMenuConfig.logo)
|
2390
|
+
? this.navBarMenuConfig.logo.imageUrl
|
2391
|
+
: PTNavbarMenuComponent.DEFAULT_LOGO_URL;
|
2392
|
+
}
|
2393
|
+
getLogoAltText() {
|
2394
|
+
return this.isImageStyle(this.navBarMenuConfig.logo)
|
2395
|
+
? this.navBarMenuConfig.logo.altText ||
|
2396
|
+
PTNavbarMenuComponent.DEFAULT_LOGO_ALT_TEXT
|
2397
|
+
: PTNavbarMenuComponent.DEFAULT_LOGO_ALT_TEXT;
|
2398
|
+
}
|
2399
|
+
getLogoStyles() {
|
2400
|
+
if (this.isImageStyle(this.navBarMenuConfig.logo)) {
|
2401
|
+
return {
|
2402
|
+
color: this.navBarMenuConfig.logo.color ||
|
2403
|
+
PTNavbarMenuComponent.DEFAULT_ICON_COLOR,
|
2404
|
+
width: this.navBarMenuConfig.logo.width ||
|
2405
|
+
PTNavbarMenuComponent.DEFAULT_LOGO_WIDTH,
|
2406
|
+
height: this.navBarMenuConfig.logo.height ||
|
2407
|
+
PTNavbarMenuComponent.DEFAULT_LOGO_HEIGHT,
|
2408
|
+
};
|
2409
|
+
}
|
2410
|
+
return {};
|
2411
|
+
}
|
2412
|
+
getAppName() {
|
2413
|
+
return this.isTextStyle(this.navBarMenuConfig.appName)
|
2414
|
+
? this.navBarMenuConfig.appName.text
|
2415
|
+
: PTNavbarMenuComponent.DEFAULT_APP_NAME;
|
2416
|
+
}
|
2417
|
+
getAppNameStyles() {
|
2418
|
+
if (this.isTextStyle(this.navBarMenuConfig.appName)) {
|
2419
|
+
return {
|
2420
|
+
color: this.navBarMenuConfig.appName.color ||
|
2421
|
+
PTNavbarMenuComponent.DEFAULT_APP_NAME_COLOR,
|
2422
|
+
fontSize: this.navBarMenuConfig.appName.fontSize ||
|
2423
|
+
PTNavbarMenuComponent.DEFAULT_APP_NAME_FONT_SIZE,
|
2424
|
+
};
|
2425
|
+
}
|
2426
|
+
return {
|
2427
|
+
color: PTNavbarMenuComponent.DEFAULT_APP_NAME_COLOR,
|
2428
|
+
fontSize: PTNavbarMenuComponent.DEFAULT_APP_NAME_FONT_SIZE,
|
2429
|
+
};
|
2430
|
+
}
|
2431
|
+
getNavbarStyles() {
|
2432
|
+
const transparency = this.navBarMenuConfig.pattern?.transparencyPercentage ||
|
2433
|
+
PTNavbarMenuComponent.DEFAULT_TRANSPARENCY;
|
2434
|
+
const backgroundImage = this.navBarMenuConfig.pattern
|
2435
|
+
? `linear-gradient(rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100}), rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100})), url(${this.navBarMenuConfig.pattern.imageUrl})`
|
2436
|
+
: '';
|
2437
|
+
return {
|
2438
|
+
backgroundColor: this.navBarMenuConfig.pattern ? 'transparent' : '#fff',
|
2439
|
+
backgroundImage: backgroundImage,
|
2440
|
+
backgroundSize: 'cover',
|
2441
|
+
backgroundPosition: 'center',
|
2442
|
+
};
|
2443
|
+
}
|
2444
|
+
toggleMenu() {
|
2445
|
+
this.toggleSidebar.emit();
|
2446
|
+
}
|
2447
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2448
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTNavbarMenuComponent, selector: "pt-nav-bar-menu", inputs: { navBarMenuConfig: "navBarMenuConfig" }, outputs: { toggleSidebar: "toggleSidebar" }, ngImport: i0, template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n >\n <img\n [src]=\"getLogoUrl()\"\n [alt]=\"getLogoAltText()\"\n [ngStyle]=\"getLogoStyles()\"\n class=\"navbar-logo\"\n />\n <span class=\"navbar-title\" [ngStyle]=\"getAppNameStyles()\">\n {{ getAppName() }}\n </span>\n </a>\n <a (click)=\"toggleMenu()\" class=\"toggle-btn\">\n <i class=\"pi pi-bars\"></i>\n </a>\n </div>\n <div class=\"navbar-right\">\n <pt-menu-fancy\n *ngFor=\"let menuConfig of navBarMenuConfig.menus\"\n [config]=\"menuConfig\"\n ></pt-menu-fancy>\n </div>\n</div>\n", styles: [".pt-nav-bar-menu{display:flex;justify-content:space-between;align-items:center;padding:10px;border-bottom:1px solid #ddd;background-color:#fff;background-size:cover;background-position:center}.pt-nav-bar-menu .navbar-left{display:flex;align-items:center}.pt-nav-bar-menu .logo-link{display:flex;align-items:center;text-decoration:none;color:inherit}.pt-nav-bar-menu .navbar-logo{margin-left:10px;margin-right:20px}.pt-nav-bar-menu .navbar-right{display:flex;align-items:center}.pt-nav-bar-menu .navbar-right a{margin-left:20px;color:#333;text-decoration:none;font-size:20px;cursor:pointer}.pt-nav-bar-menu .navbar-right a:hover{color:#000;cursor:pointer}.pt-nav-bar-menu .toggle-btn>.pi.pi-bars{font-size:1.5rem;color:#333}.pt-nav-bar-menu .toggle-btn:hover{background-color:#f1f1f1}.pt-nav-bar-menu .toggle-btn{margin-left:2rem;cursor:pointer;padding:7px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: PTMenuFancyComponent, selector: "pt-menu-fancy", inputs: ["config"] }] }); }
|
2449
|
+
}
|
2450
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuComponent, decorators: [{
|
2451
|
+
type: Component,
|
2452
|
+
args: [{ selector: 'pt-nav-bar-menu', template: "<div class=\"pt-nav-bar-menu\" [ngStyle]=\"getNavbarStyles()\">\n <div class=\"navbar-left\">\n <a\n [routerLink]=\"\n isImageStyle(navBarMenuConfig.logo)\n ? navBarMenuConfig.logo.routerLink\n : '/'\n \"\n class=\"logo-link\"\n >\n <img\n [src]=\"getLogoUrl()\"\n [alt]=\"getLogoAltText()\"\n [ngStyle]=\"getLogoStyles()\"\n class=\"navbar-logo\"\n />\n <span class=\"navbar-title\" [ngStyle]=\"getAppNameStyles()\">\n {{ getAppName() }}\n </span>\n </a>\n <a (click)=\"toggleMenu()\" class=\"toggle-btn\">\n <i class=\"pi pi-bars\"></i>\n </a>\n </div>\n <div class=\"navbar-right\">\n <pt-menu-fancy\n *ngFor=\"let menuConfig of navBarMenuConfig.menus\"\n [config]=\"menuConfig\"\n ></pt-menu-fancy>\n </div>\n</div>\n", styles: [".pt-nav-bar-menu{display:flex;justify-content:space-between;align-items:center;padding:10px;border-bottom:1px solid #ddd;background-color:#fff;background-size:cover;background-position:center}.pt-nav-bar-menu .navbar-left{display:flex;align-items:center}.pt-nav-bar-menu .logo-link{display:flex;align-items:center;text-decoration:none;color:inherit}.pt-nav-bar-menu .navbar-logo{margin-left:10px;margin-right:20px}.pt-nav-bar-menu .navbar-right{display:flex;align-items:center}.pt-nav-bar-menu .navbar-right a{margin-left:20px;color:#333;text-decoration:none;font-size:20px;cursor:pointer}.pt-nav-bar-menu .navbar-right a:hover{color:#000;cursor:pointer}.pt-nav-bar-menu .toggle-btn>.pi.pi-bars{font-size:1.5rem;color:#333}.pt-nav-bar-menu .toggle-btn:hover{background-color:#f1f1f1}.pt-nav-bar-menu .toggle-btn{margin-left:2rem;cursor:pointer;padding:7px}\n"] }]
|
2453
|
+
}], propDecorators: { navBarMenuConfig: [{
|
2454
|
+
type: Input
|
2455
|
+
}], toggleSidebar: [{
|
2456
|
+
type: Output
|
2457
|
+
}] } });
|
2458
|
+
|
2459
|
+
class PTMenuFancyModule {
|
2460
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2461
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyModule, declarations: [PTMenuFancyComponent], imports: [CommonModule, PTCardModule], exports: [PTMenuFancyComponent] }); }
|
2462
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyModule, imports: [CommonModule, PTCardModule] }); }
|
2463
|
+
}
|
2464
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuFancyModule, decorators: [{
|
2465
|
+
type: NgModule,
|
2466
|
+
args: [{
|
2467
|
+
declarations: [PTMenuFancyComponent],
|
2468
|
+
imports: [CommonModule, PTCardModule],
|
2469
|
+
exports: [PTMenuFancyComponent],
|
2470
|
+
}]
|
2471
|
+
}] });
|
2472
|
+
|
2473
|
+
class PTNavbarMenuModule {
|
2474
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2475
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuModule, declarations: [PTNavbarMenuComponent], imports: [CommonModule, RouterModule, PTMenuFancyModule], exports: [PTNavbarMenuComponent] }); }
|
2476
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuModule, imports: [CommonModule, RouterModule, PTMenuFancyModule] }); }
|
2477
|
+
}
|
2478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTNavbarMenuModule, decorators: [{
|
2479
|
+
type: NgModule,
|
2480
|
+
args: [{
|
2481
|
+
declarations: [PTNavbarMenuComponent],
|
2482
|
+
imports: [CommonModule, RouterModule, PTMenuFancyModule],
|
2483
|
+
exports: [PTNavbarMenuComponent],
|
2484
|
+
}]
|
2485
|
+
}] });
|
2486
|
+
|
2487
|
+
class PTSideBarMenuComponent {
|
2488
|
+
constructor(renderer, el) {
|
2489
|
+
this.renderer = renderer;
|
2490
|
+
this.el = el;
|
2491
|
+
this.menuConfig = {
|
2492
|
+
menus: [],
|
2493
|
+
isVisible: true,
|
2494
|
+
searchable: true,
|
2495
|
+
width: '250px',
|
2496
|
+
height: '100vh',
|
2497
|
+
scrollable: true,
|
2498
|
+
backgroundColor: 'white',
|
2499
|
+
fontColor: '#333', // Default main font color
|
2500
|
+
fontColorSubMenu: '#666', // Default submenu font color
|
2501
|
+
hoverColor: '#f1f1f1', // Default hover color for main menu
|
2502
|
+
hoverColorSubMenu: '#e0e0e0', // Default hover color for submenu
|
2503
|
+
};
|
2504
|
+
this.searchCardConfig = {
|
2505
|
+
backgroundColor: 'white',
|
2506
|
+
height: '72px',
|
2507
|
+
};
|
2508
|
+
this.cardConfig = {
|
2509
|
+
backgroundColor: '',
|
2510
|
+
width: '',
|
2511
|
+
height: '',
|
2512
|
+
scrollableVertical: false,
|
2513
|
+
};
|
2514
|
+
this.formGroup = new FormGroup({
|
2515
|
+
search: new FormControl(''),
|
2516
|
+
});
|
2517
|
+
this.searchField = {
|
2518
|
+
name: 'search',
|
2519
|
+
placeholder: 'Search...',
|
2520
|
+
iconClass: 'pi pi-search',
|
2521
|
+
};
|
2522
|
+
this.filteredMenus = [];
|
2523
|
+
}
|
2524
|
+
ngOnInit() {
|
2525
|
+
this.cardConfig = {
|
2526
|
+
backgroundColor: this.menuConfig.backgroundColor,
|
2527
|
+
width: this.menuConfig.width,
|
2528
|
+
height: this.menuConfig.height,
|
2529
|
+
scrollableVertical: this.menuConfig.scrollable,
|
2530
|
+
pattern: this.menuConfig.pattern,
|
2531
|
+
};
|
2532
|
+
this.filteredMenus = this.menuConfig.menus;
|
2533
|
+
const cardWidth = this.menuConfig.width
|
2534
|
+
? parseInt(this.menuConfig.width)
|
2535
|
+
: 250;
|
2536
|
+
this.searchField.width = `${cardWidth - 60}px`;
|
2537
|
+
this.searchCardConfig.width = this.menuConfig.width;
|
2538
|
+
this.searchCardConfig.pattern = this.menuConfig.pattern;
|
2539
|
+
if (this.menuConfig.searchable) {
|
2540
|
+
this.formGroup
|
2541
|
+
.get('search')
|
2542
|
+
?.valueChanges.subscribe((searchTerm) => {
|
2543
|
+
this.onSearch(searchTerm);
|
2544
|
+
});
|
2545
|
+
}
|
2546
|
+
}
|
2547
|
+
toggleMenu(item, event) {
|
2548
|
+
item.isExpanded = !item.isExpanded;
|
2549
|
+
event.preventDefault();
|
2550
|
+
}
|
2551
|
+
getChevronClass(item) {
|
2552
|
+
return item.isExpanded ? 'fa fa-chevron-down' : 'fa fa-chevron-right';
|
2553
|
+
}
|
2554
|
+
getBadgeStyles(badge) {
|
2555
|
+
const defaultColors = this.getDefaultBadgeColors(badge.type || BadgeType.Info);
|
2556
|
+
return {
|
2557
|
+
color: badge.color || defaultColors.color,
|
2558
|
+
backgroundColor: badge.backgroundColor || defaultColors.backgroundColor,
|
2559
|
+
padding: '2px 8px',
|
2560
|
+
borderRadius: '5px',
|
2561
|
+
fontSize: '12px',
|
2562
|
+
};
|
2563
|
+
}
|
2564
|
+
getDefaultBadgeColors(type) {
|
2565
|
+
switch (type) {
|
2566
|
+
case BadgeType.Info:
|
2567
|
+
return { color: 'white', backgroundColor: '#17a2b8' };
|
2568
|
+
case BadgeType.Danger:
|
2569
|
+
return { color: 'white', backgroundColor: '#dc3545' };
|
2570
|
+
case BadgeType.Warning:
|
2571
|
+
return { color: 'white', backgroundColor: '#ffc107' };
|
2572
|
+
default:
|
2573
|
+
return { color: 'white', backgroundColor: '#6c757d' };
|
2574
|
+
}
|
2575
|
+
}
|
2576
|
+
onSearch(searchTerm) {
|
2577
|
+
if (searchTerm.trim() === '') {
|
2578
|
+
this.filteredMenus = this.menuConfig.menus;
|
2579
|
+
this.collapseAllMenus();
|
2580
|
+
}
|
2581
|
+
else {
|
2582
|
+
const lowerCaseSearch = searchTerm.toLowerCase();
|
2583
|
+
this.filteredMenus = this.menuConfig.menus
|
2584
|
+
.map((menu) => this.searchInMenu({ ...menu }, lowerCaseSearch))
|
2585
|
+
.filter(Boolean);
|
2586
|
+
}
|
2587
|
+
}
|
2588
|
+
searchInMenu(menu, searchTerm) {
|
2589
|
+
const isMatch = menu.label.toLowerCase().includes(searchTerm);
|
2590
|
+
if (menu.children) {
|
2591
|
+
const matchingChildren = menu.children
|
2592
|
+
.map((child) => this.searchInMenu(child, searchTerm))
|
2593
|
+
.filter(Boolean);
|
2594
|
+
if (matchingChildren.length > 0) {
|
2595
|
+
menu.children = matchingChildren;
|
2596
|
+
menu.isExpanded = true;
|
2597
|
+
return menu;
|
2598
|
+
}
|
2599
|
+
}
|
2600
|
+
return isMatch ? menu : null;
|
2601
|
+
}
|
2602
|
+
collapseAllMenus() {
|
2603
|
+
this.menuConfig.menus.forEach((menu) => {
|
2604
|
+
menu.isExpanded = false;
|
2605
|
+
});
|
2606
|
+
}
|
2607
|
+
getMenuItemStyles() {
|
2608
|
+
return {
|
2609
|
+
color: this.menuConfig.fontColor || '#333', // Set default font color if not specified in config
|
2610
|
+
};
|
2611
|
+
}
|
2612
|
+
getMenuLinkStyles() {
|
2613
|
+
return {
|
2614
|
+
color: this.menuConfig.fontColor || '#333',
|
2615
|
+
'text-decoration': 'none',
|
2616
|
+
'border-radius': '8px',
|
2617
|
+
padding: '10px 15px',
|
2618
|
+
'font-size': '16px',
|
2619
|
+
transition: 'background-color 0.2s, color 0.2s',
|
2620
|
+
display: 'flex',
|
2621
|
+
'align-items': 'center',
|
2622
|
+
':hover': {
|
2623
|
+
backgroundColor: this.menuConfig.hoverColor || '#f1f1f1',
|
2624
|
+
color: '#111',
|
2625
|
+
},
|
2626
|
+
};
|
2627
|
+
}
|
2628
|
+
getSubMenuLinkStyles() {
|
2629
|
+
return {
|
2630
|
+
color: this.menuConfig.fontColorSubMenu || this.menuConfig.fontColor || '#666',
|
2631
|
+
'text-decoration': 'none',
|
2632
|
+
'border-radius': '5px',
|
2633
|
+
padding: '5px 10px',
|
2634
|
+
transition: 'background-color 0.2s, color 0.2s',
|
2635
|
+
':hover': {
|
2636
|
+
backgroundColor: this.menuConfig.hoverColorSubMenu || '#e0e0e0',
|
2637
|
+
},
|
2638
|
+
};
|
2639
|
+
}
|
2640
|
+
ngAfterViewInit() {
|
2641
|
+
this.applyHoverEffects();
|
2642
|
+
}
|
2643
|
+
applyHoverEffects() {
|
2644
|
+
const menuLinks = this.el.nativeElement.querySelectorAll('a.menu-link');
|
2645
|
+
const subMenuLinks = this.el.nativeElement.querySelectorAll('a.submenu-link');
|
2646
|
+
// Apply hover effects for main menu links
|
2647
|
+
menuLinks.forEach((link) => {
|
2648
|
+
this.renderer.listen(link, 'mouseenter', () => {
|
2649
|
+
this.renderer.setStyle(link, 'background-color', this.menuConfig.hoverColor || '#f1f1f1');
|
2650
|
+
this.renderer.setStyle(link, 'color', this.menuConfig.hoverFontColor || 'white');
|
2651
|
+
});
|
2652
|
+
this.renderer.listen(link, 'mouseleave', () => {
|
2653
|
+
this.renderer.removeStyle(link, 'background-color');
|
2654
|
+
this.renderer.setStyle(link, 'color', this.menuConfig.fontColor || '#333');
|
2655
|
+
});
|
2656
|
+
});
|
2657
|
+
// Apply hover effects for submenu links
|
2658
|
+
subMenuLinks.forEach((link) => {
|
2659
|
+
this.renderer.listen(link, 'mouseenter', () => {
|
2660
|
+
this.renderer.setStyle(link, 'background-color', this.menuConfig.hoverColorSubMenu ||
|
2661
|
+
this.menuConfig.hoverColor ||
|
2662
|
+
'#f1f1f1');
|
2663
|
+
this.renderer.setStyle(link, 'color', this.menuConfig.hoverFontColorSubMenu ||
|
2664
|
+
this.menuConfig.hoverFontColor ||
|
2665
|
+
'#fff');
|
2666
|
+
});
|
2667
|
+
this.renderer.listen(link, 'mouseleave', () => {
|
2668
|
+
this.renderer.removeStyle(link, 'background-color');
|
2669
|
+
this.renderer.setStyle(link, 'color', this.menuConfig.fontColorSubMenu ||
|
2670
|
+
this.menuConfig.fontColor ||
|
2671
|
+
'#666');
|
2672
|
+
});
|
2673
|
+
});
|
2674
|
+
}
|
2675
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
2676
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTSideBarMenuComponent, selector: "pt-side-bar-menu", inputs: { menuConfig: "menuConfig" }, ngImport: i0, template: "<div class=\"pt-side-bar-menu\">\n <pt-card\n *ngIf=\"menuConfig.searchable\"\n [config]=\"searchCardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': !menuConfig.isVisible }\"\n >\n <div class=\"search-input\">\n <pt-text-input [formGroup]=\"formGroup\" [formField]=\"searchField\">\n </pt-text-input>\n </div>\n </pt-card>\n\n <pt-card\n [config]=\"cardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': !menuConfig.isVisible }\"\n >\n <ul class=\"menu-list\">\n <li\n *ngFor=\"let item of filteredMenus\"\n class=\"menu-item\"\n [ngClass]=\"{ 'menu-item-expanded': item.isExpanded }\"\n [ngStyle]=\"getMenuItemStyles()\"\n >\n <!-- Main menu items without children -->\n <a\n *ngIf=\"!item.children?.length\"\n [routerLink]=\"item.url\"\n class=\"menu-link\"\n [ngStyle]=\"getMenuLinkStyles()\"\n >\n <i [ngClass]=\"item.icon\"></i>\n <span>{{ item.label }}</span>\n <span\n *ngIf=\"item.badge\"\n [ngStyle]=\"getBadgeStyles(item.badge)\"\n class=\"badge\"\n >\n {{ item.badge.count }}\n </span>\n </a>\n\n <!-- Menu items with children -->\n <a\n *ngIf=\"item.children?.length\"\n class=\"menu-link\"\n (click)=\"toggleMenu(item, $event)\"\n [ngStyle]=\"getMenuLinkStyles()\"\n >\n <i [ngClass]=\"item.icon\"></i>\n <span>{{ item.label }}</span>\n <span\n *ngIf=\"item.badge\"\n [ngStyle]=\"getBadgeStyles(item.badge)\"\n class=\"badge\"\n >\n {{ item.badge.count }}\n </span>\n <i [ngClass]=\"getChevronClass(item)\" class=\"chevron\"></i>\n </a>\n\n <!-- Submenu -->\n <ul class=\"submenu-list\">\n <li *ngFor=\"let child of item.children\" class=\"submenu-item\">\n <a\n [routerLink]=\"child.url\"\n class=\"submenu-link\"\n [ngStyle]=\"getSubMenuLinkStyles()\"\n >\n <i [ngClass]=\"child.icon\"></i>\n <span class=\"submenu-title\">{{ child.label }}</span>\n <span\n *ngIf=\"child.badge\"\n [ngStyle]=\"getBadgeStyles(child.badge)\"\n class=\"badge\"\n >\n {{ child.badge.count }}\n </span>\n </a>\n </li>\n </ul>\n </li>\n </ul>\n </pt-card>\n</div>\n", styles: [".pt-side-bar-menu .badge{background-color:#38bdf8;border-radius:5px;color:#fff;font-size:12px;margin-left:auto;padding:2px 8px}.pt-side-bar-menu .chevron{color:#8c8c8c;cursor:pointer;margin-left:auto}.pt-side-bar-menu .menu-item{position:relative}.pt-side-bar-menu .menu-item-expanded .submenu-list{max-height:500px;padding-bottom:5px;padding-top:5px}.pt-side-bar-menu .menu-link{align-items:center;border-radius:8px;color:#333;cursor:pointer;display:flex;font-size:16px;margin-bottom:15px;padding:10px 15px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .menu-link:hover{background-color:#f1f1f1;color:#111}.pt-side-bar-menu .menu-link i{margin-right:10px}.pt-side-bar-menu .menu-list{list-style-type:none;padding:0}.pt-side-bar-menu pt-card{transition:transform .3s ease-in-out,opacity .3s ease-in-out;display:block}.pt-side-bar-menu .search-input{margin-left:10px}.pt-side-bar-menu .sidebar-hidden{transform:translate(-100%);opacity:0}.pt-side-bar-menu .sidebar-menu{margin:0;padding:0;transition:transform .3s ease-in-out;width:250px}.pt-side-bar-menu .submenu-item{padding:5px 0;position:relative}.pt-side-bar-menu .submenu-item:before{background-color:#e5e7eb;content:\"\";height:1px;left:-25px;position:absolute;top:50%;transform:translateY(-50%);width:25px}.pt-side-bar-menu .submenu-item:last-child:after{content:none}.pt-side-bar-menu .submenu-link{align-items:center;border-radius:5px;color:#666;display:flex;font-size:14px;padding:5px 10px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .submenu-link:hover{background-color:#f1f1f1;color:#000}.pt-side-bar-menu .submenu-list{border-left:1px solid #e5e7eb;list-style-type:none;margin-left:23px;margin-top:5px;max-height:0;overflow:hidden;padding-left:25px;position:relative;transition:max-height .3s ease-out,padding .3s ease-out}.pt-side-bar-menu .submenu-list:after{background-color:#e5e7eb;bottom:0;content:\"\";left:-1px;position:absolute;top:0;width:1px}.pt-side-bar-menu .submenu-title{margin-left:5px}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }] }); }
|
2677
|
+
}
|
2678
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuComponent, decorators: [{
|
2679
|
+
type: Component,
|
2680
|
+
args: [{ selector: 'pt-side-bar-menu', template: "<div class=\"pt-side-bar-menu\">\n <pt-card\n *ngIf=\"menuConfig.searchable\"\n [config]=\"searchCardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': !menuConfig.isVisible }\"\n >\n <div class=\"search-input\">\n <pt-text-input [formGroup]=\"formGroup\" [formField]=\"searchField\">\n </pt-text-input>\n </div>\n </pt-card>\n\n <pt-card\n [config]=\"cardConfig\"\n [ngClass]=\"{ 'sidebar-hidden': !menuConfig.isVisible }\"\n >\n <ul class=\"menu-list\">\n <li\n *ngFor=\"let item of filteredMenus\"\n class=\"menu-item\"\n [ngClass]=\"{ 'menu-item-expanded': item.isExpanded }\"\n [ngStyle]=\"getMenuItemStyles()\"\n >\n <!-- Main menu items without children -->\n <a\n *ngIf=\"!item.children?.length\"\n [routerLink]=\"item.url\"\n class=\"menu-link\"\n [ngStyle]=\"getMenuLinkStyles()\"\n >\n <i [ngClass]=\"item.icon\"></i>\n <span>{{ item.label }}</span>\n <span\n *ngIf=\"item.badge\"\n [ngStyle]=\"getBadgeStyles(item.badge)\"\n class=\"badge\"\n >\n {{ item.badge.count }}\n </span>\n </a>\n\n <!-- Menu items with children -->\n <a\n *ngIf=\"item.children?.length\"\n class=\"menu-link\"\n (click)=\"toggleMenu(item, $event)\"\n [ngStyle]=\"getMenuLinkStyles()\"\n >\n <i [ngClass]=\"item.icon\"></i>\n <span>{{ item.label }}</span>\n <span\n *ngIf=\"item.badge\"\n [ngStyle]=\"getBadgeStyles(item.badge)\"\n class=\"badge\"\n >\n {{ item.badge.count }}\n </span>\n <i [ngClass]=\"getChevronClass(item)\" class=\"chevron\"></i>\n </a>\n\n <!-- Submenu -->\n <ul class=\"submenu-list\">\n <li *ngFor=\"let child of item.children\" class=\"submenu-item\">\n <a\n [routerLink]=\"child.url\"\n class=\"submenu-link\"\n [ngStyle]=\"getSubMenuLinkStyles()\"\n >\n <i [ngClass]=\"child.icon\"></i>\n <span class=\"submenu-title\">{{ child.label }}</span>\n <span\n *ngIf=\"child.badge\"\n [ngStyle]=\"getBadgeStyles(child.badge)\"\n class=\"badge\"\n >\n {{ child.badge.count }}\n </span>\n </a>\n </li>\n </ul>\n </li>\n </ul>\n </pt-card>\n</div>\n", styles: [".pt-side-bar-menu .badge{background-color:#38bdf8;border-radius:5px;color:#fff;font-size:12px;margin-left:auto;padding:2px 8px}.pt-side-bar-menu .chevron{color:#8c8c8c;cursor:pointer;margin-left:auto}.pt-side-bar-menu .menu-item{position:relative}.pt-side-bar-menu .menu-item-expanded .submenu-list{max-height:500px;padding-bottom:5px;padding-top:5px}.pt-side-bar-menu .menu-link{align-items:center;border-radius:8px;color:#333;cursor:pointer;display:flex;font-size:16px;margin-bottom:15px;padding:10px 15px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .menu-link:hover{background-color:#f1f1f1;color:#111}.pt-side-bar-menu .menu-link i{margin-right:10px}.pt-side-bar-menu .menu-list{list-style-type:none;padding:0}.pt-side-bar-menu pt-card{transition:transform .3s ease-in-out,opacity .3s ease-in-out;display:block}.pt-side-bar-menu .search-input{margin-left:10px}.pt-side-bar-menu .sidebar-hidden{transform:translate(-100%);opacity:0}.pt-side-bar-menu .sidebar-menu{margin:0;padding:0;transition:transform .3s ease-in-out;width:250px}.pt-side-bar-menu .submenu-item{padding:5px 0;position:relative}.pt-side-bar-menu .submenu-item:before{background-color:#e5e7eb;content:\"\";height:1px;left:-25px;position:absolute;top:50%;transform:translateY(-50%);width:25px}.pt-side-bar-menu .submenu-item:last-child:after{content:none}.pt-side-bar-menu .submenu-link{align-items:center;border-radius:5px;color:#666;display:flex;font-size:14px;padding:5px 10px;text-decoration:none;transition:background-color .2s,color .2s}.pt-side-bar-menu .submenu-link:hover{background-color:#f1f1f1;color:#000}.pt-side-bar-menu .submenu-list{border-left:1px solid #e5e7eb;list-style-type:none;margin-left:23px;margin-top:5px;max-height:0;overflow:hidden;padding-left:25px;position:relative;transition:max-height .3s ease-out,padding .3s ease-out}.pt-side-bar-menu .submenu-list:after{background-color:#e5e7eb;bottom:0;content:\"\";left:-1px;position:absolute;top:0;width:1px}.pt-side-bar-menu .submenu-title{margin-left:5px}\n"] }]
|
2681
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { menuConfig: [{
|
2682
|
+
type: Input
|
2683
|
+
}] } });
|
2684
|
+
|
2685
|
+
class PTSideBarMenuModule {
|
2686
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2687
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuModule, declarations: [PTSideBarMenuComponent], imports: [CommonModule, RouterModule, PTCardModule, PTTextInputModule], exports: [PTSideBarMenuComponent] }); }
|
2688
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuModule, imports: [CommonModule, RouterModule, PTCardModule, PTTextInputModule] }); }
|
2689
|
+
}
|
2690
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTSideBarMenuModule, decorators: [{
|
2691
|
+
type: NgModule,
|
2692
|
+
args: [{
|
2693
|
+
declarations: [PTSideBarMenuComponent],
|
2694
|
+
imports: [CommonModule, RouterModule, PTCardModule, PTTextInputModule],
|
2695
|
+
exports: [PTSideBarMenuComponent],
|
2696
|
+
}]
|
2697
|
+
}] });
|
2698
|
+
|
2699
|
+
class PTFooterComponent {
|
2700
|
+
constructor() {
|
2701
|
+
this.footerConfig = {
|
2702
|
+
appName: 'Default App',
|
2703
|
+
version: '1.0.0',
|
2704
|
+
productionYear: new Date().getFullYear(),
|
2705
|
+
};
|
2706
|
+
}
|
2707
|
+
getCurrentYear() {
|
2708
|
+
return new Date().getFullYear();
|
2709
|
+
}
|
2710
|
+
getCardConfig() {
|
2711
|
+
return (this.footerConfig.cardConfig ?? {
|
2712
|
+
backgroundColor: '#f8f8f8',
|
2713
|
+
width: '100%',
|
2714
|
+
height: 'auto',
|
2715
|
+
scrollableVertical: false,
|
2716
|
+
padding: '0',
|
2717
|
+
margin: '0',
|
2718
|
+
});
|
2719
|
+
}
|
2720
|
+
displayYears() {
|
2721
|
+
const currentYear = this.getCurrentYear();
|
2722
|
+
const productionYear = this.footerConfig.productionYear;
|
2723
|
+
return productionYear === currentYear
|
2724
|
+
? `${currentYear}`
|
2725
|
+
: `${productionYear} - ${currentYear}`;
|
2726
|
+
}
|
2727
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFooterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2728
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTFooterComponent, selector: "pt-footer", inputs: { footerConfig: "footerConfig" }, ngImport: i0, template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:5px;font-size:14px;line-height:1.8;margin-top:0}.footer-card{width:100%;background-color:transparent;margin-top:0}\n"], dependencies: [{ kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }] }); }
|
2729
|
+
}
|
2730
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFooterComponent, decorators: [{
|
2731
|
+
type: Component,
|
2732
|
+
args: [{ selector: 'pt-footer', template: "<pt-card [config]=\"getCardConfig()\" class=\"footer-card\">\n <footer class=\"footer\">\n <p>\n {{ footerConfig.appName }} V {{ footerConfig.version }}\n <br />\n © {{ displayYears() }} All rights reserved.\n </p>\n </footer>\n</pt-card>\n", styles: [".footer{text-align:center;padding:5px;font-size:14px;line-height:1.8;margin-top:0}.footer-card{width:100%;background-color:transparent;margin-top:0}\n"] }]
|
2733
|
+
}], propDecorators: { footerConfig: [{
|
2734
|
+
type: Input
|
2735
|
+
}] } });
|
2736
|
+
|
2737
|
+
class PTBreadCrumbService {
|
2738
|
+
constructor(router) {
|
2739
|
+
this.router = router;
|
2740
|
+
this._breadcrumb = new BehaviorSubject([]);
|
2741
|
+
this.breadcrumb$ = this._breadcrumb.asObservable();
|
2742
|
+
this.menuData = [];
|
2743
|
+
this.router.events
|
2744
|
+
.pipe(filter((event) => event instanceof NavigationEnd))
|
2745
|
+
.subscribe((event) => {
|
2746
|
+
let urlParts = event.urlAfterRedirects.split('/');
|
2747
|
+
urlParts.splice(0, 1);
|
2748
|
+
let urlWithoutContext = urlParts.join('/');
|
2749
|
+
let newBreadcrumb = this.createBreadcrumb(urlWithoutContext);
|
2750
|
+
this._breadcrumb.next(newBreadcrumb);
|
2751
|
+
});
|
2752
|
+
}
|
2753
|
+
// Method to set menuData
|
2754
|
+
setMenuData(menuData) {
|
2755
|
+
this.menuData = menuData;
|
2756
|
+
}
|
2757
|
+
createBreadcrumb(url = '', breadcrumbs = []) {
|
2758
|
+
if (!url) {
|
2759
|
+
return breadcrumbs;
|
2760
|
+
}
|
2761
|
+
const pathSegments = url.split('/').filter((segment) => segment);
|
2762
|
+
return this.buildParentBreadcrumbs(this.menuData, pathSegments, breadcrumbs);
|
2763
|
+
}
|
2764
|
+
buildParentBreadcrumbs(menuData, pathSegments, breadcrumbs) {
|
2765
|
+
if (pathSegments.length === 0) {
|
2766
|
+
return breadcrumbs;
|
2767
|
+
}
|
2768
|
+
const currentSegment = pathSegments.shift();
|
2769
|
+
const currentMenu = menuData.find((menu) => menu.url === currentSegment || menu.url.endsWith(currentSegment));
|
2770
|
+
if (currentMenu) {
|
2771
|
+
breadcrumbs.push({ label: currentMenu.label, url: currentMenu.url });
|
2772
|
+
if (currentMenu.children &&
|
2773
|
+
currentMenu.children.length > 0 &&
|
2774
|
+
pathSegments.length > 0) {
|
2775
|
+
return this.buildChildBreadcrumbs(currentMenu.children, pathSegments, breadcrumbs, currentSegment || '');
|
2776
|
+
}
|
2777
|
+
}
|
2778
|
+
return breadcrumbs;
|
2779
|
+
}
|
2780
|
+
buildChildBreadcrumbs(menuData, pathSegments, breadcrumbs, currentUrl) {
|
2781
|
+
if (pathSegments.length === 0) {
|
2782
|
+
return breadcrumbs;
|
2783
|
+
}
|
2784
|
+
const currentSegment = pathSegments.shift();
|
2785
|
+
currentUrl = `/${currentUrl}/${currentSegment}`;
|
2786
|
+
const currentMenu = menuData.find((menu) => menu.url === currentUrl);
|
2787
|
+
if (currentMenu) {
|
2788
|
+
breadcrumbs.push({ label: currentMenu.label, url: currentMenu.url });
|
2789
|
+
if (currentMenu.children &&
|
2790
|
+
currentMenu.children.length > 0 &&
|
2791
|
+
pathSegments.length > 0) {
|
2792
|
+
return this.buildChildBreadcrumbs(currentMenu.children, pathSegments, breadcrumbs, currentUrl);
|
2793
|
+
}
|
2794
|
+
}
|
2795
|
+
else {
|
2796
|
+
const parentMenu = menuData.find((menu) => menu.children &&
|
2797
|
+
menu.children.some((child) => child.url === currentUrl));
|
2798
|
+
if (parentMenu && parentMenu.children) {
|
2799
|
+
const childMenu = parentMenu.children.find((child) => child.url === currentUrl);
|
2800
|
+
if (childMenu) {
|
2801
|
+
breadcrumbs.push({ label: parentMenu.label, url: parentMenu.url });
|
2802
|
+
breadcrumbs.push({ label: childMenu.label, url: childMenu.url });
|
2803
|
+
if (childMenu.children &&
|
2804
|
+
childMenu.children.length > 0 &&
|
2805
|
+
pathSegments.length > 0) {
|
2806
|
+
return this.buildChildBreadcrumbs(childMenu.children, pathSegments, breadcrumbs, currentUrl);
|
2807
|
+
}
|
2808
|
+
}
|
2809
|
+
}
|
2810
|
+
}
|
2811
|
+
return breadcrumbs;
|
2812
|
+
}
|
2813
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbService, deps: [{ token: i2$2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
2814
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbService, providedIn: 'root' }); }
|
2815
|
+
}
|
2816
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbService, decorators: [{
|
2817
|
+
type: Injectable,
|
2818
|
+
args: [{
|
2819
|
+
providedIn: 'root',
|
2820
|
+
}]
|
2821
|
+
}], ctorParameters: () => [{ type: i2$2.Router }] });
|
2822
|
+
|
2823
|
+
class PTBreadCrumbComponent {
|
2824
|
+
constructor(breadcrumbService, renderer, el) {
|
2825
|
+
this.breadcrumbService = breadcrumbService;
|
2826
|
+
this.renderer = renderer;
|
2827
|
+
this.el = el;
|
2828
|
+
}
|
2829
|
+
ngOnInit() {
|
2830
|
+
this.home = { icon: 'pi pi-home', routerLink: 'dashboard' };
|
2831
|
+
// Pass the input menuData to the service
|
2832
|
+
this.breadcrumbService.setMenuData(this.breadCrumbConfig.menuData);
|
2833
|
+
this.breadCrumbSubscription = this.breadcrumbService.breadcrumb$.subscribe((breadcrumb) => {
|
2834
|
+
this.items = breadcrumb;
|
2835
|
+
});
|
2836
|
+
}
|
2837
|
+
ngAfterViewInit() {
|
2838
|
+
this.applyBackgroundStyles();
|
2839
|
+
}
|
2840
|
+
ngOnDestroy() {
|
2841
|
+
if (this.breadCrumbSubscription) {
|
2842
|
+
this.breadCrumbSubscription.unsubscribe();
|
2843
|
+
}
|
2844
|
+
}
|
2845
|
+
applyBackgroundStyles() {
|
2846
|
+
const transparency = this.breadCrumbConfig.pattern?.transparencyPercentage || '100';
|
2847
|
+
const backgroundImage = this.breadCrumbConfig.pattern?.imageUrl
|
2848
|
+
? `linear-gradient(rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100}), rgba(255, 255, 255, ${1 - parseFloat(transparency) / 100})), url('${this.breadCrumbConfig.pattern.imageUrl}')`
|
2849
|
+
: '';
|
2850
|
+
// Delay to ensure that the element is fully rendered before applying styles
|
2851
|
+
setTimeout(() => {
|
2852
|
+
const breadcrumbNav = this.el.nativeElement.querySelector('nav.p-breadcrumb.p-component');
|
2853
|
+
if (breadcrumbNav) {
|
2854
|
+
this.renderer.setStyle(breadcrumbNav, 'background-image', backgroundImage);
|
2855
|
+
}
|
2856
|
+
});
|
2857
|
+
}
|
2858
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbComponent, deps: [{ token: PTBreadCrumbService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
2859
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTBreadCrumbComponent, selector: "pt-bread-crumb", inputs: { breadCrumbConfig: "breadCrumbConfig" }, ngImport: i0, template: "<div\n *ngIf=\"items && items.length > 0\"\n class=\"pt-bread-crumb breadcrumb-container\"\n>\n <p-breadcrumb class=\"max-w-full\" [model]=\"items\" [home]=\"home\"></p-breadcrumb>\n</div>\n", styles: [".pt-bread-crumb ::ng-deep chevronrighticon.p-element.p-icon-wrapper.ng-star-inserted{margin-top:4px}.pt-bread-crumb ::ng-deep .p-breadcrumb{margin-bottom:20px}.pt-bread-crumb .breadcrumb-container{padding:10px;border-radius:5px;margin-bottom:20px}.pt-bread-crumb ::ng-deep .breadcrumb-background{background-size:cover;background-position:center;background-repeat:no-repeat}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3$6.Breadcrumb, selector: "p-breadcrumb", inputs: ["model", "style", "styleClass", "home", "homeAriaLabel"], outputs: ["onItemClick"] }] }); }
|
2860
|
+
}
|
2861
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbComponent, decorators: [{
|
2862
|
+
type: Component,
|
2863
|
+
args: [{ selector: 'pt-bread-crumb', template: "<div\n *ngIf=\"items && items.length > 0\"\n class=\"pt-bread-crumb breadcrumb-container\"\n>\n <p-breadcrumb class=\"max-w-full\" [model]=\"items\" [home]=\"home\"></p-breadcrumb>\n</div>\n", styles: [".pt-bread-crumb ::ng-deep chevronrighticon.p-element.p-icon-wrapper.ng-star-inserted{margin-top:4px}.pt-bread-crumb ::ng-deep .p-breadcrumb{margin-bottom:20px}.pt-bread-crumb .breadcrumb-container{padding:10px;border-radius:5px;margin-bottom:20px}.pt-bread-crumb ::ng-deep .breadcrumb-background{background-size:cover;background-position:center;background-repeat:no-repeat}\n"] }]
|
2864
|
+
}], ctorParameters: () => [{ type: PTBreadCrumbService }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { breadCrumbConfig: [{
|
2865
|
+
type: Input
|
2866
|
+
}] } });
|
2867
|
+
|
2868
|
+
class PTPageSkeletonComponent {
|
2869
|
+
constructor() {
|
2870
|
+
this.toggleSidebar = new EventEmitter();
|
2871
|
+
this.isSidebarVisible = true;
|
2872
|
+
}
|
2873
|
+
ngOnInit() {
|
2874
|
+
this.initializeBackgroundCardConfig();
|
2875
|
+
this.initializeContentCardConfig();
|
2876
|
+
}
|
2877
|
+
onToggleSidebar() {
|
2878
|
+
this.isSidebarVisible = !this.isSidebarVisible;
|
2879
|
+
this.toggleSidebar.emit();
|
2880
|
+
}
|
2881
|
+
// Initialize backgroundCardConfig with default values
|
2882
|
+
initializeBackgroundCardConfig() {
|
2883
|
+
this.pageSkeletonConfig.backgroundCardConfig = {
|
2884
|
+
noBorder: this.pageSkeletonConfig.backgroundCardConfig?.noBorder ?? true,
|
2885
|
+
backgroundColor: this.pageSkeletonConfig.backgroundCardConfig?.backgroundColor || '#fff',
|
2886
|
+
padding: this.pageSkeletonConfig.backgroundCardConfig?.padding || '20px',
|
2887
|
+
margin: this.pageSkeletonConfig.backgroundCardConfig?.margin || '10px',
|
2888
|
+
...this.pageSkeletonConfig.backgroundCardConfig,
|
2889
|
+
};
|
2890
|
+
}
|
2891
|
+
// Initialize contentCardConfig with default values (if necessary)
|
2892
|
+
initializeContentCardConfig() {
|
2893
|
+
this.pageSkeletonConfig.contentCardConfig = {
|
2894
|
+
noBorder: this.pageSkeletonConfig.contentCardConfig?.noBorder ?? false,
|
2895
|
+
backgroundColor: this.pageSkeletonConfig.contentCardConfig?.backgroundColor || '#f0f0f0',
|
2896
|
+
padding: this.pageSkeletonConfig.contentCardConfig?.padding || '15px',
|
2897
|
+
...this.pageSkeletonConfig.contentCardConfig,
|
2898
|
+
};
|
2899
|
+
}
|
2900
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
2901
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTPageSkeletonComponent, selector: "pt-page-skeleton", inputs: { pageSkeletonConfig: "pageSkeletonConfig" }, outputs: { toggleSidebar: "toggleSidebar" }, ngImport: i0, template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n <pt-side-bar-menu\n *ngIf=\"isSidebarVisible\"\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n <pt-bread-crumb\n *ngIf=\"pageSkeletonConfig.breadCrumbConfig\"\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n <pt-footer\n *ngIf=\"pageSkeletonConfig.footerConfig\"\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{width:300px;transition:all .3s ease-in-out}.content-area.full-width{margin-left:0;width:100%}pt-card{width:100%;height:100%;max-width:100%;overflow:hidden}pt-card .card-body-scrollable{overflow-x:auto}.pt-footer{margin-top:0}.footer-card{width:100%;background-color:transparent}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: PTNavbarMenuComponent, selector: "pt-nav-bar-menu", inputs: ["navBarMenuConfig"], outputs: ["toggleSidebar"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "component", type: PTSideBarMenuComponent, selector: "pt-side-bar-menu", inputs: ["menuConfig"] }, { kind: "directive", type: i2$2.RouterOutlet, selector: "router-outlet", inputs: ["name"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }, { kind: "component", type: PTFooterComponent, selector: "pt-footer", inputs: ["footerConfig"] }, { kind: "component", type: PTBreadCrumbComponent, selector: "pt-bread-crumb", inputs: ["breadCrumbConfig"] }] }); }
|
2902
|
+
}
|
2903
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonComponent, decorators: [{
|
2904
|
+
type: Component,
|
2905
|
+
args: [{ selector: 'pt-page-skeleton', template: "<pt-card [config]=\"pageSkeletonConfig.backgroundCardConfig!\">\n <!-- Navbar -->\n <pt-nav-bar-menu\n [navBarMenuConfig]=\"pageSkeletonConfig.navBarMenuConfig\"\n (toggleSidebar)=\"onToggleSidebar()\"\n ></pt-nav-bar-menu>\n\n <div class=\"main-content\">\n <!-- Sidebar (use *ngIf to toggle visibility) -->\n <pt-side-bar-menu\n *ngIf=\"isSidebarVisible\"\n [menuConfig]=\"pageSkeletonConfig.sideMenuBarConfig\"\n class=\"sidebar\"\n ></pt-side-bar-menu>\n\n <!-- Main View Area -->\n <div class=\"content-area\" [ngClass]=\"{ 'full-width': !isSidebarVisible }\">\n <!-- Content Card Wrapper -->\n <pt-card [config]=\"pageSkeletonConfig.contentCardConfig\">\n <!-- Breadcrumb -->\n <pt-bread-crumb\n *ngIf=\"pageSkeletonConfig.breadCrumbConfig\"\n [breadCrumbConfig]=\"pageSkeletonConfig.breadCrumbConfig\"\n class=\"bread-crumb\"\n ></pt-bread-crumb>\n\n <!-- Background Card -->\n\n <router-outlet></router-outlet>\n </pt-card>\n </div>\n </div>\n\n <!-- Footer -->\n <pt-footer\n *ngIf=\"pageSkeletonConfig.footerConfig\"\n [footerConfig]=\"pageSkeletonConfig.footerConfig\"\n class=\"pt-footer\"\n ></pt-footer>\n</pt-card>\n", styles: [".bread-crumb{margin-bottom:15px}.app-container{display:flex;flex-direction:column;height:100vh}.main-content{display:flex;flex-grow:1;transition:all .3s ease-in-out}.content-area{flex-grow:1;display:flex;justify-content:center;align-items:flex-start;transition:all .3s ease-in-out;margin-left:14px;width:100%;overflow-x:hidden}.sidebar{width:300px;transition:all .3s ease-in-out}.content-area.full-width{margin-left:0;width:100%}pt-card{width:100%;height:100%;max-width:100%;overflow:hidden}pt-card .card-body-scrollable{overflow-x:auto}.pt-footer{margin-top:0}.footer-card{width:100%;background-color:transparent}\n"] }]
|
2906
|
+
}], propDecorators: { pageSkeletonConfig: [{
|
2907
|
+
type: Input
|
2908
|
+
}], toggleSidebar: [{
|
2909
|
+
type: Output
|
2910
|
+
}] } });
|
2911
|
+
|
2912
|
+
class PTFooterModule {
|
2913
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFooterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2914
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTFooterModule, declarations: [PTFooterComponent], imports: [CommonModule, PTCardModule], exports: [PTFooterComponent] }); }
|
2915
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFooterModule, imports: [CommonModule, PTCardModule] }); }
|
2916
|
+
}
|
2917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTFooterModule, decorators: [{
|
2918
|
+
type: NgModule,
|
2919
|
+
args: [{
|
2920
|
+
declarations: [PTFooterComponent],
|
2921
|
+
imports: [CommonModule, PTCardModule],
|
2922
|
+
exports: [PTFooterComponent],
|
2923
|
+
}]
|
2924
|
+
}] });
|
2925
|
+
|
2926
|
+
class PTBreadCrumbModule {
|
2927
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2928
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbModule, declarations: [PTBreadCrumbComponent], imports: [CommonModule, BreadcrumbModule], exports: [PTBreadCrumbComponent] }); }
|
2929
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbModule, imports: [CommonModule, BreadcrumbModule] }); }
|
2930
|
+
}
|
2931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTBreadCrumbModule, decorators: [{
|
2932
|
+
type: NgModule,
|
2933
|
+
args: [{
|
2934
|
+
declarations: [PTBreadCrumbComponent],
|
2935
|
+
imports: [CommonModule, BreadcrumbModule],
|
2936
|
+
exports: [PTBreadCrumbComponent],
|
2937
|
+
}]
|
2938
|
+
}] });
|
2939
|
+
|
2940
|
+
class PTPageSkeletonModule {
|
2941
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2942
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonModule, declarations: [PTPageSkeletonComponent], imports: [CommonModule,
|
2943
|
+
PTNavbarMenuModule,
|
2944
|
+
PTCardModule,
|
2945
|
+
PTSideBarMenuModule,
|
2946
|
+
RouterModule,
|
2947
|
+
PTFooterModule,
|
2948
|
+
PTBreadCrumbModule], exports: [PTPageSkeletonComponent] }); }
|
2949
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonModule, imports: [CommonModule,
|
2950
|
+
PTNavbarMenuModule,
|
2951
|
+
PTCardModule,
|
2952
|
+
PTSideBarMenuModule,
|
2953
|
+
RouterModule,
|
2954
|
+
PTFooterModule,
|
2955
|
+
PTBreadCrumbModule] }); }
|
2956
|
+
}
|
2957
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTPageSkeletonModule, decorators: [{
|
2958
|
+
type: NgModule,
|
2959
|
+
args: [{
|
2960
|
+
declarations: [PTPageSkeletonComponent],
|
2961
|
+
imports: [
|
2962
|
+
CommonModule,
|
2963
|
+
PTNavbarMenuModule,
|
2964
|
+
PTCardModule,
|
2965
|
+
PTSideBarMenuModule,
|
2966
|
+
RouterModule,
|
2967
|
+
PTFooterModule,
|
2968
|
+
PTBreadCrumbModule,
|
2969
|
+
],
|
2970
|
+
exports: [PTPageSkeletonComponent],
|
2971
|
+
}]
|
2972
|
+
}] });
|
2973
|
+
|
2974
|
+
class PTButtonComponent {
|
2975
|
+
constructor(renderer, el) {
|
2976
|
+
this.renderer = renderer;
|
2977
|
+
this.el = el;
|
2978
|
+
this.buttonConfig = {
|
2979
|
+
label: 'Click Me',
|
2980
|
+
icon: '',
|
2981
|
+
iconPos: 'left',
|
2982
|
+
disabled: false,
|
2983
|
+
styleClass: '',
|
2984
|
+
loading: false,
|
2985
|
+
type: 'button',
|
2986
|
+
width: '100%',
|
2987
|
+
height: 'auto',
|
2988
|
+
fontColor: '#000',
|
2989
|
+
backgroundColor: '#fff',
|
2990
|
+
borderColor: '#000',
|
2991
|
+
};
|
2992
|
+
}
|
2993
|
+
ngOnInit() {
|
2994
|
+
// Initialization logic if needed
|
2995
|
+
}
|
2996
|
+
ngAfterViewInit() {
|
2997
|
+
this.applyButtonStyles();
|
2998
|
+
}
|
2999
|
+
getIconPos() {
|
3000
|
+
return this.buttonConfig.iconPos === 'right' ? 'right' : 'left';
|
3001
|
+
}
|
3002
|
+
getType() {
|
3003
|
+
return this.buttonConfig.type || 'button';
|
3004
|
+
}
|
3005
|
+
applyButtonStyles() {
|
3006
|
+
// Select the native button element inside the p-button
|
3007
|
+
const buttonElement = this.el.nativeElement.querySelector('button.p-element');
|
3008
|
+
if (buttonElement) {
|
3009
|
+
// Apply dynamic styles using Renderer2
|
3010
|
+
this.renderer.setStyle(buttonElement, 'color', this.buttonConfig.fontColor);
|
3011
|
+
this.renderer.setStyle(buttonElement, 'background-color', this.buttonConfig.backgroundColor);
|
3012
|
+
this.renderer.setStyle(buttonElement, 'border-color', this.buttonConfig.borderColor);
|
3013
|
+
this.renderer.setStyle(buttonElement, 'width', this.buttonConfig.width || 'auto');
|
3014
|
+
this.renderer.setStyle(buttonElement, 'height', this.buttonConfig.height || 'auto');
|
3015
|
+
}
|
3016
|
+
}
|
3017
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTButtonComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
3018
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTButtonComponent, selector: "pt-button", inputs: { buttonConfig: "buttonConfig" }, ngImport: i0, template: "<p-button\n [label]=\"buttonConfig.label\"\n [icon]=\"buttonConfig.icon || ''\"\n [iconPos]=\"getIconPos()\"\n [disabled]=\"buttonConfig.disabled\"\n [loading]=\"buttonConfig.loading\"\n [class]=\"buttonConfig.styleClass\"\n [type]=\"getType()\"\n></p-button>\n", styles: ["::ng-deep p-button{display:block}\n"], dependencies: [{ kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "style", "styleClass", "badgeClass", "ariaLabel", "autofocus"], outputs: ["onClick", "onFocus", "onBlur"] }] }); }
|
3019
|
+
}
|
3020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTButtonComponent, decorators: [{
|
3021
|
+
type: Component,
|
3022
|
+
args: [{ selector: 'pt-button', template: "<p-button\n [label]=\"buttonConfig.label\"\n [icon]=\"buttonConfig.icon || ''\"\n [iconPos]=\"getIconPos()\"\n [disabled]=\"buttonConfig.disabled\"\n [loading]=\"buttonConfig.loading\"\n [class]=\"buttonConfig.styleClass\"\n [type]=\"getType()\"\n></p-button>\n", styles: ["::ng-deep p-button{display:block}\n"] }]
|
3023
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { buttonConfig: [{
|
3024
|
+
type: Input
|
3025
|
+
}] } });
|
3026
|
+
|
3027
|
+
class PTLoginPageComponent {
|
3028
|
+
constructor(fb) {
|
3029
|
+
this.fb = fb;
|
3030
|
+
this.loginSubmit = new EventEmitter();
|
3031
|
+
this.backgroundImageStyle = '';
|
3032
|
+
this.formGroup = this.fb.group({});
|
3033
|
+
}
|
3034
|
+
ngOnInit() {
|
3035
|
+
this.initializeDefaults();
|
3036
|
+
this.setupFormFields();
|
3037
|
+
this.formGroup.patchValue({
|
3038
|
+
username: this.loginPageConfig.login?.username || '',
|
3039
|
+
password: this.loginPageConfig.login?.password || '',
|
3040
|
+
});
|
3041
|
+
this.setBackgroundImageStyle();
|
3042
|
+
// Enable/Disable the button based on form validity
|
3043
|
+
this.formGroup.statusChanges.subscribe((status) => {
|
3044
|
+
this.loginPageConfig.buttonConfig.disabled = status !== 'VALID';
|
3045
|
+
});
|
3046
|
+
}
|
3047
|
+
// Initialize default values for all fields in loginPageConfig if not set
|
3048
|
+
initializeDefaults() {
|
3049
|
+
// Initialize backgroundImage
|
3050
|
+
this.loginPageConfig.backgroundImage = {
|
3051
|
+
imageUrl: this.loginPageConfig.backgroundImage?.imageUrl || '',
|
3052
|
+
transparencyPercentage: this.loginPageConfig.backgroundImage?.transparencyPercentage || '100',
|
3053
|
+
...this.loginPageConfig.backgroundImage,
|
3054
|
+
};
|
3055
|
+
// Initialize title
|
3056
|
+
this.loginPageConfig.title = {
|
3057
|
+
text: this.loginPageConfig.title?.text || 'Login',
|
3058
|
+
position: this.loginPageConfig.title?.position || 'center',
|
3059
|
+
color: this.loginPageConfig.title?.color || '#333',
|
3060
|
+
fontSize: this.loginPageConfig.title?.fontSize || '24px',
|
3061
|
+
...this.loginPageConfig.title,
|
3062
|
+
};
|
3063
|
+
// Initialize logoUrl
|
3064
|
+
this.loginPageConfig.logoUrl = {
|
3065
|
+
altText: this.loginPageConfig.logoUrl?.altText || 'Logo',
|
3066
|
+
imageUrl: this.loginPageConfig.logoUrl?.imageUrl || '',
|
3067
|
+
width: this.loginPageConfig.logoUrl?.width || '100px',
|
3068
|
+
height: this.loginPageConfig.logoUrl?.height || 'auto',
|
3069
|
+
...this.loginPageConfig.logoUrl,
|
3070
|
+
};
|
3071
|
+
// Initialize footer
|
3072
|
+
this.loginPageConfig.footer = {
|
3073
|
+
version: this.loginPageConfig.footer?.version || 'V1.0',
|
3074
|
+
copyright: this.loginPageConfig.footer?.copyright || 'Your Company © 2024',
|
3075
|
+
...this.loginPageConfig.footer,
|
3076
|
+
};
|
3077
|
+
// Initialize login
|
3078
|
+
this.loginPageConfig.login = {
|
3079
|
+
username: this.loginPageConfig.login?.username || '',
|
3080
|
+
password: this.loginPageConfig.login?.password || '',
|
3081
|
+
errorMessage: this.loginPageConfig.login?.errorMessage || '',
|
3082
|
+
emptyFieldsErrorMessage: this.loginPageConfig.login?.emptyFieldsErrorMessage ||
|
3083
|
+
"Veuillez saisir votre nom d'utilisateur et votre mot de passe !",
|
3084
|
+
...this.loginPageConfig.login,
|
3085
|
+
};
|
3086
|
+
// Initialize cardConfig
|
3087
|
+
this.loginPageConfig.cardConfig = {
|
3088
|
+
noBorder: this.loginPageConfig.cardConfig?.noBorder ?? true,
|
3089
|
+
width: this.loginPageConfig.cardConfig?.width ?? '400px',
|
3090
|
+
padding: this.loginPageConfig.cardConfig?.padding ?? '40px',
|
3091
|
+
...this.loginPageConfig.cardConfig,
|
3092
|
+
};
|
3093
|
+
// Initialize usernameField
|
3094
|
+
this.loginPageConfig.usernameField = {
|
3095
|
+
name: this.loginPageConfig.usernameField?.name || 'username',
|
3096
|
+
label: this.loginPageConfig.usernameField?.label || "Nom d'utilisateur",
|
3097
|
+
required: this.loginPageConfig.usernameField?.required ?? true,
|
3098
|
+
placeholder: this.loginPageConfig.usernameField?.placeholder ||
|
3099
|
+
"Entrer votre nom d'utilisateur",
|
3100
|
+
...this.loginPageConfig.usernameField,
|
3101
|
+
};
|
3102
|
+
// Initialize passwordField
|
3103
|
+
this.loginPageConfig.passwordField = {
|
3104
|
+
name: this.loginPageConfig.passwordField?.name || 'password',
|
3105
|
+
label: this.loginPageConfig.passwordField?.label || 'Mot de passe',
|
3106
|
+
required: this.loginPageConfig.passwordField?.required ?? true,
|
3107
|
+
placeholder: this.loginPageConfig.passwordField?.placeholder ||
|
3108
|
+
'Entrer votre mot de passe',
|
3109
|
+
type: this.loginPageConfig.passwordField?.type || FormInputTypeEnum.PASSWORD,
|
3110
|
+
...this.loginPageConfig.passwordField,
|
3111
|
+
};
|
3112
|
+
// Initialize buttonConfig
|
3113
|
+
this.loginPageConfig.buttonConfig = {
|
3114
|
+
label: this.loginPageConfig.buttonConfig?.label || 'Login',
|
3115
|
+
type: this.loginPageConfig.buttonConfig?.type || 'submit',
|
3116
|
+
icon: this.loginPageConfig.buttonConfig?.icon || 'pi pi-sign-in',
|
3117
|
+
iconPos: this.loginPageConfig.buttonConfig?.iconPos || 'left',
|
3118
|
+
styleClass: this.loginPageConfig.buttonConfig?.styleClass || 'p-button-success',
|
3119
|
+
disabled: this.loginPageConfig.buttonConfig?.disabled ?? true,
|
3120
|
+
width: this.loginPageConfig.buttonConfig?.width ?? '100%',
|
3121
|
+
...this.loginPageConfig.buttonConfig,
|
3122
|
+
};
|
3123
|
+
}
|
3124
|
+
setBackgroundImageStyle() {
|
3125
|
+
const transparency = parseFloat(this.loginPageConfig?.backgroundImage?.transparencyPercentage) / 100;
|
3126
|
+
this.backgroundImageStyle = `linear-gradient(rgba(255,255,255,${1 - transparency}), rgba(255,255,255,${1 - transparency})), url(${this.loginPageConfig?.backgroundImage?.imageUrl})`;
|
3127
|
+
}
|
3128
|
+
login() {
|
3129
|
+
if (this.formGroup.valid) {
|
3130
|
+
this.loginSubmit.emit(this.formGroup.value);
|
3131
|
+
}
|
3132
|
+
else {
|
3133
|
+
this.loginPageConfig.login.errorMessage =
|
3134
|
+
this.loginPageConfig.login?.emptyFieldsErrorMessage;
|
3135
|
+
}
|
3136
|
+
}
|
3137
|
+
// Setup form fields using the usernameField and passwordField from LoginPageConfig
|
3138
|
+
setupFormFields() {
|
3139
|
+
const usernameValidators = this.loginPageConfig.usernameField?.required
|
3140
|
+
? [Validators.required]
|
3141
|
+
: [];
|
3142
|
+
const passwordValidators = this.loginPageConfig.passwordField?.required
|
3143
|
+
? [Validators.required]
|
3144
|
+
: [];
|
3145
|
+
this.formGroup.addControl(this.loginPageConfig.usernameField.name, this.fb.control(this.loginPageConfig.login?.username, usernameValidators));
|
3146
|
+
this.formGroup.addControl(this.loginPageConfig.passwordField.name, this.fb.control(this.loginPageConfig.login?.password, passwordValidators));
|
3147
|
+
}
|
3148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageComponent, deps: [{ token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
|
3149
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTLoginPageComponent, selector: "pt-login-page", inputs: { loginPageConfig: "loginPageConfig" }, outputs: { loginSubmit: "loginSubmit" }, ngImport: i0, template: "<div\n class=\"login-container\"\n [ngStyle]=\"{\n 'background-image': backgroundImageStyle\n }\"\n>\n <pt-card [config]=\"loginPageConfig.cardConfig!\">\n <div class=\"logo-container\" *ngIf=\"loginPageConfig.logoUrl?.imageUrl\">\n <img\n [src]=\"loginPageConfig.logoUrl?.imageUrl\"\n [alt]=\"loginPageConfig.logoUrl?.altText\"\n [style.width]=\"loginPageConfig.logoUrl?.width\"\n [style.height]=\"loginPageConfig.logoUrl?.height\"\n />\n </div>\n\n <div\n class=\"title-container\"\n [ngStyle]=\"{ 'text-align': loginPageConfig.title?.position }\"\n >\n <h1\n [ngStyle]=\"{\n color: loginPageConfig.title?.color,\n 'font-size': loginPageConfig.title?.fontSize\n }\"\n >\n {{ loginPageConfig.title?.text }}\n </h1>\n </div>\n\n <form class=\"form-container\" [formGroup]=\"formGroup\" (ngSubmit)=\"login()\">\n <div *ngIf=\"loginPageConfig.login?.errorMessage\" class=\"error-message\">\n {{ loginPageConfig.login?.errorMessage }}\n </div>\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"loginPageConfig.usernameField!\"\n ></pt-text-input>\n </div>\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"loginPageConfig.passwordField!\"\n ></pt-text-input>\n </div>\n <div class=\"submit-btn\">\n <pt-button [buttonConfig]=\"loginPageConfig.buttonConfig!\"></pt-button>\n </div>\n </form>\n\n <div class=\"login-footer\">\n {{ loginPageConfig.footer?.version }}\n <span>{{ loginPageConfig.footer?.copyright }}</span>\n </div>\n </pt-card>\n</div>\n", styles: [".login-container{background-size:cover;background-position:center;background-repeat:no-repeat;height:100vh;width:100vw;display:flex;justify-content:center;align-items:center}.error-message{color:red;background-color:#ffe6e6;border:1px solid red;padding:10px;margin-bottom:10px;border-radius:5px;width:100%}.logo-container{display:flex;justify-content:center;align-items:center;margin-bottom:20px}.title-container{text-align:center;margin-bottom:20px}.field{display:flex;flex-direction:column;margin-bottom:20px;width:100%}.submit-btn{display:flex;justify-content:center;width:100%}::ng-deep pt-button{width:100%}::ng-deep .submit-btn p-button button{width:100%}@media (max-width: 768px){.submit-btn{min-width:100%}}.login-footer{margin-top:20px;text-align:center;font-size:.9em;color:#555}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "component", type: PTTextInputComponent, selector: "pt-text-input", inputs: ["formGroup", "formField"] }, { kind: "component", type: PTCardComponent, selector: "pt-card", inputs: ["config"] }, { kind: "component", type: PTButtonComponent, selector: "pt-button", inputs: ["buttonConfig"] }] }); }
|
3150
|
+
}
|
3151
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageComponent, decorators: [{
|
3152
|
+
type: Component,
|
3153
|
+
args: [{ selector: 'pt-login-page', template: "<div\n class=\"login-container\"\n [ngStyle]=\"{\n 'background-image': backgroundImageStyle\n }\"\n>\n <pt-card [config]=\"loginPageConfig.cardConfig!\">\n <div class=\"logo-container\" *ngIf=\"loginPageConfig.logoUrl?.imageUrl\">\n <img\n [src]=\"loginPageConfig.logoUrl?.imageUrl\"\n [alt]=\"loginPageConfig.logoUrl?.altText\"\n [style.width]=\"loginPageConfig.logoUrl?.width\"\n [style.height]=\"loginPageConfig.logoUrl?.height\"\n />\n </div>\n\n <div\n class=\"title-container\"\n [ngStyle]=\"{ 'text-align': loginPageConfig.title?.position }\"\n >\n <h1\n [ngStyle]=\"{\n color: loginPageConfig.title?.color,\n 'font-size': loginPageConfig.title?.fontSize\n }\"\n >\n {{ loginPageConfig.title?.text }}\n </h1>\n </div>\n\n <form class=\"form-container\" [formGroup]=\"formGroup\" (ngSubmit)=\"login()\">\n <div *ngIf=\"loginPageConfig.login?.errorMessage\" class=\"error-message\">\n {{ loginPageConfig.login?.errorMessage }}\n </div>\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"loginPageConfig.usernameField!\"\n ></pt-text-input>\n </div>\n <div class=\"field\">\n <pt-text-input\n [formGroup]=\"formGroup\"\n [formField]=\"loginPageConfig.passwordField!\"\n ></pt-text-input>\n </div>\n <div class=\"submit-btn\">\n <pt-button [buttonConfig]=\"loginPageConfig.buttonConfig!\"></pt-button>\n </div>\n </form>\n\n <div class=\"login-footer\">\n {{ loginPageConfig.footer?.version }}\n <span>{{ loginPageConfig.footer?.copyright }}</span>\n </div>\n </pt-card>\n</div>\n", styles: [".login-container{background-size:cover;background-position:center;background-repeat:no-repeat;height:100vh;width:100vw;display:flex;justify-content:center;align-items:center}.error-message{color:red;background-color:#ffe6e6;border:1px solid red;padding:10px;margin-bottom:10px;border-radius:5px;width:100%}.logo-container{display:flex;justify-content:center;align-items:center;margin-bottom:20px}.title-container{text-align:center;margin-bottom:20px}.field{display:flex;flex-direction:column;margin-bottom:20px;width:100%}.submit-btn{display:flex;justify-content:center;width:100%}::ng-deep pt-button{width:100%}::ng-deep .submit-btn p-button button{width:100%}@media (max-width: 768px){.submit-btn{min-width:100%}}.login-footer{margin-top:20px;text-align:center;font-size:.9em;color:#555}\n"] }]
|
3154
|
+
}], ctorParameters: () => [{ type: i2$1.FormBuilder }], propDecorators: { loginPageConfig: [{
|
3155
|
+
type: Input
|
3156
|
+
}], loginSubmit: [{
|
3157
|
+
type: Output
|
3158
|
+
}] } });
|
3159
|
+
|
3160
|
+
class PTButtonModule {
|
3161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
3162
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTButtonModule, declarations: [PTButtonComponent], imports: [CommonModule, ButtonModule], exports: [PTButtonComponent] }); }
|
3163
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTButtonModule, imports: [CommonModule, ButtonModule] }); }
|
3164
|
+
}
|
3165
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTButtonModule, decorators: [{
|
3166
|
+
type: NgModule,
|
3167
|
+
args: [{
|
3168
|
+
declarations: [PTButtonComponent],
|
3169
|
+
imports: [CommonModule, ButtonModule],
|
3170
|
+
exports: [PTButtonComponent],
|
3171
|
+
}]
|
3172
|
+
}] });
|
3173
|
+
|
3174
|
+
class PTLoginPageModule {
|
3175
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
3176
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageModule, declarations: [PTLoginPageComponent], imports: [CommonModule,
|
3177
|
+
FormsModule,
|
3178
|
+
ReactiveFormsModule,
|
3179
|
+
PTTextInputModule,
|
3180
|
+
PTCardModule,
|
3181
|
+
PTButtonModule], exports: [PTLoginPageComponent] }); }
|
3182
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageModule, imports: [CommonModule,
|
3183
|
+
FormsModule,
|
3184
|
+
ReactiveFormsModule,
|
3185
|
+
PTTextInputModule,
|
3186
|
+
PTCardModule,
|
3187
|
+
PTButtonModule] }); }
|
3188
|
+
}
|
3189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTLoginPageModule, decorators: [{
|
3190
|
+
type: NgModule,
|
3191
|
+
args: [{
|
3192
|
+
declarations: [PTLoginPageComponent],
|
3193
|
+
imports: [
|
3194
|
+
CommonModule,
|
3195
|
+
FormsModule,
|
3196
|
+
ReactiveFormsModule,
|
3197
|
+
PTTextInputModule,
|
3198
|
+
PTCardModule,
|
3199
|
+
PTButtonModule,
|
3200
|
+
],
|
3201
|
+
exports: [PTLoginPageComponent],
|
3202
|
+
}]
|
3203
|
+
}] });
|
3204
|
+
|
3205
|
+
class PTDialogComponent {
|
3206
|
+
constructor(confirmationService, messageService, renderer, el) {
|
3207
|
+
this.confirmationService = confirmationService;
|
3208
|
+
this.messageService = messageService;
|
3209
|
+
this.renderer = renderer;
|
3210
|
+
this.el = el;
|
3211
|
+
this.dialogModel = {
|
3212
|
+
header: { text: 'Confirmation' },
|
3213
|
+
visible: false,
|
3214
|
+
width: '400px',
|
3215
|
+
height: 'auto',
|
3216
|
+
content: 'Do you want to proceed?',
|
3217
|
+
confirmButtonConfig: {
|
3218
|
+
label: 'Confirm',
|
3219
|
+
fontColor: '#fff',
|
3220
|
+
backgroundColor: '#007bff',
|
3221
|
+
},
|
3222
|
+
cancelButtonConfig: {
|
3223
|
+
label: 'Cancel',
|
3224
|
+
fontColor: '#fff',
|
3225
|
+
backgroundColor: '#6c757d',
|
3226
|
+
},
|
3227
|
+
};
|
3228
|
+
this.confirm = new EventEmitter();
|
3229
|
+
this.cancel = new EventEmitter();
|
3230
|
+
}
|
3231
|
+
ngOnChanges(changes) {
|
3232
|
+
if (changes['dialogModel'] && this.dialogModel.visible) {
|
3233
|
+
this.showDialog();
|
3234
|
+
}
|
3235
|
+
}
|
3236
|
+
showDialog() {
|
3237
|
+
this.confirmationService.confirm({
|
3238
|
+
header: this.dialogModel.header?.text || 'Confirmation',
|
3239
|
+
message: this.dialogModel.content || 'Are you sure?',
|
3240
|
+
acceptButtonStyleClass: this.getButtonStyle(this.dialogModel.confirmButtonConfig),
|
3241
|
+
rejectButtonStyleClass: this.getButtonStyle(this.dialogModel.cancelButtonConfig),
|
3242
|
+
acceptIcon: this.dialogModel.confirmButtonConfig?.icon || 'pi pi-check',
|
3243
|
+
rejectIcon: this.dialogModel.cancelButtonConfig?.icon || 'pi pi-times',
|
3244
|
+
accept: () => {
|
3245
|
+
this.confirm.emit();
|
3246
|
+
this.messageService.add({
|
3247
|
+
severity: 'info',
|
3248
|
+
summary: 'Confirmed',
|
3249
|
+
detail: 'Action confirmed',
|
3250
|
+
life: 3000,
|
3251
|
+
});
|
3252
|
+
},
|
3253
|
+
reject: (type) => {
|
3254
|
+
this.cancel.emit();
|
3255
|
+
if (type === ConfirmEventType.REJECT) {
|
3256
|
+
this.messageService.add({
|
3257
|
+
severity: 'error',
|
3258
|
+
summary: 'Rejected',
|
3259
|
+
detail: 'Action cancelled',
|
3260
|
+
life: 3000,
|
3261
|
+
});
|
3262
|
+
}
|
3263
|
+
},
|
3264
|
+
});
|
3265
|
+
// Use renderer to apply dynamic styles
|
3266
|
+
setTimeout(() => {
|
3267
|
+
const dialogElement = this.el.nativeElement.querySelector('.p-dialog');
|
3268
|
+
if (dialogElement) {
|
3269
|
+
this.renderer.setStyle(dialogElement, 'width', this.dialogModel.width || '400px');
|
3270
|
+
this.renderer.setStyle(dialogElement, 'height', this.dialogModel.height || 'auto');
|
3271
|
+
}
|
3272
|
+
}, 0);
|
3273
|
+
}
|
3274
|
+
getButtonStyle(buttonConfig) {
|
3275
|
+
return buttonConfig?.styleClass || 'p-button-sm'; // Default to small button style
|
3276
|
+
}
|
3277
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogComponent, deps: [{ token: i1$1.ConfirmationService }, { token: i1$1.MessageService }, { token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
3278
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTDialogComponent, selector: "pt-dialog", inputs: { dialogModel: "dialogModel" }, outputs: { confirm: "confirm", cancel: "cancel" }, providers: [ConfirmationService, MessageService], usesOnChanges: true, ngImport: i0, template: "<div>\n <p-toast></p-toast>\n <p-confirmDialog>\n <ng-template pTemplate=\"message\" let-message>\n <div\n class=\"flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border\"\n >\n <i [class]=\"dialogModel.header?.icon || 'pi pi-exclamation-circle'\"></i>\n <p>{{ message.message }}</p>\n </div>\n </ng-template>\n </p-confirmDialog>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1$1.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i2$3.Toast, selector: "p-toast", inputs: ["key", "autoZIndex", "baseZIndex", "life", "style", "styleClass", "position", "preventOpenDuplicates", "preventDuplicates", "showTransformOptions", "hideTransformOptions", "showTransitionOptions", "hideTransitionOptions", "breakpoints"], outputs: ["onClose"] }, { kind: "component", type: i3$7.ConfirmDialog, selector: "p-confirmDialog", inputs: ["header", "icon", "message", "style", "styleClass", "maskStyleClass", "acceptIcon", "acceptLabel", "closeAriaLabel", "acceptAriaLabel", "acceptVisible", "rejectIcon", "rejectLabel", "rejectAriaLabel", "rejectVisible", "acceptButtonStyleClass", "rejectButtonStyleClass", "closeOnEscape", "dismissableMask", "blockScroll", "rtl", "closable", "appendTo", "key", "autoZIndex", "baseZIndex", "transitionOptions", "focusTrap", "defaultFocus", "breakpoints", "visible", "position"], outputs: ["onHide"] }] }); }
|
3279
|
+
}
|
3280
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogComponent, decorators: [{
|
3281
|
+
type: Component,
|
3282
|
+
args: [{ selector: 'pt-dialog', providers: [ConfirmationService, MessageService], template: "<div>\n <p-toast></p-toast>\n <p-confirmDialog>\n <ng-template pTemplate=\"message\" let-message>\n <div\n class=\"flex flex-column align-items-center w-full gap-3 border-bottom-1 surface-border\"\n >\n <i [class]=\"dialogModel.header?.icon || 'pi pi-exclamation-circle'\"></i>\n <p>{{ message.message }}</p>\n </div>\n </ng-template>\n </p-confirmDialog>\n</div>\n" }]
|
3283
|
+
}], ctorParameters: () => [{ type: i1$1.ConfirmationService }, { type: i1$1.MessageService }, { type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { dialogModel: [{
|
3284
|
+
type: Input
|
3285
|
+
}], confirm: [{
|
3286
|
+
type: Output
|
3287
|
+
}], cancel: [{
|
3288
|
+
type: Output
|
3289
|
+
}] } });
|
3290
|
+
|
3291
|
+
class PTDialogModule {
|
3292
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
3293
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTDialogModule, declarations: [PTDialogComponent], imports: [CommonModule,
|
3294
|
+
DialogModule,
|
3295
|
+
PTButtonModule,
|
3296
|
+
ToastModule,
|
3297
|
+
ConfirmDialogModule], exports: [PTDialogComponent] }); }
|
3298
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogModule, imports: [CommonModule,
|
3299
|
+
DialogModule,
|
3300
|
+
PTButtonModule,
|
3301
|
+
ToastModule,
|
3302
|
+
ConfirmDialogModule] }); }
|
3303
|
+
}
|
3304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTDialogModule, decorators: [{
|
3305
|
+
type: NgModule,
|
3306
|
+
args: [{
|
3307
|
+
declarations: [PTDialogComponent],
|
3308
|
+
imports: [
|
3309
|
+
CommonModule,
|
3310
|
+
DialogModule,
|
3311
|
+
PTButtonModule,
|
3312
|
+
ToastModule,
|
3313
|
+
ConfirmDialogModule,
|
3314
|
+
],
|
3315
|
+
exports: [PTDialogComponent],
|
3316
|
+
}]
|
3317
|
+
}] });
|
3318
|
+
|
2147
3319
|
class NgPrimeToolsModule {
|
2148
3320
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
2149
3321
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
|
@@ -2166,7 +3338,24 @@ class NgPrimeToolsModule {
|
|
2166
3338
|
// Cards
|
2167
3339
|
PTCardModule,
|
2168
3340
|
// Menu
|
2169
|
-
PTMenuModule
|
3341
|
+
PTMenuModule,
|
3342
|
+
PTMenuFancyModule,
|
3343
|
+
// Navbar
|
3344
|
+
PTNavbarMenuModule,
|
3345
|
+
// SideBar
|
3346
|
+
PTSideBarMenuModule,
|
3347
|
+
// Page skeleton
|
3348
|
+
PTPageSkeletonModule,
|
3349
|
+
// Footer
|
3350
|
+
PTFooterModule,
|
3351
|
+
// BreadCrumb
|
3352
|
+
PTBreadCrumbModule,
|
3353
|
+
// Login
|
3354
|
+
PTLoginPageModule,
|
3355
|
+
// Button
|
3356
|
+
PTButtonModule,
|
3357
|
+
// Dialog
|
3358
|
+
PTDialogModule], exports: [NgAdvancedPrimeTableModule,
|
2170
3359
|
MultiSearchCriteriaModule,
|
2171
3360
|
// Inputs
|
2172
3361
|
PTCheckBoxInputModule,
|
@@ -2184,7 +3373,24 @@ class NgPrimeToolsModule {
|
|
2184
3373
|
// Cards
|
2185
3374
|
PTCardModule,
|
2186
3375
|
// Menu
|
2187
|
-
PTMenuModule
|
3376
|
+
PTMenuModule,
|
3377
|
+
PTMenuFancyModule,
|
3378
|
+
// Navbar
|
3379
|
+
PTNavbarMenuModule,
|
3380
|
+
// SideBar
|
3381
|
+
PTSideBarMenuModule,
|
3382
|
+
// Page skeleton
|
3383
|
+
PTPageSkeletonModule,
|
3384
|
+
// Footer
|
3385
|
+
PTFooterModule,
|
3386
|
+
// BreadCrumb
|
3387
|
+
PTBreadCrumbModule,
|
3388
|
+
// Login
|
3389
|
+
PTLoginPageModule,
|
3390
|
+
// Button
|
3391
|
+
PTButtonModule,
|
3392
|
+
// Dialog
|
3393
|
+
PTDialogModule] }); }
|
2188
3394
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
|
2189
3395
|
FormsModule,
|
2190
3396
|
NgAdvancedPrimeTableModule,
|
@@ -2205,7 +3411,24 @@ class NgPrimeToolsModule {
|
|
2205
3411
|
// Cards
|
2206
3412
|
PTCardModule,
|
2207
3413
|
// Menu
|
2208
|
-
PTMenuModule,
|
3414
|
+
PTMenuModule,
|
3415
|
+
PTMenuFancyModule,
|
3416
|
+
// Navbar
|
3417
|
+
PTNavbarMenuModule,
|
3418
|
+
// SideBar
|
3419
|
+
PTSideBarMenuModule,
|
3420
|
+
// Page skeleton
|
3421
|
+
PTPageSkeletonModule,
|
3422
|
+
// Footer
|
3423
|
+
PTFooterModule,
|
3424
|
+
// BreadCrumb
|
3425
|
+
PTBreadCrumbModule,
|
3426
|
+
// Login
|
3427
|
+
PTLoginPageModule,
|
3428
|
+
// Button
|
3429
|
+
PTButtonModule,
|
3430
|
+
// Dialog
|
3431
|
+
PTDialogModule, NgAdvancedPrimeTableModule,
|
2209
3432
|
MultiSearchCriteriaModule,
|
2210
3433
|
// Inputs
|
2211
3434
|
PTCheckBoxInputModule,
|
@@ -2223,7 +3446,24 @@ class NgPrimeToolsModule {
|
|
2223
3446
|
// Cards
|
2224
3447
|
PTCardModule,
|
2225
3448
|
// Menu
|
2226
|
-
PTMenuModule
|
3449
|
+
PTMenuModule,
|
3450
|
+
PTMenuFancyModule,
|
3451
|
+
// Navbar
|
3452
|
+
PTNavbarMenuModule,
|
3453
|
+
// SideBar
|
3454
|
+
PTSideBarMenuModule,
|
3455
|
+
// Page skeleton
|
3456
|
+
PTPageSkeletonModule,
|
3457
|
+
// Footer
|
3458
|
+
PTFooterModule,
|
3459
|
+
// BreadCrumb
|
3460
|
+
PTBreadCrumbModule,
|
3461
|
+
// Login
|
3462
|
+
PTLoginPageModule,
|
3463
|
+
// Button
|
3464
|
+
PTButtonModule,
|
3465
|
+
// Dialog
|
3466
|
+
PTDialogModule] }); }
|
2227
3467
|
}
|
2228
3468
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, decorators: [{
|
2229
3469
|
type: NgModule,
|
@@ -2250,6 +3490,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
2250
3490
|
PTCardModule,
|
2251
3491
|
// Menu
|
2252
3492
|
PTMenuModule,
|
3493
|
+
PTMenuFancyModule,
|
3494
|
+
// Navbar
|
3495
|
+
PTNavbarMenuModule,
|
3496
|
+
// SideBar
|
3497
|
+
PTSideBarMenuModule,
|
3498
|
+
// Page skeleton
|
3499
|
+
PTPageSkeletonModule,
|
3500
|
+
// Footer
|
3501
|
+
PTFooterModule,
|
3502
|
+
// BreadCrumb
|
3503
|
+
PTBreadCrumbModule,
|
3504
|
+
// Login
|
3505
|
+
PTLoginPageModule,
|
3506
|
+
// Button
|
3507
|
+
PTButtonModule,
|
3508
|
+
// Dialog
|
3509
|
+
PTDialogModule,
|
2253
3510
|
],
|
2254
3511
|
exports: [
|
2255
3512
|
NgAdvancedPrimeTableModule,
|
@@ -2271,6 +3528,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
2271
3528
|
PTCardModule,
|
2272
3529
|
// Menu
|
2273
3530
|
PTMenuModule,
|
3531
|
+
PTMenuFancyModule,
|
3532
|
+
// Navbar
|
3533
|
+
PTNavbarMenuModule,
|
3534
|
+
// SideBar
|
3535
|
+
PTSideBarMenuModule,
|
3536
|
+
// Page skeleton
|
3537
|
+
PTPageSkeletonModule,
|
3538
|
+
// Footer
|
3539
|
+
PTFooterModule,
|
3540
|
+
// BreadCrumb
|
3541
|
+
PTBreadCrumbModule,
|
3542
|
+
// Login
|
3543
|
+
PTLoginPageModule,
|
3544
|
+
// Button
|
3545
|
+
PTButtonModule,
|
3546
|
+
// Dialog
|
3547
|
+
PTDialogModule,
|
2274
3548
|
],
|
2275
3549
|
}]
|
2276
3550
|
}] });
|
@@ -2281,5 +3555,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
|
|
2281
3555
|
* Generated bundle index. Do not edit.
|
2282
3556
|
*/
|
2283
3557
|
|
2284
|
-
export { ButtonColorEnum, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgAdvancedPrimeTableComponent, NgAdvancedPrimeTableModule, NgPrimeToolsModule, PTCardComponent, PTCardModule, PTChartComponent, PTChartModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTDateInputComponent, PTDateInputModule, PTDropdownComponent, PTDropdownModule, PTFormBuilderComponent, PTFormBuilderModule, PTMenuComponent, PTMenuModule, PTMetricCardComponent, PTMetricCardGroupComponent, PTMetricCardGroupModule, PTMetricCardModule, PTNumberInputComponent, PTNumberInputModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, SearchCriteriaTypeEnum, TableTypeEnum };
|
3558
|
+
export { BadgeType, BadgeTypeStyles, ButtonColorEnum, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgAdvancedPrimeTableComponent, NgAdvancedPrimeTableModule, NgPrimeToolsModule, PTBreadCrumbComponent, PTBreadCrumbModule, PTButtonComponent, PTButtonModule, PTCardComponent, PTCardModule, PTChartComponent, PTChartModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTDateInputComponent, PTDateInputModule, PTDialogComponent, PTDialogModule, PTDropdownComponent, PTDropdownModule, PTFooterComponent, PTFooterModule, PTFormBuilderComponent, PTFormBuilderModule, PTLoginPageComponent, PTLoginPageModule, PTMenuComponent, PTMenuFancyComponent, PTMenuFancyModule, PTMenuModule, PTMetricCardComponent, PTMetricCardGroupComponent, PTMetricCardGroupModule, PTMetricCardModule, PTNavbarMenuComponent, PTNavbarMenuModule, PTNumberInputComponent, PTNumberInputModule, PTPageSkeletonComponent, PTPageSkeletonModule, PTSideBarMenuComponent, PTSideBarMenuModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, SearchCriteriaTypeEnum, TableTypeEnum };
|
2285
3559
|
//# sourceMappingURL=ng-prime-tools.mjs.map
|