@eternalcodestudio/primeng-table 19.0.0 → 19.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +7 -0
  2. package/fesm2022/eternalcodestudio-primeng-table.mjs +671 -424
  3. package/fesm2022/eternalcodestudio-primeng-table.mjs.map +1 -1
  4. package/lib/components/column-selector/column-selector.d.ts +3 -0
  5. package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +37 -62
  6. package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +3 -1
  7. package/lib/components/table-button/table-button.d.ts +1 -4
  8. package/lib/components/table-cell/table-cell.d.ts +7 -5
  9. package/lib/components/{table-predifined-filters/table-predifined-filters.d.ts → table-predefined-filters/table-predefined-filters.d.ts} +10 -5
  10. package/lib/components/views-management/views-management.d.ts +4 -3
  11. package/lib/enums/cell-overflow-behaviour.enum.d.ts +11 -1
  12. package/lib/enums/data-align-horizontal.enum.d.ts +9 -0
  13. package/lib/enums/data-align-vertical.enum.d.ts +9 -0
  14. package/lib/enums/data-type.enum.enum.d.ts +14 -1
  15. package/lib/enums/frozen-column-align.enum.d.ts +10 -0
  16. package/lib/enums/table-view-save-mode.enum.d.ts +15 -4
  17. package/lib/interfaces/columns-metadata.interface.d.ts +1 -1
  18. package/lib/interfaces/index.d.ts +2 -1
  19. package/lib/interfaces/predefined-filter.interface.d.ts +80 -0
  20. package/lib/interfaces/table-button.interface.d.ts +59 -12
  21. package/lib/interfaces/table-configuration.interface.d.ts +1 -0
  22. package/lib/interfaces/table-options.interface.d.ts +433 -0
  23. package/lib/interfaces/table-paged-response.interface.d.ts +0 -7
  24. package/lib/interfaces/table-query-request.interface.d.ts +0 -9
  25. package/lib/services/http.service.d.ts +27 -2
  26. package/lib/services/notification.service.d.ts +17 -1
  27. package/lib/utils/create-table-options.d.ts +5 -0
  28. package/lib/utils/index.d.ts +1 -0
  29. package/package.json +5 -4
  30. package/public-api.d.ts +1 -0
  31. package/fesm2022/ecs-primeng-table.mjs +0 -1745
  32. package/fesm2022/ecs-primeng-table.mjs.map +0 -1
  33. package/lib/interfaces/predifined-filter.interface.d.ts +0 -34
@@ -1,29 +1,76 @@
1
1
  /**
2
- * Interface representing the configuration for action buttons in a PrimeNG table.
2
+ * Interface representing a table action button, applicable for both header and row buttons.
3
3
  */
