excellentexport 3.8.0 → 3.8.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/.github/workflows/webpack.yml +1 -1
- package/README.md +7 -0
- package/dist/excellentexport.d.ts +5 -0
- package/dist/excellentexport.js +1 -1
- package/dist/excellentexport.js.LICENSE.txt +2 -2
- package/index.bigtable.html +19 -44
- package/package.json +24 -24
- package/src/excellentexport.ts +9 -2
- package/tsconfig.json +17 -17
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
2
2
|
|
|
3
|
-
/*!
|
|
3
|
+
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
package/index.bigtable.html
CHANGED
|
@@ -2,63 +2,38 @@
|
|
|
2
2
|
<head>
|
|
3
3
|
<meta charset="utf-8">
|
|
4
4
|
<title>Export to excel test</title>
|
|
5
|
-
<script src="excellentexport.js"></script>
|
|
5
|
+
<script src="dist/excellentexport.js"></script>
|
|
6
6
|
<style>
|
|
7
7
|
table, tr, td {
|
|
8
8
|
border: 1px black solid;
|
|
9
9
|
}
|
|
10
10
|
</style>
|
|
11
|
+
<script>
|
|
12
|
+
function action(format) {
|
|
13
|
+
return ExcellentExport.convert({
|
|
14
|
+
anchor: 'bigdata-' + format,
|
|
15
|
+
filename: 'big_table.' + format,
|
|
16
|
+
format: format
|
|
17
|
+
}, [{
|
|
18
|
+
name: 'Big Table',
|
|
19
|
+
from: {
|
|
20
|
+
table: 'bigtable'
|
|
21
|
+
}
|
|
22
|
+
}]);
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
11
25
|
</head>
|
|
12
26
|
<body>
|
|
13
27
|
<h1>ExcellentExport.js</h1>
|
|
14
28
|
|
|
15
29
|
Check on <a href="http://jordiburgos.com">jordiburgos.com</a> and <a href="https://github.com/jmaister/excellentexport">GitHub</a>.
|
|
16
30
|
|
|
17
|
-
<h3>Test page</h3>
|
|
18
|
-
|
|
19
|
-
<br/>
|
|
20
|
-
|
|
21
|
-
<a download="somedata.xls" href="#" onclick="return ExcellentExport.excel(this, 'datatable', 'Sheet Name Here');">Export to Excel</a>
|
|
22
|
-
<br/>
|
|
23
|
-
|
|
24
|
-
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable');">Export to CSV - UTF8</a>
|
|
25
|
-
<br/>
|
|
26
|
-
<a download="somedata.csv" href="#" onclick="return ExcellentExport.csv(this, 'datatable', ';');">Export to CSV - Using semicolon ";" separator - UTF8</a>
|
|
27
|
-
<br/>
|
|
31
|
+
<h3>Big Table Test page</h3>
|
|
28
32
|
|
|
29
|
-
<table id="datatable">
|
|
30
|
-
<tr>
|
|
31
|
-
<th>Column 1</th>
|
|
32
|
-
<th>Column "cool" 2</th>
|
|
33
|
-
<th>Column 3</th>
|
|
34
|
-
<th>Column 4</th>
|
|
35
|
-
</tr>
|
|
36
|
-
<tr>
|
|
37
|
-
<td>100,111</td>
|
|
38
|
-
<td>200</td>
|
|
39
|
-
<td>300</td>
|
|
40
|
-
<td>áéíóú</td>
|
|
41
|
-
</tr>
|
|
42
|
-
<tr>
|
|
43
|
-
<td>400</td>
|
|
44
|
-
<td>500</td>
|
|
45
|
-
<td>Chinese chars: 解决导出csv中文乱码问题</td>
|
|
46
|
-
<td>àèìòù</td>
|
|
47
|
-
</tr>
|
|
48
|
-
<tr>
|
|
49
|
-
<td>Text</td>
|
|
50
|
-
<td>More text</td>
|
|
51
|
-
<td>Text with
|
|
52
|
-
new line</td>
|
|
53
|
-
<td>ç ñ ÄËÏÖÜ äëïöü</td>
|
|
54
|
-
</tr>
|
|
55
|
-
</table>
|
|
56
33
|
|
|
57
|
-
|
|
58
|
-
<br/>
|
|
59
|
-
<
|
|
60
|
-
<a download="bigdata.xls" href="#" onclick="return ExcellentExport.excel(this, 'bigtable', 'Big Data Sheet');">Export to Excel very big table</a><br/>
|
|
61
|
-
<a download="bigdata.csv" href="#" onclick="return ExcellentExport.csv(this, 'bigtable');">Export to CSV very big table</a>
|
|
34
|
+
<a id="bigdata-xlsx" download="bigdata.xlsx" href="#" onclick="return action('xlsx')">Export to XLSX very big table</a><br/>
|
|
35
|
+
<a id="bigdata-xls" download="bigdata.xls" href="#" onclick="return action('xls')">Export to XLS very big table</a><br/>
|
|
36
|
+
<a id="bigdata-csv" download="bigdata.csv" href="#" onclick="return action('csv')">Export to CSV very big table</a>
|
|
62
37
|
<table id="bigtable">
|
|
63
38
|
<br/>
|
|
64
39
|
</table>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "excellentexport",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "Client side JavaScript export to Excel or CSV",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "http://jordiburgos.com",
|
|
@@ -27,32 +27,32 @@
|
|
|
27
27
|
},
|
|
28
28
|
"main": "dist/excellentexport.js",
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@babel/core": "7.
|
|
31
|
-
"@babel/plugin-proposal-class-properties": "7.
|
|
32
|
-
"@babel/plugin-transform-flow-strip-types": "7.
|
|
33
|
-
"@babel/preset-env": "7.
|
|
34
|
-
"@types/jest": "
|
|
35
|
-
"@types/jest-environment-puppeteer": "5.0.
|
|
36
|
-
"@types/node": "
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"blob-polyfill": "6.0.20211015",
|
|
30
|
+
"@babel/core": "7.20.12",
|
|
31
|
+
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
32
|
+
"@babel/plugin-transform-flow-strip-types": "7.19.0",
|
|
33
|
+
"@babel/preset-env": "7.20.2",
|
|
34
|
+
"@types/jest": "29.4.0",
|
|
35
|
+
"@types/jest-environment-puppeteer": "5.0.3",
|
|
36
|
+
"@types/node": "18.13.0",
|
|
37
|
+
"babel-loader": "9.1.2",
|
|
38
|
+
"blob-polyfill": "7.0.20220408",
|
|
40
39
|
"coveralls": "3.1.1",
|
|
41
40
|
"cross-env": "7.0.3",
|
|
42
|
-
"html-loader": "
|
|
43
|
-
"jest": "
|
|
44
|
-
"jest-
|
|
45
|
-
"puppeteer": "
|
|
46
|
-
"
|
|
47
|
-
"ts-
|
|
48
|
-
"ts-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"webpack
|
|
53
|
-
"webpack-
|
|
41
|
+
"html-loader": "4.2.0",
|
|
42
|
+
"jest": "29.4.2",
|
|
43
|
+
"jest-environment-jsdom": "^29.4.2",
|
|
44
|
+
"jest-puppeteer": "7.0.0",
|
|
45
|
+
"puppeteer": "19.6.3",
|
|
46
|
+
"ts-jest": "29.0.5",
|
|
47
|
+
"ts-loader": "9.4.2",
|
|
48
|
+
"ts-node": "10.9.1",
|
|
49
|
+
"typescript": "4.9.5",
|
|
50
|
+
"webdriverio": "8.3.5",
|
|
51
|
+
"webpack": "5.75.0",
|
|
52
|
+
"webpack-cli": "5.0.1",
|
|
53
|
+
"webpack-dev-server": "4.11.1",
|
|
54
54
|
"webpack-node-externals": "3.0.0",
|
|
55
|
-
"xlsx": "0.
|
|
55
|
+
"xlsx": "0.18.5"
|
|
56
56
|
},
|
|
57
57
|
"resolutions": {
|
|
58
58
|
"json-schema": "0.4.0"
|
package/src/excellentexport.ts
CHANGED
|
@@ -11,6 +11,13 @@ import * as XLSX from 'xlsx';
|
|
|
11
11
|
|
|
12
12
|
import * as utils from './utils';
|
|
13
13
|
|
|
14
|
+
// Fix for IE11: https://stackoverflow.com/questions/69485778/new-typescript-version-does-not-include-window-navigator-mssaveblob
|
|
15
|
+
declare global {
|
|
16
|
+
interface Navigator {
|
|
17
|
+
msSaveBlob?: (blob: any, defaultName?: string) => boolean
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
14
21
|
export interface ConvertOptions {
|
|
15
22
|
anchor?: (string|HTMLAnchorElement),
|
|
16
23
|
openAsDownload?: boolean,
|
|
@@ -35,7 +42,7 @@ export interface SheetOptions {
|
|
|
35
42
|
|
|
36
43
|
const ExcellentExport = function() {
|
|
37
44
|
|
|
38
|
-
const version = "3.8.
|
|
45
|
+
const version = "3.8.1";
|
|
39
46
|
|
|
40
47
|
/*
|
|
41
48
|
ExcellentExport.convert(options, sheets);
|
|
@@ -135,7 +142,7 @@ const ExcellentExport = function() {
|
|
|
135
142
|
workbook.Views.push({RTL: options.rtl || sheetConf.rtl || false});
|
|
136
143
|
});
|
|
137
144
|
|
|
138
|
-
const wbOut:string = XLSX.write(workbook, {bookType: options.format, bookSST:true, type: 'binary'});
|
|
145
|
+
const wbOut:string = XLSX.write(workbook, {bookType: options.format, bookSST:true, type: 'binary', compression: true});
|
|
139
146
|
try {
|
|
140
147
|
const blob = new Blob([utils.string2ArrayBuffer(wbOut)], { type: "application/octet-stream" });
|
|
141
148
|
const filename = (options.filename || 'download') + '.' + options.format;
|
package/tsconfig.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
|
-
"allowJs": true,
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"sourceMap": true,
|
|
7
|
-
"removeComments": false,
|
|
8
|
-
"declaration": true,
|
|
9
|
-
"rootDir": "src",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"esModuleInterop": true
|
|
12
|
-
},
|
|
13
|
-
"include": [
|
|
14
|
-
"src/**/*.ts",
|
|
15
|
-
"test/**/*.{ts,js}"
|
|
16
|
-
]
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"allowJs": true,
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"sourceMap": true,
|
|
7
|
+
"removeComments": false,
|
|
8
|
+
"declaration": true,
|
|
9
|
+
"rootDir": "src",
|
|
10
|
+
"moduleResolution": "node",
|
|
11
|
+
"esModuleInterop": true
|
|
12
|
+
},
|
|
13
|
+
"include": [
|
|
14
|
+
"src/**/*.ts",
|
|
15
|
+
"test/**/*.{ts,js}"
|
|
16
|
+
]
|
|
17
|
+
}
|