@eternalcodestudio/primeng-table 20.0.10 → 20.0.12

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
@@ -105,15 +105,25 @@ interface ITableButton {
105
105
  */
106
106
  style?: string;
107
107
  /**
108
- * Optional. Function that determines whether the button should be displayed for a given row.
108
+ * Optional. Function that determines whether the button should be visible for a given row.
109
109
  * @param rowData The row data object. Null for header buttons.
110
110
  * @returns True if the button should be visible; false otherwise.
111
111
  */
112
- condition?: (rowData: any) => boolean;
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;
113
121
  /**
114
- * Optional. Controls behavior when `condition` returns false.
115
- * - If `true`, the button will be hidden when the condition is not met.
116
- * - If `false` or `undefined`, the button will remain visible but disabled.
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.
117
127
  */
118
128
  conditionFailHide?: boolean;
119
129
  /**
@@ -603,6 +613,14 @@ interface ITableOptions {
603
613
  * @default false
604
614
  */
605
615
  resizable?: boolean;
616
+ /**
617
+ * Function that determines whether the checkbox should be enabled or not.
618
+ * @param rowData The row data object.
619
+ * @returns True if the checkbox should be enabled; false otherwise.
620
+ *
621
+ * @default undefined
622
+ */
623
+ enabledCondition?: (rowData: any) => boolean;
606
624
  };
607
625
  /**
608
626
  * Configurations related to the single row selector.
@@ -915,19 +933,30 @@ declare class ECSPrimengTable implements OnInit, AfterViewInit {
915
933
  paginatorContainer: ElementRef;
916
934
  ngAfterViewInit(): void;
917
935
  onResize(): void;
918
- calculateScrollHeight(): void;
936
+ private calculateScrollHeight;
919
937
  get scrollHeightValue(): string;
920
938
  /**
921
- * Used to update the data of a table externally outside the component.
939
+ * Updates the table data and, if needed, retrieves the initial table configuration from an external source.
940
+ *
941
+ * Also allows resetting the table to its original state before any user manipulations.
942
+ *
943
+ * @param {boolean} [resetTableView=false] Optional.
944
+ * - `true`: resets the table state before loading data.
945
+ * - `false`: refreshes data using the current configuration (and retrieves initial configuration if necessary).
922
946
  *
947
+ * **_Behavior_**
948
+ * - The table is automatically set to `isActive = true`.
949
+ * - If the initial configuration has not been fetched, it will fetch it and then update the data.
950
+ * - If the initial configuration is already fetched, it will just update the data.
951
+ * - If `resetTableView` is true and the configuration is already initialized, the table will be reset to its original state before updating the data.
923
952
  */
924
- updateData(): void;
925
- canFetchData(): boolean;
926
- fetchTableConfiguration(resetTableView?: boolean): void;
953
+ updateData(resetTableView?: boolean): void;
954
+ private canFetchData;
955
+ private fetchTableConfiguration;
927
956
  private handleTableConfigurationResponse;
928
957
  refreshData(event: any): void;
929
958
  tableViewsEnabled(): boolean;
930
- fetchTableViews(): void;
959
+ private fetchTableViews;
931
960
  private tableViewListProcess;
932
961
  viewLoad(tableViewAlias: string): void;
933
962
  viewCreate(viewAlias: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eternalcodestudio/primeng-table",
3
- "version": "20.0.10",
3
+ "version": "20.0.12",
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",