@colijnit/corecomponents_v12 256.1.24 → 256.1.25
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/bundles/colijnit-corecomponents_v12.umd.js +157 -94
- package/bundles/colijnit-corecomponents_v12.umd.js.map +1 -1
- package/colijnit-corecomponents_v12.d.ts +17 -16
- package/colijnit-corecomponents_v12.metadata.json +1 -1
- package/esm2015/colijnit-corecomponents_v12.js +18 -17
- package/esm2015/lib/components/simple-grid/simple-grid.component.js +146 -205
- package/esm2015/lib/service/excel-export.service.js +125 -0
- package/fesm2015/colijnit-corecomponents_v12.js +265 -202
- package/fesm2015/colijnit-corecomponents_v12.js.map +1 -1
- package/lib/components/simple-grid/simple-grid.component.d.ts +5 -6
- package/lib/components/simple-grid/style/_layout.scss +5 -8
- package/lib/service/excel-export.service.d.ts +44 -0
- package/package.json +1 -1
|
@@ -2,12 +2,14 @@ import { ChangeDetectorRef } from '@angular/core';
|
|
|
2
2
|
import { FormMasterService } from '../../core/service/form-master.service';
|
|
3
3
|
import { BaseSimpleGridComponent } from './base-simple-grid.component';
|
|
4
4
|
import { ColumnAlign } from './simple-grid-column.directive';
|
|
5
|
-
import { CoreComponentsIcon } from
|
|
6
|
-
import { IconCacheService } from
|
|
5
|
+
import { CoreComponentsIcon } from '../../core/enum/core-components-icon.enum';
|
|
6
|
+
import { IconCacheService } from '../icon/icon-cache.service';
|
|
7
|
+
import { ExcelExportService } from '../../service/excel-export.service';
|
|
7
8
|
export declare class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
8
9
|
icons: IconCacheService;
|
|
9
10
|
private _changeDetection;
|
|
10
11
|
private _formMaster;
|
|
12
|
+
private excelExportService;
|
|
11
13
|
readonly defaultTextAlign: ColumnAlign;
|
|
12
14
|
set headerCells(cells: any);
|
|
13
15
|
showAdd: boolean;
|
|
@@ -35,12 +37,10 @@ export declare class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
35
37
|
readonly Icons: typeof CoreComponentsIcon;
|
|
36
38
|
private _doubleClicked;
|
|
37
39
|
private _newRow;
|
|
38
|
-
constructor(icons: IconCacheService, _changeDetection: ChangeDetectorRef, _formMaster: FormMasterService);
|
|
40
|
+
constructor(icons: IconCacheService, _changeDetection: ChangeDetectorRef, _formMaster: FormMasterService, excelExportService: ExcelExportService);
|
|
39
41
|
handleClickOutsideRow(): void;
|
|
40
42
|
getIsRowDisabled(idx: number): boolean;
|
|
41
43
|
isRowDisabled(row: any, index: number): Promise<boolean>;
|
|
42
|
-
isSingleColumn(column: any): boolean;
|
|
43
|
-
rowContainsSingleColumn(row: any, columns: any): boolean;
|
|
44
44
|
addNewRow(): Promise<void>;
|
|
45
45
|
validateAndSave(stopediting?: boolean): boolean;
|
|
46
46
|
cancelEditRow(): void;
|
|
@@ -53,7 +53,6 @@ export declare class SimpleGridComponent extends BaseSimpleGridComponent {
|
|
|
53
53
|
toggleSettingsMenu(): void;
|
|
54
54
|
toggleColumnMenu(col: any): void;
|
|
55
55
|
hideColumn(col: any): void;
|
|
56
|
-
private _sortData;
|
|
57
56
|
showAllColumns(): void;
|
|
58
57
|
exportToExcel(): void;
|
|
59
58
|
protected prepareDataRow(row: any, index: number): void;
|
|
@@ -158,15 +158,12 @@
|
|
|
158
158
|
justify-content: flex-start;
|
|
159
159
|
}
|
|
160
160
|
.grid-settings {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
padding-bottom: 4px;
|
|
165
|
-
box-shadow: inset 0 -2px $cc-color-grid-row-hover-background;
|
|
166
|
-
border: none;
|
|
161
|
+
position: absolute;
|
|
162
|
+
right: 0;
|
|
163
|
+
top: 0;
|
|
167
164
|
|
|
168
165
|
co-button {
|
|
169
|
-
|
|
166
|
+
height: 30px;
|
|
170
167
|
cursor: pointer;
|
|
171
168
|
|
|
172
169
|
&.selected {
|
|
@@ -206,7 +203,7 @@
|
|
|
206
203
|
.settings-menu,
|
|
207
204
|
.column-menu {
|
|
208
205
|
position: absolute;
|
|
209
|
-
top:
|
|
206
|
+
top: 38px;
|
|
210
207
|
right: 4px;
|
|
211
208
|
width: 250px;
|
|
212
209
|
padding: 0 8px 8px;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ExportColumn {
|
|
2
|
+
key: string;
|
|
3
|
+
header: string;
|
|
4
|
+
width?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare class ExcelExportService {
|
|
7
|
+
/**
|
|
8
|
+
* Export data to Excel file
|
|
9
|
+
* @param data - Array of objects to export
|
|
10
|
+
* @param columns - Column configuration (optional)
|
|
11
|
+
* @param fileName - Name of the exported file
|
|
12
|
+
* @param sheetName - Name of the Excel sheet
|
|
13
|
+
*/
|
|
14
|
+
exportToExcel(data: any[], columns?: ExportColumn[], fileName?: string, sheetName?: string): void;
|
|
15
|
+
/**
|
|
16
|
+
* Export multiple sheets to one Excel file
|
|
17
|
+
* @param sheets - Array of sheet data
|
|
18
|
+
* @param fileName - Name of the exported file
|
|
19
|
+
*/
|
|
20
|
+
exportMultipleSheets(sheets: Array<{
|
|
21
|
+
data: any[];
|
|
22
|
+
columns?: ExportColumn[];
|
|
23
|
+
sheetName: string;
|
|
24
|
+
}>, fileName?: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Export HTML table to Excel
|
|
27
|
+
* @param tableId - ID of the HTML table element
|
|
28
|
+
* @param fileName - Name of the exported file
|
|
29
|
+
* @param sheetName - Name of the Excel sheet
|
|
30
|
+
*/
|
|
31
|
+
exportTableToExcel(tableId: string, fileName?: string, sheetName?: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Get nested object value using dot notation
|
|
34
|
+
* @param obj - Object to search in
|
|
35
|
+
* @param path - Dot notation path (e.g., 'user.address.city')
|
|
36
|
+
*/
|
|
37
|
+
private getNestedValue;
|
|
38
|
+
/**
|
|
39
|
+
* Format date for Excel export
|
|
40
|
+
* @param date - Date to format
|
|
41
|
+
* @param format - Format string (default: 'MM/DD/YYYY')
|
|
42
|
+
*/
|
|
43
|
+
formatDateForExport(date: Date | string, format?: string): string;
|
|
44
|
+
}
|