Skip to content

Commit 4dfd9c1

Browse files
authored
feat(elements): Add excel and csv exporters to elements. (#15611)
1 parent 8460eea commit 4dfd9c1

File tree

8 files changed

+33
-2
lines changed

8 files changed

+33
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { GridTypeBase, IgxCsvExporterOptions, IgxCsvExporterService } from 'igniteui-angular';
2+
3+
export class IgcCsvExporterService extends IgxCsvExporterService {
4+
public override export(grid: GridTypeBase, options: IgxCsvExporterOptions): void {
5+
const gridRef = (grid as any).ngElementStrategy?.componentRef?.instance;
6+
super.export(gridRef || grid, options);
7+
}
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { GridTypeBase, IgxExcelExporterOptions, IgxExcelExporterService } from 'igniteui-angular';
2+
3+
export class IgcExcelExporterService extends IgxExcelExporterService {
4+
public override export(grid: GridTypeBase, options: IgxExcelExporterOptions): void {
5+
const gridRef = (grid as any).ngElementStrategy?.componentRef?.instance;
6+
super.export(gridRef || grid, options);
7+
}
8+
}

projects/igniteui-angular-elements/src/public_api.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { registerI18n, setCurrentI18n } from 'igniteui-i18n-core';
22
import { ByLevelTreeGridMergeStrategy, ColumnPinningPosition, DefaultMergeStrategy, DefaultTreeGridMergeStrategy, FilteringExpressionsTree, FilteringExpressionsTreeType, FilteringLogic, HorizontalAlignment, IgxBooleanFilteringOperand, IgxDateFilteringOperand, IgxDateTimeFilteringOperand, IgxFilteringOperand, IgxNumberFilteringOperand, IgxStringFilteringOperand, IgxTimeFilteringOperand, NoopFilteringStrategy, NoopSortingStrategy, SortingDirection, TransactionType, TransactionEventOrigin, VerticalAlignment } from 'igniteui-angular/core';
3-
import { DropPosition, GridPagingMode, IgxDateSummaryOperand, IgxNumberSummaryOperand, IgxPivotAggregate, IgxPivotDateAggregate, IgxPivotDateDimension, IgxPivotNumericAggregate, IgxPivotTimeAggregate, IgxSummaryOperand, IgxTimeSummaryOperand, NoopPivotDimensionsStrategy, PivotDimensionType, RowPinningPosition } from 'igniteui-angular/grids/core';
3+
import { CsvFileTypes, DropPosition, GridPagingMode, IgxCsvExporterOptions, IgxDateSummaryOperand, IgxExcelExporterOptions, IgxNumberSummaryOperand, IgxPivotAggregate, IgxPivotDateAggregate, IgxPivotDateDimension, IgxPivotNumericAggregate, IgxPivotTimeAggregate, IgxSummaryOperand, IgxTimeSummaryOperand, NoopPivotDimensionsStrategy, PivotDimensionType, RowPinningPosition } from 'igniteui-angular/grids/core';
4+
import { IgcExcelExporterService } from './lib/excel-exporter';
5+
import { IgcCsvExporterService } from './lib/csv-exporter';
46

57
/** Export Public API, TODO: reorganize, Generate all w/ renames? */
68
export {
@@ -53,4 +55,11 @@ export {
5355
// Transactions API
5456
TransactionType,
5557
TransactionEventOrigin,
58+
59+
// Exporters
60+
IgxExcelExporterOptions as IgcExcelExporterOptions,
61+
IgxCsvExporterOptions as IgcCsvExporterOptions,
62+
IgcExcelExporterService,
63+
IgcCsvExporterService,
64+
CsvFileTypes
5665
}

projects/igniteui-angular/grids/core/src/services/csv/csv-exporter-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { IgxExporterOptionsBase } from '../exporter-common/exporter-options-base';
22

3+
/* csSuppress */
34
/**
45
* Objects of this class are used to configure the CSV exporting process.
56
*/

projects/igniteui-angular/grids/core/src/services/csv/csv-exporter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ import { CharSeparatedValueData } from './char-separated-value-data';
55
import { CsvFileTypes, IgxCsvExporterOptions } from './csv-exporter-options';
66
import { IBaseEventArgs } from 'igniteui-angular/core';
77

8+
/* csSuppress */
89
export interface ICsvExportEndedEventArgs extends IBaseEventArgs {
910
csvData?: string;
1011
}
1112

13+
/* csSuppress */
1214
/**
1315
* **Ignite UI for Angular CSV Exporter Service** -
1416
* [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/exporter-csv)

projects/igniteui-angular/grids/core/src/services/excel/excel-exporter-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { IgxExporterOptionsBase } from '../exporter-common/exporter-options-base';
22

3+
/* csSuppress */
34
/**
45
* Objects of this class are used to configure the Excel exporting process.
56
*/

projects/igniteui-angular/grids/core/src/services/excel/excel-exporter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import { WorksheetData } from './worksheet-data';
1111
import { WorksheetFile } from './excel-files';
1212
import { IBaseEventArgs } from 'igniteui-angular/core';
1313

14+
/* csSuppress */
1415
export interface IExcelExportEndedEventArgs extends IBaseEventArgs {
1516
xlsx?: Object
1617
}
1718

1819
const EXCEL_MAX_ROWS = 1048576;
1920
const EXCEL_MAX_COLS = 16384;
2021

22+
/* csSuppress */
2123
/**
2224
* **Ignite UI for Angular Excel Exporter Service** -
2325
* [Documentation](https://www.infragistics.com/products/ignite-ui-angular/angular/components/exporter_excel.html)

projects/igniteui-angular/grids/core/src/services/exporter-common/base-export-service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export abstract class IgxBaseExporter {
225225
*
226226
* @memberof IgxBaseExporter
227227
*/
228-
public export(grid: any, options: IgxExporterOptionsBase): void {
228+
public export(grid: GridTypeBase, options: IgxExporterOptionsBase): void {
229229
if (options === undefined || options === null) {
230230
throw Error('No options provided!');
231231
}

0 commit comments

Comments
 (0)