ng-prime-tools 1.0.7 → 1.0.9

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.
Files changed (122) hide show
  1. package/README.md +29 -0
  2. package/esm2022/lib/models/card-config.model.mjs +2 -0
  3. package/esm2022/lib/models/chart-config.model.mjs +2 -0
  4. package/esm2022/lib/models/icon-style.model.mjs +2 -0
  5. package/esm2022/lib/models/index.mjs +1 -5
  6. package/esm2022/lib/models/menu-config.model.mjs +2 -0
  7. package/esm2022/lib/models/menu-item.model.mjs +2 -0
  8. package/esm2022/lib/models/metric-card-data.model.mjs +2 -0
  9. package/esm2022/lib/models/public-api.mjs +14 -1
  10. package/esm2022/lib/models/text-style.model.mjs +2 -0
  11. package/esm2022/lib/models/title-style.model.mjs +2 -0
  12. package/esm2022/lib/multi-search-criteria/index.mjs +2 -6
  13. package/esm2022/lib/multi-search-criteria/public-api.mjs +3 -0
  14. package/esm2022/lib/ng-advanced-prime-table/index.mjs +2 -6
  15. package/esm2022/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.mjs +9 -3
  16. package/esm2022/lib/ng-advanced-prime-table/ng-advanced-prime-table.module.mjs +7 -3
  17. package/esm2022/lib/ng-advanced-prime-table/public-api.mjs +3 -0
  18. package/esm2022/lib/ng-prime-tools.module.mjs +64 -5
  19. package/esm2022/lib/pt-card/index.mjs +2 -0
  20. package/esm2022/lib/pt-card/pt-card.component.mjs +88 -0
  21. package/esm2022/lib/pt-card/pt-card.module.mjs +19 -0
  22. package/esm2022/lib/pt-card/public-api.mjs +3 -0
  23. package/esm2022/lib/pt-chart/index.mjs +2 -0
  24. package/esm2022/lib/pt-chart/pt-chart.component.mjs +61 -0
  25. package/esm2022/lib/pt-chart/pt-chart.module.mjs +18 -0
  26. package/esm2022/lib/pt-chart/public-api.mjs +3 -0
  27. package/esm2022/lib/pt-menu/index.mjs +2 -0
  28. package/esm2022/lib/pt-menu/pt-menu.component.mjs +75 -0
  29. package/esm2022/lib/pt-menu/pt-menu.module.mjs +18 -0
  30. package/esm2022/lib/pt-menu/public-api.mjs +3 -0
  31. package/esm2022/lib/pt-metric-card/index.mjs +2 -0
  32. package/esm2022/lib/pt-metric-card/pt-metric-card.component.mjs +150 -0
  33. package/esm2022/lib/pt-metric-card/pt-metric-card.module.mjs +18 -0
  34. package/esm2022/lib/pt-metric-card/public-api.mjs +3 -0
  35. package/esm2022/lib/pt-metric-card-group/index.mjs +2 -0
  36. package/esm2022/lib/pt-metric-card-group/pt-metric-card-group.component.mjs +18 -0
  37. package/esm2022/lib/pt-metric-card-group/pt-metric-card-group.module.mjs +19 -0
  38. package/esm2022/lib/pt-metric-card-group/public-api.mjs +3 -0
  39. package/esm2022/public-api.mjs +13 -2
  40. package/fesm2022/ng-prime-tools.mjs +523 -30
  41. package/fesm2022/ng-prime-tools.mjs.map +1 -1
  42. package/lib/models/card-config.model.d.ts +13 -0
  43. package/lib/models/card-config.model.d.ts.map +1 -0
  44. package/lib/models/chart-config.model.d.ts +18 -0
  45. package/lib/models/chart-config.model.d.ts.map +1 -0
  46. package/lib/models/icon-style.model.d.ts +7 -0
  47. package/lib/models/icon-style.model.d.ts.map +1 -0
  48. package/lib/models/index.d.ts +0 -4
  49. package/lib/models/index.d.ts.map +1 -1
  50. package/lib/models/menu-config.model.d.ts +9 -0
  51. package/lib/models/menu-config.model.d.ts.map +1 -0
  52. package/lib/models/menu-item.model.d.ts +7 -0
  53. package/lib/models/menu-item.model.d.ts.map +1 -0
  54. package/lib/models/metric-card-data.model.d.ts +35 -0
  55. package/lib/models/metric-card-data.model.d.ts.map +1 -0
  56. package/lib/models/public-api.d.ts +6 -0
  57. package/lib/models/public-api.d.ts.map +1 -1
  58. package/lib/models/text-style.model.d.ts +6 -0
  59. package/lib/models/text-style.model.d.ts.map +1 -0
  60. package/lib/models/title-style.model.d.ts +9 -0
  61. package/lib/models/title-style.model.d.ts.map +1 -0
  62. package/lib/multi-search-criteria/index.d.ts +1 -5
  63. package/lib/multi-search-criteria/index.d.ts.map +1 -1
  64. package/lib/multi-search-criteria/{public_api.d.ts → public-api.d.ts} +1 -1
  65. package/lib/multi-search-criteria/public-api.d.ts.map +1 -0
  66. package/lib/ng-advanced-prime-table/index.d.ts +1 -5
  67. package/lib/ng-advanced-prime-table/index.d.ts.map +1 -1
  68. package/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.d.ts +3 -1
  69. package/lib/ng-advanced-prime-table/ng-advanced-prime-table.component.d.ts.map +1 -1
  70. package/lib/ng-advanced-prime-table/ng-advanced-prime-table.module.d.ts +2 -1
  71. package/lib/ng-advanced-prime-table/ng-advanced-prime-table.module.d.ts.map +1 -1
  72. package/lib/ng-advanced-prime-table/{public_api.d.ts → public-api.d.ts} +1 -1
  73. package/lib/ng-advanced-prime-table/public-api.d.ts.map +1 -0
  74. package/lib/ng-prime-tools.module.d.ts +6 -1
  75. package/lib/ng-prime-tools.module.d.ts.map +1 -1
  76. package/lib/pt-card/index.d.ts +2 -0
  77. package/lib/pt-card/index.d.ts.map +1 -0
  78. package/lib/pt-card/pt-card.component.d.ts +42 -0
  79. package/lib/pt-card/pt-card.component.d.ts.map +1 -0
  80. package/lib/pt-card/pt-card.module.d.ts +10 -0
  81. package/lib/pt-card/pt-card.module.d.ts.map +1 -0
  82. package/lib/pt-card/public-api.d.ts +3 -0
  83. package/lib/pt-card/public-api.d.ts.map +1 -0
  84. package/lib/pt-chart/index.d.ts +2 -0
  85. package/lib/pt-chart/index.d.ts.map +1 -0
  86. package/lib/pt-chart/pt-chart.component.d.ts +15 -0
  87. package/lib/pt-chart/pt-chart.component.d.ts.map +1 -0
  88. package/lib/pt-chart/pt-chart.module.d.ts +9 -0
  89. package/lib/pt-chart/pt-chart.module.d.ts.map +1 -0
  90. package/lib/pt-chart/public-api.d.ts +3 -0
  91. package/lib/pt-chart/public-api.d.ts.map +1 -0
  92. package/lib/pt-menu/index.d.ts +2 -0
  93. package/lib/pt-menu/index.d.ts.map +1 -0
  94. package/lib/pt-menu/pt-menu.component.d.ts +32 -0
  95. package/lib/pt-menu/pt-menu.component.d.ts.map +1 -0
  96. package/lib/pt-menu/pt-menu.module.d.ts +9 -0
  97. package/lib/pt-menu/pt-menu.module.d.ts.map +1 -0
  98. package/lib/pt-menu/public-api.d.ts +3 -0
  99. package/lib/pt-menu/public-api.d.ts.map +1 -0
  100. package/lib/pt-metric-card/index.d.ts +2 -0
  101. package/lib/pt-metric-card/index.d.ts.map +1 -0
  102. package/lib/pt-metric-card/pt-metric-card.component.d.ts +60 -0
  103. package/lib/pt-metric-card/pt-metric-card.component.d.ts.map +1 -0
  104. package/lib/pt-metric-card/pt-metric-card.module.d.ts +9 -0
  105. package/lib/pt-metric-card/pt-metric-card.module.d.ts.map +1 -0
  106. package/lib/pt-metric-card/public-api.d.ts +3 -0
  107. package/lib/pt-metric-card/public-api.d.ts.map +1 -0
  108. package/lib/pt-metric-card-group/index.d.ts +2 -0
  109. package/lib/pt-metric-card-group/index.d.ts.map +1 -0
  110. package/lib/pt-metric-card-group/pt-metric-card-group.component.d.ts +8 -0
  111. package/lib/pt-metric-card-group/pt-metric-card-group.component.d.ts.map +1 -0
  112. package/lib/pt-metric-card-group/pt-metric-card-group.module.d.ts +10 -0
  113. package/lib/pt-metric-card-group/pt-metric-card-group.module.d.ts.map +1 -0
  114. package/lib/pt-metric-card-group/public-api.d.ts +3 -0
  115. package/lib/pt-metric-card-group/public-api.d.ts.map +1 -0
  116. package/package.json +4 -2
  117. package/public-api.d.ts +6 -1
  118. package/public-api.d.ts.map +1 -1
  119. package/esm2022/lib/multi-search-criteria/public_api.mjs +0 -4
  120. package/esm2022/lib/ng-advanced-prime-table/public_api.mjs +0 -4
  121. package/lib/multi-search-criteria/public_api.d.ts.map +0 -1
  122. package/lib/ng-advanced-prime-table/public_api.d.ts.map +0 -1
