@eternalcodestudio/primeng-table 20.0.12 → 20.0.13
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/index.d.ts
CHANGED
|
@@ -1,188 +1,35 @@
|
|
|
1
|
+
import { HttpResponse, HttpHeaders } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
1
3
|
import * as i0 from '@angular/core';
|
|
2
4
|
import { OnInit, AfterViewInit, EventEmitter, ElementRef } from '@angular/core';
|
|
3
5
|
import { Table, TableLazyLoadEvent, TableRowSelectEvent, TableRowUnSelectEvent, TablePageEvent } from 'primeng/table';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { HttpResponse, HttpHeaders } from '@angular/common/http';
|
|
6
6
|
import { SortMeta, MenuItem } from 'primeng/api';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Provides a consistent interface for making GET and POST requests to the backend.
|
|
12
|
-
* Implementations must define how requests are executed, including error handling,
|
|
13
|
-
* headers, and response processing.
|
|
14
|
-
*/
|
|
15
|
-
declare abstract class ECSPrimengTableHttpService {
|
|
16
|
-
/**
|
|
17
|
-
* Performs a GET request to the specified service endpoint.
|
|
18
|
-
*
|
|
19
|
-
* @template T The expected response type.
|
|
20
|
-
* @param servicePoint The endpoint URL or path for the GET request.
|
|
21
|
-
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
22
|
-
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
23
|
-
*/
|
|
24
|
-
abstract handleHttpGetRequest<T>(servicePoint: string, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
25
|
-
/**
|
|
26
|
-
* Performs a POST request to the specified service endpoint.
|
|
27
|
-
*
|
|
28
|
-
* @template T The expected response type.
|
|
29
|
-
* @param servicePoint The endpoint URL or path for the POST request.
|
|
30
|
-
* @param data The payload to send in the POST request body.
|
|
31
|
-
* @param httpOptions Optional HTTP headers to include in the request.
|
|
32
|
-
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
33
|
-
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
34
|
-
*/
|
|
35
|
-
abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
36
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableHttpService, never>;
|
|
37
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableHttpService>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Abstract service for handling notifications in **ECS Primeng table**.
|
|
42
|
-
*
|
|
43
|
-
* Provides a consistent interface for displaying and clearing toast notifications.
|
|
44
|
-
* Implementations must define how the notifications are managed.
|
|
45
|
-
*/
|
|
46
|
-
declare abstract class ECSPrimengTableNotificationService {
|
|
47
|
-
/**
|
|
48
|
-
* Displays a toast notification.
|
|
49
|
-
*
|
|
50
|
-
* @param severity The severity level of the notification (e.g., 'success', 'info', 'warn', 'error').
|
|
51
|
-
* @param title The title of the toast message.
|
|
52
|
-
* @param message The detailed message of the toast.
|
|
53
|
-
*/
|
|
54
|
-
abstract showToast(severity: string, title: string, message: string): void;
|
|
55
|
-
/**
|
|
56
|
-
* Clears all currently displayed toast notifications.
|
|
57
|
-
*/
|
|
58
|
-
abstract clearToasts(): void;
|
|
59
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableNotificationService, never>;
|
|
60
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableNotificationService>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Interface representing a table action button, applicable for both header and row buttons.
|
|
65
|
-
*/
|
|
66
|
-
interface ITableButton {
|
|
67
|
-
/**
|
|
68
|
-
* Optional. The icon to display on the button.
|
|
69
|
-
* Should be a valid icon name from PrimeNG, Material Icons, Font Awesome, or similar libraries.
|
|
70
|
-
*/
|
|
71
|
-
icon?: string;
|
|
72
|
-
/**
|
|
73
|
-
* Optional. The position of the icon relative to the button label.
|
|
74
|
-
* Defaults to "left". Possible values are:
|
|
75
|
-
* - "left"
|
|
76
|
-
* - "right"
|
|
77
|
-
* - "top"
|
|
78
|
-
* - "bottom"
|
|
79
|
-
*/
|
|
80
|
-
iconPos?: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional. The text label displayed on the button.
|
|
83
|
-
*/
|
|
84
|
-
label?: string;
|
|
85
|
-
/**
|
|
86
|
-
* Optional. If true, the button will be round. Defaults to false.
|
|
87
|
-
*/
|
|
88
|
-
rounded?: boolean;
|
|
89
|
-
/**
|
|
90
|
-
* Optional. If true, adds a shadow to indicate elevation. Defaults to false.
|
|
91
|
-
*/
|
|
92
|
-
raised?: boolean;
|
|
93
|
-
/**
|
|
94
|
-
* Optional. Specifies the variant of the button.
|
|
95
|
-
* Can be null (default), "text", or "outlined".
|
|
96
|
-
*/
|
|
97
|
-
variant?: string;
|
|
98
|
-
/**
|
|
99
|
-
* Optional. The CSS class to apply for button styling.
|
|
100
|
-
* Example: "p-button-success" or "custom-class".
|
|
101
|
-
*/
|
|
102
|
-
color?: string;
|
|
103
|
-
/**
|
|
104
|
-
* Optional. Additional inline CSS styles for the button.
|
|
105
|
-
*/
|
|
106
|
-
style?: string;
|
|
107
|
-
/**
|
|
108
|
-
* Optional. Function that determines whether the button should be visible for a given row.
|
|
109
|
-
* @param rowData The row data object. Null for header buttons.
|
|
110
|
-
* @returns True if the button should be visible; false otherwise.
|
|
111
|
-
*/
|
|
112
|
-
visibleCondition?: (rowData: any) => boolean;
|
|
113
|
-
/**
|
|
114
|
-
* Optional. Function that determines whether the button should be displayed for a given row.
|
|
115
|
-
*
|
|
116
|
-
* Ignored if `visibleCondition` returns false.
|
|
117
|
-
* @param rowData The row data object. Null for header buttons.
|
|
118
|
-
* @returns True if the button should be enabled; false otherwise.
|
|
119
|
-
*/
|
|
120
|
-
enabledCondition?: (rowData: any) => boolean;
|
|
121
|
-
/**
|
|
122
|
-
* Optional. Controls behavior when `enabledCondition` returns false.
|
|
123
|
-
* - If `true`, the button will be hidden when the 'enabledCondition' is not met.
|
|
124
|
-
* - If `false` or `undefined`, the button will remain visible but disabled if 'enabledCondition' is not met.
|
|
125
|
-
*
|
|
126
|
-
* Ignored if `visibleCondition` returns false.
|
|
127
|
-
*/
|
|
128
|
-
conditionFailHide?: boolean;
|
|
129
|
-
/**
|
|
130
|
-
* Optional. The action to execute when the button is clicked.
|
|
131
|
-
* @param rowData The row data object of the clicked row. Null for header buttons.
|
|
132
|
-
*/
|
|
133
|
-
action?: (rowData: any) => void;
|
|
134
|
-
/**
|
|
135
|
-
* Optional. Tooltip text to display when the user hovers over the button.
|
|
136
|
-
*/
|
|
137
|
-
tooltip?: string;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
interface ITableQueryRequest {
|
|
141
|
-
page: number;
|
|
142
|
-
pageSize: number;
|
|
143
|
-
sort?: any;
|
|
144
|
-
filter: any;
|
|
145
|
-
globalFilter?: string | null;
|
|
146
|
-
columns?: string[];
|
|
147
|
-
dateFormat: string;
|
|
148
|
-
dateTimezone: string;
|
|
149
|
-
dateCulture: string;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
interface IExcelExportRequest extends ITableQueryRequest {
|
|
153
|
-
filename: string;
|
|
154
|
-
allColumns: boolean;
|
|
155
|
-
applyFilters: boolean;
|
|
156
|
-
applySorts: boolean;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Enum representing how content that overflows a table cell should be handled.
|
|
9
|
+
* Defines how content that overflows a table cell is displayed.
|
|
161
10
|
*
|
|
162
11
|
* @remarks
|
|
163
|
-
*
|
|
12
|
+
* This enumeration specifies the visual behavior of cell content when it exceeds the cell’s width.
|
|
164
13
|
*/
|
|
165
14
|
declare enum CellOverflowBehaviour {
|
|
166
|
-
/**
|
|
15
|
+
/** The overflowing content is clipped and not visible. */
|
|
167
16
|
Hidden = 0,
|
|
168
|
-
/**
|
|
169
|
-
Wrap = 1
|
|
170
|
-
/** Content is truncated and an ellipsis (...) is shown at the end. */
|
|
171
|
-
Ellipsis = 2
|
|
17
|
+
/** The content wraps onto multiple lines to fit within the cell. */
|
|
18
|
+
Wrap = 1
|
|
172
19
|
}
|
|
173
20
|
|
|
174
21
|
/**
|
|
175
|
-
*
|
|
22
|
+
* Defines the horizontal alignment of content within a table cell.
|
|
176
23
|
*
|
|
177
24
|
* @remarks
|
|
178
|
-
*
|
|
25
|
+
* Specifies how the content inside a cell is positioned horizontally relative to the cell's width.
|
|
179
26
|
*/
|
|
180
27
|
declare enum DataAlignHorizontal {
|
|
181
|
-
/**
|
|
28
|
+
/** Content is aligned to the left side of the cell. */
|
|
182
29
|
Left = 0,
|
|
183
|
-
/**
|
|
30
|
+
/** Content is aligned to the center of the cell. */
|
|
184
31
|
Center = 1,
|
|
185
|
-
/**
|
|
32
|
+
/** Content is aligned to the right side of the cell. */
|
|
186
33
|
Right = 2
|
|
187
34
|
}
|
|
188
35
|
|
|
@@ -245,7 +92,7 @@ declare enum FrozenColumnAlign {
|
|
|
245
92
|
* sorting) are persisted.
|
|
246
93
|
*/
|
|
247
94
|
declare enum TableViewSaveMode {
|
|
248
|
-
/**
|
|
95
|
+
/** Views are disabled. */
|
|
249
96
|
None = 0,
|
|
250
97
|
/** Save the table view state in the browser's sessionStorage (cleared on tab close). */
|
|
251
98
|
SessionStorage = 1,
|
|
@@ -255,33 +102,61 @@ declare enum TableViewSaveMode {
|
|
|
255
102
|
DatabaseStorage = 3
|
|
256
103
|
}
|
|
257
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Represents the metadata for a column in a table.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* Provides configuration for column behavior, appearance, and user interactions.
|
|
110
|
+
*/
|
|
258
111
|
interface IColumnMetadata {
|
|
112
|
+
/** The key or identifier for the column's data field. */
|
|
259
113
|
field: string;
|
|
114
|
+
/** The display name of the column header. */
|
|
260
115
|
header: string;
|
|
116
|
+
/** The type of data contained in the column. */
|
|
261
117
|
dataType: DataType;
|
|
118
|
+
/** The horizontal alignment of the column content. */
|
|
262
119
|
dataAlignHorizontal: DataAlignHorizontal;
|
|
120
|
+
/** Indicates whether the horizontal alignment can be modified by the user. */
|
|
263
121
|
dataAlignHorizontalAllowUserEdit: boolean;
|
|
122
|
+
/** The vertical alignment of the column content. */
|
|
264
123
|
dataAlignVertical: DataAlignVertical;
|
|
124
|
+
/** Indicates whether the vertical alignment can be modified by the user. */
|
|
265
125
|
dataAlignVerticalAllowUserEdit: boolean;
|
|
126
|
+
/** Determines if the column can be hidden. */
|
|
266
127
|
canBeHidden: boolean;
|
|
128
|
+
/** Determines if the column should initially be hidden. */
|
|
267
129
|
startHidden: boolean;
|
|
130
|
+
/** Determines if the column can be resized by the user. */
|
|
268
131
|
canBeResized: boolean;
|
|
132
|
+
/** Determines if the column can be reordered by the user. */
|
|
269
133
|
canBeReordered: boolean;
|
|
134
|
+
/** Determines if the column can be sorted. */
|
|
270
135
|
canBeSorted: boolean;
|
|
136
|
+
/** Determines if the column can be filtered. */
|
|
271
137
|
canBeFiltered: boolean;
|
|
138
|
+
/** Name of predefined filter values, if any. */
|
|
272
139
|
filterPredefinedValuesName: string;
|
|
140
|
+
/** Determines if the column can be included in global filtering. */
|
|
273
141
|
canBeGlobalFiltered: boolean;
|
|
142
|
+
/** Description or tooltip text for the column. */
|
|
274
143
|
columnDescription: string;
|
|
144
|
+
/** Determines if a tooltip should be shown for the column data. */
|
|
275
145
|
dataTooltipShow: boolean;
|
|
146
|
+
/** Custom source for the tooltip content, if applicable. */
|
|
276
147
|
dataTooltipCustomColumnSource: string;
|
|
148
|
+
/** Alignment for frozen columns (left or right). */
|
|
277
149
|
frozenColumnAlign: FrozenColumnAlign;
|
|
150
|
+
/** Specifies how overflowing content is handled within the cell. */
|
|
278
151
|
cellOverflowBehaviour: CellOverflowBehaviour;
|
|
152
|
+
/** Indicates whether the cell overflow behavior can be modified by the user. */
|
|
279
153
|
cellOverflowBehaviourAllowUserEdit: boolean;
|
|
154
|
+
/** Initial width of the column in pixels. */
|
|
280
155
|
initialWidth: number;
|
|
281
156
|
}
|
|
282
157
|
|
|
283
158
|
/**
|
|
284
|
-
* Represents a predefined filter value for a column in **ECS PrimeNG
|
|
159
|
+
* Represents a predefined filter value for a column in **ECS PrimeNG table**.
|
|
285
160
|
*
|
|
286
161
|
* Allows displaying a value as text, tag, icon or image (from URL or blob) with optional styles and colors.
|
|
287
162
|
*/
|
|
@@ -361,15 +236,206 @@ interface IPredefinedFilter {
|
|
|
361
236
|
action?: (rowData: any, option: IPredefinedFilter) => void;
|
|
362
237
|
}
|
|
363
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Interface representing a table action button, applicable for both header and row buttons.
|
|
241
|
+
*/
|
|
242
|
+
interface ITableButton {
|
|
243
|
+
/**
|
|
244
|
+
* Optional. The icon to display on the button.
|
|
245
|
+
* Should be a valid icon name from PrimeNG, Material Icons, Font Awesome, or similar libraries.
|
|
246
|
+
*/
|
|
247
|
+
icon?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Optional. The position of the icon relative to the button label.
|
|
250
|
+
* Defaults to "left". Possible values are:
|
|
251
|
+
* - "left"
|
|
252
|
+
* - "right"
|
|
253
|
+
* - "top"
|
|
254
|
+
* - "bottom"
|
|
255
|
+
*/
|
|
256
|
+
iconPos?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Optional. The text label displayed on the button.
|
|
259
|
+
*/
|
|
260
|
+
label?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Optional. If true, the button will be round. Defaults to false.
|
|
263
|
+
*/
|
|
264
|
+
rounded?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Optional. If true, adds a shadow to indicate elevation. Defaults to false.
|
|
267
|
+
*/
|
|
268
|
+
raised?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Optional. Specifies the variant of the button.
|
|
271
|
+
* Can be null (default), "text", or "outlined".
|
|
272
|
+
*/
|
|
273
|
+
variant?: string;
|
|
274
|
+
/**
|
|
275
|
+
* Optional. The CSS class to apply for button styling.
|
|
276
|
+
* Example: "p-button-success" or "custom-class".
|
|
277
|
+
*/
|
|
278
|
+
color?: string;
|
|
279
|
+
/**
|
|
280
|
+
* Optional. Additional inline CSS styles for the button.
|
|
281
|
+
*/
|
|
282
|
+
style?: string;
|
|
283
|
+
/**
|
|
284
|
+
* Optional. Function that determines whether the button should be visible for a given row.
|
|
285
|
+
* @param rowData The row data object. Null for header buttons.
|
|
286
|
+
* @returns True if the button should be visible; false otherwise.
|
|
287
|
+
*/
|
|
288
|
+
visibleCondition?: (rowData: any) => boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Optional. Function that determines whether the button should be displayed for a given row.
|
|
291
|
+
*
|
|
292
|
+
* Ignored if `visibleCondition` returns false.
|
|
293
|
+
* @param rowData The row data object. Null for header buttons.
|
|
294
|
+
* @returns True if the button should be enabled; false otherwise.
|
|
295
|
+
*/
|
|
296
|
+
enabledCondition?: (rowData: any) => boolean;
|
|
297
|
+
/**
|
|
298
|
+
* Optional. Controls behavior when `enabledCondition` returns false.
|
|
299
|
+
* - If `true`, the button will be hidden when the 'enabledCondition' is not met.
|
|
300
|
+
* - If `false` or `undefined`, the button will remain visible but disabled if 'enabledCondition' is not met.
|
|
301
|
+
*
|
|
302
|
+
* Ignored if `visibleCondition` returns false.
|
|
303
|
+
*/
|
|
304
|
+
conditionFailHide?: boolean;
|
|
305
|
+
/**
|
|
306
|
+
* Optional. The action to execute when the button is clicked.
|
|
307
|
+
* @param rowData The row data object of the clicked row. Null for header buttons.
|
|
308
|
+
*/
|
|
309
|
+
action?: (rowData: any) => void;
|
|
310
|
+
/**
|
|
311
|
+
* Optional. Tooltip text to display when the user hovers over the button.
|
|
312
|
+
*/
|
|
313
|
+
tooltip?: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Represents a request for querying table data with pagination, sorting, and filtering.
|
|
318
|
+
*
|
|
319
|
+
* @remarks
|
|
320
|
+
* Includes information about page, page size, sorting, filters, and date formatting options.
|
|
321
|
+
*/
|
|
322
|
+
interface ITableQueryRequest {
|
|
323
|
+
/** The current page number. */
|
|
324
|
+
page: number;
|
|
325
|
+
/** The number of items per page. */
|
|
326
|
+
pageSize: number;
|
|
327
|
+
/** Optional sorting configuration. */
|
|
328
|
+
sort?: any;
|
|
329
|
+
/** Filter criteria for the query. */
|
|
330
|
+
filter: any;
|
|
331
|
+
/** Optional global filter applied across all columns. */
|
|
332
|
+
globalFilter?: string | null;
|
|
333
|
+
/** Optional array of column names to include in the query. */
|
|
334
|
+
columns?: string[];
|
|
335
|
+
/** The date format used for query parameters. */
|
|
336
|
+
dateFormat: string;
|
|
337
|
+
/** The timezone used for formatting date values. */
|
|
338
|
+
dateTimezone: string;
|
|
339
|
+
/** The culture/locale used for formatting dates and numbers. */
|
|
340
|
+
dateCulture: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Represents the request parameters for exporting table data to Excel.
|
|
345
|
+
*
|
|
346
|
+
* @remarks
|
|
347
|
+
* Extends `ITableQueryRequest` to include Excel-specific options such as filename,
|
|
348
|
+
* column selection, and whether to apply current filters and sorts.
|
|
349
|
+
*/
|
|
350
|
+
interface IExcelExportRequest extends ITableQueryRequest {
|
|
351
|
+
/** The desired name of the exported Excel file. */
|
|
352
|
+
filename: string;
|
|
353
|
+
/** Determines whether all columns should be included in the export. */
|
|
354
|
+
allColumns: boolean;
|
|
355
|
+
/** Determines whether the current table filters should be applied in the export. */
|
|
356
|
+
applyFilters: boolean;
|
|
357
|
+
/** Determines whether the current table sorting should be applied in the export. */
|
|
358
|
+
applySorts: boolean;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Represents the configuration settings for a table.
|
|
363
|
+
*
|
|
364
|
+
* @remarks
|
|
365
|
+
* Contains column definitions, pagination options, date formatting, and other table-related settings.
|
|
366
|
+
*/
|
|
364
367
|
interface ITableConfiguration {
|
|
368
|
+
/** Array of metadata objects defining each column in the table. */
|
|
365
369
|
columnsInfo: IColumnMetadata[];
|
|
370
|
+
/** Allowed options for the number of items displayed per page. */
|
|
366
371
|
allowedItemsPerPage: number[];
|
|
372
|
+
/** The format used for displaying dates in the table. */
|
|
367
373
|
dateFormat: string;
|
|
374
|
+
/** The timezone applied when formatting date values. */
|
|
368
375
|
dateTimezone: string;
|
|
376
|
+
/** The culture/locale used for date and number formatting. */
|
|
369
377
|
dateCulture: string;
|
|
378
|
+
/** Maximum number of table views that can be saved or tracked. */
|
|
370
379
|
maxViews: number;
|
|
371
380
|
}
|
|
372
381
|
|
|
382
|
+
/**
|
|
383
|
+
* Represents a paged response from a table query.
|
|
384
|
+
*
|
|
385
|
+
* @remarks
|
|
386
|
+
* Provides information about the current page, total records, and the data for the page.
|
|
387
|
+
*/
|
|
388
|
+
interface ITablePagedResponse {
|
|
389
|
+
/** The current page number. */
|
|
390
|
+
page: number;
|
|
391
|
+
/** Total number of records after applying any filters. */
|
|
392
|
+
totalRecords: number;
|
|
393
|
+
/** Total number of records without applying any filters. */
|
|
394
|
+
totalRecordsNotFiltered: number;
|
|
395
|
+
/** The data items for the current page. */
|
|
396
|
+
data: any;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Represents the current state and configuration of a table view.
|
|
401
|
+
*
|
|
402
|
+
* @remarks
|
|
403
|
+
* Includes information about displayed columns, widths, sorting, filtering, and pagination.
|
|
404
|
+
*/
|
|
405
|
+
interface ITableViewData {
|
|
406
|
+
/** Array of columns currently visible in the table. */
|
|
407
|
+
columnsShown: IColumnMetadata[];
|
|
408
|
+
/** The total width of the table in pixels. */
|
|
409
|
+
tableWidth: any;
|
|
410
|
+
/** Widths of individual columns as a formatted string (in pixels). */
|
|
411
|
+
columnsWidth: string;
|
|
412
|
+
/** Sorting metadata for multiple columns, if applicable. */
|
|
413
|
+
multiSortMeta: SortMeta[] | null | undefined;
|
|
414
|
+
/** Current filter settings applied to the table. */
|
|
415
|
+
filters: any;
|
|
416
|
+
/** Text used for global search across all columns, if any. */
|
|
417
|
+
globalSearchText: string | null;
|
|
418
|
+
/** The current page number. */
|
|
419
|
+
currentPage: number;
|
|
420
|
+
/** The number of rows displayed per page. */
|
|
421
|
+
currentRowsPerPage: number;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/**
|
|
425
|
+
* Represents a saved or active view of a table.
|
|
426
|
+
*
|
|
427
|
+
* @remarks
|
|
428
|
+
* Contains information about whether the view is currently active, its alias, and the view data.
|
|
429
|
+
*/
|
|
430
|
+
interface ITableView {
|
|
431
|
+
/** Indicates if this view is the last active one. */
|
|
432
|
+
lastActive: boolean;
|
|
433
|
+
/** Alias or name of the view. */
|
|
434
|
+
viewAlias: string;
|
|
435
|
+
/** The detailed data and configuration for this view. */
|
|
436
|
+
viewData: ITableViewData;
|
|
437
|
+
}
|
|
438
|
+
|
|
373
439
|
/** Configuration options for ECS Primeng table */
|
|
374
440
|
interface ITableOptions {
|
|
375
441
|
/**
|
|
@@ -414,6 +480,66 @@ interface ITableOptions {
|
|
|
414
480
|
* @default []
|
|
415
481
|
*/
|
|
416
482
|
data?: any[];
|
|
483
|
+
/**
|
|
484
|
+
* Configuration options for the table description section.
|
|
485
|
+
*/
|
|
486
|
+
description?: {
|
|
487
|
+
/**
|
|
488
|
+
* Icon displayed alongside the table description.
|
|
489
|
+
* You can use any PrimeIcons class or icons from third-party libraries
|
|
490
|
+
* such as Material Icons or Font Awesome.
|
|
491
|
+
*
|
|
492
|
+
* @default "pi pi-info-circle"
|
|
493
|
+
*/
|
|
494
|
+
icon?: string;
|
|
495
|
+
/**
|
|
496
|
+
* Determines how the description text is displayed.
|
|
497
|
+
* - `true`, the `text` content is shown as a tooltip when hovering
|
|
498
|
+
* over the description icon.
|
|
499
|
+
* - `false`, the `text` is displayed inline to the right of the icon.
|
|
500
|
+
*
|
|
501
|
+
* @default true
|
|
502
|
+
*/
|
|
503
|
+
tooltip?: boolean;
|
|
504
|
+
/**
|
|
505
|
+
* The description content to display.
|
|
506
|
+
* If left undefined or string empty, the table description will not be rendered.
|
|
507
|
+
* Supports basic HTML for rich text formatting.
|
|
508
|
+
*
|
|
509
|
+
* @default undefined
|
|
510
|
+
*/
|
|
511
|
+
text?: string;
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* Configuration options for the table legend.
|
|
515
|
+
*/
|
|
516
|
+
legend?: {
|
|
517
|
+
/**
|
|
518
|
+
* The content to be displayed in the popover of the legend. Can be HTML rich.
|
|
519
|
+
*
|
|
520
|
+
* @default undefined
|
|
521
|
+
*/
|
|
522
|
+
content?: string;
|
|
523
|
+
/**
|
|
524
|
+
* Configuration options for the button that displays the popover of the table legend.
|
|
525
|
+
*/
|
|
526
|
+
button?: {
|
|
527
|
+
/**
|
|
528
|
+
* Icon displayed alongside the button of the table legend.
|
|
529
|
+
* You can use any PrimeIcons class or icons from third-party libraries
|
|
530
|
+
* such as Material Icons or Font Awesome.
|
|
531
|
+
*
|
|
532
|
+
* @default "pi pi-bars"
|
|
533
|
+
*/
|
|
534
|
+
icon?: string;
|
|
535
|
+
/**
|
|
536
|
+
* The text shown in the legend button.
|
|
537
|
+
*
|
|
538
|
+
* @default "Legend"
|
|
539
|
+
*/
|
|
540
|
+
text?: string;
|
|
541
|
+
};
|
|
542
|
+
};
|
|
417
543
|
/**
|
|
418
544
|
* Configurations related to options that are at the header of the table.
|
|
419
545
|
*/
|
|
@@ -800,30 +926,67 @@ interface ITableOptions {
|
|
|
800
926
|
*/
|
|
801
927
|
copyToClipboardTime?: number;
|
|
802
928
|
}
|
|
929
|
+
/** Default configuration options for ECS Primeng table */
|
|
803
930
|
declare const DEFAULT_TABLE_OPTIONS: ITableOptions;
|
|
804
931
|
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
data: any;
|
|
810
|
-
}
|
|
932
|
+
/**
|
|
933
|
+
* Create table options based on defaults, with optional overrides.
|
|
934
|
+
*/
|
|
935
|
+
declare function createTableOptions(overrides?: Partial<ITableOptions>): ITableOptions;
|
|
811
936
|
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
937
|
+
/**
|
|
938
|
+
* Abstract service for handling HTTP requests for **ECS Primeng table**.
|
|
939
|
+
*
|
|
940
|
+
* Provides a consistent interface for making GET and POST requests to the backend.
|
|
941
|
+
* Implementations must define how requests are executed, including error handling,
|
|
942
|
+
* headers, and response processing.
|
|
943
|
+
*/
|
|
944
|
+
declare abstract class ECSPrimengTableHttpService {
|
|
945
|
+
/**
|
|
946
|
+
* Performs a GET request to the specified service endpoint.
|
|
947
|
+
*
|
|
948
|
+
* @template T The expected response type.
|
|
949
|
+
* @param servicePoint The endpoint URL or path for the GET request.
|
|
950
|
+
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
951
|
+
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
952
|
+
*/
|
|
953
|
+
abstract handleHttpGetRequest<T>(servicePoint: string, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
954
|
+
/**
|
|
955
|
+
* Performs a POST request to the specified service endpoint.
|
|
956
|
+
*
|
|
957
|
+
* @template T The expected response type.
|
|
958
|
+
* @param servicePoint The endpoint URL or path for the POST request.
|
|
959
|
+
* @param data The payload to send in the POST request body.
|
|
960
|
+
* @param httpOptions Optional HTTP headers to include in the request.
|
|
961
|
+
* @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
|
|
962
|
+
* @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
|
|
963
|
+
*/
|
|
964
|
+
abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
|
|
965
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableHttpService, never>;
|
|
966
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableHttpService>;
|
|
821
967
|
}
|
|
822
968
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
969
|
+
/**
|
|
970
|
+
* Abstract service for handling notifications in **ECS Primeng table**.
|
|
971
|
+
*
|
|
972
|
+
* Provides a consistent interface for displaying and clearing toast notifications.
|
|
973
|
+
* Implementations must define how the notifications are managed.
|
|
974
|
+
*/
|
|
975
|
+
declare abstract class ECSPrimengTableNotificationService {
|
|
976
|
+
/**
|
|
977
|
+
* Displays a toast notification.
|
|
978
|
+
*
|
|
979
|
+
* @param severity The severity level of the notification (e.g., 'success', 'info', 'warn', 'error').
|
|
980
|
+
* @param title The title of the toast message.
|
|
981
|
+
* @param message The detailed message of the toast.
|
|
982
|
+
*/
|
|
983
|
+
abstract showToast(severity: string, title: string, message: string): void;
|
|
984
|
+
/**
|
|
985
|
+
* Clears all currently displayed toast notifications.
|
|
986
|
+
*/
|
|
987
|
+
abstract clearToasts(): void;
|
|
988
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableNotificationService, never>;
|
|
989
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableNotificationService>;
|
|
827
990
|
}
|
|
828
991
|
|
|
829
992
|
declare class ECSPrimengTableService {
|
|
@@ -1002,16 +1165,6 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
1002
1165
|
* @param {IPrimengPredefinedFilter[]} selectedValues - An array of selected predefined filter values.
|
|
1003
1166
|
*/
|
|
1004
1167
|
onPredefinedFilterChange(filterName: string, selectedValues: IPredefinedFilter[]): void;
|
|
1005
|
-
/**
|
|
1006
|
-
* Retrieves the number of values selected for a predefined filter.
|
|
1007
|
-
*
|
|
1008
|
-
* This function checks the collection of selected values for a specified column key name and returns a string
|
|
1009
|
-
* indicating the number of selected items along with a predefined text.
|
|
1010
|
-
*
|
|
1011
|
-
* @param {string} columnKeyName - The key name of the column for which to retrieve the number of selected values.
|
|
1012
|
-
* @returns {string} A string indicating the number of selected values for the specified column.
|
|
1013
|
-
*/
|
|
1014
|
-
predefinedFiltersSelectedValuesText(columnKeyName: string): string;
|
|
1015
1168
|
/**
|
|
1016
1169
|
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
1017
1170
|
* that need to be applied to an item on a row.
|
|
@@ -1040,10 +1193,5 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
|
|
|
1040
1193
|
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>;
|
|
1041
1194
|
}
|
|
1042
1195
|
|
|
1043
|
-
/**
|
|
1044
|
-
* Create table options based on defaults, with optional overrides.
|
|
1045
|
-
*/
|
|
1046
|
-
declare function createTableOptions(overrides?: Partial<ITableOptions>): ITableOptions;
|
|
1047
|
-
|
|
1048
1196
|
export { CellOverflowBehaviour, DEFAULT_TABLE_OPTIONS, DataAlignHorizontal, DataAlignVertical, DataType, ECSPrimengTable, ECSPrimengTableHttpService, ECSPrimengTableNotificationService, ECSPrimengTableService, FrozenColumnAlign, TableViewSaveMode, createTableOptions };
|
|
1049
|
-
export type { IColumnMetadata,
|
|
1197
|
+
export type { IColumnMetadata, IPredefinedFilter, ITableButton, ITableOptions };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternalcodestudio/primeng-table",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.0.13",
|
|
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",
|