@competer/primeng-table 0.0.0-stage → 14.2.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 (96) hide show
  1. package/README.md +279 -3
  2. package/esm2020/competer-primeng-table.mjs +5 -0
  3. package/esm2020/lib/components/column-selector/column-selector.mjs +147 -0
  4. package/esm2020/lib/components/ecs-primeng-table/ecs-primeng-table.mjs +1411 -0
  5. package/esm2020/lib/components/ecs-primeng-table/ecs-primeng-table.service.mjs +222 -0
  6. package/esm2020/lib/components/export-excel/export-excel.mjs +153 -0
  7. package/esm2020/lib/components/export-excel/export-excel.service.mjs +23 -0
  8. package/esm2020/lib/components/table-button/table-button.mjs +63 -0
  9. package/esm2020/lib/components/table-cell/table-cell.mjs +159 -0
  10. package/esm2020/lib/components/table-predefined-filters/table-predefined-filters.mjs +94 -0
  11. package/esm2020/lib/components/views-management/views-management.mjs +117 -0
  12. package/esm2020/lib/enums/cell-display.enum.mjs +7 -0
  13. package/esm2020/lib/enums/cell-overflow-behaviour.enum.mjs +14 -0
  14. package/esm2020/lib/enums/data-align-horizontal.enum.mjs +16 -0
  15. package/esm2020/lib/enums/data-align-vertical.enum.mjs +16 -0
  16. package/esm2020/lib/enums/data-type.enum.enum.mjs +21 -0
  17. package/esm2020/lib/enums/device-type.enum.mjs +8 -0
  18. package/esm2020/lib/enums/frozen-column-align.enum.mjs +17 -0
  19. package/esm2020/lib/enums/index.mjs +9 -0
  20. package/esm2020/lib/enums/table-view-save-mode.enum.mjs +19 -0
  21. package/esm2020/lib/interfaces/columns-metadata.interface.mjs +2 -0
  22. package/esm2020/lib/interfaces/excel-export-request.interface.mjs +2 -0
  23. package/esm2020/lib/interfaces/index.mjs +11 -0
  24. package/esm2020/lib/interfaces/predefined-filter.interface.mjs +2 -0
  25. package/esm2020/lib/interfaces/table-button.interface.mjs +2 -0
  26. package/esm2020/lib/interfaces/table-configuration.interface.mjs +2 -0
  27. package/esm2020/lib/interfaces/table-options.interface.mjs +107 -0
  28. package/esm2020/lib/interfaces/table-paged-response.interface.mjs +2 -0
  29. package/esm2020/lib/interfaces/table-query-request.interface.mjs +2 -0
  30. package/esm2020/lib/interfaces/table-view-data.interface.mjs +2 -0
  31. package/esm2020/lib/interfaces/table-view.interface.mjs +2 -0
  32. package/esm2020/lib/pipes/ui-translate.pipe.mjs +21 -0
  33. package/esm2020/lib/services/http.service.mjs +18 -0
  34. package/esm2020/lib/services/i18n.service.mjs +61 -0
  35. package/esm2020/lib/services/index.mjs +5 -0
  36. package/esm2020/lib/services/notification.service.mjs +17 -0
  37. package/esm2020/lib/services/table-state.service.mjs +38 -0
  38. package/esm2020/lib/utils/create-table-options.mjs +37 -0
  39. package/esm2020/lib/utils/data-align-horizontal-as-text.mjs +23 -0
  40. package/esm2020/lib/utils/data-align-vertical-as-text.mjs +23 -0
  41. package/esm2020/lib/utils/data-type-as-text.mjs +25 -0
  42. package/esm2020/lib/utils/frozen-column-align-as-text.mjs +21 -0
  43. package/esm2020/lib/utils/highlight-text.mjs +36 -0
  44. package/esm2020/lib/utils/index.mjs +7 -0
  45. package/esm2020/lib/utils/tree-table-state.mjs +239 -0
  46. package/esm2020/public-api.mjs +19 -0
  47. package/fesm2015/competer-primeng-table.mjs +3119 -0
  48. package/fesm2015/competer-primeng-table.mjs.map +1 -0
  49. package/fesm2020/competer-primeng-table.mjs +3049 -0
  50. package/fesm2020/competer-primeng-table.mjs.map +1 -0
  51. package/index.d.ts +5 -0
  52. package/lib/components/column-selector/column-selector.d.ts +55 -0
  53. package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +256 -0
  54. package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +52 -0
  55. package/lib/components/export-excel/export-excel.d.ts +51 -0
  56. package/lib/components/export-excel/export-excel.service.d.ts +6 -0
  57. package/lib/components/table-button/table-button.d.ts +16 -0
  58. package/lib/components/table-cell/table-cell.d.ts +69 -0
  59. package/lib/components/table-predefined-filters/table-predefined-filters.d.ts +39 -0
  60. package/lib/components/views-management/views-management.d.ts +34 -0
  61. package/lib/enums/cell-display.enum.d.ts +5 -0
  62. package/lib/enums/cell-overflow-behaviour.enum.d.ts +12 -0
  63. package/lib/enums/data-align-horizontal.enum.d.ts +14 -0
  64. package/lib/enums/data-align-vertical.enum.d.ts +14 -0
  65. package/lib/enums/data-type.enum.enum.d.ts +19 -0
  66. package/lib/enums/device-type.enum.d.ts +6 -0
  67. package/lib/enums/frozen-column-align.enum.d.ts +15 -0
  68. package/lib/enums/index.d.ts +8 -0
  69. package/lib/enums/table-view-save-mode.enum.d.ts +17 -0
  70. package/lib/interfaces/columns-metadata.interface.d.ts +66 -0
  71. package/lib/interfaces/excel-export-request.interface.d.ts +20 -0
  72. package/lib/interfaces/index.d.ts +10 -0
  73. package/lib/interfaces/predefined-filter.interface.d.ts +101 -0
  74. package/lib/interfaces/table-button.interface.d.ts +75 -0
  75. package/lib/interfaces/table-configuration.interface.d.ts +23 -0
  76. package/lib/interfaces/table-options.interface.d.ts +604 -0
  77. package/lib/interfaces/table-paged-response.interface.d.ts +16 -0
  78. package/lib/interfaces/table-query-request.interface.d.ts +28 -0
  79. package/lib/interfaces/table-view-data.interface.d.ts +28 -0
  80. package/lib/interfaces/table-view.interface.d.ts +15 -0
  81. package/lib/pipes/ui-translate.pipe.d.ts +13 -0
  82. package/lib/services/http.service.d.ts +34 -0
  83. package/lib/services/i18n.service.d.ts +20 -0
  84. package/lib/services/index.d.ts +4 -0
  85. package/lib/services/notification.service.d.ts +23 -0
  86. package/lib/services/table-state.service.d.ts +31 -0
  87. package/lib/utils/create-table-options.d.ts +5 -0
  88. package/lib/utils/data-align-horizontal-as-text.d.ts +11 -0
  89. package/lib/utils/data-align-vertical-as-text.d.ts +11 -0
  90. package/lib/utils/data-type-as-text.d.ts +11 -0
  91. package/lib/utils/frozen-column-align-as-text.d.ts +11 -0
  92. package/lib/utils/highlight-text.d.ts +17 -0
  93. package/lib/utils/index.d.ts +6 -0
  94. package/lib/utils/tree-table-state.d.ts +66 -0
  95. package/package.json +58 -3
  96. package/public-api.d.ts +10 -0