@@ -1,7 +1,9 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Pipe, EventEmitter, Component, Input, Output, ViewChild, NgModule, Injectable } from '@angular/core';
2
+ import { Pipe, EventEmitter, Component, Input, Output, ViewChild, NgModule, Injectable, HostListener } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
+ import * as i2$1 from '@angular/forms';
6
+ import { FormsModule, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
5
7
  import * as i2 from 'primeng/table';
6
8
  import { TableModule } from 'primeng/table';
7
9
  import * as i3 from 'primeng/api';
@@ -11,8 +13,6 @@ import * as i3$1 from 'primeng/button';
11
13
  import { ButtonModule } from 'primeng/button';
12
14
  import * as i6 from 'primeng/calendar';
13
15
  import { CalendarModule } from 'primeng/calendar';
14
- import * as i2$1 from '@angular/forms';
15
- import { FormsModule, FormControl, Validators, ReactiveFormsModule } from '@angular/forms';
16
16
  import * as i8 from 'primeng/multiselect';
17
17
  import { MultiSelectModule } from 'primeng/multiselect';
18
18
  import * as i9 from 'primeng/tag';
@@ -21,6 +21,7 @@ import * as i10 from 'primeng/iconfield';
21
21
  import { IconFieldModule } from 'primeng/iconfield';
22
22
  import * as i11 from 'primeng/inputicon';
23
23
  import { InputIconModule } from 'primeng/inputicon';
24
+ import { ProgressSpinnerModule } from 'primeng/progressspinner';
24
25
  import * as i8$1 from 'primeng/inputnumber';
25
26
  import { InputNumberModule } from 'primeng/inputnumber';
26
27
  import * as i9$1 from 'primeng/panel';
@@ -37,6 +38,8 @@ import * as i3$5 from 'primeng/inputtextarea';
37
38
  import { InputTextareaModule } from 'primeng/inputtextarea';
38
39
  import * as i3$6 from 'primeng/dropdown';
39
40
  import { DropdownModule } from 'primeng/dropdown';
41
+ import { Chart, registerables } from 'chart.js';
42
+ import ChartDataLabels from 'chartjs-plugin-datalabels';
40
43
 
41
44
  class CustomCurrencyPipe {
42
45
  transform(value, currency, decimalPlaces, thousandSeparator = 'comma', decimalSeparator = 'dot') {
@@ -136,6 +139,8 @@ class NgAdvancedPrimeTableComponent {
136
139
  this.isPaginated = false;
137
140
  this.actions = [];
138
141
  this.isSortable = false;
142
+ this.loading = false;
143
+ this.maxHeight = null;
139
144
  // Outputs: Events emitted to the parent component
140
145
  this.filter = new EventEmitter();
141
146
  this.search = new EventEmitter();
@@ -391,11 +396,11 @@ class NgAdvancedPrimeTableComponent {
391
396
  this.exportPdfEvent.emit();
392
397
  }
393
398
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
394
- 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" }, 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 <div>\n <p-table\n #dt\n [value]=\"data\"\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 >\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 fa-lg\"\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 fa-lg\"\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 fa-lg\"\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>\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 <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 [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\n *ngIf=\"isMultiSelect(col.code); else datePicker\"\n >\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\n *ngIf=\"col.type === 'AMOUNT'; else normalText\"\n >\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</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}.table-container{display:flex;flex-direction:column;gap:.5rem}::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}\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" }] }); }
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" }] }); }
395
400
  }