4
4
  export interface ITableButton {
5
5
  /**
6
- * Gets or sets the icon to be displayed on the button.
7
- * The value should be a string representing the PrimeIcons class name.
6
+ * Optional. The icon to display on the button.
7
+ * Should be a valid icon name from PrimeNG, Material Icons, Font Awesome, or similar libraries.
8
8
  */
9
9
  icon?: string;
10
+ /**
11
+ * Optional. The position of the icon relative to the button label.
12
+ * Defaults to "left". Possible values are:
13
+ * - "left"
14
+ * - "right"
15
+ * - "top"
16
+ * - "bottom"
17
+ */
18
+ iconPos?: string;
19
+ /**
20
+ * Optional. The text label displayed on the button.
21
+ */
10
22
  label?: string;
11
23
  /**
12
- * Gets or sets the color style class to be applied to the button.
13
- * The value should be a string representing a CSS class for styling the button.
24
+ * Optional. If true, the button will be round. Defaults to false.
25
+ */
26
+ rounded?: boolean;
27
+ /**
28
+ * Optional. If true, adds a shadow to indicate elevation. Defaults to false.
29
+ */
30
+ raised?: boolean;
31
+ /**
32
+ * Optional. Specifies the variant of the button.
33
+ * Can be null (default), "text", or "outlined".
34
+ */
35
+ variant?: string;
36
+ /**
37
+ * Optional. The CSS class to apply for button styling.
38
+ * Example: "p-button-success" or "custom-class".
14
39
  */
15
40
  color?: string;
16
41
  /**
17
- * Gets or sets the condition for displaying the button.
18
- * It is a function that takes row data as input and returns a boolean indicating
19
- * whether the button should be displayed for that row.
42
+ * Optional. Additional inline CSS styles for the button.
43
+ */
44
+ style?: string;
45
+ /**
46
+ * Optional. Function that determines whether the button should be visible for a given row.
47
+ * @param rowData The row data object. Null for header buttons.
48
+ * @returns True if the button should be visible; false otherwise.
49
+ */
50
+ visibleCondition?: (rowData: any) => boolean;
51
+ /**
52
+ * Optional. Function that determines whether the button should be displayed for a given row.
53
+ *
54
+ * Ignored if `visibleCondition` returns false.
55
+ * @param rowData The row data object. Null for header buttons.
56
+ * @returns True if the button should be enabled; false otherwise.
20
57
  */
21
- condition?: (rowData: any) => boolean;
58
+ enabledCondition?: (rowData: any) => boolean;
22
59
  /**
23
- * Represents the action to be executed when the button is clicked.
24
- * This function takes the row data of the clicked row as input and performs
25
- * specific actions based on that data.
60
+ * Optional. Controls behavior when `enabledCondition` returns false.
61
+ * - If `true`, the button will be hidden when the 'enabledCondition' is not met.
62
+ * - If `false` or `undefined`, the button will remain visible but disabled if 'enabledCondition' is not met.
63
+ *
64
+ * Ignored if `visibleCondition` returns false.
65
+ */
66
+ conditionFailHide?: boolean;
67
+ /**
68
+ * Optional. The action to execute when the button is clicked.
69
+ * @param rowData The row data object of the clicked row. Null for header buttons.
26
70
  */
27
71
  action?: (rowData: any) => void;
72
+ /**
73
+ * Optional. Tooltip text to display when the user hovers over the button.
74
+ */
28
75
  tooltip?: string;
29
76
  }
@@ -5,4 +5,5 @@ export interface ITableConfiguration {
5
5
  dateFormat: string;
6
6
  dateTimezone: string;
7
7
  dateCulture: string;
8
+ maxViews: number;
8
9
  }
