@progress/kendo-react-excel-export 6.1.1 → 7.0.0-develop.1

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.
Files changed (63) hide show
  1. package/{dist/npm/ColumnBase.d.ts → ColumnBase.d.ts} +4 -0
  2. package/{dist/es/ExcelExport.d.ts → ExcelExport.d.ts} +5 -1
  3. package/{dist/es/ExcelExportColumn.d.ts → ExcelExportColumn.d.ts} +4 -0
  4. package/{dist/npm/ExcelExportColumnGroup.d.ts → ExcelExportColumnGroup.d.ts} +4 -0
  5. package/{dist/npm/ExcelExportData.d.ts → ExcelExportData.d.ts} +4 -0
  6. package/LICENSE.md +1 -1
  7. package/dist/cdn/js/kendo-react-excel.js +8 -0
  8. package/index.d.ts +15 -0
  9. package/index.js +8 -0
  10. package/index.mjs +226 -0
  11. package/{dist/es/ooxml → ooxml}/CellOptionsInterface.d.ts +4 -0
  12. package/{dist/npm/ooxml → ooxml}/ExporterColumns.d.ts +4 -0
  13. package/{dist/es/ooxml → ooxml}/workbook.d.ts +4 -0
  14. package/package-metadata.d.ts +9 -0
  15. package/package.json +28 -40
  16. package/{dist/npm/templates → templates}/ExcelExportFooter.d.ts +4 -0
  17. package/{dist/npm/templates → templates}/ExcelExportGroupFooter.d.ts +4 -0
  18. package/{dist/es/templates → templates}/ExcelExportGroupHeader.d.ts +4 -0
  19. package/about.md +0 -3
  20. package/dist/cdn/js/kendo-react-excel-export.js +0 -1
  21. package/dist/es/ColumnBase.d.ts +0 -38
  22. package/dist/es/ColumnBase.js +0 -1
  23. package/dist/es/ExcelExport.js +0 -193
  24. package/dist/es/ExcelExportColumn.js +0 -24
  25. package/dist/es/ExcelExportColumnGroup.d.ts +0 -11
  26. package/dist/es/ExcelExportColumnGroup.js +0 -17
  27. package/dist/es/ExcelExportData.d.ts +0 -13
  28. package/dist/es/ExcelExportData.js +0 -2
  29. package/dist/es/main.d.ts +0 -11
  30. package/dist/es/main.js +0 -9
  31. package/dist/es/ooxml/CellOptionsInterface.js +0 -2
  32. package/dist/es/ooxml/ExporterColumns.d.ts +0 -26
  33. package/dist/es/ooxml/ExporterColumns.js +0 -99
  34. package/dist/es/ooxml/workbook.js +0 -39
  35. package/dist/es/package-metadata.d.ts +0 -5
  36. package/dist/es/package-metadata.js +0 -11
  37. package/dist/es/templates/ExcelExportFooter.d.ts +0 -14
  38. package/dist/es/templates/ExcelExportFooter.js +0 -27
  39. package/dist/es/templates/ExcelExportGroupFooter.d.ts +0 -17
  40. package/dist/es/templates/ExcelExportGroupFooter.js +0 -27
  41. package/dist/es/templates/ExcelExportGroupHeader.js +0 -27
  42. package/dist/npm/ColumnBase.js +0 -2
  43. package/dist/npm/ExcelExport.d.ts +0 -151
  44. package/dist/npm/ExcelExport.js +0 -196
  45. package/dist/npm/ExcelExportColumn.d.ts +0 -50
  46. package/dist/npm/ExcelExportColumn.js +0 -27
  47. package/dist/npm/ExcelExportColumnGroup.js +0 -20
  48. package/dist/npm/ExcelExportData.js +0 -3
  49. package/dist/npm/main.d.ts +0 -11
  50. package/dist/npm/main.js +0 -32
  51. package/dist/npm/ooxml/CellOptionsInterface.d.ts +0 -76
  52. package/dist/npm/ooxml/CellOptionsInterface.js +0 -3
  53. package/dist/npm/ooxml/ExporterColumns.js +0 -103
  54. package/dist/npm/ooxml/workbook.d.ts +0 -14
  55. package/dist/npm/ooxml/workbook.js +0 -45
  56. package/dist/npm/package-metadata.d.ts +0 -5
  57. package/dist/npm/package-metadata.js +0 -14
  58. package/dist/npm/templates/ExcelExportFooter.js +0 -30
  59. package/dist/npm/templates/ExcelExportGroupFooter.js +0 -30
  60. package/dist/npm/templates/ExcelExportGroupHeader.d.ts +0 -16
  61. package/dist/npm/templates/ExcelExportGroupHeader.js +0 -30
  62. package/dist/systemjs/kendo-react-excel-export.js +0 -1
  63. package/e2e-next/excelexport.basic.tests.ts +0 -23