396
401
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableComponent, decorators: [{
397
402
  type: Component,
398
- args: [{ selector: 'ng-advanced-prime-table', template: "<div class=\"table-container\">\n <div>\n <p-table\n #dt\n [value]=\"data\"\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 >\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 fa-lg\"\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 fa-lg\"\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 fa-lg\"\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>\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 <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 [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\n *ngIf=\"isMultiSelect(col.code); else datePicker\"\n >\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\n *ngIf=\"col.type === 'AMOUNT'; else normalText\"\n >\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</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}.table-container{display:flex;flex-direction:column;gap:.5rem}::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}\n"] }]
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"] }]
399
404
  }], ctorParameters: () => [], propDecorators: { data: [{
400
405
  type: Input
401
406
  }], columns: [{
@@ -418,6 +423,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
418
423
  type: Input
419
424
  }], isSortable: [{
420
425
  type: Input
426
+ }], loading: [{
427
+ type: Input
428
+ }], maxHeight: [{
429
+ type: Input
421
430
  }], filter: [{
422
431
  type: Output
423
432
  }], search: [{
@@ -443,7 +452,8 @@ class NgAdvancedPrimeTableModule {
443
452
  TagModule,
444
453
  CustomCurrencyPipe,
445
454
  IconFieldModule,
446
- InputIconModule], exports: [NgAdvancedPrimeTableComponent] }); }
455
+ InputIconModule,
456
+ ProgressSpinnerModule], exports: [NgAdvancedPrimeTableComponent] }); }
447
457
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableModule, imports: [CommonModule,
448
458
  TableModule,
449
459
  InputTextModule,
@@ -453,7 +463,8 @@ class NgAdvancedPrimeTableModule {
453
463
  MultiSelectModule,
454
464
  TagModule,
455
465
  IconFieldModule,
456
- InputIconModule] }); }
466
+ InputIconModule,
467
+ ProgressSpinnerModule] }); }
457
468
  }
458
469
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgAdvancedPrimeTableModule, decorators: [{
459
470
  type: NgModule,
@@ -471,18 +482,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
471
482
  CustomCurrencyPipe,
472
483
  IconFieldModule,
473
484
  InputIconModule,
485
+ ProgressSpinnerModule,
474
486
  ],
475
487
  exports: [NgAdvancedPrimeTableComponent],
476
488
  }]
477
489
  }] });
478
490
 
479
- // projects/ng-prime-tools/src/lib/ng-advanced-prime-table/index.ts
480
-
481
- /**
482
- * Generated bundle index. Do not edit.
483
- */
484
- /// <amd-module name="ng-prime-tools/multi-search-criteria" />
485
-
486
491
  var TableTypeEnum;
487
492
  (function (TableTypeEnum) {
488
493
  TableTypeEnum["DATE"] = "DATE";
@@ -702,13 +707,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
702
707
  }]
703
708
  }] });
704
709
 
705
- // projects/ng-prime-tools/src/lib/ng-advanced-prime-table/index.ts
706
-
707
- /**
708
- * Generated bundle index. Do not edit.
709
- */
710
- /// <amd-module name="ng-prime-tools/multi-search-criteria" />
711
-
712
710
  class PTCheckBoxInputComponent {
713
711
  ngOnInit() {
714
712
  this.setupControl();
@@ -1702,6 +1700,450 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
1702
1700
  }]
1703
1701
  }] });
1704
1702
 