@@ -0,0 +1,433 @@
1
+ import { TableViewSaveMode } from "../enums";
2
+ import { IColumnMetadata, IPredefinedFilter, ITableButton } from "../interfaces";
3
+ /** Configuration options for ECS Primeng table */
4
+ export interface ITableOptions {
5
+ /**
6
+ * Controls whether the table is active.
7
+ *
8
+ * - When `true`, the table will fetch configuration, columns, and data on init.
9
+ * - When `false`, the table will **not** automatically fetch or update data, even after initialization.
10
+ * Use this if you want to apply filters, column changes, or other manipulations
11
+ * without triggering automatic updates.
12
+ *
13
+ * @default true
14
+ */
15
+ isActive?: boolean;
16
+ /**
17
+ * Endpoint URL to fetch the table configuration.
18
+ *
19
+ * The configuration is fetched **once** when the table is initialized and is expected to return
20
+ * an `ITableConfiguration` object from the API. This includes data such as column definitions,
21
+ * the timezone to use, and other settings.
22
+ *
23
+ * If set to `undefined` or if `isActive` is `false`, the table will **not** fetch configuration automatically.
24
+ *
25
+ * @default undefined
26
+ */
27
+ urlTableConfiguration?: string;
28
+ /**
29
+ * Endpoint URL to fetch the table data.
30
+ *
31
+ * This endpoint is called **whenever the user filters, changes pages, or sorts** the table.
32
+ * It is expected to return an `ITablePagedResponse` object containing the paginated data.
33
+ *
34
+ * If set to `undefined` or if `isActive` is `false`, the table will **not** fetch or update data automatically.
35
+ *
36
+ * @default undefined
37
+ */
38
+ urlTableData?: string;
39
+ /**
40
+ * The array of data to be displayed in the table.
41
+ *
42
+ * Each item should represent a row and match the table's column structure.
43
+ *
44
+ * @default []
45
+ */
46
+ data?: any[];
47
+ /**
48
+ * Configurations related to options that are at the header of the table.
49
+ */
50
+ header?: {
51
+ /**
52
+ * A collection of `ITableButton` to be shown in the table header.
53
+ *
54
+ * @default []
55
+ */
56
+ buttons?: ITableButton[];
57
+ /**
58
+ * When set to `false`, the **clear sorts** button will be hidden.
59
+ *
60
+ * @default true
61
+ */
62
+ clearSortsEnabled?: boolean;
63
+ /**
64
+ * Allows customization of the **clear sorts** button icon. You may use any other icons from PrimeNG or third-party providers such as Material Icons or Font Awesome.
65
+ *
66
+ * @default "pi pi-sort-alt-slash"
67
+ */
68
+ clearSortsIcon?: string;
69
+ /**
70
+ * When set to `false`, the **clear filters** button will be hidden.
71
+ *
72
+ * @default true
73
+ */
74
+ clearFiltersEnabled?: boolean;
75
+ /**
76
+ * Allows customization of the **clear filters** button icon. Other icons from PrimeNG or third-party libraries (e.g., Material Icons, Font Awesome) may also be used.
77
+ *
78
+ * @default "pi pi-filter-slash"
79
+ */
80
+ clearFiltersIcon?: string;
81
+ };
82
+ /**
83
+ * Configurations related to the columns of the table.
84
+ */
85
+ columns?: {
86
+ /**
87
+ * Enables or disables the column selector feature.
88
+ *
89
+ * When `true`, a button is displayed in the top-left corner of the table.
90
+ * Clicking this button opens a modal that allows users to:
91
+ * - Show or hide columns.
92
+ * - Adjust the cell overflow behavior for each column.
93
+ * - Change the horizontal and vertical alignment of cells per column.
94
+ *
95
+ * When `false`, the button to open the column's selector modal will not be available.
96
+ *
97
+ * @default true
98
+ */
99
+ selectorEnabled?: boolean;
100
+ /**
101
+ * Can be used to specifiy a different icon to be used by the column selector.
102
+ * You can replace it with any icon from PrimeNG or other libraries such as Font Awesome or Material Icons.
103
+ *
104
+ * @default "pi pi-pen-to-square"
105
+ */
106
+ selectorIcon?: string;
107
+ /**
108
+ * The combination of non-selectable columns and user-selected columns
109
+ * that must be displayed in the table.
110
+ *
111
+ * @default []
112
+ */
113
+ shown?: IColumnMetadata[];
114
+ };
115
+ /**
116
+ * Configurations related to the rows of the table.
117
+ */
118
+ rows?: {
119
+ /**
120
+ * Function to dynamically assign CSS classes to a row.
121
+ *
122
+ * Receives the `rowData` object for the current row and returns:
123
+ * - A string with a single CSS class name
124
+ * - An array of class names
125
+ * - A Set of class names
126
+ * - An object with class keys and truthy/falsy values
127
+ *
128
+ * The returned classes are applied to the row in addition to any global or default styles.
129
+ * Useful for changing appearance of a row based on column values.
130
+ *
131
+ * Example:
132
+ * ```ts
133
+ * class: (rowData) => {
134
+ * const classes = [];
135
+ * if (rowData.status === "Unemployed") classes.push("unemployedRow");
136
+ * return classes;
137
+ * }
138
+ * ```
139
+ */
140
+ class?: (rowData: any) => string | string[] | Set<string> | {
141
+ [klass: string]: any;
142
+ };
143
+ /**
144
+ * Function to dynamically assign inline styles to a row.
145
+ *
146
+ * Receives the `rowData` object for the current row and returns an object
147
+ * with CSS properties to apply inline. This allows dynamic styling based
148
+ * on the row's content or values.
149
+ *
150
+ * If not provided, no dynamic styles are applied.
151
+ *
152
+ * Example:
153
+ * ```ts
154
+ * style: (rowData) => {
155
+ * if (rowData.status === "Full-time") {
156
+ * return { fontWeight: "bold", fontStyle: "italic" };
157
+ * }
158
+ * return {};
159
+ * }
160
+ * ```
161
+ */
162
+ style?: (rowData: any) => {
163
+ [klass: string]: any;
164
+ };
165
+ /**
166
+ * Configurations related to the action column for the rows.
167
+ */
168
+ action?: {
169
+ /**
170
+ * A collection of `ITableButton` to be shown by this column to perform actions over rows. At least one button needs to be enable the row actions column.
171
+ *
172
+ * @default []
173
+ */
174
+ buttons?: ITableButton[];
175
+ /**
176
+ * The header label for the row actions column.
177
+ *
178
+ * @default "Actions"
179
+ */
180
+ header?: string;
181
+ /**
182
+ * If `true`, the column will appear on the right side of the table. Otherwise, it will appear on the left.
183
+ *
184
+ * @default true
185
+ */
186
+ alignmentRight?: boolean;
187
+ /**
188
+ * The fixed column width in pixels.
189
+ *
190
+ * @default 150
191
+ */
192
+ width?: number;
193
+ /**
194
+ * If `true`, the column remains visible when horizontally scrolling the table.
195
+ *
196
+ * @default true
197
+ */
198
+ frozen?: boolean;
199
+ /**
200
+ * If `true`, users can resize the column.
201
+ *
202
+ * @default false
203
+ */
204
+ resizable?: boolean;
205
+ };
206
+ /**
207
+ * Configurations related to the row checkbox selector.
208
+ */
209
+ checkboxSelector?: {
210
+ /**
211
+ * If `true`, a new column with checkboxes will be displayed. Users can select or unselect rows using these checkboxes. Additionally an option to filter by this column will be enabled.
212
+ *
213
+ * @default false
214
+ */
215
+ enabled?: boolean;
216
+ /**
217
+ * The header label for the checkbox selection column.
218
+ *
219
+ * @default "Selected"
220
+ */
221
+ header?: string;
222
+ /**
223
+ * If `true`, the column will appear on the right side of the table. Otherwise, it will appear on the left.
224
+ *
225
+ * @default false
226
+ */
227
+ alignmentRight?: boolean;
228
+ /**
229
+ * The fixed column width in pixels.
230
+ *
231
+ * @default 150
232
+ */
233
+ width?: number;
234
+ /**
235
+ * If `true`, the column remains visible when horizontally scrolling the table.
236
+ *
237
+ * @default true
238
+ */
239
+ frozen?: boolean;
240
+ /**
241
+ * If `true`, users can resize the column.
242
+ *
243
+ * @default false
244
+ */
245
+ resizable?: boolean;
246
+ /**
247
+ * Function that determines whether the checkbox should be enabled or not.
248
+ * @param rowData The row data object.
249
+ * @returns True if the checkbox should be enabled; false otherwise.
250
+ *
251
+ * @default undefined
252
+ */
253
+ enabledCondition?: (rowData: any) => boolean;
254
+ };
255
+ /**
256
+ * Configurations related to the single row selector.
257
+ */
258
+ singleSelector?: {
259
+ /**
260
+ * If set to `true`, users can click a row to select it. You can then subscribe to selection events to execute custom actions.
261
+ *
262
+ * @default false
263
+ */
264
+ enabled?: boolean;
265
+ /**
266
+ * When `true`, users must hold **CTRL** and click on a selected row to unselect it. When `false`, users can unselect a row simply by clicking it again.
267
+ *
268
+ * On mobile devices (phones or tablets), the **CTRL** key configuration is ignored. Users can unselect a previously selected row by simply clicking it, as mobile devices do not have a **CTRL** key.
269
+ *
270
+ * @default true
271
+ */
272
+ metakey?: boolean;
273
+ };
274
+ };
275
+ /** Configurations related to the vertical scroll of the table. */
276
+ verticalScroll?: {
277
+ /**
278
+ * Automatically adjust the table's height to fit its container.
279
+ *
280
+ * When set to `true`, the table will calculate the maximum height dynamically
281
+ * so that it exactly fits its container. This takes precedence over the `height` property.
282
+ *
283
+ * Ignored if a `cssFormula` has been provided.
284
+ *
285
+ * @default true
286
+ */
287
+ fitToContainer?: boolean;
288
+ /**
289
+ * Fixed vertical height for the table when `fitToContainer` is `false`.
290
+ *
291
+ * - If a `cssFormula` has been provided, this property is ignored.
292
+ * - If `fitToContainer` from `verticalScroll` is `true`, this property is ignored.
293
+ * - If set to a value `<= 0`, this is ignored.
294
+ *
295
+ * Use this property to enable vertical scrolling with a fixed height when you do not want
296
+ * the table to dynamically fit its container.
297
+ *
298
+ * @default 0
299
+ */
300
+ height?: number;
301
+ /**
302
+ * A CSS string used to define the table's vertical height.
303
+ *
304
+ * Can be a fixed value (e.g., `"500px"`) or a CSS formula (e.g., `"calc(100vh - 200px)"`).
305
+ * When provided, this value **overrides** both `fitToContainer` and `height`.
306
+ *
307
+ * @default undefined
308
+ */
309
+ cssFormula?: string;
310
+ };
311
+ /** Configurations related to the global filter functionality of the table. */
312
+ globalFilter?: {
313
+ /**
314
+ * Enables or disables the global filter input.
315
+ *
316
+ * When set to `true`, users can search across all table columns using the global search bar.
317
+ * When `false`, the global search input will not be rendered.
318
+ *
319
+ * @default true
320
+ */
321
+ enabled?: boolean;
322
+ /**
323
+ * Maximum number of characters allowed in the global filter input.
324
+ *
325
+ * Use this to limit the length of search queries and prevent excessively long input.
326
+ *
327
+ * @default 20
328
+ */
329
+ maxLength?: number;
330
+ };
331
+ /**
332
+ * Predefined filters for table columns.
333
+ *
334
+ * Restricts filter options to a known set of values for a column.
335
+ * Suitable for columns with a limited number of distinct values.
336
+ * Supports plain text, tags, icons, and images. Works with `list` data types.
337
+ *
338
+ * @default {}
339
+ */
340
+ predefinedFilters?: {
341
+ [key: string]: IPredefinedFilter[];
342
+ };
343
+ /**
344
+ * Configurations related to saved table views.
345
+ */
346
+ views?: {
347
+ /**
348
+ * Determines how the table views are saved.
349
+ *
350
+ * - `TableViewSaveMode.None`: Do not save any views.
351
+ * - `TableViewSaveMode.SessionStorage`: Save views in the browser session storage (cleared when the tab/window closes).
352
+ * - `TableViewSaveMode.LocalStorage`: Save views in the browser local storage (persistent across sessions).
353
+ * - `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`
354
+ *
355
+ * This allows users to keep their custom column orders, filters, sorting, and other table settings
356
+ * according to the selected storage option.
357
+ *
358
+ * @default TableViewSaveMode.None
359
+ */
360
+ saveMode?: TableViewSaveMode;
361
+ /**
362
+ * Key used to identify the table when saving and retrieving its views.
363
+ *
364
+ * Each table should have a unique `saveKey` so that its saved views (filters, column order, sorting, etc.)
365
+ * do not conflict with other tables.
366
+ *
367
+ * If set to `undefined`, the table will not save or load any views.
368
+ *
369
+ * @default undefined
370
+ */
371
+ saveKey?: string;
372
+ /**
373
+ * Endpoint URL to fetch saved views from the database.
374
+ *
375
+ * Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
376
+ * The `saveKey` is sent to identify the correct table views.
377
+ *
378
+ * @default undefined
379
+ */
380
+ urlGet?: string;
381
+ /**
382
+ * Endpoint URL to save table views to the database.
383
+ *
384
+ * Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
385
+ * The `saveKey` is sent to identify the correct table views.
386
+ *
387
+ * @default undefined
388
+ */
389
+ urlSave?: string;
390
+ };
391
+ /**
392
+ * Configurations for exporting the table data to Excel.
393
+ */
394
+ excelReport?: {
395
+ /**
396
+ * Endpoint URL of the API to perform the Excel export.
397
+ *
398
+ * When set, the table will send a request to this endpoint including the properties
399
+ * specified by the user, such as selected columns, filters, and sort order, to generate
400
+ * the export.
401
+ *
402
+ * If set to `undefined`, Excel export functionality will be disabled.
403
+ *
404
+ * @default undefined
405
+ */
406
+ url?: string;
407
+ /**
408
+ * Default title shown in the Excel export modal when preparing the export.
409
+ *
410
+ * If the string is empty (after trimming) **and** `titleAllowUserEdit` is `false`,
411
+ * the export button will be disabled.
412
+ *
413
+ * @default "Report"
414
+ */
415
+ defaultTitle?: string;
416
+ /**
417
+ * Determines whether the user can edit the title of the Excel file in the export modal.
418
+ *
419
+ * - If `true`, the user can modify the title before exporting.
420
+ * - If `false`, the title is fixed to `defaultTitle`.
421
+ *
422
+ * @default true
423
+ */
424
+ titleAllowUserEdit?: boolean;
425
+ };
426
+ /**
427
+ * Defines the number of seconds the user must hold the mouse button on a cell before its content is copied to the clipboard. Set to a value <= 0 to turn off this feature entirely
428
+ *
429
+ * @default 0.5
430
+ */
431
+ copyToClipboardTime?: number;
432
+ }
433
+ export declare const DEFAULT_TABLE_OPTIONS: ITableOptions;
@@ -1,13 +1,6 @@
1
- /**
2
- * Interface representing the return structure for PrimeNG post requests when gathering data to represent in a table.
3
- */
4
1
  export interface ITablePagedResponse {
5
- /** The current page number.*/
6
2
  page: number;
7
- /** Total number of records available from filter.*/
8
3
  totalRecords: number;
9
- /** Total number of records available (without filters).*/
10
4
  totalRecordsNotFiltered: number;
11
- /** Dynamic data representing the response content of data for the table.*/
12
5
  data: any;
13
6
  }
