@eternalcodestudio/primeng-table 20.0.3 → 20.0.5
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 +385 -236
- package/fesm2022/eternalcodestudio-primeng-table.mjs.map +1 -1
- package/index.d.ts +392 -77
- package/package.json +4 -3
package/index.d.ts
CHANGED
|
@@ -2,18 +2,18 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { OnInit, AfterViewInit, EventEmitter, ElementRef } from '@angular/core';
|
|
3
3
|
import { Table, TableLazyLoadEvent, TableRowSelectEvent, TableRowUnSelectEvent, TablePageEvent } from 'primeng/table';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
|
-
import {
|
|
5
|
+
import { HttpResponse, HttpHeaders } from '@angular/common/http';
|
|
6
6
|
import { SortMeta, MenuItem } from 'primeng/api';
|
|
7
7
|
|
|
8
8
|
declare abstract class ECSPrimengTableHttpService {
|
|
9
|
-
abstract handleHttpGetRequest<T>(servicePoint: string,
|
|
10
|
-
abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null,
|
|
9
|
+
abstract handleHttpGetRequest<T>(servicePoint: string, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
10
|
+
abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableHttpService, never>;
|
|
12
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableHttpService>;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
declare abstract class ECSPrimengTableNotificationService {
|
|
16
|
-
abstract showToast(severity: string, title: string, message: string
|
|
16
|
+
abstract showToast(severity: string, title: string, message: string): void;
|
|
17
17
|
abstract clearToasts(): void;
|
|
18
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableNotificationService, never>;
|
|
19
19
|
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableNotificationService>;
|
|
@@ -77,42 +77,103 @@ interface IExcelExportRequest extends ITableQueryRequest {
|
|
|
77
77
|
applySorts: boolean;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Enum representing how content that overflows a table cell should be handled.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* Determines the visual behavior of cell content when it exceeds the cell's width.
|
|
85
|
+
*/
|
|
80
86
|
declare enum CellOverflowBehaviour {
|
|
87
|
+
/** Content that exceeds the cell's width is clipped and not visible. */
|
|
81
88
|
Hidden = 0,
|
|
89
|
+
/** Content wraps onto multiple lines to fit within the cell. */
|
|
82
90
|
Wrap = 1,
|
|
91
|
+
/** Content is truncated and an ellipsis (...) is shown at the end. */
|
|
83
92
|
Ellipsis = 2
|
|
84
93
|
}
|
|
85
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Enum representing the horizontal alignment of content within a table cell.
|
|
97
|
+
*
|
|
98
|
+
* @remarks
|
|
99
|
+
* Determines how the content inside a cell is positioned horizontally relative to the cell's width.
|
|
100
|
+
*/
|
|
86
101
|
declare enum DataAlignHorizontal {
|
|
102
|
+
/** Align content to the left of the cell. */
|
|
87
103
|
Left = 0,
|
|
104
|
+
/** Align content to the center of the cell. */
|
|
88
105
|
Center = 1,
|
|
106
|
+
/** Align content to the right of the cell. */
|
|
89
107
|
Right = 2
|
|
90
108
|
}
|
|
91
109
|
|
|
110
|
+
/**
|
|
111
|
+
* Enum representing the vertical alignment of content within a table cell.
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* Determines how the content inside a cell is positioned vertically relative to the cell's height.
|
|
115
|
+
*/
|
|
92
116
|
declare enum DataAlignVertical {
|
|
117
|
+
/** Align content to the top of the cell. */
|
|
93
118
|
Top = 0,
|
|
119
|
+
/** Align content to the vertical middle of the cell. */
|
|
94
120
|
Middle = 1,
|
|
121
|
+
/** Align content to the bottom of the cell. */
|
|
95
122
|
Bottom = 2
|
|
96
123
|
}
|
|
97
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Enum representing the different types of data a table column can hold.
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* This is used to determine how values should be rendered, formatted, and
|
|
130
|
+
* filtered in the table component.
|
|
131
|
+
*/
|
|
98
132
|
declare enum DataType {
|
|
133
|
+
/** Plain text string values. */
|
|
99
134
|
Text = 0,
|
|
135
|
+
/** Numeric values, e.g., integers or decimals. */
|
|
100
136
|
Numeric = 1,
|
|
137
|
+
/** Boolean values (true/false). */
|
|
101
138
|
Boolean = 2,
|
|
102
|
-
Date
|
|
139
|
+
/** Date or datetime values. */
|
|
140
|
+
Date = 3,
|
|
141
|
+
/** List of values, stored as a string separated by a delimiter (";"). */
|
|
142
|
+
List = 4
|
|
103
143
|
}
|
|
104
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Enum representing the alignment of frozen columns in a table.
|
|
147
|
+
*
|
|
148
|
+
* @remarks
|
|
149
|
+
* Used to determine if a column should be frozen, and if so, on which side
|
|
150
|
+
* of the table it should appear.
|
|
151
|
+
*/
|
|
105
152
|
declare enum FrozenColumnAlign {
|
|
153
|
+
/** The column is not frozen. */
|
|
106
154
|
Noone = 0,
|
|
155
|
+
/** The column is frozen on the left side of the table. */
|
|
107
156
|
Left = 1,
|
|
157
|
+
/** The column is frozen on the right side of the table. */
|
|
108
158
|
Right = 2
|
|
109
159
|
}
|
|
110
160
|
|
|
161
|
+
/**
|
|
162
|
+
* Enum representing the mode used to save the state or configuration of a table view.
|
|
163
|
+
*
|
|
164
|
+
* @remarks
|
|
165
|
+
* Determines where and how the table's view settings (e.g., column order, filters,
|
|
166
|
+
* sorting) are persisted.
|
|
167
|
+
*/
|
|
111
168
|
declare enum TableViewSaveMode {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
169
|
+
/** Do not save the table view state. */
|
|
170
|
+
None = 0,
|
|
171
|
+
/** Save the table view state in the browser's sessionStorage (cleared on tab close). */
|
|
172
|
+
SessionStorage = 1,
|
|
173
|
+
/** Save the table view state in the browser's localStorage (persists across sessions). */
|
|
174
|
+
LocalStorage = 2,
|
|
175
|
+
/** Save the table view state in a backend database (requires server support). */
|
|
176
|
+
DatabaseStorage = 3
|
|
116
177
|
}
|
|
117
178
|
|
|
118
179
|
interface IColumnMetadata {
|
|
@@ -129,7 +190,7 @@ interface IColumnMetadata {
|
|
|
129
190
|
canBeReordered: boolean;
|
|
130
191
|
canBeSorted: boolean;
|
|
131
192
|
canBeFiltered: boolean;
|
|
132
|
-
|
|
193
|
+
filterPredefinedValuesName: string;
|
|
133
194
|
canBeGlobalFiltered: boolean;
|
|
134
195
|
columnDescription: string;
|
|
135
196
|
dataTooltipShow: boolean;
|
|
@@ -140,39 +201,79 @@ interface IColumnMetadata {
|
|
|
140
201
|
initialWidth: number;
|
|
141
202
|
}
|
|
142
203
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
iconBlobSourceEndpoint?: string;
|
|
150
|
-
iconBlobSourceEndpointResponseError?: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Represents a predefined filter value for a column in **ECS PrimeNG tables**.
|
|
206
|
+
*
|
|
207
|
+
* Allows displaying a value as text, tag, icon or image (from URL or blob) with optional styles and colors.
|
|
208
|
+
*/
|
|
209
|
+
interface IPredefinedFilter {
|
|
151
210
|
/**
|
|
152
|
-
* The
|
|
211
|
+
* The underlying value of the cell. Must match the data returned from the backend for proper filtering and mapping.
|
|
212
|
+
*
|
|
213
|
+
* This is also used by the global filter internally.
|
|
214
|
+
*
|
|
215
|
+
* **IMPORTANT**: For text and tag representations, it is recommended that `value` matches `name`.
|
|
153
216
|
*/
|
|
154
|
-
|
|
217
|
+
value: string | number;
|
|
155
218
|
/**
|
|
156
|
-
*
|
|
219
|
+
* The text displayed in the frontend for this filter value.
|
|
220
|
+
*
|
|
221
|
+
* Used when `displayName` is `true` or when displaying a tag.
|
|
157
222
|
*/
|
|
158
223
|
name?: string;
|
|
159
224
|
/**
|
|
160
|
-
*
|
|
225
|
+
* Set to `true` to display the `name` as text in the cell.
|
|
161
226
|
*/
|
|
162
227
|
displayName?: boolean;
|
|
163
228
|
/**
|
|
164
|
-
*
|
|
229
|
+
* Set to `true` to display the `name` as a tag in the cell.
|
|
165
230
|
*/
|
|
166
|
-
|
|
231
|
+
displayTag?: boolean;
|
|
167
232
|
/**
|
|
168
|
-
*
|
|
233
|
+
* Optional CSS style object to apply to the tag.
|
|
234
|
+
*
|
|
235
|
+
* Example: { background: 'rgb(255,0,0)', color: 'white' }
|
|
169
236
|
*/
|
|
170
|
-
displayTag?: boolean;
|
|
171
237
|
tagStyle?: {
|
|
172
238
|
[key: string]: string;
|
|
173
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* The icon to display for this value.
|
|
242
|
+
*
|
|
243
|
+
* Can use icons from PrimeNG, Font Awesome, Material Icons, etc...
|
|
244
|
+
*/
|
|
245
|
+
icon?: string;
|
|
246
|
+
/**
|
|
247
|
+
* Optional color to apply to the icon.
|
|
248
|
+
*
|
|
249
|
+
* Example: "red", "#00ff00"
|
|
250
|
+
*/
|
|
174
251
|
iconColor?: string;
|
|
252
|
+
/**
|
|
253
|
+
* Optional CSS style string to apply to the icon.
|
|
254
|
+
*
|
|
255
|
+
* Example: "font-size: 1.5rem" "margin-right: 0.5rem"
|
|
256
|
+
*/
|
|
175
257
|
iconStyle?: string;
|
|
258
|
+
/**
|
|
259
|
+
* The image to display directly from a URL.
|
|
260
|
+
*/
|
|
261
|
+
imageURL?: string;
|
|
262
|
+
/**
|
|
263
|
+
* The image to display from a Blob object.
|
|
264
|
+
*/
|
|
265
|
+
imageBlob?: Blob;
|
|
266
|
+
/**
|
|
267
|
+
* If using a Blob and it is not provided directly, the backend endpoint to fetch the Blob from.
|
|
268
|
+
*/
|
|
269
|
+
imageBlobSourceEndpoint?: string;
|
|
270
|
+
/**
|
|
271
|
+
* @internal
|
|
272
|
+
* Indicates that fetching the Blob from `imageBlobSourceEndpoint` failed.
|
|
273
|
+
*
|
|
274
|
+
* **_Do not modify this property manually._**
|
|
275
|
+
*/
|
|
276
|
+
imageBlobFetchError?: boolean;
|
|
176
277
|
}
|
|
177
278
|
|
|
178
279
|
interface ITableConfiguration {
|
|
@@ -181,8 +282,252 @@ interface ITableConfiguration {
|
|
|
181
282
|
dateFormat: string;
|
|
182
283
|
dateTimezone: string;
|
|
183
284
|
dateCulture: string;
|
|
285
|
+
maxViews: number;
|
|
184
286
|
}
|
|
185
287
|
|
|
288
|
+
/** Configuration options for ECS Primeng table */
|
|
289
|
+
interface ITableOptions {
|
|
290
|
+
/**
|
|
291
|
+
* Controls whether the table is active.
|
|
292
|
+
*
|
|
293
|
+
* - When `true`, the table will fetch configuration, columns, and data on init.
|
|
294
|
+
* - When `false`, the table will **not** automatically fetch or update data, even after initialization.
|
|
295
|
+
* Use this if you want to apply filters, column changes, or other manipulations
|
|
296
|
+
* without triggering automatic updates.
|
|
297
|
+
*
|
|
298
|
+
* @default true
|
|
299
|
+
*/
|
|
300
|
+
isActive?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Endpoint URL to fetch the table configuration.
|
|
303
|
+
*
|
|
304
|
+
* The configuration is fetched **once** when the table is initialized and is expected to return
|
|
305
|
+
* an `ITableConfiguration` object from the API. This includes data such as column definitions,
|
|
306
|
+
* the timezone to use, and other settings.
|
|
307
|
+
*
|
|
308
|
+
* If set to `undefined` or if `isActive` is `false`, the table will **not** fetch configuration automatically.
|
|
309
|
+
*
|
|
310
|
+
* @default undefined
|
|
311
|
+
*/
|
|
312
|
+
urlTableConfiguration?: string;
|
|
313
|
+
/**
|
|
314
|
+
* Endpoint URL to fetch the table data.
|
|
315
|
+
*
|
|
316
|
+
* This endpoint is called **whenever the user filters, changes pages, or sorts** the table.
|
|
317
|
+
* It is expected to return an `ITablePagedResponse` object containing the paginated data.
|
|
318
|
+
*
|
|
319
|
+
* If set to `undefined` or if `isActive` is `false`, the table will **not** fetch or update data automatically.
|
|
320
|
+
*
|
|
321
|
+
* @default undefined
|
|
322
|
+
*/
|
|
323
|
+
urlTableData?: string;
|
|
324
|
+
/**
|
|
325
|
+
* The array of data to be displayed in the table.
|
|
326
|
+
*
|
|
327
|
+
* Each item should represent a row and match the table's column structure.
|
|
328
|
+
*
|
|
329
|
+
* @default []
|
|
330
|
+
*/
|
|
331
|
+
data?: any[];
|
|
332
|
+
header?: {
|
|
333
|
+
buttons?: ITableButton[];
|
|
334
|
+
clearSortsEnabled?: boolean;
|
|
335
|
+
clearSortsIcon?: string;
|
|
336
|
+
clearFiltersEnabled?: boolean;
|
|
337
|
+
clearFiltersIcon?: string;
|
|
338
|
+
};
|
|
339
|
+
/**
|
|
340
|
+
* Configurations related to the columns of the table.
|
|
341
|
+
*/
|
|
342
|
+
columns?: {
|
|
343
|
+
/**
|
|
344
|
+
* Enables or disables the column selector feature.
|
|
345
|
+
*
|
|
346
|
+
* When `true`, a button is displayed in the top-left corner of the table.
|
|
347
|
+
* Clicking this button opens a modal that allows users to:
|
|
348
|
+
* - Show or hide columns.
|
|
349
|
+
* - Adjust the cell overflow behavior for each column.
|
|
350
|
+
* - Change the horizontal and vertical alignment of cells per column.
|
|
351
|
+
*
|
|
352
|
+
* When `false`, the button to open the column's selector modal will not be available.
|
|
353
|
+
*
|
|
354
|
+
* @default true
|
|
355
|
+
*/
|
|
356
|
+
selectorEnabled?: boolean;
|
|
357
|
+
selectorIcon?: string;
|
|
358
|
+
/**
|
|
359
|
+
* The combination of non-selectable columns and user-selected columns
|
|
360
|
+
* that must be displayed in the table.
|
|
361
|
+
*
|
|
362
|
+
* @default []
|
|
363
|
+
*/
|
|
364
|
+
shown?: IColumnMetadata[];
|
|
365
|
+
};
|
|
366
|
+
/**
|
|
367
|
+
* Configurations related to the rows of the table.
|
|
368
|
+
*/
|
|
369
|
+
rows?: {
|
|
370
|
+
class?: (rowData: any) => string | string[] | Set<string> | {
|
|
371
|
+
[klass: string]: any;
|
|
372
|
+
};
|
|
373
|
+
style?: (rowData: any) => {
|
|
374
|
+
[klass: string]: any;
|
|
375
|
+
};
|
|
376
|
+
action?: {
|
|
377
|
+
buttons?: ITableButton[];
|
|
378
|
+
header?: string;
|
|
379
|
+
alignmentRight?: boolean;
|
|
380
|
+
width?: number;
|
|
381
|
+
frozen?: boolean;
|
|
382
|
+
resizable?: boolean;
|
|
383
|
+
};
|
|
384
|
+
checkboxSelector?: {
|
|
385
|
+
enabled?: boolean;
|
|
386
|
+
header?: string;
|
|
387
|
+
alignmentRight?: boolean;
|
|
388
|
+
width?: number;
|
|
389
|
+
frozen?: boolean;
|
|
390
|
+
resizable?: boolean;
|
|
391
|
+
};
|
|
392
|
+
singleSelector?: {
|
|
393
|
+
enabled?: boolean;
|
|
394
|
+
metakey?: boolean;
|
|
395
|
+
};
|
|
396
|
+
};
|
|
397
|
+
/** Configurations related to the vertical scroll of the table. */
|
|
398
|
+
verticalScroll?: {
|
|
399
|
+
/**
|
|
400
|
+
* Automatically adjust the table's height to fit its container.
|
|
401
|
+
*
|
|
402
|
+
* When set to `true`, the table will calculate the maximum height dynamically
|
|
403
|
+
* so that it exactly fits its container. This takes precedence over the `height` property.
|
|
404
|
+
*
|
|
405
|
+
* @default true
|
|
406
|
+
*/
|
|
407
|
+
fitToContainer?: boolean;
|
|
408
|
+
/**
|
|
409
|
+
* Fixed vertical height for the table when `fitToContainer` is `false`.
|
|
410
|
+
*
|
|
411
|
+
* - If `fitToContainer` from `verticalScroll` is `true`, this property is ignored.
|
|
412
|
+
* - If set to a value `<= 0`, this is ignored and there will be only verticall scroll enabled if `fitToContainer` from `verticalScroll` is `true`.
|
|
413
|
+
*
|
|
414
|
+
* Use this property to enable vertical scrolling with a fixed height when you do not want
|
|
415
|
+
* the table to dynamically fit its container.
|
|
416
|
+
*
|
|
417
|
+
* @default 0
|
|
418
|
+
*/
|
|
419
|
+
height?: number;
|
|
420
|
+
};
|
|
421
|
+
/** Configurations related to the global search functionality of the table. */
|
|
422
|
+
globalSearch?: {
|
|
423
|
+
/**
|
|
424
|
+
* Enables or disables the global search input.
|
|
425
|
+
*
|
|
426
|
+
* When set to `true`, users can search across all table columns using the global search bar.
|
|
427
|
+
* When `false`, the global search input will not be rendered.
|
|
428
|
+
*
|
|
429
|
+
* @default true
|
|
430
|
+
*/
|
|
431
|
+
enabled?: boolean;
|
|
432
|
+
/**
|
|
433
|
+
* Maximum number of characters allowed in the global search input.
|
|
434
|
+
*
|
|
435
|
+
* Use this to limit the length of search queries and prevent excessively long input.
|
|
436
|
+
*
|
|
437
|
+
* @default 20
|
|
438
|
+
*/
|
|
439
|
+
maxLength?: number;
|
|
440
|
+
};
|
|
441
|
+
predefinedFilters?: {
|
|
442
|
+
[key: string]: IPredefinedFilter[];
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* Configurations related to saved table views.
|
|
446
|
+
*/
|
|
447
|
+
views?: {
|
|
448
|
+
/**
|
|
449
|
+
* Determines how the table views are saved.
|
|
450
|
+
*
|
|
451
|
+
* - `TableViewSaveMode.None`: Do not save any views.
|
|
452
|
+
* - `TableViewSaveMode.SessionStorage`: Save views in the browser session storage (cleared when the tab/window closes).
|
|
453
|
+
* - `TableViewSaveMode.LocalStorage`: Save views in the browser local storage (persistent across sessions).
|
|
454
|
+
* - `TableViewSaveMode.DatabaseStorage`: Save views directly in the database via the backend API. If you are using this method you will need to specify also the `urlGet`and `urlSave`
|
|
455
|
+
*
|
|
456
|
+
* This allows users to keep their custom column orders, filters, sorting, and other table settings
|
|
457
|
+
* according to the selected storage option.
|
|
458
|
+
*
|
|
459
|
+
* @default TableViewSaveMode.None
|
|
460
|
+
*/
|
|
461
|
+
saveMode?: TableViewSaveMode;
|
|
462
|
+
/**
|
|
463
|
+
* Key used to identify the table when saving and retrieving its views.
|
|
464
|
+
*
|
|
465
|
+
* Each table should have a unique `saveKey` so that its saved views (filters, column order, sorting, etc.)
|
|
466
|
+
* do not conflict with other tables.
|
|
467
|
+
*
|
|
468
|
+
* If set to `undefined`, the table will not save or load any views.
|
|
469
|
+
*
|
|
470
|
+
* @default undefined
|
|
471
|
+
*/
|
|
472
|
+
saveKey?: string;
|
|
473
|
+
/**
|
|
474
|
+
* Endpoint URL to fetch saved views from the database.
|
|
475
|
+
*
|
|
476
|
+
* Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
|
|
477
|
+
* The `saveKey` is sent to identify the correct table views.
|
|
478
|
+
*
|
|
479
|
+
* @default undefined
|
|
480
|
+
*/
|
|
481
|
+
urlGet?: string;
|
|
482
|
+
/**
|
|
483
|
+
* Endpoint URL to save table views to the database.
|
|
484
|
+
*
|
|
485
|
+
* Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
|
|
486
|
+
* The `saveKey` is sent to identify the correct table views.
|
|
487
|
+
*
|
|
488
|
+
* @default undefined
|
|
489
|
+
*/
|
|
490
|
+
urlSave?: string;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* Configurations for exporting the table data to Excel.
|
|
494
|
+
*/
|
|
495
|
+
excelReport?: {
|
|
496
|
+
/**
|
|
497
|
+
* Endpoint URL of the API to perform the Excel export.
|
|
498
|
+
*
|
|
499
|
+
* When set, the table will send a request to this endpoint including the properties
|
|
500
|
+
* specified by the user, such as selected columns, filters, and sort order, to generate
|
|
501
|
+
* the export.
|
|
502
|
+
*
|
|
503
|
+
* If set to `undefined`, Excel export functionality will be disabled.
|
|
504
|
+
*
|
|
505
|
+
* @default undefined
|
|
506
|
+
*/
|
|
507
|
+
url?: string;
|
|
508
|
+
/**
|
|
509
|
+
* Default title shown in the Excel export modal when preparing the export.
|
|
510
|
+
*
|
|
511
|
+
* If the string is empty (after trimming) **and** `titleAllowUserEdit` is `false`,
|
|
512
|
+
* the export button will be disabled.
|
|
513
|
+
*
|
|
514
|
+
* @default "Report"
|
|
515
|
+
*/
|
|
516
|
+
defaultTitle?: string;
|
|
517
|
+
/**
|
|
518
|
+
* Determines whether the user can edit the title of the Excel file in the export modal.
|
|
519
|
+
*
|
|
520
|
+
* - If `true`, the user can modify the title before exporting.
|
|
521
|
+
* - If `false`, the title is fixed to `defaultTitle`.
|
|
522
|
+
*
|
|
523
|
+
* @default true
|
|
524
|
+
*/
|
|
525
|
+
titleAllowUserEdit?: boolean;
|
|
526
|
+
};
|
|
527
|
+
copyToClipboardTime?: number;
|
|
528
|
+
}
|
|
529
|
+
declare const DEFAULT_TABLE_OPTIONS: ITableOptions;
|
|
530
|
+
|
|
186
531
|
/**
|
|
187
532
|
* Interface representing the return structure for PrimeNG post requests when gathering data to represent in a table.
|
|
188
533
|
*/
|
|
@@ -221,6 +566,7 @@ declare class ECSPrimengTableService {
|
|
|
221
566
|
fetchTableConfiguration(url: string): Observable<HttpResponse<ITableConfiguration>>;
|
|
222
567
|
fetchTableData(url: string, postData: ITableQueryRequest): Observable<HttpResponse<ITablePagedResponse>>;
|
|
223
568
|
fetchExcelReport(url: string, postData: IExcelExportRequest): Observable<HttpResponse<Blob>>;
|
|
569
|
+
getIconBlob(url: string): Observable<HttpResponse<Blob>>;
|
|
224
570
|
downloadFile(data: Blob, fileName: string, contentType: string): void;
|
|
225
571
|
handleTableError(error: any, customTitle?: string): void;
|
|
226
572
|
orderColumnsWithFrozens(colsToOrder: IColumnMetadata[]): IColumnMetadata[];
|
|
@@ -258,45 +604,7 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
258
604
|
private tableService;
|
|
259
605
|
private notification;
|
|
260
606
|
constructor(tableService: ECSPrimengTableService, notification: ECSPrimengTableNotificationService);
|
|
261
|
-
|
|
262
|
-
data: any[];
|
|
263
|
-
columnsToShow: IColumnMetadata[];
|
|
264
|
-
computeScrollHeight: boolean;
|
|
265
|
-
globalSearchEnabled: boolean;
|
|
266
|
-
globalSearchMaxLength: number;
|
|
267
|
-
globalSearchPlaceholder: string;
|
|
268
|
-
columnEditorEnabled: boolean;
|
|
269
|
-
urlColumnsSource: string;
|
|
270
|
-
urlDataSource: string;
|
|
271
|
-
urlExcelReport: string | null;
|
|
272
|
-
predifinedFiltersCollection: {
|
|
273
|
-
[key: string]: IPredifinedFilter[];
|
|
274
|
-
};
|
|
275
|
-
predifinedFiltersNoSelectionPlaceholder: string;
|
|
276
|
-
predifinedFiltersCollectionSelectedValuesText: string;
|
|
277
|
-
rowActionButtons: ITableButton[];
|
|
278
|
-
headerActionButtons: ITableButton[];
|
|
279
|
-
copyCellDataToClipboardTimeSecs: number;
|
|
280
|
-
actionsColumnAligmentRight: boolean;
|
|
281
|
-
actionsColumnWidth: number;
|
|
282
|
-
actionsColumnFrozen: boolean;
|
|
283
|
-
rowSelectorColumnActive: boolean;
|
|
284
|
-
rowSelectorColumName: string;
|
|
285
|
-
rowSelectorColumnAligmentRight: boolean;
|
|
286
|
-
rowSelectorColumnWidth: number;
|
|
287
|
-
rowSelectorColumnFrozen: boolean;
|
|
288
|
-
actionsColumnResizable: boolean;
|
|
289
|
-
actionColumnName: string;
|
|
290
|
-
rowselectorColumnResizable: boolean;
|
|
291
|
-
noDataFoundText: string;
|
|
292
|
-
showClearSortAndFilters: boolean;
|
|
293
|
-
excelReportTitleDefault: string;
|
|
294
|
-
excelReportTitleAllowUserEdit: boolean;
|
|
295
|
-
tableViewSaveAs: TableViewSaveMode;
|
|
296
|
-
tableViewSaveKey: string;
|
|
297
|
-
viewsGetSourceURL: string;
|
|
298
|
-
viewsSaveSourceURL: string;
|
|
299
|
-
maxTableViews: number;
|
|
607
|
+
tableOptions: ITableOptions;
|
|
300
608
|
onRowCheckboxChange: EventEmitter<{
|
|
301
609
|
rowID: any;
|
|
302
610
|
selected: boolean;
|
|
@@ -309,6 +617,7 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
309
617
|
rowID: any;
|
|
310
618
|
rowData: any;
|
|
311
619
|
}>;
|
|
620
|
+
onDataEndUpdate: EventEmitter<void>;
|
|
312
621
|
viewsModalShow: boolean;
|
|
313
622
|
tableViewCurrentSelectedAlias: string | null;
|
|
314
623
|
tableViewsFirstFetchDone: boolean;
|
|
@@ -318,7 +627,6 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
318
627
|
selectedRowsCheckbox: any[];
|
|
319
628
|
dt: Table;
|
|
320
629
|
showRefreshData: boolean;
|
|
321
|
-
scrollHeight: string;
|
|
322
630
|
globalSearchText: string | null;
|
|
323
631
|
tableViewsList: ITableView[];
|
|
324
632
|
tableViews_menuItems: any[];
|
|
@@ -344,12 +652,13 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
344
652
|
filteredColumnData: any[];
|
|
345
653
|
private initialColumnWidths;
|
|
346
654
|
private initialTableWidth;
|
|
347
|
-
|
|
655
|
+
predefinedFiltersSelectedValuesCollection: {
|
|
348
656
|
[key: string]: any[];
|
|
349
657
|
};
|
|
350
658
|
private copyCellDataTimer;
|
|
351
659
|
tableLazyLoadEventInformation: TableLazyLoadEvent;
|
|
352
660
|
private initialConfigurationFetched;
|
|
661
|
+
private maxViews;
|
|
353
662
|
ngOnInit(): void;
|
|
354
663
|
tableContainer: ElementRef;
|
|
355
664
|
headerContainer: ElementRef;
|
|
@@ -357,13 +666,13 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
357
666
|
ngAfterViewInit(): void;
|
|
358
667
|
onResize(): void;
|
|
359
668
|
calculateScrollHeight(): void;
|
|
669
|
+
get scrollHeightValue(): string;
|
|
360
670
|
/**
|
|
361
671
|
* Used to update the data of a table externally outside the component. Use this method instead of 'updateData' to force the data updata of a table
|
|
362
672
|
*
|
|
363
|
-
* @param {(optionalData?: any) => void} [continueAction] - Optional action to execute after data retrieval if it succeeded.
|
|
364
|
-
* @param {boolean} [uponContinueActionEndModalHttp=false] - Optional flag to set the loading indicator to inactive after data retrieval.
|
|
365
673
|
*/
|
|
366
|
-
updateData(
|
|
674
|
+
updateData(): void;
|
|
675
|
+
canFetchData(): boolean;
|
|
367
676
|
fetchTableConfiguration(resetTableView?: boolean): void;
|
|
368
677
|
private handleTableConfigurationResponse;
|
|
369
678
|
refreshData(event: any): void;
|
|
@@ -404,16 +713,16 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
404
713
|
*/
|
|
405
714
|
private hasFilters;
|
|
406
715
|
getColumnStyle(col: any, headerCols?: boolean): Record<string, string>;
|
|
407
|
-
|
|
716
|
+
getPredefinedFilterValues(columnKeyName: string): IPredefinedFilter[];
|
|
408
717
|
getFrozenColumnAlignAsText(frozenColumnAlign: FrozenColumnAlign): string;
|
|
409
718
|
getDataTypeAsText(dataType: DataType): string;
|
|
410
719
|
/**
|
|
411
720
|
* Updates the filters of a PrimeNG data table based on predefined filter changes.
|
|
412
721
|
*
|
|
413
722
|
* @param {string} filterName - The name of the filter to be updated.
|
|
414
|
-
* @param {
|
|
723
|
+
* @param {IPrimengPredefinedFilter[]} selectedValues - An array of selected predefined filter values.
|
|
415
724
|
*/
|
|
416
|
-
|
|
725
|
+
onPredefinedFilterChange(filterName: string, selectedValues: IPredefinedFilter[]): void;
|
|
417
726
|
/**
|
|
418
727
|
* Retrieves the number of values selected for a predefined filter.
|
|
419
728
|
*
|
|
@@ -423,7 +732,7 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
423
732
|
* @param {string} columnKeyName - The key name of the column for which to retrieve the number of selected values.
|
|
424
733
|
* @returns {string} A string indicating the number of selected values for the specified column.
|
|
425
734
|
*/
|
|
426
|
-
|
|
735
|
+
predefinedFiltersSelectedValuesText(columnKeyName: string): string;
|
|
427
736
|
handleButtonsClick(action: (rowData: any) => void, rowData?: any): void;
|
|
428
737
|
/**
|
|
429
738
|
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
@@ -448,9 +757,15 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
448
757
|
private updateColumnsSpecialProperties;
|
|
449
758
|
openExcelExport(): void;
|
|
450
759
|
generateExcelReport(event: any): void;
|
|
760
|
+
updateIconBlobsForCollections(): void;
|
|
451
761
|
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTable, never>;
|
|
452
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ECSPrimengTable, "ecs-primeng-table", never, { "
|
|
762
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ECSPrimengTable, "ecs-primeng-table", never, { "tableOptions": { "alias": "tableOptions"; "required": false; }; }, { "onRowCheckboxChange": "onRowCheckboxChange"; "onRowSelect": "onRowSelect"; "onRowUnselect": "onRowUnselect"; "onDataEndUpdate": "onDataEndUpdate"; }, never, never, true, never>;
|
|
453
763
|
}
|
|
454
764
|
|
|
455
|
-
|
|
456
|
-
|
|
765
|
+
/**
|
|
766
|
+
* Create table options based on defaults, with optional overrides.
|
|
767
|
+
*/
|
|
768
|
+
declare function createTableOptions(overrides?: Partial<ITableOptions>): ITableOptions;
|
|
769
|
+
|
|
770
|
+
export { CellOverflowBehaviour, DEFAULT_TABLE_OPTIONS, DataAlignHorizontal, DataAlignVertical, DataType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableNotificationService, ECSPrimengTableService, FrozenColumnAlign, TableViewSaveMode, createTableOptions };
|
|
771
|
+
export type { IColumnMetadata, IExcelExportRequest, IPredefinedFilter, ITableButton, ITableConfiguration, ITableOptions, ITablePagedResponse, ITableQueryRequest, ITableView, ITableViewData };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternalcodestudio/primeng-table",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.5",
|
|
4
4
|
"description": "ECS reusable Angular PrimeNG table component with advanced server-side filters. Designed to offload filtering logic to any backend API.",
|
|
5
5
|
"author": "ECS (Eternal CODE Studio)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"peerDependencies": {
|
|
17
17
|
"@angular/common": ">=20.0.0",
|
|
18
18
|
"@angular/core": ">=20.0.0",
|
|
19
|
+
"@angular/animations": ">=20.0.0",
|
|
19
20
|
"primeng": ">=20.0.0",
|
|
20
21
|
"primeicons": ">=7.0.0"
|
|
21
22
|
},
|
|
@@ -28,10 +29,10 @@
|
|
|
28
29
|
},
|
|
29
30
|
"repository": {
|
|
30
31
|
"type": "git",
|
|
31
|
-
"url": "git+https://github.com/AIO1/
|
|
32
|
+
"url": "git+https://github.com/AIO1/ECSPrimengTable.git"
|
|
32
33
|
},
|
|
33
34
|
"bugs": {
|
|
34
|
-
"url": "https://github.com/AIO1/
|
|
35
|
+
"url": "https://github.com/AIO1/ECSPrimengTable/issues"
|
|
35
36
|
},
|
|
36
37
|
"homepage": "https://eternalcodestudio.com/",
|
|
37
38
|
"sideEffects": false,
|