@@ -0,0 +1,3119 @@
1
+ import { __awaiter } from 'tslib';
2
+ import * as i0 from '@angular/core';
3
+ import { Injectable, inject, Pipe, Component, Input, EventEmitter, ViewChild, Output, ChangeDetectorRef, ViewEncapsulation, HostListener } from '@angular/core';
4
+ import * as i1$2 from '@ngx-translate/core';
5
+ import { TranslateService, TranslateDefaultParser, TranslateModule } from '@ngx-translate/core';
6
+ import * as i3$2 from 'primeng/api';
7
+ import { PrimeNGConfig, TranslationKeys } from 'primeng/api';
8
+ import { Subject, merge, EMPTY, takeUntil, Observable, finalize, firstValueFrom } from 'rxjs';
9
+ import * as i1$1 from '@angular/common';
10
+ import { CommonModule } from '@angular/common';
11
+ import * as i6$1 from '@angular/forms';
12
+ import { FormsModule } from '@angular/forms';
13
+ import * as i6 from 'primeng/table';
14
+ import { TableModule } from 'primeng/table';
15
+ import * as i5 from 'primeng/button';
16
+ import { ButtonModule } from 'primeng/button';
17
+ import * as i3$1 from 'primeng/tooltip';
18
+ import { TooltipModule } from 'primeng/tooltip';
19
+ import * as i10 from 'primeng/inputtext';
20
+ import { InputTextModule } from 'primeng/inputtext';
21
+ import * as i11 from 'primeng/multiselect';
22
+ import { MultiSelectModule } from 'primeng/multiselect';
23
+ import * as i5$1 from 'primeng/checkbox';
24
+ import { CheckboxModule } from 'primeng/checkbox';
25
+ import * as i13 from 'primeng/paginator';
26
+ import { PaginatorModule } from 'primeng/paginator';
27
+ import * as i14 from 'primeng/overlaypanel';
28
+ import { OverlayPanelModule } from 'primeng/overlaypanel';
29
+ import * as i15 from 'primeng/menu';
30
+ import { MenuModule } from 'primeng/menu';
31
+ import * as i3 from 'primeng/skeleton';
32
+ import { SkeletonModule } from 'primeng/skeleton';
33
+ import * as i4 from 'primeng/tag';
34
+ import { TagModule } from 'primeng/tag';
35
+ import * as i1 from '@angular/platform-browser';
36
+ import { HttpHeaders } from '@angular/common/http';
37
+ import { DomHandler } from 'primeng/dom';
38
+ import * as i2 from 'primeng/dialog';
39
+ import { DialogModule } from 'primeng/dialog';
40
+ import * as i7 from 'primeng/selectbutton';
41
+ import { SelectButtonModule } from 'primeng/selectbutton';
42
+
43
+ /**
44
+ * Defines how content that overflows a table cell is displayed.
45
+ *
46
+ * @remarks
47
+ * This enumeration specifies the visual behavior of cell content when it exceeds the cell’s width.
48
+ */
49
+ var CellOverflowBehaviour;
50
+ (function (CellOverflowBehaviour) {
51
+ /** The overflowing content is clipped and not visible. */
52
+ CellOverflowBehaviour[CellOverflowBehaviour["Hidden"] = 0] = "Hidden";
53
+ /** The content wraps onto multiple lines to fit within the cell. */
54
+ CellOverflowBehaviour[CellOverflowBehaviour["Wrap"] = 1] = "Wrap";
55
+ })(CellOverflowBehaviour || (CellOverflowBehaviour = {}));
56
+
57
+ /**
58
+ * Defines the horizontal alignment of content within a table cell.
59
+ *
60
+ * @remarks
61
+ * Specifies how the content inside a cell is positioned horizontally relative to the cell's width.
62
+ */
63
+ var DataAlignHorizontal;
64
+ (function (DataAlignHorizontal) {
65
+ /** Content is aligned to the left side of the cell. */
66
+ DataAlignHorizontal[DataAlignHorizontal["Left"] = 0] = "Left";
67
+ /** Content is aligned to the center of the cell. */
68
+ DataAlignHorizontal[DataAlignHorizontal["Center"] = 1] = "Center";
69
+ /** Content is aligned to the right side of the cell. */
70
+ DataAlignHorizontal[DataAlignHorizontal["Right"] = 2] = "Right";
71
+ })(DataAlignHorizontal || (DataAlignHorizontal = {}));
72
+
73
+ /**
74
+ * Enum representing the vertical alignment of content within a table cell.
75
+ *
76
+ * @remarks
77
+ * Determines how the content inside a cell is positioned vertically relative to the cell's height.
78
+ */
79
+ var DataAlignVertical;
80
+ (function (DataAlignVertical) {
81
+ /** Align content to the top of the cell. */
82
+ DataAlignVertical[DataAlignVertical["Top"] = 0] = "Top";
83
+ /** Align content to the vertical middle of the cell. */
84
+ DataAlignVertical[DataAlignVertical["Middle"] = 1] = "Middle";
85
+ /** Align content to the bottom of the cell. */
86
+ DataAlignVertical[DataAlignVertical["Bottom"] = 2] = "Bottom";
87
+ })(DataAlignVertical || (DataAlignVertical = {}));
88
+
89
+ /**
90
+ * Enum representing the different types of data a table column can hold.
91
+ *
92
+ * @remarks
93
+ * This is used to determine how values should be rendered, formatted, and
94
+ * filtered in the table component.
95
+ */
96
+ var DataType;
97
+ (function (DataType) {
98
+ /** Plain text string values. */
99
+ DataType[DataType["Text"] = 0] = "Text";
100
+ /** Numeric values, e.g., integers or decimals. */
101
+ DataType[DataType["Numeric"] = 1] = "Numeric";
102
+ /** Boolean values (true/false). */
103
+ DataType[DataType["Boolean"] = 2] = "Boolean";
104
+ /** Date or datetime values. */
105
+ DataType[DataType["Date"] = 3] = "Date";
106
+ /** List of values, stored as a string separated by a delimiter (";"). */
107
+ DataType[DataType["List"] = 4] = "List";
108
+ })(DataType || (DataType = {}));
109
+
110
+ /**
111
+ * Enum representing the alignment of frozen columns in a table.
112
+ *
113
+ * @remarks
114
+ * Used to determine if a column should be frozen, and if so, on which side
115
+ * of the table it should appear.
116
+ */
117
+ var FrozenColumnAlign;
118
+ (function (FrozenColumnAlign) {
119
+ /** The column is not frozen. */
120
+ FrozenColumnAlign[FrozenColumnAlign["Noone"] = 0] = "Noone";
121
+ /** The column is frozen on the left side of the table. */
122
+ FrozenColumnAlign[FrozenColumnAlign["Left"] = 1] = "Left";
123
+ /** The column is frozen on the right side of the table. */
124
+ FrozenColumnAlign[FrozenColumnAlign["Right"] = 2] = "Right";
125
+ })(FrozenColumnAlign || (FrozenColumnAlign = {}));
126
+
127
+ /**
128
+ * Enum representing the mode used to save the state or configuration of a table view.
129
+ *
130
+ * @remarks
131
+ * Determines where and how the table's view settings (e.g., column order, filters,
132
+ * sorting) are persisted.
133
+ */
134
+ var TableViewSaveMode;
135
+ (function (TableViewSaveMode) {
136
+ /** Views are disabled. */
137
+ TableViewSaveMode[TableViewSaveMode["None"] = 0] = "None";
138
+ /** Save the table view state in the browser's sessionStorage (cleared on tab close). */
139
+ TableViewSaveMode[TableViewSaveMode["SessionStorage"] = 1] = "SessionStorage";
140
+ /** Save the table view state in the browser's localStorage (persists across sessions). */
141
+ TableViewSaveMode[TableViewSaveMode["LocalStorage"] = 2] = "LocalStorage";
142
+ /** Save the table view state in a backend database (requires server support). */
143
+ TableViewSaveMode[TableViewSaveMode["DatabaseStorage"] = 3] = "DatabaseStorage";
144
+ })(TableViewSaveMode || (TableViewSaveMode = {}));
145
+
146
+ /** Viewport categories; numeric values match the backend DeviceType enum. */
147
+ var DeviceType;
148
+ (function (DeviceType) {
149
+ DeviceType[DeviceType["Mobile"] = 0] = "Mobile";
150
+ DeviceType[DeviceType["Tablet"] = 1] = "Tablet";
151
+ DeviceType[DeviceType["Desktop"] = 2] = "Desktop";
152
+ })(DeviceType || (DeviceType = {}));
153
+
154
+ /** Cell presentation. Filtering, sorting and export continue to use DataType. */
155
+ var CellDisplay;
156
+ (function (CellDisplay) {
157
+ CellDisplay[CellDisplay["Default"] = 0] = "Default";
158
+ CellDisplay[CellDisplay["ProgressBar"] = 1] = "ProgressBar";
159
+ })(CellDisplay || (CellDisplay = {}));
160
+
161
+ /** Default configuration options for ECS Primeng table */
162
+ const DEFAULT_TABLE_OPTIONS = {
163
+ isActive: true,
164
+ responsive: {
165
+ tabletMinWidth: 768,
166
+ desktopMinWidth: 1200,
167
+ headerMenu: false,
168
+ rowMenu: false,
169
+ headerMenuLabel: 'Table actions',
170
+ rowMenuLabel: 'Row actions'
171
+ },
172
+ statePersistence: { enabled: false },
173
+ urlTableConfiguration: undefined,
174
+ urlTableData: undefined,
175
+ data: [],
176
+ columnDescriptionIcon: "pi pi-info-circle",
177
+ description: {
178
+ icon: "pi pi-info-circle",
179
+ tooltip: true,
180
+ text: undefined
181
+ },
182
+ legend: {
183
+ content: undefined,
184
+ button: {
185
+ icon: "pi pi-bars",
186
+ label: "Legend"
187
+ }
188
+ },
189
+ header: {
190
+ buttons: [],
191
+ clearSortsEnabled: true,
192
+ clearSortsIcon: "pi pi-sort-alt-slash",
193
+ clearFiltersEnabled: true,
194
+ clearFiltersIcon: "pi pi-filter-slash"
195
+ },
196
+ columns: {
197
+ selectorEnabled: true,
198
+ selectorIcon: "pi pi-pencil",
199
+ selectorOrderByColumnName: true,
200
+ shown: []
201
+ },
202
+ rows: {
203
+ style: () => ({}),
204
+ class: () => ({}),
205
+ action: {
206
+ buttons: [],
207
+ header: "Actions",
208
+ positionRight: true,
209
+ width: 150,
210
+ frozen: true,
211
+ resizable: false,
212
+ horizontalAlignment: DataAlignHorizontal.Center,
213
+ verticalAlignment: DataAlignVertical.Middle
214
+ },
215
+ checkboxSelector: {
216
+ enabled: false,
217
+ selectAllEnabled: false,
218
+ urlSelectAll: undefined,
219
+ header: "Selected",
220
+ positionRight: false,
221
+ width: 150,
222
+ frozen: true,
223
+ resizable: false,
224
+ enabledCondition: undefined,
225
+ horizontalAlignment: DataAlignHorizontal.Center,
226
+ verticalAlignment: DataAlignVertical.Middle
227
+ },
228
+ singleSelector: {
229
+ enabled: false,
230
+ metakey: true
231
+ }
232
+ },
233
+ verticalScroll: {
234
+ fitToContainer: true,
235
+ height: 0,
236
+ cssFormula: undefined
237
+ },
238
+ globalFilter: {
239
+ enabled: true,
240
+ minLength: 0,
241
+ debounceTime: 0,
242
+ maxLength: 20
243
+ },
244
+ predefinedFilters: {},
245
+ views: {
246
+ saveMode: TableViewSaveMode.None,
247
+ saveKey: undefined,
248
+ urlGet: undefined,
249
+ urlSave: undefined,
250
+ selectViewButtonClass: undefined,
251
+ reloadViewButtonClass: undefined,
252
+ reloadViewButtonIcon: "pi pi-refresh",
253
+ noViewSelectedText: "--- Select a view ---"
254
+ },
255
+ resetTableView: {
256
+ enabled: true,
257
+ icon: "pi pi-eraser"
258
+ },
259
+ excelReport: {
260
+ url: undefined,
261
+ defaultTitle: "Report",
262
+ titleAllowUserEdit: true
263
+ },
264
+ copyToClipboardTime: 0.5
265
+ };
266
+
267
+ /**
268
+ * Deep merge two objects.
269
+ * Recursively copies properties from `source` into `target`,
270
+ * but ignores `undefined` values to preserve defaults.
271
+ */
272
+ function deepMerge(target, source) {
273
+ for (const key in source) {
274
+ const value = source[key];
275
+ if (value === undefined) { // skip undefined values to keep defaults
276
+ continue;
277
+ }
278
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
279
+ if (!target[key])
280
+ target[key] = {};
281
+ deepMerge(target[key], value);
282
+ }
283
+ else {
284
+ target[key] = value;
285
+ }
286
+ }
287
+ return target;
288
+ }
289
+ /**
290
+ * Create table options based on defaults, with optional overrides.
291
+ */
292
+ function createTableOptions(overrides = {}) {
293
+ var _a, _b;
294
+ const defaultsCopy = JSON.parse(JSON.stringify(DEFAULT_TABLE_OPTIONS)); // clone only data
295
+ const merged = deepMerge(defaultsCopy, overrides);
296
+ // Reasign function if they exist in override
297
+ if ((_a = overrides.rows) === null || _a === void 0 ? void 0 : _a.style)
298
+ merged.rows.style = overrides.rows.style;
299
+ if ((_b = overrides.rows) === null || _b === void 0 ? void 0 : _b.class)
300
+ merged.rows.class = overrides.rows.class;
301
+ return merged;
302
+ }
303
+
304
+ class TreeTableState {
305
+ constructor(options) {
306
+ var _a, _b, _c, _d;
307
+ this.options = options;
308
+ this.expanded = new Set();
309
+ this.nodes = new Map();
310
+ this.children = new Map();
311
+ this.totals = new Map();
312
+ this.pages = new Map();
313
+ this.entries = new WeakMap();
314
+ this.roots = [];
315
+ this.allRoots = [];
316
+ this.version = 0;
317
+ this.pending = new Set();
318
+ this.restoredPages = {};
319
+ this.visible = [];
320
+ this.loading = false;
321
+ this.page = 0;
322
+ this.pageSize = 10;
323
+ this.totalRecords = 0;
324
+ this.totalRecordsNotFiltered = 0;
325
+ if (!((_a = options.keyExpr) === null || _a === void 0 ? void 0 : _a.trim()) || !((_b = options.parentIdExpr) === null || _b === void 0 ? void 0 : _b.trim()) || !((_c = options.column) === null || _c === void 0 ? void 0 : _c.trim())) {
326
+ throw new Error('Tree configuration requires keyExpr, parentIdExpr and column.');
327
+ }
328
+ if (!['all', 'onDemand', 'pagedChildren'].includes(this.mode)) {
329
+ throw new Error('Invalid tree loadMode.');
330
+ }
331
+ if (this.mode !== 'all' && !((_d = options.hasItemsExpr) === null || _d === void 0 ? void 0 : _d.trim())) {
332
+ throw new Error('Remote tree loading requires hasItemsExpr.');
333
+ }
334
+ }
335
+ get mode() { var _a; return (_a = this.options.loadMode) !== null && _a !== void 0 ? _a : 'onDemand'; }
336
+ get rootValue() { return this.options.rootValue === undefined ? 0 : this.options.rootValue; }
337
+ key(row) {
338
+ const key = row[this.options.keyExpr];
339
+ if ((typeof key !== 'string' && typeof key !== 'number') || key === '' ||
340
+ (typeof key === 'number' && !Number.isFinite(key))) {
341
+ throw new Error('Tree keys must be non-empty strings or finite numbers.');
342
+ }
343
+ return key;
344
+ }
345
+ restore(keys = [], pages = {}) {
346
+ this.expanded.clear();
347
+ keys.forEach(key => this.expanded.add(key));
348
+ this.restoredPages = Object.assign({}, pages);
349
+ }
350
+ snapshotPages() {
351
+ return Object.fromEntries([...this.pages].map(([key, page]) => [JSON.stringify(key), page]));
352
+ }
353
+ depth(row) { var _a, _b; return (_b = (_a = this.entries.get(row)) === null || _a === void 0 ? void 0 : _a.depth) !== null && _b !== void 0 ? _b : 0; }
354
+ isMore(row) { var _a; return !!((_a = this.entries.get(row)) === null || _a === void 0 ? void 0 : _a.more); }
355
+ moreParent(row) { var _a; return (_a = this.entries.get(row)) === null || _a === void 0 ? void 0 : _a.parent; }
356
+ isExpanded(row) { return this.expanded.has(this.key(row)); }
357
+ isLoading(row) { return this.pending.has(this.key(row)); }
358
+ hasChildren(row) {
359
+ var _a;
360
+ if (this.mode === 'all')
361
+ return !!((_a = this.children.get(this.key(row))) === null || _a === void 0 ? void 0 : _a.length);
362
+ return row[this.options.hasItemsExpr] === true;
363
+ }
364
+ cancel() { this.version++; this.loading = false; this.pending.clear(); }
365
+ load(page, pageSize, fetch) {
366
+ var _a, _b, _c, _d, _e;
367
+ return __awaiter(this, void 0, void 0, function* () {
368
+ const version = ++this.version;
369
+ this.loading = true;
370
+ this.pending.clear();
371
+ this.nodes.clear();
372
+ this.children.clear();
373
+ this.totals.clear();
374
+ this.pages.clear();
375
+ this.visible = [];
376
+ this.page = page;
377
+ this.pageSize = pageSize;
378
+ try {
379
+ const response = yield fetch({ roots: true, parentId: this.rootValue, loadMode: this.mode, page, pageSize });
380
+ if (version !== this.version)
381
+ return false;
382
+ this.insert(response.data);
383
+ this.page = response.page;
384
+ this.totalRecords = response.totalRecords;
385
+ this.totalRecordsNotFiltered = response.totalRecordsNotFiltered;
386
+ if (this.mode === 'all') {
387
+ this.buildAll();
388
+ this.page = Math.min(Math.max(0, page), Math.max(0, Math.ceil(this.allRoots.length / pageSize) - 1));
389
+ this.roots = this.allRoots.slice(this.page * pageSize, (this.page + 1) * pageSize);
390
+ }
391
+ else {
392
+ this.roots = response.data.map(row => this.key(row));
393
+ }
394
+ (_a = response.ancestorKeys) === null || _a === void 0 ? void 0 : _a.forEach(key => this.expanded.add(key));
395
+ const queue = [...this.roots];
396
+ for (let cursor = 0; cursor < queue.length; cursor++) {
397
+ const key = queue[cursor];
398
+ const row = this.nodes.get(key);
399
+ if (!this.expanded.has(key) || !this.hasChildren(row))
400
+ continue;
401
+ if (this.mode !== 'all') {
402
+ yield this.fetchChildren(key, 0, fetch, version);
403
+ const targetPage = (_b = this.restoredPages[JSON.stringify(key)]) !== null && _b !== void 0 ? _b : 0;
404
+ while (version === this.version && this.mode === 'pagedChildren' &&
405
+ ((_c = this.pages.get(key)) !== null && _c !== void 0 ? _c : 0) < targetPage && this.hasMore(key)) {
406
+ yield this.fetchChildren(key, ((_d = this.pages.get(key)) !== null && _d !== void 0 ? _d : 0) + 1, fetch, version);
407
+ }
408
+ }
409
+ if (version !== this.version)
410
+ return false;
411
+ queue.push(...((_e = this.children.get(key)) !== null && _e !== void 0 ? _e : []));
412
+ }
413
+ this.restoredPages = {};
414
+ this.rebuild();
415
+ return true;
416
+ }
417
+ finally {
418
+ if (version === this.version)
419
+ this.loading = false;
420
+ }
421
+ });
422
+ }
423
+ toggle(row, fetch) {
424
+ var _a;
425
+ return __awaiter(this, void 0, void 0, function* () {
426
+ const key = this.key(row);
427
+ if (this.pending.has(key))
428
+ return;
429
+ if (this.expanded.delete(key)) {
430
+ this.rebuild();
431
+ return;
432
+ }
433
+ this.expanded.add(key);
434
+ const version = this.version;
435
+ try {
436
+ const queue = [key];
437
+ for (let cursor = 0; cursor < queue.length; cursor++) {
438
+ const current = queue[cursor];
439
+ if (this.mode !== 'all' && !this.children.has(current))
440
+ yield this.fetchChildren(current, 0, fetch, version);
441
+ if (version !== this.version)
442
+ return;
443
+ for (const child of (_a = this.children.get(current)) !== null && _a !== void 0 ? _a : []) {
444
+ if (this.expanded.has(child) && this.hasChildren(this.nodes.get(child)))
445
+ queue.push(child);
446
+ }
447
+ }
448
+ this.rebuild();
449
+ }
450
+ catch (error) {
451
+ if (version === this.version)
452
+ this.expanded.delete(key);
453
+ throw error;
454
+ }
455
+ });
456
+ }
457
+ loadMore(row, fetch) {
458
+ var _a;
459
+ return __awaiter(this, void 0, void 0, function* () {
460
+ const parent = this.moreParent(row);
461
+ if (parent === undefined || this.pending.has(parent))
462
+ return;
463
+ const version = this.version;
464
+ yield this.fetchChildren(parent, ((_a = this.pages.get(parent)) !== null && _a !== void 0 ? _a : 0) + 1, fetch, version);
465
+ if (version === this.version)
466
+ this.rebuild();
467
+ });
468
+ }
469
+ insert(rows) {
470
+ const keys = new Set();
471
+ for (const row of rows) {
472
+ const key = this.key(row);
473
+ if (keys.has(key) || this.nodes.has(key))
474
+ throw new Error('Duplicate tree key.');
475
+ keys.add(key);
476
+ }
477
+ for (const row of rows)
478
+ this.nodes.set(this.key(row), row);
479
+ }
480
+ buildAll() {
481
+ var _a, _b;
482
+ this.allRoots = [];
483
+ for (const [key, row] of this.nodes) {
484
+ const parent = row[this.options.parentIdExpr];
485
+ if (parent === this.rootValue)
486
+ this.allRoots.push(key);
487
+ else {
488
+ if (!this.nodes.has(parent))
489
+ throw new Error('Missing tree parent.');
490
+ const siblings = (_a = this.children.get(parent)) !== null && _a !== void 0 ? _a : [];
491
+ siblings.push(key);
492
+ this.children.set(parent, siblings);
493
+ }
494
+ }
495
+ const seen = new Set();
496
+ const queue = [...this.allRoots];
497
+ for (let cursor = 0; cursor < queue.length; cursor++) {
498
+ const key = queue[cursor];
499
+ if (seen.has(key))
500
+ throw new Error('Tree cycle.');
501
+ seen.add(key);
502
+ queue.push(...((_b = this.children.get(key)) !== null && _b !== void 0 ? _b : []));
503
+ }
504
+ if (seen.size !== this.nodes.size)
505
+ throw new Error('Tree cycle.');
506
+ }
507
+ fetchChildren(key, page, fetch, version) {
508
+ var _a, _b;
509
+ return __awaiter(this, void 0, void 0, function* () {
510
+ this.pending.add(key);
511
+ try {
512
+ const response = yield fetch({ roots: false, parentId: key, loadMode: this.mode, page, pageSize: this.pageSize });
513
+ if (version !== this.version)
514
+ return;
515
+ for (const row of response.data) {
516
+ if (row[this.options.parentIdExpr] !== key)
517
+ throw new Error('Unexpected tree parent.');
518
+ }
519
+ this.insert(response.data);
520
+ this.children.set(key, [...((_a = this.children.get(key)) !== null && _a !== void 0 ? _a : []), ...response.data.map(row => this.key(row))]);
521
+ this.totals.set(key, response.totalRecords);
522
+ this.pages.set(key, response.page);
523
+ (_b = response.ancestorKeys) === null || _b === void 0 ? void 0 : _b.forEach(ancestor => this.expanded.add(ancestor));
524
+ }
525
+ finally {
526
+ if (version === this.version)
527
+ this.pending.delete(key);
528
+ }
529
+ });
530
+ }
531
+ hasMore(key) {
532
+ var _a, _b, _c;
533
+ return ((_b = (_a = this.children.get(key)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) < ((_c = this.totals.get(key)) !== null && _c !== void 0 ? _c : 0);
534
+ }
535
+ rebuild() {
536
+ var _a;
537
+ this.entries = new WeakMap();
538
+ const result = [];
539
+ const stack = this.roots.map(key => ({ row: this.nodes.get(key), depth: 0 })).reverse();
540
+ while (stack.length) {
541
+ const entry = stack.pop();
542
+ this.entries.set(entry.row, entry);
543
+ result.push(entry.row);
544
+ if (entry.more)
545
+ continue;
546
+ const key = this.key(entry.row);
547
+ if (!this.expanded.has(key))
548
+ continue;
549
+ if (this.hasMore(key))
550
+ stack.push({ row: {}, depth: entry.depth + 1, parent: key, more: true });
551
+ const children = (_a = this.children.get(key)) !== null && _a !== void 0 ? _a : [];
552
+ for (let index = children.length - 1; index >= 0; index--) {
553
+ stack.push({ row: this.nodes.get(children[index]), depth: entry.depth + 1, parent: key });
554
+ }
555
+ }
556
+ this.visible = result;
557
+ }
558
+ }
559
+
560
+ /**
561
+ * Abstract service for handling HTTP requests for **ECS Primeng table**.
562
+ *
563
+ * Provides a consistent interface for making GET and POST requests to the backend.
564
+ * Implementations must define how requests are executed, including error handling,
565
+ * headers, and response processing.
566
+ */
567
+ class ECSPrimengTableHttpService {
568
+ }
569
+ ECSPrimengTableHttpService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableHttpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
570
+ ECSPrimengTableHttpService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableHttpService, providedIn: 'root' });
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableHttpService, decorators: [{
572
+ type: Injectable,
573
+ args: [{ providedIn: 'root' }]
574
+ }] });
575
+
576
+ /**
577
+ * Abstract service for handling notifications in **ECS Primeng table**.
578
+ *
579
+ * Provides a consistent interface for displaying and clearing toast notifications.
580
+ * Implementations must define how the notifications are managed.
581
+ */
582
+ class ECSPrimengTableNotificationService {
583
+ }
584
+ ECSPrimengTableNotificationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
585
+ ECSPrimengTableNotificationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableNotificationService, providedIn: 'root' });
586
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableNotificationService, decorators: [{
587
+ type: Injectable,
588
+ args: [{ providedIn: 'root' }]
589
+ }] });
590
+
591
+ /**
592
+ * Provide on the parent COMPONENT containing the list and detail router outlet.
593
+ * Do not provide at application/root level or on the list component itself.
594
+ * Destroying that parent ends the scope and discards all its table states.
595
+ */
596
+ class ECSPrimengTableStateService {
597
+ constructor() {
598
+ this.states = new Map();
599
+ this.destroyed = false;
600
+ }
601
+ get(key) {
602
+ const state = this.states.get(key);
603
+ return state ? structuredClone(state) : undefined;
604
+ }
605
+ set(key, state) {
606
+ // Parent and child destruction order must not resurrect a discarded scope.
607
+ if (!this.destroyed)
608
+ this.states.set(key, structuredClone(state));
609
+ }
610
+ clear(key) {
611
+ if (key === undefined)
612
+ this.states.clear();
613
+ else
614
+ this.states.delete(key);
615
+ }
616
+ ngOnDestroy() {
617
+ this.destroyed = true;
618
+ this.clear();
619
+ }
620
+ }
621
+ ECSPrimengTableStateService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableStateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
622
+ ECSPrimengTableStateService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableStateService });
623
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableStateService, decorators: [{
624
+ type: Injectable
625
+ }] });
626
+
627
+ /** Translates UI text only; never changes column keys, data or persisted view names. */
628
+ class ECSPrimengTableI18nService {
629
+ constructor() {
630
+ this.translate = inject(TranslateService, { optional: true });
631
+ this.prime = inject(PrimeNGConfig, { optional: true });
632
+ this.destroy$ = new Subject();
633
+ this.parser = new TranslateDefaultParser();
634
+ this.connected = false;
635
+ this.appliedPrimeTranslations = false;
636
+ this.changes = this.translate
637
+ ? merge(this.translate.onLangChange, this.translate.onTranslationChange, this.translate.onDefaultLangChange)
638
+ : EMPTY;
639
+ }
640
+ text(key, params) {
641
+ var _a, _b;
642
+ if (!key)
643
+ return '';
644
+ const value = (_a = this.translate) === null || _a === void 0 ? void 0 : _a.instant(key, params);
645
+ // Literal English keys also serve as defaults, including interpolated counters.
646
+ if (typeof value === 'string' && value !== key)
647
+ return value;
648
+ return (_b = this.parser.interpolate(key, params)) !== null && _b !== void 0 ? _b : key;
649
+ }
650
+ /** Optional dictionary section "primeng" configures the application's shared PrimeNG locale. */
651
+ connectPrimeNG() {
652
+ if (this.connected || !this.prime || !this.translate)
653
+ return;
654
+ this.connected = true;
655
+ this.primeDefaults = Object.fromEntries([...Object.values(TranslationKeys), 'dateFormat', 'aria'].map(key => [key, structuredClone(this.prime.getTranslation(key))]));
656
+ this.syncPrimeNG();
657
+ this.changes.pipe(takeUntil(this.destroy$)).subscribe(() => this.syncPrimeNG());
658
+ }
659
+ ngOnDestroy() {
660
+ this.destroy$.next();
661
+ this.destroy$.complete();
662
+ }
663
+ syncPrimeNG() {
664
+ const value = this.translate.instant('primeng');
665
+ const defined = value && typeof value === 'object' && !Array.isArray(value);
666
+ if (!defined && !this.appliedPrimeTranslations)
667
+ return;
668
+ const defaults = this.primeDefaults;
669
+ const overrides = defined ? value : {};
670
+ this.prime.setTranslation(Object.assign(Object.assign(Object.assign({}, defaults), overrides), { aria: Object.assign(Object.assign({}, defaults['aria']), overrides['aria']) }));
671
+ this.appliedPrimeTranslations = !!defined;
672
+ }
673
+ }
674
+ ECSPrimengTableI18nService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableI18nService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
675
+ ECSPrimengTableI18nService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableI18nService, providedIn: 'root' });
676
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableI18nService, decorators: [{
677
+ type: Injectable,
678
+ args: [{ providedIn: 'root' }]
679
+ }] });
680
+
681
+ /** Supports English defaults and live dictionary updates without mutating the source value. */
682
+ class ECSTableTranslatePipe {
683
+ constructor(i18n, changeDetector) {
684
+ this.i18n = i18n;
685
+ this.subscription = i18n.changes.subscribe(() => changeDetector.markForCheck());
686
+ }
687
+ transform(key, params) {
688
+ return this.i18n.text(key, params);
689
+ }
690
+ ngOnDestroy() { this.subscription.unsubscribe(); }
691
+ }
692
+ ECSTableTranslatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSTableTranslatePipe, deps: [{ token: ECSPrimengTableI18nService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Pipe });
693
+ ECSTableTranslatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.12", ngImport: i0, type: ECSTableTranslatePipe, isStandalone: true, name: "ecsTranslate", pure: false });
694
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSTableTranslatePipe, decorators: [{
695
+ type: Pipe,
696
+ args: [{ name: 'ecsTranslate', standalone: true, pure: false }]
697
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableI18nService }, { type: i0.ChangeDetectorRef }]; } });
698
+
699
+ /**
700
+ * Converts a `DataAlignHorizontal` enum value to its corresponding CSS text alignment string.
701
+ *
702
+ * @param dataAlignHorizontal - The horizontal alignment enum value.
703
+ * @returns The CSS text alignment string ('left', 'center', or 'right').
704
+ *
705
+ * @remarks
706
+ * If an unknown value is provided, the function defaults to 'center'.
707
+ */
708
+ function dataAlignHorizontalAsText(dataAlignHorizontal) {
709
+ switch (dataAlignHorizontal) {
710
+ case DataAlignHorizontal.Left:
711
+ return 'left';
712
+ case DataAlignHorizontal.Center:
713
+ return 'center';
714
+ case DataAlignHorizontal.Right:
715
+ return 'right';
716
+ default:
717
+ return 'center';
718
+ }
719
+ }
720
+
721
+ /**
722
+ * Converts a `DataAlignVertical` enum value to its corresponding CSS vertical alignment string.
723
+ *
724
+ * @param dataAlignVertical - The vertical alignment enum value.
725
+ * @returns The CSS vertical alignment string ('top', 'middle', or 'bottom').
726
+ *
727
+ * @remarks
728
+ * If an unknown value is provided, the function defaults to 'middle'.
729
+ */
730
+ function dataAlignVerticalAsText(dataAlignVertical) {
731
+ switch (dataAlignVertical) {
732
+ case DataAlignVertical.Top:
733
+ return 'top';
734
+ case DataAlignVertical.Middle:
735
+ return 'middle';
736
+ case DataAlignVertical.Bottom:
737
+ return 'bottom';
738
+ default:
739
+ return 'middle';
740
+ }
741
+ }
742
+
743
+ /**
744
+ * Converts a `DataType` enum value to its corresponding string representation.
745
+ *
746
+ * @param dataType - The data type enum value.
747
+ * @returns The string representation of the data type ('text', 'numeric', 'boolean', or 'date').
748
+ *
749
+ * @remarks
750
+ * If an unknown value is provided, the function defaults to 'text'.
751
+ */
752
+ function dataTypeAsText(dataType) {
753
+ switch (dataType) {
754
+ case DataType.Text:
755
+ return 'text';
756
+ case DataType.Numeric:
757
+ return 'numeric';
758
+ case DataType.Boolean:
759
+ return 'boolean';
760
+ case DataType.Date:
761
+ return 'date';
762
+ default:
763
+ return 'text';
764
+ }
765
+ }
766
+
767
+ /**
768
+ * Converts a `FrozenColumnAlign` enum value to its corresponding CSS alignment string.
769
+ *
770
+ * @param frozenColumnAlign - The frozen column alignment enum value.
771
+ * @returns The CSS alignment string ('left' or 'right').
772
+ *
773
+ * @remarks
774
+ * If an unknown value is provided, the function defaults to 'left'.
775
+ */
776
+ function frozenColumnAlignAsText(frozenColumnAlign) {
777
+ switch (frozenColumnAlign) {
778
+ case FrozenColumnAlign.Left:
779
+ return 'left';
780
+ case FrozenColumnAlign.Right:
781
+ return 'right';
782
+ default:
783
+ return 'left';
784
+ }
785
+ }
786
+
787
+ /**
788
+ * Generates sanitized HTML (`SafeHtml`) with highlighted text based on a global search term.
789
+ *
790
+ * @remarks
791
+ * This utility safely creates HTML content where occurrences of the provided global search text
792
+ * within the cell value are wrapped in a `<span class="highlighted-text">` tag for visual emphasis.
793
+ * If the cell does not match the search text or is of type `Boolean`, the original value is returned as safe HTML.
794
+ *
795
+ * @param {any} cellValue - The cell's value that may contain the text to highlight.
796
+ * @param {IColumnMetadata} colMetadata - Metadata configuration of the column that defines its data type and filtering behavior.
797
+ * @param {string | null} globalSearchText - The search text to highlight if found within the cell's content.
798
+ * @param {DomSanitizer} sanitizer - Angular's sanitizer used to safely produce trusted HTML content.
799
+ * @returns {SafeHtml} A `SafeHtml` instance containing highlighted HTML when a match is found, or the original sanitized text otherwise.
800
+ */
801
+ function highlightText(cellValue, colMetadata, globalSearchText, sanitizer) {
802
+ if (colMetadata.dataType !== DataType.Boolean && globalSearchText !== null) { // Check if the column data type is not boolean and global search text is not null
803
+ const valueToUse = String(cellValue); // Convert cell value to string
804
+ if (colMetadata.canBeGlobalFiltered) { // Check if the column can be globally filtered
805
+ const searchLowerCase = globalSearchText.toUpperCase(); // Convert global search text to uppercase for case-insensitive comparison
806
+ const cellValueLowerCase = valueToUse.toUpperCase(); // Convert cell value to uppercase for case-insensitive comparison
807
+ if (cellValueLowerCase.includes(searchLowerCase)) { // Check if the cell value contains the search text
808
+ // Determine the start and end indices of the search text within the cell value
809
+ const startIndex = cellValueLowerCase.indexOf(searchLowerCase);
810
+ const endIndex = startIndex + globalSearchText.length;
811
+ // Extract the prefix, highlight, and suffix of the cell value
812
+ const prefix = valueToUse.substring(0, startIndex);
813
+ const highlight = valueToUse.substring(startIndex, endIndex);
814
+ const suffix = valueToUse.substring(endIndex);
815
+ return sanitizer.bypassSecurityTrustHtml(`${prefix}<span class="highlighted-text">${highlight}</span>${suffix}`); // Construct SafeHtml with highlighted text using the <mark> element
816
+ }
817
+ }
818
+ }
819
+ return sanitizer.bypassSecurityTrustHtml(String(cellValue)); // Return the original cell value if it doesn't meet the highlighting conditions
820
+ }
821
+
822
+ class ECSPrimengTableService {
823
+ constructor(http, notification) {
824
+ this.http = http;
825
+ this.notification = notification;
826
+ this.i18n = inject(ECSPrimengTableI18nService);
827
+ }
828
+ fetchTableConfiguration(url) {
829
+ return this.http.handleHttpGetRequest(url);
830
+ }
831
+ fetchTableData(url, postData) {
832
+ return this.http.handleHttpPostRequest(url, postData);
833
+ }
834
+ fetchExcelReport(url, postData) {
835
+ let httpOptions = new HttpHeaders({
836
+ 'accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
837
+ 'Content-Type': 'application/json'
838
+ });
839
+ return this.http.handleHttpPostRequest(url, postData, httpOptions, "blob");
840
+ }
841
+ getIconBlob(url) {
842
+ return this.http.handleHttpGetRequest(url, "blob");
843
+ }
844
+ downloadFile(data, fileName, contentType) {
845
+ const blob = new Blob([data], { type: contentType });
846
+ const url = window.URL.createObjectURL(blob);
847
+ const link = document.createElement('a');
848
+ link.href = url;
849
+ link.download = fileName;
850
+ link.click();
851
+ window.URL.revokeObjectURL(url);
852
+ }
853
+ handleTableError(error, customTitle = 'Data Loading Error') {
854
+ const message = error.message || 'Unknown error occurred';
855
+ this.notification.showToast('error', this.i18n.text(customTitle), this.i18n.text(message));
856
+ }
857
+ orderColumnsWithFrozens(colsToOrder) {
858
+ const frozenLeftColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Left);
859
+ const frozenRightColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Right);
860
+ const nonFrozenColumns = colsToOrder.filter(col => col.frozenColumnAlign === FrozenColumnAlign.Noone);
861
+ return [...frozenLeftColumns, ...nonFrozenColumns, ...frozenRightColumns];
862
+ }
863
+ /**
864
+ * Handles click events on action buttons in a row of data.
865
+ *
866
+ * @param {function} action - The action function to be executed when the button is clicked. It should accept one parameter, which is the row data.
867
+ * @param {any} [rowData=null] - The data of the row corresponding to the clicked button. Defaults to null.
868
+ *
869
+ * @returns {void}
870
+ *
871
+ * @example
872
+ * // Define an action for a button
873
+ * const deleteAction = (rowData) => {
874
+ * console.log(`Delete row with id: ${rowData.rowID}`);
875
+ * };
876
+ *
877
+ * // Use handleButtonsClick with row data
878
+ * handleButtonsClick(deleteAction, { rowID: 1, name: 'John Doe' });
879
+ */
880
+ handleButtonsClick(action, rowData = null) {
881
+ if (action) { // If the button has an assigned action
882
+ action(rowData); // Perform the action
883
+ }
884
+ }
885
+ handlePredefinedFilterClick(action, rowData = null, option) {
886
+ if (action) { // If the button has an assigned action
887
+ action(rowData, option); // Perform the action
888
+ }
889
+ }
890
+ getColumnStyle(col, headerCols = false) {
891
+ let styles = {};
892
+ if (!headerCols) {
893
+ switch (col.cellOverflowBehaviour) {
894
+ case CellOverflowBehaviour.Wrap:
895
+ styles['white-space'] = 'normal';
896
+ styles['word-wrap'] = 'break-word';
897
+ styles['word-break'] = 'break-all';
898
+ styles['overflow'] = 'hidden';
899
+ break;
900
+ /*case CellOverflowBehaviour.Ellipsis:
901
+ styles['white-space'] = 'nowrap';
902
+ styles['overflow'] = 'hidden';
903
+ styles['text-overflow'] = 'ellipsis';
904
+ styles['width'] = '100%';
905
+ styles['min-width'] = '100%';
906
+ styles['max-width'] = '100%';
907
+ break;*/
908
+ /*
909
+ display: block;
910
+ width: 100%;
911
+ text-align: center;
912
+ */
913
+ case CellOverflowBehaviour.Hidden:
914
+ default:
915
+ styles['white-space'] = 'nowrap';
916
+ break;
917
+ }
918
+ }
919
+ if (col.initialWidth > 0) {
920
+ const width = `${col.initialWidth}px`;
921
+ styles['width'] = width;
922
+ styles['min-width'] = width;
923
+ styles['max-width'] = width;
924
+ }
925
+ return styles;
926
+ /*let styles: Record<string, string> = {};
927
+ if(!headerCols){
928
+ styles = {
929
+ 'white-space': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'normal' : 'nowrap',
930
+ 'word-wrap': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-word' : 'normal',
931
+ 'word-break': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-all' : 'normal'
932
+ };
933
+ }
934
+ if (col.initialWidth > 0) {
935
+ styles['max-width'] = col.initialWidth + 'px';
936
+ styles['min-width'] = col.initialWidth + 'px';
937
+ styles['width'] = col.initialWidth + 'px';
938
+ }
939
+ return styles;*/
940
+ }
941
+ fetchTableViews(tableViewSaveAs, recoverListEndpoint, tableViewSaveKey) {
942
+ let tableViewList = [];
943
+ let tableViewNotParsed = null;
944
+ if (tableViewSaveKey !== "" && tableViewSaveKey !== '') {
945
+ switch (tableViewSaveAs) {
946
+ case TableViewSaveMode.None:
947
+ tableViewNotParsed = null;
948
+ break;
949
+ case TableViewSaveMode.SessionStorage:
950
+ tableViewNotParsed = sessionStorage.getItem(tableViewSaveKey);
951
+ break;
952
+ case TableViewSaveMode.LocalStorage:
953
+ tableViewNotParsed = localStorage.getItem(tableViewSaveKey);
954
+ break;
955
+ case TableViewSaveMode.DatabaseStorage:
956
+ const postData = {
957
+ tableViewSaveKey: tableViewSaveKey
958
+ };
959
+ return this.http.handleHttpPostRequest(recoverListEndpoint, postData);
960
+ default:
961
+ this.notification.showToast("error", this.i18n.text("SAVE VIEW TYPE DOES NOT EXIST"), this.i18n.text("This type of save view does not exist."));
962
+ }
963
+ }
964
+ tableViewList = tableViewNotParsed ? JSON.parse(tableViewNotParsed) : [];
965
+ this.sortViews(tableViewList);
966
+ return tableViewList;
967
+ }
968
+ sortViews(tableSaveViewList) {
969
+ tableSaveViewList.sort((a, b) => a.viewAlias.toLowerCase().localeCompare(b.viewAlias.toLowerCase()));
970
+ }
971
+ updateViewsMenuItems(tableSaveViewList) {
972
+ return tableSaveViewList.map(item => ({
973
+ label: item.viewAlias,
974
+ lastActive: item.lastActive
975
+ }));
976
+ }
977
+ viewsSaveToDatabase(tableSaveViewList, setListEndpoint, tableViewSaveKey) {
978
+ const serializedSaveViews = tableSaveViewList.map(view => ({
979
+ viewAlias: view.viewAlias,
980
+ viewData: JSON.stringify(view.viewData),
981
+ lastActive: view.lastActive
982
+ }));
983
+ const postData = {
984
+ tableViewSaveKey: tableViewSaveKey,
985
+ views: serializedSaveViews
986
+ };
987
+ return this.http.handleHttpPostRequest(setListEndpoint, postData);
988
+ }
989
+ fetchSelectionKeys(endpoint, request) {
990
+ return this.http.handleHttpPostRequest(endpoint, request);
991
+ }
992
+ viewGenerateData(dt, globalSearchText, currentPage, currentRowsPerPage, modifyFiltersFn) {
993
+ let colsWidth = this.computeColumnWidths(dt);
994
+ let tableWidth = this.computeTableWidth(dt);
995
+ const filtersWithoutGlobalAndSelectedRows = Object.assign({}, modifyFiltersFn(JSON.parse(JSON.stringify(dt.filters))));
996
+ if (filtersWithoutGlobalAndSelectedRows['rowID']) {
997
+ filtersWithoutGlobalAndSelectedRows['rowID'][0].value = null;
998
+ }
999
+ if (filtersWithoutGlobalAndSelectedRows['selector']) {
1000
+ filtersWithoutGlobalAndSelectedRows['selector'][0].value = null;
1001
+ }
1002
+ const tableView = {
1003
+ columnsShown: [...dt.columns],
1004
+ multiSortMeta: dt.multiSortMeta,
1005
+ filters: Object.assign({}, filtersWithoutGlobalAndSelectedRows),
1006
+ globalSearchText: globalSearchText,
1007
+ currentPage: currentPage,
1008
+ currentRowsPerPage: currentRowsPerPage,
1009
+ tableWidth: tableWidth,
1010
+ columnsWidth: colsWidth
1011
+ };
1012
+ return tableView;
1013
+ }
1014
+ computeColumnWidths(dt) {
1015
+ let widths = [];
1016
+ const headers = dt.el.nativeElement.querySelectorAll('.p-datatable-thead > tr > th');
1017
+ headers.forEach((header) => widths.push(DomHandler.getOuterWidth(header)));
1018
+ return widths.join(',');
1019
+ }
1020
+ computeTableWidth(dt) {
1021
+ var _a;
1022
+ let tableWidth = 0;
1023
+ if (dt.columnResizeMode === 'expand') {
1024
+ tableWidth = DomHandler.getOuterWidth((_a = dt.tableViewChild) === null || _a === void 0 ? void 0 : _a.nativeElement);
1025
+ }
1026
+ return tableWidth;
1027
+ }
1028
+ }
1029
+ ECSPrimengTableService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableService, deps: [{ token: ECSPrimengTableHttpService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
1030
+ ECSPrimengTableService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableService, providedIn: 'root' });
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTableService, decorators: [{
1032
+ type: Injectable,
1033
+ args: [{
1034
+ providedIn: 'root'
1035
+ }]
1036
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableHttpService }, { type: ECSPrimengTableNotificationService }]; } });
1037
+
1038
+ class TablePredefinedFilters {
1039
+ constructor(sanitizer, tableService) {
1040
+ this.sanitizer = sanitizer;
1041
+ this.tableService = tableService;
1042
+ this.selectable = false;
1043
+ }
1044
+ /**
1045
+ * Converts a blob from the database to a safe URL that can be used to display an image.
1046
+ *
1047
+ * This function takes a `Blob` object, converts it to a base64 encoded string, and returns a `SafeUrl`
1048
+ * that can be used in an HTML template to display the image securely. The `SafeUrl` ensures that
1049
+ * Angular's security mechanisms are bypassed correctly, preventing potential security risks.
1050
+ *
1051
+ * @param {Blob} blob - The blob object representing the image data from the database.
1052
+ * @returns {SafeUrl} A safe URL that can be used to display the image in an HTML template.
1053
+ *
1054
+ * @example
1055
+ * // Example usage in a component
1056
+ * const imageBlob = new Blob([binaryData], { type: 'image/jpeg' });
1057
+ * const imageUrl = this.getBlobIconAsUrl(imageBlob);
1058
+ *
1059
+ * // In your HTML template
1060
+ * <img [src]="imageUrl" alt="Image">
1061
+ */
1062
+ getBlobIconAsUrl(blob) {
1063
+ let objectURL = `data:image/jpeg;base64,${blob}`; // Create a base64 encoded string from the blob data
1064
+ return this.sanitizer.bypassSecurityTrustUrl(objectURL); // Bypass Angular's security mechanisms to create a SafeUrl
1065
+ }
1066
+ handleClick() {
1067
+ if (this.option.action) {
1068
+ this.tableService.handlePredefinedFilterClick(this.option.action, this.rowData, this.option);
1069
+ }
1070
+ }
1071
+ getTagStyle(option) {
1072
+ return Object.assign(Object.assign({}, option.tagStyle), { 'vertical-align': 'middle', 'gap': 0 });
1073
+ }
1074
+ getImageSkeletonStyle(width, height, isSkeleton = false) {
1075
+ const finalHeight = height && height > 0 ? `${height}px` : '22px'; // Compute final height; use default if invalid
1076
+ let finalWidth;
1077
+ if (width && width > 0) { // If width is valid, use it
1078
+ finalWidth = `${width}px`;
1079
+ }
1080
+ else if (isSkeleton) { // If it's a skeleton and width is not provided, mirror the height
1081
+ finalWidth = finalHeight;
1082
+ }
1083
+ const style = {
1084
+ 'vertical-align': 'middle',
1085
+ 'height': finalHeight
1086
+ };
1087
+ if (finalWidth) { // Add width if available
1088
+ style['width'] = finalWidth;
1089
+ }
1090
+ return style;
1091
+ }
1092
+ highlightText(cellValue, colMetadata, globalSearchText) {
1093
+ return highlightText(cellValue, colMetadata, globalSearchText !== null && globalSearchText !== void 0 ? globalSearchText : null, this.sanitizer);
1094
+ }
1095
+ }
1096
+ TablePredefinedFilters.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TablePredefinedFilters, deps: [{ token: i1.DomSanitizer }, { token: ECSPrimengTableService }], target: i0.ɵɵFactoryTarget.Component });
1097
+ TablePredefinedFilters.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TablePredefinedFilters, isStandalone: true, selector: "ecs-table-predefined-filters", inputs: { option: "option", col: "col", selectable: "selectable", rowData: "rowData", globalSearchText: "globalSearchText" }, ngImport: i0, template: "<div style=\"display: flex; align-items: center; gap: 0.5rem;\"\r\n [style.cursor]=\"(selectable && option?.action) ? 'pointer' : 'default'\"\r\n [attr.role]=\"selectable && option?.action ? 'button' : null\"\r\n (click)=\"handleClick(); selectable && option?.action && $event.stopPropagation();\">\r\n <ng-container *ngIf=\"option?.icon\">\r\n <i [class]=\"option.icon\" [style]=\"'vertical-align: middle; color: '+(option.iconColor || '') +';' +(option.iconStyle || '')\"></i>\r\n </ng-container>\r\n <ng-container *ngIf=\"!option?.imageBlob && option?.imageBlobSourceEndpoint\"> <!-- If a blob image needs to be loaded from endpoint, while it's still loading, show skeleton -->\r\n <p-skeleton [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight, true)\"></p-skeleton>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.imageBlob\">\r\n <img alt=\"image\" [src]=\"getBlobIconAsUrl(option.imageBlob)\" [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight)\"/>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.imageURL\">\r\n <img alt=\"iconFromURL\" [src]=\"option.imageURL\" [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight)\"/>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.displayTag === true\">\r\n <p-tag [innerHtml]=\"highlightText(option.name, col, globalSearchText)\" [style]=\"getTagStyle(option)\" [value]=\"option.name\"></p-tag>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.displayName === true\">\r\n <span style=\"gap: 0;\" [innerHtml]=\"highlightText(option.name, col, globalSearchText)\" [ngStyle]=\"option.nameStyle || {}\">{{ option.name }}</span>\r\n </ng-container>\r\n</div>", dependencies: [{ 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: ["styleClass", "style", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1098
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TablePredefinedFilters, decorators: [{
1099
+ type: Component,
1100
+ args: [{ selector: 'ecs-table-predefined-filters', imports: [
1101
+ SkeletonModule,
1102
+ TagModule,
1103
+ CommonModule
1104
+ ], standalone: true, template: "<div style=\"display: flex; align-items: center; gap: 0.5rem;\"\r\n [style.cursor]=\"(selectable && option?.action) ? 'pointer' : 'default'\"\r\n [attr.role]=\"selectable && option?.action ? 'button' : null\"\r\n (click)=\"handleClick(); selectable && option?.action && $event.stopPropagation();\">\r\n <ng-container *ngIf=\"option?.icon\">\r\n <i [class]=\"option.icon\" [style]=\"'vertical-align: middle; color: '+(option.iconColor || '') +';' +(option.iconStyle || '')\"></i>\r\n </ng-container>\r\n <ng-container *ngIf=\"!option?.imageBlob && option?.imageBlobSourceEndpoint\"> <!-- If a blob image needs to be loaded from endpoint, while it's still loading, show skeleton -->\r\n <p-skeleton [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight, true)\"></p-skeleton>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.imageBlob\">\r\n <img alt=\"image\" [src]=\"getBlobIconAsUrl(option.imageBlob)\" [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight)\"/>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.imageURL\">\r\n <img alt=\"iconFromURL\" [src]=\"option.imageURL\" [style]=\"getImageSkeletonStyle(option.imageWidth, option.imageHeight)\"/>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.displayTag === true\">\r\n <p-tag [innerHtml]=\"highlightText(option.name, col, globalSearchText)\" [style]=\"getTagStyle(option)\" [value]=\"option.name\"></p-tag>\r\n </ng-container>\r\n <ng-container *ngIf=\"option?.displayName === true\">\r\n <span style=\"gap: 0;\" [innerHtml]=\"highlightText(option.name, col, globalSearchText)\" [ngStyle]=\"option.nameStyle || {}\">{{ option.name }}</span>\r\n </ng-container>\r\n</div>" }]
1105
+ }], ctorParameters: function () { return [{ type: i1.DomSanitizer }, { type: ECSPrimengTableService }]; }, propDecorators: { option: [{
1106
+ type: Input
1107
+ }], col: [{
1108
+ type: Input
1109
+ }], selectable: [{
1110
+ type: Input
1111
+ }], rowData: [{
1112
+ type: Input
1113
+ }], globalSearchText: [{
1114
+ type: Input
1115
+ }] } });
1116
+
1117
+ class TableCell {
1118
+ constructor(datePipe, sanitizer) {
1119
+ this.datePipe = datePipe;
1120
+ this.sanitizer = sanitizer;
1121
+ this.globalSearchText = null;
1122
+ this.predefinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predefined column filters
1123
+ this.dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
1124
+ this.dateTimezone = "+00:00";
1125
+ this.dateCulture = "en-US";
1126
+ this.DataType = DataType;
1127
+ this.CellDisplay = CellDisplay;
1128
+ }
1129
+ /** Only finite numbers are valid; do not turn empty strings or booleans into progress. */
1130
+ get hasProgressValue() {
1131
+ return typeof this.value === 'number' && Number.isFinite(this.value);
1132
+ }
1133
+ get progressValue() {
1134
+ return Math.min(100, Math.max(0, this.value));
1135
+ }
1136
+ get progressTooltip() {
1137
+ return this.col.dataTooltipCustomColumnSource ? this.tooltipText : `${this.value} %`;
1138
+ }
1139
+ get value() {
1140
+ return this.rowData[this.col.field];
1141
+ }
1142
+ get tooltipText() {
1143
+ if (this.col.dataTooltipCustomColumnSource && this.col.dataTooltipCustomColumnSource.length > 0) {
1144
+ return this.rowData[this.col.dataTooltipCustomColumnSource];
1145
+ }
1146
+ return this.value;
1147
+ }
1148
+ getListValues(col, rowData) {
1149
+ const value = rowData[col.field];
1150
+ return value ? value.split(';').map((v) => v.trim()) : [];
1151
+ }
1152
+ /** List tooltips use the same semicolon-separated positions as the displayed list. */
1153
+ getListTooltip(item, index) {
1154
+ var _a, _b;
1155
+ const source = this.col.dataTooltipCustomColumnSource;
1156
+ const tooltips = source ? this.rowData[source] : null;
1157
+ if (typeof tooltips !== 'string')
1158
+ return item;
1159
+ // Preserve empty entries so subsequent tooltips never move to another item.
1160
+ return (_b = (_a = tooltips.split(';')[index]) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : item;
1161
+ }
1162
+ getDataAlignHorizontalAsText(dataAlignHorizontal) {
1163
+ dataAlignHorizontalAsText(dataAlignHorizontal);
1164
+ }
1165
+ getDataAlignVerticalAsText(dataAlignVertical) {
1166
+ dataAlignVerticalAsText(dataAlignVertical);
1167
+ }
1168
+ /**
1169
+ * Formats a date value using either column-level overrides or global settings.
1170
+ * The incoming value is assumed to represent a UTC date.
1171
+ *
1172
+ * @param {any} value - The date value to be formatted.
1173
+ * @param {string | null} dateFormat - Optional column-level override for the date format.
1174
+ * @param {string | null} dateTimezone - Optional column-level override for the timezone used in formatting.
1175
+ * @param {string | null} dateCulture - Optional column-level override for the culture used in formatting.
1176
+ *
1177
+ * @returns {string} - The formatted date string using the effective (column or global) settings,
1178
+ * or an empty string if the value is invalid or undefined.
1179
+ *
1180
+ * @example
1181
+ * // Example using only global settings:
1182
+ * const result = formatDate(dateValue, null, null, null);
1183
+ *
1184
+ * @example
1185
+ * // Example using column-level overrides:
1186
+ * const result = formatDate(dateValue, 'dd/MM/yyyy', 'UTC', 'en-GB');
1187
+ */
1188
+ formatDate(value, dateFormat, dateTimezone, dateCulture) {
1189
+ if (!value) { // If no value, return empty
1190
+ return '';
1191
+ }
1192
+ let formattedDate = undefined; // By default, formattedDate will be undefined
1193
+ const effectiveFormat = dateFormat !== null && dateFormat !== void 0 ? dateFormat : this.dateFormat;
1194
+ const effectiveTimezone = dateTimezone !== null && dateTimezone !== void 0 ? dateTimezone : this.dateTimezone;
1195
+ const effectiveCulture = dateCulture !== null && dateCulture !== void 0 ? dateCulture : this.dateCulture;
1196
+ if (value) { // If value is not undefined
1197
+ let dateToParse = value;
1198
+ if (typeof value === 'string' && !value.endsWith('Z') && !/[+-]\d{2}:\d{2}$/.test(value)) { // Check if the date does not contain Z
1199
+ dateToParse += 'Z';
1200
+ }
1201
+ const dateUtc = new Date(dateToParse);
1202
+ if (!isNaN(dateUtc.getTime())) { // Check that the date is valid before performing transformation
1203
+ formattedDate = this.datePipe.transform(dateUtc, effectiveFormat, effectiveTimezone, effectiveCulture); // Perform the date masking
1204
+ }
1205
+ }
1206
+ return formattedDate !== null && formattedDate !== void 0 ? formattedDate : ''; // Returns the date formatted, or as empty string if an issue was found (or value was undefined).
1207
+ }
1208
+ getPredefinedFilterTooltip(colMetadata, value) {
1209
+ var _a;
1210
+ if (colMetadata.dataType == DataType.List) {
1211
+ return value;
1212
+ }
1213
+ if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) {
1214
+ const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName);
1215
+ return (_a = options.find(x => x.value == value)) === null || _a === void 0 ? void 0 : _a.name;
1216
+ }
1217
+ return null;
1218
+ }
1219
+ /**
1220
+ * Checks if the provided column metadata matches a specific style of the predefined filters
1221
+ * that need to be applied to an item on a row.
1222
+ *
1223
+ * @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
1224
+ * @param {any} value - The value to be matched against the predefined filter values.
1225
+ * @returns {any} The matching predefined filter value if found, otherwise null.
1226
+ */
1227
+ getPredfinedFilterMatch(colMetadata, value) {
1228
+ if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) { // Check if the column uses predefined filter values
1229
+ const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName); // Get the predefined filter values based on the name
1230
+ return options.find(option => option.value === value); // Return the matching option if found
1231
+ }
1232
+ return null; // Return null if the column does not use predefined filter values
1233
+ }
1234
+ getPredefinedFilterValues(columnKeyName) {
1235
+ var _a;
1236
+ return ((_a = this.predefinedFiltersCollection) === null || _a === void 0 ? void 0 : _a[columnKeyName]) || []; // Return the predefined filter values or an empty array if the option name does not exist
1237
+ }
1238
+ highlightText(cellValue, colMetadata, globalSearchText) {
1239
+ return highlightText(cellValue, colMetadata, globalSearchText, this.sanitizer);
1240
+ }
1241
+ ecsTrack6(index, item) { return index; }
1242
+ ecsTrack7(index, item) { return index; }
1243
+ }
1244
+ TableCell.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableCell, deps: [{ token: i1$1.DatePipe }, { token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
1245
+ TableCell.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TableCell, isStandalone: true, selector: "ecs-table-cell", inputs: { col: "col", rowData: "rowData", globalSearchText: "globalSearchText", predefinedFiltersCollection: "predefinedFiltersCollection", dateFormat: "dateFormat", dateTimezone: "dateTimezone", dateCulture: "dateCulture" }, ngImport: i0, template: "<ng-container *ngIf=\"value !== null && value !== undefined\">\r\n <ng-container *ngIf=\"col.dataType === DataType.Numeric && col.cellDisplay === CellDisplay.ProgressBar; else ecsElse6\">\r\n <ng-container *ngIf=\"hasProgressValue\">\r\n <div class=\"ecs-progress-cell\"\r\n [pTooltip]=\"progressTooltip\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"200\" tooltipPosition=\"top\">\r\n <div class=\"ecs-progress-bar\" role=\"progressbar\"\r\n [attr.aria-label]=\"col.header\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\"\r\n [attr.aria-valuenow]=\"progressValue\"\r\n [attr.aria-valuetext]=\"value + ' %'\">\r\n <div class=\"ecs-progress-bar-fill\" [style.width.%]=\"progressValue\"></div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse6><ng-container *ngIf=\"col.filterPredefinedValuesName && col.filterPredefinedValuesName.length > 0; else ecsElse7\">\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n <ng-container *ngIf=\"col.dataType === DataType.List; else ecsElse8\">\r\n <ng-container *ngFor=\"let item of getListValues(col, rowData); trackBy: ecsTrack6; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <ng-container *ngIf=\"getPredfinedFilterMatch(col, item) as option\">\r\n <div style=\"display: inline-block; margin-right: 0.5rem;\"\r\n [pTooltip]=\"getListTooltip(item, $index)\"\r\n [escape]=\"false\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"true\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse8>\r\n <ng-container *ngIf=\"getPredfinedFilterMatch(col, value) as option\">\r\n <div style=\"display: inline-block;\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"true\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-container>\r\n </ng-template>\r\n </div>\r\n </ng-container><ng-template #ecsElse7>\r\n <ng-container [ngSwitch]=\"col.dataType\"><ng-container *ngSwitchCase=\"DataType.List\">\r\n <ng-container *ngFor=\"let item of getListValues(col, rowData); trackBy: ecsTrack7; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <span [innerHtml]=\"highlightText(item, col, globalSearchText)\"\r\n [pTooltip]=\"getListTooltip(item, $index)\"\r\n [escape]=\"false\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"></span><ng-container *ngIf=\"!$last\"><span>;</span></ng-container>\r\n </ng-container>\r\n </ng-container><ng-container *ngSwitchCase=\"DataType.Boolean\">\r\n <i class=\"pi\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow || !col.dataTooltipCustomColumnSource || col.dataTooltipCustomColumnSource.length === 0\"\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 </ng-container><ng-container *ngSwitchCase=\"DataType.Date\">\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture), col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture)\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture) }}\r\n </div>\r\n </ng-container><ng-container *ngSwitchDefault>\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n </ng-container></ng-container>\r\n </ng-template></ng-template>\r\n</ng-container>\r\n", styles: [":host:has(.ecs-progress-bar){display:block;min-width:0}.ecs-progress-cell{padding-block:.5rem;margin-block:-.5rem}.ecs-progress-bar{width:100%;height:.875rem;overflow:hidden;border:1px solid var(--p-content-border-color, var(--surface-border, #d1d5db));border-radius:999px;background:var(--p-content-background, var(--surface-card, #f8fafc))}.ecs-progress-bar-fill{height:100%;background:var(--p-progressbar-value-background, var(--primary-color, #ffb547))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: TablePredefinedFilters, selector: "ecs-table-predefined-filters", inputs: ["option", "col", "selectable", "rowData", "globalSearchText"] }] });
1246
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableCell, decorators: [{
1247
+ type: Component,
1248
+ args: [{ selector: 'ecs-table-cell', imports: [
1249
+ CommonModule,
1250
+ TooltipModule,
1251
+ TablePredefinedFilters
1252
+ ], standalone: true, template: "<ng-container *ngIf=\"value !== null && value !== undefined\">\r\n <ng-container *ngIf=\"col.dataType === DataType.Numeric && col.cellDisplay === CellDisplay.ProgressBar; else ecsElse6\">\r\n <ng-container *ngIf=\"hasProgressValue\">\r\n <div class=\"ecs-progress-cell\"\r\n [pTooltip]=\"progressTooltip\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"200\" tooltipPosition=\"top\">\r\n <div class=\"ecs-progress-bar\" role=\"progressbar\"\r\n [attr.aria-label]=\"col.header\"\r\n aria-valuemin=\"0\" aria-valuemax=\"100\"\r\n [attr.aria-valuenow]=\"progressValue\"\r\n [attr.aria-valuetext]=\"value + ' %'\">\r\n <div class=\"ecs-progress-bar-fill\" [style.width.%]=\"progressValue\"></div>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse6><ng-container *ngIf=\"col.filterPredefinedValuesName && col.filterPredefinedValuesName.length > 0; else ecsElse7\">\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n <ng-container *ngIf=\"col.dataType === DataType.List; else ecsElse8\">\r\n <ng-container *ngFor=\"let item of getListValues(col, rowData); trackBy: ecsTrack6; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <ng-container *ngIf=\"getPredfinedFilterMatch(col, item) as option\">\r\n <div style=\"display: inline-block; margin-right: 0.5rem;\"\r\n [pTooltip]=\"getListTooltip(item, $index)\"\r\n [escape]=\"false\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"true\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse8>\r\n <ng-container *ngIf=\"getPredfinedFilterMatch(col, value) as option\">\r\n <div style=\"display: inline-block;\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"true\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-container>\r\n </ng-template>\r\n </div>\r\n </ng-container><ng-template #ecsElse7>\r\n <ng-container [ngSwitch]=\"col.dataType\"><ng-container *ngSwitchCase=\"DataType.List\">\r\n <ng-container *ngFor=\"let item of getListValues(col, rowData); trackBy: ecsTrack7; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <span [innerHtml]=\"highlightText(item, col, globalSearchText)\"\r\n [pTooltip]=\"getListTooltip(item, $index)\"\r\n [escape]=\"false\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"></span><ng-container *ngIf=\"!$last\"><span>;</span></ng-container>\r\n </ng-container>\r\n </ng-container><ng-container *ngSwitchCase=\"DataType.Boolean\">\r\n <i class=\"pi\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow || !col.dataTooltipCustomColumnSource || col.dataTooltipCustomColumnSource.length === 0\"\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 </ng-container><ng-container *ngSwitchCase=\"DataType.Date\">\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture), col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture)\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value, col.dateFormat, col.dateTimezone, col.dateCulture) }}\r\n </div>\r\n </ng-container><ng-container *ngSwitchDefault>\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : value\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n </ng-container></ng-container>\r\n </ng-template></ng-template>\r\n</ng-container>\r\n", styles: [":host:has(.ecs-progress-bar){display:block;min-width:0}.ecs-progress-cell{padding-block:.5rem;margin-block:-.5rem}.ecs-progress-bar{width:100%;height:.875rem;overflow:hidden;border:1px solid var(--p-content-border-color, var(--surface-border, #d1d5db));border-radius:999px;background:var(--p-content-background, var(--surface-card, #f8fafc))}.ecs-progress-bar-fill{height:100%;background:var(--p-progressbar-value-background, var(--primary-color, #ffb547))}\n"] }]
1253
+ }], ctorParameters: function () { return [{ type: i1$1.DatePipe }, { type: i1.DomSanitizer }]; }, propDecorators: { col: [{
1254
+ type: Input
1255
+ }], rowData: [{
1256
+ type: Input
1257
+ }], globalSearchText: [{
1258
+ type: Input
1259
+ }], predefinedFiltersCollection: [{
1260
+ type: Input
1261
+ }], dateFormat: [{
1262
+ type: Input
1263
+ }], dateTimezone: [{
1264
+ type: Input
1265
+ }], dateCulture: [{
1266
+ type: Input
1267
+ }] } });
1268
+
1269
+ class TableButton {
1270
+ constructor(tableService) {
1271
+ this.tableService = tableService;
1272
+ this.isActionButton = false;
1273
+ this.isLastActionButton = false;
1274
+ }
1275
+ handleClick(event) {
1276
+ var _a;
1277
+ if (((_a = this.button) === null || _a === void 0 ? void 0 : _a.action) || this.overrideAction) { // If there is an action or an override, execute logic
1278
+ if (this.overrideAction) { // If overrideAction exists, execute it first
1279
+ this.overrideAction(event); // Call override action
1280
+ }
1281
+ else { // Otherwise execute the normal button action through the service
1282
+ this.tableService.handleButtonsClick(this.button.action, this.rowData);
1283
+ }
1284
+ }
1285
+ }
1286
+ getButtonStyle(button, isActionButton, isLastActionButton) {
1287
+ const styles = {};
1288
+ if (button.style) { // Add inline styles from button.style
1289
+ button.style.split(';').forEach(part => {
1290
+ const [prop, value] = part.split(':').map(x => x.trim());
1291
+ if (prop && value)
1292
+ styles[prop] = value;
1293
+ });
1294
+ }
1295
+ if (isActionButton && !isLastActionButton) { // Add margin-right for action buttons
1296
+ styles['margin-right'] = '10px';
1297
+ }
1298
+ return styles;
1299
+ }
1300
+ }
1301
+ TableButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableButton, deps: [{ token: ECSPrimengTableService }], target: i0.ɵɵFactoryTarget.Component });
1302
+ TableButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: TableButton, isStandalone: true, selector: "ecs-table-button", inputs: { button: "button", rowData: "rowData", isActionButton: "isActionButton", isLastActionButton: "isLastActionButton", overrideAction: "overrideAction" }, ngImport: i0, template: "<ng-container *ngIf=\"button.visibleCondition?.(rowData) ?? true\"> <!--If 'visibleCondition' is true or not defined-->\r\n <ng-container *ngIf=\"(button.enabledCondition?.(rowData) ?? true) || !button.conditionFailHide\"> <!--Render button if 'enabledCondition' is true or undefined, OR if 'conditionFailHide' is false-->\r\n <p-button\r\n [ariaLabel]=\"(button.label || button.tooltip || '') | ecsTranslate\"\r\n [disabled]=\"!(button.enabledCondition?.(rowData) ?? true)\"\r\n [iconPos]=\"button.iconPos || 'left'\"\r\n [pTooltip]=\"(button.tooltip || '') | ecsTranslate\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"\r\n (isActionButton ? ' custom-small-btn' : '') +\r\n (button.rounded ? ' p-button-rounded' : '') +\r\n (button.raised ? ' p-button-raised' : '') +\r\n (button.variant === 'text' ? ' p-button-text' : '') +\r\n (button.variant === 'outlined' ? ' p-button-outlined' : '') +\r\n (button.class ? ' ' + button.class : '')\r\n \"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"(button.label || '') | ecsTranslate\"\r\n [ngStyle]=\"getButtonStyle(button, isActionButton, isLastActionButton)\"\r\n (onClick)=\"handleClick($event)\"></p-button>\r\n </ng-container>\r\n</ng-container>", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"], dependencies: [{ kind: "pipe", type: ECSTableTranslatePipe, name: "ecsTranslate" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
1303
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: TableButton, decorators: [{
1304
+ type: Component,
1305
+ args: [{ selector: 'ecs-table-button', imports: [
1306
+ ECSTableTranslatePipe,
1307
+ CommonModule,
1308
+ ButtonModule,
1309
+ TooltipModule
1310
+ ], standalone: true, template: "<ng-container *ngIf=\"button.visibleCondition?.(rowData) ?? true\"> <!--If 'visibleCondition' is true or not defined-->\r\n <ng-container *ngIf=\"(button.enabledCondition?.(rowData) ?? true) || !button.conditionFailHide\"> <!--Render button if 'enabledCondition' is true or undefined, OR if 'conditionFailHide' is false-->\r\n <p-button\r\n [ariaLabel]=\"(button.label || button.tooltip || '') | ecsTranslate\"\r\n [disabled]=\"!(button.enabledCondition?.(rowData) ?? true)\"\r\n [iconPos]=\"button.iconPos || 'left'\"\r\n [pTooltip]=\"(button.tooltip || '') | ecsTranslate\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"\r\n (isActionButton ? ' custom-small-btn' : '') +\r\n (button.rounded ? ' p-button-rounded' : '') +\r\n (button.raised ? ' p-button-raised' : '') +\r\n (button.variant === 'text' ? ' p-button-text' : '') +\r\n (button.variant === 'outlined' ? ' p-button-outlined' : '') +\r\n (button.class ? ' ' + button.class : '')\r\n \"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"(button.label || '') | ecsTranslate\"\r\n [ngStyle]=\"getButtonStyle(button, isActionButton, isLastActionButton)\"\r\n (onClick)=\"handleClick($event)\"></p-button>\r\n </ng-container>\r\n</ng-container>", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"] }]
1311
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableService }]; }, propDecorators: { button: [{
1312
+ type: Input
1313
+ }], rowData: [{
1314
+ type: Input
1315
+ }], isActionButton: [{
1316
+ type: Input
1317
+ }], isLastActionButton: [{
1318
+ type: Input
1319
+ }], overrideAction: [{
1320
+ type: Input
1321
+ }] } });
1322
+
1323
+ class ColumnSelector {
1324
+ constructor(translate, changeDetector) {
1325
+ this.translate = translate;
1326
+ this.destroy$ = new Subject();
1327
+ this.orderByHeader = false;
1328
+ this.visible = false;
1329
+ this.columnModalData = [];
1330
+ this.filteredColumnData = [];
1331
+ this.visibleChange = new EventEmitter();
1332
+ this.applyChanges = new EventEmitter();
1333
+ this.cellOverflowBehaviourOptions = [
1334
+ { icon: 'pi pi-minus', val: CellOverflowBehaviour.Hidden, name: "Hidden" },
1335
+ { icon: 'pi pi-equals', val: CellOverflowBehaviour.Wrap, name: "Wrap" } /*,
1336
+ {icon: 'pi pi-ellipsis-h', val: CellOverflowBehaviour.Ellipsis, name: "Ellipsis"}*/
1337
+ ];
1338
+ this.dataAlignHorizontalOptions = [
1339
+ { icon: 'pi pi-align-left', val: DataAlignHorizontal.Left, name: "Left" },
1340
+ { icon: 'pi pi-align-center', val: DataAlignHorizontal.Center, name: "Center" },
1341
+ { icon: 'pi pi-align-right', val: DataAlignHorizontal.Right, name: "Right" }
1342
+ ];
1343
+ this.dataAlignVerticalOptions = [
1344
+ { icon: 'pi pi-angle-up', val: DataAlignVertical.Top, name: "Top" },
1345
+ { icon: 'pi pi-align-justify', val: DataAlignVertical.Middle, name: "Middle" },
1346
+ { icon: 'pi pi-angle-down', val: DataAlignVertical.Bottom, name: "Bottom" }
1347
+ ];
1348
+ this.globalSearchText = null; // The text used by the global search
1349
+ this.globalSearchMaxLength = 50;
1350
+ merge(translate.onLangChange, translate.onTranslationChange, translate.onDefaultLangChange)
1351
+ .pipe(takeUntil(this.destroy$))
1352
+ .subscribe(() => {
1353
+ this.updateVisibleColumns();
1354
+ changeDetector.markForCheck();
1355
+ });
1356
+ }
1357
+ ngOnChanges() {
1358
+ if (!this.visible)
1359
+ this.globalSearchText = null;
1360
+ this.updateVisibleColumns();
1361
+ }
1362
+ ngOnDestroy() {
1363
+ this.destroy$.next();
1364
+ this.destroy$.complete();
1365
+ }
1366
+ updateVisibleColumns() {
1367
+ var _a;
1368
+ const search = ((_a = this.globalSearchText) !== null && _a !== void 0 ? _a : '').toLocaleLowerCase();
1369
+ const label = (column) => column.header ? this.translate.instant(column.header) : '';
1370
+ this.filteredColumnData = this.columnModalData.filter(column => label(column).toLocaleLowerCase().includes(search));
1371
+ if (this.orderByHeader) {
1372
+ this.filteredColumnData.sort((a, b) => label(a).localeCompare(label(b)));
1373
+ }
1374
+ }
1375
+ translatedOptions(options) {
1376
+ return options.map(option => (Object.assign(Object.assign({}, option), { name: this.translate.instant(option.name) })));
1377
+ }
1378
+ allColumnsCheckboxActive() {
1379
+ return this.columnModalData.every(column => column.selected);
1380
+ }
1381
+ allColumnsCheckboxClick(event) {
1382
+ if (event.checked) {
1383
+ this.columnModalData.forEach(column => { column.selected = true; });
1384
+ }
1385
+ else {
1386
+ this.columnModalData.forEach(column => {
1387
+ if (!column.selectDisabled) {
1388
+ column.selected = false;
1389
+ }
1390
+ });
1391
+ }
1392
+ }
1393
+ filterColumnModal(event) {
1394
+ this.globalSearchText = event.target.value;
1395
+ this.updateVisibleColumns();
1396
+ }
1397
+ applyColumnModalChanges() {
1398
+ const selected = this.columnModalData.filter(c => c.selected && !c.selectDisabled);
1399
+ this.applyChanges.emit(selected);
1400
+ this.closeModal();
1401
+ }
1402
+ clearGlobalFilter(dt) {
1403
+ this.globalSearchText = null;
1404
+ this.updateVisibleColumns();
1405
+ }
1406
+ closeModal() {
1407
+ this.globalSearchText = null;
1408
+ this.visibleChange.emit(false);
1409
+ }
1410
+ }
1411
+ ColumnSelector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnSelector, deps: [{ token: i1$2.TranslateService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1412
+ ColumnSelector.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ColumnSelector, isStandalone: true, selector: "ecs-column-selector", inputs: { orderByHeader: "orderByHeader", visible: "visible", columnModalData: "columnModalData", filteredColumnData: "filteredColumnData" }, outputs: { visibleChange: "visibleChange", applyChanges: "applyChanges" }, viewQueries: [{ propertyName: "dt_columnDialog", first: true, predicate: ["dt_columnDialog"], descendants: true }], usesOnChanges: 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' | ecsTranslate }}</b></span>\r\n </ng-template>\r\n <div style=\"padding: 10px;\">\r\n <p-table #dt_columnDialog [value]=\"filteredColumnData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows\r\n scrollHeight=\"calc(80vh - 220px)\">\r\n <ng-template pTemplate=\"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' | ecsTranslate }}</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <span class=\"ecs-global-search\">\r\n <span class=\"ecs-input-icon\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"'Search column name' | ecsTranslate\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </span>\r\n </ng-container>\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">{{ 'Show column' | ecsTranslate }}</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">{{ 'Column name' | ecsTranslate }}</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">{{ 'Cell overflow behaviour' | ecsTranslate }}</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">{{ 'Horizontal alignment' | ecsTranslate }}</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">{{ 'Vertical alignment' | ecsTranslate }}</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"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\"></p-checkbox>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header | translate}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"translatedOptions(cellOverflowBehaviourOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></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]=\"translatedOptions(dataAlignHorizontalOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></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]=\"translatedOptions(dataAlignVerticalOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'There are no columns' | ecsTranslate }}</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 {{count}} columns of {{total}} available columns' | ecsTranslate: { count: filteredColumnData ? filteredColumnData.length : 0, total: columnModalData ? columnModalData.length : 0 } }}\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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" [label]=\"'Save changes' | ecsTranslate\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "pipe", type: ECSTableTranslatePipe, name: "ecsTranslate" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i3$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i6.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i6.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i7.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "tabindex", "multiple", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6$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: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
1413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ColumnSelector, decorators: [{
1414
+ type: Component,
1415
+ args: [{ selector: 'ecs-column-selector', imports: [
1416
+ ECSTableTranslatePipe,
1417
+ TranslateModule,
1418
+ DialogModule,
1419
+ TableModule,
1420
+ CheckboxModule,
1421
+ ButtonModule,
1422
+ SelectButtonModule,
1423
+ CommonModule,
1424
+ FormsModule,
1425
+ InputTextModule,
1426
+ TooltipModule
1427
+ ], 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' | ecsTranslate }}</b></span>\r\n </ng-template>\r\n <div style=\"padding: 10px;\">\r\n <p-table #dt_columnDialog [value]=\"filteredColumnData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows\r\n scrollHeight=\"calc(80vh - 220px)\">\r\n <ng-template pTemplate=\"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' | ecsTranslate }}</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <span class=\"ecs-global-search\">\r\n <span class=\"ecs-input-icon\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"'Search column name' | ecsTranslate\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </span>\r\n </ng-container>\r\n </span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">{{ 'Show column' | ecsTranslate }}</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">{{ 'Column name' | ecsTranslate }}</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">{{ 'Cell overflow behaviour' | ecsTranslate }}</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">{{ 'Horizontal alignment' | ecsTranslate }}</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">{{ 'Vertical alignment' | ecsTranslate }}</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"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\"></p-checkbox>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header | translate}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"translatedOptions(cellOverflowBehaviourOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></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]=\"translatedOptions(dataAlignHorizontalOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></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]=\"translatedOptions(dataAlignVerticalOptions)\" optionValue=\"val\" optionLabel=\"name\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template pTemplate=\"item\" let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"(item.name) | ecsTranslate\" [showDelay]=\"400\" tooltipPosition=\"top\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'There are no columns' | ecsTranslate }}</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 {{count}} columns of {{total}} available columns' | ecsTranslate: { count: filteredColumnData ? filteredColumnData.length : 0, total: columnModalData ? columnModalData.length : 0 } }}\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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" [label]=\"'Save changes' | ecsTranslate\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
1428
+ }], ctorParameters: function () { return [{ type: i1$2.TranslateService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orderByHeader: [{
1429
+ type: Input
1430
+ }], dt_columnDialog: [{
1431
+ type: ViewChild,
1432
+ args: ['dt_columnDialog']
1433
+ }], visible: [{
1434
+ type: Input
1435
+ }], columnModalData: [{
1436
+ type: Input
1437
+ }], filteredColumnData: [{
1438
+ type: Input
1439
+ }], visibleChange: [{
1440
+ type: Output
1441
+ }], applyChanges: [{
1442
+ type: Output
1443
+ }] } });
1444
+
1445
+ class ExportExcelService {
1446
+ getCurrentTimeString() {
1447
+ const now = new Date();
1448
+ const year = now.getUTCFullYear();
1449
+ const month = String(now.getUTCMonth() + 1).padStart(2, '0');
1450
+ const day = String(now.getUTCDate()).padStart(2, '0');
1451
+ const hours = String(now.getUTCHours()).padStart(2, '0');
1452
+ const minutes = String(now.getUTCMinutes()).padStart(2, '0');
1453
+ const seconds = String(now.getUTCSeconds()).padStart(2, '0');
1454
+ return `_${year}${month}${day}_${hours}${minutes}${seconds}_UTC`;
1455
+ }
1456
+ }
1457
+ ExportExcelService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ExportExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1458
+ ExportExcelService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ExportExcelService, providedIn: 'root' });
1459
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ExportExcelService, decorators: [{
1460
+ type: Injectable,
1461
+ args: [{
1462
+ providedIn: 'root'
1463
+ }]
1464
+ }] });
1465
+
1466
+ class ExportExcel {
1467
+ constructor(notificationSerivce, exportExcelService) {
1468
+ this.notificationSerivce = notificationSerivce;
1469
+ this.exportExcelService = exportExcelService;
1470
+ this.i18n = inject(ECSPrimengTableI18nService);
1471
+ this.translatedOptionSets = new WeakMap();
1472
+ this.visible = false;
1473
+ this.rowCheckboxSelectorActive = false;
1474
+ this.excelReportTitle = "";
1475
+ this.includeTimeInTitle = true;
1476
+ this.exportUseIconsInBools = false;
1477
+ this.allowTitleUserEdit = false;
1478
+ this.exportToExcel = new EventEmitter();
1479
+ this.visibleChange = new EventEmitter();
1480
+ this.option_exportColumns_selected = false;
1481
+ this.option_exportColumns = [
1482
+ { label: 'Only visible', value: false },
1483
+ { label: 'All columns', value: true }
1484
+ ];
1485
+ this.option_applyCurrentFilters_selected = false;
1486
+ this.option_applyCurrentFilters = [
1487
+ { label: 'No filters', value: false },
1488
+ { label: 'Apply current filters', value: true }
1489
+ ];
1490
+ this.option_applyCurrentSorts_selected = false;
1491
+ this.option_applyCurrentSorts = [
1492
+ { label: 'No sorts', value: false },
1493
+ { label: 'Apply current sorts', value: true }
1494
+ ];
1495
+ this.option_selectedRowsExport_selected = 0;
1496
+ this.option_selectedRowsExport = [
1497
+ { label: 'All rows', value: 0 },
1498
+ { label: 'Selected rows', value: 1 },
1499
+ { label: 'Not selected rows', value: 2 }
1500
+ ];
1501
+ }
1502
+ ngOnChanges(changes) {
1503
+ // If visible changes from false to true, reset values
1504
+ if (changes['visible'] && changes['visible'].currentValue === true && changes['visible'].previousValue === false) {
1505
+ this.resetValues();
1506
+ }
1507
+ }
1508
+ resetValues() {
1509
+ this.includeTimeInTitle = true;
1510
+ this.exportUseIconsInBools = false;
1511
+ this.option_exportColumns_selected = false;
1512
+ this.option_applyCurrentFilters_selected = false;
1513
+ this.option_applyCurrentSorts_selected = false;
1514
+ this.option_selectedRowsExport_selected = 0;
1515
+ }
1516
+ getExcelReport() {
1517
+ var _a;
1518
+ let excelReportFinalTitle = "";
1519
+ this.excelReportTitle = (_a = this.excelReportTitle) === null || _a === void 0 ? void 0 : _a.trim();
1520
+ if (!this.excelReportTitle || this.excelReportTitle.length <= 0) {
1521
+ this.notificationSerivce.clearToasts();
1522
+ this.notificationSerivce.showToast("error", this.i18n.text("REPORT NAME NOT VALID"), this.i18n.text("The report name is not valid"));
1523
+ return;
1524
+ }
1525
+ const allowedPattern = /^[A-Za-z0-9 _-]*$/;
1526
+ if (!allowedPattern.test(this.excelReportTitle)) {
1527
+ this.notificationSerivce.clearToasts();
1528
+ this.notificationSerivce.showToast("error", this.i18n.text("INVALID CHARACTERS IN REPORT NAME"), this.i18n.text("The report name contains invalid characters."));
1529
+ return;
1530
+ }
1531
+ if (this.includeTimeInTitle) {
1532
+ excelReportFinalTitle = this.excelReportTitle + this.exportExcelService.getCurrentTimeString() + ".xlsx";
1533
+ }
1534
+ else {
1535
+ excelReportFinalTitle = this.excelReportTitle + ".xlsx";
1536
+ }
1537
+ this.exportToExcel.emit({
1538
+ allColumns: this.option_exportColumns_selected,
1539
+ applyFilters: this.option_applyCurrentFilters_selected,
1540
+ applySorts: this.option_applyCurrentSorts_selected,
1541
+ selectedRows: this.option_selectedRowsExport_selected,
1542
+ filename: excelReportFinalTitle,
1543
+ useIconInBools: this.exportUseIconsInBools
1544
+ });
1545
+ }
1546
+ translatedOptions(options) {
1547
+ const labels = options.map(option => this.i18n.text(option.label));
1548
+ const cached = this.translatedOptionSets.get(options);
1549
+ if ((cached === null || cached === void 0 ? void 0 : cached.length) === options.length && cached.every((option, index) => option.label === labels[index] && option.value === options[index].value)) {
1550
+ return cached;
1551
+ }
1552
+ const translated = options.map((option, index) => (Object.assign(Object.assign({}, option), { label: labels[index] })));
1553
+ this.translatedOptionSets.set(options, translated);
1554
+ return translated;
1555
+ }
1556
+ filterSelectorDisabled() {
1557
+ return this.option_selectedRowsExport_selected >= 1;
1558
+ }
1559
+ onChangeExportRows(event) {
1560
+ if (event.value >= 1) {
1561
+ this.option_applyCurrentFilters_selected = true;
1562
+ }
1563
+ }
1564
+ closeModal() {
1565
+ this.visibleChange.emit(false);
1566
+ }
1567
+ }
1568
+ ExportExcel.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ExportExcel, deps: [{ token: ECSPrimengTableNotificationService }, { token: ExportExcelService }], target: i0.ɵɵFactoryTarget.Component });
1569
+ ExportExcel.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", 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' | ecsTranslate }}</span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: grid; grid-template-columns: 4fr 8fr; gap: 1rem; align-items: center; margin-top: 10px;\">\r\n <div style=\"justify-self: end;\">\r\n {{ 'Report filename' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <input pInputText id=\"reportTitle\" [attr.aria-label]=\"'Report filename' | ecsTranslate\" [(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 <b>\\'_{year}{month}{day}_{hours}{minutes}{seconds}_UTC\\'</b> at the end of your filename.' | ecsTranslate\"\r\n tooltipPosition=\"top\"\r\n [escape]=\"false\"\r\n class=\"pi pi-info-circle\">\r\n </i>\r\n {{ 'Include time in report filename?' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"includeTimeInTitle\"></p-checkbox>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <i [pTooltip]=\"'Activating this option will make boolean values be shown as icons in the Excel report:<br>True \u2192 <span class=\\'bool-icon bool-true\\'>\u2714</span><br>False \u2192 <span class=\\'bool-icon bool-false\\'>\u2718</span>' | ecsTranslate\"\r\n tooltipPosition=\"top\"\r\n tooltipStyleClass=\"excel-export-tooltip\"\r\n [escape]=\"false\"\r\n class=\"pi pi-info-circle\">\r\n </i>\r\n {{ 'Use icons in boolean fields?' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"exportUseIconsInBools\"></p-checkbox>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n {{ 'Export columns' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_exportColumns_selected\" [options]=\"translatedOptions(option_exportColumns)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <ng-container *ngIf=\"filterSelectorDisabled()\">\r\n <i [pTooltip]=\"'Sorts are active because you want to export selected rows following a filter criteria' | ecsTranslate\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n </ng-container>\r\n {{ 'Filters to apply' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentFilters_selected\" [options]=\"translatedOptions(option_applyCurrentFilters)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" [disabled]=\"filterSelectorDisabled()\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n {{ 'Sorts to apply' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentSorts_selected\" [options]=\"translatedOptions(option_applyCurrentSorts)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <ng-container *ngIf=\"rowCheckboxSelectorActive\">\r\n <div style=\"justify-self: end;\">\r\n {{ 'Selected rows' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_selectedRowsExport_selected\" [options]=\"translatedOptions(option_selectedRowsExport)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" (onChange)=\"onChangeExportRows($event)\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n </ng-container>\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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"getExcelReport()\" [label]=\"'Export' | ecsTranslate\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: ECSTableTranslatePipe, name: "ecsTranslate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i3$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6$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: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i6$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", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i7.SelectButton, selector: "p-selectButton", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "tabindex", "multiple", "style", "styleClass", "ariaLabelledBy", "disabled", "dataKey"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }] });
1570
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ExportExcel, decorators: [{
1571
+ type: Component,
1572
+ args: [{ selector: 'ecs-export-excel', imports: [
1573
+ CommonModule,
1574
+ ECSTableTranslatePipe,
1575
+ DialogModule,
1576
+ FormsModule,
1577
+ ButtonModule,
1578
+ SelectButtonModule,
1579
+ InputTextModule,
1580
+ TooltipModule,
1581
+ CheckboxModule
1582
+ ], 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' | ecsTranslate }}</span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: grid; grid-template-columns: 4fr 8fr; gap: 1rem; align-items: center; margin-top: 10px;\">\r\n <div style=\"justify-self: end;\">\r\n {{ 'Report filename' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <input pInputText id=\"reportTitle\" [attr.aria-label]=\"'Report filename' | ecsTranslate\" [(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 <b>\\'_{year}{month}{day}_{hours}{minutes}{seconds}_UTC\\'</b> at the end of your filename.' | ecsTranslate\"\r\n tooltipPosition=\"top\"\r\n [escape]=\"false\"\r\n class=\"pi pi-info-circle\">\r\n </i>\r\n {{ 'Include time in report filename?' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"includeTimeInTitle\"></p-checkbox>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <i [pTooltip]=\"'Activating this option will make boolean values be shown as icons in the Excel report:<br>True \u2192 <span class=\\'bool-icon bool-true\\'>\u2714</span><br>False \u2192 <span class=\\'bool-icon bool-false\\'>\u2718</span>' | ecsTranslate\"\r\n tooltipPosition=\"top\"\r\n tooltipStyleClass=\"excel-export-tooltip\"\r\n [escape]=\"false\"\r\n class=\"pi pi-info-circle\">\r\n </i>\r\n {{ 'Use icons in boolean fields?' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"exportUseIconsInBools\"></p-checkbox>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n {{ 'Export columns' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_exportColumns_selected\" [options]=\"translatedOptions(option_exportColumns)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <ng-container *ngIf=\"filterSelectorDisabled()\">\r\n <i [pTooltip]=\"'Sorts are active because you want to export selected rows following a filter criteria' | ecsTranslate\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n </ng-container>\r\n {{ 'Filters to apply' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentFilters_selected\" [options]=\"translatedOptions(option_applyCurrentFilters)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" [disabled]=\"filterSelectorDisabled()\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n {{ 'Sorts to apply' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentSorts_selected\" [options]=\"translatedOptions(option_applyCurrentSorts)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n\r\n <ng-container *ngIf=\"rowCheckboxSelectorActive\">\r\n <div style=\"justify-self: end;\">\r\n {{ 'Selected rows' | ecsTranslate }}\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_selectedRowsExport_selected\" [options]=\"translatedOptions(option_selectedRowsExport)\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" (onChange)=\"onChangeExportRows($event)\"><ng-template pTemplate=\"item\" let-option>{{ option.label | ecsTranslate }}</ng-template></p-selectButton>\r\n </div>\r\n </ng-container>\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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"getExcelReport()\" [label]=\"'Export' | ecsTranslate\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>\r\n" }]
1583
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableNotificationService }, { type: ExportExcelService }]; }, propDecorators: { visible: [{
1584
+ type: Input
1585
+ }], rowCheckboxSelectorActive: [{
1586
+ type: Input
1587
+ }], excelReportTitle: [{
1588
+ type: Input
1589
+ }], allowTitleUserEdit: [{
1590
+ type: Input
1591
+ }], exportToExcel: [{
1592
+ type: Output
1593
+ }], visibleChange: [{
1594
+ type: Output
1595
+ }] } });
1596
+
1597
+ class ViewsManagement {
1598
+ constructor(notification) {
1599
+ this.notification = notification;
1600
+ this.i18n = inject(ECSPrimengTableI18nService);
1601
+ this.visible = false;
1602
+ this.tableViews_menuItems = [];
1603
+ this.onViewSelect = new EventEmitter();
1604
+ this.onViewDelete = new EventEmitter();
1605
+ this.onViewUpdateData = new EventEmitter();
1606
+ this.onViewUpdateActiveStartup = new EventEmitter();
1607
+ this.onViewEditAlias = new EventEmitter();
1608
+ this.onViewCreate = new EventEmitter();
1609
+ this.visibleChange = new EventEmitter();
1610
+ this.viewEditorShow = false;
1611
+ this.editingViewAlias = '';
1612
+ this.newViewAlias = '';
1613
+ }
1614
+ loadView(viewAlias) {
1615
+ this.onViewSelect.emit(viewAlias);
1616
+ }
1617
+ deleteView(viewAlias) {
1618
+ this.onViewDelete.emit(viewAlias);
1619
+ }
1620
+ updateView(viewAlias) {
1621
+ this.onViewUpdateData.emit(viewAlias);
1622
+ }
1623
+ updateViewActiveStartup(viewAlias) {
1624
+ this.onViewUpdateActiveStartup.emit(viewAlias);
1625
+ }
1626
+ createView(viewAlias) {
1627
+ const exists = this.tableViews_menuItems.some(item => item.label === viewAlias);
1628
+ if (exists) {
1629
+ this.notification.showToast("error", this.i18n.text("DUPLICATE VIEW NAME"), this.i18n.text("A view with alias \"{{value0}}\" already exists", { value0: viewAlias }));
1630
+ return;
1631
+ }
1632
+ this.onViewCreate.emit(viewAlias);
1633
+ }
1634
+ editViewAlias(viewAliasOld, viewAliasNew) {
1635
+ this.onViewEditAlias.emit({
1636
+ viewAliasOld: viewAliasOld,
1637
+ viewAliasNew: viewAliasNew
1638
+ });
1639
+ }
1640
+ showViewEditor(editingViewAlias = '') {
1641
+ this.editingViewAlias = editingViewAlias;
1642
+ this.newViewAlias = this.editingViewAlias;
1643
+ this.viewEditorShow = true;
1644
+ }
1645
+ closeModal() {
1646
+ this.visibleChange.emit(false);
1647
+ }
1648
+ createOrUpdateTableView() {
1649
+ this.viewEditorShow = false;
1650
+ if (this.editingViewAlias !== '') {
1651
+ this.editViewAlias(this.editingViewAlias, this.newViewAlias);
1652
+ }
1653
+ else {
1654
+ this.createView(this.newViewAlias);
1655
+ }
1656
+ }
1657
+ }
1658
+ ViewsManagement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ViewsManagement, deps: [{ token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
1659
+ ViewsManagement.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ViewsManagement, isStandalone: true, selector: "ecs-views-management", inputs: { visible: "visible", tableViews_menuItems: "tableViews_menuItems" }, outputs: { onViewSelect: "onViewSelect", onViewDelete: "onViewDelete", onViewUpdateData: "onViewUpdateData", onViewUpdateActiveStartup: "onViewUpdateActiveStartup", 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' | ecsTranslate }}</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 pTemplate=\"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' | ecsTranslate\" (click)=\"showViewEditor()\" [pTooltip]=\"'New view' | ecsTranslate\" tooltipPosition=\"top\" [showDelay]=\"700\"></p-button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th style=\"text-align: center;\">{{ 'View name' | ecsTranslate }}</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">{{ 'Load on startup' | ecsTranslate }}</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">{{ 'Actions' | ecsTranslate }}</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">\r\n <p-checkbox [(ngModel)]=\"rowData.lastActive\" [binary]=\"true\" (onChange)=\"updateViewActiveStartup(rowData.label)\"></p-checkbox>\r\n </td>\r\n <td style=\"max-width: 220px; min-width: 220px; width: 220px; 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' | ecsTranslate\" 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' | ecsTranslate\" 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' | ecsTranslate\" 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' | ecsTranslate\" 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 pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'There are no views' | ecsTranslate }}</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 {{count}} views' | ecsTranslate: { count: tableViews_menuItems ? tableViews_menuItems.length : 0 } }}\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') | ecsTranslate }}</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' | ecsTranslate }}<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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"(editingViewAlias !== '' ? 'Update' : 'Create') | ecsTranslate\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "pipe", type: ECSTableTranslatePipe, name: "ecsTranslate" }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "visible", "style", "position"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i3$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i6.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "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", "label", "icon", "loading"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i6$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: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }] });
1660
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ViewsManagement, decorators: [{
1661
+ type: Component,
1662
+ args: [{ selector: 'ecs-views-management', imports: [
1663
+ ECSTableTranslatePipe,
1664
+ DialogModule,
1665
+ TableModule,
1666
+ ButtonModule,
1667
+ CommonModule,
1668
+ FormsModule,
1669
+ TooltipModule,
1670
+ InputTextModule,
1671
+ CheckboxModule
1672
+ ], 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' | ecsTranslate }}</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 pTemplate=\"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' | ecsTranslate\" (click)=\"showViewEditor()\" [pTooltip]=\"'New view' | ecsTranslate\" tooltipPosition=\"top\" [showDelay]=\"700\"></p-button>\r\n </div>\r\n </ng-template>\r\n <ng-template pTemplate=\"header\">\r\n <tr>\r\n <th style=\"text-align: center;\">{{ 'View name' | ecsTranslate }}</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">{{ 'Load on startup' | ecsTranslate }}</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">{{ 'Actions' | ecsTranslate }}</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template pTemplate=\"body\" let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">\r\n <p-checkbox [(ngModel)]=\"rowData.lastActive\" [binary]=\"true\" (onChange)=\"updateViewActiveStartup(rowData.label)\"></p-checkbox>\r\n </td>\r\n <td style=\"max-width: 220px; min-width: 220px; width: 220px; 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' | ecsTranslate\" 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' | ecsTranslate\" 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' | ecsTranslate\" 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' | ecsTranslate\" 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 pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'There are no views' | ecsTranslate }}</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 {{count}} views' | ecsTranslate: { count: tableViews_menuItems ? tableViews_menuItems.length : 0 } }}\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') | ecsTranslate }}</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' | ecsTranslate }}<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' | ecsTranslate\" outlined=\"true\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"(editingViewAlias !== '' ? 'Update' : 'Create') | ecsTranslate\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
1673
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableNotificationService }]; }, propDecorators: { visible: [{
1674
+ type: Input
1675
+ }], tableViews_menuItems: [{
1676
+ type: Input
1677
+ }], onViewSelect: [{
1678
+ type: Output
1679
+ }], onViewDelete: [{
1680
+ type: Output
1681
+ }], onViewUpdateData: [{
1682
+ type: Output
1683
+ }], onViewUpdateActiveStartup: [{
1684
+ type: Output
1685
+ }], onViewEditAlias: [{
1686
+ type: Output
1687
+ }], onViewCreate: [{
1688
+ type: Output
1689
+ }], visibleChange: [{
1690
+ type: Output
1691
+ }] } });
1692
+
1693
+ class ECSPrimengTable {
1694
+ constructor(tableService, notification) {
1695
+ this.tableService = tableService;
1696
+ this.notification = notification;
1697
+ this.i18n = inject(ECSPrimengTableI18nService);
1698
+ this.changeDetector = inject(ChangeDetectorRef, { optional: true });
1699
+ this.stateScope = inject(ECSPrimengTableStateService, { optional: true });
1700
+ this.destroy$ = new Subject();
1701
+ this.initialStateApplied = false;
1702
+ this.destroyed = false;
1703
+ this.tableOptions = DEFAULT_TABLE_OPTIONS;
1704
+ this.treeStateRestored = false;
1705
+ this.onRowCheckboxChange = new EventEmitter(); // Emitter that returns the column selected and if it was selected or unselected
1706
+ this.onRowSelect = new EventEmitter;
1707
+ this.onRowUnselect = new EventEmitter;
1708
+ this.onDataEndUpdate = new EventEmitter();
1709
+ this.viewsModalShow = false;
1710
+ this.tableViewCurrentSelectedAlias = null;
1711
+ this.tableViewsFirstFetchDone = false;
1712
+ this.excelReportTitle = "";
1713
+ this.showExportModal = false;
1714
+ this.showColumnSelector = false;
1715
+ this.selectedRowsCheckbox = []; // An array to keep all the selected rows
1716
+ this.selectAllLoading = false;
1717
+ this.selectionQueryKey = '';
1718
+ this.globalSearchText = null; // The text used by the global search
1719
+ this.appliedGlobalSearchText = null;
1720
+ this.globalSearchManaged = false;
1721
+ this.tableViewsList = [];
1722
+ this.tableViews_menuItems = [];
1723
+ this.DataType = DataType;
1724
+ this.CellOverflowBehaviour = CellOverflowBehaviour;
1725
+ this.DataAlignHorizontal = DataAlignHorizontal;
1726
+ this.DataAlignVertical = DataAlignVertical;
1727
+ this.FrozenColumnAlign = FrozenColumnAlign;
1728
+ this.TableViewSaveMode = TableViewSaveMode;
1729
+ this.currentPage = 0; // The current page we are at
1730
+ this.currentRowsPerPage = 0; // The current rows per page selected
1731
+ this.allowedRowsPerPage = []; // The different values of rows per page allowed
1732
+ this.totalRecords = 0; // The number of total records that are available (taking into account the filters)
1733
+ this.totalRecordsNotFiltered = 0; // The total number of records available if no filters were applied
1734
+ this.dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
1735
+ this.dateTimezone = "+00:00";
1736
+ this.dateCulture = "en-US";
1737
+ this.exportDateFormat = "dd-MMM-yyyy HH:mm:ss";
1738
+ this.columns = [];
1739
+ this.columnsCantBeHidden = [];
1740
+ this.columnsSelected = [];
1741
+ this.columnModalData = [];
1742
+ this.filteredColumnData = [];
1743
+ this.predefinedFiltersSelectedValuesCollection = {}; // Contains a collection of the predefined column filters selection (possible values come from 'predefinedFiltersCollection')
1744
+ this.tableLazyLoadEventInformation = {}; // Data of the last lazy load event of the table
1745
+ this.initialConfigurationFetched = false;
1746
+ this.maxViews = 0;
1747
+ this.deviceType = DeviceType.Desktop;
1748
+ this.columnSelectionCustomized = false;
1749
+ this.headerMenuItems = [];
1750
+ this.rowMenuItems = [];
1751
+ this.i18n.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
1752
+ var _a;
1753
+ this.headerMenuItems = this.translateMenuItems(this.headerMenuItems);
1754
+ this.rowMenuItems = this.translateMenuItems(this.rowMenuItems);
1755
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.markForCheck();
1756
+ });
1757
+ }
1758
+ /** The applied query stays separate from text being typed during the debounce. */
1759
+ get effectiveGlobalSearchText() {
1760
+ return this.globalSearchManaged ? this.appliedGlobalSearchText : this.globalSearchText;
1761
+ }
1762
+ cancelGlobalSearch() {
1763
+ if (this.globalSearchTimer !== undefined)
1764
+ clearTimeout(this.globalSearchTimer);
1765
+ this.globalSearchTimer = undefined;
1766
+ }
1767
+ restoreGlobalSearch(value) {
1768
+ this.cancelGlobalSearch();
1769
+ this.globalSearchText = value;
1770
+ this.appliedGlobalSearchText = value || null;
1771
+ this.globalSearchManaged = true;
1772
+ }
1773
+ globalSearchOption(value) {
1774
+ return typeof value === 'number' && Number.isFinite(value) ? Math.max(0, Math.floor(value)) : 0;
1775
+ }
1776
+ onGlobalSearchInput(value) {
1777
+ var _a, _b, _c;
1778
+ if (this.destroyed)
1779
+ return;
1780
+ this.cancelGlobalSearch();
1781
+ if (!this.globalSearchManaged)
1782
+ this.appliedGlobalSearchText = this.globalSearchText || null;
1783
+ this.globalSearchManaged = true;
1784
+ this.globalSearchText = value;
1785
+ const minLength = this.globalSearchOption((_a = this.tableOptions.globalFilter) === null || _a === void 0 ? void 0 : _a.minLength);
1786
+ const delay = this.globalSearchOption((_b = this.tableOptions.globalFilter) === null || _b === void 0 ? void 0 : _b.debounceTime);
1787
+ const trimmed = value.trim();
1788
+ const effective = trimmed.length >= minLength ? (trimmed || null) : null;
1789
+ if (effective === (((_c = this.appliedGlobalSearchText) === null || _c === void 0 ? void 0 : _c.trim()) || null))
1790
+ return;
1791
+ const apply = () => {
1792
+ this.globalSearchTimer = undefined;
1793
+ if (this.destroyed)
1794
+ return;
1795
+ this.appliedGlobalSearchText = effective;
1796
+ this.currentPage = 0;
1797
+ this.dt.first = 0;
1798
+ if (minLength === 0 && delay === 0) {
1799
+ // Keep PrimeNG's existing filtering behavior when the feature is not configured.
1800
+ this.dt.filterGlobal(value, 'contains');
1801
+ }
1802
+ else {
1803
+ // Own the global delay so it is not added to PrimeNG's column-filter delay.
1804
+ this.dt.filters = Object.assign(Object.assign({}, this.dt.filters), { global: { value: effective, matchMode: 'contains' } });
1805
+ this.fetchTableData(Object.assign(Object.assign({}, this.tableLazyLoadEventInformation), { first: 0, rows: this.currentRowsPerPage, filters: this.dt.filters }));
1806
+ }
1807
+ };
1808
+ if (effective === null || delay === 0)
1809
+ apply();
1810
+ else
1811
+ this.globalSearchTimer = setTimeout(apply, delay);
1812
+ }
1813
+ ngOnInit() {
1814
+ this.i18n.connectPrimeNG();
1815
+ if (this.tableOptions.tree)
1816
+ this.treeState = new TreeTableState(this.tableOptions.tree);
1817
+ this.validateStatePersistence();
1818
+ this.updateResponsiveViewport();
1819
+ this.fetchTableConfiguration();
1820
+ }
1821
+ ngAfterViewInit() {
1822
+ var _a;
1823
+ this.calculateScrollHeight();
1824
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.detectChanges();
1825
+ }
1826
+ get compactHeader() {
1827
+ var _a;
1828
+ return !!((_a = this.tableOptions.responsive) === null || _a === void 0 ? void 0 : _a.headerMenu) && this.deviceType !== DeviceType.Desktop;
1829
+ }
1830
+ get compactRows() {
1831
+ var _a;
1832
+ return !!((_a = this.tableOptions.responsive) === null || _a === void 0 ? void 0 : _a.rowMenu) && this.deviceType !== DeviceType.Desktop;
1833
+ }
1834
+ get actionColumnWidth() {
1835
+ var _a, _b, _c;
1836
+ return this.compactRows ? 56 : ((_c = (_b = (_a = this.tableOptions.rows) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.width) !== null && _c !== void 0 ? _c : 150);
1837
+ }
1838
+ getColumnHeaderGroups(columns) {
1839
+ var _a, _b, _c;
1840
+ if (!columns.some(column => { var _a; return (_a = column.headerGroup) === null || _a === void 0 ? void 0 : _a.trim(); }))
1841
+ return [];
1842
+ const groups = [];
1843
+ for (const column of columns) {
1844
+ const label = (_b = (_a = column.headerGroup) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
1845
+ const frozenColumnAlign = (_c = column.frozenColumnAlign) !== null && _c !== void 0 ? _c : FrozenColumnAlign.Noone;
1846
+ const previous = groups[groups.length - 1];
1847
+ if (previous && previous.label === label && previous.frozenColumnAlign === frozenColumnAlign) {
1848
+ previous.colspan++;
1849
+ }
1850
+ else {
1851
+ groups.push({ field: column.field, label, colspan: 1, frozenColumnAlign });
1852
+ }
1853
+ }
1854
+ return groups;
1855
+ }
1856
+ isInitiallyVisible(column) {
1857
+ if (!column.canBeHidden)
1858
+ return true;
1859
+ if (column.startHidden)
1860
+ return false;
1861
+ const devices = column.visibleOnlyIn;
1862
+ return !(devices === null || devices === void 0 ? void 0 : devices.length) || devices.some(device => device === this.deviceType || String(device).toLowerCase() === DeviceType[this.deviceType].toLowerCase());
1863
+ }
1864
+ updateResponsiveViewport() {
1865
+ var _a, _b, _c, _d, _e, _f;
1866
+ const options = this.tableOptions.responsive;
1867
+ const tablet = (_a = options === null || options === void 0 ? void 0 : options.tabletMinWidth) !== null && _a !== void 0 ? _a : 768;
1868
+ const desktop = (_b = options === null || options === void 0 ? void 0 : options.desktopMinWidth) !== null && _b !== void 0 ? _b : 1200;
1869
+ if (!Number.isFinite(tablet) || !Number.isFinite(desktop) || tablet <= 0 || desktop <= tablet) {
1870
+ throw new Error('ECS table responsive widths must be finite and 0 < tabletMinWidth < desktopMinWidth.');
1871
+ }
1872
+ const width = typeof window === 'undefined' ? desktop : window.innerWidth;
1873
+ const next = width < tablet ? DeviceType.Mobile : width < desktop ? DeviceType.Tablet : DeviceType.Desktop;
1874
+ if (next === this.deviceType)
1875
+ return;
1876
+ this.deviceType = next;
1877
+ (_c = this.responsiveHeaderMenu) === null || _c === void 0 ? void 0 : _c.hide();
1878
+ (_d = this.responsiveRowMenu) === null || _d === void 0 ? void 0 : _d.hide();
1879
+ if (!this.initialConfigurationFetched || this.columnSelectionCustomized ||
1880
+ !this.columns.some(column => { var _a; return (_a = column.visibleOnlyIn) === null || _a === void 0 ? void 0 : _a.length; }))
1881
+ return;
1882
+ const selected = this.columns.filter(column => column.canBeHidden && this.isInitiallyVisible(column));
1883
+ const shown = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(selected));
1884
+ const previous = (_f = (_e = this.tableOptions.columns) === null || _e === void 0 ? void 0 : _e.shown) !== null && _f !== void 0 ? _f : [];
1885
+ if (shown.length === previous.length && shown.every((column, i) => column.field === previous[i].field))
1886
+ return;
1887
+ this.columnsSelected = selected;
1888
+ this.tableOptions.columns.shown = shown;
1889
+ this.showColumnSelector = false;
1890
+ // Request newly visible fields without resetting filters, sorting or pagination.
1891
+ if (this.initialStateApplied)
1892
+ this.fetchTableData(this.tableLazyLoadEventInformation);
1893
+ }
1894
+ buttonVisible(button, row) {
1895
+ var _a, _b, _c, _d;
1896
+ return ((_b = (_a = button.visibleCondition) === null || _a === void 0 ? void 0 : _a.call(button, row)) !== null && _b !== void 0 ? _b : true) &&
1897
+ (((_d = (_c = button.enabledCondition) === null || _c === void 0 ? void 0 : _c.call(button, row)) !== null && _d !== void 0 ? _d : true) || !button.conditionFailHide);
1898
+ }
1899
+ hasRowMenuActions(row) {
1900
+ var _a, _b, _c;
1901
+ return ((_c = (_b = (_a = this.tableOptions.rows) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.buttons) !== null && _c !== void 0 ? _c : []).some(button => this.buttonVisible(button, row));
1902
+ }
1903
+ buttonMenuItems(buttons, row) {
1904
+ return buttons.filter(button => this.buttonVisible(button, row)).map((button, index) => {
1905
+ var _a, _b;
1906
+ return ({
1907
+ label: button.label || button.tooltip || 'Action {{number}}',
1908
+ _uiParams: { number: index + 1 },
1909
+ icon: button.icon,
1910
+ disabled: !((_b = (_a = button.enabledCondition) === null || _a === void 0 ? void 0 : _a.call(button, row)) !== null && _b !== void 0 ? _b : true),
1911
+ command: () => {
1912
+ var _a, _b;
1913
+ if (this.buttonVisible(button, row) && ((_b = (_a = button.enabledCondition) === null || _a === void 0 ? void 0 : _a.call(button, row)) !== null && _b !== void 0 ? _b : true) && button.action) {
1914
+ this.tableService.handleButtonsClick(button.action, row);
1915
+ }
1916
+ }
1917
+ });
1918
+ });
1919
+ }
1920
+ closeResponsiveMenus() {
1921
+ var _a, _b;
1922
+ (_a = this.responsiveHeaderMenu) === null || _a === void 0 ? void 0 : _a.hide();
1923
+ (_b = this.responsiveRowMenu) === null || _b === void 0 ? void 0 : _b.hide();
1924
+ }
1925
+ openRowMenu(event, row) {
1926
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1927
+ event.stopPropagation();
1928
+ (_a = this.responsiveHeaderMenu) === null || _a === void 0 ? void 0 : _a.hide();
1929
+ if (((_b = this.responsiveRowMenu) === null || _b === void 0 ? void 0 : _b.visible) && this.rowMenuRow === row) {
1930
+ this.responsiveRowMenu.hide();
1931
+ return;
1932
+ }
1933
+ // Use one overlay for all rows. Replacing the model binds every action to this row.
1934
+ this.rowMenuRow = row;
1935
+ this.rowMenuItems = this.translateMenuItems(this.buttonMenuItems((_e = (_d = (_c = this.tableOptions.rows) === null || _c === void 0 ? void 0 : _c.action) === null || _d === void 0 ? void 0 : _d.buttons) !== null && _e !== void 0 ? _e : [], row));
1936
+ const wasOpen = (_f = this.responsiveRowMenu) === null || _f === void 0 ? void 0 : _f.visible;
1937
+ (_g = this.responsiveRowMenu) === null || _g === void 0 ? void 0 : _g.show(event);
1938
+ if (wasOpen)
1939
+ (_h = this.responsiveRowMenu) === null || _h === void 0 ? void 0 : _h.alignOverlay();
1940
+ }
1941
+ translateMenuItems(items) {
1942
+ return items.map(item => {
1943
+ var _a;
1944
+ if (item['_literalLabel'])
1945
+ return item;
1946
+ const key = (_a = item['_uiLabelKey']) !== null && _a !== void 0 ? _a : item.label;
1947
+ return Object.assign(Object.assign({}, item), { _uiLabelKey: key, label: this.i18n.text(key, item['_uiParams']) });
1948
+ });
1949
+ }
1950
+ openHeaderMenu(event) {
1951
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1952
+ (_a = this.responsiveRowMenu) === null || _a === void 0 ? void 0 : _a.hide();
1953
+ const options = this.tableOptions;
1954
+ const items = [];
1955
+ if ((_b = options.columns) === null || _b === void 0 ? void 0 : _b.selectorEnabled)
1956
+ items.push({ label: 'Modify columns', icon: options.columns.selectorIcon, command: () => this.columnSelectorShow() });
1957
+ if ((_c = options.header) === null || _c === void 0 ? void 0 : _c.clearSortsEnabled)
1958
+ items.push({ label: 'Clear sorts', icon: options.header.clearSortsIcon, disabled: !this.hasToClearSorts(this.dt), command: () => this.clearSorts(this.dt) });
1959
+ if ((_d = options.header) === null || _d === void 0 ? void 0 : _d.clearFiltersEnabled)
1960
+ items.push({ label: 'Clear filters', icon: options.header.clearFiltersIcon, disabled: !this.hasToClearFilters(this.dt, this.globalSearchText), command: () => this.clearFilters(this.dt) });
1961
+ if (this.tableViewsEnabled()) {
1962
+ items.push({ label: this.tableViewCurrentSelectedAlias || ((_e = options.views) === null || _e === void 0 ? void 0 : _e.noViewSelectedText) || 'Select a view', _literalLabel: !!this.tableViewCurrentSelectedAlias, icon: 'pi pi-bookmark', command: () => { this.viewsModalShow = true; } });
1963
+ items.push({ label: 'Apply view again', icon: ((_f = options.views) === null || _f === void 0 ? void 0 : _f.reloadViewButtonIcon) || 'pi pi-refresh', disabled: !this.tableViewCurrentSelectedAlias, command: () => this.viewLoad(this.tableViewCurrentSelectedAlias) });
1964
+ }
1965
+ if ((_h = (_g = options.excelReport) === null || _g === void 0 ? void 0 : _g.url) === null || _h === void 0 ? void 0 : _h.trim())
1966
+ items.push({ label: 'Export to Excel', icon: 'pi pi-file-excel', command: () => this.openExcelExport() });
1967
+ if ((_j = options.resetTableView) === null || _j === void 0 ? void 0 : _j.enabled)
1968
+ items.push({ label: 'Reset table view', icon: options.resetTableView.icon, command: () => this.resetTableView() });
1969
+ items.push({ label: 'Refresh data', icon: 'pi pi-refresh', command: () => this.refreshData(event) });
1970
+ items.push(...this.buttonMenuItems((_l = (_k = options.header) === null || _k === void 0 ? void 0 : _k.buttons) !== null && _l !== void 0 ? _l : [], null));
1971
+ this.headerMenuItems = this.translateMenuItems(items);
1972
+ (_m = this.responsiveHeaderMenu) === null || _m === void 0 ? void 0 : _m.toggle(event);
1973
+ }
1974
+ validateStatePersistence() {
1975
+ var _a, _b;
1976
+ if (!((_a = this.tableOptions.statePersistence) === null || _a === void 0 ? void 0 : _a.enabled))
1977
+ return;
1978
+ if (!((_b = this.tableOptions.statePersistence.key) === null || _b === void 0 ? void 0 : _b.trim()) || !this.stateScope) {
1979
+ throw new Error('ECS table statePersistence requires a non-empty key and ECSPrimengTableStateService provided on a parent scope component.');
1980
+ }
1981
+ }
1982
+ ngOnDestroy() {
1983
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1984
+ this.cancelGlobalSearch();
1985
+ this.destroyed = true;
1986
+ this.destroy$.next();
1987
+ this.destroy$.complete();
1988
+ (_a = this.treeState) === null || _a === void 0 ? void 0 : _a.cancel();
1989
+ const options = this.tableOptions.statePersistence;
1990
+ const key = (_b = options === null || options === void 0 ? void 0 : options.key) === null || _b === void 0 ? void 0 : _b.trim();
1991
+ if (!key || !this.stateScope)
1992
+ return;
1993
+ if (!(options === null || options === void 0 ? void 0 : options.enabled)) {
1994
+ this.stateScope.clear(key);
1995
+ return;
1996
+ }
1997
+ if (!this.initialStateApplied || !this.dt)
1998
+ return;
1999
+ const filters = structuredClone((_c = this.dt.filters) !== null && _c !== void 0 ? _c : {});
2000
+ delete filters['global'];
2001
+ delete filters['selector'];
2002
+ this.stateScope.set(key, {
2003
+ configurationUrl: (_d = this.tableOptions.urlTableConfiguration) !== null && _d !== void 0 ? _d : '',
2004
+ dataUrl: (_e = this.tableOptions.urlTableData) !== null && _e !== void 0 ? _e : '',
2005
+ filters,
2006
+ multiSortMeta: structuredClone((_f = this.dt.multiSortMeta) !== null && _f !== void 0 ? _f : []),
2007
+ globalSearchText: this.effectiveGlobalSearchText,
2008
+ currentPage: this.currentPage,
2009
+ currentRowsPerPage: this.currentRowsPerPage,
2010
+ treeMode: (_g = this.treeState) === null || _g === void 0 ? void 0 : _g.mode,
2011
+ treeExpandedKeys: this.treeState ? [...this.treeState.expanded] : undefined,
2012
+ treeChildPages: (_h = this.treeState) === null || _h === void 0 ? void 0 : _h.snapshotPages()
2013
+ });
2014
+ }
2015
+ restoreNavigationState() {
2016
+ var _a, _b, _c, _d;
2017
+ this.validateStatePersistence();
2018
+ const options = this.tableOptions.statePersistence;
2019
+ const key = (_a = options === null || options === void 0 ? void 0 : options.key) === null || _a === void 0 ? void 0 : _a.trim();
2020
+ if (!(options === null || options === void 0 ? void 0 : options.enabled)) {
2021
+ if (key)
2022
+ (_b = this.stateScope) === null || _b === void 0 ? void 0 : _b.clear(key);
2023
+ return false;
2024
+ }
2025
+ const state = this.stateScope.get(key);
2026
+ if (!state)
2027
+ return false;
2028
+ if (state.configurationUrl !== this.tableOptions.urlTableConfiguration ||
2029
+ state.dataUrl !== this.tableOptions.urlTableData || state.treeMode !== ((_c = this.treeState) === null || _c === void 0 ? void 0 : _c.mode)) {
2030
+ this.stateScope.clear(key);
2031
+ return false;
2032
+ }
2033
+ const fields = new Set(this.columns.map(column => column.field));
2034
+ const filters = {};
2035
+ for (const [field, filter] of Object.entries(state.filters)) {
2036
+ if (fields.has(field))
2037
+ filters[field] = filter;
2038
+ }
2039
+ this.currentRowsPerPage = this.allowedRowsPerPage.includes(state.currentRowsPerPage)
2040
+ ? state.currentRowsPerPage : this.currentRowsPerPage;
2041
+ this.currentPage = this.currentRowsPerPage === state.currentRowsPerPage
2042
+ ? Math.max(0, state.currentPage) : 0;
2043
+ this.restoreGlobalSearch(state.globalSearchText);
2044
+ (_d = this.treeState) === null || _d === void 0 ? void 0 : _d.restore(state.treeExpandedKeys, state.treeChildPages);
2045
+ this.treeStateRestored = !!this.treeState;
2046
+ if (this.globalSearchText) {
2047
+ filters['global'] = { value: this.globalSearchText, matchMode: 'contains' };
2048
+ }
2049
+ const sorts = state.multiSortMeta.filter(sort => fields.has(sort.field));
2050
+ this.dt.filters = Object.assign(Object.assign({}, this.dt.filters), structuredClone(filters));
2051
+ // Keep initialStateApplied=false while PrimeNG setters can emit lazy-load events.
2052
+ this.dt.multiSortMeta = sorts;
2053
+ this.dt.first = this.currentPage * this.currentRowsPerPage;
2054
+ this.dt.rows = this.currentRowsPerPage;
2055
+ this.tableLazyLoadEventInformation = {
2056
+ first: this.dt.first,
2057
+ rows: this.currentRowsPerPage,
2058
+ filters: this.dt.filters,
2059
+ multiSortMeta: sorts
2060
+ };
2061
+ this.restorePredefinedSelections(filters);
2062
+ return true;
2063
+ }
2064
+ restorePredefinedSelections(filters) {
2065
+ var _a, _b, _c;
2066
+ this.predefinedFiltersSelectedValuesCollection = {};
2067
+ for (const column of this.columns) {
2068
+ const key = column.filterPredefinedValuesName;
2069
+ if (!key)
2070
+ continue;
2071
+ const criteria = filters[column.field];
2072
+ const value = (_a = (Array.isArray(criteria) ? criteria[0] : criteria)) === null || _a === void 0 ? void 0 : _a.value;
2073
+ if (value === null || value === undefined)
2074
+ continue;
2075
+ this.predefinedFiltersSelectedValuesCollection[key] =
2076
+ ((_c = (_b = this.tableOptions.predefinedFilters) === null || _b === void 0 ? void 0 : _b[key]) !== null && _c !== void 0 ? _c : []).filter(option => Array.isArray(value) ? value.includes(option.value) : value === option.value);
2077
+ }
2078
+ }
2079
+ onResize() {
2080
+ this.updateResponsiveViewport();
2081
+ this.calculateScrollHeight();
2082
+ }
2083
+ calculateScrollHeight() {
2084
+ var _a, _b;
2085
+ if ((_a = this.tableOptions.verticalScroll) === null || _a === void 0 ? void 0 : _a.cssFormula) {
2086
+ return;
2087
+ }
2088
+ if (((_b = this.tableOptions.verticalScroll) === null || _b === void 0 ? void 0 : _b.fitToContainer) && this.tableContainer && this.paginatorContainer && this.headerContainer) {
2089
+ const containerRect = this.tableContainer.nativeElement.getBoundingClientRect();
2090
+ const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight;
2091
+ const headerHeight = this.headerContainer.nativeElement.offsetHeight;
2092
+ const viewportHeight = window.innerHeight;
2093
+ const topOffset = containerRect.top + window.scrollY;
2094
+ this.tableOptions.verticalScroll.height = (viewportHeight - topOffset - paginatorHeight - headerHeight) - 60;
2095
+ }
2096
+ }
2097
+ get scrollHeightValue() {
2098
+ var _a, _b;
2099
+ if ((_a = this.tableOptions.verticalScroll) === null || _a === void 0 ? void 0 : _a.cssFormula) {
2100
+ return this.tableOptions.verticalScroll.cssFormula;
2101
+ }
2102
+ const height = (_b = this.tableOptions.verticalScroll) === null || _b === void 0 ? void 0 : _b.height;
2103
+ return height && height > 0 ? `${height}px` : '';
2104
+ }
2105
+ /**
2106
+ * Updates the table data and, if needed, retrieves the initial table configuration from an external source.
2107
+ *
2108
+ * Also allows resetting the table to its original state before any user manipulations.
2109
+ *
2110
+ * @param {boolean} [resetTableView=false] Optional.
2111
+ * - `true`: resets the table state before loading data.
2112
+ * - `false`: refreshes data using the current configuration (and retrieves initial configuration if necessary).
2113
+ *
2114
+ * **_Behavior_**
2115
+ * - The table is automatically set to `isActive = true`.
2116
+ * - If the initial configuration has not been fetched, it will fetch it and then update the data.
2117
+ * - If the initial configuration is already fetched, it will just update the data.
2118
+ * - If `resetTableView` is true and the configuration is already initialized, the table will be reset to its original state before updating the data.
2119
+ */
2120
+ updateData(resetTableView = false) {
2121
+ this.tableOptions.isActive = true; // Enable table actions: the table is now active and can perform updates
2122
+ if (!this.initialConfigurationFetched || resetTableView) { // If initial configuration hasn't been fetched yet or a reset is explicitly requested
2123
+ if (this.initialConfigurationFetched && resetTableView) { // Reset the table only if it was already initialized and a reset is explicitly requested
2124
+ this.resetTableView(); // Reset table state (filters, pagination, sorting, etc.) and then refresh data
2125
+ }
2126
+ else { // We only need to get the table configuration without reseting the view
2127
+ this.fetchTableConfiguration(); // Fetch the initial table configuration before updating data
2128
+ }
2129
+ }
2130
+ else { // Table is already initialized and no reset requested, just refresh the data
2131
+ this.fetchTableData(this.tableLazyLoadEventInformation); // Update table rows using the last lazy load event
2132
+ }
2133
+ }
2134
+ canFetchData() {
2135
+ var _a, _b;
2136
+ return !this.destroyed
2137
+ && !!this.tableOptions.isActive
2138
+ && !!((_a = this.tableOptions.urlTableConfiguration) === null || _a === void 0 ? void 0 : _a.trim())
2139
+ && !!((_b = this.tableOptions.urlTableData) === null || _b === void 0 ? void 0 : _b.trim());
2140
+ }
2141
+ fetchTableConfiguration(resetTableView = false) {
2142
+ if (!this.canFetchData()) {
2143
+ return;
2144
+ }
2145
+ this.tableService.fetchTableConfiguration(this.tableOptions.urlTableConfiguration)
2146
+ .pipe(takeUntil(this.destroy$)).subscribe({
2147
+ next: (response) => {
2148
+ this.handleTableConfigurationResponse(response.body, resetTableView);
2149
+ },
2150
+ error: (err) => this.tableService.handleTableError(err, 'Columns Error')
2151
+ });
2152
+ }
2153
+ handleTableConfigurationResponse(body, resetTableView = false) {
2154
+ this.allowedRowsPerPage = body.allowedItemsPerPage; // Update the number of rows allowed per page
2155
+ this.currentRowsPerPage = Math.min(...this.allowedRowsPerPage); // Update the current rows per page to use the minimum value of allowed rows per page by default
2156
+ this.columns = body.columnsInfo; // Update columns with fetched data
2157
+ this.columnsCantBeHidden = this.columns.filter((col) => !col.canBeHidden); // Filter columns that cannot be hidden
2158
+ this.columnSelectionCustomized = false;
2159
+ this.columnsSelected = this.columns.filter(col => col.canBeHidden && this.isInitiallyVisible(col)); // Selected columns that are not hidden by default
2160
+ this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
2161
+ this.dateFormat = body.dateFormat;
2162
+ this.dateTimezone = body.dateTimezone;
2163
+ this.dateCulture = body.dateCulture;
2164
+ this.exportDateFormat = body.exportDateFormat;
2165
+ this.currentPage = 0;
2166
+ this.initialConfigurationFetched = true;
2167
+ this.maxViews = body.maxViews;
2168
+ if (resetTableView) {
2169
+ this.tableOptions.isActive = false;
2170
+ this.clearFilters(this.dt, true);
2171
+ this.clearSorts(this.dt, true);
2172
+ this.dt.tableWidthState = this.initialTableWidth;
2173
+ this.dt.columnWidthsState = this.initialColumnWidths;
2174
+ this.dt.restoreColumnWidths();
2175
+ this.tableLazyLoadEventInformation.multiSortMeta = [];
2176
+ this.tableOptions.isActive = true;
2177
+ this.initialStateApplied = true;
2178
+ this.tableLazyLoadEventInformation.first = 0;
2179
+ this.tableLazyLoadEventInformation.rows = this.currentRowsPerPage;
2180
+ this.fetchTableData(this.tableLazyLoadEventInformation);
2181
+ }
2182
+ else {
2183
+ setTimeout(() => {
2184
+ if (this.destroyed)
2185
+ return;
2186
+ this.initialColumnWidths = this.tableService.computeColumnWidths(this.dt);
2187
+ this.initialTableWidth = this.tableService.computeTableWidth(this.dt);
2188
+ }, 0);
2189
+ this.fetchTableViews();
2190
+ }
2191
+ }
2192
+ refreshData(event) {
2193
+ this.fetchTableData(this.tableLazyLoadEventInformation);
2194
+ }
2195
+ tableViewsEnabled() {
2196
+ var _a, _b, _c;
2197
+ const views = this.tableOptions.views;
2198
+ if ((views === null || views === void 0 ? void 0 : views.saveMode) === TableViewSaveMode.None) { // saveMode must be different from noone
2199
+ return false;
2200
+ }
2201
+ if (!((_a = views === null || views === void 0 ? void 0 : views.saveKey) === null || _a === void 0 ? void 0 : _a.trim())) { // saveKey must exist and must not be empty after trim
2202
+ return false;
2203
+ }
2204
+ if (this.maxViews <= 0) { // maxViews must be greater than 0
2205
+ return false;
2206
+ }
2207
+ if ((views === null || views === void 0 ? void 0 : views.saveMode) === TableViewSaveMode.DatabaseStorage) { // If saveMode is database, urlGet and urlSave must exist and must not be empty after trim
2208
+ if (!((_b = views === null || views === void 0 ? void 0 : views.urlGet) === null || _b === void 0 ? void 0 : _b.trim()) || !((_c = views === null || views === void 0 ? void 0 : views.urlSave) === null || _c === void 0 ? void 0 : _c.trim())) {
2209
+ return false;
2210
+ }
2211
+ }
2212
+ return true; // All checks passed, views are enabled
2213
+ }
2214
+ fetchTableViews() {
2215
+ if (!this.tableViewsEnabled()) {
2216
+ this.startInitialDataLoad();
2217
+ return;
2218
+ }
2219
+ const tableViews = this.tableService.fetchTableViews(this.tableOptions.views.saveMode, this.tableOptions.views.urlGet, this.tableOptions.views.saveKey);
2220
+ if (tableViews instanceof Observable) {
2221
+ tableViews.pipe(takeUntil(this.destroy$)).subscribe({
2222
+ next: (response) => {
2223
+ let parsedResult = response.body.map((item) => ({
2224
+ viewAlias: item.viewAlias,
2225
+ viewData: JSON.parse(item.viewData),
2226
+ lastActive: item.lastActive
2227
+ }));
2228
+ this.tableViewListProcess(parsedResult);
2229
+ },
2230
+ error: (err) => {
2231
+ this.tableService.handleTableError(err, 'Views get error');
2232
+ this.startInitialDataLoad();
2233
+ }
2234
+ });
2235
+ }
2236
+ else {
2237
+ this.tableViewListProcess(tableViews);
2238
+ }
2239
+ }
2240
+ tableViewListProcess(tableViews) {
2241
+ this.tableViewsList = [...tableViews];
2242
+ if (this.tableViewsList.length > 0) {
2243
+ this.tableService.sortViews(this.tableViewsList);
2244
+ }
2245
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
2246
+ this.startInitialDataLoad();
2247
+ }
2248
+ startInitialDataLoad() {
2249
+ if (this.initialStateApplied || this.destroyed)
2250
+ return;
2251
+ const restored = this.restoreNavigationState();
2252
+ this.initialStateApplied = true;
2253
+ const viewToStartup = restored ? undefined : this.tableViewsList.find(v => v.lastActive);
2254
+ if (viewToStartup) { // If there is a view that needs to be loaded on startup
2255
+ this.viewLoad(viewToStartup.viewAlias);
2256
+ }
2257
+ else {
2258
+ this.fetchTableData(this.tableLazyLoadEventInformation);
2259
+ }
2260
+ }
2261
+ viewLoad(tableViewAlias) {
2262
+ var _a, _b, _c;
2263
+ const viewToLoad = this.tableViewsList.find(v => v.viewAlias === tableViewAlias);
2264
+ if (!viewToLoad) {
2265
+ this.notification.showToast("error", this.i18n.text("VIEW TO LOAD DOESN'T EXIST"), this.i18n.text("The view to load doesn't exist"));
2266
+ return;
2267
+ }
2268
+ this.columnSelectionCustomized = true;
2269
+ let viewData = viewToLoad.viewData;
2270
+ (_a = this.treeState) === null || _a === void 0 ? void 0 : _a.restore(viewData.treeExpandedKeys, viewData.treeChildPages);
2271
+ this.treeStateRestored = !!this.treeState;
2272
+ this.columnsSelected = viewData.columnsShown
2273
+ .map(data => this.columns.find((col) => col.field === data.field))
2274
+ .filter((col) => col !== undefined)
2275
+ .filter(col => !this.columnsCantBeHidden.includes(col));
2276
+ this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
2277
+ this.currentPage = viewData.currentPage;
2278
+ this.currentRowsPerPage = viewData.currentRowsPerPage;
2279
+ this.restoreGlobalSearch(viewData.globalSearchText);
2280
+ this.tableOptions.isActive = false;
2281
+ this.tableLazyLoadEventInformation.multiSortMeta = [...((_b = viewData.multiSortMeta) !== null && _b !== void 0 ? _b : [])];
2282
+ this.dt.multiSortMeta = [...((_c = viewData.multiSortMeta) !== null && _c !== void 0 ? _c : [])];
2283
+ this.dt.sortMultiple();
2284
+ this.dt.first = this.currentPage * this.currentRowsPerPage;
2285
+ this.dt.rows = this.currentRowsPerPage;
2286
+ this.tableLazyLoadEventInformation.first = this.dt.first;
2287
+ this.tableLazyLoadEventInformation.rows = this.currentRowsPerPage;
2288
+ this.tableOptions.isActive = true;
2289
+ this.tableLazyLoadEventInformation.filters = structuredClone(viewData.filters);
2290
+ this.dt.filters = structuredClone(viewData.filters);
2291
+ this.restorePredefinedSelections(viewData.filters);
2292
+ this.dt.tableWidthState = viewData.tableWidth;
2293
+ this.dt.columnWidthsState = viewData.columnsWidth;
2294
+ this.tableViewCurrentSelectedAlias = tableViewAlias;
2295
+ this.notification.showToast("info", this.i18n.text("TABLE VIEW RESTORED"), this.i18n.text("The table view '{{value0}}' has been restored.", { value0: this.tableViewCurrentSelectedAlias }));
2296
+ this.viewsModalShow = false;
2297
+ this.fetchTableData(this.tableLazyLoadEventInformation);
2298
+ }
2299
+ viewCreate(viewAlias) {
2300
+ if (this.tableViewsList.length >= this.maxViews) {
2301
+ this.notification.showToast("error", this.i18n.text("NO MORE VIEWS ALLOWED"), this.i18n.text("You have created the maximum number of allowed views for this table"));
2302
+ return;
2303
+ }
2304
+ let viewData = this.generateViewData();
2305
+ let newView = {
2306
+ lastActive: false,
2307
+ viewAlias: viewAlias,
2308
+ viewData: viewData
2309
+ };
2310
+ this.tableViewsList.push(newView);
2311
+ this.tableService.sortViews(this.tableViewsList);
2312
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
2313
+ this.tableViewCurrentSelectedAlias = viewAlias;
2314
+ this.viewsSave(0);
2315
+ }
2316
+ viewDelete(viewAlias) {
2317
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
2318
+ if (index === -1) {
2319
+ this.notification.showToast("error", this.i18n.text("Table view delete failed"), this.i18n.text("The table view could not be deleted since it was not found."));
2320
+ return;
2321
+ }
2322
+ this.tableViewsList.splice(index, 1);
2323
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
2324
+ if (this.tableViewCurrentSelectedAlias === viewAlias) {
2325
+ this.tableViewCurrentSelectedAlias = null;
2326
+ }
2327
+ this.viewsSave(3);
2328
+ }
2329
+ viewEditAlias(event) {
2330
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === event.viewAliasOld);
2331
+ if (index === -1) {
2332
+ this.notification.showToast("error", this.i18n.text("Table view alias change failed"), this.i18n.text("The table view alias could not be changed since it was not found."));
2333
+ return;
2334
+ }
2335
+ this.tableViewsList[index].viewAlias = event.viewAliasNew;
2336
+ this.tableService.sortViews(this.tableViewsList);
2337
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
2338
+ if (this.tableViewCurrentSelectedAlias === event.viewAliasOld) {
2339
+ this.tableViewCurrentSelectedAlias = event.viewAliasNew;
2340
+ }
2341
+ this.viewsSave(2);
2342
+ }
2343
+ viewUpdateData(viewAlias) {
2344
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
2345
+ if (index === -1) {
2346
+ this.notification.showToast("error", this.i18n.text("Table view not found"), this.i18n.text("The table view to update data from was not found."));
2347
+ return;
2348
+ }
2349
+ let viewData = this.generateViewData();
2350
+ this.tableViewsList[index].viewData = viewData;
2351
+ this.viewsSave(1);
2352
+ }
2353
+ viewUpdateActiveStartup(viewAlias) {
2354
+ const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
2355
+ if (index === -1) {
2356
+ this.notification.showToast("error", this.i18n.text("Table view not found"), this.i18n.text("The table view to update data from was not found."));
2357
+ return;
2358
+ }
2359
+ let newStatus = !this.tableViewsList[index].lastActive;
2360
+ this.tableViewsList.forEach(v => v.lastActive = false);
2361
+ this.tableViewsList[index].lastActive = newStatus;
2362
+ this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
2363
+ this.viewsSave(4);
2364
+ }
2365
+ viewsSave(endMessage) {
2366
+ let tableView = JSON.stringify(this.tableViewsList);
2367
+ switch (this.tableOptions.views.saveMode) {
2368
+ case TableViewSaveMode.SessionStorage:
2369
+ sessionStorage.setItem(this.tableOptions.views.saveKey, tableView);
2370
+ break;
2371
+ case TableViewSaveMode.LocalStorage:
2372
+ localStorage.setItem(this.tableOptions.views.saveKey, tableView);
2373
+ break;
2374
+ case TableViewSaveMode.DatabaseStorage:
2375
+ const saveObsv = this.tableService.viewsSaveToDatabase(this.tableViewsList, this.tableOptions.views.urlSave, this.tableOptions.views.saveKey);
2376
+ saveObsv.subscribe({
2377
+ next: (response) => {
2378
+ this.viewsSaveEnd(endMessage);
2379
+ },
2380
+ error: (err) => this.tableService.handleTableError(err, 'Views save error')
2381
+ });
2382
+ return;
2383
+ default:
2384
+ this.notification.showToast("error", this.i18n.text("NOT IMPLEMENTED"), this.i18n.text("This type os save view has not been implemented yet."));
2385
+ return;
2386
+ }
2387
+ this.viewsSaveEnd(endMessage);
2388
+ }
2389
+ viewsSaveEnd(endMessage) {
2390
+ var _a;
2391
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.markForCheck();
2392
+ switch (endMessage) {
2393
+ case 0: // NEW VIEW
2394
+ this.notification.showToast("info", this.i18n.text("Table view created"), this.i18n.text("New table view has been created."));
2395
+ this.viewsModalShow = false;
2396
+ break;
2397
+ case 1: // UPDATE VIEW
2398
+ this.notification.showToast("info", this.i18n.text("Table view data updated"), this.i18n.text("The table view data was updated."));
2399
+ break;
2400
+ case 2: // UPDATE ALIAS
2401
+ this.notification.showToast("info", this.i18n.text("Table view name updated"), this.i18n.text("The table view alias was updated."));
2402
+ break;
2403
+ case 3: // DELETE VIEW
2404
+ this.notification.showToast("info", this.i18n.text("Table view delete"), this.i18n.text("The table view was deleted."));
2405
+ break;
2406
+ case 4: // DELETE VIEW
2407
+ this.notification.showToast("info", this.i18n.text("Table view active on startup"), this.i18n.text("Changed the view that will be active on startup."));
2408
+ break;
2409
+ }
2410
+ }
2411
+ fetchTableData(event) {
2412
+ var _a;
2413
+ if (!this.canFetchData()) {
2414
+ return;
2415
+ }
2416
+ if (!this.initialConfigurationFetched || !this.initialStateApplied) {
2417
+ return;
2418
+ }
2419
+ (_a = this.responsiveRowMenu) === null || _a === void 0 ? void 0 : _a.hide();
2420
+ this.tableLazyLoadEventInformation = event; // Store the event information for later use
2421
+ if (event.rows != null && event.rows !== undefined) {
2422
+ this.currentRowsPerPage = event.rows;
2423
+ }
2424
+ if (event.first != null && event.first !== undefined && event.rows != null && event.rows !== undefined) {
2425
+ this.currentPage = event.first / event.rows;
2426
+ }
2427
+ let filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(this.tableLazyLoadEventInformation.filters); // Create filters excluding the global filter
2428
+ filtersWithoutGlobalAndSelectedRows = this.revertDateTimeZoneFilters(filtersWithoutGlobalAndSelectedRows);
2429
+ const requestData = {
2430
+ page: this.currentPage,
2431
+ pageSize: this.currentRowsPerPage,
2432
+ sort: this.tableLazyLoadEventInformation.multiSortMeta,
2433
+ filter: filtersWithoutGlobalAndSelectedRows,
2434
+ globalFilter: this.effectiveGlobalSearchText,
2435
+ columns: this.tableOptions.columns.shown.map(col => col.field),
2436
+ dateFormat: this.dateFormat,
2437
+ dateTimezone: this.dateTimezone,
2438
+ dateCulture: this.dateCulture,
2439
+ exportDateFormat: this.exportDateFormat
2440
+ };
2441
+ const selectionKey = JSON.stringify(Object.assign(Object.assign({}, requestData), { page: 0, pageSize: 0, sort: null }));
2442
+ if (selectionKey !== this.selectionQueryKey)
2443
+ this.matchingSelectionKeys = undefined;
2444
+ this.selectionQueryKey = selectionKey;
2445
+ this.selectionQuery = structuredClone(requestData);
2446
+ if (this.treeState) {
2447
+ const tree = this.treeState;
2448
+ if (!this.treeStateRestored)
2449
+ tree.restore([...tree.expanded], tree.snapshotPages());
2450
+ this.treeStateRestored = false;
2451
+ const structural = [tree.options.keyExpr, tree.options.parentIdExpr, tree.options.hasItemsExpr, 'rowID'];
2452
+ requestData.columns = [...new Set([...requestData.columns, ...structural.filter((field) => !!field)])];
2453
+ this.treeQuery = structuredClone(requestData);
2454
+ const loading = tree.load(this.currentPage, this.currentRowsPerPage, this.treeFetcher(requestData));
2455
+ this.tableOptions.data = [];
2456
+ loading.then(updated => {
2457
+ if (updated && !this.destroyed)
2458
+ this.syncTreeRows();
2459
+ }).catch(error => {
2460
+ if (!this.destroyed)
2461
+ this.tableService.handleTableError(error, 'Tree data error');
2462
+ }).finally(() => {
2463
+ var _a;
2464
+ if (!this.destroyed) {
2465
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.markForCheck();
2466
+ this.onDataEndUpdate.emit();
2467
+ }
2468
+ });
2469
+ return;
2470
+ }
2471
+ this.tableService.fetchTableData(this.tableOptions.urlTableData, requestData)
2472
+ .pipe(takeUntil(this.destroy$), finalize(() => {
2473
+ if (this.destroyed)
2474
+ return;
2475
+ this.onDataEndUpdate.emit(); // This is always executed after data update.
2476
+ }))
2477
+ .subscribe({
2478
+ next: (response) => this.handleTableDataResponse(response.body),
2479
+ error: (err) => this.tableService.handleTableError(err, 'Columns Error')
2480
+ });
2481
+ }
2482
+ modifyFiltersWithoutGlobalAndSelectedRows(filters, overrideOption = -1) {
2483
+ let filtersWithoutGlobalAndSelectedRows = structuredClone(filters !== null && filters !== void 0 ? filters : {}); // Create a copy of filters to delete the global.
2484
+ if (filtersWithoutGlobalAndSelectedRows.hasOwnProperty('global')) { // If there is an entry with the global filter
2485
+ delete filtersWithoutGlobalAndSelectedRows['global']; // Remove the global filter
2486
+ }
2487
+ this.selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption);
2488
+ return filtersWithoutGlobalAndSelectedRows; // Return the filters without global array
2489
+ }
2490
+ resetTableView() {
2491
+ var _a, _b, _c, _d;
2492
+ this.cancelGlobalSearch();
2493
+ const key = (_b = (_a = this.tableOptions.statePersistence) === null || _a === void 0 ? void 0 : _a.key) === null || _b === void 0 ? void 0 : _b.trim();
2494
+ if (key)
2495
+ (_c = this.stateScope) === null || _c === void 0 ? void 0 : _c.clear(key);
2496
+ (_d = this.treeState) === null || _d === void 0 ? void 0 : _d.restore();
2497
+ this.treeStateRestored = !!this.treeState;
2498
+ this.initialStateApplied = false;
2499
+ this.tableViewCurrentSelectedAlias = '';
2500
+ this.fetchTableConfiguration(true);
2501
+ }
2502
+ selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption = -1) {
2503
+ var _a, _b;
2504
+ if (filtersWithoutGlobalAndSelectedRows.hasOwnProperty('selector') || overrideOption === 1 || overrideOption === 2) {
2505
+ const selectorFilter = (_a = filtersWithoutGlobalAndSelectedRows['selector']) === null || _a === void 0 ? void 0 : _a[0];
2506
+ let filterType = null;
2507
+ if (overrideOption < 0 || overrideOption > 2) {
2508
+ filterType = (_b = selectorFilter === null || selectorFilter === void 0 ? void 0 : selectorFilter.value) !== null && _b !== void 0 ? _b : null;
2509
+ }
2510
+ else {
2511
+ switch (overrideOption) {
2512
+ case 0: // All
2513
+ filterType = null;
2514
+ break;
2515
+ case 1: // Only selected rows
2516
+ filterType = true;
2517
+ break;
2518
+ case 2: // Only NOT selected
2519
+ filterType = false;
2520
+ break;
2521
+ }
2522
+ }
2523
+ if (!filtersWithoutGlobalAndSelectedRows.hasOwnProperty('rowID')) {
2524
+ filtersWithoutGlobalAndSelectedRows['rowID'] = [
2525
+ {
2526
+ "value": null,
2527
+ "matchMode": "in",
2528
+ "operator": "or"
2529
+ }
2530
+ ];
2531
+ }
2532
+ const idFilter = filtersWithoutGlobalAndSelectedRows['rowID'][0];
2533
+ if (filterType === true) {
2534
+ idFilter.matchMode = "in";
2535
+ idFilter.value = this.selectedRowsCheckbox;
2536
+ }
2537
+ else if (filterType === false) {
2538
+ idFilter.operator = "and";
2539
+ idFilter.matchMode = "notIn";
2540
+ idFilter.value = this.selectedRowsCheckbox;
2541
+ }
2542
+ else if (filterType === null) {
2543
+ idFilter.value = null;
2544
+ idFilter.matchMode = "in";
2545
+ }
2546
+ }
2547
+ }
2548
+ revertDateTimeZoneFilters(inputFilter) {
2549
+ this.tableOptions.columns.shown.forEach((column) => {
2550
+ if (column.dataType === DataType.Date) { // If its date type
2551
+ if (inputFilter.hasOwnProperty(column.field)) {
2552
+ const originalDate = inputFilter[column.field][0].value;
2553
+ if (originalDate !== null && originalDate instanceof Date) {
2554
+ const utcDate = new Date(Date.UTC(originalDate.getFullYear(), originalDate.getMonth(), originalDate.getDate()));
2555
+ inputFilter[column.field][0].value = utcDate;
2556
+ }
2557
+ }
2558
+ }
2559
+ });
2560
+ return inputFilter;
2561
+ }
2562
+ handleTableDataResponse(body) {
2563
+ this.tableOptions.data = body.data; // Update the table data
2564
+ this.totalRecords = body.totalRecords; // Update the total number of records
2565
+ this.totalRecordsNotFiltered = body.totalRecordsNotFiltered; // Update the total records not filtered
2566
+ this.currentPage = body.page; // Update the current page
2567
+ }
2568
+ generateViewData() {
2569
+ const view = this.tableService.viewGenerateData(this.dt, this.effectiveGlobalSearchText, this.currentPage, this.currentRowsPerPage, this.modifyFiltersWithoutGlobalAndSelectedRows.bind(this));
2570
+ if (this.treeState) {
2571
+ view.treeExpandedKeys = [...this.treeState.expanded];
2572
+ view.treeChildPages = this.treeState.snapshotPages();
2573
+ }
2574
+ return view;
2575
+ }
2576
+ treeFetcher(query) {
2577
+ return (request) => __awaiter(this, void 0, void 0, function* () {
2578
+ const response = yield firstValueFrom(this.tableService.fetchTableData(this.tableOptions.urlTableData, Object.assign(Object.assign({}, structuredClone(query)), request)).pipe(takeUntil(this.destroy$)));
2579
+ if (!response.body)
2580
+ throw new Error('Empty tree response.');
2581
+ return response.body;
2582
+ });
2583
+ }
2584
+ syncTreeRows() {
2585
+ var _a;
2586
+ const tree = this.treeState;
2587
+ this.tableOptions.data = tree.visible;
2588
+ this.totalRecords = tree.totalRecords;
2589
+ this.totalRecordsNotFiltered = tree.totalRecordsNotFiltered;
2590
+ this.currentPage = tree.page;
2591
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.markForCheck();
2592
+ }
2593
+ toggleTreeRow(event, row) {
2594
+ var _a, _b;
2595
+ return __awaiter(this, void 0, void 0, function* () {
2596
+ event.stopPropagation();
2597
+ if (!this.treeState || !this.treeQuery || this.treeState.loading)
2598
+ return;
2599
+ try {
2600
+ const update = this.treeState.toggle(row, this.treeFetcher(this.treeQuery));
2601
+ (_a = this.changeDetector) === null || _a === void 0 ? void 0 : _a.markForCheck();
2602
+ yield update;
2603
+ if (!this.destroyed)
2604
+ this.syncTreeRows();
2605
+ }
2606
+ catch (error) {
2607
+ if (!this.destroyed)
2608
+ this.tableService.handleTableError(error, 'Tree data error');
2609
+ }
2610
+ finally {
2611
+ if (!this.destroyed) {
2612
+ (_b = this.changeDetector) === null || _b === void 0 ? void 0 : _b.markForCheck();
2613
+ this.onDataEndUpdate.emit();
2614
+ }
2615
+ }
2616
+ });
2617
+ }
2618
+ loadMoreTreeRows(event, row) {
2619
+ return __awaiter(this, void 0, void 0, function* () {
2620
+ event.stopPropagation();
2621
+ if (!this.treeState || !this.treeQuery || this.treeState.loading)
2622
+ return;
2623
+ try {
2624
+ yield this.treeState.loadMore(row, this.treeFetcher(this.treeQuery));
2625
+ if (!this.destroyed)
2626
+ this.syncTreeRows();
2627
+ }
2628
+ catch (error) {
2629
+ if (!this.destroyed)
2630
+ this.tableService.handleTableError(error, 'Tree data error');
2631
+ }
2632
+ });
2633
+ }
2634
+ get treeColumn() {
2635
+ var _a, _b, _c, _d, _e;
2636
+ const columns = (_b = (_a = this.tableOptions.columns) === null || _a === void 0 ? void 0 : _a.shown) !== null && _b !== void 0 ? _b : [];
2637
+ return (_d = (_c = columns.find(column => { var _a; return column.field === ((_a = this.treeState) === null || _a === void 0 ? void 0 : _a.options.column); })) === null || _c === void 0 ? void 0 : _c.field) !== null && _d !== void 0 ? _d : (_e = columns[0]) === null || _e === void 0 ? void 0 : _e.field;
2638
+ }
2639
+ treePageChange(event) {
2640
+ var _a, _b;
2641
+ this.fetchTableData(Object.assign(Object.assign({}, this.tableLazyLoadEventInformation), { first: (_a = event.first) !== null && _a !== void 0 ? _a : 0, rows: (_b = event.rows) !== null && _b !== void 0 ? _b : this.currentRowsPerPage }));
2642
+ }
2643
+ clearFilters(dt, force = false, onlyGlobalFilter = false) {
2644
+ var _a, _b, _c;
2645
+ this.cancelGlobalSearch();
2646
+ let hasToClear = this.hasToClearFilters(dt, this.globalSearchText, force);
2647
+ if (hasToClear) {
2648
+ if (!onlyGlobalFilter) {
2649
+ this.predefinedFiltersSelectedValuesCollection = {};
2650
+ for (const key in dt.filters) {
2651
+ if (dt.filters.hasOwnProperty(key)) {
2652
+ const filters = dt.filters[key];
2653
+ if (Array.isArray(filters)) {
2654
+ filters.forEach(filter => {
2655
+ filter.value = null; // Set value to null
2656
+ });
2657
+ }
2658
+ else {
2659
+ filters.value = null; // Set value to null
2660
+ }
2661
+ }
2662
+ }
2663
+ let filters = Object.assign({}, this.dt.filters);
2664
+ (_a = dt.columns) === null || _a === void 0 ? void 0 : _a.forEach(element => {
2665
+ dt.filter(null, element.field, element.matchMode);
2666
+ });
2667
+ this.dt.filters = filters;
2668
+ }
2669
+ this.restoreGlobalSearch(null);
2670
+ if (this.globalSearchOption((_b = this.tableOptions.globalFilter) === null || _b === void 0 ? void 0 : _b.minLength) > 0 ||
2671
+ this.globalSearchOption((_c = this.tableOptions.globalFilter) === null || _c === void 0 ? void 0 : _c.debounceTime) > 0) {
2672
+ this.currentPage = 0;
2673
+ dt.first = 0;
2674
+ dt.filters = Object.assign(Object.assign({}, dt.filters), { global: { value: null, matchMode: 'contains' } });
2675
+ this.fetchTableData(Object.assign(Object.assign({}, this.tableLazyLoadEventInformation), { first: 0, rows: this.currentRowsPerPage, filters: dt.filters }));
2676
+ }
2677
+ else
2678
+ dt.filterGlobal('', '');
2679
+ }
2680
+ }
2681
+ clearSorts(dt, force = false) {
2682
+ let hasToClear = this.hasToClearSorts(dt, force);
2683
+ if (hasToClear) {
2684
+ dt.multiSortMeta = [];
2685
+ dt.sortMultiple();
2686
+ }
2687
+ }
2688
+ hasToClearSorts(dt, force = false) {
2689
+ let hasToClear = false;
2690
+ const hasSorts = (dt.multiSortMeta && dt.multiSortMeta.length > 0);
2691
+ if (force || hasSorts) {
2692
+ hasToClear = true;
2693
+ }
2694
+ return hasToClear;
2695
+ }
2696
+ hasToClearFilters(dt, globalSearchText, force = false) {
2697
+ let hasToClear = false;
2698
+ const filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(dt.filters);
2699
+ const hasFilters = this.hasFilters(filtersWithoutGlobalAndSelectedRows);
2700
+ const hasGlobalFilter = (globalSearchText && globalSearchText.trim() !== "");
2701
+ if (force || hasFilters || hasGlobalFilter) {
2702
+ hasToClear = true;
2703
+ }
2704
+ return hasToClear;
2705
+ }
2706
+ /**
2707
+ * Determines whether there are active filters based on the provided filter rules.
2708
+ *
2709
+ * @param {any} filterRules An object representing filter rules for each column.
2710
+ * The keys are column names, and the values are arrays of filter rules.
2711
+ * Each filter rule has the following properties:
2712
+ * - `field`: The field or property name of the column.
2713
+ * - `value`: The filter value entered by the user.
2714
+ * - Other properties depending on the type of filter (e.g., `matchMode` for string filters).
2715
+ * @returns {boolean} `true` if at least one active filter is found, otherwise `false`.
2716
+ */
2717
+ hasFilters(filterRules) {
2718
+ for (const columnName of Object.keys(filterRules)) { // Iterate over each column name in the filter rules
2719
+ const columnFilters = filterRules[columnName]; // Get the filter rules for the current column
2720
+ for (const filterRule of columnFilters) { // Iterate over each filter rule for the current column
2721
+ if (filterRule.value !== null && filterRule.value !== "") { // Check if the filter value is not null or an empty string
2722
+ return true; // At least one active filter found
2723
+ }
2724
+ }
2725
+ }
2726
+ return false; // No active filters found
2727
+ }
2728
+ getColumnStyle(col, headerCols = false) {
2729
+ return this.tableService.getColumnStyle(col, headerCols);
2730
+ }
2731
+ getPredefinedFilterValues(columnKeyName) {
2732
+ var _a;
2733
+ return ((_a = this.tableOptions.predefinedFilters) === null || _a === void 0 ? void 0 : _a[columnKeyName]) || []; // Return the predefined filter values or an empty array if the option name does not exist
2734
+ }
2735
+ getFrozenColumnAlignAsText(frozenColumnAlign) {
2736
+ return frozenColumnAlignAsText(frozenColumnAlign);
2737
+ }
2738
+ getDataTypeAsText(dataType) {
2739
+ return dataTypeAsText(dataType);
2740
+ }
2741
+ /**
2742
+ * Updates the filters of a PrimeNG data table based on predefined filter changes.
2743
+ *
2744
+ * @param {string} filterName - The name of the filter to be updated.
2745
+ * @param {IPrimengPredefinedFilter[]} selectedValues - An array of selected predefined filter values.
2746
+ */
2747
+ onPredefinedFilterChange(filterName, selectedValues) {
2748
+ const filters = Object.assign({}, this.dt.filters); // Create a shallow copy of the current filters to avoid mutating the original filters directly
2749
+ const newValue = selectedValues && selectedValues.length ? selectedValues.map(value => value.value) : null; // Convert empty selection to null so PrimeNG removes the filter instead of applying an empty array
2750
+ if (Array.isArray(filters[filterName])) { // Check if the filter for the given filterName is an array
2751
+ filters[filterName].forEach(criteria => {
2752
+ criteria.value = newValue; // Update the value of each criteria with the values from selectedValues
2753
+ });
2754
+ }
2755
+ else if (filters[filterName]) { // Check if the filter for the given filterName exists and is not an array
2756
+ const criteria = filters[filterName]; // Cast the filter criteria to FilterMetadata
2757
+ criteria.value = newValue; // Update the value of the criteria with the values from selectedValues
2758
+ }
2759
+ this.dt.filters = filters; // Update the data table's filters with the modified filters object
2760
+ this.dt._filter(); // Trigger the filtering operation on the data table to apply the new filters
2761
+ }
2762
+ /**
2763
+ * Checks if the provided column metadata matches a specific style of the predefined filters
2764
+ * that need to be applied to an item on a row.
2765
+ *
2766
+ * @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
2767
+ * @param {any} value - The value to be matched against the predefined filter values.
2768
+ * @returns {any} The matching predefined filter value if found, otherwise null.
2769
+ */
2770
+ getPredfinedFilterMatch(colMetadata, value) {
2771
+ if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) { // Check if the column uses predefined filter values
2772
+ const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName); // Get the predefined filter values based on the name
2773
+ return options.find(option => option.value === value); // Return the matching option if found
2774
+ }
2775
+ return null; // Return null if the column does not use predefined filter values
2776
+ }
2777
+ copyToClipboardStart(event) {
2778
+ var _a, _b;
2779
+ if (((_a = this.tableOptions.copyToClipboardTime) !== null && _a !== void 0 ? _a : 0) > 0) {
2780
+ const cellContent = event.target.innerText;
2781
+ this.copyCellDataTimer = setTimeout(() => {
2782
+ navigator.clipboard.writeText(cellContent).then(() => {
2783
+ this.notification.clearToasts();
2784
+ this.notification.showToast("info", this.i18n.text("CELL CONTENT COPIED"), this.i18n.text("The cell content has been copied to your clipboard."));
2785
+ }).catch(err => {
2786
+ this.notification.clearToasts();
2787
+ this.notification.showToast("error", this.i18n.text("CELL CONTENT COPIED"), this.i18n.text("The cell content failed to copy to your clipboard with error: {{value0}}", { value0: err }));
2788
+ });
2789
+ }, ((_b = this.tableOptions.copyToClipboardTime) !== null && _b !== void 0 ? _b : 0) * 1000);
2790
+ }
2791
+ }
2792
+ copyToClipboardCancel() {
2793
+ var _a;
2794
+ if (((_a = this.tableOptions.copyToClipboardTime) !== null && _a !== void 0 ? _a : 0) > 0) {
2795
+ clearTimeout(this.copyCellDataTimer);
2796
+ }
2797
+ }
2798
+ getDataAlignHorizontalAsText(dataAlignHorizontal) {
2799
+ return dataAlignHorizontalAsText(dataAlignHorizontal);
2800
+ }
2801
+ getDataAlignVerticalAsText(dataAlignVertical) {
2802
+ return dataAlignVerticalAsText(dataAlignVertical);
2803
+ }
2804
+ isRowCheckboxSelected(rowID) {
2805
+ return this.selectedRowsCheckbox.includes(rowID);
2806
+ }
2807
+ get allMatchingRowsSelected() {
2808
+ var _a;
2809
+ if (!((_a = this.matchingSelectionKeys) === null || _a === void 0 ? void 0 : _a.length))
2810
+ return false;
2811
+ const selected = new Set(this.selectedRowsCheckbox);
2812
+ return this.matchingSelectionKeys.every(key => selected.has(key));
2813
+ }
2814
+ get matchingRowsPartiallySelected() {
2815
+ if (this.allMatchingRowsSelected)
2816
+ return false;
2817
+ if (!this.matchingSelectionKeys)
2818
+ return this.selectedRowsCheckbox.length > 0;
2819
+ const selected = new Set(this.selectedRowsCheckbox);
2820
+ return this.matchingSelectionKeys.some(key => selected.has(key));
2821
+ }
2822
+ toggleAllMatchingRows(checked) {
2823
+ var _a, _b, _c;
2824
+ return __awaiter(this, void 0, void 0, function* () {
2825
+ const options = (_a = this.tableOptions.rows) === null || _a === void 0 ? void 0 : _a.checkboxSelector;
2826
+ if (!(options === null || options === void 0 ? void 0 : options.enabled) || !options.selectAllEnabled || !options.urlSelectAll ||
2827
+ !this.selectionQuery || this.selectAllLoading)
2828
+ return;
2829
+ const queryKey = this.selectionQueryKey;
2830
+ this.selectAllLoading = true;
2831
+ try {
2832
+ const response = yield firstValueFrom(this.tableService.fetchSelectionKeys(options.urlSelectAll, structuredClone(this.selectionQuery)).pipe(takeUntil(this.destroy$)));
2833
+ if (this.destroyed || queryKey !== this.selectionQueryKey)
2834
+ return;
2835
+ if (!Array.isArray(response.body) || response.body.some(key => typeof key !== 'string' && typeof key !== 'number'))
2836
+ throw new Error('Invalid selection identifiers.');
2837
+ const disabledKeys = new Set(((_b = this.tableOptions.data) !== null && _b !== void 0 ? _b : [])
2838
+ .filter(row => { var _a, _b; return !((_b = (_a = options.enabledCondition) === null || _a === void 0 ? void 0 : _a.call(options, row)) !== null && _b !== void 0 ? _b : true); }).map(row => row.rowID));
2839
+ const keys = [...new Set(response.body)].filter(key => !disabledKeys.has(key));
2840
+ this.matchingSelectionKeys = keys;
2841
+ const selected = new Set(this.selectedRowsCheckbox);
2842
+ const changed = keys.filter(key => selected.has(key) !== checked);
2843
+ for (const key of changed) {
2844
+ if (checked)
2845
+ selected.add(key);
2846
+ else
2847
+ selected.delete(key);
2848
+ }
2849
+ this.selectedRowsCheckbox = [...selected];
2850
+ for (const rowID of changed)
2851
+ this.onRowCheckboxChange.emit({ rowID, selected: checked });
2852
+ }
2853
+ catch (error) {
2854
+ if (!this.destroyed)
2855
+ this.tableService.handleTableError(error, 'Selection error');
2856
+ }
2857
+ finally {
2858
+ this.selectAllLoading = false;
2859
+ (_c = this.changeDetector) === null || _c === void 0 ? void 0 : _c.markForCheck();
2860
+ }
2861
+ });
2862
+ }
2863
+ onRowChekboxChange(event, rowID) {
2864
+ if (event.checked) { // Add the selected item
2865
+ if (!this.selectedRowsCheckbox.includes(rowID))
2866
+ this.selectedRowsCheckbox.push(rowID);
2867
+ }
2868
+ else { // Remove the selected item
2869
+ this.selectedRowsCheckbox = this.selectedRowsCheckbox.filter(selectedId => selectedId !== rowID);
2870
+ }
2871
+ this.onRowCheckboxChange.emit({
2872
+ rowID: rowID,
2873
+ selected: event.checked
2874
+ });
2875
+ }
2876
+ rowSelect(event) {
2877
+ this.onRowSelect.emit({
2878
+ rowID: event.data.rowID,
2879
+ rowData: event.data
2880
+ });
2881
+ }
2882
+ rowUnselect(event) {
2883
+ this.onRowUnselect.emit({
2884
+ rowID: event.data.rowID,
2885
+ rowData: event.data
2886
+ });
2887
+ }
2888
+ pageChange(event) {
2889
+ this.currentPage = event.rows ? event.first / event.rows : 0;
2890
+ this.currentRowsPerPage = event.rows ? event.rows : 0;
2891
+ }
2892
+ columnSelectorShow() {
2893
+ var _a;
2894
+ (_a = this.tableOptions.columns) === null || _a === void 0 ? void 0 : _a.selectorOrderByColumnName;
2895
+ let tempData = this.columns.map(column => {
2896
+ const isSelected = this.columnsSelected.some(selectedColumn => selectedColumn.field === column.field) || this.columnsCantBeHidden.some(selectedColumn => selectedColumn.field === column.field);
2897
+ const isSelectDisabled = this.columnsCantBeHidden.some(selectedColumn => selectedColumn.field === column.field);
2898
+ return {
2899
+ field: column.field,
2900
+ header: column.header,
2901
+ selected: isSelected,
2902
+ selectDisabled: isSelectDisabled,
2903
+ cellOverflowBehaviour: column.cellOverflowBehaviour,
2904
+ cellOverflowBehaviourDisabled: !column.cellOverflowBehaviourAllowUserEdit,
2905
+ dataAlignHorizontal: column.dataAlignHorizontal,
2906
+ dataAlignHorizontalDisabled: !column.dataAlignHorizontalAllowUserEdit,
2907
+ dataAlignVertical: column.dataAlignVertical,
2908
+ dataAlignVerticalDisabled: !column.dataAlignVerticalAllowUserEdit
2909
+ };
2910
+ });
2911
+ this.columnModalData = [...tempData];
2912
+ this.filteredColumnData = this.columnModalData;
2913
+ this.showColumnSelector = true;
2914
+ }
2915
+ applyColumnModalChanges(selectedColumns) {
2916
+ this.columnSelectionCustomized = true;
2917
+ const existingColumns = this.dt.columns;
2918
+ const columnsToKeep = new Set();
2919
+ this.columnsCantBeHidden.forEach(col => columnsToKeep.add(col.field));
2920
+ selectedColumns.forEach(col => columnsToKeep.add(col.field));
2921
+ const finalColumns = [];
2922
+ existingColumns.forEach(col => {
2923
+ if (columnsToKeep.has(col.field)) {
2924
+ finalColumns.push(col);
2925
+ }
2926
+ });
2927
+ selectedColumns.forEach(col => {
2928
+ const matchingColumn = this.columns.find(c => c.field === col.field);
2929
+ if (matchingColumn && !finalColumns.find(c => c.field === matchingColumn.field)) {
2930
+ finalColumns.push(matchingColumn);
2931
+ }
2932
+ });
2933
+ let prevColsToShow = this.tableOptions.columns.shown;
2934
+ this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(finalColumns);
2935
+ let sameColumnsAsBefore = prevColsToShow.length === this.tableOptions.columns.shown.length &&
2936
+ prevColsToShow.every((prevCol, index) => prevCol.field === this.tableOptions.columns.shown[index].field);
2937
+ this.columnsSelected = this.tableOptions.columns.shown.filter(column => !this.columnsCantBeHidden.some(nonSelectable => nonSelectable.field === column.field));
2938
+ this.updateColumnsSpecialProperties(this.columnModalData);
2939
+ if (!sameColumnsAsBefore) {
2940
+ this.tableOptions.isActive = false;
2941
+ this.clearSorts(this.dt, true);
2942
+ this.clearFilters(this.dt, true, false);
2943
+ setTimeout(() => {
2944
+ this.tableOptions.isActive = true;
2945
+ }, 1);
2946
+ }
2947
+ }
2948
+ updateColumnsSpecialProperties(columnsSource) {
2949
+ const allColumns = [this.columns, this.tableOptions.columns.shown, this.columnsSelected, this.columnsCantBeHidden];
2950
+ const columnModalDataMap = new Map(columnsSource.map((item) => [item.field, {
2951
+ cellOverflowBehaviour: item.cellOverflowBehaviour,
2952
+ dataAlignHorizontal: item.dataAlignHorizontal,
2953
+ dataAlignVertical: item.dataAlignVertical,
2954
+ width: item.width
2955
+ }]));
2956
+ const updatedFields = new Set(); // To track updated fields
2957
+ allColumns.forEach((columnList) => {
2958
+ columnList.forEach((col) => {
2959
+ if (columnModalDataMap.has(col.field) && !updatedFields.has(col.field)) {
2960
+ const columnData = columnModalDataMap.get(col.field);
2961
+ if (columnData) {
2962
+ col.cellOverflowBehaviour = columnData.cellOverflowBehaviour;
2963
+ col.dataAlignHorizontal = columnData.dataAlignHorizontal;
2964
+ col.dataAlignVertical = columnData.dataAlignVertical;
2965
+ col.width = columnData.width;
2966
+ updatedFields.add(col.field);
2967
+ }
2968
+ }
2969
+ });
2970
+ });
2971
+ }
2972
+ openExcelExport() {
2973
+ var _a, _b, _c;
2974
+ const defaultTitle = (_b = (_a = this.tableOptions.excelReport) === null || _a === void 0 ? void 0 : _a.defaultTitle) === null || _b === void 0 ? void 0 : _b.trim();
2975
+ const allowEdit = ((_c = this.tableOptions.excelReport) === null || _c === void 0 ? void 0 : _c.titleAllowUserEdit) === true;
2976
+ this.excelReportTitle = this.i18n.text((!defaultTitle && !allowEdit) ? 'Report' : defaultTitle);
2977
+ this.showExportModal = true;
2978
+ }
2979
+ generateExcelReport(event) {
2980
+ var _a, _b;
2981
+ if (!((_b = (_a = this.tableOptions.excelReport) === null || _a === void 0 ? void 0 : _a.url) === null || _b === void 0 ? void 0 : _b.trim())) {
2982
+ return;
2983
+ }
2984
+ let filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(this.tableLazyLoadEventInformation.filters, event.selectedRows); // Create filters excluding the global filter
2985
+ filtersWithoutGlobalAndSelectedRows = this.revertDateTimeZoneFilters(filtersWithoutGlobalAndSelectedRows);
2986
+ const filtersMustBeApplied = (event.selectedRows === 1 || event.selectedRows === 2)
2987
+ ? true
2988
+ : event.applyFilters;
2989
+ const requestData = {
2990
+ page: this.currentPage,
2991
+ pageSize: this.currentRowsPerPage,
2992
+ sort: this.tableLazyLoadEventInformation.multiSortMeta,
2993
+ filter: filtersWithoutGlobalAndSelectedRows,
2994
+ globalFilter: this.effectiveGlobalSearchText,
2995
+ columns: this.tableOptions.columns.shown.map(col => col.field),
2996
+ dateFormat: this.dateFormat,
2997
+ dateTimezone: this.dateTimezone,
2998
+ dateCulture: this.dateCulture,
2999
+ exportDateFormat: this.exportDateFormat,
3000
+ allColumns: event.allColumns,
3001
+ applyFilters: filtersMustBeApplied,
3002
+ applySorts: event.applySorts,
3003
+ filename: event.filename,
3004
+ useIconInBools: event.useIconInBools
3005
+ };
3006
+ if (this.treeState)
3007
+ Object.assign(requestData, { expandedKeys: [...this.treeState.expanded] });
3008
+ this.tableService.fetchExcelReport(this.tableOptions.excelReport.url, requestData).subscribe({
3009
+ next: (response) => {
3010
+ this.tableService.downloadFile(response.body, event.filename, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
3011
+ this.showExportModal = false;
3012
+ },
3013
+ error: (err) => this.tableService.handleTableError(err, 'Excel export error')
3014
+ });
3015
+ }
3016
+ updateIconBlobsForCollections() {
3017
+ var _a;
3018
+ Object.keys((_a = this.tableOptions.predefinedFilters) !== null && _a !== void 0 ? _a : {}).forEach(key => {
3019
+ var _a;
3020
+ const filters = (_a = this.tableOptions.predefinedFilters) === null || _a === void 0 ? void 0 : _a[key];
3021
+ if (Array.isArray(filters) && filters.length > 0) {
3022
+ filters.forEach(filter => {
3023
+ if (filter.imageBlobSourceEndpoint && !filter.imageBlob) {
3024
+ filter.imageBlob = undefined;
3025
+ filter.imageBlobFetchError = false;
3026
+ this.tableService.getIconBlob(filter.imageBlobSourceEndpoint).subscribe({
3027
+ next: (response) => {
3028
+ filter.imageBlob = response.body;
3029
+ this.showExportModal = false;
3030
+ },
3031
+ error: () => {
3032
+ filter.imageBlobFetchError = true;
3033
+ }
3034
+ });
3035
+ }
3036
+ });
3037
+ }
3038
+ else {
3039
+ console.warn(`Filters for key ${key} is not an array:`, filters);
3040
+ }
3041
+ });
3042
+ }
3043
+ ecsTrack1(index, button) { return button; }
3044
+ ecsTrack2(index, button) { return index; }
3045
+ ecsTrack3(index, group) { return group.field; }
3046
+ ecsTrack4(index, col) { return col.header; }
3047
+ ecsTrack5(index, col) { return col.field; }
3048
+ }
3049
+ ECSPrimengTable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTable, deps: [{ token: ECSPrimengTableService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
3050
+ ECSPrimengTable.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ECSPrimengTable, isStandalone: true, selector: "ecs-primeng-table", inputs: { tableOptions: "tableOptions" }, outputs: { onRowCheckboxChange: "onRowCheckboxChange", onRowSelect: "onRowSelect", onRowUnselect: "onRowUnselect", onDataEndUpdate: "onDataEndUpdate" }, host: { listeners: { "document:keydown.escape": "closeResponsiveMenus()", "window:resize": "onResize()" } }, 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 }, { propertyName: "responsiveHeaderMenu", first: true, predicate: ["responsiveHeaderMenu"], descendants: true }, { propertyName: "responsiveRowMenu", first: true, predicate: ["responsiveRowMenu"], descendants: true }], ngImport: i0, template: "<div #tableContainer>\r\n <p-table #dt\r\n styleClass=\"p-datatable-sm p-datatable-gridlines p-datatable-striped\"\r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"scrollHeightValue\"\r\n [columns]=\"tableOptions.columns?.shown ?? []\" [value]=\"tableOptions.data ?? []\" dataKey=\"rowID\" \r\n [paginator]=\"!treeState\" [loading]=\"treeState?.loading ?? false\" paginatorDropdownAppendTo=\"body\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [selectionMode]=\"tableOptions.rows?.singleSelector?.enabled ? 'single' : ''\" [metaKeySelection]=\"tableOptions.rows?.singleSelector?.metakey ?? true\" [(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 <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0\">\r\n <th [ngStyle]=\"{\r\n 'text-align': 'center',\r\n 'vertical-align': 'middle',\r\n 'max-width': actionColumnWidth + 'px',\r\n 'min-width': actionColumnWidth + 'px',\r\n 'width': actionColumnWidth + 'px'\r\n }\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.action?.resizable\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\">\r\n {{ (tableOptions.rows?.action?.header ?? '') | ecsTranslate }}\r\n </th>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0\">\r\n <td \r\n [ngStyle]=\"{\r\n 'text-align': (getDataAlignHorizontalAsText(tableOptions.rows?.action?.horizontalAlignment ?? DataAlignHorizontal.Center)),\r\n 'vertical-align': (getDataAlignVerticalAsText(tableOptions.rows?.action?.verticalAlignment ?? DataAlignVertical.Middle)),\r\n 'max-width': actionColumnWidth + 'px',\r\n 'min-width': actionColumnWidth + 'px',\r\n 'width': actionColumnWidth + 'px'\r\n }\"\r\n pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <ng-container *ngIf=\"compactRows; else ecsElse0\">\r\n <ng-container *ngIf=\"hasRowMenuActions(rowData)\">\r\n <button pButton type=\"button\" icon=\"pi pi-ellipsis-v\" [attr.aria-label]=\"(tableOptions.responsive?.rowMenuLabel || 'Row actions') | ecsTranslate\"\r\n aria-haspopup=\"menu\" [attr.aria-expanded]=\"responsiveRowMenu.visible && rowMenuRow === rowData\"\r\n (click)=\"openRowMenu($event, rowData)\" class=\"ecs-responsive-trigger\"></button>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse0>\r\n <ng-container *ngFor=\"let button of tableOptions.rows?.action?.buttons; trackBy: ecsTrack1; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count; let last = last\">\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\"></ecs-table-button>\r\n </ng-container>\r\n </ng-template>\r\n </td>\r\n </ng-container>\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]=\"{\r\n 'text-align': 'center',\r\n 'vertical-align': 'middle',\r\n 'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'\r\n }\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.checkboxSelector?.resizable\" pFrozenColumn \r\n [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.selectAllEnabled\">\r\n <input type=\"checkbox\" class=\"ecs-select-all\" [checked]=\"allMatchingRowsSelected\"\r\n [indeterminate]=\"matchingRowsPartiallySelected\"\r\n [disabled]=\"selectAllLoading || !tableOptions.rows?.checkboxSelector?.urlSelectAll\"\r\n [attr.aria-label]=\"'Select all filtered rows' | ecsTranslate\"\r\n [pTooltip]=\"'Select all filtered rows' | ecsTranslate\"\r\n (change)=\"toggleAllMatchingRows($any($event.target).checked)\">\r\n </ng-container>\r\n {{ (tableOptions.rows?.checkboxSelector?.header ?? '') | ecsTranslate }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"></p-columnFilter>\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 'text-align': (getDataAlignHorizontalAsText(tableOptions.rows?.checkboxSelector?.horizontalAlignment ?? DataAlignHorizontal.Center)),\r\n 'vertical-align': (getDataAlignVerticalAsText(tableOptions.rows?.checkboxSelector?.verticalAlignment ?? DataAlignVertical.Middle)),\r\n 'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'\r\n }\"\r\n pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [disabled]=\"!(tableOptions.rows?.checkboxSelector?.enabledCondition?.(rowData) ?? true)\"\r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"></p-checkbox>\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 pTemplate=\"caption\">\r\n <div #headerContainer [class.ecs-compact-header]=\"compactHeader\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <ng-container *ngIf=\"compactHeader; else ecsElse1\">\r\n <ng-container *ngIf=\"tableOptions.globalFilter?.enabled\">\r\n <span class=\"ecs-global-search ecs-responsive-search\">\r\n <span class=\"ecs-input-icon\"><i class=\"pi pi-search\"></i></span>\r\n <input pInputText type=\"text\" [attr.aria-label]=\"'Search keyword' | ecsTranslate\" [placeholder]=\"'Search keyword' | ecsTranslate\" autocomplete=\"off\"\r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" [ngModel]=\"globalSearchText\"\r\n (ngModelChange)=\"onGlobalSearchInput($event)\"/>\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\"><button type=\"button\" class=\"ecs-clear-search\" [attr.aria-label]=\"'Clear search' | ecsTranslate\" (click)=\"clearFilters(dt, true, true)\"><i class=\"pi pi-times\"></i></button></span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.description?.text\">\r\n <i [class]=\"tableOptions.description!.icon\" [pTooltip]=\"(tableOptions.description!.text) | ecsTranslate\" [escape]=\"false\"></i>\r\n </ng-container>\r\n <button pButton type=\"button\" icon=\"pi pi-bars\" [attr.aria-label]=\"(tableOptions.responsive?.headerMenuLabel || 'Table actions') | ecsTranslate\"\r\n aria-haspopup=\"menu\" [attr.aria-expanded]=\"responsiveHeaderMenu.visible\"\r\n (click)=\"openHeaderMenu($event)\" class=\"ecs-responsive-trigger ecs-header-menu-trigger\"></button>\r\n </ng-container><ng-template #ecsElse1>\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n <ng-container *ngIf=\"tableOptions.columns?.selectorEnabled\">\r\n <p-button [icon]=\"tableOptions.columns?.selectorIcon ?? 'pi pi-pencil'\" (onClick)=\"columnSelectorShow()\" [pTooltip]=\"'Modify columns' | ecsTranslate\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n <!--CLEAR SORTS AND FILTERS-->\r\n <ng-container *ngIf=\"tableOptions.header?.clearSortsEnabled\">\r\n <p-button [icon]=\"tableOptions.header?.clearSortsIcon ?? 'pi pi-sort-alt-slash'\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n [pTooltip]=\"'Clear sorts' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.header?.clearFiltersEnabled\">\r\n <p-button\r\n [icon]=\"tableOptions.header?.clearFiltersIcon ?? 'pi pi-filter-slash'\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n [pTooltip]=\"'Clear filters' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--TABLE DESCRIPTION-->\r\n <ng-container *ngIf=\"tableOptions.description?.text\"> <!-- If a table description text is provided -->\r\n <ng-container *ngIf=\"!tableOptions.description!.tooltip; else ecsElse2\"> <!-- The table description must be shown as text next to the icon -->\r\n <i [class]=\"tableOptions.description!.icon\"></i>\r\n <span [innerHTML]=\"(tableOptions.description!.text) | ecsTranslate\"></span>\r\n </ng-container><ng-template #ecsElse2>\r\n <i [escape]=\"false\" [pTooltip]=\"(tableOptions.description!.text) | ecsTranslate\" tooltipPosition=\"right\" [class]=\"tableOptions.description!.icon\"></i>\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n <ng-container *ngIf=\"tableViewsEnabled()\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <span class=\"p-buttonset ecs-view-buttons\">\r\n <p-button (click)=\"viewsModalShow=true;\"\r\n [label]=\"tableViewCurrentSelectedAlias \r\n ? tableViewCurrentSelectedAlias \r\n : ((tableOptions.views?.noViewSelectedText || '--- Select a view ---') | ecsTranslate)\"\r\n [class]=\"'viewButton' + (tableOptions.views?.selectViewButtonClass ? ' ' + tableOptions.views!.selectViewButtonClass : '')\"></p-button>\r\n <p-button (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" [pTooltip]=\"'Apply view again' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\"\r\n [icon]=\"tableOptions.views?.reloadViewButtonIcon || 'pi pi-refresh'\"\r\n [class]=\"tableOptions.views?.reloadViewButtonClass || ''\"></p-button>\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n <ng-container *ngIf=\"tableOptions.globalFilter?.enabled\">\r\n <span class=\"ecs-global-search ml-auto\">\r\n <span class=\"ecs-input-icon\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input pInputText type=\"text\" \r\n (ngModelChange)=\"onGlobalSearchInput($event)\" autocomplete=\"off\"\r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" [placeholder]=\"'Search keyword' | ecsTranslate\" [ngModel]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n\r\n <!--EXPORT DATA-->\r\n <ng-container *ngIf=\"tableOptions.excelReport?.url?.trim()\">\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n [pTooltip]=\"'Export to Excel' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--RESET TABLE VIEW-->\r\n <ng-container *ngIf=\"tableOptions.resetTableView?.enabled\">\r\n <p-button [icon]=\"tableOptions.resetTableView?.icon ?? 'pi pi-eraser'\" (click)=\"resetTableView()\" [pTooltip]=\"'Reset table view' | ecsTranslate\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--REFRESH DATA-->\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" [pTooltip]=\"'Refresh data' | ecsTranslate\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n <ng-container *ngIf=\"(tableOptions.header?.buttons?.length ?? 0) > 0\">\r\n <td style=\"display: flex; justify-content: center; align-items: center; gap: 10px;\">\r\n <ng-container *ngFor=\"let button of tableOptions.header?.buttons; trackBy: ecsTrack2; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\"></ecs-table-button>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <ng-container *ngIf=\"getColumnHeaderGroups(columns) as headerGroups\">\r\n <ng-container *ngIf=\"headerGroups.length\">\r\n <tr class=\"ecs-column-groups\">\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0 && !tableOptions.rows?.action?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\" alignFrozen=\"left\"\r\n [style.width.px]=\"actionColumnWidth\" [style.min-width.px]=\"actionColumnWidth\"></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" alignFrozen=\"left\"\r\n [style.width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\" [style.min-width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\"></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let group of headerGroups; trackBy: ecsTrack3; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <td [attr.colspan]=\"group.colspan\" role=\"columnheader\" [attr.aria-colspan]=\"group.colspan\" style=\"text-align: center; vertical-align: middle;\"\r\n pFrozenColumn [frozen]=\"group.frozenColumnAlign !== FrozenColumnAlign.Noone\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(group.frozenColumnAlign)\">\r\n {{ group.label | translate }}\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" alignFrozen=\"right\"\r\n [style.width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\" [style.min-width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\"></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0 && tableOptions.rows?.action?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\" alignFrozen=\"right\"\r\n [style.width.px]=\"actionColumnWidth\" [style.min-width.px]=\"actionColumnWidth\"></td>\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n <tr>\r\n <ng-container *ngIf=\"!tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let col of columns; trackBy: ecsTrack4; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\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 | translate }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n <ng-container *ngIf=\"col.canBeSorted\">\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </ng-container>\r\n <ng-container *ngIf=\"col.canBeFiltered\">\r\n <ng-container *ngIf=\"!col.filterPredefinedValuesName || col.filterPredefinedValuesName.length === 0; else ecsElse3\">\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\" (click)=\"$event.stopPropagation()\"></p-columnFilter>\r\n </ng-container><ng-template #ecsElse3>\r\n <p-columnFilter\r\n [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template pTemplate=\"filter\">\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName]\"\r\n [options]=\"getPredefinedFilterValues(col.filterPredefinedValuesName)\" [placeholder]=\"'Any value' | ecsTranslate\"\r\n (onChange)=\"onPredefinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template pTemplate=\"item\" let-option >\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"false\" [rowData]=\"null\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"col.columnDescription && col.columnDescription.length > 0\">\r\n <i [pTooltip]=\"(col.columnDescription) | ecsTranslate\" tooltipPosition=\"top\" [class]=\"tableOptions.columnDescriptionIcon || 'pi pi-info-circle'\"></i>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <ng-container *ngIf=\"treeState?.isMore(rowData); else ecsElse4\">\r\n <tr class=\"ecs-tree-more-row\">\r\n <td colspan=\"999\">\r\n <p-button icon=\"pi pi-plus\" styleClass=\"p-button-text\" [label]=\"'Load more children' | ecsTranslate\"\r\n (onClick)=\"loadMoreTreeRows($event, rowData)\" ></p-button>\r\n </td>\r\n </tr>\r\n </ng-container><ng-template #ecsElse4>\r\n <tr [pSelectableRow]=\"rowData\" [ngClass]=\"tableOptions.rows?.class?.(rowData)\" [ngStyle]=\"tableOptions.rows?.style?.(rowData)\"\r\n [attr.aria-level]=\"treeState ? treeState.depth(rowData) + 1 : null\"\r\n [attr.aria-expanded]=\"treeState?.hasChildren(rowData) ? treeState?.isExpanded(rowData) : null\">\r\n <ng-container *ngIf=\"!tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let col of columns; trackBy: ecsTrack5; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\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 <ng-container *ngIf=\"treeState && col.field === treeColumn; else ecsElse5\">\r\n <div class=\"ecs-tree-cell\" [style.padding-inline-start.px]=\"treeState.depth(rowData) * 20\">\r\n <button type=\"button\" class=\"ecs-tree-toggle\" [class.ecs-tree-leaf]=\"!treeState.hasChildren(rowData)\"\r\n [disabled]=\"!treeState.hasChildren(rowData) || treeState.isLoading(rowData) || treeState.loading\"\r\n [attr.aria-label]=\"(treeState.isExpanded(rowData) ? 'Collapse node' : 'Expand node') | ecsTranslate\"\r\n [attr.aria-expanded]=\"treeState.hasChildren(rowData) ? treeState.isExpanded(rowData) : null\"\r\n [pTooltip]=\"(treeState.isExpanded(rowData) ? 'Collapse node' : 'Expand node') | ecsTranslate\"\r\n (mousedown)=\"$event.stopPropagation()\" (mouseup)=\"$event.stopPropagation()\"\r\n (click)=\"toggleTreeRow($event, rowData)\">\r\n <i [class]=\"treeState.isLoading(rowData) ? 'pi pi-spinner pi-spin' : treeState.isExpanded(rowData) ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\" aria-hidden=\"true\"></i>\r\n </button>\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"effectiveGlobalSearchText\"\r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\" ></ecs-table-cell>\r\n </div>\r\n </ng-container><ng-template #ecsElse5>\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"effectiveGlobalSearchText\"\r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\"></ecs-table-cell>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'No data found for the current filter criteria.' | ecsTranslate }}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template pTemplate=\"paginatorleft\">\r\n <div #paginatorContainer>\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <ng-container *ngIf=\"tableOptions.legend?.content\">\r\n <ecs-table-button [button]=\"tableOptions.legend?.button\" [rowData]=\"null\" [overrideAction]=\"op.toggle.bind(op)\"></ecs-table-button>\r\n <p-overlayPanel #op>\r\n <div [innerHTML]=\"(tableOptions.legend?.content) | ecsTranslate\"></div>\r\n </p-overlayPanel>\r\n </ng-container>\r\n <span>{{ 'Showing {{count}} records of {{total}} available records' | ecsTranslate: { count: totalRecords, total: totalRecordsNotFiltered } }}</span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n <ng-container *ngIf=\"treeState\">\r\n <div #paginatorContainer class=\"ecs-tree-paginator\">\r\n <ng-container *ngIf=\"tableOptions.legend?.content\">\r\n <ecs-table-button [button]=\"tableOptions.legend?.button\" [rowData]=\"null\" [overrideAction]=\"treeLegend.toggle.bind(treeLegend)\" ></ecs-table-button>\r\n <p-overlayPanel #treeLegend><div [innerHTML]=\"(tableOptions.legend?.content) | ecsTranslate\"></div></p-overlayPanel>\r\n </ng-container>\r\n <span>{{ 'Showing {{count}} root nodes of {{total}} available root nodes' | ecsTranslate: { count: totalRecords, total: totalRecordsNotFiltered } }}</span>\r\n <p-paginator [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" dropdownAppendTo=\"body\" (onPageChange)=\"treePageChange($event)\" ></p-paginator>\r\n </div>\r\n </ng-container>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" [orderByHeader]=\"tableOptions.columns?.selectorOrderByColumnName === true\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"></ecs-column-selector>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"tableOptions.rows?.checkboxSelector?.enabled ?? false\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"tableOptions.excelReport?.titleAllowUserEdit ?? false\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"></ecs-export-excel>\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)\" (onViewUpdateActiveStartup)=\"viewUpdateActiveStartup($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"></ecs-views-management>\r\n<!-- Body-level overlays avoid clipping inside scrollable and frozen table cells. -->\r\n<p-menu #responsiveHeaderMenu [model]=\"headerMenuItems\" [popup]=\"true\" appendTo=\"body\" styleClass=\"ecs-responsive-menu\"></p-menu>\r\n<p-menu #responsiveRowMenu [model]=\"rowMenuItems\" [popup]=\"true\" appendTo=\"body\" styleClass=\"ecs-responsive-menu\"></p-menu>\r\n", styles: [".highlighted-text{background-color:#ff0;color:#000;border-radius:2px}.excel-export-tooltip .bool-icon{text-shadow:0 0 2px white,0 0 3px white}.excel-export-tooltip .bool-true{color:green}.excel-export-tooltip .bool-false{color:red}.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;border-radius:0!important}.ecs-view-buttons{display:inline-flex;align-items:center;flex-wrap:nowrap}.ecs-view-buttons>p-button{display:inline-flex;flex:0 0 auto}.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}.ecs-compact-header{gap:.5rem;min-width:0}.ecs-header-menu-trigger{margin-left:auto;flex:0 0 auto}.ecs-responsive-trigger{min-width:44px;min-height:44px}.ecs-global-search{display:inline-flex;align-items:center;gap:8px;min-width:0}.ecs-global-search>.ecs-input-icon{display:inline-flex;flex:0 0 auto}.ecs-global-search input{min-width:0}.ecs-responsive-search{flex:1 1 220px;min-width:0;max-width:320px}.ecs-responsive-search input{width:100%;padding-right:2.5rem}.ecs-clear-search{border:0;background:transparent;color:inherit;cursor:pointer}.ecs-responsive-menu{max-width:calc(100vw - 16px);max-height:calc(100dvh - 32px);overflow-y:auto}.ecs-responsive-menu .p-menu-item-link{min-height:44px;white-space:normal}.ecs-tree-cell{display:flex;align-items:center;gap:4px;min-width:0}.ecs-tree-cell>ecs-table-cell{flex:1;min-width:0}.ecs-tree-toggle{width:32px;height:32px;flex:0 0 32px;border:0;background:transparent;color:inherit;cursor:pointer}.ecs-tree-toggle:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.ecs-tree-leaf{visibility:hidden}.ecs-tree-paginator{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}.p-datatable-thead>.ecs-column-groups>td{padding:var(--p-datatable-header-cell-padding);background:var(--p-datatable-header-cell-background);color:var(--p-datatable-header-cell-color);font-weight:var(--p-datatable-column-title-font-weight);border:1px solid var(--p-datatable-header-cell-border-color);white-space:normal;overflow-wrap:anywhere}\n"], dependencies: [{ kind: "pipe", type: ECSTableTranslatePipe, name: "ecsTranslate" }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i1$2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { 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: i6$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: i6$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i6$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i6.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "groupRowsByOrder", "responsiveLayout", "breakpoint", "virtualRowHeight", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "selectAll"], outputs: ["selectAllChange", "selectionChange", "contextMenuSelectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i3$2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i6.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i6.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i6.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "directive", type: i6.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i6.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i6.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i6.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"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "style", "styleClass", "badgeClass", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i3$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "fitContent", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i10.InputText, selector: "[pInputText]" }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i11.MultiSelect, selector: "p-multiSelect", inputs: ["style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "label", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i5$1.Checkbox, selector: "p-checkbox", inputs: ["value", "name", "disabled", "binary", "label", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "styleClass", "labelStyleClass", "formControl", "checkboxIcon", "readonly", "required", "trueValue", "falseValue"], outputs: ["onChange"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: i13.Paginator, selector: "p-paginator", inputs: ["pageLinkSize", "style", "styleClass", "alwaysShow", "templateLeft", "templateRight", "dropdownAppendTo", "dropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showFirstLastIcon", "totalRecords", "rows", "rowsPerPageOptions", "showJumpToPageDropdown", "showJumpToPageInput", "showPageLinks", "dropdownItemTemplate", "first"], outputs: ["onPageChange"] }, { kind: "component", type: TableCell, selector: "ecs-table-cell", inputs: ["col", "rowData", "globalSearchText", "predefinedFiltersCollection", "dateFormat", "dateTimezone", "dateCulture"] }, { kind: "component", type: TablePredefinedFilters, selector: "ecs-table-predefined-filters", inputs: ["option", "col", "selectable", "rowData", "globalSearchText"] }, { kind: "component", type: TableButton, selector: "ecs-table-button", inputs: ["button", "rowData", "isActionButton", "isLastActionButton", "overrideAction"] }, { kind: "component", type: ColumnSelector, selector: "ecs-column-selector", inputs: ["orderByHeader", "visible", "columnModalData", "filteredColumnData"], outputs: ["visibleChange", "applyChanges"] }, { kind: "component", type: ExportExcel, selector: "ecs-export-excel", inputs: ["visible", "rowCheckboxSelectorActive", "excelReportTitle", "allowTitleUserEdit"], outputs: ["exportToExcel", "visibleChange"] }, { kind: "component", type: ViewsManagement, selector: "ecs-views-management", inputs: ["visible", "tableViews_menuItems"], outputs: ["onViewSelect", "onViewDelete", "onViewUpdateData", "onViewUpdateActiveStartup", "onViewEditAlias", "onViewCreate", "visibleChange"] }, { kind: "ngmodule", type: OverlayPanelModule }, { kind: "component", type: i14.OverlayPanel, selector: "p-overlayPanel", inputs: ["dismissable", "showCloseIcon", "style", "styleClass", "appendTo", "autoZIndex", "ariaCloseLabel", "baseZIndex", "focusOnShow", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: MenuModule }, { kind: "component", type: i15.Menu, selector: "p-menu", inputs: ["model", "popup", "style", "styleClass", "appendTo", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions"], outputs: ["onShow", "onHide"] }], encapsulation: i0.ViewEncapsulation.None });
3051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ECSPrimengTable, decorators: [{
3052
+ type: Component,
3053
+ args: [{ selector: 'ecs-primeng-table', imports: [
3054
+ ECSTableTranslatePipe,
3055
+ TranslateModule,
3056
+ CommonModule,
3057
+ FormsModule,
3058
+ TableModule,
3059
+ ButtonModule,
3060
+ TooltipModule,
3061
+ InputTextModule,
3062
+ MultiSelectModule,
3063
+ CheckboxModule,
3064
+ PaginatorModule,
3065
+ TableCell,
3066
+ TablePredefinedFilters,
3067
+ TableButton,
3068
+ ColumnSelector,
3069
+ ExportExcel,
3070
+ ViewsManagement,
3071
+ OverlayPanelModule,
3072
+ MenuModule
3073
+ ], standalone: true, encapsulation: ViewEncapsulation.None, template: "<div #tableContainer>\r\n <p-table #dt\r\n styleClass=\"p-datatable-sm p-datatable-gridlines p-datatable-striped\"\r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"scrollHeightValue\"\r\n [columns]=\"tableOptions.columns?.shown ?? []\" [value]=\"tableOptions.data ?? []\" dataKey=\"rowID\" \r\n [paginator]=\"!treeState\" [loading]=\"treeState?.loading ?? false\" paginatorDropdownAppendTo=\"body\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [selectionMode]=\"tableOptions.rows?.singleSelector?.enabled ? 'single' : ''\" [metaKeySelection]=\"tableOptions.rows?.singleSelector?.metakey ?? true\" [(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 <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0\">\r\n <th [ngStyle]=\"{\r\n 'text-align': 'center',\r\n 'vertical-align': 'middle',\r\n 'max-width': actionColumnWidth + 'px',\r\n 'min-width': actionColumnWidth + 'px',\r\n 'width': actionColumnWidth + 'px'\r\n }\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.action?.resizable\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\">\r\n {{ (tableOptions.rows?.action?.header ?? '') | ecsTranslate }}\r\n </th>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0\">\r\n <td \r\n [ngStyle]=\"{\r\n 'text-align': (getDataAlignHorizontalAsText(tableOptions.rows?.action?.horizontalAlignment ?? DataAlignHorizontal.Center)),\r\n 'vertical-align': (getDataAlignVerticalAsText(tableOptions.rows?.action?.verticalAlignment ?? DataAlignVertical.Middle)),\r\n 'max-width': actionColumnWidth + 'px',\r\n 'min-width': actionColumnWidth + 'px',\r\n 'width': actionColumnWidth + 'px'\r\n }\"\r\n pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <ng-container *ngIf=\"compactRows; else ecsElse0\">\r\n <ng-container *ngIf=\"hasRowMenuActions(rowData)\">\r\n <button pButton type=\"button\" icon=\"pi pi-ellipsis-v\" [attr.aria-label]=\"(tableOptions.responsive?.rowMenuLabel || 'Row actions') | ecsTranslate\"\r\n aria-haspopup=\"menu\" [attr.aria-expanded]=\"responsiveRowMenu.visible && rowMenuRow === rowData\"\r\n (click)=\"openRowMenu($event, rowData)\" class=\"ecs-responsive-trigger\"></button>\r\n </ng-container>\r\n </ng-container><ng-template #ecsElse0>\r\n <ng-container *ngFor=\"let button of tableOptions.rows?.action?.buttons; trackBy: ecsTrack1; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count; let last = last\">\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\"></ecs-table-button>\r\n </ng-container>\r\n </ng-template>\r\n </td>\r\n </ng-container>\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]=\"{\r\n 'text-align': 'center',\r\n 'vertical-align': 'middle',\r\n 'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'\r\n }\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.checkboxSelector?.resizable\" pFrozenColumn \r\n [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.selectAllEnabled\">\r\n <input type=\"checkbox\" class=\"ecs-select-all\" [checked]=\"allMatchingRowsSelected\"\r\n [indeterminate]=\"matchingRowsPartiallySelected\"\r\n [disabled]=\"selectAllLoading || !tableOptions.rows?.checkboxSelector?.urlSelectAll\"\r\n [attr.aria-label]=\"'Select all filtered rows' | ecsTranslate\"\r\n [pTooltip]=\"'Select all filtered rows' | ecsTranslate\"\r\n (change)=\"toggleAllMatchingRows($any($event.target).checked)\">\r\n </ng-container>\r\n {{ (tableOptions.rows?.checkboxSelector?.header ?? '') | ecsTranslate }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"></p-columnFilter>\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 'text-align': (getDataAlignHorizontalAsText(tableOptions.rows?.checkboxSelector?.horizontalAlignment ?? DataAlignHorizontal.Center)),\r\n 'vertical-align': (getDataAlignVerticalAsText(tableOptions.rows?.checkboxSelector?.verticalAlignment ?? DataAlignVertical.Middle)),\r\n 'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px',\r\n 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'\r\n }\"\r\n pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.positionRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [disabled]=\"!(tableOptions.rows?.checkboxSelector?.enabledCondition?.(rowData) ?? true)\"\r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"></p-checkbox>\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 pTemplate=\"caption\">\r\n <div #headerContainer [class.ecs-compact-header]=\"compactHeader\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <ng-container *ngIf=\"compactHeader; else ecsElse1\">\r\n <ng-container *ngIf=\"tableOptions.globalFilter?.enabled\">\r\n <span class=\"ecs-global-search ecs-responsive-search\">\r\n <span class=\"ecs-input-icon\"><i class=\"pi pi-search\"></i></span>\r\n <input pInputText type=\"text\" [attr.aria-label]=\"'Search keyword' | ecsTranslate\" [placeholder]=\"'Search keyword' | ecsTranslate\" autocomplete=\"off\"\r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" [ngModel]=\"globalSearchText\"\r\n (ngModelChange)=\"onGlobalSearchInput($event)\"/>\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\"><button type=\"button\" class=\"ecs-clear-search\" [attr.aria-label]=\"'Clear search' | ecsTranslate\" (click)=\"clearFilters(dt, true, true)\"><i class=\"pi pi-times\"></i></button></span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.description?.text\">\r\n <i [class]=\"tableOptions.description!.icon\" [pTooltip]=\"(tableOptions.description!.text) | ecsTranslate\" [escape]=\"false\"></i>\r\n </ng-container>\r\n <button pButton type=\"button\" icon=\"pi pi-bars\" [attr.aria-label]=\"(tableOptions.responsive?.headerMenuLabel || 'Table actions') | ecsTranslate\"\r\n aria-haspopup=\"menu\" [attr.aria-expanded]=\"responsiveHeaderMenu.visible\"\r\n (click)=\"openHeaderMenu($event)\" class=\"ecs-responsive-trigger ecs-header-menu-trigger\"></button>\r\n </ng-container><ng-template #ecsElse1>\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n <ng-container *ngIf=\"tableOptions.columns?.selectorEnabled\">\r\n <p-button [icon]=\"tableOptions.columns?.selectorIcon ?? 'pi pi-pencil'\" (onClick)=\"columnSelectorShow()\" [pTooltip]=\"'Modify columns' | ecsTranslate\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n <!--CLEAR SORTS AND FILTERS-->\r\n <ng-container *ngIf=\"tableOptions.header?.clearSortsEnabled\">\r\n <p-button [icon]=\"tableOptions.header?.clearSortsIcon ?? 'pi pi-sort-alt-slash'\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n [pTooltip]=\"'Clear sorts' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.header?.clearFiltersEnabled\">\r\n <p-button\r\n [icon]=\"tableOptions.header?.clearFiltersIcon ?? 'pi pi-filter-slash'\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n [pTooltip]=\"'Clear filters' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--TABLE DESCRIPTION-->\r\n <ng-container *ngIf=\"tableOptions.description?.text\"> <!-- If a table description text is provided -->\r\n <ng-container *ngIf=\"!tableOptions.description!.tooltip; else ecsElse2\"> <!-- The table description must be shown as text next to the icon -->\r\n <i [class]=\"tableOptions.description!.icon\"></i>\r\n <span [innerHTML]=\"(tableOptions.description!.text) | ecsTranslate\"></span>\r\n </ng-container><ng-template #ecsElse2>\r\n <i [escape]=\"false\" [pTooltip]=\"(tableOptions.description!.text) | ecsTranslate\" tooltipPosition=\"right\" [class]=\"tableOptions.description!.icon\"></i>\r\n </ng-template>\r\n </ng-container>\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n <ng-container *ngIf=\"tableViewsEnabled()\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <span class=\"p-buttonset ecs-view-buttons\">\r\n <p-button (click)=\"viewsModalShow=true;\"\r\n [label]=\"tableViewCurrentSelectedAlias \r\n ? tableViewCurrentSelectedAlias \r\n : ((tableOptions.views?.noViewSelectedText || '--- Select a view ---') | ecsTranslate)\"\r\n [class]=\"'viewButton' + (tableOptions.views?.selectViewButtonClass ? ' ' + tableOptions.views!.selectViewButtonClass : '')\"></p-button>\r\n <p-button (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" [pTooltip]=\"'Apply view again' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\"\r\n [icon]=\"tableOptions.views?.reloadViewButtonIcon || 'pi pi-refresh'\"\r\n [class]=\"tableOptions.views?.reloadViewButtonClass || ''\"></p-button>\r\n </span>\r\n </div>\r\n </ng-container>\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n <ng-container *ngIf=\"tableOptions.globalFilter?.enabled\">\r\n <span class=\"ecs-global-search ml-auto\">\r\n <span class=\"ecs-input-icon\">\r\n <i class=\"pi pi-search\"></i>\r\n </span>\r\n <input pInputText type=\"text\" \r\n (ngModelChange)=\"onGlobalSearchInput($event)\" autocomplete=\"off\"\r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" [placeholder]=\"'Search keyword' | ecsTranslate\" [ngModel]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n <ng-container *ngIf=\"globalSearchText\">\r\n <span class=\"ecs-input-icon\" position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </span>\r\n </ng-container>\r\n </span>\r\n </ng-container>\r\n\r\n <!--EXPORT DATA-->\r\n <ng-container *ngIf=\"tableOptions.excelReport?.url?.trim()\">\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n [pTooltip]=\"'Export to Excel' | ecsTranslate\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--RESET TABLE VIEW-->\r\n <ng-container *ngIf=\"tableOptions.resetTableView?.enabled\">\r\n <p-button [icon]=\"tableOptions.resetTableView?.icon ?? 'pi pi-eraser'\" (click)=\"resetTableView()\" [pTooltip]=\"'Reset table view' | ecsTranslate\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n </ng-container>\r\n\r\n <!--REFRESH DATA-->\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" [pTooltip]=\"'Refresh data' | ecsTranslate\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"></p-button>\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n <ng-container *ngIf=\"(tableOptions.header?.buttons?.length ?? 0) > 0\">\r\n <td style=\"display: flex; justify-content: center; align-items: center; gap: 10px;\">\r\n <ng-container *ngFor=\"let button of tableOptions.header?.buttons; trackBy: ecsTrack2; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\"></ecs-table-button>\r\n </ng-container>\r\n </td>\r\n </ng-container>\r\n </div>\r\n </ng-template>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template pTemplate=\"header\" let-columns>\r\n <ng-container *ngIf=\"getColumnHeaderGroups(columns) as headerGroups\">\r\n <ng-container *ngIf=\"headerGroups.length\">\r\n <tr class=\"ecs-column-groups\">\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0 && !tableOptions.rows?.action?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\" alignFrozen=\"left\"\r\n [style.width.px]=\"actionColumnWidth\" [style.min-width.px]=\"actionColumnWidth\"></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" alignFrozen=\"left\"\r\n [style.width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\" [style.min-width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\"></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let group of headerGroups; trackBy: ecsTrack3; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\r\n <td [attr.colspan]=\"group.colspan\" role=\"columnheader\" [attr.aria-colspan]=\"group.colspan\" style=\"text-align: center; vertical-align: middle;\"\r\n pFrozenColumn [frozen]=\"group.frozenColumnAlign !== FrozenColumnAlign.Noone\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(group.frozenColumnAlign)\">\r\n {{ group.label | translate }}\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" alignFrozen=\"right\"\r\n [style.width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\" [style.min-width.px]=\"tableOptions.rows?.checkboxSelector?.width ?? 150\"></td>\r\n </ng-container>\r\n <ng-container *ngIf=\"(tableOptions.rows?.action?.buttons?.length ?? 0) > 0 && tableOptions.rows?.action?.positionRight\">\r\n <td aria-hidden=\"true\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\" alignFrozen=\"right\"\r\n [style.width.px]=\"actionColumnWidth\" [style.min-width.px]=\"actionColumnWidth\"></td>\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n <tr>\r\n <ng-container *ngIf=\"!tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let col of columns; trackBy: ecsTrack4; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\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 | translate }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n <ng-container *ngIf=\"col.canBeSorted\">\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n </ng-container>\r\n <ng-container *ngIf=\"col.canBeFiltered\">\r\n <ng-container *ngIf=\"!col.filterPredefinedValuesName || col.filterPredefinedValuesName.length === 0; else ecsElse3\">\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\" (click)=\"$event.stopPropagation()\"></p-columnFilter>\r\n </ng-container><ng-template #ecsElse3>\r\n <p-columnFilter\r\n [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\"\r\n (click)=\"$event.stopPropagation()\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template pTemplate=\"filter\">\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName]\"\r\n [options]=\"getPredefinedFilterValues(col.filterPredefinedValuesName)\" [placeholder]=\"'Any value' | ecsTranslate\"\r\n (onChange)=\"onPredefinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template pTemplate=\"item\" let-option >\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"false\" [rowData]=\"null\"></ecs-table-predefined-filters>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n </ng-template>\r\n </ng-container>\r\n <ng-container *ngIf=\"col.columnDescription && col.columnDescription.length > 0\">\r\n <i [pTooltip]=\"(col.columnDescription) | ecsTranslate\" tooltipPosition=\"top\" [class]=\"tableOptions.columnDescriptionIcon || 'pi pi-info-circle'\"></i>\r\n </ng-container>\r\n </div>\r\n </div>\r\n </th>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n </ng-container>\r\n </tr>\r\n </ng-container>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\">\r\n <ng-container *ngIf=\"treeState?.isMore(rowData); else ecsElse4\">\r\n <tr class=\"ecs-tree-more-row\">\r\n <td colspan=\"999\">\r\n <p-button icon=\"pi pi-plus\" styleClass=\"p-button-text\" [label]=\"'Load more children' | ecsTranslate\"\r\n (onClick)=\"loadMoreTreeRows($event, rowData)\" ></p-button>\r\n </td>\r\n </tr>\r\n </ng-container><ng-template #ecsElse4>\r\n <tr [pSelectableRow]=\"rowData\" [ngClass]=\"tableOptions.rows?.class?.(rowData)\" [ngStyle]=\"tableOptions.rows?.style?.(rowData)\"\r\n [attr.aria-level]=\"treeState ? treeState.depth(rowData) + 1 : null\"\r\n [attr.aria-expanded]=\"treeState?.hasChildren(rowData) ? treeState?.isExpanded(rowData) : null\">\r\n <ng-container *ngIf=\"!tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngFor=\"let col of columns; trackBy: ecsTrack5; let $index = index; let $first = first; let $last = last; let $even = even; let $odd = odd; let $count = count\">\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 <ng-container *ngIf=\"treeState && col.field === treeColumn; else ecsElse5\">\r\n <div class=\"ecs-tree-cell\" [style.padding-inline-start.px]=\"treeState.depth(rowData) * 20\">\r\n <button type=\"button\" class=\"ecs-tree-toggle\" [class.ecs-tree-leaf]=\"!treeState.hasChildren(rowData)\"\r\n [disabled]=\"!treeState.hasChildren(rowData) || treeState.isLoading(rowData) || treeState.loading\"\r\n [attr.aria-label]=\"(treeState.isExpanded(rowData) ? 'Collapse node' : 'Expand node') | ecsTranslate\"\r\n [attr.aria-expanded]=\"treeState.hasChildren(rowData) ? treeState.isExpanded(rowData) : null\"\r\n [pTooltip]=\"(treeState.isExpanded(rowData) ? 'Collapse node' : 'Expand node') | ecsTranslate\"\r\n (mousedown)=\"$event.stopPropagation()\" (mouseup)=\"$event.stopPropagation()\"\r\n (click)=\"toggleTreeRow($event, rowData)\">\r\n <i [class]=\"treeState.isLoading(rowData) ? 'pi pi-spinner pi-spin' : treeState.isExpanded(rowData) ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\" aria-hidden=\"true\"></i>\r\n </button>\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"effectiveGlobalSearchText\"\r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\" ></ecs-table-cell>\r\n </div>\r\n </ng-container><ng-template #ecsElse5>\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"effectiveGlobalSearchText\"\r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\"></ecs-table-cell>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.positionRight\">\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n <ng-container *ngIf=\"tableOptions.rows?.action?.positionRight\">\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n </ng-container>\r\n </tr>\r\n </ng-template>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template pTemplate=\"emptymessage\">\r\n <tr>\r\n <td colspan=\"999\">{{ 'No data found for the current filter criteria.' | ecsTranslate }}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template pTemplate=\"paginatorleft\">\r\n <div #paginatorContainer>\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <ng-container *ngIf=\"tableOptions.legend?.content\">\r\n <ecs-table-button [button]=\"tableOptions.legend?.button\" [rowData]=\"null\" [overrideAction]=\"op.toggle.bind(op)\"></ecs-table-button>\r\n <p-overlayPanel #op>\r\n <div [innerHTML]=\"(tableOptions.legend?.content) | ecsTranslate\"></div>\r\n </p-overlayPanel>\r\n </ng-container>\r\n <span>{{ 'Showing {{count}} records of {{total}} available records' | ecsTranslate: { count: totalRecords, total: totalRecordsNotFiltered } }}</span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n <ng-container *ngIf=\"treeState\">\r\n <div #paginatorContainer class=\"ecs-tree-paginator\">\r\n <ng-container *ngIf=\"tableOptions.legend?.content\">\r\n <ecs-table-button [button]=\"tableOptions.legend?.button\" [rowData]=\"null\" [overrideAction]=\"treeLegend.toggle.bind(treeLegend)\" ></ecs-table-button>\r\n <p-overlayPanel #treeLegend><div [innerHTML]=\"(tableOptions.legend?.content) | ecsTranslate\"></div></p-overlayPanel>\r\n </ng-container>\r\n <span>{{ 'Showing {{count}} root nodes of {{total}} available root nodes' | ecsTranslate: { count: totalRecords, total: totalRecordsNotFiltered } }}</span>\r\n <p-paginator [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" dropdownAppendTo=\"body\" (onPageChange)=\"treePageChange($event)\" ></p-paginator>\r\n </div>\r\n </ng-container>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" [orderByHeader]=\"tableOptions.columns?.selectorOrderByColumnName === true\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"></ecs-column-selector>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"tableOptions.rows?.checkboxSelector?.enabled ?? false\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"tableOptions.excelReport?.titleAllowUserEdit ?? false\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"></ecs-export-excel>\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)\" (onViewUpdateActiveStartup)=\"viewUpdateActiveStartup($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"></ecs-views-management>\r\n<!-- Body-level overlays avoid clipping inside scrollable and frozen table cells. -->\r\n<p-menu #responsiveHeaderMenu [model]=\"headerMenuItems\" [popup]=\"true\" appendTo=\"body\" styleClass=\"ecs-responsive-menu\"></p-menu>\r\n<p-menu #responsiveRowMenu [model]=\"rowMenuItems\" [popup]=\"true\" appendTo=\"body\" styleClass=\"ecs-responsive-menu\"></p-menu>\r\n", styles: [".highlighted-text{background-color:#ff0;color:#000;border-radius:2px}.excel-export-tooltip .bool-icon{text-shadow:0 0 2px white,0 0 3px white}.excel-export-tooltip .bool-true{color:green}.excel-export-tooltip .bool-false{color:red}.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;border-radius:0!important}.ecs-view-buttons{display:inline-flex;align-items:center;flex-wrap:nowrap}.ecs-view-buttons>p-button{display:inline-flex;flex:0 0 auto}.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}.ecs-compact-header{gap:.5rem;min-width:0}.ecs-header-menu-trigger{margin-left:auto;flex:0 0 auto}.ecs-responsive-trigger{min-width:44px;min-height:44px}.ecs-global-search{display:inline-flex;align-items:center;gap:8px;min-width:0}.ecs-global-search>.ecs-input-icon{display:inline-flex;flex:0 0 auto}.ecs-global-search input{min-width:0}.ecs-responsive-search{flex:1 1 220px;min-width:0;max-width:320px}.ecs-responsive-search input{width:100%;padding-right:2.5rem}.ecs-clear-search{border:0;background:transparent;color:inherit;cursor:pointer}.ecs-responsive-menu{max-width:calc(100vw - 16px);max-height:calc(100dvh - 32px);overflow-y:auto}.ecs-responsive-menu .p-menu-item-link{min-height:44px;white-space:normal}.ecs-tree-cell{display:flex;align-items:center;gap:4px;min-width:0}.ecs-tree-cell>ecs-table-cell{flex:1;min-width:0}.ecs-tree-toggle{width:32px;height:32px;flex:0 0 32px;border:0;background:transparent;color:inherit;cursor:pointer}.ecs-tree-toggle:focus-visible{outline:2px solid var(--p-primary-color);outline-offset:1px}.ecs-tree-leaf{visibility:hidden}.ecs-tree-paginator{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}.p-datatable-thead>.ecs-column-groups>td{padding:var(--p-datatable-header-cell-padding);background:var(--p-datatable-header-cell-background);color:var(--p-datatable-header-cell-color);font-weight:var(--p-datatable-column-title-font-weight);border:1px solid var(--p-datatable-header-cell-border-color);white-space:normal;overflow-wrap:anywhere}\n"] }]
3074
+ }], ctorParameters: function () { return [{ type: ECSPrimengTableService }, { type: ECSPrimengTableNotificationService }]; }, propDecorators: { tableOptions: [{
3075
+ type: Input
3076
+ }], onRowCheckboxChange: [{
3077
+ type: Output
3078
+ }], onRowSelect: [{
3079
+ type: Output
3080
+ }], onRowUnselect: [{
3081
+ type: Output
3082
+ }], onDataEndUpdate: [{
3083
+ type: Output
3084
+ }], dt: [{
3085
+ type: ViewChild,
3086
+ args: ['dt']
3087
+ }], tableContainer: [{
3088
+ type: ViewChild,
3089
+ args: ['tableContainer', { static: false }]
3090
+ }], headerContainer: [{
3091
+ type: ViewChild,
3092
+ args: ['headerContainer', { static: false }]
3093
+ }], paginatorContainer: [{
3094
+ type: ViewChild,
3095
+ args: ['paginatorContainer', { static: false }]
3096
+ }], responsiveHeaderMenu: [{
3097
+ type: ViewChild,
3098
+ args: ['responsiveHeaderMenu']
3099
+ }], responsiveRowMenu: [{
3100
+ type: ViewChild,
3101
+ args: ['responsiveRowMenu']
3102
+ }], closeResponsiveMenus: [{
3103
+ type: HostListener,
3104
+ args: ['document:keydown.escape']
3105
+ }], onResize: [{
3106
+ type: HostListener,
3107
+ args: ['window:resize']
3108
+ }] } });
3109
+
3110
+ /*
3111
+ * Public API Surface of ecs-primeng-table
3112
+ */
3113
+
3114
+ /**
3115
+ * Generated bundle index. Do not edit.
3116
+ */
3117
+
3118
+ export { CellDisplay, CellOverflowBehaviour, DEFAULT_TABLE_OPTIONS, DataAlignHorizontal, DataAlignVertical, DataType, DeviceType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableI18nService, ECSPrimengTableNotificationService, ECSPrimengTableService, ECSPrimengTableStateService, FrozenColumnAlign, TableViewSaveMode, TreeTableState, createTableOptions };
3119
+ //# sourceMappingURL=competer-primeng-table.mjs.map