@@ -1,18 +1,9 @@
1
- /**
2
- * Interface representing the request structure for PrimeNG post requests.
3
- */
4
1
  export interface ITableQueryRequest {
5
- /** Gets or sets the current page number.*/
6
2
  page: number;
7
- /** Gets or sets the number of items to display per page.*/
8
3
  pageSize: number;
9
- /** Gets or sets a list of sorting configurations for the table.*/
10
4
  sort?: any;
11
- /** Gets or sets a dictionary containing filter configurations for each column.*/
12
5
  filter: any;
13
- /** Gets or sets a global filter string applied to all columns.*/
14
6
  globalFilter?: string | null;
15
- /** Gets or sets a list of columns to be included in the response.*/
16
7
  columns?: string[];
17
8
  dateFormat: string;
18
9
  dateTimezone: string;
@@ -1,9 +1,34 @@
1
1
  import { HttpHeaders, HttpResponse } from '@angular/common/http';
2
2
  import { Observable } from 'rxjs';
3
3
  import * as i0 from "@angular/core";
4
+ /**
5
+ * Abstract service for handling HTTP requests for **ECS Primeng table**.
6
+ *
7
+ * Provides a consistent interface for making GET and POST requests to the backend.
8
+ * Implementations must define how requests are executed, including error handling,
9
+ * headers, and response processing.
10
+ */
4
11
  export declare abstract class ECSPrimengTableHttpService {
5
- abstract handleHttpGetRequest<T>(servicePoint: string, httpOptions?: HttpHeaders | null, showSpinner?: boolean, customErrorHandler?: ((error: any) => Observable<any>) | null, showAPIError?: boolean, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
6
- abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, showSpinner?: boolean, customErrorHandler?: ((error: any) => Observable<any>) | null, showAPIError?: boolean, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
12
+ /**
13
+ * Performs a GET request to the specified service endpoint.
14
+ *
15
+ * @template T The expected response type.
16
+ * @param servicePoint The endpoint URL or path for the GET request.
17
+ * @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
18
+ * @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
19
+ */
20
+ abstract handleHttpGetRequest<T>(servicePoint: string, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
21
+ /**
22
+ * Performs a POST request to the specified service endpoint.
23
+ *
24
+ * @template T The expected response type.
25
+ * @param servicePoint The endpoint URL or path for the POST request.
26
+ * @param data The payload to send in the POST request body.
27
+ * @param httpOptions Optional HTTP headers to include in the request.
28
+ * @param responseType Optional. The type of response expected, either `'json'` (default) or `'blob'`.
29
+ * @returns An Observable of `HttpResponse<T>`, containing the full HTTP response.
30
+ */
31
+ abstract handleHttpPostRequest<T>(servicePoint: string, data: any, httpOptions?: HttpHeaders | null, responseType?: 'json' | 'blob'): Observable<HttpResponse<T>>;
7
32
  static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableHttpService, never>;
8
33
  static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableHttpService>;
9
34
  }
@@ -1,6 +1,22 @@
1
1
  import * as i0 from "@angular/core";
2
+ /**
3
+ * Abstract service for handling notifications in **ECS Primeng table**.
4
+ *
5
+ * Provides a consistent interface for displaying and clearing toast notifications.
6
+ * Implementations must define how the notifications are managed.
7
+ */
2
8
  export declare abstract class ECSPrimengTableNotificationService {
3
- abstract showToast(severity: string, title: string, message: string, duration?: number, keepToast?: boolean, closable?: boolean, clearPrevious?: boolean): void;
9
+ /**
10
+ * Displays a toast notification.
11
+ *
12
+ * @param severity The severity level of the notification (e.g., 'success', 'info', 'warn', 'error').
13
+ * @param title The title of the toast message.
14
+ * @param message The detailed message of the toast.
15
+ */
16
+ abstract showToast(severity: string, title: string, message: string): void;
17
+ /**
18
+ * Clears all currently displayed toast notifications.
19
+ */
4
20
  abstract clearToasts(): void;
5
21
  static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableNotificationService, never>;
6
22
  static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableNotificationService>;
@@ -0,0 +1,5 @@
1
+ import { ITableOptions } from '../interfaces';
2
+ /**
3
+ * Create table options based on defaults, with optional overrides.
4
+ */
5
+ export declare function createTableOptions(overrides?: Partial<ITableOptions>): ITableOptions;
@@ -1,3 +1,4 @@
1
+ export * from "./create-table-options";
1
2
  export * from "./data-align-horizontal-as-text";
2
3
  export * from "./data-align-vertical-as-text";
3
4
  export * from "./data-type-as-text";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalcodestudio/primeng-table",
3
- "version": "19.0.0",
3
+ "version": "19.0.2",
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,8 +16,9 @@
16
16
  "peerDependencies": {
17
17
  "@angular/common": ">=19.0.0",
18
18
  "@angular/core": ">=19.0.0",
19
+ "@angular/animations": ">=19.0.0",
19
20
  "primeng": ">=19.0.0",
20
- "primeicons": ">=6.0.0"
21
+ "primeicons": ">=7.0.0"
21
22
  },
22
23
  "dependencies": {
23
24
  "tslib": "^2.3.0"
@@ -28,10 +29,10 @@
28
29
  },
29
30
  "repository": {
30
31
  "type": "git",
31
- "url": "https://github.com/AIO1/PrimeNGTableReusableComponent"
32
+ "url": "git+https://github.com/AIO1/ECSPrimengTable.git"
32
33
  },
33
34
  "bugs": {
34
- "url": "https://github.com/AIO1/PrimeNGTableReusableComponent/issues"
35
+ "url": "https://github.com/AIO1/ECSPrimengTable/issues"
35
36
  },
36
37
  "homepage": "https://eternalcodestudio.com/",
37
38
  "sideEffects": false,
package/public-api.d.ts CHANGED
@@ -3,3 +3,4 @@ export * from './lib/components/ecs-primeng-table/ecs-primeng-table.service';
3
3
  export * from './lib/enums';
4
4
  export * from './lib/interfaces';
5
5
  export * from './lib/services';
6
+ export * from "./lib/utils/create-table-options";