@@ -1,196 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- var __assign = (this && this.__assign) || function () {
18
- __assign = Object.assign || function(t) {
19
- for (var s, i = 1, n = arguments.length; i < n; i++) {
20
- s = arguments[i];
21
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
22
- t[p] = s[p];
23
- }
24
- return t;
25
- };
26
- return __assign.apply(this, arguments);
27
- };
28
- Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.ExcelExport = void 0;
30
- var React = require("react");
31
- var PropTypes = require("prop-types");
32
- var kendo_file_saver_1 = require("@progress/kendo-file-saver");
33
- var workbook_1 = require("./ooxml/workbook");
34
- var licensing = require("@progress/kendo-licensing");
35
- var package_metadata_1 = require("./package-metadata");
36
- var ExcelExport = /** @class */ (function (_super) {
37
- __extends(ExcelExport, _super);
38
- function ExcelExport(props) {
39
- var _this = _super.call(this, props) || this;
40
- _this.saveFile = function (dataURL) {
41
- (0, kendo_file_saver_1.saveAs)(dataURL, _this.props.fileName, {
42
- forceProxy: _this.props.forceProxy,
43
- proxyURL: _this.props.proxyURL
44
- });
45
- };
46
- _this.extractColumns = function (children, level) {
47
- if (level === void 0) { level = 0; }
48
- return Array.isArray(children)
49
- ? children.map(function (child) {
50
- return _this.extractChild(child, level);
51
- })
52
- : [children, _this.extractChild(children, level)];
53
- };
54
- _this.extractChild = function (child, level) {
55
- if (level === void 0) { level = 0; }
56
- return React.isValidElement(child)
57
- ? __assign(__assign({}, child.props), { width: child.props.width && parseInt("".concat(child.props.width), 10), level: level, children: child.props.children
58
- && _this.extractColumns(child.props.children, level + 1) }) : __assign(__assign({}, child), { level: level, children: child.children && _this.extractColumns(child.children, level + 1) });
59
- };
60
- _this.getExportData = function (exportData) {
61
- var result;
62
- if (exportData) {
63
- if (Array.isArray(exportData)) {
64
- result = {
65
- data: exportData
66
- };
67
- }
68
- else {
69
- result = exportData;
70
- }
71
- }
72
- else {
73
- result = {
74
- data: _this.props.data,
75
- group: _this.props.group
76
- };
77
- }
78
- return result;
79
- };
80
- if (typeof licensing !== 'undefined') {
81
- licensing.validatePackage(package_metadata_1.packageMetadata);
82
- }
83
- else {
84
- var message = "License activation failed for ".concat(package_metadata_1.packageMetadata.name, "\n");
85
- message += 'The @progress/kendo-licensing script is not loaded.\n';
86
- message += "See ".concat(package_metadata_1.packageMetadata.licensingDocsUrl, " for more information.\n");
87
- console.warn(message);
88
- }
89
- _this.save = _this.save.bind(_this);
90
- _this.toDataURL = _this.toDataURL.bind(_this);
91
- _this.workbookOptions = _this.workbookOptions.bind(_this);
92
- return _this;
93
- }
94
- /**
95
- * Saves the data to Excel.
96
- *
97
- * @param exportData - An optional parameter. Can be the data that will be exported or the [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}).
98
- * @param columns - An optional parameter. If present, it will be used instead of the columns prop or the child column components.
99
- */
100
- ExcelExport.prototype.save = function (exportData, columns) {
101
- var _this = this;
102
- this.toDataURL(exportData, columns)
103
- .then(function () {
104
- var args = [];
105
- for (var _i = 0; _i < arguments.length; _i++) {
106
- args[_i] = arguments[_i];
107
- }
108
- if (_this.props.onExportComplete) {
109
- _this.props.onExportComplete.call(undefined, { target: _this });
110
- }
111
- _this.saveFile.apply(_this, args);
112
- });
113
- };
114
- /**
115
- * Returns a promise which will be resolved with the file data URI.
116
- *
117
- * @param exportData - The optional data or the [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}) that will be used to generate the data URI.
118
- * @param externalColumns - The optional columns that will be used.
119
- * @returns {Promise<string>} - The promise that will be resolved by the file data URI.
120
- */
121
- ExcelExport.prototype.toDataURL = function (exportData, columns) {
122
- var options = (0, workbook_1.isWorkbookOptions)(exportData)
123
- ? exportData
124
- : this.workbookOptions(exportData, columns);
125
- return (0, workbook_1.toDataURL)(options);
126
- };
127
- /**
128
- * Based on the specified columns and data, returns [`WorkbookOptions`]({% slug api_excel-export_workbookoptions %}).
129
- *
130
- * @param exportData - The optional data that will be exported.
131
- * @param externalColumns - The optional columns that will be used.
132
- * @returns {WorkbookOptions} - The workbook options.
133
- */
134
- // tslint:enable:max-line-length
135
- ExcelExport.prototype.workbookOptions = function (exportData, externalColumns) {
136
- var currentData = this.getExportData(exportData);
137
- var children = this.props.children;
138
- var gridColumns = children && children.type &&
139
- children.type.displayName === 'KendoReactGrid' &&
140
- children.props && React.Children.toArray(children.props.children);
141
- var columns = this.extractColumns(gridColumns ||
142
- externalColumns ||
143
- this.props.columns ||
144
- React.Children.toArray(children));
145
- var options = (0, workbook_1.workbookOptions)({
146
- columns: columns,
147
- data: currentData.data,
148
- group: currentData.group,
149
- filterable: this.props.filterable,
150
- creator: this.props.creator,
151
- date: this.props.date,
152
- dir: this.props.dir,
153
- hierarchy: this.props.hierarchy,
154
- paddingCellOptions: this.props.paddingCellOptions,
155
- headerPaddingCellOptions: this.props.headerPaddingCellOptions,
156
- collapsible: this.props.collapsible
157
- });
158
- return options;
159
- };
160
- /**
161
- * @hidden
162
- */
163
- ExcelExport.prototype.render = function () {
164
- return this.props.children || null;
165
- };
166
- /**
167
- * @hidden
168
- */
169
- ExcelExport.propTypes = {
170
- children: PropTypes.any,
171
- columns: PropTypes.arrayOf(PropTypes.any),
172
- creator: PropTypes.string,
173
- data: PropTypes.any,
174
- date: PropTypes.any,
175
- filterable: PropTypes.bool,
176
- fileName: PropTypes.string,
177
- forceProxy: PropTypes.bool,
178
- group: PropTypes.any,
179
- headerPaddingCellOptions: PropTypes.any,
180
- paddingCellOptions: PropTypes.any,
181
- proxyURL: PropTypes.string,
182
- dir: PropTypes.string,
183
- hierarchy: PropTypes.bool,
184
- collapsible: PropTypes.bool
185
- };
186
- /**
187
- * @hidden
188
- */
189
- ExcelExport.defaultProps = {
190
- fileName: 'Export.xlsx',
191
- forceProxy: false,
192
- collapsible: false
193
- };
194
- return ExcelExport;
195
- }(React.Component));
196
- exports.ExcelExport = ExcelExport;
@@ -1,50 +0,0 @@
1
- import * as React from 'react';
2
- import { ColumnBase } from './ColumnBase';
3
- import { CellOptions } from './ooxml/CellOptionsInterface';
4
- import { ExcelExportGroupHeader } from './templates/ExcelExportGroupHeader';
5
- import { ExcelExportGroupFooter } from './templates/ExcelExportGroupFooter';
6
- import { ExcelExportFooter } from './templates/ExcelExportFooter';
7
- /**
8
- * Represents the props of the KendoReact ExcelExportColumnProps component.
9
- */
10
- export interface ExcelExportColumnProps extends ColumnBase {
11
- /**
12
- * The options of the column data cells.
13
- */
14
- cellOptions?: CellOptions;
15
- /**
16
- * The field to which the column is bound.
17
- */
18
- field?: string;
19
- /**
20
- * The options of the column footer cell.
21
- */
22
- footerCellOptions?: CellOptions;
23
- /**
24
- * The column footer. Can be a function or a React component.
25
- */
26
- footer?: Function | ExcelExportFooter;
27
- /**
28
- * The options of the column group footer cells.
29
- */
30
- groupFooterCellOptions?: CellOptions;
31
- /**
32
- * The footer of the group. Can be a function or a React component.
33
- */
34
- groupFooter?: Function | ExcelExportGroupFooter;
35
- /**
36
- * The options of the column group header cells.
37
- */
38
- groupHeaderCellOptions?: CellOptions;
39
- /**
40
- * The header of the group. Can be a function or a React component.
41
- */
42
- groupHeader?: Function | ExcelExportGroupHeader;
43
- }
44
- /**
45
- * Represents the columns of the KendoReact ExcelExport component.
46
- *
47
- * @returns null
48
- */
49
- declare const ExcelExportColumn: React.FunctionComponent<ExcelExportColumnProps>;
50
- export { ExcelExportColumn };
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExcelExportColumn = void 0;
4
- var PropTypes = require("prop-types");
5
- /**
6
- * Represents the columns of the KendoReact ExcelExport component.
7
- *
8
- * @returns null
9
- */
10
- var ExcelExportColumn = function (_) { return null; };
11
- exports.ExcelExportColumn = ExcelExportColumn;
12
- ExcelExportColumn.propTypes = {
13
- cellOptions: PropTypes.any,
14
- field: PropTypes.string,
15
- footerCellOptions: PropTypes.any,
16
- footer: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
17
- groupFooterCellOptions: PropTypes.any,
18
- groupFooter: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
19
- groupHeaderCellOptions: PropTypes.any,
20
- groupHeader: PropTypes.oneOfType([PropTypes.func, PropTypes.element]),
21
- headerCellOptions: PropTypes.any,
22
- hidden: PropTypes.bool,
23
- level: PropTypes.number,
24
- locked: PropTypes.bool,
25
- title: PropTypes.string,
26
- width: PropTypes.number
27
- };
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExcelExportColumnGroup = void 0;
4
- var PropTypes = require("prop-types");
5
- /**
6
- * Represents the column group component of the KendoReact ExcelExport component.
7
- *
8
- * @returns null
9
- */
10
- var ExcelExportColumnGroup = function (_) { return null; };
11
- exports.ExcelExportColumnGroup = ExcelExportColumnGroup;
12
- ExcelExportColumnGroup.propTypes = {
13
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element]),
14
- headerCellOptions: PropTypes.any,
15
- hidden: PropTypes.bool,
16
- level: PropTypes.number,
17
- locked: PropTypes.bool,
18
- title: PropTypes.string,
19
- width: PropTypes.number
20
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // tslint:enable:max-line-length
@@ -1,11 +0,0 @@
1
- import { ExcelExport, ExcelExportProps } from './ExcelExport';
2
- import { ExcelExportData } from './ExcelExportData';
3
- import { ExcelExportColumn, ExcelExportColumnProps } from './ExcelExportColumn';
4
- import { ExcelExportColumnGroup, ExcelExportColumnGroupProps } from './ExcelExportColumnGroup';
5
- import { ColumnBase } from './ColumnBase';
6
- import { ExcelExportFooter, ExcelExportFooterProps } from './templates/ExcelExportFooter';
7
- import { ExcelExportGroupFooter, ExcelExportGroupFooterProps } from './templates/ExcelExportGroupFooter';
8
- import { ExcelExportGroupHeader, ExcelExportGroupHeaderProps } from './templates/ExcelExportGroupHeader';
9
- import * as KendoOoxml from '@progress/kendo-ooxml';
10
- export { ExcelExport, ExcelExportData, ExcelExportProps, ExcelExportColumnGroup, ExcelExportColumnGroupProps, ExcelExportFooter, ExcelExportFooterProps, ExcelExportColumn, ExcelExportColumnProps, ColumnBase, ExcelExportGroupFooter, ExcelExportGroupFooterProps, ExcelExportGroupHeader, ExcelExportGroupHeaderProps, KendoOoxml };
11
- export * from './ooxml/workbook';
package/dist/npm/main.js DELETED
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.KendoOoxml = exports.ExcelExportGroupHeader = exports.ExcelExportGroupFooter = exports.ExcelExportColumn = exports.ExcelExportFooter = exports.ExcelExportColumnGroup = exports.ExcelExport = void 0;
18
- var ExcelExport_1 = require("./ExcelExport");
19
- Object.defineProperty(exports, "ExcelExport", { enumerable: true, get: function () { return ExcelExport_1.ExcelExport; } });
20
- var ExcelExportColumn_1 = require("./ExcelExportColumn");
21
- Object.defineProperty(exports, "ExcelExportColumn", { enumerable: true, get: function () { return ExcelExportColumn_1.ExcelExportColumn; } });
22
- var ExcelExportColumnGroup_1 = require("./ExcelExportColumnGroup");
23
- Object.defineProperty(exports, "ExcelExportColumnGroup", { enumerable: true, get: function () { return ExcelExportColumnGroup_1.ExcelExportColumnGroup; } });
24
- var ExcelExportFooter_1 = require("./templates/ExcelExportFooter");
25
- Object.defineProperty(exports, "ExcelExportFooter", { enumerable: true, get: function () { return ExcelExportFooter_1.ExcelExportFooter; } });
26
- var ExcelExportGroupFooter_1 = require("./templates/ExcelExportGroupFooter");
27
- Object.defineProperty(exports, "ExcelExportGroupFooter", { enumerable: true, get: function () { return ExcelExportGroupFooter_1.ExcelExportGroupFooter; } });
28
- var ExcelExportGroupHeader_1 = require("./templates/ExcelExportGroupHeader");
29
- Object.defineProperty(exports, "ExcelExportGroupHeader", { enumerable: true, get: function () { return ExcelExportGroupHeader_1.ExcelExportGroupHeader; } });
30
- var KendoOoxml = require("@progress/kendo-ooxml");
31
- exports.KendoOoxml = KendoOoxml;
32
- __exportStar(require("./ooxml/workbook"), exports);
@@ -1,76 +0,0 @@
1
- import { WorkbookSheetRowCellBorderBottom, WorkbookSheetRowCellBorderLeft, WorkbookSheetRowCellBorderTop, WorkbookSheetRowCellBorderRight } from '@progress/kendo-ooxml';
2
- /**
3
- * The options for the Excel Export cell.
4
- */
5
- export interface CellOptions {
6
- /**
7
- * Sets the background color of the cell. Supports hex CSS-like values that start with `"#"`. For example, `"#ff00ff"`.
8
- */
9
- background?: string;
10
- /**
11
- * The style information for the bottom border of the cell.
12
- */
13
- borderBottom?: WorkbookSheetRowCellBorderBottom;
14
- /**
15
- * The style information for the left border of the cell.
16
- */
17
- borderLeft?: WorkbookSheetRowCellBorderLeft;
18
- /**
19
- * The style information for the top border of the cell.
20
- */
21
- borderTop?: WorkbookSheetRowCellBorderTop;
22
- /**
23
- * The style information for the right border of the cell.
24
- */
25
- borderRight?: WorkbookSheetRowCellBorderRight;
26
- /**
27
- * If set to `true`, renders the cell value in bold.
28
- */
29
- bold?: boolean;
30
- /**
31
- * The text color of the cell. Supports hex CSS-like values that start with `"#"`. For example, `"#ff00ff"`.
32
- */
33
- color?: string;
34
- /**
35
- * Sets the font that is used to display the cell value.
36
- */
37
- fontFamily?: string;
38
- /**
39
- * Sets the font size in pixels.
40
- */
41
- fontSize?: number;
42
- /**
43
- * Sets the format that Excel uses to display the cell value. For more information, refer to the page on [supported Excel formats](https://support.office.com/en-us/article/Create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4).
44
- */
45
- format?: string;
46
- /**
47
- * If set to `true`, renders the cell value in italics.
48
- */
49
- italic?: boolean;
50
- /**
51
- * Sets the horizontal alignment of the cell value.
52
- *
53
- * The supported values are:
54
- * * `"left"`
55
- * * `"center"`
56
- * * `"right"`
57
- */
58
- textAlign?: 'left' | 'center' | 'right';
59
- /**
60
- * If set to `true`, underlines the cell value.
61
- */
62
- underline?: boolean;
63
- /**
64
- * If set to `true`, wraps the cell value.
65
- */
66
- wrap?: boolean;
67
- /**
68
- * Sets the vertical alignment of the cell value.
69
- *
70
- * The supported values are:
71
- * * `"top"`
72
- * * `"center"`
73
- * * `"bottom"`
74
- */
75
- verticalAlign?: 'top' | 'center' | 'bottom';
76
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- // tslint:enable:max-line-length
@@ -1,103 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.ExporterColumn = exports.toExporterColumns = void 0;
15
- var React = require("react");
16
- var ReactDOMServer = require("react-dom/server");
17
- /* tslint:disable align */
18
- /* tslint:disable:no-use-before-declare */
19
- var compileTemplate = function (Template, context, updateContext) {
20
- var result = function (data) {
21
- updateContext(context, data);
22
- var templateResult = ReactDOMServer.renderToStaticMarkup(React.createElement(Template, __assign({}, context)));
23
- var parsed = Number(templateResult);
24
- return isNaN(parsed)
25
- ? templateResult
26
- : parsed;
27
- };
28
- return result;
29
- };
30
- var updateGroupHeaderContext = function (context, data) {
31
- context.$implicit = context.group = data;
32
- context.field = data.field;
33
- context.value = data.value;
34
- context.aggregates = data.aggregates;
35
- };
36
- var updateGroupFooterContext = function (context, data) {
37
- context.group = data.group;
38
- context.$implicit = context.aggregates = data;
39
- };
40
- // eslint-disable-next-line @typescript-eslint/no-empty-function
41
- var updateFooterContext = function (_context, _data) { };
42
- /**
43
- * @hidden
44
- */
45
- var toExporterColumns = function (sourceColumns) {
46
- var exporterColumns = [];
47
- var columnIndex = 0;
48
- var addColumns = function (columns, result, level) {
49
- columns.forEach(function (column) {
50
- if (column.level === level) {
51
- var exporterColumn = new ExporterColumn(column, columnIndex);
52
- result.push(exporterColumn);
53
- if (column.children && column.children.length > 1) {
54
- var children = exporterColumn.columns = [];
55
- addColumns(column.children, children, level + 1);
56
- }
57
- else {
58
- columnIndex++;
59
- }
60
- }
61
- });
62
- };
63
- addColumns(sourceColumns, exporterColumns, 0);
64
- return exporterColumns;
65
- };
66
- exports.toExporterColumns = toExporterColumns;
67
- /**
68
- * @hidden
69
- */
70
- var ExporterColumn = /** @class */ (function () {
71
- function ExporterColumn(column, columnIndex) {
72
- this.columns = null;
73
- this.title = column.title;
74
- this.field = column.field;
75
- this.hidden = column.hidden;
76
- this.locked = column.locked;
77
- this.width = column.width;
78
- this.headerCellOptions = column.headerCellOptions;
79
- this.cellOptions = column.cellOptions;
80
- this.groupHeaderCellOptions = column.groupHeaderCellOptions;
81
- this.groupFooterCellOptions = column.groupFooterCellOptions;
82
- this.footerCellOptions = column.footerCellOptions;
83
- if (column.footer) {
84
- this.footerTemplate = compileTemplate(column.footer, {
85
- $implicit: column,
86
- column: column,
87
- columnIndex: columnIndex
88
- }, updateFooterContext);
89
- }
90
- if (column.groupFooter) {
91
- this.groupFooterTemplate = compileTemplate(column.groupFooter, {
92
- column: column,
93
- field: column.field
94
- }, updateGroupFooterContext);
95
- }
96
- if (column.groupHeader) {
97
- this.groupHeaderTemplate =
98
- compileTemplate(column.groupHeader, {}, updateGroupHeaderContext);
99
- }
100
- }
101
- return ExporterColumn;
102
- }());
103
- exports.ExporterColumn = ExporterColumn;
@@ -1,14 +0,0 @@
1
- import { WorkbookOptions } from '@progress/kendo-ooxml';
2
- import { ExcelExportProps } from '../ExcelExport';
3
- /**
4
- * @hidden
5
- */
6
- export declare const workbookOptions: (options: ExcelExportProps) => WorkbookOptions;
7
- /**
8
- * @hidden
9
- */
10
- export declare const toDataURL: (options: WorkbookOptions) => Promise<string>;
11
- /**
12
- * @hidden
13
- */
14
- export declare const isWorkbookOptions: (value: any) => boolean;
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isWorkbookOptions = exports.toDataURL = exports.workbookOptions = void 0;
4
- var kendo_ooxml_1 = require("@progress/kendo-ooxml");
5
- var ExporterColumns_1 = require("./ExporterColumns");
6
- var getDepth = function (data) {
7
- return Math.max.apply(Math, data.map(function (i) { return i.level; })) + 1;
8
- };
9
- /**
10
- * @hidden
11
- */
12
- var workbookOptions = function (options) {
13
- var columns = (0, ExporterColumns_1.toExporterColumns)(options.columns);
14
- var exporter = new kendo_ooxml_1.ExcelExporter({
15
- columns: columns,
16
- data: options.data,
17
- filterable: options.filterable,
18
- groups: options.group,
19
- paddingCellOptions: options.paddingCellOptions,
20
- headerPaddingCellOptions: options.headerPaddingCellOptions,
21
- hierarchy: options.hierarchy ? { depth: getDepth(options.data), itemLevel: function (item) { return item.level; } } : null,
22
- collapsible: options.collapsible
23
- });
24
- var result = exporter.workbook();
25
- result.creator = options.creator;
26
- result.date = options.date;
27
- result.rtl = options.dir === 'rtl';
28
- return result;
29
- };
30
- exports.workbookOptions = workbookOptions;
31
- /**
32
- * @hidden
33
- */
34
- var toDataURL = function (options) {
35
- var workbook = new kendo_ooxml_1.Workbook(options);
36
- return workbook.toDataURL();
37
- };
38
- exports.toDataURL = toDataURL;
39
- /**
40
- * @hidden
41
- */
42
- var isWorkbookOptions = function (value) {
43
- return value && value.sheets;
44
- };
45
- exports.isWorkbookOptions = isWorkbookOptions;
@@ -1,5 +0,0 @@
1
- import { PackageMetadata } from '@progress/kendo-licensing';
2
- /**
3
- * @hidden
4
- */
5
- export declare const packageMetadata: PackageMetadata;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.packageMetadata = void 0;
4
- /**
5
- * @hidden
6
- */
7
- exports.packageMetadata = {
8
- name: '@progress/kendo-react-excel-export',
9
- productName: 'KendoReact',
10
- productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
11
- publishDate: 1700064415,
12
- version: '',
13
- licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
14
- };
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ExcelExportFooter = void 0;
19
- var React = require("react");
20
- /**
21
- * Represents the footer of column.
22
- */
23
- var ExcelExportFooter = /** @class */ (function (_super) {
24
- __extends(ExcelExportFooter, _super);
25
- function ExcelExportFooter() {
26
- return _super !== null && _super.apply(this, arguments) || this;
27
- }
28
- return ExcelExportFooter;
29
- }(React.PureComponent));
30
- exports.ExcelExportFooter = ExcelExportFooter;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- var __extends = (this && this.__extends) || (function () {
3
- var extendStatics = function (d, b) {
4
- extendStatics = Object.setPrototypeOf ||
5
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
- return extendStatics(d, b);
8
- };
9
- return function (d, b) {
10
- if (typeof b !== "function" && b !== null)
11
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
- extendStatics(d, b);
13
- function __() { this.constructor = d; }
14
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
- };
16
- })();
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.ExcelExportGroupFooter = void 0;
19
- var React = require("react");
20
- /**
21
- * Represents the footer of the column group.
22
- */
23
- var ExcelExportGroupFooter = /** @class */ (function (_super) {
24
- __extends(ExcelExportGroupFooter, _super);
25
- function ExcelExportGroupFooter() {
26
- return _super !== null && _super.apply(this, arguments) || this;
27
- }
28
- return ExcelExportGroupFooter;
29
- }(React.PureComponent));
30
- exports.ExcelExportGroupFooter = ExcelExportGroupFooter;