1703
+ class PTMetricCardComponent {
1704
+ static { this.DEFAULT_ICON_COLOR = '#5a67d8'; }
1705
+ static { this.DEFAULT_ICON_SIZE = '24px'; }
1706
+ static { this.DEFAULT_TITLE_COLOR = '#5a67d8'; }
1707
+ static { this.DEFAULT_TITLE_SIZE = '16px'; }
1708
+ static { this.DEFAULT_VALUE_COLOR = '#2d3748'; }
1709
+ static { this.DEFAULT_VALUE_SIZE = '32px'; }
1710
+ static { this.DEFAULT_LABEL_COLOR = '#718096'; }
1711
+ static { this.DEFAULT_LABEL_SIZE = '14px'; }
1712
+ static { this.DEFAULT_ADDITIONAL_INFO_COLOR = 'gray'; }
1713
+ static { this.DEFAULT_ADDITIONAL_INFO_SIZE = '14px'; }
1714
+ static { this.DEFAULT_BACKGROUND_COLOR = '#fff'; }
1715
+ isIconObject() {
1716
+ return typeof this.cardData.icon === 'object';
1717
+ }
1718
+ isTitleObject() {
1719
+ return typeof this.cardData.title === 'object';
1720
+ }
1721
+ isValueObject() {
1722
+ return typeof this.cardData.value === 'object';
1723
+ }
1724
+ isLabelObject(label) {
1725
+ return typeof label === 'object';
1726
+ }
1727
+ isAdditionalInfoObject() {
1728
+ return typeof this.cardData.additionalInfo === 'object';
1729
+ }
1730
+ getIconText() {
1731
+ return this.isIconObject()
1732
+ ? this.cardData.icon.code
1733
+ : this.cardData.icon;
1734
+ }
1735
+ getTitleText() {
1736
+ return this.isTitleObject()
1737
+ ? this.cardData.title.text
1738
+ : this.cardData.title;
1739
+ }
1740
+ getValueText() {
1741
+ return this.isValueObject()
1742
+ ? this.cardData.value.text
1743
+ : this.cardData.value;
1744
+ }
1745
+ getLabelText() {
1746
+ const label = this.cardData.value?.label;
1747
+ return this.isLabelObject(label)
1748
+ ? label.text
1749
+ : label;
1750
+ }
1751
+ getAdditionalInfoText() {
1752
+ return this.isAdditionalInfoObject()
1753
+ ? this.cardData.additionalInfo.text
1754
+ : this.cardData.additionalInfo;
1755
+ }
1756
+ getIconStyles() {
1757
+ if (this.isIconObject()) {
1758
+ const icon = this.cardData.icon;
1759
+ return {
1760
+ color: icon.color || PTMetricCardComponent.DEFAULT_ICON_COLOR,
1761
+ fontSize: icon.fontSize || PTMetricCardComponent.DEFAULT_ICON_SIZE,
1762
+ };
1763
+ }
1764
+ return {};
1765
+ }
1766
+ getTitleStyles() {
1767
+ if (this.isTitleObject()) {
1768
+ const title = this.cardData.title;
1769
+ return {
1770
+ color: title.color || PTMetricCardComponent.DEFAULT_TITLE_COLOR,
1771
+ fontSize: title.fontSize || PTMetricCardComponent.DEFAULT_TITLE_SIZE,
1772
+ };
1773
+ }
1774
+ return {};
1775
+ }
1776
+ getValueStyles() {
1777
+ if (this.isValueObject()) {
1778
+ const value = this.cardData.value;
1779
+ return {
1780
+ color: value.color || PTMetricCardComponent.DEFAULT_VALUE_COLOR,
1781
+ fontSize: value.fontSize || PTMetricCardComponent.DEFAULT_VALUE_SIZE,
1782
+ };
1783
+ }
1784
+ else {
1785
+ return {
1786
+ color: PTMetricCardComponent.DEFAULT_VALUE_COLOR,
1787
+ fontSize: PTMetricCardComponent.DEFAULT_VALUE_SIZE,
1788
+ };
1789
+ }
1790
+ }
1791
+ getLabelStyles(position) {
1792
+ const label = this.cardData.value?.label;
1793
+ if (this.isLabelObject(label) &&
1794
+ label.position === position) {
1795
+ return {
1796
+ color: label.color ||
1797
+ PTMetricCardComponent.DEFAULT_LABEL_COLOR,
1798
+ fontSize: label.fontSize ||
1799
+ PTMetricCardComponent.DEFAULT_LABEL_SIZE,
1800
+ };
1801
+ }
1802
+ else {
1803
+ return {
1804
+ color: PTMetricCardComponent.DEFAULT_LABEL_COLOR,
1805
+ fontSize: PTMetricCardComponent.DEFAULT_LABEL_SIZE,
1806
+ };
1807
+ }
1808
+ }
1809
+ getAdditionalInfoStyles() {
1810
+ if (this.isAdditionalInfoObject()) {
1811
+ const additionalInfo = this.cardData.additionalInfo;
1812
+ return {
1813
+ color: additionalInfo.color ||
1814
+ PTMetricCardComponent.DEFAULT_ADDITIONAL_INFO_COLOR,
1815
+ fontSize: additionalInfo.fontSize ||
1816
+ PTMetricCardComponent.DEFAULT_ADDITIONAL_INFO_SIZE,
1817
+ };
1818
+ }
1819
+ else {
1820
+ return {
1821
+ color: PTMetricCardComponent.DEFAULT_ADDITIONAL_INFO_COLOR,
1822
+ fontSize: PTMetricCardComponent.DEFAULT_ADDITIONAL_INFO_SIZE,
1823
+ };
1824
+ }
1825
+ }
1826
+ isLabelOnLeft() {
1827
+ const label = this.cardData.value?.label;
1828
+ return (this.isLabelObject(label) && label.position === 'left');
1829
+ }
1830
+ isLabelOnRight() {
1831
+ const label = this.cardData.value?.label;
1832
+ return (this.isLabelObject(label) && label.position === 'right');
1833
+ }
1834
+ getBackgroundStyle() {
1835
+ return {
1836
+ 'background-color': this.cardData.appearance?.backgroundColor ||
1837
+ PTMetricCardComponent.DEFAULT_BACKGROUND_COLOR,
1838
+ };
1839
+ }
1840
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1841
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMetricCardComponent, selector: "pt-metric-card", inputs: { cardData: "cardData" }, ngImport: i0, template: "<div\n class=\"metric-card-container\"\n [ngStyle]=\"{\n 'min-width': cardData.size?.minWidth || '100%',\n 'max-width': cardData.size?.maxWidth || 'calc(25% - 16px)',\n width: cardData.size?.fixedWidth || 'auto'\n }\"\n>\n <div\n *ngIf=\"cardData.verticalLine?.show\"\n class=\"vertical-line\"\n [ngStyle]=\"{\n 'background-color': cardData.verticalLine?.color || '#5a67d8'\n }\"\n ></div>\n\n <div class=\"metric-card\" [ngStyle]=\"getBackgroundStyle()\">\n <div class=\"metric-card-header\">\n <i\n *ngIf=\"isIconObject()\"\n [ngClass]=\"getIconText()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <i *ngIf=\"!isIconObject()\" [ngClass]=\"cardData.icon\"></i>\n\n <span\n *ngIf=\"isTitleObject()\"\n class=\"metric-card-header-text\"\n [ngStyle]=\"getTitleStyles()\"\n >\n {{ getTitleText() }}\n </span>\n <span *ngIf=\"!isTitleObject()\" class=\"metric-card-header-text\">\n {{ cardData.title }}\n </span>\n </div>\n\n <div class=\"metric-card-content\">\n <div class=\"metric-value\" [ngStyle]=\"getValueStyles()\">\n <span\n *ngIf=\"isLabelOnLeft()\"\n class=\"value-label\"\n [ngStyle]=\"getLabelStyles('left')\"\n >\n {{ getLabelText() }}\n </span>\n\n <span [ngStyle]=\"getValueStyles()\">{{ getValueText() }}</span>\n\n <span\n *ngIf=\"isLabelOnRight()\"\n class=\"value-label\"\n [ngStyle]=\"getLabelStyles('right')\"\n >\n {{ getLabelText() }}\n </span>\n </div>\n\n <div\n *ngIf=\"cardData.divider?.show\"\n class=\"metric-divider\"\n [ngStyle]=\"{ backgroundColor: cardData.divider?.color || '#e2e8f0' }\"\n ></div>\n\n <div\n *ngIf=\"isAdditionalInfoObject()\"\n class=\"metric-additional-info\"\n [ngStyle]=\"getAdditionalInfoStyles()\"\n >\n {{ getAdditionalInfoText() }}\n </div>\n <div\n *ngIf=\"!isAdditionalInfoObject()\"\n class=\"metric-additional-info\"\n [ngStyle]=\"getAdditionalInfoStyles()\"\n >\n {{ cardData.additionalInfo }}\n </div>\n </div>\n </div>\n</div>\n", styles: [".metric-card-container{display:flex;align-items:stretch;box-sizing:border-box}.vertical-line{width:4px;border-radius:8px 0 0 8px;margin-right:-4px;z-index:2}.metric-card{background-color:#fff;border-radius:5px;box-shadow:0 1px 3px #0000001a;padding:16px;display:flex;flex-direction:column;box-sizing:border-box;margin-left:0}.metric-card-header{display:flex;align-items:center;margin-bottom:16px}.metric-card-header i.icon-text{margin-right:8px}.metric-card-content{display:flex;flex-direction:column;justify-content:space-between}.metric-number{font-weight:700}.metric-label{margin-left:8px}.metric-divider{width:100%;height:1px;margin:16px 0}.metric-additional-info{margin-top:8px}.metric-card-header-text{margin-left:6px}\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"] }] }); }
1842
+ }
1843
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardComponent, decorators: [{
1844
+ type: Component,
1845
+ args: [{ selector: 'pt-metric-card', template: "<div\n class=\"metric-card-container\"\n [ngStyle]=\"{\n 'min-width': cardData.size?.minWidth || '100%',\n 'max-width': cardData.size?.maxWidth || 'calc(25% - 16px)',\n width: cardData.size?.fixedWidth || 'auto'\n }\"\n>\n <div\n *ngIf=\"cardData.verticalLine?.show\"\n class=\"vertical-line\"\n [ngStyle]=\"{\n 'background-color': cardData.verticalLine?.color || '#5a67d8'\n }\"\n ></div>\n\n <div class=\"metric-card\" [ngStyle]=\"getBackgroundStyle()\">\n <div class=\"metric-card-header\">\n <i\n *ngIf=\"isIconObject()\"\n [ngClass]=\"getIconText()\"\n [ngStyle]=\"getIconStyles()\"\n ></i>\n <i *ngIf=\"!isIconObject()\" [ngClass]=\"cardData.icon\"></i>\n\n <span\n *ngIf=\"isTitleObject()\"\n class=\"metric-card-header-text\"\n [ngStyle]=\"getTitleStyles()\"\n >\n {{ getTitleText() }}\n </span>\n <span *ngIf=\"!isTitleObject()\" class=\"metric-card-header-text\">\n {{ cardData.title }}\n </span>\n </div>\n\n <div class=\"metric-card-content\">\n <div class=\"metric-value\" [ngStyle]=\"getValueStyles()\">\n <span\n *ngIf=\"isLabelOnLeft()\"\n class=\"value-label\"\n [ngStyle]=\"getLabelStyles('left')\"\n >\n {{ getLabelText() }}\n </span>\n\n <span [ngStyle]=\"getValueStyles()\">{{ getValueText() }}</span>\n\n <span\n *ngIf=\"isLabelOnRight()\"\n class=\"value-label\"\n [ngStyle]=\"getLabelStyles('right')\"\n >\n {{ getLabelText() }}\n </span>\n </div>\n\n <div\n *ngIf=\"cardData.divider?.show\"\n class=\"metric-divider\"\n [ngStyle]=\"{ backgroundColor: cardData.divider?.color || '#e2e8f0' }\"\n ></div>\n\n <div\n *ngIf=\"isAdditionalInfoObject()\"\n class=\"metric-additional-info\"\n [ngStyle]=\"getAdditionalInfoStyles()\"\n >\n {{ getAdditionalInfoText() }}\n </div>\n <div\n *ngIf=\"!isAdditionalInfoObject()\"\n class=\"metric-additional-info\"\n [ngStyle]=\"getAdditionalInfoStyles()\"\n >\n {{ cardData.additionalInfo }}\n </div>\n </div>\n </div>\n</div>\n", styles: [".metric-card-container{display:flex;align-items:stretch;box-sizing:border-box}.vertical-line{width:4px;border-radius:8px 0 0 8px;margin-right:-4px;z-index:2}.metric-card{background-color:#fff;border-radius:5px;box-shadow:0 1px 3px #0000001a;padding:16px;display:flex;flex-direction:column;box-sizing:border-box;margin-left:0}.metric-card-header{display:flex;align-items:center;margin-bottom:16px}.metric-card-header i.icon-text{margin-right:8px}.metric-card-content{display:flex;flex-direction:column;justify-content:space-between}.metric-number{font-weight:700}.metric-label{margin-left:8px}.metric-divider{width:100%;height:1px;margin:16px 0}.metric-additional-info{margin-top:8px}.metric-card-header-text{margin-left:6px}\n"] }]
1846
+ }], propDecorators: { cardData: [{
1847
+ type: Input
1848
+ }] } });
1849
+
1850
+ class PTMetricCardModule {
1851
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1852
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardModule, declarations: [PTMetricCardComponent], imports: [CommonModule], exports: [PTMetricCardComponent] }); }
1853
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardModule, imports: [CommonModule] }); }
1854
+ }
1855
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardModule, decorators: [{
1856
+ type: NgModule,
1857
+ args: [{
1858
+ declarations: [PTMetricCardComponent],
1859
+ imports: [CommonModule],
1860
+ exports: [PTMetricCardComponent],
1861
+ }]
1862
+ }] });
1863
+
1864
+ class PTMetricCardGroupComponent {
1865
+ constructor() {
1866
+ this.cardsData = [];
1867
+ }
1868
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1869
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTMetricCardGroupComponent, selector: "pt-metric-card-group", inputs: { cardsData: "cardsData" }, ngImport: i0, template: "<div class=\"metric-card-group\">\n <pt-metric-card\n *ngFor=\"let card of cardsData\"\n [cardData]=\"card\"\n ></pt-metric-card>\n</div>\n", styles: [".metric-card-group{display:flex;gap:16px;flex-wrap:wrap;width:100%}.metric-card{flex:0 1 auto;max-width:250px}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: PTMetricCardComponent, selector: "pt-metric-card", inputs: ["cardData"] }] }); }
1870
+ }
1871
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupComponent, decorators: [{
1872
+ type: Component,
1873
+ args: [{ selector: 'pt-metric-card-group', template: "<div class=\"metric-card-group\">\n <pt-metric-card\n *ngFor=\"let card of cardsData\"\n [cardData]=\"card\"\n ></pt-metric-card>\n</div>\n", styles: [".metric-card-group{display:flex;gap:16px;flex-wrap:wrap;width:100%}.metric-card{flex:0 1 auto;max-width:250px}\n"] }]
1874
+ }], propDecorators: { cardsData: [{
1875
+ type: Input
1876
+ }] } });
1877
+
1878
+ class PTMetricCardGroupModule {
1879
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1880
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupModule, declarations: [PTMetricCardGroupComponent], imports: [CommonModule, PTMetricCardModule], exports: [PTMetricCardGroupComponent] }); }
1881
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupModule, imports: [CommonModule, PTMetricCardModule] }); }
1882
+ }
1883
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMetricCardGroupModule, decorators: [{
1884
+ type: NgModule,
1885
+ args: [{
1886
+ declarations: [PTMetricCardGroupComponent],
1887
+ imports: [CommonModule, PTMetricCardModule],
1888
+ exports: [PTMetricCardGroupComponent],
1889
+ }]
1890
+ }] });
1891
+
1892
+ class PTChartComponent {
1893
+ constructor() {
1894
+ Chart.register(...registerables, ChartDataLabels);
1895
+ }
1896
+ ngOnInit() {
1897
+ this.initializeChart();
1898
+ }
1899
+ ngOnDestroy() {
1900
+ if (this.chart) {
1901
+ this.chart.destroy();
1902
+ }
1903
+ }
1904
+ initializeChart() {
1905
+ const canvas = document.querySelector('canvas');
1906
+ const config = {
1907
+ type: this.chartConfig.type,
1908
+ data: this.chartConfig.data,
1909
+ options: {
1910
+ ...this.chartConfig.options,
1911
+ plugins: {
1912
+ datalabels: {
1913
+ formatter: (value, context) => {
1914
+ const data = context.chart.data.datasets[0].data;
1915
+ const total = data.reduce((sum, val) => sum + val, 0);
1916
+ const percentage = ((value / total) * 100).toFixed(1) + '%';
1917
+ return percentage;
1918
+ },
1919
+ color: '#000', // Color of the percentage text
1920
+ font: {
1921
+ weight: 'bold',
1922
+ },
1923
+ },
1924
+ ...this.chartConfig.options?.plugins,
1925
+ },
1926
+ },
1927
+ };
1928
+ this.chart = new Chart(canvas, config);
1929
+ }
1930
+ updateChart() {
1931
+ if (this.chart) {
1932
+ this.chart.data = this.chartConfig.data;
1933
+ if (this.chartConfig.options) {
1934
+ this.chart.options = this.chartConfig.options;
1935
+ }
1936
+ this.chart.update();
1937
+ }
1938
+ }
1939
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1940
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.11", type: PTChartComponent, selector: "pt-chart", inputs: { chartConfig: "chartConfig" }, ngImport: i0, template: "<div style=\"position: relative; height: 100%; width: 100%\">\n <canvas></canvas>\n</div>\n", styles: [""] }); }
1941
+ }
1942
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTChartComponent, decorators: [{
1943
+ type: Component,
1944
+ args: [{ selector: 'pt-chart', template: "<div style=\"position: relative; height: 100%; width: 100%\">\n <canvas></canvas>\n</div>\n" }]
1945
+ }], ctorParameters: () => [], propDecorators: { chartConfig: [{
1946
+ type: Input
1947
+ }] } });
1948
+
1949
+ class PTChartModule {
1950
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTChartModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1951
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTChartModule, declarations: [PTChartComponent], imports: [CommonModule], exports: [PTChartComponent] }); }
1952
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTChartModule, imports: [CommonModule] }); }
1953
+ }
1954
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTChartModule, decorators: [{
1955
+ type: NgModule,
1956
+ args: [{
1957
+ declarations: [PTChartComponent],
1958
+ imports: [CommonModule],
1959
+ exports: [PTChartComponent],
1960
+ }]
1961
+ }] });
1962
+
1963
+ class PTMenuComponent {
1964
+ constructor() {
1965
+ this.config = {
1966
+ icon: { code: 'pi pi-ellipsis-v', color: '#000', fontSize: '15px' },
1967
+ };
1968
+ this.isOpen = false;
1969
+ }
1970
+ static { this.DEFAULT_TEXT_COLOR = '#000'; }
1971
+ static { this.DEFAULT_TEXT_FONT_SIZE = '15px'; }
1972
+ static { this.DEFAULT_ICON_COLOR = '#000'; }
1973
+ static { this.DEFAULT_ICON_FONT_SIZE = '15px'; }
1974
+ static { this.DEFAULT_ICON_CODE = 'pi pi-ellipsis-v'; }
1975
+ toggleMenu() {
1976
+ this.isOpen = !this.isOpen;
1977
+ }
1978
+ closeMenu() {
1979
+ this.isOpen = false;
1980
+ }
1981
+ getMenuItemIconClass(item) {
1982
+ return typeof item.icon === 'string' ? item.icon : item.icon?.code || '';
1983
+ }
1984
+ getMenuItemIconStyles(item) {
1985
+ if (typeof item.icon !== 'string') {
1986
+ return {
1987
+ color: item.icon?.color || PTMenuComponent.DEFAULT_ICON_COLOR,
1988
+ fontSize: item.icon?.fontSize || PTMenuComponent.DEFAULT_ICON_FONT_SIZE,
1989
+ };
1990
+ }
1991
+ return {
1992
+ color: PTMenuComponent.DEFAULT_ICON_COLOR,
1993
+ fontSize: PTMenuComponent.DEFAULT_ICON_FONT_SIZE,
1994
+ };
1995
+ }
1996
+ getIconClass() {
1997
+ return this.config.icon?.code || PTMenuComponent.DEFAULT_ICON_CODE;
1998
+ }
1999
+ getIconStyles() {
2000
+ return {
2001
+ color: this.config.color ||
2002
+ this.config.icon?.color ||
2003
+ PTMenuComponent.DEFAULT_ICON_COLOR,
2004
+ fontSize: this.config.fontSize ||
2005
+ this.config.icon?.fontSize ||
2006
+ PTMenuComponent.DEFAULT_ICON_FONT_SIZE,
2007
+ };
2008
+ }
2009
+ getTextStyles(item) {
2010
+ return {
2011
+ color: item.color || PTMenuComponent.DEFAULT_TEXT_COLOR,
2012
+ fontSize: item.fontSize || PTMenuComponent.DEFAULT_TEXT_FONT_SIZE,
2013
+ };
2014
+ }
2015
+ // Listen to all clicks on the document
2016
+ onDocumentClick(event) {
2017
+ const clickedInside = event.target.closest('.menu-container');
2018
+ if (!clickedInside) {
2019
+ this.closeMenu();
2020
+ }
2021
+ }
2022
+ 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 class=\"menu-container\" [ngClass]=\"{ open: isOpen }\">\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: [".menu-container{position:relative;display:inline-block}.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}.menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.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}.menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.menu-item i{margin-right:10px}.menu-item:hover{background-color:#f1f1f1}.menu-container.open .menu-dropdown{display:block}\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
+ }
2025
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuComponent, decorators: [{
2026
+ type: Component,
2027
+ args: [{ selector: 'pt-menu', template: "<div class=\"menu-container\" [ngClass]=\"{ open: isOpen }\">\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: [".menu-container{position:relative;display:inline-block}.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}.menu-icon:hover{background-color:#5959591a;box-shadow:0 0 0 1px #5959591a}.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}.menu-item{padding:8px 16px;cursor:pointer;display:flex;align-items:center}.menu-item i{margin-right:10px}.menu-item:hover{background-color:#f1f1f1}.menu-container.open .menu-dropdown{display:block}\n"] }]
2028
+ }], propDecorators: { config: [{
2029
+ type: Input
2030
+ }], onDocumentClick: [{
2031
+ type: HostListener,
2032
+ args: ['document:click', ['$event']]
2033
+ }] } });
2034
+
2035
+ class PTCardComponent {
2036
+ constructor() {
2037
+ this.config = {};
2038
+ }
2039
+ static { this.DEFAULT_TITLE_COLOR = '#333'; }
2040
+ static { this.DEFAULT_TITLE_FONT_SIZE = '1.5em'; }
2041
+ static { this.DEFAULT_ICON_COLOR = '#333'; }
2042
+ static { this.DEFAULT_ICON_FONT_SIZE = '1em'; }
2043
+ static { this.DEFAULT_ICON_POSITION = 'left'; }
2044
+ static { this.DEFAULT_BACKGROUND_COLOR = '#fff'; }
2045
+ static { this.DEFAULT_WIDTH = '100%'; }
2046
+ static { this.DEFAULT_HEIGHT = 'auto'; }
2047
+ static { this.DEFAULT_TITLE_POSITION = 'left'; }
2048
+ static { this.DEFAULT_MENU_POSITION = 'right'; }
2049
+ static { this.DEFAULT_BORDER_COLOR = '#ddd'; }
2050
+ static { this.DEFAULT_BORDER_WIDTH = '1px'; }
2051
+ isTitleObject() {
2052
+ return typeof this.config.title === 'object';
2053
+ }
2054
+ getTitleText() {
2055
+ return this.isTitleObject()
2056
+ ? this.config.title.text
2057
+ : this.config.title;
2058
+ }
2059
+ getTitleStyles() {
2060
+ const title = this.config.title;
2061
+ const alignMap = {
2062
+ left: 'flex-start',
2063
+ center: 'center',
2064
+ right: 'flex-end',
2065
+ };
2066
+ return {
2067
+ color: title?.color || PTCardComponent.DEFAULT_TITLE_COLOR,
2068
+ fontSize: title?.fontSize || PTCardComponent.DEFAULT_TITLE_FONT_SIZE,
2069
+ '--text-align': alignMap[title?.position || PTCardComponent.DEFAULT_TITLE_POSITION],
2070
+ };
2071
+ }
2072
+ getIconClass() {
2073
+ const icon = this.config.title?.icon;
2074
+ return typeof icon === 'string' ? icon : icon?.code || null;
2075
+ }
2076
+ getIconStyles() {
2077
+ const icon = this.config.title?.icon;
2078
+ if (typeof icon !== 'string') {
2079
+ return {
2080
+ color: icon?.color || PTCardComponent.DEFAULT_ICON_COLOR,
2081
+ fontSize: icon?.fontSize || PTCardComponent.DEFAULT_ICON_FONT_SIZE,
2082
+ };
2083
+ }
2084
+ return {
2085
+ color: PTCardComponent.DEFAULT_ICON_COLOR,
2086
+ fontSize: PTCardComponent.DEFAULT_ICON_FONT_SIZE,
2087
+ };
2088
+ }
2089
+ getIconPosition() {
2090
+ const icon = this.config.title?.icon;
2091
+ if (typeof icon !== 'string' && icon?.position) {
2092
+ return icon.position;
2093
+ }
2094
+ return PTCardComponent.DEFAULT_ICON_POSITION;
2095
+ }
2096
+ getMenuPosition() {
2097
+ return this.config.menuPosition || PTCardComponent.DEFAULT_MENU_POSITION;
2098
+ }
2099
+ getCardStyles() {
2100
+ return {
2101
+ backgroundColor: this.config.backgroundColor || PTCardComponent.DEFAULT_BACKGROUND_COLOR,
2102
+ width: this.config.width || PTCardComponent.DEFAULT_WIDTH,
2103
+ height: this.config.height || PTCardComponent.DEFAULT_HEIGHT,
2104
+ borderColor: this.config.borderColor || PTCardComponent.DEFAULT_BORDER_COLOR,
2105
+ borderWidth: this.config.borderWidth || PTCardComponent.DEFAULT_BORDER_WIDTH,
2106
+ borderStyle: 'solid',
2107
+ };
2108
+ }
2109
+ 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 class=\"card-body\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".card{border-radius:8px;box-shadow:0 2px 4px #0000001a;padding:16px;margin:16px 0;display:flex;flex-direction:column}.card-body{flex-grow:1}.card-header-icon-left{margin-right:6px}.card-header{margin-bottom:16px;display:flex;align-items:center;justify-content:var(--text-align, left);position:relative}.card-header-icon-right{margin-left:6px}.menu-left{position:absolute;left:0;top:0}.menu-right{position:absolute;right:0;top:-2px}.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
+ }
2112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardComponent, decorators: [{
2113
+ 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 class=\"card-body\">\n <ng-content></ng-content>\n </div>\n</div>\n", styles: [".card{border-radius:8px;box-shadow:0 2px 4px #0000001a;padding:16px;margin:16px 0;display:flex;flex-direction:column}.card-body{flex-grow:1}.card-header-icon-left{margin-right:6px}.card-header{margin-bottom:16px;display:flex;align-items:center;justify-content:var(--text-align, left);position:relative}.card-header-icon-right{margin-left:6px}.menu-left{position:absolute;left:0;top:0}.menu-right{position:absolute;right:0;top:-2px}.card-menu{margin-left:auto;cursor:pointer}\n"] }]
2115
+ }], propDecorators: { config: [{
2116
+ type: Input
2117
+ }] } });
2118
+
2119
+ class PTMenuModule {
2120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2121
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTMenuModule, declarations: [PTMenuComponent], imports: [CommonModule], exports: [PTMenuComponent] }); }
2122
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuModule, imports: [CommonModule] }); }
2123
+ }
2124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTMenuModule, decorators: [{
2125
+ type: NgModule,
2126
+ args: [{
2127
+ declarations: [PTMenuComponent],
2128
+ imports: [CommonModule],
2129
+ exports: [PTMenuComponent],
2130
+ }]
2131
+ }] });
2132
+
2133
+ class PTCardModule {
2134
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2135
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: PTCardModule, declarations: [PTCardComponent], imports: [CommonModule, PTMenuModule], exports: [PTCardComponent] }); }
2136
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardModule, imports: [CommonModule, PTMenuModule] }); }
2137
+ }
2138
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: PTCardModule, decorators: [{
2139
+ type: NgModule,
2140
+ args: [{
2141
+ declarations: [PTCardComponent],
2142
+ imports: [CommonModule, PTMenuModule],
2143
+ exports: [PTCardComponent],
2144
+ }]
2145
+ }] });
2146
+
1705
2147
  class NgPrimeToolsModule {
1706
2148
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1707
2149
  static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
@@ -1715,7 +2157,16 @@ class NgPrimeToolsModule {
1715
2157
  PTNumberInputModule,
1716
2158
  PTSwitchInputModule,
1717
2159
  PTTextAreaInputModule,
1718
- PTTextInputModule], exports: [NgAdvancedPrimeTableModule,
2160
+ PTTextInputModule,
2161
+ // Dashboard
2162
+ PTMetricCardModule,
2163
+ PTMetricCardGroupModule,
2164
+ // Chart
2165
+ PTChartModule,
2166
+ // Cards
2167
+ PTCardModule,
2168
+ // Menu
2169
+ PTMenuModule], exports: [NgAdvancedPrimeTableModule,
1719
2170
  MultiSearchCriteriaModule,
1720
2171
  // Inputs
1721
2172
  PTCheckBoxInputModule,
@@ -1724,7 +2175,16 @@ class NgPrimeToolsModule {
1724
2175
  PTNumberInputModule,
1725
2176
  PTSwitchInputModule,
1726
2177
  PTTextAreaInputModule,
1727
- PTTextInputModule] }); }
2178
+ PTTextInputModule,
2179
+ // Dashboard
2180
+ PTMetricCardModule,
2181
+ PTMetricCardGroupModule,
2182
+ // Chart
2183
+ PTChartModule,
2184
+ // Cards
2185
+ PTCardModule,
2186
+ // Menu
2187
+ PTMenuModule] }); }
1728
2188
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, imports: [CommonModule,
1729
2189
  FormsModule,
1730
2190
  NgAdvancedPrimeTableModule,
@@ -1736,7 +2196,16 @@ class NgPrimeToolsModule {
1736
2196
  PTNumberInputModule,
1737
2197
  PTSwitchInputModule,
1738
2198
  PTTextAreaInputModule,
1739
- PTTextInputModule, NgAdvancedPrimeTableModule,
2199
+ PTTextInputModule,
2200
+ // Dashboard
2201
+ PTMetricCardModule,
2202
+ PTMetricCardGroupModule,
2203
+ // Chart
2204
+ PTChartModule,
2205
+ // Cards
2206
+ PTCardModule,
2207
+ // Menu
2208
+ PTMenuModule, NgAdvancedPrimeTableModule,
1740
2209
  MultiSearchCriteriaModule,
1741
2210
  // Inputs
1742
2211
  PTCheckBoxInputModule,
@@ -1745,7 +2214,16 @@ class NgPrimeToolsModule {
1745
2214
  PTNumberInputModule,
1746
2215
  PTSwitchInputModule,
1747
2216
  PTTextAreaInputModule,
1748
- PTTextInputModule] }); }
2217
+ PTTextInputModule,
2218
+ // Dashboard
2219
+ PTMetricCardModule,
2220
+ PTMetricCardGroupModule,
2221
+ // Chart
2222
+ PTChartModule,
2223
+ // Cards
2224
+ PTCardModule,
2225
+ // Menu
2226
+ PTMenuModule] }); }
1749
2227
  }
