@eternalcodestudio/primeng-table 20.0.7 → 20.0.9

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.
@@ -185,7 +185,8 @@ const DEFAULT_TABLE_OPTIONS = {
185
185
  },
186
186
  verticalScroll: {
187
187
  fitToContainer: true,
188
- height: 0
188
+ height: 0,
189
+ cssFormula: undefined
189
190
  },
190
191
  globalFilter: {
191
192
  enabled: true,
@@ -206,26 +207,6 @@ const DEFAULT_TABLE_OPTIONS = {
206
207
  copyToClipboardTime: 0.5
207
208
  };
208
209
 
209
- /**
210
- * Deep merge two objects.
211
- * Recursively copies properties from `source` into `target`.
212
- */
213
- /*function deepMerge<T>(target: T, source: Partial<T>): T {
214
- for (const key in source) {
215
- if (
216
- source[key] !== null &&
217
- typeof source[key] === 'object' &&
218
- !Array.isArray(source[key])
219
- ) {
220
- if (!target[key]) (target as any)[key] = {};
221
- deepMerge((target as any)[key], source[key]);
222
- } else {
223
- (target as any)[key] = source[key];
224
- }
225
- }
226
- return target;
227
- }
228
- */
229
210
  /**
230
211
  * Deep merge two objects.
231
212
  * Recursively copies properties from `source` into `target`,
@@ -511,6 +492,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
511
492
  type: Input
512
493
  }] } });
513
494
 
495
+ /**
496
+ * Abstract service for handling HTTP requests for **ECS Primeng table**.
497
+ *
498
+ * Provides a consistent interface for making GET and POST requests to the backend.
499
+ * Implementations must define how requests are executed, including error handling,
500
+ * headers, and response processing.
501
+ */
514
502
  class ECSPrimengTableHttpService {
515
503
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ECSPrimengTableHttpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
516
504
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ECSPrimengTableHttpService, providedIn: 'root' });
@@ -520,6 +508,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
520
508
  args: [{ providedIn: 'root' }]
521
509
  }] });
522
510
 
511
+ /**
512
+ * Abstract service for handling notifications in **ECS Primeng table**.
513
+ *
514
+ * Provides a consistent interface for displaying and clearing toast notifications.
515
+ * Implementations must define how the notifications are managed.
516
+ */
523
517
  class ECSPrimengTableNotificationService {
524
518
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ECSPrimengTableNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
525
519
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: ECSPrimengTableNotificationService, providedIn: 'root' });
@@ -1167,6 +1161,9 @@ class ECSPrimengTable {
1167
1161
  this.calculateScrollHeight();
1168
1162
  }
1169
1163
  calculateScrollHeight() {
1164
+ if (this.tableOptions.verticalScroll?.cssFormula) {
1165
+ return;
1166
+ }
1170
1167
  if (this.tableOptions.verticalScroll?.fitToContainer && this.tableContainer && this.paginatorContainer && this.headerContainer) {
1171
1168
  const containerRect = this.tableContainer.nativeElement.getBoundingClientRect();
1172
1169
  const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight;
@@ -1174,16 +1171,12 @@ class ECSPrimengTable {
1174
1171
  const viewportHeight = window.innerHeight;
1175
1172
  const topOffset = containerRect.top + window.scrollY;
1176
1173
  this.tableOptions.verticalScroll.height = (viewportHeight - topOffset - paginatorHeight - headerHeight) - 60;
1177
- /* const containerRect = this.tableContainer.nativeElement.getBoundingClientRect(); // Get the bounding rectangle of the table container
1178
- const paginatorHeight = this.paginatorContainer.nativeElement.offsetHeight; // Get the height of the paginator container
1179
- const headerHeight = this.headerContainer.nativeElement.offsetHeight; // Get the height of the header container
1180
- const viewportHeight = window.innerHeight; // Get the height of the viewport (visible part of the window)
1181
- const topOffset = containerRect.top + window.scrollY; // Calculate the top offset of the table container relative to the viewport
1182
- this.tableOptions.verticalScroll.height = `${(viewportHeight - topOffset - paginatorHeight - headerHeight) - 45}px`; // Calculate and set the scrollable height by subtracting offsets and container heights
1183
- }*/
1184
1174
  }
1185
1175
  }
1186
1176
  get scrollHeightValue() {
1177
+ if (this.tableOptions.verticalScroll?.cssFormula) {
1178
+ return this.tableOptions.verticalScroll.cssFormula;
1179
+ }
1187
1180
  const height = this.tableOptions.verticalScroll?.height;
1188
1181
  return height && height > 0 ? `${height}px` : '';
1189
1182
  }
@@ -1335,7 +1328,6 @@ class ECSPrimengTable {
1335
1328
  this.fetchTableData(this.tableLazyLoadEventInformation);
1336
1329
  }
1337
1330
  viewCreate(viewAlias) {
1338
- console.log("length:", this.tableViewsList.length, "max:", this.maxViews);
1339
1331
  if (this.tableViewsList.length >= this.maxViews) {
1340
1332
  this.notification.showToast("error", "NO MORE VIEWS ALLOWED", "You have created the maximum number of allowed views for this table");
1341
1333
  return;