@slickgrid-universal/excel-export 4.7.0 → 5.0.0-beta.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.
package/README.md CHANGED
@@ -1,82 +1,82 @@
1
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
- [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
3
- [![lerna--lite](https://img.shields.io/badge/maintained%20with-lerna--lite-e137ff)](https://github.com/ghiscoding/lerna-lite)
4
- [![npm](https://img.shields.io/npm/v/@slickgrid-universal/excel-export.svg)](https://www.npmjs.com/package/@slickgrid-universal/excel-export)
5
- [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/excel-export)](https://www.npmjs.com/package/@slickgrid-universal/excel-export)
6
-
7
- [![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/CI%20Build/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions)
8
- [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/)
9
- [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
10
- [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal)
11
-
12
- ## Excel Export Service
13
- #### @slickgrid-universal/excel-export
14
-
15
- Simple Export to Excel Service that allows to exporting as `.xls` or `.xlsx`.
16
-
17
- ### Internal Dependencies
18
- - [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common)
19
- - [@slickgrid-universal/utils](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/utils)
20
-
21
- ### External Dependencies
22
- This package requires [excel-builder-vanilla](https://www.npmjs.com/package/excel-builder-vanilla) which itself also has a single dependency [fflate](https://www.npmjs.com/package/fflate) to compress the data before sending it to the browser.
23
-
24
- ### Installation
25
- Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation), you can see a demo by looking at the [GitHub Demo](https://ghiscoding.github.io/slickgrid-universal/#/example02) page and click on "Export to Excel" from the Context Menu or the Grid Menu (aka hamburger menu).
26
-
27
- You can also use nearly all Excel-Builder-Vanilla options, see their [Excel-Builder-Vanilla - Documentation](https://ghiscoding.gitbook.io/excel-builder-vanilla/) and also take a look at Slickgrid-Universal [Excel Export - Documentation](https://ghiscoding.gitbook.io/slickgrid-universal/grid-functionalities/export-to-excel) on how to use both.
28
-
29
- ### Usage
30
- In order to use the Service, you will need to register it in your grid options via the `registerExternalResources` as shown below.
31
-
32
- ##### ViewModel
33
- ```ts
34
- import { ExcelExportService } from '@slickgrid-universal/excel-export';
35
-
36
- export class MyExample {
37
- initializeGrid {
38
- this.gridOptions = {
39
- enableExcelExport: true,
40
- excelExportOptions: {
41
- sanitizeDataExport: true
42
- },
43
- externalResources: [new ExcelExportService()],
44
- }
45
- }
46
- }
47
- ```
48
-
49
- If you wish to reference the service to use it with external export button, then simply create a reference while instantiating it.
50
- ```ts
51
- import { ExcelExportService } from '@slickgrid-universal/excel-export';
52
-
53
- export class MyExample {
54
- excelExportService: ExcelExportService;
55
-
56
- constructor() {
57
- this.excelExportService = new ExcelExportService();
58
- }
59
-
60
- initializeGrid {
61
- this.gridOptions = {
62
- enableExcelExport: true,
63
- excelExportOptions: {
64
- sanitizeDataExport: true
65
- },
66
- externalResources: [this.excelExportService],
67
- }
68
- }
69
-
70
- exportToExcel() {
71
- this.excelExportService.exportToExcel({ filename: 'export', format: FileType.xlsx });
72
- }
73
- }
74
- ```
75
-
76
- ### CSP (Content Security Policy)
77
- Please note that this Excel Export service is using `fflate` (it compresses the data before sending it to the browser) and for better performance it uses Web Workers and for that reason you might need to adjust your CSP rules. You simply need to add a CSP rule to avoid the error `worker-src 'self' blob:;`
78
-
79
- ```html
80
- <meta http-equiv="Content-Security-Policy"
81
- content="default-src 'self'; ...other rules... worker-src 'self' blob:;" />
1
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
+ [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/)
3
+ [![lerna--lite](https://img.shields.io/badge/maintained%20with-lerna--lite-e137ff)](https://github.com/ghiscoding/lerna-lite)
4
+ [![npm](https://img.shields.io/npm/v/@slickgrid-universal/excel-export.svg)](https://www.npmjs.com/package/@slickgrid-universal/excel-export)
5
+ [![npm](https://img.shields.io/npm/dy/@slickgrid-universal/excel-export)](https://www.npmjs.com/package/@slickgrid-universal/excel-export)
6
+
7
+ [![Actions Status](https://github.com/ghiscoding/slickgrid-universal/workflows/CI%20Build/badge.svg)](https://github.com/ghiscoding/slickgrid-universal/actions)
8
+ [![Cypress.io](https://img.shields.io/badge/tested%20with-Cypress-04C38E.svg)](https://www.cypress.io/)
9
+ [![jest](https://jestjs.io/img/jest-badge.svg)](https://github.com/facebook/jest)
10
+ [![codecov](https://codecov.io/gh/ghiscoding/slickgrid-universal/branch/master/graph/badge.svg)](https://codecov.io/gh/ghiscoding/slickgrid-universal)
11
+
12
+ ## Excel Export Service
13
+ #### @slickgrid-universal/excel-export
14
+
15
+ Simple Export to Excel Service that allows to exporting as `.xls` or `.xlsx`.
16
+
17
+ ### Internal Dependencies
18
+ - [@slickgrid-universal/common](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/common)
19
+ - [@slickgrid-universal/utils](https://github.com/ghiscoding/slickgrid-universal/tree/master/packages/utils)
20
+
21
+ ### External Dependencies
22
+ This package requires [excel-builder-vanilla](https://www.npmjs.com/package/excel-builder-vanilla) which itself also has a single dependency [fflate](https://www.npmjs.com/package/fflate) to compress the data before sending it to the browser.
23
+
24
+ ### Installation
25
+ Follow the instruction provided in the main [README](https://github.com/ghiscoding/slickgrid-universal#installation), you can see a demo by looking at the [GitHub Demo](https://ghiscoding.github.io/slickgrid-universal/#/example02) page and click on "Export to Excel" from the Context Menu or the Grid Menu (aka hamburger menu).
26
+
27
+ You can also use nearly all Excel-Builder-Vanilla options, see their [Excel-Builder-Vanilla - Documentation](https://ghiscoding.gitbook.io/excel-builder-vanilla/) and also take a look at Slickgrid-Universal [Excel Export - Documentation](https://ghiscoding.gitbook.io/slickgrid-universal/grid-functionalities/export-to-excel) on how to use both.
28
+
29
+ ### Usage
30
+ In order to use the Service, you will need to register it in your grid options via the `registerExternalResources` as shown below.
31
+
32
+ ##### ViewModel
33
+ ```ts
34
+ import { ExcelExportService } from '@slickgrid-universal/excel-export';
35
+
36
+ export class MyExample {
37
+ initializeGrid {
38
+ this.gridOptions = {
39
+ enableExcelExport: true,
40
+ excelExportOptions: {
41
+ sanitizeDataExport: true
42
+ },
43
+ externalResources: [new ExcelExportService()],
44
+ }
45
+ }
46
+ }
47
+ ```
48
+
49
+ If you wish to reference the service to use it with external export button, then simply create a reference while instantiating it.
50
+ ```ts
51
+ import { ExcelExportService } from '@slickgrid-universal/excel-export';
52
+
53
+ export class MyExample {
54
+ excelExportService: ExcelExportService;
55
+
56
+ constructor() {
57
+ this.excelExportService = new ExcelExportService();
58
+ }
59
+
60
+ initializeGrid {
61
+ this.gridOptions = {
62
+ enableExcelExport: true,
63
+ excelExportOptions: {
64
+ sanitizeDataExport: true
65
+ },
66
+ externalResources: [this.excelExportService],
67
+ }
68
+ }
69
+
70
+ exportToExcel() {
71
+ this.excelExportService.exportToExcel({ filename: 'export', format: FileType.xlsx });
72
+ }
73
+ }
74
+ ```
75
+
76
+ ### CSP (Content Security Policy)
77
+ Please note that this Excel Export service is using `fflate` (it compresses the data before sending it to the browser) and for better performance it uses Web Workers and for that reason you might need to adjust your CSP rules. You simply need to add a CSP rule to avoid the error `worker-src 'self' blob:;`
78
+
79
+ ```html
80
+ <meta http-equiv="Content-Security-Policy"
81
+ content="default-src 'self'; ...other rules... worker-src 'self' blob:;" />
82
82
  ```