@eternalcodestudio/primeng-table 20.0.4 → 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/index.d.ts CHANGED
@@ -201,39 +201,79 @@ interface IColumnMetadata {
201
201
  initialWidth: number;
202
202
  }
203
203
 
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
+ */
204
209
  interface IPredefinedFilter {
205
210
  /**
206
- * The value of the PrimeNG icon.
207
- */
208
- icon?: string;
209
- iconURL?: string;
210
- iconBlobSourceEndpoint?: string;
211
- iconBlobSourceEndpointResponseError?: boolean;
212
- /**
213
- * The icon as a blob.
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`.
214
216
  */
215
- iconBlob?: Blob;
217
+ value: string | number;
216
218
  /**
217
- * A string representing the name to be shown in the UI.
219
+ * The text displayed in the frontend for this filter value.
220
+ *
221
+ * Used when `displayName` is `true` or when displaying a tag.
218
222
  */
219
223
  name?: string;
220
224
  /**
221
- * If the name needs to be shown in the UI
225
+ * Set to `true` to display the `name` as text in the cell.
222
226
  */
223
227
  displayName?: boolean;
224
228
  /**
225
- * The underlying value of the option. The value can be of any type and represents the data managed behind the scenes.
229
+ * Set to `true` to display the `name` as a tag in the cell.
226
230
  */
227
- value: any;
231
+ displayTag?: boolean;
228
232
  /**
229
- * If the value needs to be displayed with a tag
233
+ * Optional CSS style object to apply to the tag.
234
+ *
235
+ * Example: { background: 'rgb(255,0,0)', color: 'white' }
230
236
  */
231
- displayTag?: boolean;
232
237
  tagStyle?: {
233
238
  [key: string]: string;
234
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
+ */
235
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
+ */
236
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;
237
277
  }
238
278
 
239
279
  interface ITableConfiguration {
@@ -257,7 +297,7 @@ interface ITableOptions {
257
297
  *
258
298
  * @default true
259
299
  */
260
- isActive: boolean;
300
+ isActive?: boolean;
261
301
  /**
262
302
  * Endpoint URL to fetch the table configuration.
263
303
  *
@@ -265,22 +305,22 @@ interface ITableOptions {
265
305
  * an `ITableConfiguration` object from the API. This includes data such as column definitions,
266
306
  * the timezone to use, and other settings.
267
307
  *
268
- * If set to `null` or if `isActive` is `false`, the table will **not** fetch configuration automatically.
308
+ * If set to `undefined` or if `isActive` is `false`, the table will **not** fetch configuration automatically.
269
309
  *
270
- * @default null
310
+ * @default undefined
271
311
  */
272
- urlTableConfiguration: string | null;
312
+ urlTableConfiguration?: string;
273
313
  /**
274
314
  * Endpoint URL to fetch the table data.
275
315
  *
276
316
  * This endpoint is called **whenever the user filters, changes pages, or sorts** the table.
277
317
  * It is expected to return an `ITablePagedResponse` object containing the paginated data.
278
318
  *
279
- * If set to `null` or if `isActive` is `false`, the table will **not** fetch or update data automatically.
319
+ * If set to `undefined` or if `isActive` is `false`, the table will **not** fetch or update data automatically.
280
320
  *
281
- * @default null
321
+ * @default undefined
282
322
  */
283
- urlTableData: string | null;
323
+ urlTableData?: string;
284
324
  /**
285
325
  * The array of data to be displayed in the table.
286
326
  *
@@ -288,18 +328,18 @@ interface ITableOptions {
288
328
  *
289
329
  * @default []
290
330
  */
291
- data: any[];
292
- header: {
293
- buttons: ITableButton[];
294
- clearSortsEnabled: boolean;
295
- clearSortsIcon: string;
296
- clearFiltersEnabled: boolean;
297
- clearFiltersIcon: string;
331
+ data?: any[];
332
+ header?: {
333
+ buttons?: ITableButton[];
334
+ clearSortsEnabled?: boolean;
335
+ clearSortsIcon?: string;
336
+ clearFiltersEnabled?: boolean;
337
+ clearFiltersIcon?: string;
298
338
  };
299
339
  /**
300
340
  * Configurations related to the columns of the table.
301
341
  */
302
- columns: {
342
+ columns?: {
303
343
  /**
304
344
  * Enables or disables the column selector feature.
305
345
  *
@@ -313,48 +353,49 @@ interface ITableOptions {
313
353
  *
314
354
  * @default true
315
355
  */
316
- selectorEnabled: boolean;
356
+ selectorEnabled?: boolean;
357
+ selectorIcon?: string;
317
358
  /**
318
359
  * The combination of non-selectable columns and user-selected columns
319
360
  * that must be displayed in the table.
320
361
  *
321
362
  * @default []
322
363
  */
323
- shown: IColumnMetadata[];
364
+ shown?: IColumnMetadata[];
324
365
  };
325
366
  /**
326
367
  * Configurations related to the rows of the table.
327
368
  */
328
- rows: {
329
- class: (rowData: any) => string | string[] | Set<string> | {
369
+ rows?: {
370
+ class?: (rowData: any) => string | string[] | Set<string> | {
330
371
  [klass: string]: any;
331
372
  };
332
- style: (rowData: any) => {
373
+ style?: (rowData: any) => {
333
374
  [klass: string]: any;
334
375
  };
335
- action: {
336
- buttons: ITableButton[];
337
- header: string;
338
- alignmentRight: boolean;
339
- width: number;
340
- frozen: boolean;
341
- resizable: boolean;
376
+ action?: {
377
+ buttons?: ITableButton[];
378
+ header?: string;
379
+ alignmentRight?: boolean;
380
+ width?: number;
381
+ frozen?: boolean;
382
+ resizable?: boolean;
342
383
  };
343
- checkboxSelector: {
344
- enabled: boolean;
345
- header: string;
346
- alignmentRight: boolean;
347
- width: number;
348
- frozen: boolean;
349
- resizable: boolean;
384
+ checkboxSelector?: {
385
+ enabled?: boolean;
386
+ header?: string;
387
+ alignmentRight?: boolean;
388
+ width?: number;
389
+ frozen?: boolean;
390
+ resizable?: boolean;
350
391
  };
351
- singleSelector: {
352
- enabled: boolean;
353
- metakey: boolean;
392
+ singleSelector?: {
393
+ enabled?: boolean;
394
+ metakey?: boolean;
354
395
  };
355
396
  };
356
397
  /** Configurations related to the vertical scroll of the table. */
357
- verticalScroll: {
398
+ verticalScroll?: {
358
399
  /**
359
400
  * Automatically adjust the table's height to fit its container.
360
401
  *
@@ -363,7 +404,7 @@ interface ITableOptions {
363
404
  *
364
405
  * @default true
365
406
  */
366
- fitToContainer: boolean;
407
+ fitToContainer?: boolean;
367
408
  /**
368
409
  * Fixed vertical height for the table when `fitToContainer` is `false`.
369
410
  *
@@ -375,10 +416,10 @@ interface ITableOptions {
375
416
  *
376
417
  * @default 0
377
418
  */
378
- height: number;
419
+ height?: number;
379
420
  };
380
421
  /** Configurations related to the global search functionality of the table. */
381
- globalSearch: {
422
+ globalSearch?: {
382
423
  /**
383
424
  * Enables or disables the global search input.
384
425
  *
@@ -387,7 +428,7 @@ interface ITableOptions {
387
428
  *
388
429
  * @default true
389
430
  */
390
- enabled: boolean;
431
+ enabled?: boolean;
391
432
  /**
392
433
  * Maximum number of characters allowed in the global search input.
393
434
  *
@@ -395,15 +436,15 @@ interface ITableOptions {
395
436
  *
396
437
  * @default 20
397
438
  */
398
- maxLength: number;
439
+ maxLength?: number;
399
440
  };
400
- predefinedFilters: {
441
+ predefinedFilters?: {
401
442
  [key: string]: IPredefinedFilter[];
402
443
  };
403
444
  /**
404
445
  * Configurations related to saved table views.
405
446
  */
406
- views: {
447
+ views?: {
407
448
  /**
408
449
  * Determines how the table views are saved.
409
450
  *
@@ -417,41 +458,41 @@ interface ITableOptions {
417
458
  *
418
459
  * @default TableViewSaveMode.None
419
460
  */
420
- saveMode: TableViewSaveMode;
461
+ saveMode?: TableViewSaveMode;
421
462
  /**
422
463
  * Key used to identify the table when saving and retrieving its views.
423
464
  *
424
465
  * Each table should have a unique `saveKey` so that its saved views (filters, column order, sorting, etc.)
425
466
  * do not conflict with other tables.
426
467
  *
427
- * If set to `null`, the table will not save or load any views.
468
+ * If set to `undefined`, the table will not save or load any views.
428
469
  *
429
- * @default null
470
+ * @default undefined
430
471
  */
431
- saveKey: string | null;
472
+ saveKey?: string;
432
473
  /**
433
474
  * Endpoint URL to fetch saved views from the database.
434
475
  *
435
476
  * Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
436
477
  * The `saveKey` is sent to identify the correct table views.
437
478
  *
438
- * @default null
479
+ * @default undefined
439
480
  */
440
- urlGet: string | null;
481
+ urlGet?: string;
441
482
  /**
442
483
  * Endpoint URL to save table views to the database.
443
484
  *
444
485
  * Only used if `saveMode` is `TableViewSaveMode.databaseStorage`.
445
486
  * The `saveKey` is sent to identify the correct table views.
446
487
  *
447
- * @default null
488
+ * @default undefined
448
489
  */
449
- urlSave: string | null;
490
+ urlSave?: string;
450
491
  };
451
492
  /**
452
493
  * Configurations for exporting the table data to Excel.
453
494
  */
454
- excelReport: {
495
+ excelReport?: {
455
496
  /**
456
497
  * Endpoint URL of the API to perform the Excel export.
457
498
  *
@@ -459,11 +500,11 @@ interface ITableOptions {
459
500
  * specified by the user, such as selected columns, filters, and sort order, to generate
460
501
  * the export.
461
502
  *
462
- * If set to `null`, Excel export functionality will be disabled.
503
+ * If set to `undefined`, Excel export functionality will be disabled.
463
504
  *
464
- * @default null
505
+ * @default undefined
465
506
  */
466
- url: string | null;
507
+ url?: string;
467
508
  /**
468
509
  * Default title shown in the Excel export modal when preparing the export.
469
510
  *
@@ -472,7 +513,7 @@ interface ITableOptions {
472
513
  *
473
514
  * @default "Report"
474
515
  */
475
- defaultTitle: string;
516
+ defaultTitle?: string;
476
517
  /**
477
518
  * Determines whether the user can edit the title of the Excel file in the export modal.
478
519
  *
@@ -481,9 +522,9 @@ interface ITableOptions {
481
522
  *
482
523
  * @default true
483
524
  */
484
- titleAllowUserEdit: boolean;
525
+ titleAllowUserEdit?: boolean;
485
526
  };
486
- copyToClipboardTime: number;
527
+ copyToClipboardTime?: number;
487
528
  }
488
529
  declare const DEFAULT_TABLE_OPTIONS: ITableOptions;
489
530
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalcodestudio/primeng-table",
3
- "version": "20.0.4",
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,7 +29,7 @@
28
29
  },
29
30
  "repository": {
30
31
  "type": "git",
31
- "url": "git+https://github.com/AIO1/ECSPrimengTable"
32
+ "url": "git+https://github.com/AIO1/ECSPrimengTable.git"
32
33
  },
33
34
  "bugs": {
34
35
  "url": "https://github.com/AIO1/ECSPrimengTable/issues"