1750
2228
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImport: i0, type: NgPrimeToolsModule, decorators: [{
1751
2229
  type: NgModule,
@@ -1763,6 +2241,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
1763
2241
  PTSwitchInputModule,
1764
2242
  PTTextAreaInputModule,
1765
2243
  PTTextInputModule,
2244
+ // Dashboard
2245
+ PTMetricCardModule,
2246
+ PTMetricCardGroupModule,
2247
+ // Chart
2248
+ PTChartModule,
2249
+ // Cards
2250
+ PTCardModule,
2251
+ // Menu
2252
+ PTMenuModule,
1766
2253
  ],
1767
2254
  exports: [
1768
2255
  NgAdvancedPrimeTableModule,
@@ -1775,18 +2262,24 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.11", ngImpo
1775
2262
  PTSwitchInputModule,
1776
2263
  PTTextAreaInputModule,
1777
2264
  PTTextInputModule,
2265
+ // Dashboard
2266
+ PTMetricCardModule,
2267
+ PTMetricCardGroupModule,
2268
+ // Chart
2269
+ PTChartModule,
2270
+ // Cards
2271
+ PTCardModule,
2272
+ // Menu
2273
+ PTMenuModule,
1778
2274
  ],
1779
2275
  }]
1780
2276
  }] });
1781
2277
 
1782
- /**
1783
- * Generated bundle index. Do not edit.
1784
- */
1785
- /// <amd-module name="ng-prime-tools/models" />
2278
+ // Advanced table
1786
2279
 
1787
2280
  /**
1788
2281
  * Generated bundle index. Do not edit.
1789
2282
  */
1790
2283
 
1791
- export { ButtonColorEnum, FormInputTypeEnum, InputValidationEnum, MultiSearchCriteriaComponent, MultiSearchCriteriaModule, NgAdvancedPrimeTableComponent, NgAdvancedPrimeTableModule, NgPrimeToolsModule, PTCheckBoxInputComponent, PTCheckBoxInputModule, PTDateInputComponent, PTDateInputModule, PTDropdownComponent, PTDropdownModule, PTFormBuilderComponent, PTFormBuilderModule, PTNumberInputComponent, PTNumberInputModule, PTSwitchInputComponent, PTSwitchInputModule, PTTextAreaInputComponent, PTTextAreaInputModule, PTTextInputComponent, PTTextInputModule, SearchCriteriaTypeEnum, TableTypeEnum };
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 };
1792
2285
  //# sourceMappingURL=ng-prime-tools.mjs.map