@competer/primeng-table 0.0.0-stage → 19.1.8
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/README.md +174 -3
- package/fesm2022/competer-primeng-table.mjs +2562 -0
- package/fesm2022/competer-primeng-table.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/components/column-selector/column-selector.d.ts +53 -0
- package/lib/components/ecs-primeng-table/ecs-primeng-table.d.ts +199 -0
- package/lib/components/ecs-primeng-table/ecs-primeng-table.service.d.ts +51 -0
- package/lib/components/export-excel/export-excel.d.ts +49 -0
- package/lib/components/export-excel/export-excel.service.d.ts +6 -0
- package/lib/components/table-button/table-button.d.ts +16 -0
- package/lib/components/table-cell/table-cell.d.ts +67 -0
- package/lib/components/table-predefined-filters/table-predefined-filters.d.ts +39 -0
- package/lib/components/views-management/views-management.d.ts +34 -0
- package/lib/enums/cell-display.enum.d.ts +5 -0
- package/lib/enums/cell-overflow-behaviour.enum.d.ts +12 -0
- package/lib/enums/data-align-horizontal.enum.d.ts +14 -0
- package/lib/enums/data-align-vertical.enum.d.ts +14 -0
- package/lib/enums/data-type.enum.enum.d.ts +19 -0
- package/lib/enums/device-type.enum.d.ts +6 -0
- package/lib/enums/frozen-column-align.enum.d.ts +15 -0
- package/lib/enums/index.d.ts +8 -0
- package/lib/enums/table-view-save-mode.enum.d.ts +17 -0
- package/lib/interfaces/columns-metadata.interface.d.ts +65 -0
- package/lib/interfaces/excel-export-request.interface.d.ts +20 -0
- package/lib/interfaces/index.d.ts +10 -0
- package/lib/interfaces/predefined-filter.interface.d.ts +101 -0
- package/lib/interfaces/table-button.interface.d.ts +75 -0
- package/lib/interfaces/table-configuration.interface.d.ts +23 -0
- package/lib/interfaces/table-options.interface.d.ts +591 -0
- package/lib/interfaces/table-paged-response.interface.d.ts +16 -0
- package/lib/interfaces/table-query-request.interface.d.ts +28 -0
- package/lib/interfaces/table-view-data.interface.d.ts +26 -0
- package/lib/interfaces/table-view.interface.d.ts +15 -0
- package/lib/pipes/ui-translate.pipe.d.ts +13 -0
- package/lib/services/http.service.d.ts +34 -0
- package/lib/services/i18n.service.d.ts +18 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/notification.service.d.ts +23 -0
- package/lib/services/table-state.service.d.ts +28 -0
- package/lib/utils/create-table-options.d.ts +5 -0
- package/lib/utils/data-align-horizontal-as-text.d.ts +11 -0
- package/lib/utils/data-align-vertical-as-text.d.ts +11 -0
- package/lib/utils/data-type-as-text.d.ts +11 -0
- package/lib/utils/frozen-column-align-as-text.d.ts +11 -0
- package/lib/utils/highlight-text.d.ts +17 -0
- package/lib/utils/index.d.ts +6 -0
- package/package.json +48 -3
- package/public-api.d.ts +9 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnChanges } from '@angular/core';
|
|
2
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
3
|
+
import { Table } from 'primeng/table';
|
|
4
|
+
import { CellOverflowBehaviour, DataAlignHorizontal, DataAlignVertical } from '../../enums';
|
|
5
|
+
import { IColumnMetadata } from '../../interfaces';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class ColumnSelector implements OnChanges {
|
|
8
|
+
private translate;
|
|
9
|
+
orderByHeader: boolean;
|
|
10
|
+
constructor(translate: TranslateService, changeDetector: ChangeDetectorRef);
|
|
11
|
+
ngOnChanges(): void;
|
|
12
|
+
private updateVisibleColumns;
|
|
13
|
+
dt_columnDialog: Table;
|
|
14
|
+
visible: boolean;
|
|
15
|
+
columnModalData: any[];
|
|
16
|
+
filteredColumnData: any[];
|
|
17
|
+
visibleChange: EventEmitter<boolean>;
|
|
18
|
+
applyChanges: EventEmitter<IColumnMetadata[]>;
|
|
19
|
+
cellOverflowBehaviourOptions: {
|
|
20
|
+
icon: string;
|
|
21
|
+
val: CellOverflowBehaviour;
|
|
22
|
+
name: string;
|
|
23
|
+
}[];
|
|
24
|
+
dataAlignHorizontalOptions: {
|
|
25
|
+
icon: string;
|
|
26
|
+
val: DataAlignHorizontal;
|
|
27
|
+
name: string;
|
|
28
|
+
}[];
|
|
29
|
+
dataAlignVerticalOptions: {
|
|
30
|
+
icon: string;
|
|
31
|
+
val: DataAlignVertical;
|
|
32
|
+
name: string;
|
|
33
|
+
}[];
|
|
34
|
+
translatedOptions(options: {
|
|
35
|
+
name: string;
|
|
36
|
+
icon: string;
|
|
37
|
+
val: number;
|
|
38
|
+
}[]): {
|
|
39
|
+
name: any;
|
|
40
|
+
icon: string;
|
|
41
|
+
val: number;
|
|
42
|
+
}[];
|
|
43
|
+
globalSearchText: string | null;
|
|
44
|
+
globalSearchMaxLength: number;
|
|
45
|
+
allColumnsCheckboxActive(): boolean;
|
|
46
|
+
allColumnsCheckboxClick(event: any): void;
|
|
47
|
+
filterColumnModal(event: any): void;
|
|
48
|
+
applyColumnModalChanges(): void;
|
|
49
|
+
clearGlobalFilter(dt: Table): void;
|
|
50
|
+
closeModal(): void;
|
|
51
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ColumnSelector, never>;
|
|
52
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ColumnSelector, "ecs-column-selector", never, { "orderByHeader": { "alias": "orderByHeader"; "required": false; }; "visible": { "alias": "visible"; "required": false; }; "columnModalData": { "alias": "columnModalData"; "required": false; }; "filteredColumnData": { "alias": "filteredColumnData"; "required": false; }; }, { "visibleChange": "visibleChange"; "applyChanges": "applyChanges"; }, never, never, true, never>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, EventEmitter, OnInit, OnDestroy } from '@angular/core';
|
|
2
|
+
import { Table, TableLazyLoadEvent, TablePageEvent, TableRowSelectEvent, TableRowUnSelectEvent } from 'primeng/table';
|
|
3
|
+
import { MenuItem } from 'primeng/api';
|
|
4
|
+
import { Menu } from 'primeng/menu';
|
|
5
|
+
import { ECSPrimengTableService } from './ecs-primeng-table.service';
|
|
6
|
+
import { DeviceType, CellOverflowBehaviour, DataAlignHorizontal, DataAlignVertical, DataType, FrozenColumnAlign, TableViewSaveMode } from '../../enums';
|
|
7
|
+
import { IColumnMetadata, IPredefinedFilter, ITablePagedResponse, ITableView, ITableOptions } from '../../interfaces';
|
|
8
|
+
import { ECSPrimengTableNotificationService } from '../../services';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class ECSPrimengTable implements OnInit, AfterViewInit, OnDestroy {
|
|
11
|
+
private tableService;
|
|
12
|
+
private notification;
|
|
13
|
+
private readonly i18n;
|
|
14
|
+
private readonly changeDetector;
|
|
15
|
+
private readonly stateScope;
|
|
16
|
+
private readonly destroyRef;
|
|
17
|
+
private initialStateApplied;
|
|
18
|
+
private destroyed;
|
|
19
|
+
constructor(tableService: ECSPrimengTableService, notification: ECSPrimengTableNotificationService);
|
|
20
|
+
tableOptions: ITableOptions;
|
|
21
|
+
onRowCheckboxChange: EventEmitter<{
|
|
22
|
+
rowID: any;
|
|
23
|
+
selected: boolean;
|
|
24
|
+
}>;
|
|
25
|
+
onRowSelect: EventEmitter<{
|
|
26
|
+
rowID: any;
|
|
27
|
+
rowData: any;
|
|
28
|
+
}>;
|
|
29
|
+
onRowUnselect: EventEmitter<{
|
|
30
|
+
rowID: any;
|
|
31
|
+
rowData: any;
|
|
32
|
+
}>;
|
|
33
|
+
onDataEndUpdate: EventEmitter<void>;
|
|
34
|
+
viewsModalShow: boolean;
|
|
35
|
+
tableViewCurrentSelectedAlias: string | null;
|
|
36
|
+
tableViewsFirstFetchDone: boolean;
|
|
37
|
+
excelReportTitle: string;
|
|
38
|
+
showExportModal: boolean;
|
|
39
|
+
showColumnSelector: boolean;
|
|
40
|
+
selectedRowsCheckbox: any[];
|
|
41
|
+
dt: Table;
|
|
42
|
+
globalSearchText: string | null;
|
|
43
|
+
tableViewsList: ITableView[];
|
|
44
|
+
tableViews_menuItems: any[];
|
|
45
|
+
DataType: typeof DataType;
|
|
46
|
+
CellOverflowBehaviour: typeof CellOverflowBehaviour;
|
|
47
|
+
DataAlignHorizontal: typeof DataAlignHorizontal;
|
|
48
|
+
DataAlignVertical: typeof DataAlignVertical;
|
|
49
|
+
FrozenColumnAlign: typeof FrozenColumnAlign;
|
|
50
|
+
TableViewSaveMode: typeof TableViewSaveMode;
|
|
51
|
+
rowSelection: any;
|
|
52
|
+
currentPage: number;
|
|
53
|
+
currentRowsPerPage: number;
|
|
54
|
+
allowedRowsPerPage: number[];
|
|
55
|
+
totalRecords: number;
|
|
56
|
+
totalRecordsNotFiltered: number;
|
|
57
|
+
dateFormat: string;
|
|
58
|
+
dateTimezone: string;
|
|
59
|
+
dateCulture: string;
|
|
60
|
+
exportDateFormat: string;
|
|
61
|
+
columns: IColumnMetadata[];
|
|
62
|
+
columnsCantBeHidden: IColumnMetadata[];
|
|
63
|
+
columnsSelected: IColumnMetadata[];
|
|
64
|
+
columnModalData: any[];
|
|
65
|
+
filteredColumnData: any[];
|
|
66
|
+
private initialColumnWidths;
|
|
67
|
+
private initialTableWidth;
|
|
68
|
+
predefinedFiltersSelectedValuesCollection: {
|
|
69
|
+
[key: string]: any[];
|
|
70
|
+
};
|
|
71
|
+
private copyCellDataTimer;
|
|
72
|
+
tableLazyLoadEventInformation: TableLazyLoadEvent;
|
|
73
|
+
private initialConfigurationFetched;
|
|
74
|
+
private maxViews;
|
|
75
|
+
ngOnInit(): void;
|
|
76
|
+
tableContainer: ElementRef;
|
|
77
|
+
headerContainer: ElementRef;
|
|
78
|
+
paginatorContainer: ElementRef;
|
|
79
|
+
ngAfterViewInit(): void;
|
|
80
|
+
deviceType: DeviceType;
|
|
81
|
+
private columnSelectionCustomized;
|
|
82
|
+
headerMenuItems: MenuItem[];
|
|
83
|
+
rowMenuItems: MenuItem[];
|
|
84
|
+
rowMenuRow: any;
|
|
85
|
+
responsiveHeaderMenu?: Menu;
|
|
86
|
+
responsiveRowMenu?: Menu;
|
|
87
|
+
get compactHeader(): boolean;
|
|
88
|
+
get compactRows(): boolean;
|
|
89
|
+
get actionColumnWidth(): number;
|
|
90
|
+
private isInitiallyVisible;
|
|
91
|
+
private updateResponsiveViewport;
|
|
92
|
+
private buttonVisible;
|
|
93
|
+
hasRowMenuActions(row: any): boolean;
|
|
94
|
+
private buttonMenuItems;
|
|
95
|
+
openRowMenu(event: Event, row: any): void;
|
|
96
|
+
private translateMenuItems;
|
|
97
|
+
openHeaderMenu(event: Event): void;
|
|
98
|
+
private validateStatePersistence;
|
|
99
|
+
ngOnDestroy(): void;
|
|
100
|
+
private restoreNavigationState;
|
|
101
|
+
private restorePredefinedSelections;
|
|
102
|
+
onResize(): void;
|
|
103
|
+
private calculateScrollHeight;
|
|
104
|
+
get scrollHeightValue(): string;
|
|
105
|
+
/**
|
|
106
|
+
* Updates the table data and, if needed, retrieves the initial table configuration from an external source.
|
|
107
|
+
*
|
|
108
|
+
* Also allows resetting the table to its original state before any user manipulations.
|
|
109
|
+
*
|
|
110
|
+
* @param {boolean} [resetTableView=false] Optional.
|
|
111
|
+
* - `true`: resets the table state before loading data.
|
|
112
|
+
* - `false`: refreshes data using the current configuration (and retrieves initial configuration if necessary).
|
|
113
|
+
*
|
|
114
|
+
* **_Behavior_**
|
|
115
|
+
* - The table is automatically set to `isActive = true`.
|
|
116
|
+
* - If the initial configuration has not been fetched, it will fetch it and then update the data.
|
|
117
|
+
* - If the initial configuration is already fetched, it will just update the data.
|
|
118
|
+
* - If `resetTableView` is true and the configuration is already initialized, the table will be reset to its original state before updating the data.
|
|
119
|
+
*/
|
|
120
|
+
updateData(resetTableView?: boolean): void;
|
|
121
|
+
private canFetchData;
|
|
122
|
+
private fetchTableConfiguration;
|
|
123
|
+
private handleTableConfigurationResponse;
|
|
124
|
+
refreshData(event: any): void;
|
|
125
|
+
tableViewsEnabled(): boolean;
|
|
126
|
+
private fetchTableViews;
|
|
127
|
+
private tableViewListProcess;
|
|
128
|
+
private startInitialDataLoad;
|
|
129
|
+
viewLoad(tableViewAlias: string): void;
|
|
130
|
+
viewCreate(viewAlias: string): void;
|
|
131
|
+
viewDelete(viewAlias: string): void;
|
|
132
|
+
viewEditAlias(event: {
|
|
133
|
+
viewAliasOld: string;
|
|
134
|
+
viewAliasNew: string;
|
|
135
|
+
}): void;
|
|
136
|
+
viewUpdateData(viewAlias: string): void;
|
|
137
|
+
viewUpdateActiveStartup(viewAlias: string): void;
|
|
138
|
+
viewsSave(endMessage: number): void;
|
|
139
|
+
viewsSaveEnd(endMessage: number): void;
|
|
140
|
+
fetchTableData(event: TableLazyLoadEvent): void;
|
|
141
|
+
modifyFiltersWithoutGlobalAndSelectedRows(filters: any, overrideOption?: number): any;
|
|
142
|
+
resetTableView(): void;
|
|
143
|
+
private selectorRowFilterBuilder;
|
|
144
|
+
revertDateTimeZoneFilters(inputFilter: any): any;
|
|
145
|
+
handleTableDataResponse(body: ITablePagedResponse): void;
|
|
146
|
+
clearFilters(dt: Table, force?: boolean, onlyGlobalFilter?: boolean): void;
|
|
147
|
+
clearSorts(dt: Table, force?: boolean): void;
|
|
148
|
+
hasToClearSorts(dt: Table, force?: boolean): boolean;
|
|
149
|
+
hasToClearFilters(dt: Table, globalSearchText: string | null, force?: boolean): boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Determines whether there are active filters based on the provided filter rules.
|
|
152
|
+
*
|
|
153
|
+
* @param {any} filterRules An object representing filter rules for each column.
|
|
154
|
+
* The keys are column names, and the values are arrays of filter rules.
|
|
155
|
+
* Each filter rule has the following properties:
|
|
156
|
+
* - `field`: The field or property name of the column.
|
|
157
|
+
* - `value`: The filter value entered by the user.
|
|
158
|
+
* - Other properties depending on the type of filter (e.g., `matchMode` for string filters).
|
|
159
|
+
* @returns {boolean} `true` if at least one active filter is found, otherwise `false`.
|
|
160
|
+
*/
|
|
161
|
+
private hasFilters;
|
|
162
|
+
getColumnStyle(col: any, headerCols?: boolean): Record<string, string>;
|
|
163
|
+
getPredefinedFilterValues(columnKeyName: string): IPredefinedFilter[];
|
|
164
|
+
getFrozenColumnAlignAsText(frozenColumnAlign: FrozenColumnAlign): string;
|
|
165
|
+
getDataTypeAsText(dataType: DataType): string;
|
|
166
|
+
/**
|
|
167
|
+
* Updates the filters of a PrimeNG data table based on predefined filter changes.
|
|
168
|
+
*
|
|
169
|
+
* @param {string} filterName - The name of the filter to be updated.
|
|
170
|
+
* @param {IPrimengPredefinedFilter[]} selectedValues - An array of selected predefined filter values.
|
|
171
|
+
*/
|
|
172
|
+
onPredefinedFilterChange(filterName: string, selectedValues: IPredefinedFilter[]): void;
|
|
173
|
+
/**
|
|
174
|
+
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
175
|
+
* that need to be applied to an item on a row.
|
|
176
|
+
*
|
|
177
|
+
* @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
|
|
178
|
+
* @param {any} value - The value to be matched against the predefined filter values.
|
|
179
|
+
* @returns {any} The matching predefined filter value if found, otherwise null.
|
|
180
|
+
*/
|
|
181
|
+
getPredfinedFilterMatch(colMetadata: IColumnMetadata, value: any): any;
|
|
182
|
+
copyToClipboardStart(event: MouseEvent): void;
|
|
183
|
+
copyToClipboardCancel(): void;
|
|
184
|
+
getDataAlignHorizontalAsText(dataAlignHorizontal: DataAlignHorizontal): string;
|
|
185
|
+
getDataAlignVerticalAsText(dataAlignVertical: DataAlignVertical): string;
|
|
186
|
+
isRowCheckboxSelected(rowID: any): boolean;
|
|
187
|
+
onRowChekboxChange(event: any, rowID: any): void;
|
|
188
|
+
rowSelect(event: TableRowSelectEvent<any>): void;
|
|
189
|
+
rowUnselect(event: TableRowUnSelectEvent<any>): void;
|
|
190
|
+
pageChange(event: TablePageEvent): void;
|
|
191
|
+
columnSelectorShow(): void;
|
|
192
|
+
applyColumnModalChanges(selectedColumns: IColumnMetadata[]): void;
|
|
193
|
+
private updateColumnsSpecialProperties;
|
|
194
|
+
openExcelExport(): void;
|
|
195
|
+
generateExcelReport(event: any): void;
|
|
196
|
+
updateIconBlobsForCollections(): void;
|
|
197
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTable, never>;
|
|
198
|
+
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>;
|
|
199
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { HttpResponse } from '@angular/common/http';
|
|
3
|
+
import { ECSPrimengTableHttpService, ECSPrimengTableNotificationService } from '../../services';
|
|
4
|
+
import { IColumnMetadata, IExcelExportRequest, IPredefinedFilter, ITableConfiguration, ITablePagedResponse, ITableView, ITableViewData } from '../../interfaces';
|
|
5
|
+
import { TableViewSaveMode } from '../../enums';
|
|
6
|
+
import { ITableQueryRequest } from '../../interfaces/table-query-request.interface';
|
|
7
|
+
import { MenuItem } from 'primeng/api';
|
|
8
|
+
import { Table } from 'primeng/table';
|
|
9
|
+
import * as i0 from "@angular/core";
|
|
10
|
+
export declare class ECSPrimengTableService {
|
|
11
|
+
private http;
|
|
12
|
+
private notification;
|
|
13
|
+
private readonly i18n;
|
|
14
|
+
constructor(http: ECSPrimengTableHttpService, notification: ECSPrimengTableNotificationService);
|
|
15
|
+
fetchTableConfiguration(url: string): Observable<HttpResponse<ITableConfiguration>>;
|
|
16
|
+
fetchTableData(url: string, postData: ITableQueryRequest): Observable<HttpResponse<ITablePagedResponse>>;
|
|
17
|
+
fetchExcelReport(url: string, postData: IExcelExportRequest): Observable<HttpResponse<Blob>>;
|
|
18
|
+
getIconBlob(url: string): Observable<HttpResponse<Blob>>;
|
|
19
|
+
downloadFile(data: Blob, fileName: string, contentType: string): void;
|
|
20
|
+
handleTableError(error: any, customTitle?: string): void;
|
|
21
|
+
orderColumnsWithFrozens(colsToOrder: IColumnMetadata[]): IColumnMetadata[];
|
|
22
|
+
/**
|
|
23
|
+
* Handles click events on action buttons in a row of data.
|
|
24
|
+
*
|
|
25
|
+
* @param {function} action - The action function to be executed when the button is clicked. It should accept one parameter, which is the row data.
|
|
26
|
+
* @param {any} [rowData=null] - The data of the row corresponding to the clicked button. Defaults to null.
|
|
27
|
+
*
|
|
28
|
+
* @returns {void}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* // Define an action for a button
|
|
32
|
+
* const deleteAction = (rowData) => {
|
|
33
|
+
* console.log(`Delete row with id: ${rowData.rowID}`);
|
|
34
|
+
* };
|
|
35
|
+
*
|
|
36
|
+
* // Use handleButtonsClick with row data
|
|
37
|
+
* handleButtonsClick(deleteAction, { rowID: 1, name: 'John Doe' });
|
|
38
|
+
*/
|
|
39
|
+
handleButtonsClick(action: (rowData: any) => void, rowData?: any): void;
|
|
40
|
+
handlePredefinedFilterClick(action: (rowData: any, option: IPredefinedFilter) => void, rowData: any | undefined, option: IPredefinedFilter): void;
|
|
41
|
+
getColumnStyle(col: any, headerCols?: boolean): Record<string, string>;
|
|
42
|
+
fetchTableViews(tableViewSaveAs: TableViewSaveMode, recoverListEndpoint: string, tableViewSaveKey: string): ITableView[] | Observable<HttpResponse<ITableView[]>>;
|
|
43
|
+
sortViews(tableSaveViewList: ITableView[]): void;
|
|
44
|
+
updateViewsMenuItems(tableSaveViewList: ITableView[]): MenuItem[];
|
|
45
|
+
viewsSaveToDatabase(tableSaveViewList: ITableView[], setListEndpoint: string, tableViewSaveKey: string): Observable<HttpResponse<any>>;
|
|
46
|
+
viewGenerateData(dt: Table, globalSearchText: string | null, currentPage: number, currentRowsPerPage: number, modifyFiltersFn: (filters: any) => any): ITableViewData;
|
|
47
|
+
computeColumnWidths(dt: Table): any;
|
|
48
|
+
computeTableWidth(dt: Table): any;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ECSPrimengTableService, never>;
|
|
50
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ECSPrimengTableService>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { SelectButtonChangeEvent } from 'primeng/selectbutton';
|
|
3
|
+
import { ECSPrimengTableNotificationService } from '../../services';
|
|
4
|
+
import { ExportExcelService } from './export-excel.service';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class ExportExcel implements OnChanges {
|
|
7
|
+
private notificationSerivce;
|
|
8
|
+
private exportExcelService;
|
|
9
|
+
private readonly i18n;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
rowCheckboxSelectorActive: boolean;
|
|
12
|
+
excelReportTitle: string;
|
|
13
|
+
includeTimeInTitle: boolean;
|
|
14
|
+
exportUseIconsInBools: boolean;
|
|
15
|
+
allowTitleUserEdit: boolean;
|
|
16
|
+
exportToExcel: EventEmitter<{
|
|
17
|
+
allColumns: boolean;
|
|
18
|
+
applyFilters: boolean;
|
|
19
|
+
applySorts: boolean;
|
|
20
|
+
selectedRows: number;
|
|
21
|
+
filename: string;
|
|
22
|
+
useIconInBools: boolean;
|
|
23
|
+
}>;
|
|
24
|
+
visibleChange: EventEmitter<boolean>;
|
|
25
|
+
constructor(notificationSerivce: ECSPrimengTableNotificationService, exportExcelService: ExportExcelService);
|
|
26
|
+
option_exportColumns_selected: boolean;
|
|
27
|
+
option_exportColumns: any[];
|
|
28
|
+
option_applyCurrentFilters_selected: boolean;
|
|
29
|
+
option_applyCurrentFilters: any[];
|
|
30
|
+
option_applyCurrentSorts_selected: boolean;
|
|
31
|
+
option_applyCurrentSorts: any[];
|
|
32
|
+
option_selectedRowsExport_selected: number;
|
|
33
|
+
option_selectedRowsExport: any[];
|
|
34
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
35
|
+
private resetValues;
|
|
36
|
+
getExcelReport(): void;
|
|
37
|
+
translatedOptions(options: {
|
|
38
|
+
label: string;
|
|
39
|
+
value: boolean | number;
|
|
40
|
+
}[]): {
|
|
41
|
+
label: string;
|
|
42
|
+
value: boolean | number;
|
|
43
|
+
}[];
|
|
44
|
+
filterSelectorDisabled(): boolean;
|
|
45
|
+
onChangeExportRows(event: SelectButtonChangeEvent): void;
|
|
46
|
+
closeModal(): void;
|
|
47
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ExportExcel, never>;
|
|
48
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ExportExcel, "ecs-export-excel", never, { "visible": { "alias": "visible"; "required": false; }; "rowCheckboxSelectorActive": { "alias": "rowCheckboxSelectorActive"; "required": false; }; "excelReportTitle": { "alias": "excelReportTitle"; "required": false; }; "allowTitleUserEdit": { "alias": "allowTitleUserEdit"; "required": false; }; }, { "exportToExcel": "exportToExcel"; "visibleChange": "visibleChange"; }, never, never, true, never>;
|
|
49
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ECSPrimengTableService } from '../ecs-primeng-table/ecs-primeng-table.service';
|
|
2
|
+
import { ITableButton } from '../../interfaces';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TableButton {
|
|
5
|
+
private tableService;
|
|
6
|
+
constructor(tableService: ECSPrimengTableService);
|
|
7
|
+
button: any;
|
|
8
|
+
rowData: any;
|
|
9
|
+
isActionButton: boolean;
|
|
10
|
+
isLastActionButton: boolean;
|
|
11
|
+
overrideAction?: ((event: Event) => void);
|
|
12
|
+
handleClick(event: Event): void;
|
|
13
|
+
getButtonStyle(button: ITableButton, isActionButton: boolean, isLastActionButton: boolean): any;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableButton, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableButton, "ecs-table-button", never, { "button": { "alias": "button"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "isActionButton": { "alias": "isActionButton"; "required": false; }; "isLastActionButton": { "alias": "isLastActionButton"; "required": false; }; "overrideAction": { "alias": "overrideAction"; "required": false; }; }, {}, never, never, true, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { CellDisplay, DataAlignHorizontal, DataAlignVertical, DataType } from '../../enums';
|
|
2
|
+
import { DatePipe } from '@angular/common';
|
|
3
|
+
import { IColumnMetadata, IPredefinedFilter } from '../../interfaces';
|
|
4
|
+
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class TableCell {
|
|
7
|
+
private datePipe;
|
|
8
|
+
private sanitizer;
|
|
9
|
+
constructor(datePipe: DatePipe, sanitizer: DomSanitizer);
|
|
10
|
+
col: any;
|
|
11
|
+
rowData: any;
|
|
12
|
+
globalSearchText: string | null;
|
|
13
|
+
predefinedFiltersCollection?: {
|
|
14
|
+
[key: string]: IPredefinedFilter[];
|
|
15
|
+
};
|
|
16
|
+
dateFormat: string;
|
|
17
|
+
dateTimezone: string;
|
|
18
|
+
dateCulture: string;
|
|
19
|
+
DataType: typeof DataType;
|
|
20
|
+
CellDisplay: typeof CellDisplay;
|
|
21
|
+
/** Only finite numbers are valid; do not turn empty strings or booleans into progress. */
|
|
22
|
+
get hasProgressValue(): boolean;
|
|
23
|
+
get progressValue(): number;
|
|
24
|
+
get progressTooltip(): any;
|
|
25
|
+
get value(): any;
|
|
26
|
+
get tooltipText(): any;
|
|
27
|
+
getListValues(col: any, rowData: any): string[];
|
|
28
|
+
/** List tooltips use the same semicolon-separated positions as the displayed list. */
|
|
29
|
+
getListTooltip(item: string, index: number): string;
|
|
30
|
+
getDataAlignHorizontalAsText(dataAlignHorizontal: DataAlignHorizontal): void;
|
|
31
|
+
getDataAlignVerticalAsText(dataAlignVertical: DataAlignVertical): void;
|
|
32
|
+
/**
|
|
33
|
+
* Formats a date value using either column-level overrides or global settings.
|
|
34
|
+
* The incoming value is assumed to represent a UTC date.
|
|
35
|
+
*
|
|
36
|
+
* @param {any} value - The date value to be formatted.
|
|
37
|
+
* @param {string | null} dateFormat - Optional column-level override for the date format.
|
|
38
|
+
* @param {string | null} dateTimezone - Optional column-level override for the timezone used in formatting.
|
|
39
|
+
* @param {string | null} dateCulture - Optional column-level override for the culture used in formatting.
|
|
40
|
+
*
|
|
41
|
+
* @returns {string} - The formatted date string using the effective (column or global) settings,
|
|
42
|
+
* or an empty string if the value is invalid or undefined.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Example using only global settings:
|
|
46
|
+
* const result = formatDate(dateValue, null, null, null);
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Example using column-level overrides:
|
|
50
|
+
* const result = formatDate(dateValue, 'dd/MM/yyyy', 'UTC', 'en-GB');
|
|
51
|
+
*/
|
|
52
|
+
formatDate(value: any, dateFormat: string | null, dateTimezone: string | null, dateCulture: string | null): string;
|
|
53
|
+
getPredefinedFilterTooltip(colMetadata: IColumnMetadata, value: any): any;
|
|
54
|
+
/**
|
|
55
|
+
* Checks if the provided column metadata matches a specific style of the predefined filters
|
|
56
|
+
* that need to be applied to an item on a row.
|
|
57
|
+
*
|
|
58
|
+
* @param {IprimengColumnsMetadata} colMetadata - The metadata of the column being checked.
|
|
59
|
+
* @param {any} value - The value to be matched against the predefined filter values.
|
|
60
|
+
* @returns {any} The matching predefined filter value if found, otherwise null.
|
|
61
|
+
*/
|
|
62
|
+
getPredfinedFilterMatch(colMetadata: IColumnMetadata, value: any): any;
|
|
63
|
+
getPredefinedFilterValues(columnKeyName: string): IPredefinedFilter[];
|
|
64
|
+
highlightText(cellValue: any, colMetadata: IColumnMetadata, globalSearchText: string | null): SafeHtml;
|
|
65
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TableCell, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TableCell, "ecs-table-cell", never, { "col": { "alias": "col"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "globalSearchText": { "alias": "globalSearchText"; "required": false; }; "predefinedFiltersCollection": { "alias": "predefinedFiltersCollection"; "required": false; }; "dateFormat": { "alias": "dateFormat"; "required": false; }; "dateTimezone": { "alias": "dateTimezone"; "required": false; }; "dateCulture": { "alias": "dateCulture"; "required": false; }; }, {}, never, never, true, never>;
|
|
67
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DomSanitizer, SafeHtml, SafeUrl } from '@angular/platform-browser';
|
|
2
|
+
import { ECSPrimengTableService } from '../ecs-primeng-table/ecs-primeng-table.service';
|
|
3
|
+
import { IColumnMetadata } from '../../interfaces';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TablePredefinedFilters {
|
|
6
|
+
private sanitizer;
|
|
7
|
+
private tableService;
|
|
8
|
+
constructor(sanitizer: DomSanitizer, tableService: ECSPrimengTableService);
|
|
9
|
+
option: any;
|
|
10
|
+
col: any;
|
|
11
|
+
selectable: boolean;
|
|
12
|
+
rowData: any;
|
|
13
|
+
globalSearchText?: any;
|
|
14
|
+
/**
|
|
15
|
+
* Converts a blob from the database to a safe URL that can be used to display an image.
|
|
16
|
+
*
|
|
17
|
+
* This function takes a `Blob` object, converts it to a base64 encoded string, and returns a `SafeUrl`
|
|
18
|
+
* that can be used in an HTML template to display the image securely. The `SafeUrl` ensures that
|
|
19
|
+
* Angular's security mechanisms are bypassed correctly, preventing potential security risks.
|
|
20
|
+
*
|
|
21
|
+
* @param {Blob} blob - The blob object representing the image data from the database.
|
|
22
|
+
* @returns {SafeUrl} A safe URL that can be used to display the image in an HTML template.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* // Example usage in a component
|
|
26
|
+
* const imageBlob = new Blob([binaryData], { type: 'image/jpeg' });
|
|
27
|
+
* const imageUrl = this.getBlobIconAsUrl(imageBlob);
|
|
28
|
+
*
|
|
29
|
+
* // In your HTML template
|
|
30
|
+
* <img [src]="imageUrl" alt="Image">
|
|
31
|
+
*/
|
|
32
|
+
getBlobIconAsUrl(blob: Blob): SafeUrl;
|
|
33
|
+
handleClick(): void;
|
|
34
|
+
getTagStyle(option: any): any;
|
|
35
|
+
getImageSkeletonStyle(width?: number, height?: number, isSkeleton?: boolean): Record<string, string>;
|
|
36
|
+
highlightText(cellValue: any, colMetadata: IColumnMetadata, globalSearchText: string | null | undefined): SafeHtml;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TablePredefinedFilters, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TablePredefinedFilters, "ecs-table-predefined-filters", never, { "option": { "alias": "option"; "required": false; }; "col": { "alias": "col"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "rowData": { "alias": "rowData"; "required": false; }; "globalSearchText": { "alias": "globalSearchText"; "required": false; }; }, {}, never, never, true, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { ECSPrimengTableNotificationService } from '../../services';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ViewsManagement {
|
|
5
|
+
private notification;
|
|
6
|
+
private readonly i18n;
|
|
7
|
+
constructor(notification: ECSPrimengTableNotificationService);
|
|
8
|
+
visible: boolean;
|
|
9
|
+
tableViews_menuItems: any[];
|
|
10
|
+
onViewSelect: EventEmitter<string>;
|
|
11
|
+
onViewDelete: EventEmitter<string>;
|
|
12
|
+
onViewUpdateData: EventEmitter<string>;
|
|
13
|
+
onViewUpdateActiveStartup: EventEmitter<string>;
|
|
14
|
+
onViewEditAlias: EventEmitter<{
|
|
15
|
+
viewAliasOld: string;
|
|
16
|
+
viewAliasNew: string;
|
|
17
|
+
}>;
|
|
18
|
+
onViewCreate: EventEmitter<string>;
|
|
19
|
+
visibleChange: EventEmitter<boolean>;
|
|
20
|
+
viewEditorShow: boolean;
|
|
21
|
+
editingViewAlias: string;
|
|
22
|
+
newViewAlias: string;
|
|
23
|
+
loadView(viewAlias: string): void;
|
|
24
|
+
deleteView(viewAlias: string): void;
|
|
25
|
+
updateView(viewAlias: string): void;
|
|
26
|
+
updateViewActiveStartup(viewAlias: string): void;
|
|
27
|
+
createView(viewAlias: string): void;
|
|
28
|
+
editViewAlias(viewAliasOld: string, viewAliasNew: string): void;
|
|
29
|
+
showViewEditor(editingViewAlias?: string): void;
|
|
30
|
+
closeModal(): void;
|
|
31
|
+
createOrUpdateTableView(): void;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ViewsManagement, never>;
|
|
33
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ViewsManagement, "ecs-views-management", never, { "visible": { "alias": "visible"; "required": false; }; "tableViews_menuItems": { "alias": "tableViews_menuItems"; "required": false; }; }, { "onViewSelect": "onViewSelect"; "onViewDelete": "onViewDelete"; "onViewUpdateData": "onViewUpdateData"; "onViewUpdateActiveStartup": "onViewUpdateActiveStartup"; "onViewEditAlias": "onViewEditAlias"; "onViewCreate": "onViewCreate"; "visibleChange": "visibleChange"; }, never, never, true, never>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines how content that overflows a table cell is displayed.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This enumeration specifies the visual behavior of cell content when it exceeds the cell’s width.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum CellOverflowBehaviour {
|
|
8
|
+
/** The overflowing content is clipped and not visible. */
|
|
9
|
+
Hidden = 0,
|
|
10
|
+
/** The content wraps onto multiple lines to fit within the cell. */
|
|
11
|
+
Wrap = 1
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines the horizontal alignment of content within a table cell.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Specifies how the content inside a cell is positioned horizontally relative to the cell's width.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DataAlignHorizontal {
|
|
8
|
+
/** Content is aligned to the left side of the cell. */
|
|
9
|
+
Left = 0,
|
|
10
|
+
/** Content is aligned to the center of the cell. */
|
|
11
|
+
Center = 1,
|
|
12
|
+
/** Content is aligned to the right side of the cell. */
|
|
13
|
+
Right = 2
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the vertical alignment of content within a table cell.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Determines how the content inside a cell is positioned vertically relative to the cell's height.
|
|
6
|
+
*/
|
|
7
|
+
export declare enum DataAlignVertical {
|
|
8
|
+
/** Align content to the top of the cell. */
|
|
9
|
+
Top = 0,
|
|
10
|
+
/** Align content to the vertical middle of the cell. */
|
|
11
|
+
Middle = 1,
|
|
12
|
+
/** Align content to the bottom of the cell. */
|
|
13
|
+
Bottom = 2
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the different types of data a table column can hold.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This is used to determine how values should be rendered, formatted, and
|
|
6
|
+
* filtered in the table component.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum DataType {
|
|
9
|
+
/** Plain text string values. */
|
|
10
|
+
Text = 0,
|
|
11
|
+
/** Numeric values, e.g., integers or decimals. */
|
|
12
|
+
Numeric = 1,
|
|
13
|
+
/** Boolean values (true/false). */
|
|
14
|
+
Boolean = 2,
|
|
15
|
+
/** Date or datetime values. */
|
|
16
|
+
Date = 3,
|
|
17
|
+
/** List of values, stored as a string separated by a delimiter (";"). */
|
|
18
|
+
List = 4
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the alignment of frozen columns in a table.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Used to determine if a column should be frozen, and if so, on which side
|
|
6
|
+
* of the table it should appear.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum FrozenColumnAlign {
|
|
9
|
+
/** The column is not frozen. */
|
|
10
|
+
Noone = 0,
|
|
11
|
+
/** The column is frozen on the left side of the table. */
|
|
12
|
+
Left = 1,
|
|
13
|
+
/** The column is frozen on the right side of the table. */
|
|
14
|
+
Right = 2
|
|
15
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./cell-overflow-behaviour.enum";
|
|
2
|
+
export * from "./data-align-horizontal.enum";
|
|
3
|
+
export * from "./data-align-vertical.enum";
|
|
4
|
+
export * from "./data-type.enum.enum";
|
|
5
|
+
export * from "./frozen-column-align.enum";
|
|
6
|
+
export * from "./table-view-save-mode.enum";
|
|
7
|
+
export * from "./device-type.enum";
|
|
8
|
+
export * from "./cell-display.enum";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the mode used to save the state or configuration of a table view.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Determines where and how the table's view settings (e.g., column order, filters,
|
|
6
|
+
* sorting) are persisted.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum TableViewSaveMode {
|
|
9
|
+
/** Views are disabled. */
|
|
10
|
+
None = 0,
|
|
11
|
+
/** Save the table view state in the browser's sessionStorage (cleared on tab close). */
|
|
12
|
+
SessionStorage = 1,
|
|
13
|
+
/** Save the table view state in the browser's localStorage (persists across sessions). */
|
|
14
|
+
LocalStorage = 2,
|
|
15
|
+
/** Save the table view state in a backend database (requires server support). */
|
|
16
|
+
DatabaseStorage = 3
|
|
17
|
+
}
|