@eternalcodestudio/primeng-table 19.0.0 → 19.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/fesm2022/eternalcodestudio-primeng-table.mjs +651 -420
- package/fesm2022/eternalcodestudio-primeng-table.mjs.map +1 -1
- package/lib/components/column-selector/column-selector.d.ts +3 -0
- package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +24 -60
- package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +3 -1
- package/lib/components/table-button/table-button.d.ts +1 -4
- package/lib/components/table-cell/table-cell.d.ts +7 -5
- package/lib/components/{table-predifined-filters/table-predifined-filters.d.ts → table-predefined-filters/table-predefined-filters.d.ts} +10 -5
- package/lib/components/views-management/views-management.d.ts +4 -3
- package/lib/enums/cell-overflow-behaviour.enum.d.ts +11 -1
- package/lib/enums/data-align-horizontal.enum.d.ts +9 -0
- package/lib/enums/data-align-vertical.enum.d.ts +9 -0
- package/lib/enums/data-type.enum.enum.d.ts +14 -1
- package/lib/enums/frozen-column-align.enum.d.ts +10 -0
- package/lib/enums/table-view-save-mode.enum.d.ts +15 -4
- package/lib/interfaces/columns-metadata.interface.d.ts +1 -1
- package/lib/interfaces/index.d.ts +2 -1
- package/lib/interfaces/predefined-filter.interface.d.ts +80 -0
- package/lib/interfaces/table-button.interface.d.ts +49 -12
- package/lib/interfaces/table-configuration.interface.d.ts +1 -0
- package/lib/interfaces/table-options.interface.d.ts +433 -0
- package/lib/interfaces/table-paged-response.interface.d.ts +0 -7
- package/lib/interfaces/table-query-request.interface.d.ts +0 -9
- package/lib/services/http.service.d.ts +27 -2
- package/lib/services/notification.service.d.ts +17 -1
- package/lib/utils/create-table-options.d.ts +5 -0
- package/lib/utils/index.d.ts +1 -0
- package/package.json +5 -4
- package/public-api.d.ts +1 -0
- package/fesm2022/ecs-primeng-table.mjs +0 -1745
- package/fesm2022/ecs-primeng-table.mjs.map +0 -1
- package/lib/interfaces/predifined-filter.interface.d.ts +0 -34
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, Component,
|
|
2
|
+
import { Injectable, Input, Component, EventEmitter, Output, ViewChild, HostListener, ViewEncapsulation } from '@angular/core';
|
|
3
3
|
import * as i1$1 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i8$1 from '@angular/forms';
|
|
@@ -14,11 +14,11 @@ import * as i11 from 'primeng/inputtext';
|
|
|
14
14
|
import { InputTextModule } from 'primeng/inputtext';
|
|
15
15
|
import * as i10 from 'primeng/iconfield';
|
|
16
16
|
import { IconFieldModule } from 'primeng/iconfield';
|
|
17
|
-
import * as i9 from 'primeng/inputicon';
|
|
17
|
+
import * as i9$1 from 'primeng/inputicon';
|
|
18
18
|
import { InputIconModule } from 'primeng/inputicon';
|
|
19
19
|
import * as i12 from 'primeng/multiselect';
|
|
20
20
|
import { MultiSelectModule } from 'primeng/multiselect';
|
|
21
|
-
import * as
|
|
21
|
+
import * as i9 from 'primeng/checkbox';
|
|
22
22
|
import { CheckboxModule } from 'primeng/checkbox';
|
|
23
23
|
import { PaginatorModule } from 'primeng/paginator';
|
|
24
24
|
import * as i14 from 'primeng/buttongroup';
|
|
@@ -35,52 +35,215 @@ import { DialogModule } from 'primeng/dialog';
|
|
|
35
35
|
import * as i6 from 'primeng/selectbutton';
|
|
36
36
|
import { SelectButtonModule, SelectButton } from 'primeng/selectbutton';
|
|
37
37
|
import * as i2 from 'primeng/api';
|
|
38
|
-
import { Observable } from 'rxjs';
|
|
38
|
+
import { Observable, finalize } from 'rxjs';
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Enum representing how content that overflows a table cell should be handled.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Determines the visual behavior of cell content when it exceeds the cell's width.
|
|
45
|
+
*/
|
|
40
46
|
var CellOverflowBehaviour;
|
|
41
47
|
(function (CellOverflowBehaviour) {
|
|
48
|
+
/** Content that exceeds the cell's width is clipped and not visible. */
|
|
42
49
|
CellOverflowBehaviour[CellOverflowBehaviour["Hidden"] = 0] = "Hidden";
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
/** Content wraps onto multiple lines to fit within the cell. */
|
|
51
|
+
CellOverflowBehaviour[CellOverflowBehaviour["Wrap"] = 1] = "Wrap";
|
|
52
|
+
/** Content is truncated and an ellipsis (...) is shown at the end. */
|
|
53
|
+
CellOverflowBehaviour[CellOverflowBehaviour["Ellipsis"] = 2] = "Ellipsis";
|
|
45
54
|
})(CellOverflowBehaviour || (CellOverflowBehaviour = {}));
|
|
46
55
|
|
|
56
|
+
/**
|
|
57
|
+
* Enum representing the horizontal alignment of content within a table cell.
|
|
58
|
+
*
|
|
59
|
+
* @remarks
|
|
60
|
+
* Determines how the content inside a cell is positioned horizontally relative to the cell's width.
|
|
61
|
+
*/
|
|
47
62
|
var DataAlignHorizontal;
|
|
48
63
|
(function (DataAlignHorizontal) {
|
|
64
|
+
/** Align content to the left of the cell. */
|
|
49
65
|
DataAlignHorizontal[DataAlignHorizontal["Left"] = 0] = "Left";
|
|
66
|
+
/** Align content to the center of the cell. */
|
|
50
67
|
DataAlignHorizontal[DataAlignHorizontal["Center"] = 1] = "Center";
|
|
68
|
+
/** Align content to the right of the cell. */
|
|
51
69
|
DataAlignHorizontal[DataAlignHorizontal["Right"] = 2] = "Right";
|
|
52
70
|
})(DataAlignHorizontal || (DataAlignHorizontal = {}));
|
|
53
71
|
|
|
72
|
+
/**
|
|
73
|
+
* Enum representing the vertical alignment of content within a table cell.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* Determines how the content inside a cell is positioned vertically relative to the cell's height.
|
|
77
|
+
*/
|
|
54
78
|
var DataAlignVertical;
|
|
55
79
|
(function (DataAlignVertical) {
|
|
80
|
+
/** Align content to the top of the cell. */
|
|
56
81
|
DataAlignVertical[DataAlignVertical["Top"] = 0] = "Top";
|
|
82
|
+
/** Align content to the vertical middle of the cell. */
|
|
57
83
|
DataAlignVertical[DataAlignVertical["Middle"] = 1] = "Middle";
|
|
84
|
+
/** Align content to the bottom of the cell. */
|
|
58
85
|
DataAlignVertical[DataAlignVertical["Bottom"] = 2] = "Bottom";
|
|
59
86
|
})(DataAlignVertical || (DataAlignVertical = {}));
|
|
60
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Enum representing the different types of data a table column can hold.
|
|
90
|
+
*
|
|
91
|
+
* @remarks
|
|
92
|
+
* This is used to determine how values should be rendered, formatted, and
|
|
93
|
+
* filtered in the table component.
|
|
94
|
+
*/
|
|
61
95
|
var DataType;
|
|
62
96
|
(function (DataType) {
|
|
97
|
+
/** Plain text string values. */
|
|
63
98
|
DataType[DataType["Text"] = 0] = "Text";
|
|
99
|
+
/** Numeric values, e.g., integers or decimals. */
|
|
64
100
|
DataType[DataType["Numeric"] = 1] = "Numeric";
|
|
101
|
+
/** Boolean values (true/false). */
|
|
65
102
|
DataType[DataType["Boolean"] = 2] = "Boolean";
|
|
103
|
+
/** Date or datetime values. */
|
|
66
104
|
DataType[DataType["Date"] = 3] = "Date";
|
|
105
|
+
/** List of values, stored as a string separated by a delimiter (";"). */
|
|
106
|
+
DataType[DataType["List"] = 4] = "List";
|
|
67
107
|
})(DataType || (DataType = {}));
|
|
68
108
|
|
|
109
|
+
/**
|
|
110
|
+
* Enum representing the alignment of frozen columns in a table.
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* Used to determine if a column should be frozen, and if so, on which side
|
|
114
|
+
* of the table it should appear.
|
|
115
|
+
*/
|
|
69
116
|
var FrozenColumnAlign;
|
|
70
117
|
(function (FrozenColumnAlign) {
|
|
118
|
+
/** The column is not frozen. */
|
|
71
119
|
FrozenColumnAlign[FrozenColumnAlign["Noone"] = 0] = "Noone";
|
|
120
|
+
/** The column is frozen on the left side of the table. */
|
|
72
121
|
FrozenColumnAlign[FrozenColumnAlign["Left"] = 1] = "Left";
|
|
122
|
+
/** The column is frozen on the right side of the table. */
|
|
73
123
|
FrozenColumnAlign[FrozenColumnAlign["Right"] = 2] = "Right";
|
|
74
124
|
})(FrozenColumnAlign || (FrozenColumnAlign = {}));
|
|
75
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Enum representing the mode used to save the state or configuration of a table view.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* Determines where and how the table's view settings (e.g., column order, filters,
|
|
131
|
+
* sorting) are persisted.
|
|
132
|
+
*/
|
|
76
133
|
var TableViewSaveMode;
|
|
77
134
|
(function (TableViewSaveMode) {
|
|
78
|
-
|
|
79
|
-
TableViewSaveMode[TableViewSaveMode["
|
|
80
|
-
|
|
81
|
-
TableViewSaveMode[TableViewSaveMode["
|
|
135
|
+
/** Do not save the table view state. */
|
|
136
|
+
TableViewSaveMode[TableViewSaveMode["None"] = 0] = "None";
|
|
137
|
+
/** Save the table view state in the browser's sessionStorage (cleared on tab close). */
|
|
138
|
+
TableViewSaveMode[TableViewSaveMode["SessionStorage"] = 1] = "SessionStorage";
|
|
139
|
+
/** Save the table view state in the browser's localStorage (persists across sessions). */
|
|
140
|
+
TableViewSaveMode[TableViewSaveMode["LocalStorage"] = 2] = "LocalStorage";
|
|
141
|
+
/** Save the table view state in a backend database (requires server support). */
|
|
142
|
+
TableViewSaveMode[TableViewSaveMode["DatabaseStorage"] = 3] = "DatabaseStorage";
|
|
82
143
|
})(TableViewSaveMode || (TableViewSaveMode = {}));
|
|
83
144
|
|
|
145
|
+
const DEFAULT_TABLE_OPTIONS = {
|
|
146
|
+
isActive: true,
|
|
147
|
+
data: [],
|
|
148
|
+
urlTableConfiguration: undefined,
|
|
149
|
+
urlTableData: undefined,
|
|
150
|
+
header: {
|
|
151
|
+
buttons: [],
|
|
152
|
+
clearSortsEnabled: true,
|
|
153
|
+
clearSortsIcon: "pi pi-sort-alt-slash",
|
|
154
|
+
clearFiltersEnabled: true,
|
|
155
|
+
clearFiltersIcon: "pi pi-filter-slash"
|
|
156
|
+
},
|
|
157
|
+
columns: {
|
|
158
|
+
selectorEnabled: true,
|
|
159
|
+
selectorIcon: "pi pi-pen-to-square",
|
|
160
|
+
shown: []
|
|
161
|
+
},
|
|
162
|
+
rows: {
|
|
163
|
+
style: () => ({}),
|
|
164
|
+
class: () => ({}),
|
|
165
|
+
action: {
|
|
166
|
+
buttons: [],
|
|
167
|
+
header: "Actions",
|
|
168
|
+
alignmentRight: true,
|
|
169
|
+
width: 150,
|
|
170
|
+
frozen: true,
|
|
171
|
+
resizable: false
|
|
172
|
+
},
|
|
173
|
+
checkboxSelector: {
|
|
174
|
+
enabled: false,
|
|
175
|
+
header: "Selected",
|
|
176
|
+
alignmentRight: false,
|
|
177
|
+
width: 150,
|
|
178
|
+
frozen: true,
|
|
179
|
+
resizable: false,
|
|
180
|
+
enabledCondition: undefined
|
|
181
|
+
},
|
|
182
|
+
singleSelector: {
|
|
183
|
+
enabled: false,
|
|
184
|
+
metakey: true
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
verticalScroll: {
|
|
188
|
+
fitToContainer: true,
|
|
189
|
+
height: 0,
|
|
190
|
+
cssFormula: undefined
|
|
191
|
+
},
|
|
192
|
+
globalFilter: {
|
|
193
|
+
enabled: true,
|
|
194
|
+
maxLength: 20
|
|
195
|
+
},
|
|
196
|
+
predefinedFilters: {},
|
|
197
|
+
views: {
|
|
198
|
+
saveMode: TableViewSaveMode.None,
|
|
199
|
+
saveKey: undefined,
|
|
200
|
+
urlGet: undefined,
|
|
201
|
+
urlSave: undefined
|
|
202
|
+
},
|
|
203
|
+
excelReport: {
|
|
204
|
+
url: undefined,
|
|
205
|
+
defaultTitle: "Report",
|
|
206
|
+
titleAllowUserEdit: true
|
|
207
|
+
},
|
|
208
|
+
copyToClipboardTime: 0.5
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Deep merge two objects.
|
|
213
|
+
* Recursively copies properties from `source` into `target`,
|
|
214
|
+
* but ignores `undefined` values to preserve defaults.
|
|
215
|
+
*/
|
|
216
|
+
function deepMerge(target, source) {
|
|
217
|
+
for (const key in source) {
|
|
218
|
+
const value = source[key];
|
|
219
|
+
if (value === undefined) { // skip undefined values to keep defaults
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value)) {
|
|
223
|
+
if (!target[key])
|
|
224
|
+
target[key] = {};
|
|
225
|
+
deepMerge(target[key], value);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
target[key] = value;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return target;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Create table options based on defaults, with optional overrides.
|
|
235
|
+
*/
|
|
236
|
+
function createTableOptions(overrides = {}) {
|
|
237
|
+
const defaultsCopy = JSON.parse(JSON.stringify(DEFAULT_TABLE_OPTIONS)); // clona solo datos
|
|
238
|
+
const merged = deepMerge(defaultsCopy, overrides);
|
|
239
|
+
// reasignar funciones si existen en overrides
|
|
240
|
+
if (overrides.rows?.style)
|
|
241
|
+
merged.rows.style = overrides.rows.style;
|
|
242
|
+
if (overrides.rows?.class)
|
|
243
|
+
merged.rows.class = overrides.rows.class;
|
|
244
|
+
return merged;
|
|
245
|
+
}
|
|
246
|
+
|
|
84
247
|
function dataAlignHorizontalAsText(dataAlignHorizontal) {
|
|
85
248
|
switch (dataAlignHorizontal) {
|
|
86
249
|
case DataAlignHorizontal.Left:
|
|
@@ -175,170 +338,33 @@ function highlightText(cellValue, colMetadata, globalSearchText) {
|
|
|
175
338
|
return cellValue; // Return the original cell value if it doesn't meet the highlighting conditions
|
|
176
339
|
}
|
|
177
340
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Converts a blob from the database to a safe URL that can be used to display an image.
|
|
187
|
-
*
|
|
188
|
-
* This function takes a `Blob` object, converts it to a base64 encoded string, and returns a `SafeUrl`
|
|
189
|
-
* that can be used in an HTML template to display the image securely. The `SafeUrl` ensures that
|
|
190
|
-
* Angular's security mechanisms are bypassed correctly, preventing potential security risks.
|
|
191
|
-
*
|
|
192
|
-
* @param {Blob} blob - The blob object representing the image data from the database.
|
|
193
|
-
* @returns {SafeUrl} A safe URL that can be used to display the image in an HTML template.
|
|
194
|
-
*
|
|
195
|
-
* @example
|
|
196
|
-
* // Example usage in a component
|
|
197
|
-
* const imageBlob = new Blob([binaryData], { type: 'image/jpeg' });
|
|
198
|
-
* const imageUrl = this.getBlobIconAsUrl(imageBlob);
|
|
199
|
-
*
|
|
200
|
-
* // In your HTML template
|
|
201
|
-
* <img [src]="imageUrl" alt="Image">
|
|
202
|
-
*/
|
|
203
|
-
getBlobIconAsUrl(blob) {
|
|
204
|
-
let objectURL = `data:image/jpeg;base64,${blob}`; // Create a base64 encoded string from the blob data
|
|
205
|
-
return this.sanitizer.bypassSecurityTrustUrl(objectURL); // Bypass Angular's security mechanisms to create a SafeUrl
|
|
206
|
-
}
|
|
207
|
-
getIconStyles(option) {
|
|
208
|
-
return {
|
|
209
|
-
'vertical-align': 'middle',
|
|
210
|
-
'margin-right': '0.5rem',
|
|
211
|
-
'color': option.iconColor || '',
|
|
212
|
-
...option.iconStyle
|
|
213
|
-
};
|
|
214
|
-
}
|
|
215
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePredifinedFilters, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component });
|
|
216
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TablePredifinedFilters, isStandalone: true, selector: "ecs-table-predifined-filters", inputs: { option: "option", col: "col" }, ngImport: i0, template: "@if (option?.icon) {\r\n <i [class]=\"option.icon\" [ngStyle]=\"getIconStyles(option)\"></i>\r\n}\r\n@if (!option?.iconBlob && option?.iconBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\" [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\"/>\r\n}\r\n@if (option?.iconBlob) {\r\n <img alt=\"iconBlob\"\r\n [src]=\"getBlobIconAsUrl(option.iconBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.iconURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.iconURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.displayTag === true) {\r\n <p-tag [style]=\"option.tagStyle\"\r\n [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\">\r\n {{ option.name }}\r\n </p-tag>\r\n}\r\n@if (option?.displayName === true) {\r\n <span style=\"margin-left: 0.25rem; margin-top: 0.25rem;\">{{ option.name }}</span>\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i3.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i4.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }] });
|
|
217
|
-
}
|
|
218
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TablePredifinedFilters, decorators: [{
|
|
219
|
-
type: Component,
|
|
220
|
-
args: [{ selector: 'ecs-table-predifined-filters', imports: [
|
|
221
|
-
CommonModule,
|
|
222
|
-
SkeletonModule,
|
|
223
|
-
TagModule
|
|
224
|
-
], standalone: true, template: "@if (option?.icon) {\r\n <i [class]=\"option.icon\" [ngStyle]=\"getIconStyles(option)\"></i>\r\n}\r\n@if (!option?.iconBlob && option?.iconBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\" [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\"/>\r\n}\r\n@if (option?.iconBlob) {\r\n <img alt=\"iconBlob\"\r\n [src]=\"getBlobIconAsUrl(option.iconBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.iconURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.iconURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle; margin-right: 0.5rem;\"/>\r\n}\r\n@if (option?.displayTag === true) {\r\n <p-tag [style]=\"option.tagStyle\"\r\n [ngStyle]=\"{\r\n 'vertical-align': 'middle',\r\n 'margin-right': '0.5rem'\r\n }\">\r\n {{ option.name }}\r\n </p-tag>\r\n}\r\n@if (option?.displayName === true) {\r\n <span style=\"margin-left: 0.25rem; margin-top: 0.25rem;\">{{ option.name }}</span>\r\n}" }]
|
|
225
|
-
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { option: [{
|
|
226
|
-
type: Input
|
|
227
|
-
}], col: [{
|
|
228
|
-
type: Input
|
|
229
|
-
}] } });
|
|
230
|
-
|
|
231
|
-
class TableCell {
|
|
232
|
-
datePipe;
|
|
233
|
-
constructor(datePipe) {
|
|
234
|
-
this.datePipe = datePipe;
|
|
235
|
-
}
|
|
236
|
-
col;
|
|
237
|
-
rowData;
|
|
238
|
-
globalSearchText = null;
|
|
239
|
-
predifinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predifined column filters
|
|
240
|
-
dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
|
|
241
|
-
dateTimezone = "+00:00";
|
|
242
|
-
dateCulture = "en-US";
|
|
243
|
-
DataType = DataType;
|
|
244
|
-
get value() {
|
|
245
|
-
return this.rowData[this.col.field];
|
|
246
|
-
}
|
|
247
|
-
get tooltipText() {
|
|
248
|
-
if (this.col.dataTooltipCustomColumnSource && this.col.dataTooltipCustomColumnSource.length > 0) {
|
|
249
|
-
return this.rowData[this.col.dataTooltipCustomColumnSource];
|
|
250
|
-
}
|
|
251
|
-
return this.value;
|
|
252
|
-
}
|
|
253
|
-
getDataAlignHorizontalAsText(dataAlignHorizontal) {
|
|
254
|
-
dataAlignHorizontalAsText(dataAlignHorizontal);
|
|
255
|
-
}
|
|
256
|
-
getDataAlignVerticalAsText(dataAlignVertical) {
|
|
257
|
-
dataAlignVerticalAsText(dataAlignVertical);
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Formats a date value to a specific string format. Provided date will be assumed to be in UTC
|
|
261
|
-
*
|
|
262
|
-
* @param {any} value - The date value to be formatted.
|
|
263
|
-
* @returns {string} - The formatted date string in 'dd-MMM-yyyy HH:mm:ss' format followed by the timezone, or empty string if the provided value is invalid or undefined.
|
|
264
|
-
*
|
|
265
|
-
* @example
|
|
266
|
-
* // Example date value
|
|
267
|
-
* const dateValue: Date = new Date();
|
|
268
|
-
*
|
|
269
|
-
* // Use formatDate to get the formatted date string
|
|
270
|
-
* const formattedDate: string = formatDate(dateValue);
|
|
271
|
-
*
|
|
272
|
-
* // Output might be: '18-Jun-2024 14:30:00 GMT+0000'
|
|
273
|
-
*/
|
|
274
|
-
formatDate(value) {
|
|
275
|
-
let formattedDate = undefined; // By default, formattedDate will be undefined
|
|
276
|
-
if (value) { // If value is not undefined
|
|
277
|
-
formattedDate = this.datePipe.transform(value, this.dateFormat, this.dateTimezone, this.dateCulture); // Perform the date masking
|
|
278
|
-
}
|
|
279
|
-
return formattedDate ?? ''; // Returns the date formatted, or as empty string if an issue was found (or value was undefined).
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
283
|
-
* that need to be applied to an item on a row.
|
|
284
|
-
*
|
|
285
|
-
* @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
|
|
286
|
-
* @param {any} value - The value to be matched against the predefined filter values.
|
|
287
|
-
* @returns {any} The matching predefined filter value if found, otherwise null.
|
|
288
|
-
*/
|
|
289
|
-
getPredfinedFilterMatch(colMetadata, value) {
|
|
290
|
-
if (colMetadata.filterPredifinedValuesName && colMetadata.filterPredifinedValuesName.length > 0) { // Check if the column uses predefined filter values
|
|
291
|
-
const options = this.getPredifinedFilterValues(colMetadata.filterPredifinedValuesName); // Get the predefined filter values based on the name
|
|
292
|
-
return options.find(option => option.value === value); // Return the matching option if found
|
|
293
|
-
}
|
|
294
|
-
return null; // Return null if the column does not use predefined filter values
|
|
295
|
-
}
|
|
296
|
-
getPredifinedFilterValues(columnKeyName) {
|
|
297
|
-
return this.predifinedFiltersCollection[columnKeyName] || []; // Return the predefined filter values or an empty array if the option name does not exist
|
|
298
|
-
}
|
|
299
|
-
highlightText(cellValue, colMetadata, globalSearchText) {
|
|
300
|
-
return highlightText(cellValue, colMetadata, globalSearchText);
|
|
301
|
-
}
|
|
302
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableCell, deps: [{ token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
303
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: TableCell, isStandalone: true, selector: "ecs-table-cell", inputs: { col: "col", rowData: "rowData", globalSearchText: "globalSearchText", predifinedFiltersCollection: "predifinedFiltersCollection", dateFormat: "dateFormat", dateTimezone: "dateTimezone", dateCulture: "dateCulture" }, ngImport: i0, template: "<!--\r\n[ngStyle]=\"{\r\n 'display': 'flex',\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n-->\r\n@if (value !== null) {\r\n @if (col.filterPredifinedValuesName && col.filterPredifinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (getPredfinedFilterMatch(col, value); as option) {\r\n <div \r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [style.color]=\"value ? 'green' : 'red'\"\r\n [ngClass]=\"{ 'pi-check-circle': value, 'pi-times-circle': !value }\">\r\n </i>\r\n }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n }\r\n }\r\n }\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: TablePredifinedFilters, selector: "ecs-table-predifined-filters", inputs: ["option", "col"] }] });
|
|
304
|
-
}
|
|
305
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: TableCell, decorators: [{
|
|
306
|
-
type: Component,
|
|
307
|
-
args: [{ selector: 'ecs-table-cell', imports: [
|
|
308
|
-
CommonModule,
|
|
309
|
-
TooltipModule,
|
|
310
|
-
TablePredifinedFilters
|
|
311
|
-
], standalone: true, template: "<!--\r\n[ngStyle]=\"{\r\n 'display': 'flex',\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n-->\r\n@if (value !== null) {\r\n @if (col.filterPredifinedValuesName && col.filterPredifinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (getPredfinedFilterMatch(col, value); as option) {\r\n <div \r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [style.color]=\"value ? 'green' : 'red'\"\r\n [ngClass]=\"{ 'pi-check-circle': value, 'pi-times-circle': !value }\">\r\n </i>\r\n }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"tooltipText\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ value }}\r\n </div>\r\n }\r\n }\r\n }\r\n}" }]
|
|
312
|
-
}], ctorParameters: () => [{ type: i1$1.DatePipe }], propDecorators: { col: [{
|
|
313
|
-
type: Input
|
|
314
|
-
}], rowData: [{
|
|
315
|
-
type: Input
|
|
316
|
-
}], globalSearchText: [{
|
|
317
|
-
type: Input
|
|
318
|
-
}], predifinedFiltersCollection: [{
|
|
319
|
-
type: Input
|
|
320
|
-
}], dateFormat: [{
|
|
321
|
-
type: Input
|
|
322
|
-
}], dateTimezone: [{
|
|
323
|
-
type: Input
|
|
324
|
-
}], dateCulture: [{
|
|
325
|
-
type: Input
|
|
326
|
-
}] } });
|
|
327
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Abstract service for handling HTTP requests for **ECS Primeng table**.
|
|
343
|
+
*
|
|
344
|
+
* Provides a consistent interface for making GET and POST requests to the backend.
|
|
345
|
+
* Implementations must define how requests are executed, including error handling,
|
|
346
|
+
* headers, and response processing.
|
|
347
|
+
*/
|
|
328
348
|
class ECSPrimengTableHttpService {
|
|
329
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
330
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
349
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableHttpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
350
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableHttpService, providedIn: 'root' });
|
|
331
351
|
}
|
|
332
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
352
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableHttpService, decorators: [{
|
|
333
353
|
type: Injectable,
|
|
334
354
|
args: [{ providedIn: 'root' }]
|
|
335
355
|
}] });
|
|
336
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Abstract service for handling notifications in **ECS Primeng table**.
|
|
359
|
+
*
|
|
360
|
+
* Provides a consistent interface for displaying and clearing toast notifications.
|
|
361
|
+
* Implementations must define how the notifications are managed.
|
|
362
|
+
*/
|
|
337
363
|
class ECSPrimengTableNotificationService {
|
|
338
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
339
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
364
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
365
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableNotificationService, providedIn: 'root' });
|
|
340
366
|
}
|
|
341
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
367
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableNotificationService, decorators: [{
|
|
342
368
|
type: Injectable,
|
|
343
369
|
args: [{ providedIn: 'root' }]
|
|
344
370
|
}] });
|
|
@@ -361,7 +387,10 @@ class ECSPrimengTableService {
|
|
|
361
387
|
'accept': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
|
362
388
|
'Content-Type': 'application/json'
|
|
363
389
|
});
|
|
364
|
-
return this.http.handleHttpPostRequest(url, postData, httpOptions,
|
|
390
|
+
return this.http.handleHttpPostRequest(url, postData, httpOptions, "blob");
|
|
391
|
+
}
|
|
392
|
+
getIconBlob(url) {
|
|
393
|
+
return this.http.handleHttpGetRequest(url, "blob");
|
|
365
394
|
}
|
|
366
395
|
downloadFile(data, fileName, contentType) {
|
|
367
396
|
const blob = new Blob([data], { type: contentType });
|
|
@@ -404,37 +433,77 @@ class ECSPrimengTableService {
|
|
|
404
433
|
action(rowData); // Perform the action
|
|
405
434
|
}
|
|
406
435
|
}
|
|
436
|
+
handlePredefinedFilterClick(action, rowData = null, option) {
|
|
437
|
+
if (action) { // If the button has an assigned action
|
|
438
|
+
action(rowData, option); // Perform the action
|
|
439
|
+
}
|
|
440
|
+
}
|
|
407
441
|
getColumnStyle(col, headerCols = false) {
|
|
408
442
|
let styles = {};
|
|
409
443
|
if (!headerCols) {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
444
|
+
switch (col.cellOverflowBehaviour) {
|
|
445
|
+
case CellOverflowBehaviour.Wrap:
|
|
446
|
+
styles['white-space'] = 'normal';
|
|
447
|
+
styles['word-wrap'] = 'break-word';
|
|
448
|
+
styles['word-break'] = 'break-all';
|
|
449
|
+
styles['overflow'] = 'hidden';
|
|
450
|
+
break;
|
|
451
|
+
case CellOverflowBehaviour.Ellipsis:
|
|
452
|
+
styles['white-space'] = 'nowrap';
|
|
453
|
+
styles['overflow'] = 'hidden';
|
|
454
|
+
styles['text-overflow'] = 'ellipsis';
|
|
455
|
+
styles['width'] = '100%';
|
|
456
|
+
styles['min-width'] = '100%';
|
|
457
|
+
styles['max-width'] = '100%';
|
|
458
|
+
break;
|
|
459
|
+
/*
|
|
460
|
+
display: block;
|
|
461
|
+
width: 100%;
|
|
462
|
+
text-align: center;
|
|
463
|
+
*/
|
|
464
|
+
case CellOverflowBehaviour.Hidden:
|
|
465
|
+
default:
|
|
466
|
+
styles['white-space'] = 'nowrap';
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
if (col.initialWidth > 0) {
|
|
471
|
+
const width = `${col.initialWidth}px`;
|
|
472
|
+
styles['width'] = width;
|
|
473
|
+
styles['min-width'] = width;
|
|
474
|
+
styles['max-width'] = width;
|
|
475
|
+
}
|
|
476
|
+
return styles;
|
|
477
|
+
/*let styles: Record<string, string> = {};
|
|
478
|
+
if(!headerCols){
|
|
479
|
+
styles = {
|
|
480
|
+
'white-space': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'normal' : 'nowrap',
|
|
481
|
+
'word-wrap': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-word' : 'normal',
|
|
482
|
+
'word-break': col.cellOverflowBehaviour === CellOverflowBehaviour.Wrap ? 'break-all' : 'normal'
|
|
483
|
+
};
|
|
415
484
|
}
|
|
416
485
|
if (col.initialWidth > 0) {
|
|
417
486
|
styles['max-width'] = col.initialWidth + 'px';
|
|
418
487
|
styles['min-width'] = col.initialWidth + 'px';
|
|
419
488
|
styles['width'] = col.initialWidth + 'px';
|
|
420
489
|
}
|
|
421
|
-
return styles
|
|
490
|
+
return styles;*/
|
|
422
491
|
}
|
|
423
492
|
fetchTableViews(tableViewSaveAs, recoverListEndpoint, tableViewSaveKey) {
|
|
424
493
|
let tableViewList = [];
|
|
425
494
|
let tableViewNotParsed = null;
|
|
426
495
|
if (tableViewSaveKey !== "" && tableViewSaveKey !== '') {
|
|
427
496
|
switch (tableViewSaveAs) {
|
|
428
|
-
case TableViewSaveMode.
|
|
497
|
+
case TableViewSaveMode.None:
|
|
429
498
|
tableViewNotParsed = null;
|
|
430
499
|
break;
|
|
431
|
-
case TableViewSaveMode.
|
|
500
|
+
case TableViewSaveMode.SessionStorage:
|
|
432
501
|
tableViewNotParsed = sessionStorage.getItem(tableViewSaveKey);
|
|
433
502
|
break;
|
|
434
|
-
case TableViewSaveMode.
|
|
503
|
+
case TableViewSaveMode.LocalStorage:
|
|
435
504
|
tableViewNotParsed = localStorage.getItem(tableViewSaveKey);
|
|
436
505
|
break;
|
|
437
|
-
case TableViewSaveMode.
|
|
506
|
+
case TableViewSaveMode.DatabaseStorage:
|
|
438
507
|
const postData = {
|
|
439
508
|
tableViewSaveKey: tableViewSaveKey
|
|
440
509
|
};
|
|
@@ -452,7 +521,8 @@ class ECSPrimengTableService {
|
|
|
452
521
|
}
|
|
453
522
|
updateViewsMenuItems(tableSaveViewList) {
|
|
454
523
|
return tableSaveViewList.map(item => ({
|
|
455
|
-
label: item.viewAlias
|
|
524
|
+
label: item.viewAlias,
|
|
525
|
+
lastActive: item.lastActive
|
|
456
526
|
}));
|
|
457
527
|
}
|
|
458
528
|
viewsSaveToDatabase(tableSaveViewList, setListEndpoint, tableViewSaveKey) {
|
|
@@ -502,16 +572,190 @@ class ECSPrimengTableService {
|
|
|
502
572
|
}
|
|
503
573
|
return tableWidth;
|
|
504
574
|
}
|
|
505
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
506
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
575
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableService, deps: [{ token: ECSPrimengTableHttpService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
576
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableService, providedIn: 'root' });
|
|
507
577
|
}
|
|
508
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
578
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTableService, decorators: [{
|
|
509
579
|
type: Injectable,
|
|
510
580
|
args: [{
|
|
511
581
|
providedIn: 'root'
|
|
512
582
|
}]
|
|
513
583
|
}], ctorParameters: () => [{ type: ECSPrimengTableHttpService }, { type: ECSPrimengTableNotificationService }] });
|
|
514
584
|
|
|
585
|
+
class TablePredefinedFilters {
|
|
586
|
+
sanitizer;
|
|
587
|
+
tableService;
|
|
588
|
+
constructor(sanitizer, tableService) {
|
|
589
|
+
this.sanitizer = sanitizer;
|
|
590
|
+
this.tableService = tableService;
|
|
591
|
+
}
|
|
592
|
+
option;
|
|
593
|
+
col;
|
|
594
|
+
selectable = false;
|
|
595
|
+
rowData;
|
|
596
|
+
/**
|
|
597
|
+
* Converts a blob from the database to a safe URL that can be used to display an image.
|
|
598
|
+
*
|
|
599
|
+
* This function takes a `Blob` object, converts it to a base64 encoded string, and returns a `SafeUrl`
|
|
600
|
+
* that can be used in an HTML template to display the image securely. The `SafeUrl` ensures that
|
|
601
|
+
* Angular's security mechanisms are bypassed correctly, preventing potential security risks.
|
|
602
|
+
*
|
|
603
|
+
* @param {Blob} blob - The blob object representing the image data from the database.
|
|
604
|
+
* @returns {SafeUrl} A safe URL that can be used to display the image in an HTML template.
|
|
605
|
+
*
|
|
606
|
+
* @example
|
|
607
|
+
* // Example usage in a component
|
|
608
|
+
* const imageBlob = new Blob([binaryData], { type: 'image/jpeg' });
|
|
609
|
+
* const imageUrl = this.getBlobIconAsUrl(imageBlob);
|
|
610
|
+
*
|
|
611
|
+
* // In your HTML template
|
|
612
|
+
* <img [src]="imageUrl" alt="Image">
|
|
613
|
+
*/
|
|
614
|
+
getBlobIconAsUrl(blob) {
|
|
615
|
+
let objectURL = `data:image/jpeg;base64,${blob}`; // Create a base64 encoded string from the blob data
|
|
616
|
+
return this.sanitizer.bypassSecurityTrustUrl(objectURL); // Bypass Angular's security mechanisms to create a SafeUrl
|
|
617
|
+
}
|
|
618
|
+
handleClick() {
|
|
619
|
+
if (this.option.action) {
|
|
620
|
+
this.tableService.handlePredefinedFilterClick(this.option.action, this.rowData, this.option);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
getTagStyle(option) {
|
|
624
|
+
return {
|
|
625
|
+
...option.tagStyle,
|
|
626
|
+
'vertical-align': 'middle'
|
|
627
|
+
};
|
|
628
|
+
}
|
|
629
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TablePredefinedFilters, deps: [{ token: i1.DomSanitizer }, { token: ECSPrimengTableService }], target: i0.ɵɵFactoryTarget.Component });
|
|
630
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TablePredefinedFilters, isStandalone: true, selector: "ecs-table-predefined-filters", inputs: { option: "option", col: "col", selectable: "selectable", rowData: "rowData" }, ngImport: i0, template: "<div style=\"align-items: center; gap: 0.25rem;\"\r\n [style.cursor]=\"(selectable && option?.action) ? 'pointer' : 'default'\"\r\n [attr.role]=\"selectable && option?.action ? 'button' : null\"\r\n (click)=\"handleClick(); $event.stopPropagation();\">\r\n @if (option?.icon) {\r\n <i [class]=\"option.icon\"\r\n [style]=\"'vertical-align: middle; color: '+(option.iconColor || '') +';' +(option.iconStyle || '')\"></i>\r\n }\r\n @if (!option?.imageBlob && option?.imageBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\"\r\n [style]=\"{'vertical-align': 'middle'}\"/>\r\n }\r\n @if (option?.imageBlob) {\r\n <img alt=\"image\"\r\n [src]=\"getBlobIconAsUrl(option.imageBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle;\"/>\r\n }\r\n @if (option?.imageURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.imageURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle;\"/>\r\n }\r\n @if (option?.displayTag === true) {\r\n <p-tag [style]=\"getTagStyle(option)\" [value]=\"option.name\"/>\r\n }\r\n @if (option?.displayName === true) {\r\n <span>{{ option.name }}</span>\r\n }\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: ["style", "styleClass", "severity", "value", "icon", "rounded"] }] });
|
|
631
|
+
}
|
|
632
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TablePredefinedFilters, decorators: [{
|
|
633
|
+
type: Component,
|
|
634
|
+
args: [{ selector: 'ecs-table-predefined-filters', imports: [
|
|
635
|
+
SkeletonModule,
|
|
636
|
+
TagModule
|
|
637
|
+
], standalone: true, template: "<div style=\"align-items: center; gap: 0.25rem;\"\r\n [style.cursor]=\"(selectable && option?.action) ? 'pointer' : 'default'\"\r\n [attr.role]=\"selectable && option?.action ? 'button' : null\"\r\n (click)=\"handleClick(); $event.stopPropagation();\">\r\n @if (option?.icon) {\r\n <i [class]=\"option.icon\"\r\n [style]=\"'vertical-align: middle; color: '+(option.iconColor || '') +';' +(option.iconStyle || '')\"></i>\r\n }\r\n @if (!option?.imageBlob && option?.imageBlobSourceEndpoint) {\r\n <p-skeleton size=\"28px\"\r\n [style]=\"{'vertical-align': 'middle'}\"/>\r\n }\r\n @if (option?.imageBlob) {\r\n <img alt=\"image\"\r\n [src]=\"getBlobIconAsUrl(option.imageBlob)\"\r\n height=\"28\"\r\n style=\"vertical-align: middle;\"/>\r\n }\r\n @if (option?.imageURL) {\r\n <img alt=\"iconFromURL\"\r\n [src]=\"option.imageURL\"\r\n height=\"28\"\r\n style=\"vertical-align: middle;\"/>\r\n }\r\n @if (option?.displayTag === true) {\r\n <p-tag [style]=\"getTagStyle(option)\" [value]=\"option.name\"/>\r\n }\r\n @if (option?.displayName === true) {\r\n <span>{{ option.name }}</span>\r\n }\r\n</div>" }]
|
|
638
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }, { type: ECSPrimengTableService }], propDecorators: { option: [{
|
|
639
|
+
type: Input
|
|
640
|
+
}], col: [{
|
|
641
|
+
type: Input
|
|
642
|
+
}], selectable: [{
|
|
643
|
+
type: Input
|
|
644
|
+
}], rowData: [{
|
|
645
|
+
type: Input
|
|
646
|
+
}] } });
|
|
647
|
+
|
|
648
|
+
class TableCell {
|
|
649
|
+
datePipe;
|
|
650
|
+
constructor(datePipe) {
|
|
651
|
+
this.datePipe = datePipe;
|
|
652
|
+
}
|
|
653
|
+
col;
|
|
654
|
+
rowData;
|
|
655
|
+
globalSearchText = null;
|
|
656
|
+
predefinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predefined column filters
|
|
657
|
+
dateFormat = "dd-MMM-yyyy HH:mm:ss zzzz";
|
|
658
|
+
dateTimezone = "+00:00";
|
|
659
|
+
dateCulture = "en-US";
|
|
660
|
+
DataType = DataType;
|
|
661
|
+
get value() {
|
|
662
|
+
return this.rowData[this.col.field];
|
|
663
|
+
}
|
|
664
|
+
get tooltipText() {
|
|
665
|
+
if (this.col.dataTooltipCustomColumnSource && this.col.dataTooltipCustomColumnSource.length > 0) {
|
|
666
|
+
return this.rowData[this.col.dataTooltipCustomColumnSource];
|
|
667
|
+
}
|
|
668
|
+
return this.value;
|
|
669
|
+
}
|
|
670
|
+
getListValues(col, rowData) {
|
|
671
|
+
const value = rowData[col.field];
|
|
672
|
+
return value ? value.split(';').map((v) => v.trim()) : [];
|
|
673
|
+
}
|
|
674
|
+
getDataAlignHorizontalAsText(dataAlignHorizontal) {
|
|
675
|
+
dataAlignHorizontalAsText(dataAlignHorizontal);
|
|
676
|
+
}
|
|
677
|
+
getDataAlignVerticalAsText(dataAlignVertical) {
|
|
678
|
+
dataAlignVerticalAsText(dataAlignVertical);
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Formats a date value to a specific string format. Provided date will be assumed to be in UTC
|
|
682
|
+
*
|
|
683
|
+
* @param {any} value - The date value to be formatted.
|
|
684
|
+
* @returns {string} - The formatted date string in 'dd-MMM-yyyy HH:mm:ss' format followed by the timezone, or empty string if the provided value is invalid or undefined.
|
|
685
|
+
*
|
|
686
|
+
* @example
|
|
687
|
+
* // Example date value
|
|
688
|
+
* const dateValue: Date = new Date();
|
|
689
|
+
*
|
|
690
|
+
* // Use formatDate to get the formatted date string
|
|
691
|
+
* const formattedDate: string = formatDate(dateValue);
|
|
692
|
+
*
|
|
693
|
+
* // Output might be: '18-Jun-2024 14:30:00 GMT+0000'
|
|
694
|
+
*/
|
|
695
|
+
formatDate(value) {
|
|
696
|
+
let formattedDate = undefined; // By default, formattedDate will be undefined
|
|
697
|
+
if (value) { // If value is not undefined
|
|
698
|
+
formattedDate = this.datePipe.transform(value, this.dateFormat, this.dateTimezone, this.dateCulture); // Perform the date masking
|
|
699
|
+
}
|
|
700
|
+
return formattedDate ?? ''; // Returns the date formatted, or as empty string if an issue was found (or value was undefined).
|
|
701
|
+
}
|
|
702
|
+
getPredefinedFilterTooltip(colMetadata, value) {
|
|
703
|
+
if (colMetadata.dataType == DataType.List) {
|
|
704
|
+
return value;
|
|
705
|
+
}
|
|
706
|
+
if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) {
|
|
707
|
+
const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName);
|
|
708
|
+
return options.find(x => x.value == value)?.name;
|
|
709
|
+
}
|
|
710
|
+
return null;
|
|
711
|
+
}
|
|
712
|
+
/**
|
|
713
|
+
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
714
|
+
* that need to be applied to an item on a row.
|
|
715
|
+
*
|
|
716
|
+
* @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
|
|
717
|
+
* @param {any} value - The value to be matched against the predefined filter values.
|
|
718
|
+
* @returns {any} The matching predefined filter value if found, otherwise null.
|
|
719
|
+
*/
|
|
720
|
+
getPredfinedFilterMatch(colMetadata, value) {
|
|
721
|
+
if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) { // Check if the column uses predefined filter values
|
|
722
|
+
const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName); // Get the predefined filter values based on the name
|
|
723
|
+
return options.find(option => option.value === value); // Return the matching option if found
|
|
724
|
+
}
|
|
725
|
+
return null; // Return null if the column does not use predefined filter values
|
|
726
|
+
}
|
|
727
|
+
getPredefinedFilterValues(columnKeyName) {
|
|
728
|
+
return this.predefinedFiltersCollection?.[columnKeyName] || []; // Return the predefined filter values or an empty array if the option name does not exist
|
|
729
|
+
}
|
|
730
|
+
highlightText(cellValue, colMetadata, globalSearchText) {
|
|
731
|
+
return highlightText(cellValue, colMetadata, globalSearchText);
|
|
732
|
+
}
|
|
733
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TableCell, deps: [{ token: i1$1.DatePipe }], target: i0.ɵɵFactoryTarget.Component });
|
|
734
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", 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: "@if (value !== null) {\r\n @if (col.filterPredefinedValuesName && col.filterPredefinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (col.dataType === DataType.List){\r\n @for (item of getListValues(col, rowData); track item) {\r\n @if (getPredfinedFilterMatch(col, item); as option) {\r\n <div style=\"display: inline-block; margin-right: 0.5rem;\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : item\"\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\"/>\r\n </div>\r\n }\r\n }\r\n } @else {\r\n @if (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\"/>\r\n </div>\r\n }\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"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 }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : formatDate(value)\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"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 }\r\n }\r\n }\r\n}", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: TablePredefinedFilters, selector: "ecs-table-predefined-filters", inputs: ["option", "col", "selectable", "rowData"] }] });
|
|
735
|
+
}
|
|
736
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TableCell, decorators: [{
|
|
737
|
+
type: Component,
|
|
738
|
+
args: [{ selector: 'ecs-table-cell', imports: [
|
|
739
|
+
CommonModule,
|
|
740
|
+
TooltipModule,
|
|
741
|
+
TablePredefinedFilters
|
|
742
|
+
], standalone: true, template: "@if (value !== null) {\r\n @if (col.filterPredefinedValuesName && col.filterPredefinedValuesName.length > 0) {\r\n <div [ngStyle]=\"{\r\n 'justify-content': getDataAlignHorizontalAsText(col.dataAlignHorizontal),\r\n 'align-items': getDataAlignVerticalAsText(col.dataAlignVertical)\r\n }\">\r\n @if (col.dataType === DataType.List){\r\n @for (item of getListValues(col, rowData); track item) {\r\n @if (getPredfinedFilterMatch(col, item); as option) {\r\n <div style=\"display: inline-block; margin-right: 0.5rem;\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : item\"\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\"/>\r\n </div>\r\n }\r\n }\r\n } @else {\r\n @if (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\"/>\r\n </div>\r\n }\r\n }\r\n </div>\r\n } @else {\r\n @switch (col.dataType) {\r\n @case (DataType.Boolean) {\r\n <i class=\"pi\"\r\n [pTooltip]=\"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 }\r\n @case (DataType.Date) {\r\n <div \r\n [innerHtml]=\"highlightText(formatDate(value), col, globalSearchText)\"\r\n [pTooltip]=\"col.dataTooltipCustomColumnSource && col.dataTooltipCustomColumnSource.length > 0 \r\n ? rowData[col.dataTooltipCustomColumnSource] \r\n : formatDate(value)\"\r\n [tooltipDisabled]=\"!col.dataTooltipShow\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\">\r\n {{ formatDate(value) }}\r\n </div>\r\n }\r\n @default {\r\n <div\r\n [innerHtml]=\"highlightText(value, col, globalSearchText)\"\r\n [pTooltip]=\"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 }\r\n }\r\n }\r\n}" }]
|
|
743
|
+
}], ctorParameters: () => [{ type: i1$1.DatePipe }], propDecorators: { col: [{
|
|
744
|
+
type: Input
|
|
745
|
+
}], rowData: [{
|
|
746
|
+
type: Input
|
|
747
|
+
}], globalSearchText: [{
|
|
748
|
+
type: Input
|
|
749
|
+
}], predefinedFiltersCollection: [{
|
|
750
|
+
type: Input
|
|
751
|
+
}], dateFormat: [{
|
|
752
|
+
type: Input
|
|
753
|
+
}], dateTimezone: [{
|
|
754
|
+
type: Input
|
|
755
|
+
}], dateCulture: [{
|
|
756
|
+
type: Input
|
|
757
|
+
}] } });
|
|
758
|
+
|
|
515
759
|
class TableButton {
|
|
516
760
|
tableService;
|
|
517
761
|
constructor(tableService) {
|
|
@@ -521,25 +765,21 @@ class TableButton {
|
|
|
521
765
|
rowData;
|
|
522
766
|
isActionButton = false;
|
|
523
767
|
isLastActionButton = false;
|
|
524
|
-
clicked = new EventEmitter();
|
|
525
|
-
isDisabled() {
|
|
526
|
-
return this.button.condition ? !this.button.condition(this.rowData) : false;
|
|
527
|
-
}
|
|
528
768
|
handleClick() {
|
|
529
769
|
if (this.button.action) {
|
|
530
770
|
this.tableService.handleButtonsClick(this.button.action, this.rowData);
|
|
531
771
|
}
|
|
532
772
|
}
|
|
533
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
534
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
773
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TableButton, deps: [{ token: ECSPrimengTableService }], target: i0.ɵɵFactoryTarget.Component });
|
|
774
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: TableButton, isStandalone: true, selector: "ecs-table-button", inputs: { button: "button", rowData: "rowData", isActionButton: "isActionButton", isLastActionButton: "isLastActionButton" }, ngImport: i0, template: "@if(!(button.conditionFailHide && (button.enabledCondition?.(rowData) ?? false))){\r\n <p-button\r\n [disabled]=\"!(button.enabledCondition?.(rowData) ?? true)\"\r\n [rounded]=\"button.rounded || false\"\r\n [iconPos]=\"button.iconPos || 'left'\"\r\n [raised]=\"button.raised || false\"\r\n [variant]=\"button.variant || null\"\r\n [pTooltip]=\"button.tooltip || ''\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"(button.color || 'p-button-outlined') + (isActionButton ? ' custom-small-btn' : '') + (button.style || '')\"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"button.label || ''\"\r\n [size]=\"isActionButton ? 'small': undefined\"\r\n [ngStyle]=\"isActionButton && !isLastActionButton ? {'margin-right':'10px'} : {}\"\r\n (onClick)=\"handleClick()\"/>\r\n}", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
|
|
535
775
|
}
|
|
536
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
776
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: TableButton, decorators: [{
|
|
537
777
|
type: Component,
|
|
538
778
|
args: [{ selector: 'ecs-table-button', imports: [
|
|
539
779
|
CommonModule,
|
|
540
780
|
ButtonModule,
|
|
541
781
|
TooltipModule
|
|
542
|
-
], standalone: true, template: "<p-button\r\n
|
|
782
|
+
], standalone: true, template: "@if(!(button.conditionFailHide && (button.enabledCondition?.(rowData) ?? false))){\r\n <p-button\r\n [disabled]=\"!(button.enabledCondition?.(rowData) ?? true)\"\r\n [rounded]=\"button.rounded || false\"\r\n [iconPos]=\"button.iconPos || 'left'\"\r\n [raised]=\"button.raised || false\"\r\n [variant]=\"button.variant || null\"\r\n [pTooltip]=\"button.tooltip || ''\"\r\n [tooltipDisabled]=\"!button.tooltip || button.tooltip.length === 0\"\r\n [showDelay]=\"700\"\r\n tooltipPosition=\"top\"\r\n [styleClass]=\"(button.color || 'p-button-outlined') + (isActionButton ? ' custom-small-btn' : '') + (button.style || '')\"\r\n [icon]=\"button.icon || ''\"\r\n [label]=\"button.label || ''\"\r\n [size]=\"isActionButton ? 'small': undefined\"\r\n [ngStyle]=\"isActionButton && !isLastActionButton ? {'margin-right':'10px'} : {}\"\r\n (onClick)=\"handleClick()\"/>\r\n}", styles: [":host ::ng-deep .custom-small-btn.p-button{height:28px!important;line-height:28px;padding-top:0;padding-bottom:0}\n"] }]
|
|
543
783
|
}], ctorParameters: () => [{ type: ECSPrimengTableService }], propDecorators: { button: [{
|
|
544
784
|
type: Input
|
|
545
785
|
}], rowData: [{
|
|
@@ -548,8 +788,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
548
788
|
type: Input
|
|
549
789
|
}], isLastActionButton: [{
|
|
550
790
|
type: Input
|
|
551
|
-
}], clicked: [{
|
|
552
|
-
type: Output
|
|
553
791
|
}] } });
|
|
554
792
|
|
|
555
793
|
class ColumnSelector {
|
|
@@ -560,19 +798,19 @@ class ColumnSelector {
|
|
|
560
798
|
visibleChange = new EventEmitter();
|
|
561
799
|
applyChanges = new EventEmitter();
|
|
562
800
|
cellOverflowBehaviourOptions = [
|
|
563
|
-
{ icon: 'pi pi-minus', val: CellOverflowBehaviour.Hidden },
|
|
564
|
-
{ icon: 'pi pi-equals', val: CellOverflowBehaviour.Wrap } /*,
|
|
565
|
-
{icon: 'pi pi-ellipsis-h', val: CellOverflowBehaviour.Ellipsis}*/
|
|
801
|
+
{ icon: 'pi pi-minus', val: CellOverflowBehaviour.Hidden, name: "Hidden" },
|
|
802
|
+
{ icon: 'pi pi-equals', val: CellOverflowBehaviour.Wrap, name: "Wrap" } /*,
|
|
803
|
+
{icon: 'pi pi-ellipsis-h', val: CellOverflowBehaviour.Ellipsis, name: "Ellipsis"}*/
|
|
566
804
|
];
|
|
567
805
|
dataAlignHorizontalOptions = [
|
|
568
|
-
{ icon: 'pi pi-align-left', val: DataAlignHorizontal.Left },
|
|
569
|
-
{ icon: 'pi pi-align-center', val: DataAlignHorizontal.Center },
|
|
570
|
-
{ icon: 'pi pi-align-right', val: DataAlignHorizontal.Right }
|
|
806
|
+
{ icon: 'pi pi-align-left', val: DataAlignHorizontal.Left, name: "Left" },
|
|
807
|
+
{ icon: 'pi pi-align-center', val: DataAlignHorizontal.Center, name: "Center" },
|
|
808
|
+
{ icon: 'pi pi-align-right', val: DataAlignHorizontal.Right, name: "Right" }
|
|
571
809
|
];
|
|
572
810
|
dataAlignVerticalOptions = [
|
|
573
|
-
{ icon: 'pi pi-angle-up', val: DataAlignVertical.Top },
|
|
574
|
-
{ icon: 'pi pi-align-justify', val: DataAlignVertical.Middle },
|
|
575
|
-
{ icon: 'pi pi-angle-down', val: DataAlignVertical.Bottom }
|
|
811
|
+
{ icon: 'pi pi-angle-up', val: DataAlignVertical.Top, name: "Top" },
|
|
812
|
+
{ icon: 'pi pi-align-justify', val: DataAlignVertical.Middle, name: "Middle" },
|
|
813
|
+
{ icon: 'pi pi-angle-down', val: DataAlignVertical.Bottom, name: "Bottom" }
|
|
576
814
|
];
|
|
577
815
|
globalSearchText = null; // The text used by the global search
|
|
578
816
|
globalSearchMaxLength = 50;
|
|
@@ -614,10 +852,10 @@ class ColumnSelector {
|
|
|
614
852
|
this.globalSearchText = null;
|
|
615
853
|
this.visibleChange.emit(false);
|
|
616
854
|
}
|
|
617
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
618
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ColumnSelector, isStandalone: true, selector: "ecs-column-selector", inputs: { visible: "visible", columnModalData: "columnModalData", filteredColumnData: "filteredColumnData" }, outputs: { visibleChange: "visibleChange", applyChanges: "applyChanges" }, viewQueries: [{ propertyName: "dt_columnDialog", first: true, predicate: ["dt_columnDialog"], descendants: true }], ngImport: i0, template: "<!--COLUMN MODAL DIALOG-->\r\n<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '65vw', 'max-width': '65vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <span class=\"white-space-nowrap\"><b>MODIFY COLUMNS</b></span>\r\n </ng-template>\r\n <div style=\"padding: 20px;\">\r\n <p-table #dt_columnDialog [value]=\"columnModalData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows \r\n [globalFilterFields]=\"['header']\" scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\" (onFilter)=\"onColumnModalFilter($event)\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px\">\r\n <p-checkbox inputId=\"selectAll\" [binary]=\"true\" [ngModel]=\"allColumnsCheckboxActive()\" (onChange)=\"allColumnsCheckboxClick($event)\"></p-checkbox>\r\n <label for=\"selectAll\">Select all columns</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <p-iconField iconPosition=\"left\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" placeholder=\"Search column name\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">Show column</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">Column name</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Cell overflow behaviour</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">Horizontal aligment</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Vertical aligment</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">\r\n <p-checkbox \r\n [(ngModel)]=\"rowData.selected\" \r\n [binary]=\"true\"\r\n [disabled]=\"rowData.selectDisabled\"/>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"cellOverflowBehaviourOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignHorizontal\" [options]=\"dataAlignHorizontalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.dataAlignVertical\" [options]=\"dataAlignVerticalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\"></i>\r\n </ng-template>\r\n </p-selectButton>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no columns</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{filteredColumnData ? filteredColumnData.length : 0}} columns of {{columnModalData ? columnModalData.length : 0}} available columns\r\n </div>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel changes\" severity=\"danger\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" label=\"Save changes\" severity=\"success\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i6.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] });
|
|
855
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ColumnSelector, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
856
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ColumnSelector, isStandalone: true, selector: "ecs-column-selector", inputs: { visible: "visible", columnModalData: "columnModalData", filteredColumnData: "filteredColumnData" }, outputs: { visibleChange: "visibleChange", applyChanges: "applyChanges" }, viewQueries: [{ propertyName: "dt_columnDialog", first: true, predicate: ["dt_columnDialog"], descendants: true }], ngImport: i0, template: "<!--COLUMN MODAL DIALOG-->\r\n<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '65vw', 'max-width': '65vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <span class=\"white-space-nowrap\"><b>MODIFY COLUMNS</b></span>\r\n </ng-template>\r\n <div style=\"padding: 20px;\">\r\n <p-table #dt_columnDialog [value]=\"columnModalData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows \r\n [globalFilterFields]=\"['header']\" scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\" (onFilter)=\"onColumnModalFilter($event)\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px\">\r\n <p-checkbox inputId=\"selectAll\" [binary]=\"true\" [ngModel]=\"allColumnsCheckboxActive()\" (onChange)=\"allColumnsCheckboxClick($event)\"></p-checkbox>\r\n <label for=\"selectAll\">Select all columns</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <p-iconField iconPosition=\"left\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" placeholder=\"Search column name\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">Show column</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">Column name</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Cell overflow behaviour</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">Horizontal aligment</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Vertical aligment</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">\r\n <p-checkbox \r\n [(ngModel)]=\"rowData.selected\" \r\n [binary]=\"true\"\r\n [disabled]=\"rowData.selectDisabled\"/>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"cellOverflowBehaviourOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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]=\"dataAlignHorizontalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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]=\"dataAlignVerticalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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 #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no columns</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{filteredColumnData ? filteredColumnData.length : 0}} columns of {{columnModalData ? columnModalData.length : 0}} available columns\r\n </div>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel changes\" severity=\"danger\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" label=\"Save changes\" severity=\"success\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i9.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: SelectButtonModule }, { kind: "component", type: i6.SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9$1.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }] });
|
|
619
857
|
}
|
|
620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
858
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ColumnSelector, decorators: [{
|
|
621
859
|
type: Component,
|
|
622
860
|
args: [{ selector: 'ecs-column-selector', imports: [
|
|
623
861
|
DialogModule,
|
|
@@ -629,8 +867,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
629
867
|
FormsModule,
|
|
630
868
|
InputIconModule,
|
|
631
869
|
IconFieldModule,
|
|
632
|
-
InputTextModule
|
|
633
|
-
|
|
870
|
+
InputTextModule,
|
|
871
|
+
TooltipModule
|
|
872
|
+
], standalone: true, template: "<!--COLUMN MODAL DIALOG-->\r\n<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '65vw', 'max-width': '65vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <span class=\"white-space-nowrap\"><b>MODIFY COLUMNS</b></span>\r\n </ng-template>\r\n <div style=\"padding: 20px;\">\r\n <p-table #dt_columnDialog [value]=\"columnModalData\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows \r\n [globalFilterFields]=\"['header']\" scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\" (onFilter)=\"onColumnModalFilter($event)\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px\">\r\n <p-checkbox inputId=\"selectAll\" [binary]=\"true\" [ngModel]=\"allColumnsCheckboxActive()\" (onChange)=\"allColumnsCheckboxClick($event)\"></p-checkbox>\r\n <label for=\"selectAll\">Select all columns</label>\r\n </div>\r\n <div style=\"display: flex; align-items: center;\">\r\n <p-iconField iconPosition=\"left\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"filterColumnModal($event)\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" placeholder=\"Search column name\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearGlobalFilter(dt_columnDialog); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">Show column</th>\r\n <th pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px; text-align: center;\">Column name</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Cell overflow behaviour</th>\r\n <th style=\"max-width: 160px; min-width: 160px; width: 160px; text-align: center;\">Horizontal aligment</th>\r\n <th style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">Vertical aligment</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td pFrozenColumn style=\"max-width: 100px; min-width: 100px; width: 100px; text-align: center;\">\r\n <p-checkbox \r\n [(ngModel)]=\"rowData.selected\" \r\n [binary]=\"true\"\r\n [disabled]=\"rowData.selectDisabled\"/>\r\n </td>\r\n <td pFrozenColumn style=\"max-width: 250px; min-width: 250px; width: 250px;\">{{rowData.header}}</td>\r\n <td style=\"max-width: 150px; min-width: 150px; width: 150px; text-align: center;\">\r\n <p-selectButton [(ngModel)]=\"rowData.cellOverflowBehaviour\" [options]=\"cellOverflowBehaviourOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.cellOverflowBehaviourDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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]=\"dataAlignHorizontalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignHorizontalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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]=\"dataAlignVerticalOptions\" optionValue=\"val\" optionLabel=\"icon\" [disabled]=\"rowData.dataAlignVerticalDisabled\" allowEmpty=\"false\">\r\n <ng-template #item let-item>\r\n <i [class]=\"item.icon\" style=\"margin: -20px;\" [pTooltip]=\"item.name\" [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 #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no columns</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{filteredColumnData ? filteredColumnData.length : 0}} columns of {{columnModalData ? columnModalData.length : 0}} available columns\r\n </div>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel changes\" severity=\"danger\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n <p-button (click)=\"applyColumnModalChanges()\" label=\"Save changes\" severity=\"success\" [style]=\"{'margin-top': '10px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
|
|
634
873
|
}], propDecorators: { dt_columnDialog: [{
|
|
635
874
|
type: ViewChild,
|
|
636
875
|
args: ['dt_columnDialog']
|
|
@@ -657,10 +896,10 @@ class ExportExcelService {
|
|
|
657
896
|
const seconds = String(now.getUTCSeconds()).padStart(2, '0');
|
|
658
897
|
return `_${year}${month}${day}_${hours}${minutes}${seconds}_UTC`;
|
|
659
898
|
}
|
|
660
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
661
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.
|
|
899
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExportExcelService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
900
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExportExcelService, providedIn: 'root' });
|
|
662
901
|
}
|
|
663
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExportExcelService, decorators: [{
|
|
664
903
|
type: Injectable,
|
|
665
904
|
args: [{
|
|
666
905
|
providedIn: 'root'
|
|
@@ -754,10 +993,10 @@ class ExportExcel {
|
|
|
754
993
|
closeModal() {
|
|
755
994
|
this.visibleChange.emit(false);
|
|
756
995
|
}
|
|
757
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
758
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
996
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExportExcel, deps: [{ token: ECSPrimengTableNotificationService }, { token: ExportExcelService }], target: i0.ɵɵFactoryTarget.Component });
|
|
997
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ExportExcel, isStandalone: true, selector: "ecs-export-excel", inputs: { visible: "visible", rowCheckboxSelectorActive: "rowCheckboxSelectorActive", excelReportTitle: "excelReportTitle", allowTitleUserEdit: "allowTitleUserEdit" }, outputs: { exportToExcel: "exportToExcel", visibleChange: "visibleChange" }, usesOnChanges: true, ngImport: i0, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"false\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Export data to Excel</span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: grid; grid-template-columns: 4fr 8fr; gap: 1rem; align-items: center;\">\r\n <div style=\"justify-self: end;\">\r\n Report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <input pInputText id=\"reportTitle\" [(ngModel)]=\"excelReportTitle\" autocomplete=\"off\" style=\"width: 100%;\" [disabled]=\"!allowTitleUserEdit\" maxlength=\"100\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n <i pTooltip=\"Activating this option will add the current '_{year}{month}{day}_{hours}{minutes}{seconds}_UTC' at the end of your filename\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n Include time in report filename\r\n </div>\r\n <div style=\"justify-self: stretch; width: 100%;\">\r\n <p-checkbox [binary]=\"true\" [(ngModel)]=\"includeTimeInTitle\"/>\r\n </div>\r\n \r\n <div style=\"justify-self: end;\">\r\n Export columns\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_exportColumns_selected\" [options]=\"option_exportColumns\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n @if(filterSelectorDisabled()){\r\n <i pTooltip=\"Sorts are active because you want to export selected rows following a filter criteria\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n Filters to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentFilters_selected\" [options]=\"option_applyCurrentFilters\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" [disabled]=\"filterSelectorDisabled()\"/>\r\n </div>\r\n\r\n <div style=\"justify-self: end;\">\r\n Sorts to apply\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_applyCurrentSorts_selected\" [options]=\"option_applyCurrentSorts\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\"/>\r\n </div>\r\n\r\n @if(rowCheckboxSelectorActive){\r\n <div style=\"justify-self: end;\">\r\n Selected rows\r\n </div>\r\n <div style=\"justify-self: start;\">\r\n <p-selectButton [(ngModel)]=\"option_selectedRowsExport_selected\" [options]=\"option_selectedRowsExport\" optionLabel=\"label\" optionValue=\"value\" allowEmpty=\"false\" (onChange)=\"onChangeExportRows($event)\"/>\r\n </div>\r\n }\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"closeModal()\" label=\"Cancel export\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"/>\r\n <p-button (click)=\"getExcelReport()\" label=\"Export\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"/>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectButton, selector: "p-selectButton, p-selectbutton, p-select-button", inputs: ["options", "optionLabel", "optionValue", "optionDisabled", "unselectable", "tabindex", "multiple", "allowEmpty", "style", "styleClass", "ariaLabelledBy", "size", "disabled", "dataKey", "autofocus"], outputs: ["onOptionClick", "onChange"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i9.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] });
|
|
759
998
|
}
|
|
760
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
999
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ExportExcel, decorators: [{
|
|
761
1000
|
type: Component,
|
|
762
1001
|
args: [{ selector: 'ecs-export-excel', imports: [
|
|
763
1002
|
DialogModule,
|
|
@@ -792,6 +1031,7 @@ class ViewsManagement {
|
|
|
792
1031
|
onViewSelect = new EventEmitter();
|
|
793
1032
|
onViewDelete = new EventEmitter();
|
|
794
1033
|
onViewUpdateData = new EventEmitter();
|
|
1034
|
+
onViewUpdateActiveStartup = new EventEmitter();
|
|
795
1035
|
onViewEditAlias = new EventEmitter();
|
|
796
1036
|
onViewCreate = new EventEmitter();
|
|
797
1037
|
visibleChange = new EventEmitter();
|
|
@@ -807,6 +1047,9 @@ class ViewsManagement {
|
|
|
807
1047
|
updateView(viewAlias) {
|
|
808
1048
|
this.onViewUpdateData.emit(viewAlias);
|
|
809
1049
|
}
|
|
1050
|
+
updateViewActiveStartup(viewAlias) {
|
|
1051
|
+
this.onViewUpdateActiveStartup.emit(viewAlias);
|
|
1052
|
+
}
|
|
810
1053
|
createView(viewAlias) {
|
|
811
1054
|
const exists = this.tableViews_menuItems.some(item => item.label === viewAlias);
|
|
812
1055
|
if (exists) {
|
|
@@ -838,10 +1081,10 @@ class ViewsManagement {
|
|
|
838
1081
|
this.createView(this.newViewAlias);
|
|
839
1082
|
}
|
|
840
1083
|
}
|
|
841
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
842
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: ViewsManagement, isStandalone: true, selector: "ecs-views-management", inputs: { visible: "visible", tableViews_menuItems: "tableViews_menuItems" }, outputs: { onViewSelect: "onViewSelect", onViewDelete: "onViewDelete", onViewUpdateData: "onViewUpdateData", onViewEditAlias: "onViewEditAlias", onViewCreate: "onViewCreate", visibleChange: "visibleChange" }, ngImport: i0, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"true\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\" (onHide)=\"closeModal()\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Table views</span>\r\n </div>\r\n </ng-template>\r\n <div class=\"p-4 pt-0\">\r\n <p-table #dt_viewsDialog [value]=\"tableViews_menuItems\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: flex-end; align-items: center; width: 100%;\">\r\n <p-button icon=\"pi pi-plus\" label=\"New view\" severity=\"success\" (click)=\"showViewEditor()\" pTooltip=\"New view\" tooltipPosition=\"top\" [showDelay]=\"700\"/>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th style=\"text-align: center;\">View name</th>\r\n <th style=\"text-align: center; max-width: 300px; min-width: 300px; width: 300px;\">Actions</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"max-width: 300px; min-width: 300px; width: 300px; display: flex; justify-content: center; align-items: center; height: 100%;\">\r\n <button pButton icon=\"pi pi-upload\" (click)=\"loadView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Restore\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-save\" (click)=\"updateView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Save\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-pencil\" (click)=\"showViewEditor(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Edit\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"deleteView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Delete\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px;\"></button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no views</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{tableViews_menuItems ? tableViews_menuItems.length : 0}} views\r\n </div>\r\n </div>\r\n</p-dialog>\r\n\r\n<!--TABLE VIEW SAVE-->\r\n<p-dialog [(visible)]=\"viewEditorShow\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'max-width': '60vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <span class=\"white-space-nowrap\"><b>{{ editingViewAlias !== '' ? 'UPDATE VIEW' : 'CREATE NEW VIEW' }}</b></span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: flex; flex-direction: column; gap: 8px;\">\r\n <label for=\"newtableviewname\"><strong>View alias<span style=\"color: red;\">*</span></strong></label>\r\n <input \r\n pInputText \r\n id=\"newtableviewname\" \r\n aria-describedby=\"newtableviewname-help\" \r\n style=\"width: 400px;\"\r\n maxlength=\"30\"\r\n [(ngModel)]=\"newViewAlias\"/>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"viewEditorShow = false\" label=\"Cancel\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"editingViewAlias !== '' ? 'Update' : 'Create'\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }] });
|
|
1084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ViewsManagement, deps: [{ token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1085
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.15", 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</span>\r\n </div>\r\n </ng-template>\r\n <div class=\"p-4 pt-0\">\r\n <p-table #dt_viewsDialog [value]=\"tableViews_menuItems\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: flex-end; align-items: center; width: 100%;\">\r\n <p-button icon=\"pi pi-plus\" label=\"New view\" (click)=\"showViewEditor()\" pTooltip=\"New view\" tooltipPosition=\"top\" [showDelay]=\"700\"/>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th style=\"text-align: center;\">View name</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">Load on startup</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">Actions</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">\r\n <p-checkbox [(ngModel)]=\"rowData.lastActive\" [binary]=\"true\" (onChange)=\"updateViewActiveStartup(rowData.label)\"/>\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\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-save\" (click)=\"updateView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Save\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-pencil\" (click)=\"showViewEditor(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Edit\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"deleteView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Delete\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px;\"></button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no views</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{tableViews_menuItems ? tableViews_menuItems.length : 0}} views\r\n </div>\r\n </div>\r\n</p-dialog>\r\n\r\n<!--TABLE VIEW SAVE-->\r\n<p-dialog [(visible)]=\"viewEditorShow\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'max-width': '60vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <span class=\"white-space-nowrap\"><b>{{ editingViewAlias !== '' ? 'UPDATE VIEW' : 'CREATE NEW VIEW' }}</b></span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: flex; flex-direction: column; gap: 8px;\">\r\n <label for=\"newtableviewname\"><strong>View alias<span style=\"color: red;\">*</span></strong></label>\r\n <input \r\n pInputText \r\n id=\"newtableviewname\" \r\n aria-describedby=\"newtableviewname-help\" \r\n style=\"width: 400px;\"\r\n maxlength=\"30\"\r\n [(ngModel)]=\"newViewAlias\"/>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"viewEditorShow = false\" label=\"Cancel\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"editingViewAlias !== '' ? 'Update' : 'Create'\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>", dependencies: [{ kind: "ngmodule", type: DialogModule }, { kind: "component", type: i1$2.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "positionLeft", "positionTop", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "responsive", "appendTo", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "breakpoint", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i5.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i9.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }] });
|
|
843
1086
|
}
|
|
844
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1087
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ViewsManagement, decorators: [{
|
|
845
1088
|
type: Component,
|
|
846
1089
|
args: [{ selector: 'ecs-views-management', imports: [
|
|
847
1090
|
DialogModule,
|
|
@@ -850,8 +1093,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
850
1093
|
CommonModule,
|
|
851
1094
|
FormsModule,
|
|
852
1095
|
TooltipModule,
|
|
853
|
-
InputTextModule
|
|
854
|
-
|
|
1096
|
+
InputTextModule,
|
|
1097
|
+
CheckboxModule
|
|
1098
|
+
], standalone: true, template: "<p-dialog [(visible)]=\"visible\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\"\r\n [closable]=\"true\" [closeOnEscape]=\"false\" [maximizable]=\"false\" [style]=\"{'min-width': '70vw', 'max-width': '70vw'}\" (onHide)=\"closeModal()\">\r\n <ng-template pTemplate=\"header\">\r\n <div>\r\n <span class=\"p-dialog-title\">Table views</span>\r\n </div>\r\n </ng-template>\r\n <div class=\"p-4 pt-0\">\r\n <p-table #dt_viewsDialog [value]=\"tableViews_menuItems\" [scrollable]=\"true\" size=\"small\" showGridlines stripedRows scrollHeight=\"400px\" [tableStyle]=\"{'min-width': '25rem'}\">\r\n <ng-template #caption>\r\n <div style=\"display: flex; justify-content: flex-end; align-items: center; width: 100%;\">\r\n <p-button icon=\"pi pi-plus\" label=\"New view\" (click)=\"showViewEditor()\" pTooltip=\"New view\" tooltipPosition=\"top\" [showDelay]=\"700\"/>\r\n </div>\r\n </ng-template>\r\n <ng-template #header>\r\n <tr>\r\n <th style=\"text-align: center;\">View name</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">Load on startup</th>\r\n <th style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">Actions</th>\r\n </tr>\r\n </ng-template>\r\n <ng-template #body let-rowData>\r\n <tr>\r\n <td>\r\n {{rowData.label}}\r\n </td>\r\n <td style=\"text-align: center; max-width: 220px; min-width: 220px; width: 220px;\">\r\n <p-checkbox [(ngModel)]=\"rowData.lastActive\" [binary]=\"true\" (onChange)=\"updateViewActiveStartup(rowData.label)\"/>\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\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-save\" (click)=\"updateView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Save\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-pencil\" (click)=\"showViewEditor(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Edit\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px; margin-right: 10px;\"></button>\r\n <button pButton icon=\"pi pi-trash\" (click)=\"deleteView(rowData.label);\" [showDelay]=\"700\" pTooltip=\"Delete\" tooltipPosition=\"top\" size=\"small\" class=\"p-button-sm\" style=\"height: 28px;\"></button>\r\n </td>\r\n </tr>\r\n </ng-template>\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">There are no views</td>\r\n </tr>\r\n </ng-template>\r\n </p-table>\r\n <div style=\"display: flex; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 10px;\">\r\n Showing {{tableViews_menuItems ? tableViews_menuItems.length : 0}} views\r\n </div>\r\n </div>\r\n</p-dialog>\r\n\r\n<!--TABLE VIEW SAVE-->\r\n<p-dialog [(visible)]=\"viewEditorShow\" [modal]=\"true\" [draggable]=\"false\" [resizable]=\"false\" [closeOnEscape]=\"false\" [closable]=\"false\" [maximizable]=\"false\" [style]=\"{'max-width': '60vw'}\">\r\n <ng-template pTemplate=\"header\">\r\n <div class=\"inline-flex align-items-center justify-content-center gap-2\">\r\n <span class=\"white-space-nowrap\"><b>{{ editingViewAlias !== '' ? 'UPDATE VIEW' : 'CREATE NEW VIEW' }}</b></span>\r\n </div>\r\n </ng-template>\r\n <div style=\"display: flex; flex-direction: column; gap: 8px;\">\r\n <label for=\"newtableviewname\"><strong>View alias<span style=\"color: red;\">*</span></strong></label>\r\n <input \r\n pInputText \r\n id=\"newtableviewname\" \r\n aria-describedby=\"newtableviewname-help\" \r\n style=\"width: 400px;\"\r\n maxlength=\"30\"\r\n [(ngModel)]=\"newViewAlias\"/>\r\n </div>\r\n <ng-template pTemplate=\"footer\" style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <p-button (click)=\"viewEditorShow = false\" label=\"Cancel\" severity=\"danger\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n <p-button (click)=\"createOrUpdateTableView()\" [label]=\"editingViewAlias !== '' ? 'Update' : 'Create'\" severity=\"success\" [style]=\"{'margin-top': '20px'}\"></p-button>\r\n </ng-template>\r\n</p-dialog>" }]
|
|
855
1099
|
}], ctorParameters: () => [{ type: ECSPrimengTableNotificationService }], propDecorators: { visible: [{
|
|
856
1100
|
type: Input
|
|
857
1101
|
}], tableViews_menuItems: [{
|
|
@@ -862,6 +1106,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
862
1106
|
type: Output
|
|
863
1107
|
}], onViewUpdateData: [{
|
|
864
1108
|
type: Output
|
|
1109
|
+
}], onViewUpdateActiveStartup: [{
|
|
1110
|
+
type: Output
|
|
865
1111
|
}], onViewEditAlias: [{
|
|
866
1112
|
type: Output
|
|
867
1113
|
}], onViewCreate: [{
|
|
@@ -873,51 +1119,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
873
1119
|
class ECSPrimengTable {
|
|
874
1120
|
tableService;
|
|
875
1121
|
notification;
|
|
876
|
-
resizeObserver;
|
|
877
1122
|
constructor(tableService, notification) {
|
|
878
1123
|
this.tableService = tableService;
|
|
879
1124
|
this.notification = notification;
|
|
880
1125
|
}
|
|
881
|
-
|
|
882
|
-
data = []; // The array of data to be displayed
|
|
883
|
-
columnsToShow = []; // The combination of the non-selectable columns + selected columns that must be shown
|
|
884
|
-
computeScrollHeight = true; // If true, the table will try not to grow more than the total height of the window vertically
|
|
885
|
-
globalSearchEnabled = true; // Used to enable or disable the global search (by default enabled)
|
|
886
|
-
globalSearchMaxLength = 50; // The maximun number of characters that can be input in the global filter
|
|
887
|
-
globalSearchPlaceholder = "Search keyword"; // The placeholder text to show if global search is enabled
|
|
888
|
-
columnEditorEnabled = true; // If the user can modify the columns thorugh the column editor
|
|
889
|
-
urlColumnsSource; // The source URL to get data from columns
|
|
890
|
-
urlDataSource; // The URL to fetch data from
|
|
891
|
-
urlExcelReport = null;
|
|
892
|
-
predifinedFiltersCollection = {}; // Contains a collection of the values that need to be shown for predifined column filters
|
|
893
|
-
predifinedFiltersNoSelectionPlaceholder = "Any value"; // A text to be displayed in the dropdown if no value has been selected in a column that uses predifined filters
|
|
894
|
-
predifinedFiltersCollectionSelectedValuesText = "items selected"; // A text to display in the predifined filters dropdown footer indicating the number of items that have been selected
|
|
895
|
-
rowActionButtons = []; // A list that contains all buttons that will appear in the actions column
|
|
896
|
-
headerActionButtons = []; // A list that contains all buttons that will appear in the right side of the header of the table
|
|
897
|
-
copyCellDataToClipboardTimeSecs = 0.5; // The amount of time since mouse down in a cell for its content to be copied to the clipboard. If you want to disable this functionality, put it to a value less than or equal to 0.
|
|
898
|
-
actionsColumnAligmentRight = true; // If actions column is put at the right end of the table (or false if its at the left)
|
|
899
|
-
actionsColumnWidth = 150; // The amount in pixels for the size of the actions column
|
|
900
|
-
actionsColumnFrozen = true; // If the actions column should be frozen
|
|
901
|
-
rowSelectorColumnActive = false; // By default false. If true, a column will be shown to the user that includes a checkbox per row. This selection and filtering that the user can do is all managed by the table component. You can fetch the selected rows through the output selectedRowsCheckbox.
|
|
902
|
-
rowSelectorColumName = "Selected"; // The title of the row selection column. By default is "Selected"
|
|
903
|
-
rowSelectorColumnAligmentRight = true; // By default true. If true, the row selector column is put at the right end of the table (or false if its at the left).
|
|
904
|
-
rowSelectorColumnWidth = 150; // The amount in pixels for the size of the selector column
|
|
905
|
-
rowSelectorColumnFrozen = true; // By default true. If true, the row selector column will be frozen.
|
|
906
|
-
actionsColumnResizable = false; // If the action column can be resized by the user
|
|
907
|
-
actionColumnName = "Actions"; // The column name were the action buttons will appear
|
|
908
|
-
rowselectorColumnResizable = false;
|
|
909
|
-
noDataFoundText = "No data found for the current filter criteria."; // The text to be shown when no data has been returned
|
|
910
|
-
showClearSortAndFilters = true;
|
|
911
|
-
excelReportTitleDefault = "Report";
|
|
912
|
-
excelReportTitleAllowUserEdit = false;
|
|
913
|
-
tableViewSaveAs = TableViewSaveMode.noone; // How the table view will be saved
|
|
914
|
-
tableViewSaveKey = ""; // The key used to save the table views
|
|
915
|
-
viewsGetSourceURL = "";
|
|
916
|
-
viewsSaveSourceURL = "";
|
|
917
|
-
maxTableViews = 10; // The maximun number of views that can be saved
|
|
1126
|
+
tableOptions = DEFAULT_TABLE_OPTIONS;
|
|
918
1127
|
onRowCheckboxChange = new EventEmitter(); // Emitter that returns the column selected and if it was selected or unselected
|
|
919
1128
|
onRowSelect = new EventEmitter;
|
|
920
1129
|
onRowUnselect = new EventEmitter;
|
|
1130
|
+
onDataEndUpdate = new EventEmitter();
|
|
921
1131
|
viewsModalShow = false;
|
|
922
1132
|
tableViewCurrentSelectedAlias = null;
|
|
923
1133
|
tableViewsFirstFetchDone = false;
|
|
@@ -927,7 +1137,6 @@ class ECSPrimengTable {
|
|
|
927
1137
|
selectedRowsCheckbox = []; // An array to keep all the selected rows
|
|
928
1138
|
dt; // Get the reference to the object table
|
|
929
1139
|
showRefreshData = true;
|
|
930
|
-
scrollHeight = "0px"; // Used to get the table height
|
|
931
1140
|
globalSearchText = null; // The text used by the global search
|
|
932
1141
|
tableViewsList = [];
|
|
933
1142
|
tableViews_menuItems = [];
|
|
@@ -951,10 +1160,13 @@ class ECSPrimengTable {
|
|
|
951
1160
|
columnsSelected = [];
|
|
952
1161
|
columnModalData = [];
|
|
953
1162
|
filteredColumnData = [];
|
|
954
|
-
|
|
1163
|
+
initialColumnWidths;
|
|
1164
|
+
initialTableWidth;
|
|
1165
|
+
predefinedFiltersSelectedValuesCollection = {}; // Contains a collection of the predefined column filters selection (possible values come from 'predefinedFiltersCollection')
|
|
955
1166
|
copyCellDataTimer; // A timer that handles the amount of time left to copy the cell data to the clipboard
|
|
956
1167
|
tableLazyLoadEventInformation = {}; // Data of the last lazy load event of the table
|
|
957
1168
|
initialConfigurationFetched = false;
|
|
1169
|
+
maxViews = 0;
|
|
958
1170
|
ngOnInit() {
|
|
959
1171
|
this.fetchTableConfiguration();
|
|
960
1172
|
}
|
|
@@ -962,48 +1174,37 @@ class ECSPrimengTable {
|
|
|
962
1174
|
headerContainer;
|
|
963
1175
|
paginatorContainer;
|
|
964
1176
|
ngAfterViewInit() {
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
this.resizeObserver.observe(this.tableContainer.nativeElement);
|
|
970
|
-
window.addEventListener('resize', this.onWindowResize);
|
|
971
|
-
this.calculateScrollHeight();
|
|
972
|
-
}
|
|
1177
|
+
this.calculateScrollHeight();
|
|
1178
|
+
}
|
|
1179
|
+
onResize() {
|
|
1180
|
+
this.calculateScrollHeight();
|
|
973
1181
|
}
|
|
974
|
-
onWindowResize = () => {
|
|
975
|
-
clearTimeout(this._resizeTimeout);
|
|
976
|
-
this._resizeTimeout = setTimeout(() => {
|
|
977
|
-
this.calculateScrollHeight();
|
|
978
|
-
}, 100);
|
|
979
|
-
};
|
|
980
1182
|
calculateScrollHeight() {
|
|
981
|
-
if (this.
|
|
1183
|
+
if (this.tableOptions.verticalScroll?.cssFormula) {
|
|
1184
|
+
return;
|
|
1185
|
+
}
|
|
1186
|
+
if (this.tableOptions.verticalScroll?.fitToContainer && this.tableContainer && this.paginatorContainer && this.headerContainer) {
|
|
982
1187
|
const containerRect = this.tableContainer.nativeElement.getBoundingClientRect();
|
|
983
1188
|
const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight;
|
|
984
1189
|
const headerHeight = this.headerContainer.nativeElement.offsetHeight;
|
|
985
1190
|
const viewportHeight = window.innerHeight;
|
|
986
1191
|
const topOffset = containerRect.top + window.scrollY;
|
|
987
|
-
this.
|
|
988
|
-
//const containerHeight = this.tableContainer.nativeElement.offsetHeight;
|
|
989
|
-
//const headerHeight = this.headerContainer.nativeElement.offsetHeight;
|
|
990
|
-
//const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight || 50; // fallback
|
|
991
|
-
//this.scrollHeight = `${containerHeight - headerHeight - paginatorHeight}px`;
|
|
992
|
-
//console.log(this.scrollHeight)
|
|
1192
|
+
this.tableOptions.verticalScroll.height = (viewportHeight - topOffset - paginatorHeight - headerHeight) - 60;
|
|
993
1193
|
}
|
|
994
1194
|
}
|
|
995
|
-
|
|
996
|
-
this.
|
|
997
|
-
|
|
1195
|
+
get scrollHeightValue() {
|
|
1196
|
+
if (this.tableOptions.verticalScroll?.cssFormula) {
|
|
1197
|
+
return this.tableOptions.verticalScroll.cssFormula;
|
|
1198
|
+
}
|
|
1199
|
+
const height = this.tableOptions.verticalScroll?.height;
|
|
1200
|
+
return height && height > 0 ? `${height}px` : '';
|
|
998
1201
|
}
|
|
999
1202
|
/**
|
|
1000
|
-
* Used to update the data of a table externally outside the component.
|
|
1203
|
+
* Used to update the data of a table externally outside the component.
|
|
1001
1204
|
*
|
|
1002
|
-
* @param {(optionalData?: any) => void} [continueAction] - Optional action to execute after data retrieval if it succeeded.
|
|
1003
|
-
* @param {boolean} [uponContinueActionEndModalHttp=false] - Optional flag to set the loading indicator to inactive after data retrieval.
|
|
1004
1205
|
*/
|
|
1005
|
-
updateData(
|
|
1006
|
-
this.isActive = true; // Indicate that the table is now enabled to perform actions
|
|
1206
|
+
updateData() {
|
|
1207
|
+
this.tableOptions.isActive = true; // Indicate that the table is now enabled to perform actions
|
|
1007
1208
|
if (!this.initialConfigurationFetched) {
|
|
1008
1209
|
this.fetchTableConfiguration();
|
|
1009
1210
|
}
|
|
@@ -1011,44 +1212,80 @@ class ECSPrimengTable {
|
|
|
1011
1212
|
this.fetchTableData(this.tableLazyLoadEventInformation);
|
|
1012
1213
|
}
|
|
1013
1214
|
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1215
|
+
canFetchData() {
|
|
1216
|
+
return !!this.tableOptions.isActive
|
|
1217
|
+
&& !!this.tableOptions.urlTableConfiguration?.trim()
|
|
1218
|
+
&& !!this.tableOptions.urlTableData?.trim();
|
|
1219
|
+
}
|
|
1220
|
+
fetchTableConfiguration(resetTableView = false) {
|
|
1221
|
+
if (!this.canFetchData()) {
|
|
1016
1222
|
return;
|
|
1017
1223
|
}
|
|
1018
|
-
this.tableService.fetchTableConfiguration(this.
|
|
1224
|
+
this.tableService.fetchTableConfiguration(this.tableOptions.urlTableConfiguration).subscribe({
|
|
1019
1225
|
next: (response) => {
|
|
1020
|
-
this.handleTableConfigurationResponse(response.body);
|
|
1021
|
-
this.fetchTableViews();
|
|
1226
|
+
this.handleTableConfigurationResponse(response.body, resetTableView);
|
|
1022
1227
|
},
|
|
1023
1228
|
error: (err) => this.tableService.handleTableError(err, 'Columns Error')
|
|
1024
1229
|
});
|
|
1025
1230
|
}
|
|
1026
|
-
handleTableConfigurationResponse(body) {
|
|
1231
|
+
handleTableConfigurationResponse(body, resetTableView = false) {
|
|
1027
1232
|
this.allowedRowsPerPage = body.allowedItemsPerPage; // Update the number of rows allowed per page
|
|
1028
1233
|
this.currentRowsPerPage = Math.min(...this.allowedRowsPerPage); // Update the current rows per page to use the minimum value of allowed rows per page by default
|
|
1029
1234
|
this.columns = body.columnsInfo; // Update columns with fetched data
|
|
1030
1235
|
this.columnsCantBeHidden = this.columns.filter((col) => !col.canBeHidden); // Filter columns that cannot be hidden
|
|
1031
1236
|
this.columnsSelected = this.columns.filter((col) => !col.startHidden && col.canBeHidden); // Selected columns that are not hidden by default
|
|
1032
|
-
this.
|
|
1237
|
+
this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
|
|
1033
1238
|
this.dateFormat = body.dateFormat;
|
|
1034
1239
|
this.dateTimezone = body.dateTimezone;
|
|
1035
1240
|
this.dateCulture = body.dateCulture;
|
|
1036
1241
|
this.currentPage = 0;
|
|
1037
1242
|
this.initialConfigurationFetched = true;
|
|
1243
|
+
this.maxViews = body.maxViews;
|
|
1244
|
+
if (resetTableView) {
|
|
1245
|
+
this.tableOptions.isActive = false;
|
|
1246
|
+
this.clearFilters(this.dt, true);
|
|
1247
|
+
this.clearSorts(this.dt, true);
|
|
1248
|
+
this.dt.tableWidthState = this.initialTableWidth;
|
|
1249
|
+
this.dt.columnWidthsState = this.initialColumnWidths;
|
|
1250
|
+
this.dt.restoreColumnWidths();
|
|
1251
|
+
this.tableLazyLoadEventInformation.multiSortMeta = [];
|
|
1252
|
+
this.tableOptions.isActive = true;
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
setTimeout(() => {
|
|
1256
|
+
this.initialColumnWidths = this.tableService.computeColumnWidths(this.dt);
|
|
1257
|
+
this.initialTableWidth = this.tableService.computeTableWidth(this.dt);
|
|
1258
|
+
}, 0);
|
|
1259
|
+
this.fetchTableViews();
|
|
1260
|
+
}
|
|
1038
1261
|
}
|
|
1039
1262
|
refreshData(event) {
|
|
1040
1263
|
this.fetchTableData(this.tableLazyLoadEventInformation);
|
|
1041
1264
|
}
|
|
1042
1265
|
tableViewsEnabled() {
|
|
1043
|
-
|
|
1044
|
-
|
|
1266
|
+
const views = this.tableOptions.views;
|
|
1267
|
+
if (views?.saveMode === TableViewSaveMode.None) { // saveMode must be different from noone
|
|
1268
|
+
return false;
|
|
1269
|
+
}
|
|
1270
|
+
if (!views?.saveKey?.trim()) { // saveKey must exist and must not be empty after trim
|
|
1271
|
+
return false;
|
|
1272
|
+
}
|
|
1273
|
+
if (this.maxViews <= 0) { // maxViews must be greater than 0
|
|
1274
|
+
return false;
|
|
1275
|
+
}
|
|
1276
|
+
if (views?.saveMode === TableViewSaveMode.DatabaseStorage) { // If saveMode is database, urlGet and urlSave must exist and must not be empty after trim
|
|
1277
|
+
if (!views?.urlGet?.trim() || !views?.urlSave?.trim()) {
|
|
1278
|
+
return false;
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
return true; // All checks passed, views are enabled
|
|
1045
1282
|
}
|
|
1046
1283
|
fetchTableViews() {
|
|
1047
1284
|
if (!this.tableViewsEnabled()) {
|
|
1048
1285
|
this.fetchTableData(this.tableLazyLoadEventInformation);
|
|
1049
1286
|
return;
|
|
1050
1287
|
}
|
|
1051
|
-
const tableViews = this.tableService.fetchTableViews(this.
|
|
1288
|
+
const tableViews = this.tableService.fetchTableViews(this.tableOptions.views.saveMode, this.tableOptions.views.urlGet, this.tableOptions.views.saveKey);
|
|
1052
1289
|
if (tableViews instanceof Observable) {
|
|
1053
1290
|
tableViews.subscribe({
|
|
1054
1291
|
next: (response) => {
|
|
@@ -1091,15 +1328,15 @@ class ECSPrimengTable {
|
|
|
1091
1328
|
.map(data => this.columns.find((col) => col.field === data.field))
|
|
1092
1329
|
.filter((col) => col !== undefined)
|
|
1093
1330
|
.filter(col => !this.columnsCantBeHidden.includes(col));
|
|
1094
|
-
this.
|
|
1331
|
+
this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(this.columnsCantBeHidden.concat(this.columnsSelected));
|
|
1095
1332
|
this.currentPage = viewData.currentPage;
|
|
1096
1333
|
this.currentRowsPerPage = viewData.currentRowsPerPage;
|
|
1097
1334
|
this.globalSearchText = viewData.globalSearchText;
|
|
1098
1335
|
this.tableLazyLoadEventInformation.multiSortMeta = [...(viewData.multiSortMeta ?? [])];
|
|
1099
1336
|
this.dt.multiSortMeta = [...(viewData.multiSortMeta ?? [])];
|
|
1100
|
-
this.isActive = false;
|
|
1337
|
+
this.tableOptions.isActive = false;
|
|
1101
1338
|
this.dt.sortMultiple();
|
|
1102
|
-
this.isActive = true;
|
|
1339
|
+
this.tableOptions.isActive = true;
|
|
1103
1340
|
this.tableLazyLoadEventInformation.filters = { ...viewData.filters };
|
|
1104
1341
|
this.dt.filters = { ...viewData.filters };
|
|
1105
1342
|
this.dt.tableWidthState = viewData.tableWidth;
|
|
@@ -1110,6 +1347,10 @@ class ECSPrimengTable {
|
|
|
1110
1347
|
this.fetchTableData(this.tableLazyLoadEventInformation);
|
|
1111
1348
|
}
|
|
1112
1349
|
viewCreate(viewAlias) {
|
|
1350
|
+
if (this.tableViewsList.length >= this.maxViews) {
|
|
1351
|
+
this.notification.showToast("error", "NO MORE VIEWS ALLOWED", "You have created the maximum number of allowed views for this table");
|
|
1352
|
+
return;
|
|
1353
|
+
}
|
|
1113
1354
|
let viewData = this.tableService.viewGenerateData(this.dt, this.globalSearchText, this.currentPage, this.currentRowsPerPage, this.modifyFiltersWithoutGlobalAndSelectedRows.bind(this));
|
|
1114
1355
|
let newView = {
|
|
1115
1356
|
lastActive: false,
|
|
@@ -1119,47 +1360,69 @@ class ECSPrimengTable {
|
|
|
1119
1360
|
this.tableViewsList.push(newView);
|
|
1120
1361
|
this.tableService.sortViews(this.tableViewsList);
|
|
1121
1362
|
this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
|
|
1363
|
+
this.tableViewCurrentSelectedAlias = viewAlias;
|
|
1122
1364
|
this.viewsSave(0);
|
|
1123
1365
|
}
|
|
1124
1366
|
viewDelete(viewAlias) {
|
|
1125
1367
|
const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
|
|
1126
1368
|
if (index === -1) {
|
|
1127
1369
|
this.notification.showToast("error", "Table view delete failed", `The table view could not be deleted since it was not found.`);
|
|
1370
|
+
return;
|
|
1128
1371
|
}
|
|
1129
1372
|
this.tableViewsList.splice(index, 1);
|
|
1130
1373
|
this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
|
|
1374
|
+
if (this.tableViewCurrentSelectedAlias === viewAlias) {
|
|
1375
|
+
this.tableViewCurrentSelectedAlias = null;
|
|
1376
|
+
}
|
|
1131
1377
|
this.viewsSave(3);
|
|
1132
1378
|
}
|
|
1133
1379
|
viewEditAlias(event) {
|
|
1134
1380
|
const index = this.tableViewsList.findIndex(v => v.viewAlias === event.viewAliasOld);
|
|
1135
1381
|
if (index === -1) {
|
|
1136
1382
|
this.notification.showToast("error", "Table view alias change failed", `The table view alias could not be changed since it was not found.`);
|
|
1383
|
+
return;
|
|
1137
1384
|
}
|
|
1138
1385
|
this.tableViewsList[index].viewAlias = event.viewAliasNew;
|
|
1139
1386
|
this.tableService.sortViews(this.tableViewsList);
|
|
1140
1387
|
this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
|
|
1388
|
+
if (this.tableViewCurrentSelectedAlias === event.viewAliasOld) {
|
|
1389
|
+
this.tableViewCurrentSelectedAlias = event.viewAliasNew;
|
|
1390
|
+
}
|
|
1141
1391
|
this.viewsSave(2);
|
|
1142
1392
|
}
|
|
1143
1393
|
viewUpdateData(viewAlias) {
|
|
1144
1394
|
const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
|
|
1145
1395
|
if (index === -1) {
|
|
1146
1396
|
this.notification.showToast("error", "Table view not found", `The table view to update data from was not found.`);
|
|
1397
|
+
return;
|
|
1147
1398
|
}
|
|
1148
1399
|
let viewData = this.tableService.viewGenerateData(this.dt, this.globalSearchText, this.currentPage, this.currentRowsPerPage, this.modifyFiltersWithoutGlobalAndSelectedRows.bind(this));
|
|
1149
1400
|
this.tableViewsList[index].viewData = viewData;
|
|
1150
1401
|
this.viewsSave(1);
|
|
1151
1402
|
}
|
|
1403
|
+
viewUpdateActiveStartup(viewAlias) {
|
|
1404
|
+
const index = this.tableViewsList.findIndex(v => v.viewAlias === viewAlias);
|
|
1405
|
+
if (index === -1) {
|
|
1406
|
+
this.notification.showToast("error", "Table view not found", `The table view to update data from was not found.`);
|
|
1407
|
+
return;
|
|
1408
|
+
}
|
|
1409
|
+
let newStatus = !this.tableViewsList[index].lastActive;
|
|
1410
|
+
this.tableViewsList.forEach(v => v.lastActive = false);
|
|
1411
|
+
this.tableViewsList[index].lastActive = newStatus;
|
|
1412
|
+
this.tableViews_menuItems = [...this.tableService.updateViewsMenuItems(this.tableViewsList)];
|
|
1413
|
+
this.viewsSave(4);
|
|
1414
|
+
}
|
|
1152
1415
|
viewsSave(endMessage) {
|
|
1153
1416
|
let tableView = JSON.stringify(this.tableViewsList);
|
|
1154
|
-
switch (this.
|
|
1155
|
-
case TableViewSaveMode.
|
|
1156
|
-
sessionStorage.setItem(this.
|
|
1417
|
+
switch (this.tableOptions.views.saveMode) {
|
|
1418
|
+
case TableViewSaveMode.SessionStorage:
|
|
1419
|
+
sessionStorage.setItem(this.tableOptions.views.saveKey, tableView);
|
|
1157
1420
|
break;
|
|
1158
|
-
case TableViewSaveMode.
|
|
1159
|
-
localStorage.setItem(this.
|
|
1421
|
+
case TableViewSaveMode.LocalStorage:
|
|
1422
|
+
localStorage.setItem(this.tableOptions.views.saveKey, tableView);
|
|
1160
1423
|
break;
|
|
1161
|
-
case TableViewSaveMode.
|
|
1162
|
-
const saveObsv = this.tableService.viewsSaveToDatabase(this.tableViewsList, this.
|
|
1424
|
+
case TableViewSaveMode.DatabaseStorage:
|
|
1425
|
+
const saveObsv = this.tableService.viewsSaveToDatabase(this.tableViewsList, this.tableOptions.views.urlSave, this.tableOptions.views.saveKey);
|
|
1163
1426
|
saveObsv.subscribe({
|
|
1164
1427
|
next: (response) => {
|
|
1165
1428
|
this.viewsSaveEnd(endMessage);
|
|
@@ -1188,10 +1451,13 @@ class ECSPrimengTable {
|
|
|
1188
1451
|
case 3: // DELETE VIEW
|
|
1189
1452
|
this.notification.showToast("info", "Table view delete", `The table view was deleted.`);
|
|
1190
1453
|
break;
|
|
1454
|
+
case 4: // DELETE VIEW
|
|
1455
|
+
this.notification.showToast("info", "Table view active on startup", `Changed the view that will be active on startup.`);
|
|
1456
|
+
break;
|
|
1191
1457
|
}
|
|
1192
1458
|
}
|
|
1193
1459
|
fetchTableData(event) {
|
|
1194
|
-
if (!this.
|
|
1460
|
+
if (!this.canFetchData()) {
|
|
1195
1461
|
return;
|
|
1196
1462
|
}
|
|
1197
1463
|
if (!this.initialConfigurationFetched) {
|
|
@@ -1212,12 +1478,16 @@ class ECSPrimengTable {
|
|
|
1212
1478
|
sort: this.tableLazyLoadEventInformation.multiSortMeta, // Set the sorting information
|
|
1213
1479
|
filter: filtersWithoutGlobalAndSelectedRows, // Set the filters excluding the global filter
|
|
1214
1480
|
globalFilter: this.globalSearchText, // Set the global filter text
|
|
1215
|
-
columns: this.
|
|
1481
|
+
columns: this.tableOptions.columns.shown.map(col => col.field), // Set the columns to show
|
|
1216
1482
|
dateFormat: this.dateFormat,
|
|
1217
1483
|
dateTimezone: this.dateTimezone,
|
|
1218
1484
|
dateCulture: this.dateCulture
|
|
1219
1485
|
};
|
|
1220
|
-
this.tableService.fetchTableData(this.
|
|
1486
|
+
this.tableService.fetchTableData(this.tableOptions.urlTableData, requestData)
|
|
1487
|
+
.pipe(finalize(() => {
|
|
1488
|
+
this.onDataEndUpdate.emit(); // This is always executed after data update.
|
|
1489
|
+
}))
|
|
1490
|
+
.subscribe({
|
|
1221
1491
|
next: (response) => this.handleTableDataResponse(response.body),
|
|
1222
1492
|
error: (err) => this.tableService.handleTableError(err, 'Columns Error')
|
|
1223
1493
|
});
|
|
@@ -1233,6 +1503,10 @@ class ECSPrimengTable {
|
|
|
1233
1503
|
this.selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption);
|
|
1234
1504
|
return filtersWithoutGlobalAndSelectedRows; // Return the filters without global array
|
|
1235
1505
|
}
|
|
1506
|
+
resetTableView() {
|
|
1507
|
+
this.tableViewCurrentSelectedAlias = '';
|
|
1508
|
+
this.fetchTableConfiguration(true);
|
|
1509
|
+
}
|
|
1236
1510
|
selectorRowFilterBuilder(filtersWithoutGlobalAndSelectedRows, overrideOption = -1) {
|
|
1237
1511
|
if (filtersWithoutGlobalAndSelectedRows.hasOwnProperty('selector')) {
|
|
1238
1512
|
const selectorFilter = filtersWithoutGlobalAndSelectedRows['selector'][0];
|
|
@@ -1279,7 +1553,7 @@ class ECSPrimengTable {
|
|
|
1279
1553
|
}
|
|
1280
1554
|
}
|
|
1281
1555
|
revertDateTimeZoneFilters(inputFilter) {
|
|
1282
|
-
this.
|
|
1556
|
+
this.tableOptions.columns.shown.forEach((column) => {
|
|
1283
1557
|
if (column.dataType === DataType.Date) { // If its date type
|
|
1284
1558
|
if (inputFilter.hasOwnProperty(column.field)) {
|
|
1285
1559
|
const originalDate = inputFilter[column.field][0].value;
|
|
@@ -1293,7 +1567,7 @@ class ECSPrimengTable {
|
|
|
1293
1567
|
return inputFilter;
|
|
1294
1568
|
}
|
|
1295
1569
|
handleTableDataResponse(body) {
|
|
1296
|
-
this.data = body.data; // Update the table data
|
|
1570
|
+
this.tableOptions.data = body.data; // Update the table data
|
|
1297
1571
|
this.totalRecords = body.totalRecords; // Update the total number of records
|
|
1298
1572
|
this.totalRecordsNotFiltered = body.totalRecordsNotFiltered; // Update the total records not filtered
|
|
1299
1573
|
this.currentPage = body.page; // Update the current page
|
|
@@ -1302,7 +1576,7 @@ class ECSPrimengTable {
|
|
|
1302
1576
|
let hasToClear = this.hasToClearFilters(dt, this.globalSearchText, force);
|
|
1303
1577
|
if (hasToClear) {
|
|
1304
1578
|
if (!onlyGlobalFilter) {
|
|
1305
|
-
this.
|
|
1579
|
+
this.predefinedFiltersSelectedValuesCollection = {};
|
|
1306
1580
|
for (const key in dt.filters) {
|
|
1307
1581
|
if (dt.filters.hasOwnProperty(key)) {
|
|
1308
1582
|
const filters = dt.filters[key];
|
|
@@ -1376,8 +1650,8 @@ class ECSPrimengTable {
|
|
|
1376
1650
|
getColumnStyle(col, headerCols = false) {
|
|
1377
1651
|
return this.tableService.getColumnStyle(col, headerCols);
|
|
1378
1652
|
}
|
|
1379
|
-
|
|
1380
|
-
return this.
|
|
1653
|
+
getPredefinedFilterValues(columnKeyName) {
|
|
1654
|
+
return this.tableOptions.predefinedFilters?.[columnKeyName] || []; // Return the predefined filter values or an empty array if the option name does not exist
|
|
1381
1655
|
}
|
|
1382
1656
|
getFrozenColumnAlignAsText(frozenColumnAlign) {
|
|
1383
1657
|
return frozenColumnAlignAsText(frozenColumnAlign);
|
|
@@ -1389,9 +1663,9 @@ class ECSPrimengTable {
|
|
|
1389
1663
|
* Updates the filters of a PrimeNG data table based on predefined filter changes.
|
|
1390
1664
|
*
|
|
1391
1665
|
* @param {string} filterName - The name of the filter to be updated.
|
|
1392
|
-
* @param {
|
|
1666
|
+
* @param {IPrimengPredefinedFilter[]} selectedValues - An array of selected predefined filter values.
|
|
1393
1667
|
*/
|
|
1394
|
-
|
|
1668
|
+
onPredefinedFilterChange(filterName, selectedValues) {
|
|
1395
1669
|
const filters = { ...this.dt.filters }; // Create a shallow copy of the current filters to avoid mutating the original filters directly
|
|
1396
1670
|
if (Array.isArray(filters[filterName])) { // Check if the filter for the given filterName is an array
|
|
1397
1671
|
filters[filterName].forEach(criteria => {
|
|
@@ -1414,15 +1688,12 @@ class ECSPrimengTable {
|
|
|
1414
1688
|
* @param {string} columnKeyName - The key name of the column for which to retrieve the number of selected values.
|
|
1415
1689
|
* @returns {string} A string indicating the number of selected values for the specified column.
|
|
1416
1690
|
*/
|
|
1417
|
-
|
|
1691
|
+
predefinedFiltersSelectedValuesText(columnKeyName) {
|
|
1418
1692
|
let numbItemsSelected = 0; // Initialize the count of selected items to zero
|
|
1419
|
-
if (this.
|
|
1420
|
-
numbItemsSelected = this.
|
|
1693
|
+
if (this.predefinedFiltersSelectedValuesCollection[columnKeyName]) { // Check if there are selected values for the specified column key
|
|
1694
|
+
numbItemsSelected = this.predefinedFiltersSelectedValuesCollection[columnKeyName].length; // Get the number of selected items
|
|
1421
1695
|
}
|
|
1422
|
-
return `${numbItemsSelected}
|
|
1423
|
-
}
|
|
1424
|
-
handleButtonsClick(action, rowData = null) {
|
|
1425
|
-
this.tableService.handleButtonsClick(action, rowData);
|
|
1696
|
+
return `${numbItemsSelected} items selected`; // Return the number of selected items concatenated with the predefined text
|
|
1426
1697
|
}
|
|
1427
1698
|
/**
|
|
1428
1699
|
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
@@ -1433,14 +1704,14 @@ class ECSPrimengTable {
|
|
|
1433
1704
|
* @returns {any} The matching predefined filter value if found, otherwise null.
|
|
1434
1705
|
*/
|
|
1435
1706
|
getPredfinedFilterMatch(colMetadata, value) {
|
|
1436
|
-
if (colMetadata.
|
|
1437
|
-
const options = this.
|
|
1707
|
+
if (colMetadata.filterPredefinedValuesName && colMetadata.filterPredefinedValuesName.length > 0) { // Check if the column uses predefined filter values
|
|
1708
|
+
const options = this.getPredefinedFilterValues(colMetadata.filterPredefinedValuesName); // Get the predefined filter values based on the name
|
|
1438
1709
|
return options.find(option => option.value === value); // Return the matching option if found
|
|
1439
1710
|
}
|
|
1440
1711
|
return null; // Return null if the column does not use predefined filter values
|
|
1441
1712
|
}
|
|
1442
1713
|
copyToClipboardStart(event) {
|
|
1443
|
-
if (this.
|
|
1714
|
+
if ((this.tableOptions.copyToClipboardTime ?? 0) > 0) {
|
|
1444
1715
|
const cellContent = event.target.innerText;
|
|
1445
1716
|
this.copyCellDataTimer = setTimeout(() => {
|
|
1446
1717
|
navigator.clipboard.writeText(cellContent).then(() => {
|
|
@@ -1450,11 +1721,11 @@ class ECSPrimengTable {
|
|
|
1450
1721
|
this.notification.clearToasts();
|
|
1451
1722
|
this.notification.showToast("error", "CELL CONTENT COPIED", `The cell content failed to copy to your clipboard with error: ${err}`);
|
|
1452
1723
|
});
|
|
1453
|
-
}, this.
|
|
1724
|
+
}, (this.tableOptions.copyToClipboardTime ?? 0) * 1000);
|
|
1454
1725
|
}
|
|
1455
1726
|
}
|
|
1456
1727
|
copyToClipboardCancel() {
|
|
1457
|
-
if (this.
|
|
1728
|
+
if ((this.tableOptions.copyToClipboardTime ?? 0) > 0) {
|
|
1458
1729
|
clearTimeout(this.copyCellDataTimer);
|
|
1459
1730
|
}
|
|
1460
1731
|
}
|
|
@@ -1538,23 +1809,23 @@ class ECSPrimengTable {
|
|
|
1538
1809
|
finalColumns.push(matchingColumn);
|
|
1539
1810
|
}
|
|
1540
1811
|
});
|
|
1541
|
-
let prevColsToShow = this.
|
|
1542
|
-
this.
|
|
1543
|
-
let sameColumnsAsBefore = prevColsToShow.length === this.
|
|
1544
|
-
prevColsToShow.every((prevCol, index) => prevCol.field === this.
|
|
1545
|
-
this.columnsSelected = this.
|
|
1812
|
+
let prevColsToShow = this.tableOptions.columns.shown;
|
|
1813
|
+
this.tableOptions.columns.shown = this.tableService.orderColumnsWithFrozens(finalColumns);
|
|
1814
|
+
let sameColumnsAsBefore = prevColsToShow.length === this.tableOptions.columns.shown.length &&
|
|
1815
|
+
prevColsToShow.every((prevCol, index) => prevCol.field === this.tableOptions.columns.shown[index].field);
|
|
1816
|
+
this.columnsSelected = this.tableOptions.columns.shown.filter(column => !this.columnsCantBeHidden.some(nonSelectable => nonSelectable.field === column.field));
|
|
1546
1817
|
this.updateColumnsSpecialProperties(this.columnModalData);
|
|
1547
1818
|
if (!sameColumnsAsBefore) {
|
|
1548
|
-
this.isActive = false;
|
|
1819
|
+
this.tableOptions.isActive = false;
|
|
1549
1820
|
this.clearSorts(this.dt, true);
|
|
1550
1821
|
setTimeout(() => {
|
|
1551
|
-
this.isActive = true;
|
|
1822
|
+
this.tableOptions.isActive = true;
|
|
1552
1823
|
this.clearSorts(this.dt, true);
|
|
1553
1824
|
}, 1);
|
|
1554
1825
|
}
|
|
1555
1826
|
}
|
|
1556
1827
|
updateColumnsSpecialProperties(columnsSource) {
|
|
1557
|
-
const allColumns = [this.columns, this.
|
|
1828
|
+
const allColumns = [this.columns, this.tableOptions.columns.shown, this.columnsSelected, this.columnsCantBeHidden];
|
|
1558
1829
|
const columnModalDataMap = new Map(columnsSource.map((item) => [item.field, {
|
|
1559
1830
|
cellOverflowBehaviour: item.cellOverflowBehaviour,
|
|
1560
1831
|
dataAlignHorizontal: item.dataAlignHorizontal,
|
|
@@ -1578,13 +1849,15 @@ class ECSPrimengTable {
|
|
|
1578
1849
|
});
|
|
1579
1850
|
}
|
|
1580
1851
|
openExcelExport() {
|
|
1581
|
-
this.
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
: this.excelReportTitleDefault;
|
|
1852
|
+
const defaultTitle = this.tableOptions.excelReport?.defaultTitle?.trim();
|
|
1853
|
+
const allowEdit = this.tableOptions.excelReport?.titleAllowUserEdit === true;
|
|
1854
|
+
this.excelReportTitle = (!defaultTitle && !allowEdit) ? 'Report' : defaultTitle;
|
|
1585
1855
|
this.showExportModal = true;
|
|
1586
1856
|
}
|
|
1587
1857
|
generateExcelReport(event) {
|
|
1858
|
+
if (!this.tableOptions.excelReport?.url?.trim()) {
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1588
1861
|
let filtersWithoutGlobalAndSelectedRows = this.modifyFiltersWithoutGlobalAndSelectedRows(this.tableLazyLoadEventInformation.filters, event.selectedRows); // Create filters excluding the global filter
|
|
1589
1862
|
filtersWithoutGlobalAndSelectedRows = this.revertDateTimeZoneFilters(filtersWithoutGlobalAndSelectedRows);
|
|
1590
1863
|
const filtersMustBeApplied = (event.selectedRows === 1 || event.selectedRows === 2)
|
|
@@ -1596,7 +1869,7 @@ class ECSPrimengTable {
|
|
|
1596
1869
|
sort: this.tableLazyLoadEventInformation.multiSortMeta, // Set the sorting information
|
|
1597
1870
|
filter: filtersWithoutGlobalAndSelectedRows, // Set the filters excluding the global filter
|
|
1598
1871
|
globalFilter: this.globalSearchText, // Set the global filter text
|
|
1599
|
-
columns: this.
|
|
1872
|
+
columns: this.tableOptions.columns.shown.map(col => col.field), // Set the columns to show
|
|
1600
1873
|
dateFormat: this.dateFormat,
|
|
1601
1874
|
dateTimezone: this.dateTimezone,
|
|
1602
1875
|
dateCulture: this.dateCulture,
|
|
@@ -1605,7 +1878,7 @@ class ECSPrimengTable {
|
|
|
1605
1878
|
applySorts: event.applySorts,
|
|
1606
1879
|
filename: event.filename
|
|
1607
1880
|
};
|
|
1608
|
-
this.tableService.fetchExcelReport(this.
|
|
1881
|
+
this.tableService.fetchExcelReport(this.tableOptions.excelReport.url, requestData).subscribe({
|
|
1609
1882
|
next: (response) => {
|
|
1610
1883
|
this.tableService.downloadFile(response.body, event.filename, 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
|
1611
1884
|
this.showExportModal = false;
|
|
@@ -1613,10 +1886,35 @@ class ECSPrimengTable {
|
|
|
1613
1886
|
error: (err) => this.tableService.handleTableError(err, 'Excel export error')
|
|
1614
1887
|
});
|
|
1615
1888
|
}
|
|
1616
|
-
|
|
1617
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: ECSPrimengTable, isStandalone: true, selector: "ecs-primeng-table", inputs: { isActive: "isActive", data: "data", columnsToShow: "columnsToShow", computeScrollHeight: "computeScrollHeight", globalSearchEnabled: "globalSearchEnabled", globalSearchMaxLength: "globalSearchMaxLength", globalSearchPlaceholder: "globalSearchPlaceholder", columnEditorEnabled: "columnEditorEnabled", urlColumnsSource: "urlColumnsSource", urlDataSource: "urlDataSource", urlExcelReport: "urlExcelReport", predifinedFiltersCollection: "predifinedFiltersCollection", predifinedFiltersNoSelectionPlaceholder: "predifinedFiltersNoSelectionPlaceholder", predifinedFiltersCollectionSelectedValuesText: "predifinedFiltersCollectionSelectedValuesText", rowActionButtons: "rowActionButtons", headerActionButtons: "headerActionButtons", copyCellDataToClipboardTimeSecs: "copyCellDataToClipboardTimeSecs", actionsColumnAligmentRight: "actionsColumnAligmentRight", actionsColumnWidth: "actionsColumnWidth", actionsColumnFrozen: "actionsColumnFrozen", rowSelectorColumnActive: "rowSelectorColumnActive", rowSelectorColumName: "rowSelectorColumName", rowSelectorColumnAligmentRight: "rowSelectorColumnAligmentRight", rowSelectorColumnWidth: "rowSelectorColumnWidth", rowSelectorColumnFrozen: "rowSelectorColumnFrozen", actionsColumnResizable: "actionsColumnResizable", actionColumnName: "actionColumnName", rowselectorColumnResizable: "rowselectorColumnResizable", noDataFoundText: "noDataFoundText", showClearSortAndFilters: "showClearSortAndFilters", excelReportTitleDefault: "excelReportTitleDefault", excelReportTitleAllowUserEdit: "excelReportTitleAllowUserEdit", tableViewSaveAs: "tableViewSaveAs", tableViewSaveKey: "tableViewSaveKey", viewsGetSourceURL: "viewsGetSourceURL", viewsSaveSourceURL: "viewsSaveSourceURL", maxTableViews: "maxTableViews" }, outputs: { onRowCheckboxChange: "onRowCheckboxChange", onRowSelect: "onRowSelect", onRowUnselect: "onRowUnselect" }, viewQueries: [{ propertyName: "dt", first: true, predicate: ["dt"], descendants: true }, { propertyName: "tableContainer", first: true, predicate: ["tableContainer"], descendants: true }, { propertyName: "headerContainer", first: true, predicate: ["headerContainer"], descendants: true }, { propertyName: "paginatorContainer", first: true, predicate: ["paginatorContainer"], descendants: true }], ngImport: i0, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"computeScrollHeight ? scrollHeight : ''\"\r\n [columns]=\"columnsToShow\" [value]=\"data\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" selectionMode=\"single\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if (rowActionButtons.length > 0) {\r\n <th [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!actionsColumnResizable\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ actionColumnName }}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if (rowActionButtons.length > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of rowActionButtons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\" (clicked)=\"handleButtonsClick($event, rowData)\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': rowSelectorColumnWidth + 'px','min-width': rowSelectorColumnWidth + 'px','width': rowSelectorColumnWidth + 'px'}\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!rowselectorColumnResizable\" pFrozenColumn \r\n [frozen]=\"rowSelectorColumnFrozen\" [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ rowSelectorColumName }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{\r\n 'max-width': rowSelectorColumnWidth + 'px', \r\n 'min-width': rowSelectorColumnWidth + 'px', \r\n 'width': rowSelectorColumnWidth + 'px'\r\n }\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"rowSelectorColumnFrozen\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (columnEditorEnabled) {\r\n <p-button icon=\"pi pi-info\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (showClearSortAndFilters) {\r\n <p-button icon=\"pi pi-sort-alt-slash\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n pTooltip=\"Clear sorts\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n <p-button\r\n icon=\"pi pi-filter-slash\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n pTooltip=\"Clear filters\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/><!--resetTableView()-->\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (globalSearchEnabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"globalSearchPlaceholder\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (urlExcelReport && urlExcelReport.trim().length > 0) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if (headerActionButtons.length > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of headerActionButtons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\" (clicked)=\"handleButtonsClick($event, null)\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredifinedValuesName || col.filterPredifinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName]\"\r\n [options]=\"getPredifinedFilterValues(col.filterPredifinedValuesName)\" [placeholder]=\"predifinedFiltersNoSelectionPlaceholder\"\r\n (onChange)=\"onPredifinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predifinedFiltersSelectedValuesText(col.filterPredifinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>{{ predifinedFiltersNoSelectionPlaceholder }}</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\">\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predifinedFiltersCollection]=\"predifinedFiltersCollection\"/>\r\n </td>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">{{noDataFoundText}}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"rowSelectorColumnActive\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"excelReportTitleAllowUserEdit\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i5$1.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "directive", type: i5$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i5$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i5$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i5$1.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i12.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i4$1.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: TableCell, selector: "ecs-table-cell", inputs: ["col", "rowData", "globalSearchText", "predifinedFiltersCollection", "dateFormat", "dateTimezone", "dateCulture"] }, { kind: "component", type: TablePredifinedFilters, selector: "ecs-table-predifined-filters", inputs: ["option", "col"] }, { kind: "component", type: TableButton, selector: "ecs-table-button", inputs: ["button", "rowData", "isActionButton", "isLastActionButton"], outputs: ["clicked"] }, { kind: "component", type: ColumnSelector, selector: "ecs-column-selector", inputs: ["visible", "columnModalData", "filteredColumnData"], outputs: ["visibleChange", "applyChanges"] }, { kind: "component", type: ExportExcel, selector: "ecs-export-excel", inputs: ["visible", "rowCheckboxSelectorActive", "excelReportTitle", "allowTitleUserEdit"], outputs: ["exportToExcel", "visibleChange"] }, { kind: "ngmodule", type: ButtonGroupModule }, { kind: "component", type: i14.ButtonGroup, selector: "p-buttonGroup, p-buttongroup, p-button-group" }, { kind: "component", type: ViewsManagement, selector: "ecs-views-management", inputs: ["visible", "tableViews_menuItems"], outputs: ["onViewSelect", "onViewDelete", "onViewUpdateData", "onViewEditAlias", "onViewCreate", "visibleChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1889
|
+
updateIconBlobsForCollections() {
|
|
1890
|
+
Object.keys(this.tableOptions.predefinedFilters ?? {}).forEach(key => {
|
|
1891
|
+
const filters = this.tableOptions.predefinedFilters?.[key];
|
|
1892
|
+
if (Array.isArray(filters) && filters.length > 0) {
|
|
1893
|
+
filters.forEach(filter => {
|
|
1894
|
+
if (filter.imageBlobSourceEndpoint && !filter.imageBlob) {
|
|
1895
|
+
filter.imageBlob = undefined;
|
|
1896
|
+
filter.imageBlobFetchError = false;
|
|
1897
|
+
this.tableService.getIconBlob(filter.imageBlobSourceEndpoint).subscribe({
|
|
1898
|
+
next: (response) => {
|
|
1899
|
+
filter.imageBlob = response.body;
|
|
1900
|
+
this.showExportModal = false;
|
|
1901
|
+
},
|
|
1902
|
+
error: () => {
|
|
1903
|
+
filter.imageBlobFetchError = true;
|
|
1904
|
+
}
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
console.warn(`Filters for key ${key} is not an array:`, filters);
|
|
1911
|
+
}
|
|
1912
|
+
});
|
|
1913
|
+
}
|
|
1914
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTable, deps: [{ token: ECSPrimengTableService }, { token: ECSPrimengTableNotificationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1915
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.15", type: ECSPrimengTable, isStandalone: true, selector: "ecs-primeng-table", inputs: { tableOptions: "tableOptions" }, outputs: { onRowCheckboxChange: "onRowCheckboxChange", onRowSelect: "onRowSelect", onRowUnselect: "onRowUnselect", onDataEndUpdate: "onDataEndUpdate" }, host: { listeners: { "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 }], ngImport: i0, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"scrollHeightValue\"\r\n [columns]=\"tableOptions.columns?.shown ?? []\" [value]=\"tableOptions.data ?? []\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" [selectionMode]=\"tableOptions.rows?.singleSelector?.enabled ? 'single' : null\" [metaKeySelection]=\"tableOptions.rows?.singleSelector?.metakey\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if ((tableOptions.rows?.action?.buttons?.length ?? 0) > 0) {\r\n <th [ngStyle]=\"{'max-width': (tableOptions.rows?.action?.width ?? 150) + 'px','min-width': (tableOptions.rows?.action?.width ?? 150) + 'px','width': (tableOptions.rows?.action?.width ?? 150) + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.action?.resizable\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ tableOptions.rows?.action?.header ?? ''}}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if ((tableOptions.rows?.action?.buttons?.length ?? 0) > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.action?.width ?? 150) + 'px','min-width': (tableOptions.rows?.action?.width ?? 150) + 'px','width': (tableOptions.rows?.action?.width ?? 150) + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of tableOptions.rows?.action?.buttons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px','min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px','width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'}\"\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?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ tableOptions.rows?.checkboxSelector?.header ?? '' }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px', 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px', 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.alignmentRight ? 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)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (tableOptions.columns?.selectorEnabled) {\r\n <p-button [icon]=\"tableOptions.columns?.selectorIcon ?? 'pi pi-pen-to-square'\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (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\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n @if (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\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" (click)=\"resetTableView()\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (tableOptions.globalFilter?.enabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" placeholder='Search keyword' [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (tableOptions.excelReport?.url?.trim()) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if ((tableOptions.header?.buttons?.length ?? 0) > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of tableOptions.header?.buttons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredefinedValuesName || col.filterPredefinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName]\"\r\n [options]=\"getPredefinedFilterValues(col.filterPredefinedValuesName)\" placeholder=\"Any value\"\r\n (onChange)=\"onPredefinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predefinedFiltersSelectedValuesText(col.filterPredefinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>Any value</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"false\" [rowData]=\"null\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\" [ngClass]=\"tableOptions.rows?.class?.(rowData)\" [ngStyle]=\"tableOptions.rows?.style?.(rowData)\">\r\n @if (!tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\"/>\r\n </td>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">No data found for the current filter criteria.</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"tableOptions.rows?.checkboxSelector?.enabled ?? false\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"tableOptions.excelReport?.titleAllowUserEdit ?? false\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\" (onViewUpdateActiveStartup)=\"viewUpdateActiveStartup($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i8$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i8$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i8$1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i8$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i5$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "directive", type: i2.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "directive", type: i5$1.SortableColumn, selector: "[pSortableColumn]", inputs: ["pSortableColumn", "pSortableColumnDisabled"] }, { kind: "directive", type: i5$1.FrozenColumn, selector: "[pFrozenColumn]", inputs: ["frozen", "alignFrozen"] }, { kind: "directive", type: i5$1.SelectableRow, selector: "[pSelectableRow]", inputs: ["pSelectableRow", "pSelectableRowIndex", "pSelectableRowDisabled"] }, { kind: "directive", type: i5$1.ResizableColumn, selector: "[pResizableColumn]", inputs: ["pResizableColumnDisabled"] }, { kind: "directive", type: i5$1.ReorderableColumn, selector: "[pReorderableColumn]", inputs: ["pReorderableColumnDisabled"] }, { kind: "component", type: i5$1.SortIcon, selector: "p-sortIcon", inputs: ["field"] }, { kind: "component", type: i5$1.ColumnFilter, selector: "p-columnFilter", inputs: ["field", "type", "display", "showMenu", "matchMode", "operator", "showOperator", "showClearButton", "showApplyButton", "showMatchModes", "showAddButton", "hideOnClear", "placeholder", "matchModeOptions", "maxConstraints", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "locale", "localeMatcher", "currency", "currencyDisplay", "useGrouping", "showButtons", "ariaLabel", "filterButtonProps"], outputs: ["onShow", "onHide"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i5.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i11.InputText, selector: "[pInputText]", inputs: ["variant", "fluid", "pSize"] }, { kind: "ngmodule", type: IconFieldModule }, { kind: "component", type: i10.IconField, selector: "p-iconfield, p-iconField, p-icon-field", inputs: ["iconPosition", "styleClass"] }, { kind: "ngmodule", type: InputIconModule }, { kind: "component", type: i9$1.InputIcon, selector: "p-inputicon, p-inputIcon", inputs: ["styleClass"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i12.MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "fluid", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "size", "showClear", "autofocus", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: CheckboxModule }, { kind: "component", type: i9.Checkbox, selector: "p-checkbox, p-checkBox, p-check-box", inputs: ["value", "name", "disabled", "binary", "ariaLabelledBy", "ariaLabel", "tabindex", "inputId", "style", "inputStyle", "styleClass", "inputClass", "indeterminate", "size", "formControl", "checkboxIcon", "readonly", "required", "autofocus", "trueValue", "falseValue", "variant"], outputs: ["onChange", "onFocus", "onBlur"] }, { kind: "ngmodule", type: PaginatorModule }, { kind: "component", type: TableCell, selector: "ecs-table-cell", inputs: ["col", "rowData", "globalSearchText", "predefinedFiltersCollection", "dateFormat", "dateTimezone", "dateCulture"] }, { kind: "component", type: TablePredefinedFilters, selector: "ecs-table-predefined-filters", inputs: ["option", "col", "selectable", "rowData"] }, { kind: "component", type: TableButton, selector: "ecs-table-button", inputs: ["button", "rowData", "isActionButton", "isLastActionButton"] }, { kind: "component", type: ColumnSelector, selector: "ecs-column-selector", inputs: ["visible", "columnModalData", "filteredColumnData"], outputs: ["visibleChange", "applyChanges"] }, { kind: "component", type: ExportExcel, selector: "ecs-export-excel", inputs: ["visible", "rowCheckboxSelectorActive", "excelReportTitle", "allowTitleUserEdit"], outputs: ["exportToExcel", "visibleChange"] }, { kind: "ngmodule", type: ButtonGroupModule }, { kind: "component", type: i14.ButtonGroup, selector: "p-buttonGroup, p-buttongroup, p-button-group" }, { kind: "component", type: ViewsManagement, selector: "ecs-views-management", inputs: ["visible", "tableViews_menuItems"], outputs: ["onViewSelect", "onViewDelete", "onViewUpdateData", "onViewUpdateActiveStartup", "onViewEditAlias", "onViewCreate", "visibleChange"] }], encapsulation: i0.ViewEncapsulation.None });
|
|
1618
1916
|
}
|
|
1619
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
1917
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.15", ngImport: i0, type: ECSPrimengTable, decorators: [{
|
|
1620
1918
|
type: Component,
|
|
1621
1919
|
args: [{ selector: 'ecs-primeng-table', imports: [
|
|
1622
1920
|
CommonModule,
|
|
@@ -1631,86 +1929,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1631
1929
|
CheckboxModule,
|
|
1632
1930
|
PaginatorModule,
|
|
1633
1931
|
TableCell,
|
|
1634
|
-
|
|
1932
|
+
TablePredefinedFilters,
|
|
1635
1933
|
TableButton,
|
|
1636
1934
|
ColumnSelector,
|
|
1637
1935
|
ExportExcel,
|
|
1638
1936
|
ButtonGroupModule,
|
|
1639
1937
|
ViewsManagement
|
|
1640
|
-
], standalone: true, encapsulation: ViewEncapsulation.None, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"computeScrollHeight ? scrollHeight : ''\"\r\n [columns]=\"columnsToShow\" [value]=\"data\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" selectionMode=\"single\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if (rowActionButtons.length > 0) {\r\n <th [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!actionsColumnResizable\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ actionColumnName }}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if (rowActionButtons.length > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': actionsColumnWidth + 'px','min-width': actionsColumnWidth + 'px','width': actionsColumnWidth + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"actionsColumnFrozen\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(actionsColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of rowActionButtons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\" (clicked)=\"handleButtonsClick($event, rowData)\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': rowSelectorColumnWidth + 'px','min-width': rowSelectorColumnWidth + 'px','width': rowSelectorColumnWidth + 'px'}\"\r\n id=\"rowSelector-header\" [attr.scope]=\"'col'\" pResizableColumn [pResizableColumnDisabled]=\"!rowselectorColumnResizable\" pFrozenColumn \r\n [frozen]=\"rowSelectorColumnFrozen\" [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ rowSelectorColumName }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{\r\n 'max-width': rowSelectorColumnWidth + 'px', \r\n 'min-width': rowSelectorColumnWidth + 'px', \r\n 'width': rowSelectorColumnWidth + 'px'\r\n }\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"rowSelectorColumnFrozen\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(rowSelectorColumnAligmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n <p-checkbox \r\n [binary]=\"true\"\r\n [ngModel]=\"isRowCheckboxSelected(rowData.rowID)\"\r\n (onChange)=\"onRowChekboxChange($event, rowData.rowID)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (columnEditorEnabled) {\r\n <p-button icon=\"pi pi-info\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (showClearSortAndFilters) {\r\n <p-button icon=\"pi pi-sort-alt-slash\" (onClick)=\"clearSorts(dt)\" [disabled]=\"!hasToClearSorts(dt)\"\r\n pTooltip=\"Clear sorts\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n <p-button\r\n icon=\"pi pi-filter-slash\" (onClick)=\"clearFilters(dt)\" [disabled]=\"!hasToClearFilters(dt, globalSearchText)\"\r\n pTooltip=\"Clear filters\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/><!--resetTableView()-->\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (globalSearchEnabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"globalSearchMaxLength\" [placeholder]=\"globalSearchPlaceholder\" [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (urlExcelReport && urlExcelReport.trim().length > 0) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if (headerActionButtons.length > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of headerActionButtons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\" (clicked)=\"handleButtonsClick($event, null)\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredifinedValuesName || col.filterPredifinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName]\"\r\n [options]=\"getPredifinedFilterValues(col.filterPredifinedValuesName)\" [placeholder]=\"predifinedFiltersNoSelectionPlaceholder\"\r\n (onChange)=\"onPredifinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predifinedFiltersSelectedValuesCollection[col.filterPredifinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predifinedFiltersSelectedValuesText(col.filterPredifinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>{{ predifinedFiltersNoSelectionPlaceholder }}</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predifined-filters [option]=\"option\" [col]=\"col\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\">\r\n @if (!actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (rowSelectorColumnActive && !rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predifinedFiltersCollection]=\"predifinedFiltersCollection\"/>\r\n </td>\r\n }\r\n @if (rowSelectorColumnActive && rowSelectorColumnAligmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (actionsColumnAligmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">{{noDataFoundText}}</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"rowSelectorColumnActive\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"excelReportTitleAllowUserEdit\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"] }]
|
|
1641
|
-
}], ctorParameters: () => [{ type: ECSPrimengTableService }, { type: ECSPrimengTableNotificationService }], propDecorators: {
|
|
1642
|
-
type: Input
|
|
1643
|
-
}], data: [{
|
|
1644
|
-
type: Input
|
|
1645
|
-
}], columnsToShow: [{
|
|
1646
|
-
type: Input
|
|
1647
|
-
}], computeScrollHeight: [{
|
|
1648
|
-
type: Input
|
|
1649
|
-
}], globalSearchEnabled: [{
|
|
1650
|
-
type: Input
|
|
1651
|
-
}], globalSearchMaxLength: [{
|
|
1652
|
-
type: Input
|
|
1653
|
-
}], globalSearchPlaceholder: [{
|
|
1654
|
-
type: Input
|
|
1655
|
-
}], columnEditorEnabled: [{
|
|
1656
|
-
type: Input
|
|
1657
|
-
}], urlColumnsSource: [{
|
|
1658
|
-
type: Input
|
|
1659
|
-
}], urlDataSource: [{
|
|
1660
|
-
type: Input
|
|
1661
|
-
}], urlExcelReport: [{
|
|
1662
|
-
type: Input
|
|
1663
|
-
}], predifinedFiltersCollection: [{
|
|
1664
|
-
type: Input
|
|
1665
|
-
}], predifinedFiltersNoSelectionPlaceholder: [{
|
|
1666
|
-
type: Input
|
|
1667
|
-
}], predifinedFiltersCollectionSelectedValuesText: [{
|
|
1668
|
-
type: Input
|
|
1669
|
-
}], rowActionButtons: [{
|
|
1670
|
-
type: Input
|
|
1671
|
-
}], headerActionButtons: [{
|
|
1672
|
-
type: Input
|
|
1673
|
-
}], copyCellDataToClipboardTimeSecs: [{
|
|
1674
|
-
type: Input
|
|
1675
|
-
}], actionsColumnAligmentRight: [{
|
|
1676
|
-
type: Input
|
|
1677
|
-
}], actionsColumnWidth: [{
|
|
1678
|
-
type: Input
|
|
1679
|
-
}], actionsColumnFrozen: [{
|
|
1680
|
-
type: Input
|
|
1681
|
-
}], rowSelectorColumnActive: [{
|
|
1682
|
-
type: Input
|
|
1683
|
-
}], rowSelectorColumName: [{
|
|
1684
|
-
type: Input
|
|
1685
|
-
}], rowSelectorColumnAligmentRight: [{
|
|
1686
|
-
type: Input
|
|
1687
|
-
}], rowSelectorColumnWidth: [{
|
|
1688
|
-
type: Input
|
|
1689
|
-
}], rowSelectorColumnFrozen: [{
|
|
1690
|
-
type: Input
|
|
1691
|
-
}], actionsColumnResizable: [{
|
|
1692
|
-
type: Input
|
|
1693
|
-
}], actionColumnName: [{
|
|
1694
|
-
type: Input
|
|
1695
|
-
}], rowselectorColumnResizable: [{
|
|
1696
|
-
type: Input
|
|
1697
|
-
}], noDataFoundText: [{
|
|
1698
|
-
type: Input
|
|
1699
|
-
}], showClearSortAndFilters: [{
|
|
1700
|
-
type: Input
|
|
1701
|
-
}], excelReportTitleDefault: [{
|
|
1702
|
-
type: Input
|
|
1703
|
-
}], excelReportTitleAllowUserEdit: [{
|
|
1704
|
-
type: Input
|
|
1705
|
-
}], tableViewSaveAs: [{
|
|
1706
|
-
type: Input
|
|
1707
|
-
}], tableViewSaveKey: [{
|
|
1708
|
-
type: Input
|
|
1709
|
-
}], viewsGetSourceURL: [{
|
|
1710
|
-
type: Input
|
|
1711
|
-
}], viewsSaveSourceURL: [{
|
|
1712
|
-
type: Input
|
|
1713
|
-
}], maxTableViews: [{
|
|
1938
|
+
], standalone: true, encapsulation: ViewEncapsulation.None, template: "<div #tableContainer>\r\n <p-table #dt\r\n size=\"small\" showGridlines stripedRows \r\n sortMode=\"multiple\"\r\n [resizableColumns]=\"true\" columnResizeMode=\"expand\"\r\n [reorderableColumns]=\"true\"\r\n [scrollable]=\"true\" [scrollHeight]=\"scrollHeightValue\"\r\n [columns]=\"tableOptions.columns?.shown ?? []\" [value]=\"tableOptions.data ?? []\" dataKey=\"rowID\" \r\n [paginator]=\"true\" [first]=\"currentPage * currentRowsPerPage\" [rows]=\"currentRowsPerPage\" [totalRecords]=\"totalRecords\"\r\n [rowsPerPageOptions]=\"allowedRowsPerPage\" [showCurrentPageReport]=\"false\" (onPage)=\"pageChange($event)\"\r\n [metaKeySelection]=\"true\" [selectionMode]=\"tableOptions.rows?.singleSelector?.enabled ? 'single' : null\" [metaKeySelection]=\"tableOptions.rows?.singleSelector?.metakey\" [(selection)]=\"rowSelection\" (onRowSelect)=\"rowSelect($event)\" (onRowUnselect)=\"rowUnselect($event)\"\r\n [lazy]=\"true\" (onLazyLoad)=\"fetchTableData($event)\">\r\n\r\n <!--TEMPLATE FOR THE ACTIONS HEADER COLUMN-->\r\n <ng-template #actionColumnHeaderTemplate>\r\n @if ((tableOptions.rows?.action?.buttons?.length ?? 0) > 0) {\r\n <th [ngStyle]=\"{'max-width': (tableOptions.rows?.action?.width ?? 150) + 'px','min-width': (tableOptions.rows?.action?.width ?? 150) + 'px','width': (tableOptions.rows?.action?.width ?? 150) + 'px'}\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!tableOptions.rows?.action?.resizable\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\" id=\"actions-header\"\r\n [attr.scope]=\"'col'\" style=\"text-align: center;\">\r\n {{ tableOptions.rows?.action?.header ?? ''}}\r\n </th>\r\n }\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ACTIONS ROW COLUMN-->\r\n <ng-template #actionColumnTemplate let-rowData=\"rowData\">\r\n @if ((tableOptions.rows?.action?.buttons?.length ?? 0) > 0) {\r\n <td \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.action?.width ?? 150) + 'px','min-width': (tableOptions.rows?.action?.width ?? 150) + 'px','width': (tableOptions.rows?.action?.width ?? 150) + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"tableOptions.rows?.action?.frozen ?? false\"\r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.action?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\">\r\n @for (button of tableOptions.rows?.action?.buttons; track button; let last = $last) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"rowData\" [isActionButton]=\"true\" [isLastActionButton]=\"last\"/>\r\n }\r\n </td>\r\n }\r\n </ng-template>\r\n\r\n <!-- TEMPLATE FOR THE ROW CHECKBOX SELECTOR HEADER COLUMN -->\r\n <ng-template #rowSelectorColumnHeaderTemplate>\r\n <th \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px','min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px','width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'}\"\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?.alignmentRight ? FrozenColumnAlign.Right : FrozenColumnAlign.Left)\"\r\n style=\"text-align: center; vertical-align: middle;\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n {{ tableOptions.rows?.checkboxSelector?.header ?? '' }}\r\n <p-columnFilter type=\"boolean\" field=\"selector\" display=\"menu\" [showButtons]=\"false\"/>\r\n </div>\r\n </th>\r\n </ng-template>\r\n\r\n <!--TEMPLATE FOR THE ROW CHECKBOX SELECTOR COLUMN-->\r\n <ng-template #rowSelectorColumnTemplate let-rowData=\"rowData\">\r\n <td \r\n [ngStyle]=\"{'max-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px', 'min-width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px', 'width': (tableOptions.rows?.checkboxSelector?.width ?? 150) + 'px'}\"\r\n style=\"text-align: center; vertical-align: middle;\" pFrozenColumn [frozen]=\"tableOptions.rows?.checkboxSelector?.frozen ?? false\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(tableOptions.rows?.checkboxSelector?.alignmentRight ? 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)\"/>\r\n </td>\r\n </ng-template>\r\n\r\n\r\n <!-- LOGIC FOR DRAWING TABLE ACTIONS ABOVE THE HEADER -->\r\n <ng-template #caption>\r\n <div #headerContainer style=\"display: flex; justify-content: space-between; align-items: center;\">\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--CHOOSE COLUMNS TO SHOW-->\r\n @if (tableOptions.columns?.selectorEnabled) {\r\n <p-button [icon]=\"tableOptions.columns?.selectorIcon ?? 'pi pi-pen-to-square'\" (onClick)=\"columnSelectorShow()\" pTooltip=\"Modify columns\"\r\n [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n <!--CLEAR SORTS AND FILTERS-->\r\n @if (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\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n @if (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\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n </div>\r\n\r\n <!--TABLE VIEWS-->\r\n @if(tableViewsEnabled()){\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <p-buttongroup>\r\n <p-button (click)=\"viewsModalShow=true;\" [label]=\"tableViewCurrentSelectedAlias ? tableViewCurrentSelectedAlias : '--- Select a view ---'\" class=\"viewButton\"/>\r\n <p-button icon=\"pi pi-refresh\" (click)=\"viewLoad(tableViewCurrentSelectedAlias!)\" [disabled]=\"!tableViewCurrentSelectedAlias\" pTooltip=\"Apply view again\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n <p-button icon=\"pi pi-eraser\" (click)=\"resetTableView()\" pTooltip=\"Reset table view\" [showDelay]=\"700\" tooltipPosition=\"top\"/>\r\n </p-buttongroup>\r\n </div>\r\n }\r\n\r\n <div style=\"display: flex; align-items: center; gap: 10px;\">\r\n <!--GLOBAL FILTER-->\r\n @if (tableOptions.globalFilter?.enabled) {\r\n <p-iconField iconPosition=\"left\" class=\"ml-auto\" [ngClass]=\"{'p-input-icon-right': globalSearchText}\">\r\n <p-inputIcon>\r\n <i class=\"pi pi-search\"></i>\r\n </p-inputIcon>\r\n <input pInputText type=\"text\" \r\n (input)=\"dt.filterGlobal($any($event.target).value, 'contains')\" autocomplete=\"off\" \r\n [maxlength]=\"tableOptions.globalFilter?.maxLength ?? null\" placeholder='Search keyword' [(ngModel)]=\"globalSearchText\"\r\n style=\"width: 220px;\"/>\r\n <!-- Right icon (only if there is text) -->\r\n @if (globalSearchText) {\r\n <p-inputIcon position=\"right\">\r\n <i class=\"pi pi-times\" style=\"cursor: pointer;\" (click)=\"clearFilters(dt, true, true); $event.stopPropagation()\"></i>\r\n </p-inputIcon>\r\n }\r\n </p-iconField>\r\n }\r\n\r\n <!--EXPORT DATA-->\r\n @if (tableOptions.excelReport?.url?.trim()) {\r\n <p-button icon=\"pi pi-file-excel\" (onClick)=\"openExcelExport()\"\r\n pTooltip=\"Export to Excel\" [showDelay]=\"700\" tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n\r\n <!--REFRESH DATA-->\r\n @if (showRefreshData) {\r\n <p-button icon=\"pi pi-refresh\" (onClick)=\"refreshData($event)\" pTooltip=\"Refresh data\" [showDelay]=\"700\"\r\n tooltipPosition=\"top\" styleClass=\"p-button-icon-only\"/>\r\n }\r\n \r\n <!-- HEADER ACTION BUTTONS -->\r\n @if ((tableOptions.header?.buttons?.length ?? 0) > 0) {\r\n <td style=\"display: flex; justify-content: center; align-items: center;\">\r\n @for (button of tableOptions.header?.buttons; track $index) {\r\n <ecs-table-button [button]=\"button\" [rowData]=\"null\"/>\r\n }\r\n </td>\r\n }\r\n </div>\r\n </div>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE HEADERS -->\r\n <ng-template #header let-columns>\r\n <tr>\r\n @if (!tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @for (col of columns; track col.header) {\r\n <th [ngStyle]=\"getColumnStyle(col, true)\"\r\n pResizableColumn [pResizableColumnDisabled]=\"!col.canBeResized ? true : false\"\r\n pReorderableColumn [pReorderableColumnDisabled]=\"!col.canBeReordered ? true : false\"\r\n pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\"\r\n [pSortableColumn]=\"col.field\" [pSortableColumnDisabled]=\"!col.canBeSorted ? true : false\"\r\n style=\"text-align: center;\"\r\n [id]=\"col.field + '-header'\" [attr.scope]=\"'col'\">\r\n <div style=\"display: flex; justify-content: space-between; align-items: center; width: 100%;\">\r\n <div style=\"margin-right: 15px;\">\r\n <span>{{ col.header }}</span>\r\n </div>\r\n <div style=\"display: flex; align-items: center; gap: 5px;\">\r\n @if (col.canBeSorted) {\r\n <p-sortIcon [field]=\"col.field\"></p-sortIcon>\r\n }\r\n @if(col.canBeFiltered){\r\n @if (!col.filterPredefinedValuesName || col.filterPredefinedValuesName.length === 0) {\r\n <p-columnFilter [type]=\"getDataTypeAsText(col.dataType)\" [field]=\"col.field\" display=\"menu\" [showButtons]=\"false\"/>\r\n } @else {\r\n <p-columnFilter\r\n type=\"{{getDataTypeAsText(col.dataType)}}\" field=\"{{col.field}}\" display=\"menu\"\r\n [showButtons]=\"false\" matchMode=\"in\" operator=\"or\" [showMatchModes]=\"false\"\r\n [showOperator]=\"false\" [showAddButton]=\"false\" [showClearButton]=\"false\" [showApplyButton]=\"false\">\r\n <ng-template #filter>\r\n <p-multiSelect\r\n [style]=\"{ minWidth: '400px' }\" [(ngModel)]=\"predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName]\"\r\n [options]=\"getPredefinedFilterValues(col.filterPredefinedValuesName)\" placeholder=\"Any value\"\r\n (onChange)=\"onPredefinedFilterChange(col.field, $event.value)\" optionLabel=\"name\">\r\n <ng-template #selectedItems>\r\n @if (predefinedFiltersSelectedValuesCollection[col.filterPredefinedValuesName].length > 0) {\r\n <div style=\"display: flex; align-items: center; gap: 0.5rem;\">\r\n <div>\r\n {{predefinedFiltersSelectedValuesText(col.filterPredefinedValuesName)}}\r\n </div>\r\n </div>\r\n } @else {\r\n <div>Any value</div>\r\n }\r\n </ng-template>\r\n <ng-template let-option pTemplate=\"item\">\r\n <div style=\"display: inline-block; vertical-align: middle;\">\r\n <ecs-table-predefined-filters [option]=\"option\" [col]=\"col\" [selectable]=\"false\" [rowData]=\"null\"/>\r\n </div>\r\n </ng-template>\r\n </p-multiSelect>\r\n </ng-template>\r\n </p-columnFilter>\r\n }\r\n }\r\n @if (col.columnDescription && col.columnDescription.length > 0) {\r\n <i [pTooltip]=\"col.columnDescription\" tooltipPosition=\"top\" class=\"pi pi-info-circle\"></i>\r\n }\r\n </div>\r\n </div>\r\n </th>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnHeaderTemplate\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnHeaderTemplate\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS CONTENTS -->\r\n <ng-template #body let-rowData let-columns=\"columns\"> \r\n <tr [pSelectableRow]=\"rowData\" [ngClass]=\"tableOptions.rows?.class?.(rowData)\" [ngStyle]=\"tableOptions.rows?.style?.(rowData)\">\r\n @if (!tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && !tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @for (col of columns; track col.field) {\r\n <td (mousedown)=\"col.dataType !== DataType.Boolean && copyToClipboardStart($event)\" (mouseup)=\"copyToClipboardCancel()\"\r\n [ngStyle]=\"getColumnStyle(col)\" pFrozenColumn [frozen]=\"col.frozenColumnAlign === FrozenColumnAlign.Left || col.frozenColumnAlign === FrozenColumnAlign.Right\" \r\n [alignFrozen]=\"getFrozenColumnAlignAsText(col.frozenColumnAlign)\" [style.text-align]=\"getDataAlignHorizontalAsText(col.dataAlignHorizontal)\" [style.vertical-align]=\"getDataAlignVerticalAsText(col.dataAlignVertical)\">\r\n <ecs-table-cell [col]=\"col\" [rowData]=\"rowData\" [globalSearchText]=\"globalSearchText\" \r\n [dateFormat]=\"dateFormat\" [dateTimezone]=\"dateTimezone\" [dateCulture]=\"dateCulture\"\r\n [predefinedFiltersCollection]=\"tableOptions.predefinedFilters\"/>\r\n </td>\r\n }\r\n @if (tableOptions.rows?.checkboxSelector?.enabled && tableOptions.rows?.checkboxSelector?.alignmentRight) {\r\n <ng-container [ngTemplateOutlet]=\"rowSelectorColumnTemplate\" [ngTemplateOutletContext]=\"{ rowData: rowData }\"></ng-container>\r\n }\r\n @if (tableOptions.rows?.action?.alignmentRight) {\r\n <ng-container *ngTemplateOutlet=\"actionColumnTemplate; context: { rowData: rowData }\"></ng-container>\r\n }\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- LOGIC FOR DRAWING TABLE DATA WHEN THERE IS NO CONTENTS -->\r\n <ng-template #emptymessage>\r\n <tr>\r\n <td colspan=\"999\">No data found for the current filter criteria.</td>\r\n </tr>\r\n </ng-template>\r\n\r\n <!-- SHOW CUSTOM RECORDS REPORT -->\r\n <ng-template #paginatorleft>\r\n <div #paginatorContainer>\r\n Showing {{totalRecords}} records of {{totalRecordsNotFiltered}} available records\r\n </div>\r\n </ng-template>\r\n </p-table>\r\n</div>\r\n<ecs-column-selector [visible]=\"showColumnSelector\" [columnModalData]=\"columnModalData\" [filteredColumnData]=\"filteredColumnData\" (visibleChange)=\"showColumnSelector=false\" (applyChanges)=\"applyColumnModalChanges($event)\"/>\r\n<ecs-export-excel [visible]=\"showExportModal\" [rowCheckboxSelectorActive]=\"tableOptions.rows?.checkboxSelector?.enabled ?? false\" [excelReportTitle]=\"excelReportTitle\" [allowTitleUserEdit]=\"tableOptions.excelReport?.titleAllowUserEdit ?? false\" (visibleChange)=\"showExportModal=false\" (exportToExcel)=\"generateExcelReport($event)\"/>\r\n<ecs-views-management [visible]=\"viewsModalShow\" [tableViews_menuItems]=\"tableViews_menuItems\" \r\n (onViewSelect)=\"viewLoad($event)\" (onViewCreate)=\"viewCreate($event)\" (onViewDelete)=\"viewDelete($event)\" (onViewEditAlias)=\"viewEditAlias($event)\" (onViewUpdateData)=\"viewUpdateData($event)\" (onViewUpdateActiveStartup)=\"viewUpdateActiveStartup($event)\"\r\n (visibleChange)=\"viewsModalShow=false\"/>", styles: [".highlighted-text{background-color:#ff0}.p-datatable-column-filter-button.p-button-icon-only.p-button-rounded,.p-datatable-column-filter-clear-button.p-button-icon-only.p-button-rounded{height:var(--p-icon-size)!important;width:var(--p-icon-size)!important}.viewButton{width:200px}.viewButton .p-button{width:100%;justify-content:center}.viewButton .p-button-label{display:block;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}\n"] }]
|
|
1939
|
+
}], ctorParameters: () => [{ type: ECSPrimengTableService }, { type: ECSPrimengTableNotificationService }], propDecorators: { tableOptions: [{
|
|
1714
1940
|
type: Input
|
|
1715
1941
|
}], onRowCheckboxChange: [{
|
|
1716
1942
|
type: Output
|
|
@@ -1718,6 +1944,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1718
1944
|
type: Output
|
|
1719
1945
|
}], onRowUnselect: [{
|
|
1720
1946
|
type: Output
|
|
1947
|
+
}], onDataEndUpdate: [{
|
|
1948
|
+
type: Output
|
|
1721
1949
|
}], dt: [{
|
|
1722
1950
|
type: ViewChild,
|
|
1723
1951
|
args: ['dt']
|
|
@@ -1730,6 +1958,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1730
1958
|
}], paginatorContainer: [{
|
|
1731
1959
|
type: ViewChild,
|
|
1732
1960
|
args: ['paginatorContainer', { static: false }]
|
|
1961
|
+
}], onResize: [{
|
|
1962
|
+
type: HostListener,
|
|
1963
|
+
args: ['window:resize']
|
|
1733
1964
|
}] } });
|
|
1734
1965
|
|
|
1735
1966
|
/*
|
|
@@ -1741,5 +1972,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
|
|
|
1741
1972
|
* Generated bundle index. Do not edit.
|
|
1742
1973
|
*/
|
|
1743
1974
|
|
|
1744
|
-
export { CellOverflowBehaviour, DataAlignHorizontal, DataAlignVertical, DataType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableNotificationService, ECSPrimengTableService, FrozenColumnAlign, TableViewSaveMode };
|
|
1975
|
+
export { CellOverflowBehaviour, DEFAULT_TABLE_OPTIONS, DataAlignHorizontal, DataAlignVertical, DataType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableNotificationService, ECSPrimengTableService, FrozenColumnAlign, TableViewSaveMode, createTableOptions };
|
|
1745
1976
|
//# sourceMappingURL=eternalcodestudio-primeng-table.mjs.map
|