@eternalcodestudio/primeng-table 19.0.0

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 (42) hide show
  1. package/fesm2022/ecs-primeng-table.mjs +1745 -0
  2. package/fesm2022/ecs-primeng-table.mjs.map +1 -0
  3. package/fesm2022/eternalcodestudio-primeng-table.mjs +1745 -0
  4. package/fesm2022/eternalcodestudio-primeng-table.mjs.map +1 -0
  5. package/index.d.ts +5 -0
  6. package/lib/components/column-selector/column-selector.d.ts +36 -0
  7. package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +203 -0
  8. package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +48 -0
  9. package/lib/components/export-excel/export-excel.d.ts +39 -0
  10. package/lib/components/export-excel/export-excel.service.d.ts +6 -0
  11. package/lib/components/table-button/table-button.d.ts +16 -0
  12. package/lib/components/table-cell/table-cell.d.ts +52 -0
  13. package/lib/components/table-predifined-filters/table-predifined-filters.d.ts +30 -0
  14. package/lib/components/views-management/views-management.d.ts +32 -0
  15. package/lib/enums/cell-overflow-behaviour.enum.d.ts +4 -0
  16. package/lib/enums/data-align-horizontal.enum.d.ts +5 -0
  17. package/lib/enums/data-align-vertical.enum.d.ts +5 -0
  18. package/lib/enums/data-type.enum.enum.d.ts +6 -0
  19. package/lib/enums/frozen-column-align.enum.d.ts +5 -0
  20. package/lib/enums/index.d.ts +6 -0
  21. package/lib/enums/table-view-save-mode.enum.d.ts +6 -0
  22. package/lib/interfaces/columns-metadata.interface.d.ts +25 -0
  23. package/lib/interfaces/excel-export-request.interface.d.ts +7 -0
  24. package/lib/interfaces/index.d.ts +9 -0
  25. package/lib/interfaces/predifined-filter.interface.d.ts +34 -0
  26. package/lib/interfaces/table-button.interface.d.ts +29 -0
  27. package/lib/interfaces/table-configuration.interface.d.ts +8 -0
  28. package/lib/interfaces/table-paged-response.interface.d.ts +13 -0
  29. package/lib/interfaces/table-query-request.interface.d.ts +20 -0
  30. package/lib/interfaces/table-view-data.interface.d.ts +12 -0
  31. package/lib/interfaces/table-view.interface.d.ts +6 -0
  32. package/lib/services/http.service.d.ts +9 -0
  33. package/lib/services/index.d.ts +2 -0
  34. package/lib/services/notification.service.d.ts +7 -0
  35. package/lib/utils/data-align-horizontal-as-text.d.ts +2 -0
  36. package/lib/utils/data-align-vertical-as-text.d.ts +2 -0
  37. package/lib/utils/data-type-as-text.d.ts +2 -0
  38. package/lib/utils/frozen-column-align-as-text.d.ts +2 -0
  39. package/lib/utils/highlight-text.d.ts +24 -0
  40. package/lib/utils/index.d.ts +5 -0
  41. package/package.json +49 -0
  42. package/public-api.d.ts +5 -0
