@progress/kendo-vue-excel-export 3.5.0-dev.202208020811 → 3.5.1-dev.202208110751
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/dist/cdn/js/kendo-vue-excel-export.js +1 -1
- package/dist/es/ColumnBase.js +1 -0
- package/dist/es/ExcelExportColumnOptions.js +1 -0
- package/dist/es/ExcelExportOptions.js +1 -0
- package/dist/es/ooxml/CellOptionsInterface.js +1 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/esm/ColumnBase.d.ts +38 -0
- package/dist/esm/ColumnBase.js +1 -0
- package/dist/esm/ExcelExportColumnOptions.d.ts +39 -0
- package/dist/esm/ExcelExportColumnOptions.js +1 -0
- package/dist/esm/ExcelExportOptions.d.ts +77 -0
- package/dist/esm/ExcelExportOptions.js +1 -0
- package/dist/esm/main.d.ts +6 -0
- package/dist/esm/main.js +6 -0
- package/dist/esm/ooxml/CellOptionsInterface.d.ts +78 -0
- package/dist/esm/ooxml/CellOptionsInterface.js +1 -0
- package/dist/esm/ooxml/ExporterColumns.d.ts +26 -0
- package/dist/esm/ooxml/ExporterColumns.js +116 -0
- package/dist/esm/ooxml/workbook.d.ts +14 -0
- package/dist/esm/ooxml/workbook.js +34 -0
- package/dist/esm/package-metadata.d.ts +5 -0
- package/dist/esm/package-metadata.js +11 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/saveExcel.d.ts +5 -0
- package/dist/esm/saveExcel.js +16 -0
- package/dist/npm/main.js +6 -2
- package/dist/npm/ooxml/ExporterColumns.js +3 -2
- package/dist/npm/ooxml/workbook.js +7 -4
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/saveExcel.js +3 -3
- package/package.json +8 -2
package/dist/es/ColumnBase.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-vue-excel-export',
|
|
6
6
|
productName: 'Kendo UI for Vue',
|
|
7
7
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1660203701,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
11
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CellOptions } from './ooxml/CellOptionsInterface';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
*/
|
|
5
|
+
export interface ColumnBase {
|
|
6
|
+
/**
|
|
7
|
+
* @hidden
|
|
8
|
+
*/
|
|
9
|
+
children?: any;
|
|
10
|
+
/**
|
|
11
|
+
* The options of the column header cell.
|
|
12
|
+
*/
|
|
13
|
+
headerCellOptions?: CellOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Sets the visibility of the column.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* @hidden
|
|
22
|
+
*/
|
|
23
|
+
level?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Toggles the locked (frozen) state of the column.
|
|
26
|
+
*
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
locked?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The title of the column.
|
|
32
|
+
*/
|
|
33
|
+
title?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The width of the column in pixels.
|
|
36
|
+
*/
|
|
37
|
+
width?: number | string;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ColumnBase } from './ColumnBase';
|
|
2
|
+
import { CellOptions } from './ooxml/CellOptionsInterface';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the props of the KendoVue ExcelExportColumnProps component.
|
|
5
|
+
*/
|
|
6
|
+
export interface ExcelExportColumnOptions extends ColumnBase {
|
|
7
|
+
/**
|
|
8
|
+
* The options of the column data cells.
|
|
9
|
+
*/
|
|
10
|
+
cellOptions?: CellOptions;
|
|
11
|
+
/**
|
|
12
|
+
* The field to which the column is bound.
|
|
13
|
+
*/
|
|
14
|
+
field?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The options of the column footer cell.
|
|
17
|
+
*/
|
|
18
|
+
footerCellOptions?: CellOptions;
|
|
19
|
+
/**
|
|
20
|
+
* The column footer. Can be a function or a Vue component.
|
|
21
|
+
*/
|
|
22
|
+
footer?: Function;
|
|
23
|
+
/**
|
|
24
|
+
* The options of the column group footer cells.
|
|
25
|
+
*/
|
|
26
|
+
groupFooterCellOptions?: CellOptions;
|
|
27
|
+
/**
|
|
28
|
+
* The footer of the group. Can be a function or a Vue component.
|
|
29
|
+
*/
|
|
30
|
+
groupFooter?: Function;
|
|
31
|
+
/**
|
|
32
|
+
* The options of the column group header cells.
|
|
33
|
+
*/
|
|
34
|
+
groupHeaderCellOptions?: CellOptions;
|
|
35
|
+
/**
|
|
36
|
+
* The header of the group. Can be a function or a Vue component.
|
|
37
|
+
*/
|
|
38
|
+
groupHeader?: Function;
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ExcelExportColumnOptions } from './ExcelExportColumnOptions';
|
|
2
|
+
import { CellOptions } from './ooxml/CellOptionsInterface';
|
|
3
|
+
import { GroupDescriptor } from '@progress/kendo-data-query';
|
|
4
|
+
/**
|
|
5
|
+
* Represents the props of the KendoVue ExcelExport component.
|
|
6
|
+
*/
|
|
7
|
+
export interface ExcelExportOptions {
|
|
8
|
+
/**
|
|
9
|
+
* You can pass the columns through the props of the component.
|
|
10
|
+
* If both the columns prop and the child column components are presented,
|
|
11
|
+
* the columns from props will be used.
|
|
12
|
+
*/
|
|
13
|
+
columns?: ExcelExportColumnOptions[] | any[];
|
|
14
|
+
/**
|
|
15
|
+
* The creator of the workbook.
|
|
16
|
+
*/
|
|
17
|
+
creator?: string;
|
|
18
|
+
/**
|
|
19
|
+
* The exported data.
|
|
20
|
+
* If grouped, the data must be structured as described by the
|
|
21
|
+
* [`GroupResult`]({% slug api_kendo-data-query_groupresult %}) option of the Kendo UI Data Query component.
|
|
22
|
+
*/
|
|
23
|
+
data?: any[];
|
|
24
|
+
/**
|
|
25
|
+
* The date on which the workbook is created.
|
|
26
|
+
* The default value is `new Date()`.
|
|
27
|
+
*/
|
|
28
|
+
date?: Date;
|
|
29
|
+
/**
|
|
30
|
+
* Enables or disables the column filtering in the Excel file.
|
|
31
|
+
*/
|
|
32
|
+
filterable?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Specifies the name of the file that is exported to Excel.
|
|
35
|
+
* @default "Export.xlsx"
|
|
36
|
+
*/
|
|
37
|
+
fileName?: string;
|
|
38
|
+
/**
|
|
39
|
+
* If set to `true`, the content is forwarded to `proxyURL`
|
|
40
|
+
* even if the browser supports the saving of files locally.
|
|
41
|
+
*/
|
|
42
|
+
forceProxy?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* The exported data groups.
|
|
45
|
+
* The groups must be compatible with the
|
|
46
|
+
* [`GroupDescriptor`]({% slug api_kendo-data-query_groupdescriptor %}) option of the
|
|
47
|
+
* Kendo UI Data Query component.
|
|
48
|
+
*/
|
|
49
|
+
group?: GroupDescriptor[];
|
|
50
|
+
/**
|
|
51
|
+
* The options of the cells that are inserted before the header cells
|
|
52
|
+
* to align the headers and the column values (when the data is grouped).
|
|
53
|
+
*/
|
|
54
|
+
headerPaddingCellOptions?: CellOptions;
|
|
55
|
+
/**
|
|
56
|
+
* The options of the cells that are inserted before the data, group, and footer cells
|
|
57
|
+
* to indicate the group hierarchy (when the data is grouped).
|
|
58
|
+
*/
|
|
59
|
+
paddingCellOptions?: CellOptions;
|
|
60
|
+
/**
|
|
61
|
+
* The URL of the server-side proxy which will stream the file to the end user.
|
|
62
|
+
* When the browser is not capable of saving files locally—for example,
|
|
63
|
+
* Internet Explorer 9 and earlier, and Safari—a proxy is used.
|
|
64
|
+
* The implementation of the server-side proxy has to be done by you.
|
|
65
|
+
* The proxy receives a POST request with the following parameters in the request body:
|
|
66
|
+
* - `contentType`—The MIME type of the file.
|
|
67
|
+
* - `base64`—The base-64 encoded file content.
|
|
68
|
+
* - `fileName`—The file name, as requested by the caller.
|
|
69
|
+
* The proxy is expected to return the decoded file with the **Content-Disposition**
|
|
70
|
+
* header set to `attachment; filename="<fileName.xslx>"`.
|
|
71
|
+
*/
|
|
72
|
+
proxyURL?: string;
|
|
73
|
+
/**
|
|
74
|
+
* If set to `rtl`, the Excel file will be rendered in the right-to-left mode.
|
|
75
|
+
*/
|
|
76
|
+
dir?: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/main.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
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.
|
|
8
|
+
* Supports hex CSS-like values that start with `"#"`. For example, `"#ff00ff"`.
|
|
9
|
+
*/
|
|
10
|
+
background?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The style information for the bottom border of the cell.
|
|
13
|
+
*/
|
|
14
|
+
borderBottom?: WorkbookSheetRowCellBorderBottom;
|
|
15
|
+
/**
|
|
16
|
+
* The style information for the left border of the cell.
|
|
17
|
+
*/
|
|
18
|
+
borderLeft?: WorkbookSheetRowCellBorderLeft;
|
|
19
|
+
/**
|
|
20
|
+
* The style information for the top border of the cell.
|
|
21
|
+
*/
|
|
22
|
+
borderTop?: WorkbookSheetRowCellBorderTop;
|
|
23
|
+
/**
|
|
24
|
+
* The style information for the right border of the cell.
|
|
25
|
+
*/
|
|
26
|
+
borderRight?: WorkbookSheetRowCellBorderRight;
|
|
27
|
+
/**
|
|
28
|
+
* If set to `true`, renders the cell value in bold.
|
|
29
|
+
*/
|
|
30
|
+
bold?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The text color of the cell.
|
|
33
|
+
* Supports hex CSS-like values that start with `"#"`. For example, `"#ff00ff"`.
|
|
34
|
+
*/
|
|
35
|
+
color?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Sets the font that is used to display the cell value.
|
|
38
|
+
*/
|
|
39
|
+
fontFamily?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the font size in pixels.
|
|
42
|
+
*/
|
|
43
|
+
fontSize?: number;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the format that Excel uses to display the cell value.
|
|
46
|
+
* For more information, refer to the page on
|
|
47
|
+
* [supported Excel formats](https://support.office.com/en-us/article/Create-or-delete-a-custom-number-format-78f2a361-936b-4c03-8772-09fab54be7f4).
|
|
48
|
+
*/
|
|
49
|
+
format?: string;
|
|
50
|
+
/**
|
|
51
|
+
* If set to `true`, renders the cell value in italics.
|
|
52
|
+
*/
|
|
53
|
+
italic?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the horizontal alignment of the cell value.
|
|
56
|
+
* The supported values are:
|
|
57
|
+
* * `"left"`
|
|
58
|
+
* * `"center"`
|
|
59
|
+
* * `"right"`
|
|
60
|
+
*/
|
|
61
|
+
textAlign?: 'left' | 'center' | 'right';
|
|
62
|
+
/**
|
|
63
|
+
* If set to `true`, underlines the cell value.
|
|
64
|
+
*/
|
|
65
|
+
underline?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* If set to `true`, wraps the cell value.
|
|
68
|
+
*/
|
|
69
|
+
wrap?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Sets the vertical alignment of the cell value.
|
|
72
|
+
* The supported values are:
|
|
73
|
+
* * `"top"`
|
|
74
|
+
* * `"center"`
|
|
75
|
+
* * `"bottom"`
|
|
76
|
+
*/
|
|
77
|
+
verticalAlign?: 'top' | 'center' | 'bottom';
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CellOptions } from './CellOptionsInterface';
|
|
2
|
+
import { ExcelExportColumnOptions } from '../ExcelExportColumnOptions';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export declare const toExporterColumns: (sourceColumns?: ExcelExportColumnOptions[]) => ExporterColumn[];
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
*/
|
|
10
|
+
export declare class ExporterColumn {
|
|
11
|
+
title?: string;
|
|
12
|
+
field?: string;
|
|
13
|
+
hidden?: boolean;
|
|
14
|
+
locked?: boolean;
|
|
15
|
+
width?: number | string;
|
|
16
|
+
columns: ExporterColumn[];
|
|
17
|
+
groupHeaderTemplate: any;
|
|
18
|
+
groupFooterTemplate: any;
|
|
19
|
+
footerTemplate: any;
|
|
20
|
+
headerCellOptions?: CellOptions;
|
|
21
|
+
cellOptions?: CellOptions;
|
|
22
|
+
groupHeaderCellOptions?: CellOptions;
|
|
23
|
+
groupFooterCellOptions?: CellOptions;
|
|
24
|
+
footerCellOptions?: CellOptions;
|
|
25
|
+
constructor(column: ExcelExportColumnOptions, columnIndex?: number);
|
|
26
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
var __assign = this && this.__assign || function () {
|
|
2
|
+
__assign = Object.assign || function (t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
|
|
6
|
+
for (var p in s) {
|
|
7
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
return __assign.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
/* tslint:disable align */
|
|
17
|
+
|
|
18
|
+
/* tslint:disable:no-use-before-declare */
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var compileTemplate = function compileTemplate(templateFunction, context, updateContext) {
|
|
22
|
+
var result = function result(data) {
|
|
23
|
+
updateContext(context, data);
|
|
24
|
+
var templateResult = templateFunction(__assign({}, context));
|
|
25
|
+
var parsed = Number(templateResult);
|
|
26
|
+
return isNaN(parsed) ? templateResult : parsed;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
var updateGroupHeaderContext = function updateGroupHeaderContext(context, data) {
|
|
33
|
+
context.$implicit = context.group = data;
|
|
34
|
+
context.field = data.field;
|
|
35
|
+
context.value = data.value;
|
|
36
|
+
context.aggregates = data.aggregates;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var updateGroupFooterContext = function updateGroupFooterContext(context, data) {
|
|
40
|
+
context.group = data.group;
|
|
41
|
+
context.$implicit = context.aggregates = data;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
var updateFooterContext = function updateFooterContext(_context, _data) {};
|
|
45
|
+
/* tslint:disable-line no-empty */
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
export var toExporterColumns = function toExporterColumns(sourceColumns) {
|
|
53
|
+
var exporterColumns = [];
|
|
54
|
+
var columnIndex = 0;
|
|
55
|
+
|
|
56
|
+
var addColumns = function addColumns(columns, result, level) {
|
|
57
|
+
columns.forEach(function (column) {
|
|
58
|
+
var exporterColumn = new ExporterColumn(column, columnIndex);
|
|
59
|
+
result.push(exporterColumn);
|
|
60
|
+
|
|
61
|
+
if (column.children && column.children.length > 1) {
|
|
62
|
+
var children = exporterColumn.columns = [];
|
|
63
|
+
addColumns(column.children, children, level + 1);
|
|
64
|
+
} else {
|
|
65
|
+
columnIndex++;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
addColumns(sourceColumns, exporterColumns, 0);
|
|
71
|
+
return exporterColumns;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* @hidden
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
var ExporterColumn =
|
|
78
|
+
/** @class */
|
|
79
|
+
function () {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
function ExporterColumn(column, columnIndex) {
|
|
82
|
+
this.title = column.title;
|
|
83
|
+
this.field = column.field;
|
|
84
|
+
this.hidden = column.hidden;
|
|
85
|
+
this.locked = column.locked;
|
|
86
|
+
this.width = column.width;
|
|
87
|
+
this.headerCellOptions = column.headerCellOptions;
|
|
88
|
+
this.cellOptions = column.cellOptions;
|
|
89
|
+
this.groupHeaderCellOptions = column.groupHeaderCellOptions;
|
|
90
|
+
this.groupFooterCellOptions = column.groupFooterCellOptions;
|
|
91
|
+
this.footerCellOptions = column.footerCellOptions;
|
|
92
|
+
|
|
93
|
+
if (column.footer) {
|
|
94
|
+
this.footerTemplate = compileTemplate(column.footer, {
|
|
95
|
+
$implicit: column,
|
|
96
|
+
column: column,
|
|
97
|
+
columnIndex: columnIndex
|
|
98
|
+
}, updateFooterContext);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (column.groupFooter) {
|
|
102
|
+
this.groupFooterTemplate = compileTemplate(column.groupFooter, {
|
|
103
|
+
column: column,
|
|
104
|
+
field: column.field
|
|
105
|
+
}, updateGroupFooterContext);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (column.groupHeader) {
|
|
109
|
+
this.groupHeaderTemplate = compileTemplate(column.groupHeader, {}, updateGroupHeaderContext);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return ExporterColumn;
|
|
114
|
+
}();
|
|
115
|
+
|
|
116
|
+
export { ExporterColumn };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WorkbookOptions } from '@progress/kendo-ooxml';
|
|
2
|
+
import { ExcelExportOptions } from '../ExcelExportOptions';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export declare const workbookOptions: (options: ExcelExportOptions) => 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;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ExcelExporter, Workbook } from '@progress/kendo-ooxml';
|
|
2
|
+
import { toExporterColumns } from './ExporterColumns.js';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export var workbookOptions = function (options) {
|
|
7
|
+
var columns = toExporterColumns(options.columns);
|
|
8
|
+
var exporter = new ExcelExporter({
|
|
9
|
+
columns: columns,
|
|
10
|
+
data: options.data,
|
|
11
|
+
filterable: options.filterable,
|
|
12
|
+
groups: options.group,
|
|
13
|
+
paddingCellOptions: options.paddingCellOptions,
|
|
14
|
+
headerPaddingCellOptions: options.headerPaddingCellOptions
|
|
15
|
+
});
|
|
16
|
+
var result = exporter.workbook();
|
|
17
|
+
result.creator = options.creator;
|
|
18
|
+
result.date = options.date;
|
|
19
|
+
result.rtl = options.dir === 'rtl';
|
|
20
|
+
return result;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
*/
|
|
25
|
+
export var toDataURL = function (options) {
|
|
26
|
+
var workbook = new Workbook(options);
|
|
27
|
+
return workbook.toDataURL();
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* @hidden
|
|
31
|
+
*/
|
|
32
|
+
export var isWorkbookOptions = function (value) {
|
|
33
|
+
return value && value.sheets;
|
|
34
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @hidden
|
|
3
|
+
*/
|
|
4
|
+
export var packageMetadata = {
|
|
5
|
+
name: '@progress/kendo-vue-excel-export',
|
|
6
|
+
productName: 'Kendo UI for Vue',
|
|
7
|
+
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
8
|
+
publishDate: 1660203701,
|
|
9
|
+
version: '',
|
|
10
|
+
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
11
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { workbookOptions, toDataURL } from './ooxml/workbook.js';
|
|
2
|
+
import { saveAs } from '@progress/kendo-file-saver';
|
|
3
|
+
/**
|
|
4
|
+
* @hidden
|
|
5
|
+
*/
|
|
6
|
+
export default function saveExcel(exportOptions) {
|
|
7
|
+
// validatePackage(packageMetadata);
|
|
8
|
+
var saveFn = function (dataURL) {
|
|
9
|
+
saveAs(dataURL, exportOptions.fileName, {
|
|
10
|
+
forceProxy: exportOptions.forceProxy,
|
|
11
|
+
proxyURL: exportOptions.proxyURL
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var options = workbookOptions(exportOptions);
|
|
15
|
+
toDataURL(options).then(saveFn);
|
|
16
|
+
}
|
package/dist/npm/main.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
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);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
exports.saveExcel = void 0;
|
|
@@ -55,7 +55,7 @@ var updateFooterContext = function updateFooterContext(_context, _data) {};
|
|
|
55
55
|
*/
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
var toExporterColumns = function toExporterColumns(sourceColumns) {
|
|
59
59
|
var exporterColumns = [];
|
|
60
60
|
var columnIndex = 0;
|
|
61
61
|
|
|
@@ -76,11 +76,12 @@ exports.toExporterColumns = function (sourceColumns) {
|
|
|
76
76
|
addColumns(sourceColumns, exporterColumns, 0);
|
|
77
77
|
return exporterColumns;
|
|
78
78
|
};
|
|
79
|
+
|
|
80
|
+
exports.toExporterColumns = toExporterColumns;
|
|
79
81
|
/**
|
|
80
82
|
* @hidden
|
|
81
83
|
*/
|
|
82
84
|
|
|
83
|
-
|
|
84
85
|
var ExporterColumn =
|
|
85
86
|
/** @class */
|
|
86
87
|
function () {
|
|
@@ -6,8 +6,8 @@ var ExporterColumns_1 = require("./ExporterColumns");
|
|
|
6
6
|
/**
|
|
7
7
|
* @hidden
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
|
-
var columns = ExporterColumns_1.toExporterColumns(options.columns);
|
|
9
|
+
var workbookOptions = function (options) {
|
|
10
|
+
var columns = (0, ExporterColumns_1.toExporterColumns)(options.columns);
|
|
11
11
|
var exporter = new kendo_ooxml_1.ExcelExporter({
|
|
12
12
|
columns: columns,
|
|
13
13
|
data: options.data,
|
|
@@ -22,16 +22,19 @@ exports.workbookOptions = function (options) {
|
|
|
22
22
|
result.rtl = options.dir === 'rtl';
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
+
exports.workbookOptions = workbookOptions;
|
|
25
26
|
/**
|
|
26
27
|
* @hidden
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
var toDataURL = function (options) {
|
|
29
30
|
var workbook = new kendo_ooxml_1.Workbook(options);
|
|
30
31
|
return workbook.toDataURL();
|
|
31
32
|
};
|
|
33
|
+
exports.toDataURL = toDataURL;
|
|
32
34
|
/**
|
|
33
35
|
* @hidden
|
|
34
36
|
*/
|
|
35
|
-
|
|
37
|
+
var isWorkbookOptions = function (value) {
|
|
36
38
|
return value && value.sheets;
|
|
37
39
|
};
|
|
40
|
+
exports.isWorkbookOptions = isWorkbookOptions;
|
|
@@ -8,7 +8,7 @@ exports.packageMetadata = {
|
|
|
8
8
|
name: '@progress/kendo-vue-excel-export',
|
|
9
9
|
productName: 'Kendo UI for Vue',
|
|
10
10
|
productCodes: ['KENDOUIVUE', 'KENDOUICOMPLETE'],
|
|
11
|
-
publishDate:
|
|
11
|
+
publishDate: 1660203701,
|
|
12
12
|
version: '',
|
|
13
13
|
licensingDocsUrl: 'https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=kendovue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning'
|
|
14
14
|
};
|
package/dist/npm/saveExcel.js
CHANGED
|
@@ -8,12 +8,12 @@ var kendo_file_saver_1 = require("@progress/kendo-file-saver");
|
|
|
8
8
|
function saveExcel(exportOptions) {
|
|
9
9
|
// validatePackage(packageMetadata);
|
|
10
10
|
var saveFn = function (dataURL) {
|
|
11
|
-
kendo_file_saver_1.saveAs(dataURL, exportOptions.fileName, {
|
|
11
|
+
(0, kendo_file_saver_1.saveAs)(dataURL, exportOptions.fileName, {
|
|
12
12
|
forceProxy: exportOptions.forceProxy,
|
|
13
13
|
proxyURL: exportOptions.proxyURL
|
|
14
14
|
});
|
|
15
15
|
};
|
|
16
|
-
var options = workbook_1.workbookOptions(exportOptions);
|
|
17
|
-
workbook_1.toDataURL(options).then(saveFn);
|
|
16
|
+
var options = (0, workbook_1.workbookOptions)(exportOptions);
|
|
17
|
+
(0, workbook_1.toDataURL)(options).then(saveFn);
|
|
18
18
|
}
|
|
19
19
|
exports.default = saveExcel;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-vue-excel-export",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1-dev.202208110751",
|
|
4
4
|
"description": "Kendo UI for Vue Excel Export package",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
"types": "dist/npm/main.d.ts",
|
|
11
11
|
"module": "dist/es/main.js",
|
|
12
12
|
"jsnext:main": "dist/es/main.js",
|
|
13
|
+
"exports": {
|
|
14
|
+
"node": "./dist/esm/main.js",
|
|
15
|
+
"import": "./dist/es/main.js",
|
|
16
|
+
"require": "./dist/npm/main.js",
|
|
17
|
+
"default": "./dist/npm/main.js"
|
|
18
|
+
},
|
|
13
19
|
"scripts": {
|
|
14
20
|
"test": "cd ../../ && npm run test -- --testPathPattern=/packages/excel/.*",
|
|
15
21
|
"start": "gulp start",
|
|
@@ -28,7 +34,7 @@
|
|
|
28
34
|
"dependencies": {
|
|
29
35
|
"@progress/kendo-file-saver": "^1.1.0",
|
|
30
36
|
"@progress/kendo-ooxml": "^1.6.1",
|
|
31
|
-
"@progress/kendo-vue-common": "3.5.
|
|
37
|
+
"@progress/kendo-vue-common": "3.5.1-dev.202208110751"
|
|
32
38
|
},
|
|
33
39
|
"devDependencies": {
|
|
34
40
|
"@progress/kendo-data-query": "^1.5.4",
|