UNPKG

@progress/kendo-angular-excel-export

Version:

Kendo UI for Angular Excel Export component

934 lines (917 loc) 37.5 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2026 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import * as i0 from '@angular/core'; import { signal, ContentChildren, Input, ChangeDetectionStrategy, Component, QueryList, Optional, Directive, forwardRef, ContentChild, SkipSelf, Host, NgModule } from '@angular/core'; import { saveAs } from '@progress/kendo-file-saver'; import { IntlService, ExcelExporter, Workbook } from '@progress/kendo-ooxml'; export * from '@progress/kendo-ooxml'; import { toString } from '@progress/kendo-intl'; import * as i1 from '@progress/kendo-angular-l10n'; import { LocalizationService, L10N_PREFIX } from '@progress/kendo-angular-l10n'; import { validatePackage } from '@progress/kendo-licensing'; const compileTemplate = (templateRef, context, updateContext) => { let embeddedView = templateRef.createEmbeddedView(context); const result = (data) => { updateContext(context, data); embeddedView.detectChanges(); return embeddedView.rootNodes.reduce((content, rootNode) => { return content + rootNode.textContent; }, '').trim(); }; result.destroy = () => { embeddedView.destroy(); embeddedView = null; }; return result; }; const updateGroupHeaderContext = (context, data) => { context.$implicit = context.group = data; context.field = data.field; context.value = data.value; context.aggregates = data.aggregates; }; const updateGroupFooterContext = (context, data) => { context.group = data.group; context.$implicit = context.aggregates = data; }; const updateFooterContext = (context, data) => { context.aggregates = data.aggregates; }; /** * @hidden */ const toExporterColumns = (sourceColumns) => { const exporterColumns = []; let columnIndex = 0; const addColumns = (columns, result, level) => { columns.forEach((column) => { if (column.level === level) { const exporterColumn = new ExporterColumn(column, columnIndex); result.push(exporterColumn); if (column.children && column.children.some(c => c !== column)) { const children = exporterColumn.columns = []; addColumns(column.children, children, level + 1); } else { columnIndex++; } } }); }; addColumns(sourceColumns, exporterColumns, 0); return exporterColumns; }; /** * @hidden */ const destroyColumns = (columns) => { if (columns) { columns.forEach(column => { column.destroy(); }); } }; /** * @hidden */ class ExporterColumn { title; field; hidden; locked; width; columns; groupHeaderTemplate; groupHeaderColumnTemplate; groupFooterTemplate; footerTemplate; headerCellOptions; cellOptions; groupHeaderCellOptions; groupFooterCellOptions; footerCellOptions; constructor(column, columnIndex) { this.title = column.title; this.field = column.field; this.hidden = column.hidden; this.locked = column.locked; this.width = column.width; this.headerCellOptions = column.headerCellOptions; this.cellOptions = column.cellOptions; this.groupHeaderCellOptions = column.groupHeaderCellOptions; this.groupFooterCellOptions = column.groupFooterCellOptions; this.footerCellOptions = column.footerCellOptions; if (column.footerTemplate) { this.footerTemplate = compileTemplate(column.footerTemplate.templateRef, { $implicit: column, column: column, columnIndex: columnIndex }, updateFooterContext); } if (column.groupFooterTemplate) { this.groupFooterTemplate = compileTemplate(column.groupFooterTemplate.templateRef, { column: column, field: column.field }, updateGroupFooterContext); } if (column.groupHeaderTemplate) { this.groupHeaderTemplate = compileTemplate(column.groupHeaderTemplate.templateRef, {}, updateGroupHeaderContext); } if (column.groupHeaderColumnTemplate) { this.groupHeaderColumnTemplate = compileTemplate(column.groupHeaderColumnTemplate.templateRef, {}, updateGroupHeaderContext); } } destroy() { if (this.footerTemplate) { this.footerTemplate.destroy(); } if (this.groupFooterTemplate) { this.groupFooterTemplate.destroy(); } if (this.groupHeaderTemplate) { this.groupHeaderTemplate.destroy(); } if (this.groupHeaderColumnTemplate) { this.groupHeaderColumnTemplate.destroy(); } destroyColumns(this.columns); } } IntlService.register({ toString }); /** * * @hidden */ const workbookOptions = (options) => { const columns = toExporterColumns(options.columns); const exporter = new ExcelExporter({ columns: columns, data: options.data, filterable: options.filterable, groups: options.group, paddingCellOptions: options.paddingCellOptions, headerPaddingCellOptions: options.headerPaddingCellOptions, collapsible: options.collapsible, hierarchy: options.hierarchy, aggregates: options.aggregates }); const result = exporter.workbook(); result.creator = options.creator; result.date = options.date; result.rtl = options.rtl; destroyColumns(columns); return result; }; /** * @hidden */ const toDataURL = (options) => { const workbook = new Workbook(options); return workbook.toDataURL(); }; /** * @hidden */ const isWorkbookOptions = (value) => { return value && value.sheets; }; /** * @hidden */ class ColumnBase { parent; /** * The title of the column. */ set title(value) { this._title.set(value); } get title() { return this._title(); } /** * The width of the column in pixels. */ set width(value) { this._width.set(value); } get width() { return this._width(); } /** * Toggles the locked (frozen) state of the column ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#locked-state)). * * @default false */ set locked(value) { this._locked.set(value); } get locked() { return this._locked(); } /** * Sets the visibility of the column ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#hidden-state)). * * @default false */ set hidden(value) { this._hidden.set(value); } get hidden() { return this._hidden(); } /** * The options of the column header cell. */ set headerCellOptions(value) { this._headerCellOptions.set(value); } get headerCellOptions() { return this._headerCellOptions(); } /** * @hidden */ children; /** * @hidden */ get level() { return this.parent ? this.parent.level + 1 : 0; } _title = signal(undefined, ...(ngDevMode ? [{ debugName: "_title" }] : [])); _width = signal(undefined, ...(ngDevMode ? [{ debugName: "_width" }] : [])); _locked = signal(undefined, ...(ngDevMode ? [{ debugName: "_locked" }] : [])); _hidden = signal(undefined, ...(ngDevMode ? [{ debugName: "_hidden" }] : [])); _headerCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_headerCellOptions" }] : [])); constructor(parent) { this.parent = parent; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnBase, deps: [{ token: ColumnBase }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ColumnBase, isStandalone: true, selector: "ng-component", inputs: { title: "title", width: "width", locked: "locked", hidden: "hidden", headerCellOptions: "headerCellOptions" }, queries: [{ propertyName: "children", predicate: ColumnBase }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnBase, decorators: [{ type: Component, args: [{ template: '', changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [{ type: ColumnBase }], propDecorators: { title: [{ type: Input }], width: [{ type: Input }], locked: [{ type: Input }], hidden: [{ type: Input }], headerCellOptions: [{ type: Input }], children: [{ type: ContentChildren, args: [ColumnBase] }] } }); /** * @hidden */ const packageMetadata = { name: '@progress/kendo-angular-excel-export', productName: 'Kendo UI for Angular', productCode: 'KENDOUIANGULAR', productCodes: ['KENDOUIANGULAR'], publishDate: 1786525905, version: '25.0.0', licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/' }; // eslint-disable max-line-length /** * Represents the [Kendo UI Excel Export component for Angular](https://www.telerik.com/kendo-angular-ui/components/excel-export). * Use this component to export data to Excel format. * * @example * ```html * <kendo-excelexport [data]="gridData" fileName="MyExport.xlsx"> * <kendo-excelexport-column field="ProductID" title="Product ID"></kendo-excelexport-column> * <kendo-excelexport-column field="ProductName" title="Product Name"></kendo-excelexport-column> * </kendo-excelexport> * ``` * * @remarks * Supported children components are: {@link ColumnComponent}, {@link ColumnGroupComponent}. */ class ExcelExportComponent { localization; zone; /** * Specifies the name of the exported Excel file. * * @default "Export.xlsx" */ set fileName(value) { this._fileName.set(value); } get fileName() { return this._fileName(); } /** * Determines whether to enable column filtering in the exported Excel file * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/filtering)). */ set filterable(value) { this._filterable.set(value); } get filterable() { return this._filterable(); } /** * Determines whether groups in the Excel file are collapsible. */ set collapsible(value) { this._collapsible.set(value); } get collapsible() { return this._collapsible(); } /** * Specifies the author of the workbook. */ set creator(value) { this._creator.set(value); } get creator() { return this._creator(); } /** * Specifies the creation date of the workbook. * The default value is `new Date()`. * * @default `new Date()` */ set date(value) { this._date.set(value); } get date() { return this._date(); } /** * Determines whether to force the use of a proxy server for file downloads. * When set to `true`, the component sends content to `proxyURL` even if the browser supports local file saving. */ set forceProxy(value) { this._forceProxy.set(value); } get forceProxy() { return this._forceProxy(); } /** * Specifies the URL of the server-side proxy that streams the file to the user. * When the browser cannot save files locally (for example, Internet Explorer 9 and earlier, and Safari), the component uses a proxy. * You must implement the server-side proxy. * * The proxy receives a `POST` request with these parameters in the request body: * - `contentType`&mdash;The `MIME` type of the file. * - `base64`&mdash;The `base-64` encoded file content. * - `fileName`&mdash;The requested file name. * The proxy must return the decoded file with the `Content-Disposition` header set to `attachment; filename="<fileName.xslx>"`. */ set proxyURL(value) { this._proxyURL.set(value); } get proxyURL() { return this._proxyURL(); } /** * Specifies the data to export. * When the data is grouped, structure it as described by the * [`GroupResult`](https://www.telerik.com/kendo-angular-ui/components/data-query/api/groupresult) option of the Kendo UI Data Query component. */ set data(value) { this._data.set(value); } get data() { return this._data(); } /** * Specifies the exported data groups. * The groups must match the * [`GroupDescriptor`](https://www.telerik.com/kendo-angular-ui/components/data-query/api/groupdescriptor) option of the Kendo UI Data Query component. */ set group(value) { this._group.set(value); } get group() { return this._group(); } /** * Specifies the options for cells inserted before data, group, and footer cells * to show group hierarchy when the data is grouped * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#padding-cells)). */ set paddingCellOptions(value) { this._paddingCellOptions.set(value); } get paddingCellOptions() { return this._paddingCellOptions(); } /** * Specifies the options for cells inserted before header cells * to align headers and column values when the data is grouped * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#header-padding-cells)). */ set headerPaddingCellOptions(value) { this._headerPaddingCellOptions.set(value); } get headerPaddingCellOptions() { return this._headerPaddingCellOptions(); } /** * @hidden */ columns = new QueryList(); _fileName = signal('Export.xlsx', ...(ngDevMode ? [{ debugName: "_fileName" }] : [])); _filterable = signal(undefined, ...(ngDevMode ? [{ debugName: "_filterable" }] : [])); _collapsible = signal(undefined, ...(ngDevMode ? [{ debugName: "_collapsible" }] : [])); _creator = signal(undefined, ...(ngDevMode ? [{ debugName: "_creator" }] : [])); _date = signal(undefined, ...(ngDevMode ? [{ debugName: "_date" }] : [])); _forceProxy = signal(undefined, ...(ngDevMode ? [{ debugName: "_forceProxy" }] : [])); _proxyURL = signal(undefined, ...(ngDevMode ? [{ debugName: "_proxyURL" }] : [])); _data = signal(undefined, ...(ngDevMode ? [{ debugName: "_data" }] : [])); _group = signal(undefined, ...(ngDevMode ? [{ debugName: "_group" }] : [])); _paddingCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_paddingCellOptions" }] : [])); _headerPaddingCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_headerPaddingCellOptions" }] : [])); constructor(localization, zone) { this.localization = localization; this.zone = zone; validatePackage(packageMetadata); this.saveFile = this.saveFile.bind(this); } /** * Exports the data to Excel. * * @param exportData - Optional. The data to export or [`WorkbookOptions`](https://www.telerik.com/kendo-angular-ui/components/excel-export/api/workbookoptions). */ save(exportData) { this.toDataURL(exportData).then(this.saveFile); } /** * Returns [`WorkbookOptions`](https://www.telerik.com/kendo-angular-ui/components/excel-export/api/workbookoptions) based on the specified columns and data. * Use this method to customize the workbook options. * * @param exportData - Optional. The data to export. * @returns {WorkbookOptions} The workbook options. */ workbookOptions(exportData) { const currentData = this.getExportData(exportData); const options = workbookOptions({ columns: this.columns, data: currentData.data, group: currentData.group, filterable: this.filterable, creator: this.creator, date: this.date, rtl: this.localization.rtl, paddingCellOptions: this.paddingCellOptions, headerPaddingCellOptions: this.headerPaddingCellOptions, collapsible: this.collapsible }); return options; } /** * Returns a promise that resolves with the file data URI. * Use this method to get the Excel file as a data URI. * * @param exportData - Optional. The data or [`WorkbookOptions`](https://www.telerik.com/kendo-angular-ui/components/excel-export/api/workbookoptions) to use for generating the data URI. * @returns {Promise<string>} A promise that resolves with the file data URI. */ toDataURL(exportData) { const options = isWorkbookOptions(exportData) ? exportData : this.workbookOptions(exportData); return this.zone.runOutsideAngular(() => toDataURL(options)); } getExportData(exportData) { let result; if (exportData) { if (Array.isArray(exportData)) { result = { data: exportData }; } else { result = exportData; } } else { result = { data: this.data, group: this.group }; } return result; } saveFile(dataURL) { saveAs(dataURL, this.fileName, { forceProxy: this.forceProxy, proxyURL: this.proxyURL }); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportComponent, deps: [{ token: i1.LocalizationService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ExcelExportComponent, isStandalone: true, selector: "kendo-excelexport", inputs: { fileName: "fileName", filterable: "filterable", collapsible: "collapsible", creator: "creator", date: "date", forceProxy: "forceProxy", proxyURL: "proxyURL", data: "data", group: "group", paddingCellOptions: "paddingCellOptions", headerPaddingCellOptions: "headerPaddingCellOptions" }, providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.excelexport' } ], queries: [{ propertyName: "columns", predicate: ColumnBase, descendants: true }], exportAs: ["kendoExcelExport"], ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-excelexport', exportAs: 'kendoExcelExport', providers: [ LocalizationService, { provide: L10N_PREFIX, useValue: 'kendo.excelexport' } ], template: ``, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i0.NgZone }], propDecorators: { fileName: [{ type: Input }], filterable: [{ type: Input }], collapsible: [{ type: Input }], creator: [{ type: Input }], date: [{ type: Input }], forceProxy: [{ type: Input }], proxyURL: [{ type: Input }], data: [{ type: Input }], group: [{ type: Input }], paddingCellOptions: [{ type: Input }], headerPaddingCellOptions: [{ type: Input }], columns: [{ type: ContentChildren, args: [ColumnBase, { descendants: true }] }] } }); /** * Represents the footer cell template of the Excel Export column component * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#footer-template)). * Use this directive to customize the footer cell of a column. * * @example * ```html * <ng-template kendoExcelExportFooterTemplate let-column let-columnIndex="columnIndex"> * Footer for {{ column.field }} * </ng-template> * ``` */ class FooterTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: FooterTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.27", type: FooterTemplateDirective, isStandalone: true, selector: "[kendoExcelExportFooterTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: FooterTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoExcelExportFooterTemplate]', standalone: true }] }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }] }); /** * Represents the group header cell template of the Excel Export column component * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#group-header-template)). * Use this directive to customize the content of the group header item. * * @example * ```html * <ng-template kendoExcelExportGroupHeaderTemplate let-group let-field="field"> * Group Header for {{ field }} * </ng-template> * ``` */ class GroupHeaderTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupHeaderTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.27", type: GroupHeaderTemplateDirective, isStandalone: true, selector: "[kendoExcelExportGroupHeaderTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupHeaderTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoExcelExportGroupHeaderTemplate]', standalone: true }] }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }] }); /** * Represents the group header column template of the Excel Export column component * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#group-header-column-template)). * Use this directive to customize the group header column. * * @example * ```html * <ng-template kendoExcelExportGroupHeaderColumnTemplate let-group let-field="field"> * Group Header Column for {{ field }} * </ng-template> * ``` */ class GroupHeaderColumnTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupHeaderColumnTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.27", type: GroupHeaderColumnTemplateDirective, isStandalone: true, selector: "[kendoExcelExportGroupHeaderColumnTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupHeaderColumnTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoExcelExportGroupHeaderColumnTemplate]', standalone: true }] }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }] }); /** * Represents the group footer cell template of the Excel Export column component * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/columns#group-footer-template)). * Use this directive to customize the group footer cell of a column. * * @example * ```html * <ng-template kendoExcelExportGroupFooterTemplate let-group let-field="field"> * Group Footer for {{ field }} * </ng-template> * ``` */ class GroupFooterTemplateDirective { templateRef; constructor(templateRef) { this.templateRef = templateRef; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupFooterTemplateDirective, deps: [{ token: i0.TemplateRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.27", type: GroupFooterTemplateDirective, isStandalone: true, selector: "[kendoExcelExportGroupFooterTemplate]", ngImport: i0 }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: GroupFooterTemplateDirective, decorators: [{ type: Directive, args: [{ selector: '[kendoExcelExportGroupFooterTemplate]', standalone: true }] }], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{ type: Optional }] }] }); /** * Represents a column in the Kendo UI Excel Export component for Angular. * Use this component to define the structure and options for each column. * * @example * ```html * <kendo-excelexport-column field="ProductName"></kendo-excelexport-column> * ``` */ class ColumnComponent extends ColumnBase { /** * Specifies the field that the column displays. */ set field(value) { this._field.set(value); } get field() { return this._field(); } /** * Specifies options for the column's data cells * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#data-cells)). */ set cellOptions(value) { this._cellOptions.set(value); } get cellOptions() { return this._cellOptions(); } /** * Specifies options for the group header cells of the column * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#header-cells)). */ set groupHeaderCellOptions(value) { this._groupHeaderCellOptions.set(value); } get groupHeaderCellOptions() { return this._groupHeaderCellOptions(); } /** * Specifies options for the group footer cells of the column * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#group-footer-cells)). */ set groupFooterCellOptions(value) { this._groupFooterCellOptions.set(value); } get groupFooterCellOptions() { return this._groupFooterCellOptions(); } /** * Specifies options for the footer cell of the column * ([see example](https://www.telerik.com/kendo-angular-ui/components/excel-export/cells#footer-cells)). */ set footerCellOptions(value) { this._footerCellOptions.set(value); } get footerCellOptions() { return this._footerCellOptions(); } /** * @hidden */ groupHeaderTemplate; /** * @hidden */ groupHeaderColumnTemplate; /** * @hidden */ groupFooterTemplate; /** * @hidden */ footerTemplate; _field = signal(undefined, ...(ngDevMode ? [{ debugName: "_field" }] : [])); _cellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_cellOptions" }] : [])); _groupHeaderCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_groupHeaderCellOptions" }] : [])); _groupFooterCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_groupFooterCellOptions" }] : [])); _footerCellOptions = signal(undefined, ...(ngDevMode ? [{ debugName: "_footerCellOptions" }] : [])); constructor(parent) { super(parent); } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnComponent, deps: [{ token: ColumnBase, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ColumnComponent, isStandalone: true, selector: "kendo-excelexport-column", inputs: { field: "field", cellOptions: "cellOptions", groupHeaderCellOptions: "groupHeaderCellOptions", groupFooterCellOptions: "groupFooterCellOptions", footerCellOptions: "footerCellOptions" }, providers: [ { provide: ColumnBase, useExisting: forwardRef(() => ColumnComponent) } ], queries: [{ propertyName: "groupHeaderTemplate", first: true, predicate: GroupHeaderTemplateDirective, descendants: true }, { propertyName: "groupHeaderColumnTemplate", first: true, predicate: GroupHeaderColumnTemplateDirective, descendants: true }, { propertyName: "groupFooterTemplate", first: true, predicate: GroupFooterTemplateDirective, descendants: true }, { propertyName: "footerTemplate", first: true, predicate: FooterTemplateDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-excelexport-column', providers: [ { provide: ColumnBase, useExisting: forwardRef(() => ColumnComponent) } ], template: ``, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [{ type: ColumnBase, decorators: [{ type: SkipSelf }, { type: Host }, { type: Optional }] }], propDecorators: { field: [{ type: Input }], cellOptions: [{ type: Input }], groupHeaderCellOptions: [{ type: Input }], groupFooterCellOptions: [{ type: Input }], footerCellOptions: [{ type: Input }], groupHeaderTemplate: [{ type: ContentChild, args: [GroupHeaderTemplateDirective, { static: false }] }], groupHeaderColumnTemplate: [{ type: ContentChild, args: [GroupHeaderColumnTemplateDirective, { static: false }] }], groupFooterTemplate: [{ type: ContentChild, args: [GroupFooterTemplateDirective, { static: false }] }], footerTemplate: [{ type: ContentChild, args: [FooterTemplateDirective, { static: false }] }] } }); /** * Represents a group of columns in the Kendo UI Excel Export component. * Use this component to organize columns into groups. * * @example * ```html * <kendo-excelexport-column-group> * <kendo-excelexport-column field="ProductName"></kendo-excelexport-column> * <kendo-excelexport-column field="UnitPrice"></kendo-excelexport-column> * </kendo-excelexport-column-group> * ``` */ class ColumnGroupComponent extends ColumnBase { parent; constructor(parent) { super(parent); this.parent = parent; } static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnGroupComponent, deps: [{ token: ColumnBase, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.27", type: ColumnGroupComponent, isStandalone: true, selector: "kendo-excelexport-column-group", providers: [ { provide: ColumnBase, useExisting: forwardRef(() => ColumnGroupComponent) } ], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ColumnGroupComponent, decorators: [{ type: Component, args: [{ selector: 'kendo-excelexport-column-group', providers: [ { provide: ColumnBase, useExisting: forwardRef(() => ColumnGroupComponent) } ], template: ``, standalone: true, changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [{ type: ColumnBase, decorators: [{ type: SkipSelf }, { type: Host }, { type: Optional }] }] }); /** * Use this utility array to access all `@progress/kendo-angular-excel-export` related components and directives. */ const KENDO_EXCELEXPORT = [ ExcelExportComponent, ColumnComponent, ColumnGroupComponent, FooterTemplateDirective, GroupFooterTemplateDirective, GroupHeaderColumnTemplateDirective, GroupHeaderTemplateDirective ]; // IMPORTANT: NgModule export kept for backwards compatibility /** * Represents the [NgModule](link:site.data.urls.angular['ngmoduleapi']) definition for the Excel Export component. * * Use this module to enable Excel export features in your application. * * @example * ```typescript * import { ExcelExportModule } from '@progress/kendo-angular-excel-export'; * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; * import { NgModule } from '@angular/core'; * import { AppComponent } from './app.component'; * * @NgModule({ * declarations: [AppComponent], * imports: [BrowserModule, ExcelExportModule], * bootstrap: [AppComponent] * }) * export class AppModule {} * * platformBrowserDynamic().bootstrapModule(AppModule); * ``` */ class ExcelExportModule { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportModule, imports: [ExcelExportComponent, ColumnComponent, ColumnGroupComponent, FooterTemplateDirective, GroupFooterTemplateDirective, GroupHeaderColumnTemplateDirective, GroupHeaderTemplateDirective], exports: [ExcelExportComponent, ColumnComponent, ColumnGroupComponent, FooterTemplateDirective, GroupFooterTemplateDirective, GroupHeaderColumnTemplateDirective, GroupHeaderTemplateDirective] }); static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportModule }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.27", ngImport: i0, type: ExcelExportModule, decorators: [{ type: NgModule, args: [{ imports: [...KENDO_EXCELEXPORT], exports: [...KENDO_EXCELEXPORT] }] }] }); /** * Generated bundle index. Do not edit. */ export { ColumnBase, ColumnComponent, ColumnGroupComponent, ExcelExportComponent, ExcelExportModule, FooterTemplateDirective, GroupFooterTemplateDirective, GroupHeaderColumnTemplateDirective, GroupHeaderTemplateDirective, KENDO_EXCELEXPORT, isWorkbookOptions, toDataURL, workbookOptions };