@@ -0,0 +1,1745 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Input, Component, Injectable, EventEmitter, Output, ViewChild, ViewEncapsulation } from '@angular/core';
3
+ import * as i1$1 from '@angular/common';
4
+ import { CommonModule } from '@angular/common';
5
+ import * as i8$1 from '@angular/forms';
6
+ import { FormsModule } from '@angular/forms';
7
+ import * as i5$1 from 'primeng/table';
8
+ import { TableModule } from 'primeng/table';
9
+ import * as i5 from 'primeng/button';
10
+ import { ButtonModule } from 'primeng/button';
11
+ import * as i8 from 'primeng/tooltip';
12
+ import { TooltipModule } from 'primeng/tooltip';
13
+ import * as i11 from 'primeng/inputtext';
14
+ import { InputTextModule } from 'primeng/inputtext';
15
+ import * as i10 from 'primeng/iconfield';
16
+ import { IconFieldModule } from 'primeng/iconfield';
17
+ import * as i9 from 'primeng/inputicon';
18
+ import { InputIconModule } from 'primeng/inputicon';
19
+ import * as i12 from 'primeng/multiselect';
20
+ import { MultiSelectModule } from 'primeng/multiselect';
21
+ import * as i4$1 from 'primeng/checkbox';
22
+ import { CheckboxModule } from 'primeng/checkbox';
23
+ import { PaginatorModule } from 'primeng/paginator';
24
+ import * as i14 from 'primeng/buttongroup';
25
+ import { ButtonGroupModule } from 'primeng/buttongroup';
26
+ import * as i3 from 'primeng/skeleton';
27
+ import { SkeletonModule } from 'primeng/skeleton';
28
+ import * as i4 from 'primeng/tag';
29
+ import { TagModule } from 'primeng/tag';
30
+ import * as i1 from '@angular/platform-browser';
31
+ import { HttpHeaders } from '@angular/common/http';
32
+ import { DomHandler } from 'primeng/dom';
33
+ import * as i1$2 from 'primeng/dialog';
34
+ import { DialogModule } from 'primeng/dialog';
35
+ import * as i6 from 'primeng/selectbutton';
36
+ import { SelectButtonModule, SelectButton } from 'primeng/selectbutton';
37
+ import * as i2 from 'primeng/api';
38
+ import { Observable } from 'rxjs';
39
+
40
+ var CellOverflowBehaviour;
41
+ (function (CellOverflowBehaviour) {
42
+ CellOverflowBehaviour[CellOverflowBehaviour["Hidden"] = 0] = "Hidden";
43
+ CellOverflowBehaviour[CellOverflowBehaviour["Wrap"] = 1] = "Wrap"; /*,
44
+ Ellipsis*/
45
+ })(CellOverflowBehaviour || (CellOverflowBehaviour = {}));
46
+
47
+ var DataAlignHorizontal;
48
+ (function (DataAlignHorizontal) {
49
+ DataAlignHorizontal[DataAlignHorizontal["Left"] = 0] = "Left";
50
+ DataAlignHorizontal[DataAlignHorizontal["Center"] = 1] = "Center";
51
+ DataAlignHorizontal[DataAlignHorizontal["Right"] = 2] = "Right";
52
+ })(DataAlignHorizontal || (DataAlignHorizontal = {}));
53
+
54
+ var DataAlignVertical;
55
+ (function (DataAlignVertical) {
56
+ DataAlignVertical[DataAlignVertical["Top"] = 0] = "Top";
57
+ DataAlignVertical[DataAlignVertical["Middle"] = 1] = "Middle";
58
+ DataAlignVertical[DataAlignVertical["Bottom"] = 2] = "Bottom";
59
+ })(DataAlignVertical || (DataAlignVertical = {}));
60
+
61
+ var DataType;
62
+ (function (DataType) {
63
+ DataType[DataType["Text"] = 0] = "Text";
64
+ DataType[DataType["Numeric"] = 1] = "Numeric";
65
+ DataType[DataType["Boolean"] = 2] = "Boolean";
66
+ DataType[DataType["Date"] = 3] = "Date";
67
+ })(DataType || (DataType = {}));
68
+
69
+ var FrozenColumnAlign;
70
+ (function (FrozenColumnAlign) {
71
+ FrozenColumnAlign[FrozenColumnAlign["Noone"] = 0] = "Noone";
72
+ FrozenColumnAlign[FrozenColumnAlign["Left"] = 1] = "Left";
73
+ FrozenColumnAlign[FrozenColumnAlign["Right"] = 2] = "Right";
74
+ })(FrozenColumnAlign || (FrozenColumnAlign = {}));
75
+
76
+ var TableViewSaveMode;
77
+ (function (TableViewSaveMode) {
78
+ TableViewSaveMode[TableViewSaveMode["noone"] = 0] = "noone";
79
+ TableViewSaveMode[TableViewSaveMode["sessionStorage"] = 1] = "sessionStorage";
80
+ TableViewSaveMode[TableViewSaveMode["localStorage"] = 2] = "localStorage";
81
+ TableViewSaveMode[TableViewSaveMode["databaseStorage"] = 3] = "databaseStorage";
82
+ })(TableViewSaveMode || (TableViewSaveMode = {}));
83
+
84
+ function dataAlignHorizontalAsText(dataAlignHorizontal) {
85
+ switch (dataAlignHorizontal) {
86
+ case DataAlignHorizontal.Left:
87
+ return 'left';
88
+ case DataAlignHorizontal.Center:
89
+ return 'center';
90
+ case DataAlignHorizontal.Right:
91
+ return 'right';
92
+ default:
93
+ return 'center';
94
+ }
95
+ }
96
+
97
+ function dataAlignVerticalAsText(dataAlignVertical) {
98
+ switch (dataAlignVertical) {
99
+ case DataAlignVertical.Top:
100
+ return 'top';
101
+ case DataAlignVertical.Middle:
102
+ return 'middle';
103
+ case DataAlignVertical.Bottom:
104
+ return 'bottom';
105
+ default:
106
+ return 'middle';
107
+ }
108
+ }
109
+
110
+ function dataTypeAsText(dataType) {
111
+ switch (dataType) {
112
+ case DataType.Text:
113
+ return 'text';
114
+ case DataType.Numeric:
115
+ return 'numeric';
116
+ case DataType.Boolean:
117
+ return 'boolean';
118
+ case DataType.Date:
119
+ return 'date';
120
+ default:
121
+ return 'text';
122
+ }
123
+ }
124
+
125
+ function frozenColumnAlignAsText(frozenColumnAlign) {
126
+ switch (frozenColumnAlign) {
127
+ case FrozenColumnAlign.Left:
128
+ return 'left';
129
+ case FrozenColumnAlign.Right:
130
+ return 'right';
131
+ default:
132
+ return 'left';
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Generates SafeHtml with highlighted text based on global search criteria.
138
+ *
139
+ * @param {any} cellValue - The value of the cell to be highlighted.
140
+ * @param {IprimengColumnsMetadata} colMetadata - The column configuration for the cell.
141
+ * @param {string | null} globalSearchText - The global search text to highlight within the cell value.
142
+ * @returns {SafeHtml} - HTML content with highlighted text if it matches the global search criteria.
143
+ *
144
+ * @example
145
+ * // Define column configuration
146
+ * const colMetadata: IprimengColumnsMetadata = { dataType: 'string', canBeGlobalFiltered: true, etc... };
147
+ *
148
+ * // Cell value to be highlighted
149
+ * const cellValue: string = 'Example text';
150
+ *
151
+ * // Global search text
152
+ * const globalSearchText: string = 'text';
153
+ *
154
+ * // Use highlightText to get SafeHtml with highlighted text
155
+ * const highlightedHtml: SafeHtml = highlightText(cellValue, colMetadata, globalSearchText);
156
+ */
157
+ function highlightText(cellValue, colMetadata, globalSearchText) {
158
+ if (colMetadata.dataType !== DataType.Boolean && globalSearchText !== null) { // Check if the column data type is not boolean and global search text is not null
159
+ const valueToUse = String(cellValue); // Convert cell value to string
160
+ if (colMetadata.canBeGlobalFiltered) { // Check if the column can be globally filtered
161
+ const searchLowerCase = globalSearchText.toUpperCase(); // Convert global search text to uppercase for case-insensitive comparison
162
+ const cellValueLowerCase = valueToUse.toUpperCase(); // Convert cell value to uppercase for case-insensitive comparison
163
+ if (cellValueLowerCase.includes(searchLowerCase)) { // Check if the cell value contains the search text
164
+ // Determine the start and end indices of the search text within the cell value
165
+ const startIndex = cellValueLowerCase.indexOf(searchLowerCase);
166
+ const endIndex = startIndex + globalSearchText.length;
167
+ // Extract the prefix, highlight, and suffix of the cell value
168
+ const prefix = valueToUse.substring(0, startIndex);
169
+ const highlight = valueToUse.substring(startIndex, endIndex);
170
+ const suffix = valueToUse.substring(endIndex);
171
+ return `${prefix}<span class="highlighted-text">${highlight}</span>${suffix}`; // Construct SafeHtml with highlighted text using the <mark> element
172
+ }
173
+ }
174
+ }
175
+ return cellValue; // Return the original cell value if it doesn't meet the highlighting conditions
176
+ }
177
+
178
+ class TablePredifinedFilters {
179
+ sanitizer;
180
+ constructor(sanitizer) {
181
+ this.sanitizer = sanitizer;
182
+ }
183
+ option;
184
+ col;
185
+ /**
186
+ * Converts a blob from the database to a safe URL that can be used to display an image.
187
+ *
188
+ * This function takes a `Blob` object, converts it to a base64 encoded string, and returns a `SafeUrl`
189
+ * that can be used in an HTML template to display the image securely. The `SafeUrl` ensures that
190
+ * Angular's security mechanisms are bypassed correctly, preventing potential security risks.
191
+ *
192
+ * @param {Blob} blob - The blob object representing the image data from the database.
193
+ * @returns {SafeUrl} A safe URL that can be used to display the image in an HTML template.
194
+ *
195
+ * @example
196
+ * // Example usage in a component
197
+ * const imageBlob = new Blob([binaryData], { type: 'image/jpeg' });
198
+ * const imageUrl = this.getBlobIconAsUrl(imageBlob);
199
+ *
200
+ * // In your HTML template
201
+ * <img [src]="imageUrl" alt="Image">
202
+ */
203
+ getBlobIconAsUrl(blob) {
204
+ let objectURL = `data:image/jpeg;base64,${blob}`; // Create a base64 encoded string from the blob data
205
+ return this.sanitizer.bypassSecurityTrustUrl(objectURL); // Bypass Angular's security mechanisms to create a SafeUrl
206
+ }
207
+ getIconStyles(option) {
208
+ return {
209
+ 'vertical-align': 'middle',
210
+ 'margin-right': '0.5rem',
211
+ 'color': option.iconColor || '',
212
+ ...option.iconStyle
213
+ };
214
+ }
215
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePredifinedFilters, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
216
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePredifinedFilters, isStandalone: true, selector: "ecs-table-predifined-filters", inputs: { option: "option", col: "col" }, ngImport: i0, template: "@if (option?.icon) {\r\n <i [class]=\"option.icon\" [ngStyle]=\"getIconStyles(option)\"></i>\r\n}\r\n@if (!option?.iconBlob && option?.iconBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\" [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\"/>\r\n}\r\n@if (option?.iconBlob) {\r\n <img alt=\"iconBlob\"\r\n [src]=\"getBlobIconAsUrl(option.iconBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.iconURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.iconURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.displayTag === true) {\r\n <p-tag [style]=\"option.tagStyle\"\r\n [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\">\r\n {{ option.name }}\r\n </p-tag>\r\n}\r\n@if (option?.displayName === true) {\r\n <span style=\"margin-left: 0.25rem; margin-top: 0.25rem;\">{{ option.name }}</span>\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i4.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }] });
217
+ }
218
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePredifinedFilters, decorators: [{
219
+ type: Component,
220
+ args: [{ selector: 'ecs-table-predifined-filters', imports: [
221
+ CommonModule,
222
+ SkeletonModule,
223
+ TagModule
224
+ ], standalone: true, template: "@if (option?.icon) {\r\n <i [class]=\"option.icon\" [ngStyle]=\"getIconStyles(option)\"></i>\r\n}\r\n@if (!option?.iconBlob && option?.iconBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\" [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\"/>\r\n}\r\n@if (option?.iconBlob) {\r\n <img alt=\"iconBlob\"\r\n [src]=\"getBlobIconAsUrl(option.iconBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.iconURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.iconURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.displayTag === true) {\r\n <p-tag [style]=\"option.tagStyle\"\r\n [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\">\r\n {{ option.name }}\r\n </p-tag>\r\n}\r\n@if (option?.displayName === true) {\r\n <span style=\"margin-left: 0.25rem; margin-top: 0.25rem;\">{{ option.name }}</span>\r\n}" }]
225
+ }], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { option: [{
226
+ type: Input
227
+ }], col: [{
228
+ type: Input
229
+ }] } });
230
+
231
+ class TableCell {
232
+ datePipe;
233
+ constructor(datePipe) {
234
+ this.datePipe = datePipe;
235
+ }
236
+ col;
237
+ rowData;
238
+ globalSearchText = null;
239
+ predifinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predifined column filters
240
+ dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
241
+ dateTimezone = "+00:00";
242
+ dateCulture = "en-US";
243
+ DataType = DataType;
244
+ get value() {
245
+ return this.rowData[this.col.field];
246
+ }
247
+ get tooltipText() {
248
+ if (this.col.dataTooltipCustomColumnSource && this.col.dataTooltipCustomColumnSource.length > 0) {
249
+ return this.rowData[this.col.dataTooltipCustomColumnSource];
250
+ }
251
+ return this.value;
252
+ }
253
+ getDataAlignHorizontalAsText(dataAlignHorizontal) {
254
+ dataAlignHorizontalAsText(dataAlignHorizontal);
255
+ }
256
+ getDataAlignVerticalAsText(dataAlignVertical) {
257
+ dataAlignVerticalAsText(dataAlignVertical);
258
+ }
259
+ /**
260
+ * Formats a date value to a specific string format. Provided date will be assumed to be in UTC
261
+ *
262
+ * @param {any} value - The date value to be formatted.
263
+ * @returns {string} - The formatted date string in 'dd-MMM-yyyy HH:mm:ss' format followed by the timezone, or empty string if the provided value is invalid or undefined.
264
+ *
265
+ * @example
266
+ * // Example date value
267
+ * const dateValue: Date = new Date();
268
+ *
269
+ * // Use formatDate to get the formatted date string
270
+ * const formattedDate: string = formatDate(dateValue);
271
+ *
272
+ * // Output might be: '18-Jun-2024 14:30:00 GMT+0000'
273
+ */
274
+ formatDate(value) {
275
+ let formattedDate = undefined; // By default, formattedDate will be undefined
276
+ if (value) { // If value is not undefined
277
+ formattedDate = this.datePipe.transform(value, this.dateFormat, this.dateTimezone, this.dateCulture); // Perform the date masking
278
+ }
279
+ return formattedDate ?? ''; // Returns the date formatted, or as empty string if an issue was found (or value was undefined).
280
+ }
281
+ /**
282
+ * Checks if the provided column metadata matches a specific style of the predefined filters
283
+ * that need to be applied to an item on a row.
284
+ *
285
+ * @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
286
+ * @param {any} value - The value to be matched against the predefined filter values.
287
+ * @returns {any} The matching predefined filter value if found, otherwise null.
288
+ */
289
+ getPredfinedFilterMatch(colMetadata, value) {
290
+ if (colMetadata.filterPredifinedValuesName && colMetadata.filterPredifinedValuesName.length > 0) { // Check if the column uses predefined filter values
291
+ const options = this.getPredifinedFilterValues(colMetadata.filterPredifinedValuesName); // Get the predefined filter values based on the name
292
+ return options.find(option => option.value === value); // Return the matching option if found
293
+ }
294
+ return null; // Return null if the column does not use predefined filter values
295
+ }
296
+ getPredifinedFilterValues(columnKeyName) {
297
+ return this.predifinedFiltersCollection[columnKeyName] || []; // Return the predefined filter values or an empty array if the option name does not exist
298
+ }
299
+ highlightText(cellValue, colMetadata, globalSearchText) {
300
+ return highlightText(cellValue, colMetadata, globalSearchText);
301
+ }
302
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableCell, deps: [{ token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component });
303
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TableCell, isStandalone: true, selector: "ecs-table-cell", inputs: { col: "col", rowData: "rowData", globalSearchText: "globalSearchText", predifinedFiltersCollection: "predifinedFiltersCollection", dateFormat: "dateFormat", dateTimezone: "dateTimezone", dateCulture: "dateCulture" }, ngImport: i0, template: "<!--\r\n[ngStyle]=\"{\r\n 'display': 'flex',\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n-->\r\n@if (value !== null) {\r\n @if (col.filterPredifinedValuesName && col.filterPredifinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (getPredfinedFilterMatch(col, value); as option) {\r\n <div \r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [style.color]=\"value ? 'green' : 'red'\"\r\n [ngClass]=\"{ 'pi-check-circle': value, 'pi-times-circle': !value }\">\r\n </i>\r\n }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n }\r\n }\r\n }\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: TablePredifinedFilters, selector: "ecs-table-predifined-filters", inputs: ["option", "col"] }] });
304
+ }
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableCell, decorators: [{
306
+ type: Component,
307
+ args: [{ selector: 'ecs-table-cell', imports: [
308
+ CommonModule,
309
+ TooltipModule,
310
+ TablePredifinedFilters
311
+ ], standalone: true, template: "<!--\r\n[ngStyle]=\"{\r\n 'display': 'flex',\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n-->\r\n@if (value !== null) {\r\n @if (col.filterPredifinedValuesName && col.filterPredifinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (getPredfinedFilterMatch(col, value); as option) {\r\n <div \r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [style.color]=\"value ? 'green' : 'red'\"\r\n [ngClass]=\"{ 'pi-check-circle': value, 'pi-times-circle': !value }\">\r\n </i>\r\n }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n }\r\n }\r\n }\r\n}" }]
312
+ }], ctorParameters: () => [{ type: i1$1.DatePipe }], propDecorators: { col: [{
313
+ type: Input
314
+ }], rowData: [{
315
+ type: Input
316
+ }], globalSearchText: [{
317
+ type: Input
318
+ }], predifinedFiltersCollection: [{
319
+ type: Input
320
+ }], dateFormat: [{
321
+ type: Input
322
+ }], dateTimezone: [{
323
+ type: Input
324
+ }], dateCulture: [{
325
+ type: Input
326
+ }] } });
327
+
328
+ class ECSPrimengTableHttpService {
329
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableHttpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
330
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableHttpService, providedIn: 'root' });
331
+ }
332
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableHttpService, decorators: [{
333
+ type: Injectable,
334
+ args: [{ providedIn: 'root' }]
335
+ }] });
336
+
337
+ class ECSPrimengTableNotificationService {
338
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
339
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableNotificationService, providedIn: 'root' });
340
+ }
341
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableNotificationService, decorators: [{
342
+ type: Injectable,
343
+ args: [{ providedIn: 'root' }]
344
+ }] });
345
+
346
+ class ECSPrimengTableService {
347
+ http;
348
+ notification;
349
+ constructor(http, notification) {
350
+ this.http = http;
351
+ this.notification = notification;
352
+ }
353
+ fetchTableConfiguration(url) {
354
+ return this.http.handleHttpGetRequest(url);
355
+ }
356
+ fetchTableData(url, postData) {
357
+ return this.http.handleHttpPostRequest(url, postData);
358
+ }
359
+ fetchExcelReport(url, postData) {
360
+ let httpOptions = new HttpHeaders({
361
+ 'accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
362
+ 'Content-Type': 'application/json'
363
+ });
364
+ return this.http.handleHttpPostRequest(url, postData, httpOptions, true, null, true, 'blob');
365
+ }
366
+ downloadFile(data, fileName, contentType) {
367
+ const blob = new Blob([data], { type: contentType });
368
+ const url = window.URL.createObjectURL(blob);
369
+ const link = document.createElement('a');
370
+ link.href = url;
371
+ link.download = fileName;
372
+ link.click();
373
+ window.URL.revokeObjectURL(url);
374
+ }
375
+ handleTableError(error, customTitle = 'Data Loading Error') {
376
+ const message = error.message || 'Unknown error occurred';
377
+ this.notification.showToast('error', customTitle, message);
378
+ }
379
+ orderColumnsWithFrozens(colsToOrder) {
380
+ const frozenLeftColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Left);
381
+ const frozenRightColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Right);
382
+ const nonFrozenColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Noone);
383
+ return [...frozenLeftColumns, ...nonFrozenColumns, ...frozenRightColumns];
384
+ }
385
+ /**
386
+ * Handles click events on action buttons in a row of data.
387
+ *
388
+ * @param {function} action - The action function to be executed when the button is clicked. It should accept one parameter, which is the row data.
389
+ * @param {any} [rowData=null] - The data of the row corresponding to the clicked button. Defaults to null.
390
+ *
391
+ * @returns {void}
392
+ *
393
+ * @example
394
+ * // Define an action for a button
395
+ * const deleteAction = (rowData) => {
396
+ * console.log(`Delete row with id: ${rowData.rowID}`);
397
+ * };
398
+ *
399
+ * // Use handleButtonsClick with row data
400
+ * handleButtonsClick(deleteAction, { rowID: 1, name: 'John Doe' });
401
+ */
402
+ handleButtonsClick(action, rowData = null) {
403
+ if (action) { // If the button has an assigned action
404
+ action(rowData); // Perform the action
405
+ }
406
+ }
407
+ getColumnStyle(col, headerCols = false) {
408
+ let styles = {};
409
+ if (!headerCols) {
410
+ styles = {
411
+ 'white-space': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'normal' : 'nowrap',
412
+ 'word-wrap': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-word' : 'normal',
413
+ 'word-break': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-all' : 'normal'
414
+ };
415
+ }
416
+ if (col.initialWidth > 0) {
417
+ styles['max-width'] = col.initialWidth + 'px';
418
+ styles['min-width'] = col.initialWidth + 'px';
419
+ styles['width'] = col.initialWidth + 'px';
420
+ }
421
+ return styles;
422
+ }
423
+ fetchTableViews(tableViewSaveAs, recoverListEndpoint, tableViewSaveKey) {
424
+ let tableViewList = [];
425
+ let tableViewNotParsed = null;
426
+ if (tableViewSaveKey !== "" && tableViewSaveKey !== '') {
427
+ switch (tableViewSaveAs) {
428
+ case TableViewSaveMode.noone:
429
+ tableViewNotParsed = null;
430
+ break;
431
+ case TableViewSaveMode.sessionStorage:
432
+ tableViewNotParsed = sessionStorage.getItem(tableViewSaveKey);
433
+ break;
434
+ case TableViewSaveMode.localStorage:
435
+ tableViewNotParsed = localStorage.getItem(tableViewSaveKey);
436
+ break;
437
+ case TableViewSaveMode.databaseStorage:
438
+ const postData = {
439
+ tableViewSaveKey: tableViewSaveKey
440
+ };
441
+ return this.http.handleHttpPostRequest(recoverListEndpoint, postData);
442
+ default:
443
+ this.notification.showToast("error", "SAVE VIEW TYPE DOES NOT EXIST", "This type of save view does not exist.");
444
+ }
445
+ }
446
+ tableViewList = tableViewNotParsed ? JSON.parse(tableViewNotParsed) : [];
447
+ this.sortViews(tableViewList);
448
+ return tableViewList;
449
+ }
450
+ sortViews(tableSaveViewList) {
451
+ tableSaveViewList.sort((a, b) => a.viewAlias.toLowerCase().localeCompare(b.viewAlias.toLowerCase()));
452
+ }
453
+ updateViewsMenuItems(tableSaveViewList) {
454
+ return tableSaveViewList.map(item => ({
455
+ label: item.viewAlias
456
+ }));
457
+ }
458
+ viewsSaveToDatabase(tableSaveViewList, setListEndpoint, tableViewSaveKey) {
459
+ const serializedSaveViews = tableSaveViewList.map(view => ({
460
+ viewAlias: view.viewAlias,
461
+ viewData: JSON.stringify(view.viewData),
462
+ lastActive: view.lastActive
463
+ }));
464
+ const postData = {
465
+ tableViewSaveKey: tableViewSaveKey,
466
+ views: serializedSaveViews
467
+ };
468
+ return this.http.handleHttpPostRequest(setListEndpoint, postData);
469
+ }
470
+ viewGenerateData(dt, globalSearchText, currentPage, currentRowsPerPage, modifyFiltersFn) {
471
+ let colsWidth = this.computeColumnWidths(dt);
472
+ let tableWidth = this.computeTableWidth(dt);
473
+ const filtersWithoutGlobalAndSelectedRows = { ...modifyFiltersFn(JSON.parse(JSON.stringify(dt.filters))) };
474
+ if (filtersWithoutGlobalAndSelectedRows['rowID']) {
475
+ filtersWithoutGlobalAndSelectedRows['rowID'][0].value = null;
476
+ }
477
+ if (filtersWithoutGlobalAndSelectedRows['selector']) {
478
+ filtersWithoutGlobalAndSelectedRows['selector'][0].value = null;
479
+ }
480
+ const tableView = {
481
+ columnsShown: [...dt.columns],
482
+ multiSortMeta: dt.multiSortMeta,
483
+ filters: { ...filtersWithoutGlobalAndSelectedRows },
484
+ globalSearchText: globalSearchText,
485
+ currentPage: currentPage,
486
+ currentRowsPerPage: currentRowsPerPage,
487
+ tableWidth: tableWidth,
488
+ columnsWidth: colsWidth
489
+ };
490
+ return tableView;
491
+ }
492
+ computeColumnWidths(dt) {
493
+ let widths = [];
494
+ const headers = dt.el.nativeElement.querySelectorAll('.p-datatable-thead > tr > th');
495
+ headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
496
+ return widths.join(',');
497
+ }
498
+ computeTableWidth(dt) {
499
+ let tableWidth = 0;
500
+ if (dt.columnResizeMode === 'expand') {
501
+ tableWidth = DomHandler.getOuterWidth(dt.tableViewChild?.nativeElement);
502
+ }
503
+ return tableWidth;
504
+ }
505
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableService, deps: [{ token: ECSPrimengTableHttpService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
506
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableService, providedIn: 'root' });
507
+ }
508
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTableService, decorators: [{
509
+ type: Injectable,
510
+ args: [{
511
+ providedIn: 'root'
512
+ }]
513
+ }], ctorParameters: () => [{ type: ECSPrimengTableHttpService }, { type: ECSPrimengTableNotificationService }] });
514
+
515
+ class TableButton {
516
+ tableService;
517
+ constructor(tableService) {
518
+ this.tableService = tableService;
519
+ }
520
+ button;
521
+ rowData;
522
+ isActionButton = false;
523
+ isLastActionButton = false;
524
+ clicked = new EventEmitter();
525
+ isDisabled() {
526
+ return this.button.condition ? !this.button.condition(this.rowData) : false;
527
+ }
528
+ handleClick() {
529
+ if (this.button.action) {
530
+ this.tableService.handleButtonsClick(this.button.action, this.rowData);
531
+ }
532
+ }
533
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableButton, deps: [{ token: ECSPrimengTableService }], target: i0.ɵɵFactoryTarget.Component });
534
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: TableButton, isStandalone: true, selector: "ecs-table-button", inputs: { button: "button", rowData: "rowData", isActionButton: "isActionButton", isLastActionButton: "isLastActionButton" }, outputs: { clicked: "clicked" }, ngImport: i0, template: "<p-button\r\n [disabled]=\"isDisabled()\"\r\n [pTooltip]=\"button.tooltip || ''\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"(button.color || 'p-button-outlined') + (isActionButton ? ' custom-small-btn' : '')\"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"button.label || ''\"\r\n [size]=\"isActionButton ? 'small': undefined\"\r\n [ngStyle]=\"isActionButton && !isLastActionButton ? {'margin-right':'10px'} : {}\"\r\n (onClick)=\"handleClick()\"/>", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
535
+ }
536
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableButton, decorators: [{
537
+ type: Component,
538
+ args: [{ selector: 'ecs-table-button', imports: [
539
+ CommonModule,
540
+ ButtonModule,
541
+ TooltipModule
542
+ ], standalone: true, template: "<p-button\r\n [disabled]=\"isDisabled()\"\r\n [pTooltip]=\"button.tooltip || ''\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"(button.color || 'p-button-outlined') + (isActionButton ? ' custom-small-btn' : '')\"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"button.label || ''\"\r\n [size]=\"isActionButton ? 'small': undefined\"\r\n [ngStyle]=\"isActionButton && !isLastActionButton ? {'margin-right':'10px'} : {}\"\r\n (onClick)=\"handleClick()\"/>", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"] }]
543
+ }], ctorParameters: () => [{ type: ECSPrimengTableService }], propDecorators: { button: [{
544
+ type: Input
545
+ }], rowData: [{
546
+ type: Input
547
+ }], isActionButton: [{
548
+ type: Input
549
+ }], isLastActionButton: [{
550
+ type: Input
551
+ }], clicked: [{
552
+ type: Output
553
+ }] } });
554
+
555
+ class ColumnSelector {
556
+ dt_columnDialog;
557
+ visible = false;
558
+ columnModalData = [];
559
+ filteredColumnData = [];
560
+ visibleChange = new EventEmitter();
561
+ applyChanges = new EventEmitter();
562
+ cellOverflowBehaviourOptions = [
563
+ { icon: 'pi pi-minus', val: CellOverflowBehaviour.Hidden },
564
+ { icon: 'pi pi-equals', val: CellOverflowBehaviour.Wrap } /*,
565
+ {icon: 'pi pi-ellipsis-h', val: CellOverflowBehaviour.Ellipsis}*/
566
+ ];
567
+ dataAlignHorizontalOptions = [
568
+ { icon: 'pi pi-align-left', val: DataAlignHorizontal.Left },
569
+ { icon: 'pi pi-align-center', val: DataAlignHorizontal.Center },
570
+ { icon: 'pi pi-align-right', val: DataAlignHorizontal.Right }
571
+ ];
572
+ dataAlignVerticalOptions = [
573
+ { icon: 'pi pi-angle-up', val: DataAlignVertical.Top },
574
+ { icon: 'pi pi-align-justify', val: DataAlignVertical.Middle },
575
+ { icon: 'pi pi-angle-down', val: DataAlignVertical.Bottom }
576
+ ];
577
+ globalSearchText = null; // The text used by the global search
578
+ globalSearchMaxLength = 50;
579
+ onColumnModalFilter(event) {
580
+ const filterValue = event.filters && event.filters.global
581
+ ? event.filters.global.value.toLowerCase()
582
+ : '';
583
+ this.filteredColumnData = this.columnModalData.filter(column => column.header.toLowerCase().includes(filterValue));
584
+ }
585
+ allColumnsCheckboxActive() {
586
+ return this.columnModalData.every(column => column.selected);
587
+ }
588
+ allColumnsCheckboxClick(event) {
589
+ if (event.checked) {
590
+ this.columnModalData.forEach(column => { column.selected = true; });
591
+ }
592
+ else {
593
+ this.columnModalData.forEach(column => {
594
+ if (!column.selectDisabled) {
595
+ column.selected = false;
596
+ }
597
+ });
598
+ }
599
+ }
600
+ filterColumnModal(event) {
601
+ let filterValue = event.target.value;
602
+ this.dt_columnDialog.filterGlobal(filterValue, 'contains');
603
+ }
604
+ applyColumnModalChanges() {
605
+ const selected = this.columnModalData.filter(c => c.selected && !c.selectDisabled);
606
+ this.applyChanges.emit(selected);
607
+ this.closeModal();
608
+ }
609
+ clearGlobalFilter(dt) {
610
+ this.globalSearchText = null;
611
+ dt.filterGlobal('', '');
612
+ }
613
+ closeModal() {
614
+ this.globalSearchText = null;
615
+ this.visibleChange.emit(false);
616
+ }
617
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ColumnSelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
618
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ColumnSelector, isStandalone: true, selector: "ecs-column-selector", inputs: { visible: "visible", columnModalData: "columnModalData", filteredColumnData: "filteredColumnData" }, outputs: { visibleChange: "visibleChange", applyChanges: "applyChanges" }, viewQueries: [{ propertyName: "dt_columnDialog", first: true, predicate: ["dt_columnDialog"], descendants: true }], ngImport: i0, template: "<!--COLUMN MODAL DIALOG-->\r\n<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '65vw', 'max-width': '65vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <span class=\"white-space-nowrap\"><b>MODIFY COLUMNS</b></span>\r\n </ng-template>\r\n <div style=\"padding: 20px;\">\r\n <p-table #dt_columnDialog [value]=\"columnModalData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows \r\n [globalFilterFields]=\"['header']\" scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\" (onFilter)=\"onColumnModalFilter($event)\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px\">\r\n <p-checkbox inputId=\"selectAll\" [binary]=\"true\" [ngModel]=\"allColumnsCheckboxActive()\" (onChange)=\"allColumnsCheckboxClick($event)\"></p-checkbox>\r\n <label for=\"selectAll\">Select all columns</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <p-iconField iconPosition=\"left\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" placeholder=\"Search column name\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">Show column</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">Column name</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Cell overflow behaviour</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">Horizontal aligment</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Vertical aligment</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">\r\n <p-checkbox \r\n [(ngModel)]=\"rowData.selected\" \r\n [binary]=\"true\"\r\n [disabled]=\"rowData.selectDisabled\"/>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"cellOverflowBehaviourOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignHorizontal\" [options]=\"dataAlignHorizontalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignVertical\" [options]=\"dataAlignVerticalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no columns</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{filteredColumnData ? filteredColumnData.length : 0}} columns of {{columnModalData ? columnModalData.length : 0}} available columns\r\n </div>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel changes\" severity=\"danger\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" label=\"Save changes\" severity=\"success\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.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", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i6.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$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: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] });
619
+ }
620
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ColumnSelector, decorators: [{
621
+ type: Component,
622
+ args: [{ selector: 'ecs-column-selector', imports: [
623
+ DialogModule,
624
+ TableModule,
625
+ CheckboxModule,
626
+ ButtonModule,
627
+ SelectButtonModule,
628
+ CommonModule,
629
+ FormsModule,
630
+ InputIconModule,
631
+ IconFieldModule,
632
+ InputTextModule
633
+ ], standalone: true, template: "<!--COLUMN MODAL DIALOG-->\r\n<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '65vw', 'max-width': '65vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <span class=\"white-space-nowrap\"><b>MODIFY COLUMNS</b></span>\r\n </ng-template>\r\n <div style=\"padding: 20px;\">\r\n <p-table #dt_columnDialog [value]=\"columnModalData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows \r\n [globalFilterFields]=\"['header']\" scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\" (onFilter)=\"onColumnModalFilter($event)\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px\">\r\n <p-checkbox inputId=\"selectAll\" [binary]=\"true\" [ngModel]=\"allColumnsCheckboxActive()\" (onChange)=\"allColumnsCheckboxClick($event)\"></p-checkbox>\r\n <label for=\"selectAll\">Select all columns</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <p-iconField iconPosition=\"left\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" placeholder=\"Search column name\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">Show column</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">Column name</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Cell overflow behaviour</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">Horizontal aligment</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Vertical aligment</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">\r\n <p-checkbox \r\n [(ngModel)]=\"rowData.selected\" \r\n [binary]=\"true\"\r\n [disabled]=\"rowData.selectDisabled\"/>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"cellOverflowBehaviourOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignHorizontal\" [options]=\"dataAlignHorizontalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignVertical\" [options]=\"dataAlignVerticalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no columns</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{filteredColumnData ? filteredColumnData.length : 0}} columns of {{columnModalData ? columnModalData.length : 0}} available columns\r\n </div>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel changes\" severity=\"danger\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" label=\"Save changes\" severity=\"success\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
634
+ }], propDecorators: { dt_columnDialog: [{
635
+ type: ViewChild,
636
+ args: ['dt_columnDialog']
637
+ }], visible: [{
638
+ type: Input
639
+ }], columnModalData: [{
640
+ type: Input
641
+ }], filteredColumnData: [{
642
+ type: Input
643
+ }], visibleChange: [{
644
+ type: Output
645
+ }], applyChanges: [{
646
+ type: Output
647
+ }] } });
648
+
649
+ class ExportExcelService {
650
+ getCurrentTimeString() {
651
+ const now = new Date();
652
+ const year = now.getUTCFullYear();
653
+ const month = String(now.getUTCMonth() + 1).padStart(2, '0');
654
+ const day = String(now.getUTCDate()).padStart(2, '0');
655
+ const hours = String(now.getUTCHours()).padStart(2, '0');
656
+ const minutes = String(now.getUTCMinutes()).padStart(2, '0');
657
+ const seconds = String(now.getUTCSeconds()).padStart(2, '0');
658
+ return `_${year}${month}${day}_${hours}${minutes}${seconds}_UTC`;
659
+ }
660
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExportExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
661
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExportExcelService, providedIn: 'root' });
662
+ }
663
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExportExcelService, decorators: [{
664
+ type: Injectable,
665
+ args: [{
666
+ providedIn: 'root'
667
+ }]
668
+ }] });
669
+
670
+ class ExportExcel {
671
+ notificationSerivce;
672
+ exportExcelService;
673
+ visible = false;
674
+ rowCheckboxSelectorActive = false;
675
+ excelReportTitle = "";
676
+ includeTimeInTitle = true;
677
+ allowTitleUserEdit = false;
678
+ exportToExcel = new EventEmitter();
679
+ visibleChange = new EventEmitter();
680
+ constructor(notificationSerivce, exportExcelService) {
681
+ this.notificationSerivce = notificationSerivce;
682
+ this.exportExcelService = exportExcelService;
683
+ }
684
+ option_exportColumns_selected = false;
685
+ option_exportColumns = [
686
+ { label: 'Only visible', value: false },
687
+ { label: 'All columns', value: true }
688
+ ];
689
+ option_applyCurrentFilters_selected = false;
690
+ option_applyCurrentFilters = [
691
+ { label: 'No filters', value: false },
692
+ { label: 'Apply current filters', value: true }
693
+ ];
694
+ option_applyCurrentSorts_selected = false;
695
+ option_applyCurrentSorts = [
696
+ { label: 'No sorts', value: false },
697
+ { label: 'Apply current sorts', value: true }
698
+ ];
699
+ option_selectedRowsExport_selected = 0;
700
+ option_selectedRowsExport = [
701
+ { label: 'All rows', value: 0 },
702
+ { label: 'Selected rows', value: 1 },
703
+ { label: 'Not selected rows', value: 2 }
704
+ ];
705
+ ngOnChanges(changes) {
706
+ // If visible changes from false to true, reset values
707
+ if (changes['visible'] && changes['visible'].currentValue === true && changes['visible'].previousValue === false) {
708
+ this.resetValues();
709
+ }
710
+ }
711
+ resetValues() {
712
+ this.includeTimeInTitle = true;
713
+ this.option_exportColumns_selected = false;
714
+ this.option_applyCurrentFilters_selected = false;
715
+ this.option_applyCurrentSorts_selected = false;
716
+ this.option_selectedRowsExport_selected = 0;
717
+ }
718
+ getExcelReport() {
719
+ let excelReportFinalTitle = "";
720
+ this.excelReportTitle = this.excelReportTitle?.trim();
721
+ if (!this.excelReportTitle || this.excelReportTitle.length <= 0) {
722
+ this.notificationSerivce.clearToasts();
723
+ this.notificationSerivce.showToast("error", "REPORT NAME NOT VALID", "The report name is not valid");
724
+ return;
725
+ }
726
+ const allowedPattern = /^[A-Za-z0-9 _-]*$/;
727
+ if (!allowedPattern.test(this.excelReportTitle)) {
728
+ this.notificationSerivce.clearToasts();
729
+ this.notificationSerivce.showToast("error", "INVALID CHARACTERS IN REPORT NAME", "The report name contains invalid characters.");
730
+ return;
731
+ }
732
+ if (this.includeTimeInTitle) {
733
+ excelReportFinalTitle = this.excelReportTitle + this.exportExcelService.getCurrentTimeString() + ".xlsx";
734
+ }
735
+ else {
736
+ excelReportFinalTitle = this.excelReportTitle + ".xlsx";
737
+ }
738
+ this.exportToExcel.emit({
739
+ allColumns: this.option_exportColumns_selected,
740
+ applyFilters: this.option_applyCurrentFilters_selected,
741
+ applySorts: this.option_applyCurrentSorts_selected,
742
+ selectedRows: this.option_selectedRowsExport_selected,
743
+ filename: excelReportFinalTitle
744
+ });
745
+ }
746
+ filterSelectorDisabled() {
747
+ return this.option_selectedRowsExport_selected >= 1;
748
+ }
749
+ onChangeExportRows(event) {
750
+ if (event.value >= 1) {
751
+ this.option_applyCurrentFilters_selected = true;
752
+ }
753
+ }
754
+ closeModal() {
755
+ this.visibleChange.emit(false);
756
+ }
757
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExportExcel, deps: [{ token: ECSPrimengTableNotificationService }, { token: ExportExcelService }], target: i0.ɵɵFactoryTarget.Component });
758
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ExportExcel, isStandalone: true, selector: "ecs-export-excel", inputs: { visible: "visible", rowCheckboxSelectorActive: "rowCheckboxSelectorActive", excelReportTitle: "excelReportTitle", allowTitleUserEdit: "allowTitleUserEdit" }, outputs: { exportToExcel: "exportToExcel", visibleChange: "visibleChange" }, usesOnChanges: true, ngImport: i0, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"false\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Export data to Excel</span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: grid; grid-template-columns: 4fr 8fr; gap: 1rem; align-items: center;\">\r\n <div style=\"justify-self: end;\">\r\n Report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <input pInputText id=\"reportTitle\" [(ngModel)]=\"excelReportTitle\" autocomplete=\"off\" style=\"width: 100%;\" [disabled]=\"!allowTitleUserEdit\" maxlength=\"100\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <i pTooltip=\"Activating this option will add the current '_{year}{month}{day}_{hours}{minutes}{seconds}_UTC' at the end of your filename\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n Include time in report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"includeTimeInTitle\"/>\r\n </div>\r\n \r\n <div style=\"justify-self: end;\">\r\n Export columns\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_exportColumns_selected\" [options]=\"option_exportColumns\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n @if(filterSelectorDisabled()){\r\n <i pTooltip=\"Sorts are active because you want to export selected rows following a filter criteria\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n Filters to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentFilters_selected\" [options]=\"option_applyCurrentFilters\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" [disabled]=\"filterSelectorDisabled()\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n Sorts to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentSorts_selected\" [options]=\"option_applyCurrentSorts\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n @if(rowCheckboxSelectorActive){\r\n <div style=\"justify-self: end;\">\r\n Selected rows\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_selectedRowsExport_selected\" [options]=\"option_selectedRowsExport\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" (onChange)=\"onChangeExportRows($event)\"/>\r\n </div>\r\n }\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel export\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"/>\r\n <p-button (click)=\"getExcelReport()\" label=\"Export\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"/>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$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: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] });
759
+ }
760
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ExportExcel, decorators: [{
761
+ type: Component,
762
+ args: [{ selector: 'ecs-export-excel', imports: [
763
+ DialogModule,
764
+ FormsModule,
765
+ ButtonModule,
766
+ SelectButton,
767
+ InputTextModule,
768
+ TooltipModule,
769
+ CheckboxModule
770
+ ], standalone: true, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"false\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Export data to Excel</span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: grid; grid-template-columns: 4fr 8fr; gap: 1rem; align-items: center;\">\r\n <div style=\"justify-self: end;\">\r\n Report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <input pInputText id=\"reportTitle\" [(ngModel)]=\"excelReportTitle\" autocomplete=\"off\" style=\"width: 100%;\" [disabled]=\"!allowTitleUserEdit\" maxlength=\"100\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <i pTooltip=\"Activating this option will add the current '_{year}{month}{day}_{hours}{minutes}{seconds}_UTC' at the end of your filename\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n Include time in report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"includeTimeInTitle\"/>\r\n </div>\r\n \r\n <div style=\"justify-self: end;\">\r\n Export columns\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_exportColumns_selected\" [options]=\"option_exportColumns\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n @if(filterSelectorDisabled()){\r\n <i pTooltip=\"Sorts are active because you want to export selected rows following a filter criteria\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n Filters to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentFilters_selected\" [options]=\"option_applyCurrentFilters\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" [disabled]=\"filterSelectorDisabled()\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n Sorts to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentSorts_selected\" [options]=\"option_applyCurrentSorts\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n @if(rowCheckboxSelectorActive){\r\n <div style=\"justify-self: end;\">\r\n Selected rows\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_selectedRowsExport_selected\" [options]=\"option_selectedRowsExport\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" (onChange)=\"onChangeExportRows($event)\"/>\r\n </div>\r\n }\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel export\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"/>\r\n <p-button (click)=\"getExcelReport()\" label=\"Export\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"/>\r\n </ng-template>\r\n</p-dialog>" }]
771
+ }], ctorParameters: () => [{ type: ECSPrimengTableNotificationService }, { type: ExportExcelService }], propDecorators: { visible: [{
772
+ type: Input
773
+ }], rowCheckboxSelectorActive: [{
774
+ type: Input
775
+ }], excelReportTitle: [{
776
+ type: Input
777
+ }], allowTitleUserEdit: [{
778
+ type: Input
779
+ }], exportToExcel: [{
780
+ type: Output
781
+ }], visibleChange: [{
782
+ type: Output
783
+ }] } });
784
+
785
+ class ViewsManagement {
786
+ notification;
787
+ constructor(notification) {
788
+ this.notification = notification;
789
+ }
790
+ visible = false;
791
+ tableViews_menuItems = [];
792
+ onViewSelect = new EventEmitter();
793
+ onViewDelete = new EventEmitter();
794
+ onViewUpdateData = new EventEmitter();
795
+ onViewEditAlias = new EventEmitter();
796
+ onViewCreate = new EventEmitter();
797
+ visibleChange = new EventEmitter();
798
+ viewEditorShow = false;
799
+ editingViewAlias = '';
800
+ newViewAlias = '';
801
+ loadView(viewAlias) {
802
+ this.onViewSelect.emit(viewAlias);
803
+ }
804
+ deleteView(viewAlias) {
805
+ this.onViewDelete.emit(viewAlias);
806
+ }
807
+ updateView(viewAlias) {
808
+ this.onViewUpdateData.emit(viewAlias);
809
+ }
810
+ createView(viewAlias) {
811
+ const exists = this.tableViews_menuItems.some(item => item.label === viewAlias);
812
+ if (exists) {
813
+ this.notification.showToast("error", "DUPLICATE VIEW NAME", `A view with alias "${viewAlias}" already exists`);
814
+ return;
815
+ }
816
+ this.onViewCreate.emit(viewAlias);
817
+ }
818
+ editViewAlias(viewAliasOld, viewAliasNew) {
819
+ this.onViewEditAlias.emit({
820
+ viewAliasOld: viewAliasOld,
821
+ viewAliasNew: viewAliasNew
822
+ });
823
+ }
824
+ showViewEditor(editingViewAlias = '') {
825
+ this.editingViewAlias = editingViewAlias;
826
+ this.newViewAlias = this.editingViewAlias;
827
+ this.viewEditorShow = true;
828
+ }
829
+ closeModal() {
830
+ this.visibleChange.emit(false);
831
+ }
832
+ createOrUpdateTableView() {
833
+ this.viewEditorShow = false;
834
+ if (this.editingViewAlias !== '') {
835
+ this.editViewAlias(this.editingViewAlias, this.newViewAlias);
836
+ }
837
+ else {
838
+ this.createView(this.newViewAlias);
839
+ }
840
+ }
841
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ViewsManagement, deps: [{ token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
842
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ViewsManagement, isStandalone: true, selector: "ecs-views-management", inputs: { visible: "visible", tableViews_menuItems: "tableViews_menuItems" }, outputs: { onViewSelect: "onViewSelect", onViewDelete: "onViewDelete", onViewUpdateData: "onViewUpdateData", onViewEditAlias: "onViewEditAlias", onViewCreate: "onViewCreate", visibleChange: "visibleChange" }, ngImport: i0, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"true\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\" (onHide)=\"closeModal()\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Table views</span>\r\n </div>\r\n </ng-template>\r\n <div class=\"p-4 pt-0\">\r\n <p-table #dt_viewsDialog [value]=\"tableViews_menuItems\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: flex-end; align-items: center; width: 100%;\">\r\n <p-button icon=\"pi pi-plus\" label=\"New view\" severity=\"success\" (click)=\"showViewEditor()\" pTooltip=\"New view\" tooltipPosition=\"top\" [showDelay]=\"700\"/>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th style=\"text-align: center;\">View name</th>\r\n <th style=\"text-align: center; max-width: 300px; min-width: 300px; width: 300px;\">Actions</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"max-width: 300px; min-width: 300px; width: 300px; display: flex; justify-content: center; align-items: center; height: 100%;\">\r\n <button pButton icon=\"pi pi-upload\" (click)=\"loadView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Restore\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-save\" (click)=\"updateView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Save\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-pencil\" (click)=\"showViewEditor(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Edit\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"deleteView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Delete\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px;\"></button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no views</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{tableViews_menuItems ? tableViews_menuItems.length : 0}} views\r\n </div>\r\n </div>\r\n</p-dialog>\r\n\r\n<!--TABLE VIEW SAVE-->\r\n<p-dialog [(visible)]=\"viewEditorShow\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'max-width': '60vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <span class=\"white-space-nowrap\"><b>{{ editingViewAlias !== '' ? 'UPDATE VIEW' : 'CREATE NEW VIEW' }}</b></span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: flex; flex-direction: column; gap: 8px;\">\r\n <label for=\"newtableviewname\"><strong>View alias<span style=\"color: red;\">*</span></strong></label>\r\n <input \r\n pInputText \r\n id=\"newtableviewname\" \r\n aria-describedby=\"newtableviewname-help\" \r\n style=\"width: 400px;\"\r\n maxlength=\"30\"\r\n [(ngModel)]=\"newViewAlias\"/>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"viewEditorShow = false\" label=\"Cancel\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"editingViewAlias !== '' ? 'Update' : 'Create'\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.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", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$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: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] });
843
+ }
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ViewsManagement, decorators: [{
845
+ type: Component,
846
+ args: [{ selector: 'ecs-views-management', imports: [
847
+ DialogModule,
848
+ TableModule,
849
+ ButtonModule,
850
+ CommonModule,
851
+ FormsModule,
852
+ TooltipModule,
853
+ InputTextModule
854
+ ], standalone: true, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"true\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\" (onHide)=\"closeModal()\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Table views</span>\r\n </div>\r\n </ng-template>\r\n <div class=\"p-4 pt-0\">\r\n <p-table #dt_viewsDialog [value]=\"tableViews_menuItems\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: flex-end; align-items: center; width: 100%;\">\r\n <p-button icon=\"pi pi-plus\" label=\"New view\" severity=\"success\" (click)=\"showViewEditor()\" pTooltip=\"New view\" tooltipPosition=\"top\" [showDelay]=\"700\"/>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th style=\"text-align: center;\">View name</th>\r\n <th style=\"text-align: center; max-width: 300px; min-width: 300px; width: 300px;\">Actions</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"max-width: 300px; min-width: 300px; width: 300px; display: flex; justify-content: center; align-items: center; height: 100%;\">\r\n <button pButton icon=\"pi pi-upload\" (click)=\"loadView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Restore\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-save\" (click)=\"updateView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Save\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-pencil\" (click)=\"showViewEditor(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Edit\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"deleteView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Delete\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px;\"></button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no views</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{tableViews_menuItems ? tableViews_menuItems.length : 0}} views\r\n </div>\r\n </div>\r\n</p-dialog>\r\n\r\n<!--TABLE VIEW SAVE-->\r\n<p-dialog [(visible)]=\"viewEditorShow\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'max-width': '60vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <span class=\"white-space-nowrap\"><b>{{ editingViewAlias !== '' ? 'UPDATE VIEW' : 'CREATE NEW VIEW' }}</b></span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: flex; flex-direction: column; gap: 8px;\">\r\n <label for=\"newtableviewname\"><strong>View alias<span style=\"color: red;\">*</span></strong></label>\r\n <input \r\n pInputText \r\n id=\"newtableviewname\" \r\n aria-describedby=\"newtableviewname-help\" \r\n style=\"width: 400px;\"\r\n maxlength=\"30\"\r\n [(ngModel)]=\"newViewAlias\"/>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"viewEditorShow = false\" label=\"Cancel\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"editingViewAlias !== '' ? 'Update' : 'Create'\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
855
+ }], ctorParameters: () => [{ type: ECSPrimengTableNotificationService }], propDecorators: { visible: [{
856
+ type: Input
857
+ }], tableViews_menuItems: [{
858
+ type: Input
859
+ }], onViewSelect: [{
860
+ type: Output
861
+ }], onViewDelete: [{
862
+ type: Output
863
+ }], onViewUpdateData: [{
864
+ type: Output
865
+ }], onViewEditAlias: [{
866
+ type: Output
867
+ }], onViewCreate: [{
868
+ type: Output
869
+ }], visibleChange: [{
870
+ type: Output
871
+ }] } });
872
+
873
+ class ECSPrimengTable {
874
+ tableService;
875
+ notification;
876
+ resizeObserver;
877
+ constructor(tableService, notification) {
878
+ this.tableService = tableService;
879
+ this.notification = notification;
880
+ }
881
+ isActive = true;
882
+ data = []; // The array of data to be displayed
883
+ columnsToShow = []; // The combination of the non-selectable columns + selected columns that must be shown
884
+ computeScrollHeight = true; // If true, the table will try not to grow more than the total height of the window vertically
885
+ globalSearchEnabled = true; // Used to enable or disable the global search (by default enabled)
886
+ globalSearchMaxLength = 50; // The maximun number of characters that can be input in the global filter
887
+ globalSearchPlaceholder = "Search keyword"; // The placeholder text to show if global search is enabled
888
+ columnEditorEnabled = true; // If the user can modify the columns thorugh the column editor
889
+ urlColumnsSource; // The source URL to get data from columns
890
+ urlDataSource; // The URL to fetch data from
891
+ urlExcelReport = null;
892
+ predifinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predifined column filters
893
+ predifinedFiltersNoSelectionPlaceholder = "Any value"; // A text to be displayed in the dropdown if no value has been selected in a column that uses predifined filters
894
+ predifinedFiltersCollectionSelectedValuesText = "items selected"; // A text to display in the predifined filters dropdown footer indicating the number of items that have been selected
895
+ rowActionButtons = []; // A list that contains all buttons that will appear in the actions column
896
+ headerActionButtons = []; // A list that contains all buttons that will appear in the right side of the header of the table
897
+ copyCellDataToClipboardTimeSecs = 0.5; // The amount of time since mouse down in a cell for its content to be copied to the clipboard. If you want to disable this functionality, put it to a value less than or equal to 0.
898
+ actionsColumnAligmentRight = true; // If actions column is put at the right end of the table (or false if its at the left)
899
+ actionsColumnWidth = 150; // The amount in pixels for the size of the actions column
900
+ actionsColumnFrozen = true; // If the actions column should be frozen
901
+ rowSelectorColumnActive = false; // By default false. If true, a column will be shown to the user that includes a checkbox per row. This selection and filtering that the user can do is all managed by the table component. You can fetch the selected rows through the output selectedRowsCheckbox.
902
+ rowSelectorColumName = "Selected"; // The title of the row selection column. By default is "Selected"
903
+ rowSelectorColumnAligmentRight = true; // By default true. If true, the row selector column is put at the right end of the table (or false if its at the left).
904
+ rowSelectorColumnWidth = 150; // The amount in pixels for the size of the selector column
905
+ rowSelectorColumnFrozen = true; // By default true. If true, the row selector column will be frozen.
906
+ actionsColumnResizable = false; // If the action column can be resized by the user
907
+ actionColumnName = "Actions"; // The column name were the action buttons will appear
908
+ rowselectorColumnResizable = false;
909
+ noDataFoundText = "No data found for the current filter criteria."; // The text to be shown when no data has been returned
910
+ showClearSortAndFilters = true;
911
+ excelReportTitleDefault = "Report";
912
+ excelReportTitleAllowUserEdit = false;
913
+ tableViewSaveAs = TableViewSaveMode.noone; // How the table view will be saved
914
+ tableViewSaveKey = ""; // The key used to save the table views
915
+ viewsGetSourceURL = "";
916
+ viewsSaveSourceURL = "";
917
+ maxTableViews = 10; // The maximun number of views that can be saved
918
+ onRowCheckboxChange = new EventEmitter(); // Emitter that returns the column selected and if it was selected or unselected
919
+ onRowSelect = new EventEmitter;
920
+ onRowUnselect = new EventEmitter;
921
+ viewsModalShow = false;
922
+ tableViewCurrentSelectedAlias = null;
923
+ tableViewsFirstFetchDone = false;
924
+ excelReportTitle = "";
925
+ showExportModal = false;
926
+ showColumnSelector = false;
927
+ selectedRowsCheckbox = []; // An array to keep all the selected rows
928
+ dt; // Get the reference to the object table
929
+ showRefreshData = true;
930
+ scrollHeight = "0px"; // Used to get the table height
931
+ globalSearchText = null; // The text used by the global search
932
+ tableViewsList = [];
933
+ tableViews_menuItems = [];
934
+ DataType = DataType;
935
+ CellOverflowBehaviour = CellOverflowBehaviour;
936
+ DataAlignHorizontal = DataAlignHorizontal;
937
+ DataAlignVertical = DataAlignVertical;
938
+ FrozenColumnAlign = FrozenColumnAlign;
939
+ TableViewSaveMode = TableViewSaveMode;
940
+ rowSelection;
941
+ currentPage = 0; // The current page we are at
942
+ currentRowsPerPage = 0; // The current rows per page selected
943
+ allowedRowsPerPage = []; // The different values of rows per page allowed
944
+ totalRecords = 0; // The number of total records that are available (taking into account the filters)
945
+ totalRecordsNotFiltered = 0; // The total number of records available if no filters were applied
946
+ dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
947
+ dateTimezone = "+00:00";
948
+ dateCulture = "en-US";
949
+ columns = [];
950
+ columnsCantBeHidden = [];
951
+ columnsSelected = [];
952
+ columnModalData = [];
953
+ filteredColumnData = [];
954
+ predifinedFiltersSelectedValuesCollection = {}; // Contains a collection of the predifined column filters selection (possible values come from 'predifinedFiltersCollection')
955
+ copyCellDataTimer; // A timer that handles the amount of time left to copy the cell data to the clipboard
956
+ tableLazyLoadEventInformation = {}; // Data of the last lazy load event of the table
957
+ initialConfigurationFetched = false;
958
+ ngOnInit() {
959
+ this.fetchTableConfiguration();
960
+ }
961
+ tableContainer;
962
+ headerContainer;
963
+ paginatorContainer;
964
+ ngAfterViewInit() {
965
+ if (this.computeScrollHeight) {
966
+ this.resizeObserver = new ResizeObserver(() => {
967
+ this.calculateScrollHeight();
968
+ });
969
+ this.resizeObserver.observe(this.tableContainer.nativeElement);
970
+ window.addEventListener('resize', this.onWindowResize);
971
+ this.calculateScrollHeight();
972
+ }
973
+ }
974
+ onWindowResize = () => {
975
+ clearTimeout(this._resizeTimeout);
976
+ this._resizeTimeout = setTimeout(() => {
977
+ this.calculateScrollHeight();
978
+ }, 100);
979
+ };
980
+ calculateScrollHeight() {
981
+ if (this.tableContainer && this.paginatorContainer && this.headerContainer) {
982
+ const containerRect = this.tableContainer.nativeElement.getBoundingClientRect();
983
+ const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight;
984
+ const headerHeight = this.headerContainer.nativeElement.offsetHeight;
985
+ const viewportHeight = window.innerHeight;
986
+ const topOffset = containerRect.top + window.scrollY;
987
+ this.scrollHeight = `${(viewportHeight - topOffset - paginatorHeight - headerHeight) - 45}px`;
988
+ //const containerHeight = this.tableContainer.nativeElement.offsetHeight;
989
+ //const headerHeight = this.headerContainer.nativeElement.offsetHeight;
990
+ //const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight || 50; // fallback
991
+ //this.scrollHeight = `${containerHeight - headerHeight - paginatorHeight}px`;
992
+ //console.log(this.scrollHeight)
993
+ }
994
+ }
995
+ ngOnDestroy() {
996
+ this.resizeObserver?.disconnect();
997
+ window.removeEventListener('resize', this.onWindowResize);
998
+ }
999
+ /**
1000
+ * Used to update the data of a table externally outside the component. Use this method instead of 'updateData' to force the data updata of a table
1001
+ *
1002
+ * @param {(optionalData?: any) => void} [continueAction] - Optional action to execute after data retrieval if it succeeded.
1003
+ * @param {boolean} [uponContinueActionEndModalHttp=false] - Optional flag to set the loading indicator to inactive after data retrieval.
1004
+ */
1005
+ updateData(continueAction, uponContinueActionEndModalHttp = false) {
1006
+ this.isActive = true; // Indicate that the table is now enabled to perform actions
1007
+ if (!this.initialConfigurationFetched) {
1008
+ this.fetchTableConfiguration();
1009
+ }
1010
+ else {
1011
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1012
+ }
1013
+ }
1014
+ fetchTableConfiguration() {
1015
+ if (!this.isActive) {
1016
+ return;
1017
+ }
1018
+ this.tableService.fetchTableConfiguration(this.urlColumnsSource).subscribe({
1019
+ next: (response) => {
1020
+ this.handleTableConfigurationResponse(response.body);
1021
+ this.fetchTableViews();
1022
+ },
1023
+ error: (err) => this.tableService.handleTableError(err, 'Columns Error')
1024
+ });
1025
+ }
1026
+ handleTableConfigurationResponse(body) {
1027
+ this.allowedRowsPerPage = body.allowedItemsPerPage; // Update the number of rows allowed per page
1028
+ this.currentRowsPerPage = Math.min(...this.allowedRowsPerPage); // Update the current rows per page to use the minimum value of allowed rows per page by default
1029
+ this.columns = body.columnsInfo; // Update columns with fetched data
1030
+ this.columnsCantBeHidden = this.columns.filter((col) => !col.canBeHidden); // Filter columns that cannot be hidden
1031
+ this.columnsSelected = this.columns.filter((col) => !col.startHidden && col.canBeHidden); // Selected columns that are not hidden by default
1032
+ this.columnsToShow = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
1033
+ this.dateFormat = body.dateFormat;
1034
+ this.dateTimezone = body.dateTimezone;
1035
+ this.dateCulture = body.dateCulture;
1036
+ this.currentPage = 0;
1037
+ this.initialConfigurationFetched = true;
1038
+ }
1039
+ refreshData(event) {
1040
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1041
+ }
1042
+ tableViewsEnabled() {
1043
+ return (this.tableViewSaveAs !== TableViewSaveMode.noone &&
1044
+ this.tableViewSaveKey !== '');
1045
+ }
1046
+ fetchTableViews() {
1047
+ if (!this.tableViewsEnabled()) {
1048
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1049
+ return;
1050
+ }
1051
+ const tableViews = this.tableService.fetchTableViews(this.tableViewSaveAs, this.viewsGetSourceURL, this.tableViewSaveKey);
1052
+ if (tableViews instanceof Observable) {
1053
+ tableViews.subscribe({
1054
+ next: (response) => {
1055
+ let parsedResult = response.body.map((item) => ({
1056
+ viewAlias: item.viewAlias,
1057
+ viewData: JSON.parse(item.viewData),
1058
+ lastActive: item.lastActive
1059
+ }));
1060
+ this.tableViewListProcess(parsedResult);
1061
+ },
1062
+ error: (err) => this.tableService.handleTableError(err, 'Views get error')
1063
+ });
1064
+ }
1065
+ else {
1066
+ this.tableViewListProcess(tableViews);
1067
+ }
1068
+ }
1069
+ tableViewListProcess(tableViews) {
1070
+ this.tableViewsList = [...tableViews];
1071
+ if (this.tableViewsList.length > 0) {
1072
+ this.tableService.sortViews(this.tableViewsList);
1073
+ }
1074
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
1075
+ const viewToStartup = this.tableViewsList.find(v => v.lastActive);
1076
+ if (viewToStartup) { // If there is a view that needs to be loaded on startup
1077
+ this.viewLoad(viewToStartup.viewAlias);
1078
+ }
1079
+ else {
1080
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1081
+ }
1082
+ }
1083
+ viewLoad(tableViewAlias) {
1084
+ const viewToLoad = this.tableViewsList.find(v => v.viewAlias === tableViewAlias);
1085
+ if (!viewToLoad) {
1086
+ this.notification.showToast("error", "VIEW TO LOAD DOESN'T EXIST", "The view to load doesn't exist");
1087
+ return;
1088
+ }
1089
+ let viewData = viewToLoad.viewData;
1090
+ this.columnsSelected = viewData.columnsShown
1091
+ .map(data => this.columns.find((col) => col.field === data.field))
1092
+ .filter((col) => col !== undefined)
1093
+ .filter(col => !this.columnsCantBeHidden.includes(col));
1094
+ this.columnsToShow = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
1095
+ this.currentPage = viewData.currentPage;
1096
+ this.currentRowsPerPage = viewData.currentRowsPerPage;
1097
+ this.globalSearchText = viewData.globalSearchText;
1098
+ this.tableLazyLoadEventInformation.multiSortMeta = [...(viewData.multiSortMeta ?? [])];
1099
+ this.dt.multiSortMeta = [...(viewData.multiSortMeta ?? [])];
1100
+ this.isActive = false;
1101
+ this.dt.sortMultiple();
1102
+ this.isActive = true;
1103
+ this.tableLazyLoadEventInformation.filters = { ...viewData.filters };
1104
+ this.dt.filters = { ...viewData.filters };
1105
+ this.dt.tableWidthState = viewData.tableWidth;
1106
+ this.dt.columnWidthsState = viewData.columnsWidth;
1107
+ this.tableViewCurrentSelectedAlias = tableViewAlias;
1108
+ this.notification.showToast("info", "TABLE VIEW RESTORED", `The table view '${this.tableViewCurrentSelectedAlias}' has been restored.`);
1109
+ this.viewsModalShow = false;
1110
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1111
+ }
1112
+ viewCreate(viewAlias) {
1113
+ let viewData = this.tableService.viewGenerateData(this.dt, this.globalSearchText, this.currentPage, this.currentRowsPerPage, this.modifyFiltersWithoutGlobalAndSelectedRows.bind(this));
1114
+ let newView = {
1115
+ lastActive: false,
1116
+ viewAlias: viewAlias,
1117
+ viewData: viewData
1118
+ };
1119
+ this.tableViewsList.push(newView);
1120
+ this.tableService.sortViews(this.tableViewsList);
1121
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
1122
+ this.viewsSave(0);
1123
+ }
1124
+ viewDelete(viewAlias) {
1125
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
1126
+ if (index === -1) {
1127
+ this.notification.showToast("error", "Table view delete failed", `The table view could not be deleted since it was not found.`);
1128
+ }
1129
+ this.tableViewsList.splice(index, 1);
1130
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
1131
+ this.viewsSave(3);
1132
+ }
1133
+ viewEditAlias(event) {
1134
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === event.viewAliasOld);
1135
+ if (index === -1) {
1136
+ this.notification.showToast("error", "Table view alias change failed", `The table view alias could not be changed since it was not found.`);
1137
+ }
1138
+ this.tableViewsList[index].viewAlias = event.viewAliasNew;
1139
+ this.tableService.sortViews(this.tableViewsList);
1140
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
1141
+ this.viewsSave(2);
1142
+ }
1143
+ viewUpdateData(viewAlias) {
1144
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
1145
+ if (index === -1) {
1146
+ this.notification.showToast("error", "Table view not found", `The table view to update data from was not found.`);
1147
+ }
1148
+ let viewData = this.tableService.viewGenerateData(this.dt, this.globalSearchText, this.currentPage, this.currentRowsPerPage, this.modifyFiltersWithoutGlobalAndSelectedRows.bind(this));
1149
+ this.tableViewsList[index].viewData = viewData;
1150
+ this.viewsSave(1);
1151
+ }
1152
+ viewsSave(endMessage) {
1153
+ let tableView = JSON.stringify(this.tableViewsList);
1154
+ switch (this.tableViewSaveAs) {
1155
+ case TableViewSaveMode.sessionStorage:
1156
+ sessionStorage.setItem(this.tableViewSaveKey, tableView);
1157
+ break;
1158
+ case TableViewSaveMode.localStorage:
1159
+ localStorage.setItem(this.tableViewSaveKey, tableView);
1160
+ break;
1161
+ case TableViewSaveMode.databaseStorage:
1162
+ const saveObsv = this.tableService.viewsSaveToDatabase(this.tableViewsList, this.viewsSaveSourceURL, this.tableViewSaveKey);
1163
+ saveObsv.subscribe({
1164
+ next: (response) => {
1165
+ this.viewsSaveEnd(endMessage);
1166
+ },
1167
+ error: (err) => this.tableService.handleTableError(err, 'Views save error')
1168
+ });
1169
+ return;
1170
+ default:
1171
+ this.notification.showToast("error", "NOT IMPLEMENTED", "This type os save view has not been implemented yet.");
1172
+ return;
1173
+ }
1174
+ this.viewsSaveEnd(endMessage);
1175
+ }
1176
+ viewsSaveEnd(endMessage) {
1177
+ switch (endMessage) {
1178
+ case 0: // NEW VIEW
1179
+ this.notification.showToast("info", "Table view created", `New table view has been created.`);
1180
+ this.viewsModalShow = false;
1181
+ break;
1182
+ case 1: // UPDATE VIEW
1183
+ this.notification.showToast("info", "Table view data updated", `The table view data was updated.`);
1184
+ break;
1185
+ case 2: // UPDATE ALIAS
1186
+ this.notification.showToast("info", "Table view name updated", `The table view alias was updated.`);
1187
+ break;
1188
+ case 3: // DELETE VIEW
1189
+ this.notification.showToast("info", "Table view delete", `The table view was deleted.`);
1190
+ break;
1191
+ }
1192
+ }
1193
+ fetchTableData(event) {
1194
+ if (!this.isActive) {
1195
+ return;
1196
+ }
1197
+ if (!this.initialConfigurationFetched) {
1198
+ return;
1199
+ }
1200
+ this.tableLazyLoadEventInformation = event; // Store the event information for later use
1201
+ if (event.rows != null && event.rows !== undefined) {
1202
+ this.currentRowsPerPage = event.rows;
1203
+ }
1204
+ if (event.first != null && event.first !== undefined && event.rows != null && event.rows !== undefined) {
1205
+ this.currentPage = event.first / event.rows;
1206
+ }
1207
+ let filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(this.tableLazyLoadEventInformation.filters); // Create filters excluding the global filter
1208
+ filtersWithoutGlobalAndSelectedRows = this.revertDateTimeZoneFilters(filtersWithoutGlobalAndSelectedRows);
1209
+ const requestData = {
1210
+ page: this.currentPage, // Set the current page number
1211
+ pageSize: this.currentRowsPerPage, // Set the number of rows per page
1212
+ sort: this.tableLazyLoadEventInformation.multiSortMeta, // Set the sorting information
1213
+ filter: filtersWithoutGlobalAndSelectedRows, // Set the filters excluding the global filter
1214
+ globalFilter: this.globalSearchText, // Set the global filter text
1215
+ columns: this.columnsToShow.map(col => col.field), // Set the columns to show
1216
+ dateFormat: this.dateFormat,
1217
+ dateTimezone: this.dateTimezone,
1218
+ dateCulture: this.dateCulture
1219
+ };
1220
+ this.tableService.fetchTableData(this.urlDataSource, requestData).subscribe({
1221
+ next: (response) => this.handleTableDataResponse(response.body),
1222
+ error: (err) => this.tableService.handleTableError(err, 'Columns Error')
1223
+ });
1224
+ }
1225
+ modifyFiltersWithoutGlobalAndSelectedRows(filters, overrideOption = -1) {
1226
+ if (this.globalSearchText === "") { // If the global search text is an empty string
1227
+ this.globalSearchText = null; // Set it to null
1228
+ }
1229
+ let filtersWithoutGlobalAndSelectedRows = { ...filters }; // Create a copy of filters to delete the global.
1230
+ if (filtersWithoutGlobalAndSelectedRows.hasOwnProperty('global')) { // If there is an entry with the global filter
1231
+ delete filtersWithoutGlobalAndSelectedRows['global']; // Remove the global filter
1232
+ }
1233
+ this.selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption);
1234
+ return filtersWithoutGlobalAndSelectedRows; // Return the filters without global array
1235
+ }
1236
+ selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption = -1) {
1237
+ if (filtersWithoutGlobalAndSelectedRows.hasOwnProperty('selector')) {
1238
+ const selectorFilter = filtersWithoutGlobalAndSelectedRows['selector'][0];
1239
+ let filterType = null;
1240
+ if (overrideOption < 0 || overrideOption > 2) {
1241
+ filterType = selectorFilter.value;
1242
+ }
1243
+ else {
1244
+ switch (overrideOption) {
1245
+ case 0: // All
1246
+ filterType = null;
1247
+ break;
1248
+ case 1: // Only selected rows
1249
+ filterType = true;
1250
+ break;
1251
+ case 2: // Only NOT selected
1252
+ filterType = false;
1253
+ break;
1254
+ }
1255
+ }
1256
+ if (!filtersWithoutGlobalAndSelectedRows.hasOwnProperty('rowID')) {
1257
+ filtersWithoutGlobalAndSelectedRows['rowID'] = [
1258
+ {
1259
+ "value": null,
1260
+ "matchMode": "in",
1261
+ "operator": "or"
1262
+ }
1263
+ ];
1264
+ }
1265
+ const idFilter = filtersWithoutGlobalAndSelectedRows['rowID'][0];
1266
+ if (filterType === true) {
1267
+ idFilter.matchMode = "in";
1268
+ idFilter.value = this.selectedRowsCheckbox;
1269
+ }
1270
+ else if (filterType === false) {
1271
+ idFilter.operator = "and";
1272
+ idFilter.matchMode = "notIn";
1273
+ idFilter.value = this.selectedRowsCheckbox;
1274
+ }
1275
+ else if (filterType === null) {
1276
+ idFilter.value = null;
1277
+ idFilter.matchMode = "in";
1278
+ }
1279
+ }
1280
+ }
1281
+ revertDateTimeZoneFilters(inputFilter) {
1282
+ this.columnsToShow.forEach((column) => {
1283
+ if (column.dataType === DataType.Date) { // If its date type
1284
+ if (inputFilter.hasOwnProperty(column.field)) {
1285
+ const originalDate = inputFilter[column.field][0].value;
1286
+ if (originalDate !== null && originalDate instanceof Date) {
1287
+ const utcDate = new Date(Date.UTC(originalDate.getFullYear(), originalDate.getMonth(), originalDate.getDate()));
1288
+ inputFilter[column.field][0].value = utcDate;
1289
+ }
1290
+ }
1291
+ }
1292
+ });
1293
+ return inputFilter;
1294
+ }
1295
+ handleTableDataResponse(body) {
1296
+ this.data = body.data; // Update the table data
1297
+ this.totalRecords = body.totalRecords; // Update the total number of records
1298
+ this.totalRecordsNotFiltered = body.totalRecordsNotFiltered; // Update the total records not filtered
1299
+ this.currentPage = body.page; // Update the current page
1300
+ }
1301
+ clearFilters(dt, force = false, onlyGlobalFilter = false) {
1302
+ let hasToClear = this.hasToClearFilters(dt, this.globalSearchText, force);
1303
+ if (hasToClear) {
1304
+ if (!onlyGlobalFilter) {
1305
+ this.predifinedFiltersSelectedValuesCollection = {};
1306
+ for (const key in dt.filters) {
1307
+ if (dt.filters.hasOwnProperty(key)) {
1308
+ const filters = dt.filters[key];
1309
+ if (Array.isArray(filters)) {
1310
+ filters.forEach(filter => {
1311
+ filter.value = null; // Establecer el valor a null
1312
+ });
1313
+ }
1314
+ else {
1315
+ filters.value = null; // Establecer el valor a null
1316
+ }
1317
+ }
1318
+ }
1319
+ let filters = { ...this.dt.filters };
1320
+ dt.columns?.forEach(element => {
1321
+ dt.filter(null, element.field, element.matchMode);
1322
+ });
1323
+ this.dt.filters = filters;
1324
+ }
1325
+ this.globalSearchText = null;
1326
+ dt.filterGlobal('', '');
1327
+ }
1328
+ }
1329
+ clearSorts(dt, force = false) {
1330
+ let hasToClear = this.hasToClearSorts(dt, force);
1331
+ if (hasToClear) {
1332
+ dt.multiSortMeta = [];
1333
+ dt.sortMultiple();
1334
+ }
1335
+ }
1336
+ hasToClearSorts(dt, force = false) {
1337
+ let hasToClear = false;
1338
+ const hasSorts = (dt.multiSortMeta && dt.multiSortMeta.length > 0);
1339
+ if (force || hasSorts) {
1340
+ hasToClear = true;
1341
+ }
1342
+ return hasToClear;
1343
+ }
1344
+ hasToClearFilters(dt, globalSearchText, force = false) {
1345
+ let hasToClear = false;
1346
+ const filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(dt.filters);
1347
+ const hasFilters = this.hasFilters(filtersWithoutGlobalAndSelectedRows);
1348
+ const hasGlobalFilter = (globalSearchText && globalSearchText.trim() !== "");
1349
+ if (force || hasFilters || hasGlobalFilter) {
1350
+ hasToClear = true;
1351
+ }
1352
+ return hasToClear;
1353
+ }
1354
+ /**
1355
+ * Determines whether there are active filters based on the provided filter rules.
1356
+ *
1357
+ * @param {any} filterRules An object representing filter rules for each column.
1358
+ * The keys are column names, and the values are arrays of filter rules.
1359
+ * Each filter rule has the following properties:
1360
+ * - `field`: The field or property name of the column.
1361
+ * - `value`: The filter value entered by the user.
1362
+ * - Other properties depending on the type of filter (e.g., `matchMode` for string filters).
1363
+ * @returns {boolean} `true` if at least one active filter is found, otherwise `false`.
1364
+ */
1365
+ hasFilters(filterRules) {
1366
+ for (const columnName of Object.keys(filterRules)) { // Iterate over each column name in the filter rules
1367
+ const columnFilters = filterRules[columnName]; // Get the filter rules for the current column
1368
+ for (const filterRule of columnFilters) { // Iterate over each filter rule for the current column
1369
+ if (filterRule.value !== null && filterRule.value !== "") { // Check if the filter value is not null or an empty string
1370
+ return true; // At least one active filter found
1371
+ }
1372
+ }
1373
+ }
1374
+ return false; // No active filters found
1375
+ }
1376
+ getColumnStyle(col, headerCols = false) {
1377
+ return this.tableService.getColumnStyle(col, headerCols);
1378
+ }
1379
+ getPredifinedFilterValues(columnKeyName) {
1380
+ return this.predifinedFiltersCollection[columnKeyName] || []; // Return the predefined filter values or an empty array if the option name does not exist
1381
+ }
1382
+ getFrozenColumnAlignAsText(frozenColumnAlign) {
1383
+ return frozenColumnAlignAsText(frozenColumnAlign);
1384
+ }
1385
+ getDataTypeAsText(dataType) {
1386
+ return dataTypeAsText(dataType);
1387
+ }
1388
+ /**
1389
+ * Updates the filters of a PrimeNG data table based on predefined filter changes.
1390
+ *
1391
+ * @param {string} filterName - The name of the filter to be updated.
1392
+ * @param {IPrimengPredifinedFilter[]} selectedValues - An array of selected predefined filter values.
1393
+ */
1394
+ onPredifinedFilterChange(filterName, selectedValues) {
1395
+ const filters = { ...this.dt.filters }; // Create a shallow copy of the current filters to avoid mutating the original filters directly
1396
+ if (Array.isArray(filters[filterName])) { // Check if the filter for the given filterName is an array
1397
+ filters[filterName].forEach(criteria => {
1398
+ criteria.value = selectedValues.map(value => value.value); // Update the value of each criteria with the values from selectedValues
1399
+ });
1400
+ }
1401
+ else if (filters[filterName]) { // Check if the filter for the given filterName exists and is not an array
1402
+ const criteria = filters[filterName]; // Cast the filter criteria to FilterMetadata
1403
+ criteria.value = selectedValues.map(value => value.value); // Update the value of the criteria with the values from selectedValues
1404
+ }
1405
+ this.dt.filters = filters; // Update the data table's filters with the modified filters object
1406
+ this.dt._filter(); // Trigger the filtering operation on the data table to apply the new filters
1407
+ }
1408
+ /**
1409
+ * Retrieves the number of values selected for a predefined filter.
1410
+ *
1411
+ * This function checks the collection of selected values for a specified column key name and returns a string
1412
+ * indicating the number of selected items along with a predefined text.
1413
+ *
1414
+ * @param {string} columnKeyName - The key name of the column for which to retrieve the number of selected values.
1415
+ * @returns {string} A string indicating the number of selected values for the specified column.
1416
+ */
1417
+ predifinedFiltersSelectedValuesText(columnKeyName) {
1418
+ let numbItemsSelected = 0; // Initialize the count of selected items to zero
1419
+ if (this.predifinedFiltersSelectedValuesCollection[columnKeyName]) { // Check if there are selected values for the specified column key
1420
+ numbItemsSelected = this.predifinedFiltersSelectedValuesCollection[columnKeyName].length; // Get the number of selected items
1421
+ }
1422
+ return `${numbItemsSelected} ${this.predifinedFiltersCollectionSelectedValuesText}`; // Return the number of selected items concatenated with the predefined text
1423
+ }
1424
+ handleButtonsClick(action, rowData = null) {
1425
+ this.tableService.handleButtonsClick(action, rowData);
1426
+ }
1427
+ /**
1428
+ * Checks if the provided column metadata matches a specific style of the predefined filters
1429
+ * that need to be applied to an item on a row.
1430
+ *
1431
+ * @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
1432
+ * @param {any} value - The value to be matched against the predefined filter values.
1433
+ * @returns {any} The matching predefined filter value if found, otherwise null.
1434
+ */
1435
+ getPredfinedFilterMatch(colMetadata, value) {
1436
+ if (colMetadata.filterPredifinedValuesName && colMetadata.filterPredifinedValuesName.length > 0) { // Check if the column uses predefined filter values
1437
+ const options = this.getPredifinedFilterValues(colMetadata.filterPredifinedValuesName); // Get the predefined filter values based on the name
1438
+ return options.find(option => option.value === value); // Return the matching option if found
1439
+ }
1440
+ return null; // Return null if the column does not use predefined filter values
1441
+ }
1442
+ copyToClipboardStart(event) {
1443
+ if (this.copyCellDataToClipboardTimeSecs > 0) {
1444
+ const cellContent = event.target.innerText;
1445
+ this.copyCellDataTimer = setTimeout(() => {
1446
+ navigator.clipboard.writeText(cellContent).then(() => {
1447
+ this.notification.clearToasts();
1448
+ this.notification.showToast("info", "CELL CONTENT COPIED", "The cell content has been copied to your clipboard.");
1449
+ }).catch(err => {
1450
+ this.notification.clearToasts();
1451
+ this.notification.showToast("error", "CELL CONTENT COPIED", `The cell content failed to copy to your clipboard with error: ${err}`);
1452
+ });
1453
+ }, this.copyCellDataToClipboardTimeSecs * 1000);
1454
+ }
1455
+ }
1456
+ copyToClipboardCancel() {
1457
+ if (this.copyCellDataToClipboardTimeSecs > 0) {
1458
+ clearTimeout(this.copyCellDataTimer);
1459
+ }
1460
+ }
1461
+ getDataAlignHorizontalAsText(dataAlignHorizontal) {
1462
+ return dataAlignHorizontalAsText(dataAlignHorizontal);
1463
+ }
1464
+ getDataAlignVerticalAsText(dataAlignVertical) {
1465
+ return dataAlignVerticalAsText(dataAlignVertical);
1466
+ }
1467
+ isRowCheckboxSelected(rowID) {
1468
+ return this.selectedRowsCheckbox.includes(rowID);
1469
+ }
1470
+ onRowChekboxChange(event, rowID) {
1471
+ if (event.checked) { // Add the selected item
1472
+ this.selectedRowsCheckbox.push(rowID);
1473
+ }
1474
+ else { // Remove the selected item
1475
+ this.selectedRowsCheckbox = this.selectedRowsCheckbox.filter(selectedId => selectedId !== rowID);
1476
+ }
1477
+ this.onRowCheckboxChange.emit({
1478
+ rowID: rowID,
1479
+ selected: event.checked
1480
+ });
1481
+ }
1482
+ rowSelect(event) {
1483
+ this.onRowSelect.emit({
1484
+ rowID: event.data.rowID,
1485
+ rowData: event.data
1486
+ });
1487
+ }
1488
+ rowUnselect(event) {
1489
+ this.onRowUnselect.emit({
1490
+ rowID: event.data.rowID,
1491
+ rowData: event.data
1492
+ });
1493
+ }
1494
+ pageChange(event) {
1495
+ this.currentPage = event.rows ? event.first / event.rows : 0;
1496
+ this.currentRowsPerPage = event.rows ? event.rows : 0;
1497
+ }
1498
+ columnSelectorShow() {
1499
+ let tempData = this.columns.map(column => {
1500
+ const isSelected = this.columnsSelected.some(selectedColumn => selectedColumn.field === column.field) || this.columnsCantBeHidden.some(selectedColumn => selectedColumn.field === column.field);
1501
+ const isSelectDisabled = this.columnsCantBeHidden.some(selectedColumn => selectedColumn.field === column.field);
1502
+ return {
1503
+ field: column.field,
1504
+ header: column.header,
1505
+ selected: isSelected,
1506
+ selectDisabled: isSelectDisabled,
1507
+ cellOverflowBehaviour: column.cellOverflowBehaviour,
1508
+ cellOverflowBehaviourDisabled: !column.cellOverflowBehaviourAllowUserEdit,
1509
+ dataAlignHorizontal: column.dataAlignHorizontal,
1510
+ dataAlignHorizontalDisabled: !column.dataAlignHorizontalAllowUserEdit,
1511
+ dataAlignVertical: column.dataAlignVertical,
1512
+ dataAlignVerticalDisabled: !column.dataAlignVerticalAllowUserEdit
1513
+ };
1514
+ });
1515
+ tempData.slice().sort((a, b) => {
1516
+ const fieldA = a.header.toUpperCase();
1517
+ const fieldB = b.header.toUpperCase();
1518
+ return fieldA.localeCompare(fieldB);
1519
+ });
1520
+ this.columnModalData = [...tempData];
1521
+ this.filteredColumnData = this.columnModalData;
1522
+ this.showColumnSelector = true;
1523
+ }
1524
+ applyColumnModalChanges(selectedColumns) {
1525
+ const existingColumns = this.dt.columns;
1526
+ const columnsToKeep = new Set();
1527
+ this.columnsCantBeHidden.forEach(col => columnsToKeep.add(col.field));
1528
+ selectedColumns.forEach(col => columnsToKeep.add(col.field));
1529
+ const finalColumns = [];
1530
+ existingColumns.forEach(col => {
1531
+ if (columnsToKeep.has(col.field)) {
1532
+ finalColumns.push(col);
1533
+ }
1534
+ });
1535
+ selectedColumns.forEach(col => {
1536
+ const matchingColumn = this.columns.find(c => c.field === col.field);
1537
+ if (matchingColumn && !finalColumns.find(c => c.field === matchingColumn.field)) {
1538
+ finalColumns.push(matchingColumn);
1539
+ }
1540
+ });
1541
+ let prevColsToShow = this.columnsToShow;
1542
+ this.columnsToShow = this.tableService.orderColumnsWithFrozens(finalColumns);
1543
+ let sameColumnsAsBefore = prevColsToShow.length === this.columnsToShow.length &&
1544
+ prevColsToShow.every((prevCol, index) => prevCol.field === this.columnsToShow[index].field);
1545
+ this.columnsSelected = this.columnsToShow.filter(column => !this.columnsCantBeHidden.some(nonSelectable => nonSelectable.field === column.field));
1546
+ this.updateColumnsSpecialProperties(this.columnModalData);
1547
+ if (!sameColumnsAsBefore) {
1548
+ this.isActive = false;
1549
+ this.clearSorts(this.dt, true);
1550
+ setTimeout(() => {
1551
+ this.isActive = true;
1552
+ this.clearSorts(this.dt, true);
1553
+ }, 1);
1554
+ }
1555
+ }
1556
+ updateColumnsSpecialProperties(columnsSource) {
1557
+ const allColumns = [this.columns, this.columnsToShow, this.columnsSelected, this.columnsCantBeHidden];
1558
+ const columnModalDataMap = new Map(columnsSource.map((item) => [item.field, {
1559
+ cellOverflowBehaviour: item.cellOverflowBehaviour,
1560
+ dataAlignHorizontal: item.dataAlignHorizontal,
1561
+ dataAlignVertical: item.dataAlignVertical,
1562
+ width: item.width
1563
+ }]));
1564
+ const updatedFields = new Set(); // To track updated fields
1565
+ allColumns.forEach((columnList) => {
1566
+ columnList.forEach((col) => {
1567
+ if (columnModalDataMap.has(col.field) && !updatedFields.has(col.field)) {
1568
+ const columnData = columnModalDataMap.get(col.field);
1569
+ if (columnData) {
1570
+ col.cellOverflowBehaviour = columnData.cellOverflowBehaviour;
1571
+ col.dataAlignHorizontal = columnData.dataAlignHorizontal;
1572
+ col.dataAlignVertical = columnData.dataAlignVertical;
1573
+ col.width = columnData.width;
1574
+ updatedFields.add(col.field);
1575
+ }
1576
+ }
1577
+ });
1578
+ });
1579
+ }
1580
+ openExcelExport() {
1581
+ this.excelReportTitle =
1582
+ (!this.excelReportTitleDefault || this.excelReportTitleDefault.trim().length === 0) && !this.excelReportTitleAllowUserEdit
1583
+ ? 'Report'
1584
+ : this.excelReportTitleDefault;
1585
+ this.showExportModal = true;
1586
+ }
1587
+ generateExcelReport(event) {
1588
+ let filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(this.tableLazyLoadEventInformation.filters, event.selectedRows); // Create filters excluding the global filter
1589
+ filtersWithoutGlobalAndSelectedRows = this.revertDateTimeZoneFilters(filtersWithoutGlobalAndSelectedRows);
1590
+ const filtersMustBeApplied = (event.selectedRows === 1 || event.selectedRows === 2)
1591
+ ? true
1592
+ : event.applyFilters;
1593
+ const requestData = {
1594
+ page: this.currentPage, // Set the current page number
1595
+ pageSize: this.currentRowsPerPage, // Set the number of rows per page
1596
+ sort: this.tableLazyLoadEventInformation.multiSortMeta, // Set the sorting information
1597
+ filter: filtersWithoutGlobalAndSelectedRows, // Set the filters excluding the global filter
1598
+ globalFilter: this.globalSearchText, // Set the global filter text
1599
+ columns: this.columnsToShow.map(col => col.field), // Set the columns to show
1600
+ dateFormat: this.dateFormat,
1601
+ dateTimezone: this.dateTimezone,
1602
+ dateCulture: this.dateCulture,
1603
+ allColumns: event.allColumns,
1604
+ applyFilters: filtersMustBeApplied,
1605
+ applySorts: event.applySorts,
1606
+ filename: event.filename
1607
+ };
1608
+ this.tableService.fetchExcelReport(this.urlExcelReport, requestData).subscribe({
1609
+ next: (response) => {
1610
+ this.tableService.downloadFile(response.body, event.filename, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
1611
+ this.showExportModal = false;
1612
+ },
1613
+ error: (err) => this.tableService.handleTableError(err, 'Excel export error')
1614
+ });
1615
+ }
1616
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTable, deps: [{ token: ECSPrimengTableService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
1617
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ECSPrimengTable, isStandalone: true, selector: "ecs-primeng-table", inputs: { isActive: "isActive", data: "data", columnsToShow: "columnsToShow", computeScrollHeight: "computeScrollHeight", globalSearchEnabled: "globalSearchEnabled", globalSearchMaxLength: "globalSearchMaxLength", globalSearchPlaceholder: "globalSearchPlaceholder", columnEditorEnabled: "columnEditorEnabled", urlColumnsSource: "urlColumnsSource", urlDataSource: "urlDataSource", urlExcelReport: "urlExcelReport", predifinedFiltersCollection: "predifinedFiltersCollection", predifinedFiltersNoSelectionPlaceholder: "predifinedFiltersNoSelectionPlaceholder", predifinedFiltersCollectionSelectedValuesText: "predifinedFiltersCollectionSelectedValuesText", rowActionButtons: "rowActionButtons", headerActionButtons: "headerActionButtons", copyCellDataToClipboardTimeSecs: "copyCellDataToClipboardTimeSecs", actionsColumnAligmentRight: "actionsColumnAligmentRight", actionsColumnWidth: "actionsColumnWidth", actionsColumnFrozen: "actionsColumnFrozen", rowSelectorColumnActive: "rowSelectorColumnActive", rowSelectorColumName: "rowSelectorColumName", rowSelectorColumnAligmentRight: "rowSelectorColumnAligmentRight", rowSelectorColumnWidth: "rowSelectorColumnWidth", rowSelectorColumnFrozen: "rowSelectorColumnFrozen", actionsColumnResizable: "actionsColumnResizable", actionColumnName: "actionColumnName", rowselectorColumnResizable: "rowselectorColumnResizable", noDataFoundText: "noDataFoundText", showClearSortAndFilters: "showClearSortAndFilters", excelReportTitleDefault: "excelReportTitleDefault", excelReportTitleAllowUserEdit: "excelReportTitleAllowUserEdit", tableViewSaveAs: "tableViewSaveAs", tableViewSaveKey: "tableViewSaveKey", viewsGetSourceURL: "viewsGetSourceURL", viewsSaveSourceURL: "viewsSaveSourceURL", maxTableViews: "maxTableViews" }, outputs: { onRowCheckboxChange: "onRowCheckboxChange", onRowSelect: "onRowSelect", onRowUnselect: "onRowUnselect" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }, { propertyName: "tableContainer", first: true, predicate: ["tableContainer"], descendants: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true }, { propertyName: "paginatorContainer", first: true, predicate: ["paginatorContainer"], descendants: true }], ngImport: i0, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"computeScrollHeight ? scrollHeight : ''\"\r\n [columns]=\"columnsToShow\" [value]=\"data\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" selectionMode=\"single\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if (rowActionButtons.length > 0) {\r\n <th [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!actionsColumnResizable\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ actionColumnName }}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if (rowActionButtons.length > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of rowActionButtons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\" (clicked)=\"handleButtonsClick($event, rowData)\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': rowSelectorColumnWidth + 'px','min-width': rowSelectorColumnWidth + 'px','width': rowSelectorColumnWidth + 'px'}\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!rowselectorColumnResizable\" pFrozenColumn \r\n [frozen]=\"rowSelectorColumnFrozen\" [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ rowSelectorColumName }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{\r\n 'max-width': rowSelectorColumnWidth + 'px', \r\n 'min-width': rowSelectorColumnWidth + 'px', \r\n 'width': rowSelectorColumnWidth + 'px'\r\n }\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"rowSelectorColumnFrozen\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (columnEditorEnabled) {\r\n <p-button icon=\"pi pi-info\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (showClearSortAndFilters) {\r\n <p-button icon=\"pi pi-sort-alt-slash\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n pTooltip=\"Clear sorts\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n <p-button\r\n icon=\"pi pi-filter-slash\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n pTooltip=\"Clear filters\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/><!--resetTableView()-->\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (globalSearchEnabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"globalSearchPlaceholder\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (urlExcelReport && urlExcelReport.trim().length > 0) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if (headerActionButtons.length > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of headerActionButtons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\" (clicked)=\"handleButtonsClick($event, null)\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredifinedValuesName || col.filterPredifinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName]\"\r\n [options]=\"getPredifinedFilterValues(col.filterPredifinedValuesName)\" [placeholder]=\"predifinedFiltersNoSelectionPlaceholder\"\r\n (onChange)=\"onPredifinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predifinedFiltersSelectedValuesText(col.filterPredifinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>{{ predifinedFiltersNoSelectionPlaceholder }}</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\">\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predifinedFiltersCollection]=\"predifinedFiltersCollection\"/>\r\n </td>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">{{noDataFoundText}}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"rowSelectorColumnActive\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"excelReportTitleAllowUserEdit\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$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: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.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", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i5$1.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "directive", type: i5$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i5$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i5$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i5$1.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", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i12.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: TableCell, selector: "ecs-table-cell", inputs: ["col", "rowData", "globalSearchText", "predifinedFiltersCollection", "dateFormat", "dateTimezone", "dateCulture"] }, { kind: "component", type: TablePredifinedFilters, selector: "ecs-table-predifined-filters", inputs: ["option", "col"] }, { kind: "component", type: TableButton, selector: "ecs-table-button", inputs: ["button", "rowData", "isActionButton", "isLastActionButton"], outputs: ["clicked"] }, { kind: "component", type: ColumnSelector, selector: "ecs-column-selector", inputs: ["visible", "columnModalData", "filteredColumnData"], outputs: ["visibleChange", "applyChanges"] }, { kind: "component", type: ExportExcel, selector: "ecs-export-excel", inputs: ["visible", "rowCheckboxSelectorActive", "excelReportTitle", "allowTitleUserEdit"], outputs: ["exportToExcel", "visibleChange"] }, { kind: "ngmodule", type: ButtonGroupModule }, { kind: "component", type: i14.ButtonGroup, selector: "p-buttonGroup, p-buttongroup, p-button-group" }, { kind: "component", type: ViewsManagement, selector: "ecs-views-management", inputs: ["visible", "tableViews_menuItems"], outputs: ["onViewSelect", "onViewDelete", "onViewUpdateData", "onViewEditAlias", "onViewCreate", "visibleChange"] }], encapsulation: i0.ViewEncapsulation.None });
1618
+ }
1619
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: ECSPrimengTable, decorators: [{
1620
+ type: Component,
1621
+ args: [{ selector: 'ecs-primeng-table', imports: [
1622
+ CommonModule,
1623
+ FormsModule,
1624
+ TableModule,
1625
+ ButtonModule,
1626
+ TooltipModule,
1627
+ InputTextModule,
1628
+ IconFieldModule,
1629
+ InputIconModule,
1630
+ MultiSelectModule,
1631
+ CheckboxModule,
1632
+ PaginatorModule,
1633
+ TableCell,
1634
+ TablePredifinedFilters,
1635
+ TableButton,
1636
+ ColumnSelector,
1637
+ ExportExcel,
1638
+ ButtonGroupModule,
1639
+ ViewsManagement
1640
+ ], standalone: true, encapsulation: ViewEncapsulation.None, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"computeScrollHeight ? scrollHeight : ''\"\r\n [columns]=\"columnsToShow\" [value]=\"data\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" selectionMode=\"single\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if (rowActionButtons.length > 0) {\r\n <th [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!actionsColumnResizable\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ actionColumnName }}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if (rowActionButtons.length > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of rowActionButtons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\" (clicked)=\"handleButtonsClick($event, rowData)\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': rowSelectorColumnWidth + 'px','min-width': rowSelectorColumnWidth + 'px','width': rowSelectorColumnWidth + 'px'}\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!rowselectorColumnResizable\" pFrozenColumn \r\n [frozen]=\"rowSelectorColumnFrozen\" [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ rowSelectorColumName }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{\r\n 'max-width': rowSelectorColumnWidth + 'px', \r\n 'min-width': rowSelectorColumnWidth + 'px', \r\n 'width': rowSelectorColumnWidth + 'px'\r\n }\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"rowSelectorColumnFrozen\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (columnEditorEnabled) {\r\n <p-button icon=\"pi pi-info\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (showClearSortAndFilters) {\r\n <p-button icon=\"pi pi-sort-alt-slash\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n pTooltip=\"Clear sorts\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n <p-button\r\n icon=\"pi pi-filter-slash\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n pTooltip=\"Clear filters\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/><!--resetTableView()-->\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (globalSearchEnabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"globalSearchPlaceholder\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (urlExcelReport && urlExcelReport.trim().length > 0) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if (headerActionButtons.length > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of headerActionButtons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\" (clicked)=\"handleButtonsClick($event, null)\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredifinedValuesName || col.filterPredifinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName]\"\r\n [options]=\"getPredifinedFilterValues(col.filterPredifinedValuesName)\" [placeholder]=\"predifinedFiltersNoSelectionPlaceholder\"\r\n (onChange)=\"onPredifinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predifinedFiltersSelectedValuesText(col.filterPredifinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>{{ predifinedFiltersNoSelectionPlaceholder }}</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\">\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predifinedFiltersCollection]=\"predifinedFiltersCollection\"/>\r\n </td>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">{{noDataFoundText}}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"rowSelectorColumnActive\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"excelReportTitleAllowUserEdit\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"] }]
1641
+ }], ctorParameters: () => [{ type: ECSPrimengTableService }, { type: ECSPrimengTableNotificationService }], propDecorators: { isActive: [{
1642
+ type: Input
1643
+ }], data: [{
1644
+ type: Input
1645
+ }], columnsToShow: [{
1646
+ type: Input
1647
+ }], computeScrollHeight: [{
1648
+ type: Input
1649
+ }], globalSearchEnabled: [{
1650
+ type: Input
1651
+ }], globalSearchMaxLength: [{
1652
+ type: Input
1653
+ }], globalSearchPlaceholder: [{
1654
+ type: Input
1655
+ }], columnEditorEnabled: [{
1656
+ type: Input
1657
+ }], urlColumnsSource: [{
1658
+ type: Input
1659
+ }], urlDataSource: [{
1660
+ type: Input
1661
+ }], urlExcelReport: [{
1662
+ type: Input
1663
+ }], predifinedFiltersCollection: [{
1664
+ type: Input
1665
+ }], predifinedFiltersNoSelectionPlaceholder: [{
1666
+ type: Input
1667
+ }], predifinedFiltersCollectionSelectedValuesText: [{
1668
+ type: Input
1669
+ }], rowActionButtons: [{
1670
+ type: Input
1671
+ }], headerActionButtons: [{
1672
+ type: Input
1673
+ }], copyCellDataToClipboardTimeSecs: [{
1674
+ type: Input
1675
+ }], actionsColumnAligmentRight: [{
1676
+ type: Input
1677
+ }], actionsColumnWidth: [{
1678
+ type: Input
1679
+ }], actionsColumnFrozen: [{
1680
+ type: Input
1681
+ }], rowSelectorColumnActive: [{
1682
+ type: Input
1683
+ }], rowSelectorColumName: [{
1684
+ type: Input
1685
+ }], rowSelectorColumnAligmentRight: [{
1686
+ type: Input
1687
+ }], rowSelectorColumnWidth: [{
1688
+ type: Input
1689
+ }], rowSelectorColumnFrozen: [{
1690
+ type: Input
1691
+ }], actionsColumnResizable: [{
1692
+ type: Input
1693
+ }], actionColumnName: [{
1694
+ type: Input
1695
+ }], rowselectorColumnResizable: [{
1696
+ type: Input
1697
+ }], noDataFoundText: [{
1698
+ type: Input
1699
+ }], showClearSortAndFilters: [{
1700
+ type: Input
1701
+ }], excelReportTitleDefault: [{
1702
+ type: Input
1703
+ }], excelReportTitleAllowUserEdit: [{
1704
+ type: Input
1705
+ }], tableViewSaveAs: [{
1706
+ type: Input
1707
+ }], tableViewSaveKey: [{
1708
+ type: Input
1709
+ }], viewsGetSourceURL: [{
1710
+ type: Input
1711
+ }], viewsSaveSourceURL: [{
1712
+ type: Input
1713
+ }], maxTableViews: [{
1714
+ type: Input
1715
+ }], onRowCheckboxChange: [{
1716
+ type: Output
1717
+ }], onRowSelect: [{
1718
+ type: Output
1719
+ }], onRowUnselect: [{
1720
+ type: Output
1721
+ }], dt: [{
1722
+ type: ViewChild,
1723
+ args: ['dt']
1724
+ }], tableContainer: [{
1725
+ type: ViewChild,
1726
+ args: ['tableContainer', { static: false }]
1727
+ }], headerContainer: [{
1728
+ type: ViewChild,
1729
+ args: ['headerContainer', { static: false }]
1730
+ }], paginatorContainer: [{
1731
+ type: ViewChild,
1732
+ args: ['paginatorContainer', { static: false }]
1733
+ }] } });
1734
+
1735
+ /*
1736
+ * Public API Surface of ecs-primeng-table
1737
+ */
1738
+ // COMPONENTS AND DEPENDENCIES
1739
+
1740
+ /**
1741
+ * Generated bundle index. Do not edit.
1742
+ */
1743
+
1744
+ export { CellOverflowBehaviour, DataAlignHorizontal, DataAlignVertical, DataType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableNotificationService, ECSPrimengTableService, FrozenColumnAlign, TableViewSaveMode };
1745
+ //# sourceMappingURL=ecs-primeng-table.mjs.map